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

Implement Display for SpanKind #62

Open
ghost opened this issue Oct 2, 2023 · 2 comments
Open

Implement Display for SpanKind #62

ghost opened this issue Oct 2, 2023 · 2 comments

Comments

@ghost
Copy link

ghost commented Oct 2, 2023

Feature Request

Motivation

The documentation has the following paragraph under 'Semantic Conventions'

OpenTelemetry defines conventional names for attributes of common operations. These names can be assigned directly as fields, e.g. trace_span!("request", "otel.kind" = %SpanKind::Client, "url.full" = ..), and they will be passed through to your configured OpenTelemetry exporter. You can find the full list of the operations and their expected field names in the semantic conventions spec.

However, that doesn't seem to actually be possible currently because SpanKind doesn't implement Display. Please let me know if I'm missing something obvious though.

Proposal

Implement Display for SpanKind according to the open telemetry semantic conventions.

Alternatives

Update docs to use hardcoded otel.kind value or alternate, instead of SpanKind directly.

@ghost
Copy link
Author

ghost commented Oct 2, 2023

Just noticed that SpanKind is part of the core opentelemetry crate and not this one. I guess my question now is, is there another SpanKind that the docs are referring to? Or is there another way to get this compiling that I'm missing?

@jtescher
Copy link
Collaborator

jtescher commented Oct 2, 2023

You can just use strings directly, e.g. trace_span!("request", "otel.kind" = "client", "url.full" = ..). The docs should really be updated to show that usage as the otel spec doesn't define a display format for span kind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant