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

Add initial experimental SDK self-observability metric #6153

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dashpole
Copy link
Contributor

Part of #2547

This adds the OTEL_GO_X_SELF_OBSERVABILITY feature gate, the otel.sdk.batch_span_processor.queue_size metric behind it. I tried to pick the least contentious metric to start with.

Note: I opted for a single environment variable for all SDKs and for all signals, rather than multiple environment variables.

TODO:

  • Add unit tests
  • Add metric to semantic conventions

Copy link

codecov bot commented Jan 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.2%. Comparing base (14b874e) to head (5fb833a).
Report is 9 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #6153     +/-   ##
=======================================
- Coverage   82.2%   82.2%   -0.1%     
=======================================
  Files        273     273             
  Lines      23674   23706     +32     
=======================================
+ Hits       19478   19492     +14     
- Misses      3849    3864     +15     
- Partials     347     350      +3     

see 5 files with indirect coverage changes

Copy link
Contributor

@MrAlias MrAlias left a comment

Choose a reason for hiding this comment

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

Looks like a good start, I like the approach. 👍

sdk/trace/batch_span_processor.go Show resolved Hide resolved
metric.WithInstrumentationVersion(version()),
)

queueSizeCounter, err := meter.Int64ObservableUpDownCounter("otel.sdk.batch_span_processor.queue_size",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just realized that there isn't a good way to distinguish different instances of the batch span processor. I think we might want to use a scope attribute to do that, but i'm not sure what the attribute should be. We don't have any unique identifiers for exporters or processors. We could generate one, but that doesn't seem very helpful.

@dashpole
Copy link
Contributor Author

Turns out there are already proposed semantic conventions: open-telemetry/semantic-conventions#1631

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

Successfully merging this pull request may close these issues.

2 participants