-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: sdk/trace: span processed metric for simple span processor #7374
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
feat: sdk/trace: span processed metric for simple span processor #7374
Conversation
…le_span_processor.go
…is already being used in batch span processor
- separate changelog entry - flatten self observability initialization - reset simpleProcessorIDCounter so tests can be run in parallel and order doesn't matter
- use sync.Pool to amortize allocation for metric attrs
- use sync.Pool to amortize allocation for metric attrs - pass context with span to ensure metric is recorded with correct span context
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7374 +/- ##
=====================================
Coverage 86.3% 86.3%
=====================================
Files 294 295 +1
Lines 25987 26054 +67
=====================================
+ Hits 22427 22495 +68
+ Misses 3187 3186 -1
Partials 373 373
🚀 New features to boost your workflow:
|
|
@mahendrabishnoi2 based your results: > benchstat bmark.result
goos: darwin
goarch: arm64
pkg: go.opentelemetry.io/otel/sdk/trace/internal/observ
cpu: Apple M1 Pro
│ bmark.result │
│ sec/op │
SSP/SpanProcessed-8 146.7n ± 15%
SSP/SpanProcessedWithError-8 205.1n ± 3%
geomean 173.5n
│ bmark.result │
│ B/op │
SSP/SpanProcessed-8 280.0 ± 0%
SSP/SpanProcessedWithError-8 408.0 ± 0%
geomean 338.0
│ bmark.result │
│ allocs/op │
SSP/SpanProcessed-8 3.000 ± 0%
SSP/SpanProcessedWithError-8 3.000 ± 0%
geomean 3.000 |
|
My bad, I forgot to run the results through benchstat. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, this looks good. The memory management of attributes during the measurement needs to be optimized though.
…s case, add docs for public methods
This comment was marked as outdated.
This comment was marked as outdated.
|
Updated benchmarks ssp_3.txt |
|
@mahendrabishnoi2 this looks ready to merge. Please take a look at the conflicts and resolve them. |
Fixes #7004
This PR adds support for experimental otel.sdk.processor.span.processed metric in simple span processor.
Definition of metric at: https://github.com/open-telemetry/semantic-conventions/blob/v1.36.0/docs/otel/sdk-metrics.md
Experimental metrics are behind a feature flag:
OTEL_GO_X_OBSERVABILITYObservability Implementation Checklist
Observability Implementation Checklist
Based on the project Observability guidelines, ensure the following are completed:
Environment Variable Activation
OTEL_GO_X_OBSERVABILITYenvironment variablex.Observability.Enabled()check 1Encapsulation
struct(e.g.,Instrumentation)Initialization
otel.GetMeterProvider())Version)SchemaURL)Performance
Attribute and Option Allocation Management
sync.Poolfor attribute slices and options with dynamic attributesCaching
Benchmarking
b.ReportAllocs()in benchmarks)Error Handling and Robustness
otel.Handle()otel.Handle()only when component cannot report error to userContext Propagation
context.Background())Semantic Conventions Compliance
otelconvconvenience package for metric semantic conventionsTesting
t.Cleanup())t.Setenv()for environment variable testingBenchmarks
Footnotes
https://github.com/open-telemetry/opentelemetry-go/blob/e4ab3141123d0811125a69823dbbe4d9ec5a9b8f/exporters/stdout/stdouttrace/internal/observ/instrumentation.go#L101-L103 ↩
https://github.com/open-telemetry/opentelemetry-go/blob/e4ab3141123d0811125a69823dbbe4d9ec5a9b8f/exporters/stdout/stdouttrace/internal/x/x.go ↩
https://github.com/open-telemetry/opentelemetry-go/blob/e4ab3141123d0811125a69823dbbe4d9ec5a9b8f/sdk/internal/x/x.go ↩