-
Notifications
You must be signed in to change notification settings - Fork 41.1k
Record SyncTerminatingPod error and set error status on span when non-nil err returned #133134
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
base: master
Are you sure you want to change the base?
Conversation
Welcome @rutigs! |
Hi @rutigs. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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-sigs/prow repository. |
/sig instrumentation |
/ok-to-test |
cc @dashpole |
/triage accepted |
otelSpan.RecordError(err) | ||
otelSpan.SetStatus(codes.Error, err.Error()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pellard
I wasn't able to fully keep up with the spec discussion around open-telemetry/opentelemetry-go-contrib#7470. I want to make sure we don't add anything here that we will break in the future. What should we do here to properly record this error?
For context, this is an error indicates the kubelet has tried and failed to terminate a pod.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From that discussion:
I believe span.RecordError remains valuable, particularly for non-terminating errors. A common use case is retry logic, where errors occur but don't immediately end the span. This is especially relevant in the context of custom instrumentation, where developers have full control and can explicitly record such intermediate errors.
IIUC this is the use case here where deletion will be retried and we're very interested in exposing this error properly
…-nil err returned
/retest |
/retest |
I don't really see how this last test is related and it seems flaky |
/retest |
1 similar comment
/retest |
@rutigs: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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-sigs/prow repository. I understand the commands that are listed here. |
Any thoughts @dashpole ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
LGTM label has been added. Git tree hash: 2c77699e85a7d7e60ac8890548057a8e81c71af3
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dashpole, rutigs The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/assign @klueska |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Which issue(s) this PR is related to:
This is the deletion side of #125017.
I'm using kubelet tracing and otel-collectors spanmetric connector to calculate a rate of
syncTerminatingPod
but the span does not record the error correctly. This change will record the error and update the span status correctly.Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: