-
Notifications
You must be signed in to change notification settings - Fork 347
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
Feature/otel span kind support #946
Feature/otel span kind support #946
Conversation
Thanks for your contribution! |
@maxday that's really depending on how the tracing_opentelemetry crate handles it. As it is today, it handles string to SpanKind conversion internally: see https://github.com/tokio-rs/tracing-opentelemetry/blob/v0.1.x/src/layer.rs#L443 and https://github.com/tokio-rs/tracing-opentelemetry/blob/v0.1.x/src/layer.rs#L102-L111. |
While testing it seems that the "kind" is passed as a integer (enum id I guess) Also not providing any |
Yes, it's a little bit confusing, but the serialization of SpanKind (an enum) is an int for the specs. |
(oh, and the o11y platforms will typically, or at least all those that i tried, convert it back to a string for visualization) |
It seems that our CI is red, I've just pushed a PR to fix it, I'll let you know once it gets reviewed/merged so you can rebase from that. Thanks! |
Yes, I saw, no worries |
#948 has just been merged and CI is now green, could you please merge main into your branch, this should resolve the failing checks? Thanks! |
…ind-support Merge upstream main to resolve failing checks
Ok, thank you. I think i have done it. |
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! Thanks 👍
📬 *Issue #945
✍️ *Add OpenTelemetry span kind support to Lambda invocation tracing. This enhancement allows users to specify the span kind (e.g., SERVER, CLIENT) in their Lambda handlers, improving how functions are represented in distributed traces.
In this way:
span.record("otel.kind", "SERVER")
or `span.record("otel.kind", "CONSUMER") etc.Changes:
otel.kind
field to the Lambda invocation span, initialized asfield::Empty
as per the tracing_opentelemetry docsexamples/opentelemetry-tracing/main.rs
to demonstrate setting the span kindPlease note that since tracing_opentelemetry 0.28.0, they have provided a method to set the status on a span, therefore setting
otel.status_code
andotel.status_message
in advance on the span is not required anymore.🔏 By submitting this pull request
cargo +nightly fmt
.cargo clippy --fix
.