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

[Tracing] We need to be able to add attributes after span creation #23308

Open
lmolkova opened this issue Aug 11, 2024 · 1 comment
Open

[Tracing] We need to be able to add attributes after span creation #23308

lmolkova opened this issue Aug 11, 2024 · 1 comment
Labels
OpenTelemetry OpenTelemetry instrumentation (not Monitor-specific)

Comments

@lmolkova
Copy link
Member

See #23268 (comment).

Some information is available in response (like response properties, error codes, etc) and should be provided after span creation.

@lmolkova lmolkova added the OpenTelemetry OpenTelemetry instrumentation (not Monitor-specific) label Aug 11, 2024
@kjg
Copy link
Contributor

kjg commented Oct 23, 2024

In #23652, we added some attributes after span creation by using

span := c.internal.Tracer().SpanFromContext(ctx)
span.SetAttributes([]tracing.Attribute{
	{Key: "db.cosmosdb.request_charge", Value: res.RequestCharge
})

However there might still be the opportunity for a nicer way to get access to a span than via the context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OpenTelemetry OpenTelemetry instrumentation (not Monitor-specific)
Projects
None yet
Development

No branches or pull requests

2 participants