Skip to content

Otel Module: handle resources#1424

Merged
dmathieu merged 2 commits intoelastic:mainfrom
dmathieu:apmotel-resources
May 5, 2023
Merged

Otel Module: handle resources#1424
dmathieu merged 2 commits intoelastic:mainfrom
dmathieu:apmotel-resources

Conversation

@dmathieu
Copy link
Member

@dmathieu dmathieu commented May 3, 2023

As I was digging through traces generated by this module, I would have wanted to see attributes set by it to identify where the traces were coming from. But I only was able to know the agent was sending them.

So this adds support for resources, as supported in the official OpenTelemetry SDK, which allows setting custom attributes on all spans.
By default, the following attributes are set:

  • service.name: unknown_service:<executable name>
  • telemetry.sdk.language: go
  • telemetry.sdk.name: apmotel
  • telemetry.sdk.version: apm.AgentVersion

This closely matches the default resource from the official SDK: https://github.com/open-telemetry/opentelemetry-go/blob/main/sdk/resource/resource.go#L203

@dmathieu dmathieu requested a review from a team May 3, 2023 10:39
Copy link
Member

@kruskall kruskall left a comment

Choose a reason for hiding this comment

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

LGTM!

@dmathieu dmathieu merged commit d04d9fe into elastic:main May 5, 2023
@dmathieu dmathieu deleted the apmotel-resources branch May 5, 2023 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 participants