Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/1.6] Configure otel from env instead of config.toml #9993

Merged
merged 4 commits into from
Apr 22, 2024

Conversation

vvoland
Copy link
Contributor

@vvoland vvoland commented Mar 25, 2024

These are standard environment variables described by the otel spec in https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/.

Config options are converted to OTEL envs, but setting from environment overrides the config.

Also since otel will by default try to connect to https://localhost:4318 if no endpoint is set, this will also just disable the otlp plugin when there is no endpoint so we don't have otel continuously trying to connect to the default endpoint, littering the logs with connection failure messages and collecting traces that won't go anywhere.

(not a clean cherry-pick)

@k8s-ci-robot
Copy link

Hi @vvoland. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@vvoland vvoland force-pushed the release/1.6-8970 branch 3 times, most recently from b80258b to cde2b1c Compare March 25, 2024 17:08
Copy link
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

@fuweid
Copy link
Member

fuweid commented Apr 19, 2024

@vvoland would you please rebase it and repush ? thanks

@fuweid fuweid added the status/needs-update Awaiting contributor update label Apr 19, 2024
fangn2 and others added 4 commits April 19, 2024 11:05
Refractor newExporter and newTracer, add unit tests to them
This PR is part of issue 7493

Signed-off-by: Tony Fang <nenghui.fang@gmail.com>
(cherry picked from commit 8472946)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 753a525)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
These are standard environment variables described by the otel spec in
https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/.

The old config options are removed

Also since otel will by default try to connect to https://localhost:4318
if no endpoint is set, this will also just disable the otlp plugin when
there is no endpoint so we don't have otel continuously trying to
connect to the default endpoint, littering the logs with connection
failure messages and collecting traces that won't go anywhere.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 4fbc984)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
@vvoland
Copy link
Contributor Author

vvoland commented Apr 19, 2024

Rebased (some workflows failed due to network flakiness though).

@thaJeztah thaJeztah removed the status/needs-update Awaiting contributor update label Apr 19, 2024
@thaJeztah
Copy link
Member

/ok-to-test

@fuweid
Copy link
Member

fuweid commented Apr 21, 2024

/retest

1 similar comment
@fuweid
Copy link
Member

fuweid commented Apr 21, 2024

/retest

if plugin.IsSkipPlugin(err) {
log.G(ic.Context).WithError(err).Infof("skipping tracing processor initialization (no tracing plugin)")
} else {
log.G(ic.Context).WithError(err).Errorf("failed to initialize a tracing processor %q", id)
Copy link
Member

Choose a reason for hiding this comment

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

do we need to fastfail here since it's not skipable error?

Copy link
Member

Choose a reason for hiding this comment

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

ping @cpuguy83

Copy link
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

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

LGTM

It's just backport and no need to change logic.
Thanks

@estesp estesp changed the title [release 1.6] Configure otel from env instead of config.toml [release/1.6] Configure otel from env instead of config.toml Apr 22, 2024
@estesp estesp merged commit 14f899e into containerd:release/1.6 Apr 22, 2024
48 checks passed
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.

8 participants