-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Stdoutlog exporter metrics #7145
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
Stdoutlog exporter metrics #7145
Conversation
e7d6c0f
to
8a95ca4
Compare
We should follow the existing convention for including experimental features in an internal/x directory. You can follow the example in https://github.com/open-telemetry/opentelemetry-go/pull/7133/files#diff-0dd3a4492039e9f0aa24246db2fe468b32e1285411c2625fabafb53f9d64d07eR68 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7145 +/- ##
=======================================
- Coverage 82.9% 82.9% -0.1%
=======================================
Files 264 265 +1
Lines 24628 24730 +102
=======================================
+ Hits 20425 20505 +80
- Misses 3820 3835 +15
- Partials 383 390 +7
🚀 New features to boost your workflow:
|
I have currently time to review this PR, but I can at least recommend looking at #7133 (that is already merged) and use similar patterns where appropriate. |
caad2dd
to
14d1c03
Compare
We are missing a CHANGELOG. We can run |
Signed-off-by: Praful <holiodin@gmail.com>
Signed-off-by: Praful <holiodin@gmail.com>
Signed-off-by: Praful <holiodin@gmail.com>
…internal/x Signed-off-by: Praful <holiodin@gmail.com>
Signed-off-by: Praful <holiodin@gmail.com> follow existing convention for including experimental features in an internal/x Signed-off-by: Praful <holiodin@gmail.com>
Signed-off-by: Praful <holiodin@gmail.com>
14d1c03
to
f54728a
Compare
Signed-off-by: Praful <holiodin@gmail.com> fix: resolve linter err Signed-off-by: Praful <holiodin@gmail.com>
f54728a
to
8835529
Compare
…servability Signed-off-by: Praful <holiodin@gmail.com> refactor: test case from TestSelfObservability to TestNewSelfObservability Signed-off-by: Praful <holiodin@gmail.com>
e.selfObservability.operationDurationMetric.Record(ctx, time.Since(start).Seconds(), addAttrs...) | ||
|
||
*bufPtr = addAttrs[:0] | ||
selfObservabilityBuffer.Put(bufPtr) |
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.
This needs to be defer
ed right after the Get
to ensure it will always be returned to the pool.
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.
i’m not sure what you mean , the entire thing is deferred.
if err != nil { | ||
addAttrs = append(addAttrs, semconv.ErrorType(err)) | ||
} else { | ||
e.selfObservability.exportedMetric.Add(ctx, count, addAttrs...) |
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.
This only adds success metrics for exported count, and it only does so when there are no errors. This does not add counts for errored exports and it does not support partial successes.
For example, if the export is successfully able to export 4 records and fails on 2, this instrument needs to record both 4 and 2 with the appropriate attributes, if it fails all 6 it needs to record all 6 as errored, and if it succeeds for a 6 then 6 needs to be recorded without any error attribute.
…rvability Signed-off-by: Praful <holiodin@gmail.com>
@Horiodino PTAL #7272 |
Hi, since this process involves specification adjustments and historical review records (which may contain invalid review suggestions), it’s impossible to tell which items need attention amid the large volume of information. Could we create a new PR based on the current branch before preparing for the review, so that subsequent reviews can proceed more smoothly? Thanks~ |
Summary
This PR adds self-observability metrics to the
stdoutlog
exporterThese metrics are enabled when the environment variable
OTEL_GO_X_SELF_OBSERVABILITY
is set to"true"
What's Added
Support for:
otel.sdk.exporter.log.inflight
otel.sdk.exporter.log.exported
otel.sdk.exporter.operation.duration
Related Issue
Closes #7020