Skip to content

fix: set OTEL traces to disabled by default#4671

Merged
milosgajdos merged 1 commit intodistribution:mainfrom
jcpunk:no-trace-in-container-by-default
Jul 10, 2025
Merged

fix: set OTEL traces to disabled by default#4671
milosgajdos merged 1 commit intodistribution:mainfrom
jcpunk:no-trace-in-container-by-default

Conversation

@jcpunk
Copy link
Copy Markdown
Contributor

@jcpunk jcpunk commented Jul 9, 2025

This updates the default container invocation to avoid spamming the system logs with failure to send trace data.

I think this resolves #4270 while leaving it easy for folks using this to setup their collectors.

If you want to enable traces, you can still set the env to your
collector.

Signed-off-by: Pat Riehecky <riehecky@fnal.gov>
@milosgajdos
Copy link
Copy Markdown
Member

We might wanna do the for the official image, too https://github.com/distribution/distribution-library-image

@milosgajdos milosgajdos requested a review from thaJeztah July 9, 2025 19:05
@jcpunk
Copy link
Copy Markdown
Contributor Author

jcpunk commented Jul 9, 2025

Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

COPY cmd/registry/config-dev.yml /etc/distribution/config.yml
COPY --from=binary /registry /bin/registry
VOLUME ["/var/lib/registry"]
ENV OTEL_TRACES_EXPORTER=none
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think anyone else would use this Dockerfile to build with a different default (other than our own use).

If that would be the case, we could add some build-arg in future, e.g. something like;

# DEFAULT_OTEL_TRACES_EXPORTER sets the default OTEL_TRACES_EXPORTER to use
ARG DEFAULT_OTEL_TRACES_EXPORTER=none
ENV OTEL_TRACES_EXPORTER=${DEFAULT_OTEL_TRACES_EXPORTER}

Which would allow the default to be set when building the image;

docker build -t foo --build-arg DEFAULT_OTEL_TRACES_EXPORTER=<whatever> .

@milosgajdos milosgajdos merged commit c9760eb into distribution:main Jul 10, 2025
21 checks passed
@jcpunk jcpunk deleted the no-trace-in-container-by-default branch July 10, 2025 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[v3.0.0-alpha.1] Disable exporting traces by default

3 participants