Files
cozystack/packages/system/monitoring/Makefile
Alexey Artamonov 474377e8ca build(monitoring): build the traces collector with a rate limiter
A shared-central traces store needs each tenant held to a write rate,
or one tenant can fill the disk every tenant shares. No upstream
OpenTelemetry distribution or processor limits throughput. Elastic's
EDOT Collector registers Elastic's ratelimitprocessor among its default
components, but it ships under the Elastic License 2.0 and carries far
more components than the chart uses.

The collector is therefore built here with the OpenTelemetry Collector
Builder from the upstream components the chart already uses, at the
same v0.136.0, plus that ratelimitprocessor (Apache-2.0). Its v0.8.2
is the release built against v0.135.0, the last before v0.137.0. The
image is versioned by the collector release with a cozystack respin
counter, runs as the upstream image's user, and is built with the
other package images.

The builder stage is alpine, which has no git, so a proxy error during
its go install would have had neither the direct fallback nor a retry;
the stage installs git. The module-fetch contract saw only go build, so
it now checks go install too, and takes only git as cover for a
versioned go install, which resolves outside the stage's module.

Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
2026-10-06 09:39:04 +03:00

31 lines
1.1 KiB
Makefile

NAME=monitoring
NAMESPACE=cozy-$(NAME)
include ../../../hack/common-envs.mk
include ../../../hack/package.mk
test:
helm unittest .
.PHONY: image image-otelcol-tracing
# The collector is versioned by its upstream release, pinned in the
# Containerfile; bump COZYSTACK_REV for a respin on the same release (a new
# component in builder-config.yaml, a Go toolchain bump).
OTELCOL_VERSION = $(shell awk -F= '/^ARG VERSION=/{print $$2}' images/otelcol-tracing/Containerfile)
COZYSTACK_REV = 0
COMPONENT_VERSION = v$(OTELCOL_VERSION)-cozystack.$(COZYSTACK_REV)
image: image-otelcol-tracing
image-otelcol-tracing:
docker buildx build images/otelcol-tracing \
--file images/otelcol-tracing/Containerfile \
$(call image-tags,otelcol-tracing,$(COMPONENT_VERSION)) \
$(call cache-args,otelcol-tracing) \
--metadata-file images/otelcol-tracing.json \
$(BUILDX_ARGS)
IMAGE="$(REGISTRY)/otelcol-tracing:$(COMPONENT_VERSION)@$$(yq e '."containerimage.digest"' images/otelcol-tracing.json -o json -r)" \
yq -i '.tracingCollector.image = strenv(IMAGE)' values.yaml
rm -f images/otelcol-tracing.json