feat(sdk-logs): implement log processor metrics#6554
feat(sdk-logs): implement log processor metrics#6554anuraaga wants to merge 8 commits intoopen-telemetry:mainfrom
Conversation
| const sdk = new NodeSDK({ | ||
| metricReader: metricReader, | ||
| traceExporter: new ConsoleSpanExporter(), | ||
| logRecordProcessors: [ |
There was a problem hiding this comment.
I realized since SDK only accepts built log record processors, not exporter, we can't wire a meter provider into it like we can with a traceExporter. So I changed this test to exercise autoconfig for all signals, and also added a test that is autoconfig only for logs and keeps this pattern for the others to exercise both cases
There was a problem hiding this comment.
That being said, I wonder if we do need some internal mechanism to fill in passed-in log record processors, depending on how common that is
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6554 +/- ##
==========================================
+ Coverage 95.76% 95.78% +0.01%
==========================================
Files 375 376 +1
Lines 12739 12796 +57
Branches 3013 3022 +9
==========================================
+ Hits 12200 12257 +57
Misses 539 539
🚀 New features to boost your workflow:
|
| ); | ||
| queueCapacity.add(capacity, this.standardAttrs); | ||
|
|
||
| const queueSize = meter.createObservableUpDownCounter( |
There was a problem hiding this comment.
I think because queueSize here is a local variable here and not assigned to this.queueSize that the removeCallback in shutdown() won't work (meaning the callback will keep firing even after the processor is shut down). I think it should be this.queueSize = meter.createObservableUpDownCounter(...)
There was a problem hiding this comment.
Doh, sorry about that fixed
Which problem is this PR solving?
I am helping to implement SDK internal metrics
https://opentelemetry.io/docs/specs/semconv/otel/sdk-metrics/
This implements log processor metrics. This is the last PR for SDK metrics.
It is very similar to #6504 except for opentelemetry-sdk-node integration
/cc @trentm
Short description of the changes
Implement metrics for log processors per semconv
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: