-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[WIP] sdk/log: self observability: batch log processor metrics #7124
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
base: main
Are you sure you want to change the base?
[WIP] sdk/log: self observability: batch log processor metrics #7124
Conversation
- setup and teardown for self observability. Includes setting up counters for queue capacity, size, log processed. Also includes callback registration for queue cap and size - doc comments pending - has some todo comments that I plan to address by discussion on PR review
…ation - increment logProcessedCounter on push to exporter or drops from queue - pending: flush methods where we are pushing to exporter
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7124 +/- ##
=======================================
- Coverage 86.1% 86.0% -0.1%
=======================================
Files 291 293 +2
Lines 25613 25710 +97
=======================================
+ Hits 22056 22131 +75
- Misses 3184 3201 +17
- Partials 373 378 +5
🚀 New features to boost your workflow:
|
…eflect what it means for a log to be processed
@mahendrabishnoi2 please take a look at #7017. I have updated the issue with a check list of items from our project Observability guidelines that need to be completed in this PR. |
@mahendrabishnoi2 I just wanted to check in with this PR. Are you still able to update this PR or open a new PR to address the instrumentation requirements? |
Yes @MrAlias. I can finish it in 2-3 days as per the updated guidelines. It would be great if I could get some feedback on the approach I'm taking for this PR. Since we need to record the metric just before logs are passed to exporter, I have crated another wrapper (similar to timeoutExporter or chunkedExporter) to achieve this. Just trying to avoid the rework. |
…ty and integrate it with processor.
processor_1.txt
|
Fixes #7017
Adds support for below metrics for sdk/log#BatchProcessor
otel.sdk.processor.log.processed
otel.sdk.processor.log.queue.size
otel.sdk.processor.log.queue.capacity
These metrics are defined at https://github.com/open-telemetry/semantic-conventions/blob/v1.36.0/docs/otel/sdk-metrics.md and are experimental. Because of this, these use global MeterProvider and are behind a feature flag
OTEL_GO_X_SELF_OBSERVABILITY
.TODO:
Observability Implementation Checklist
Observability Implementation Checklist
Based on the project Observability guidelines, ensure the following are completed:
Environment Variable Activation
OTEL_GO_X_OBSERVABILITY
environment variablex.Observability.Enabled()
check 1Encapsulation
struct
(e.g.,Instrumentation
)Initialization
otel.GetMeterProvider()
)Version
)SchemaURL
)Performance
Attribute and Option Allocation Management
sync.Pool
for 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
otelconv
convenience package for metric semantic conventionsTesting
t.Cleanup()
)t.Setenv()
for environment variable testingFootnotes
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 ↩