Skip to content

Include OpenTelemetry metrics plugin into OTel agent #36537

Open
@lmolkova

Description

@lmolkova

When using tracing shaded into otel/appinsights agent, we put instances of shaded OTel-context into SDK-context.
When unshaded metrics plugin is used, it works with instances of unshaded OTel-context, but gets shaded one created by tracing plugin from SDK-context.

As a result, exemplars could be broken and users get a couple of warning messages in the logs.

// TODO (limolkova) The context we have here is created by azure-core-tracing-opentelemetry.
// but if otel or appinsights agents are used, the azure-core-tracing-opentelemetry is shaded and records shaded context.
// if azure-core-metrics-opentelemetry is NOT shaded, we won't be able to reuse this context since it's not compatible.
// I.e. it works fine if both are shaded or not shaded and warns (once) if just one of them is shaded.
// We should fix this by adding azure-core-metrics-opentelemetry to otel agent
// In the meantime, it's ok - we return current context and exemplars should work reasonably well.

There is nothing on the SDK side that can be done and we expect users to either have both metrics and tracing plugins included in the agent or use both of them explicitly. Mixing different ways would have above drawbacks.

We can consider adding the plugin to otel agent after open-telemetry/semantic-conventions#163 is finalized.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions