Skip to content

Conversation

@thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Nov 27, 2025

util/tracing: switch to semconv v1.37.0

align with otel/sdk and docker/cli on using the same version

@github-actions github-actions bot added area/dependencies Pull requests that update a dependency file area/util labels Nov 27, 2025
@crazy-max crazy-max requested a review from jsternberg November 27, 2025 22:21
align with otel/sdk and docker/cli on using the same version

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Comment on lines 43 to 46
span.RecordError(err)
if hasStacktrace(err) {
span.SetAttributes(attribute.String(string(semconv.ExceptionStacktraceKey), fmt.Sprintf("%+v", stack.Formatter(err))))
span.SetAttributes(semconv.ExceptionStacktrace(fmt.Sprintf("%+v", stack.Formatter(err))))
}
Copy link
Member Author

@thaJeztah thaJeztah Dec 2, 2025

Choose a reason for hiding this comment

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

Note that span.RecordError itself also can provide a stack-trace; wondering what that looks like or if that's not giving the same amount of detail as the ones we get from this custom code;

cfg := trace.NewEventConfig(opts...)
attrs := cfg.Attributes()
attrs = append(attrs,
semconv.ExceptionType(typeStr(err)),
semconv.ExceptionMessage(err.Error()),
)
if cfg.StackTrace() {
buf := make([]byte, 2048)
n := runtime.Stack(buf, false)
attrs = append(attrs, semconv.ExceptionStacktrace(string(buf[0:n])))
}

@thaJeztah thaJeztah marked this pull request as ready for review December 4, 2025 23:05
@tonistiigi tonistiigi merged commit b750e94 into moby:master Dec 5, 2025
140 checks passed
@thaJeztah thaJeztah deleted the bump_semconv branch December 5, 2025 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/dependencies Pull requests that update a dependency file area/util

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants