Added the internal/observ package to stdoutlog#7735
Added the internal/observ package to stdoutlog#7735dmathieu merged 22 commits intoopen-telemetry:mainfrom
internal/observ package to stdoutlog#7735Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7735 +/- ##
=======================================
+ Coverage 81.6% 81.7% +0.1%
=======================================
Files 304 308 +4
Lines 23458 23606 +148
=======================================
+ Hits 19147 19294 +147
- Misses 3928 3929 +1
Partials 383 383
🚀 New features to boost your workflow:
|
internal/observ package to stdout loginternal/observ package to stdoutlog
671f7c2 to
ebffa09
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds the internal/observ package to the stdoutlog exporter as part of issue #7020, introducing experimental observability metrics for the exporter. The implementation includes a feature flag system to enable/disable the observability functionality via environment variables.
Key Changes
- Introduces
internal/observpackage with instrumentation for tracking log export metrics (inflight, exported, and operation duration) - Adds
internal/xpackage for experimental feature flag management, specifically theObservabilityfeature flag - Implements partial success error handling with proper error formatting
- Updates module dependencies to include metric SDK support
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| versions.yaml | Adds stdoutlog exporter to version tracking |
| exporters/stdout/stdoutlog/internal/x/x.go | Implements feature flag framework for experimental features |
| exporters/stdout/stdoutlog/internal/x/x_test.go | Tests for feature flag functionality |
| exporters/stdout/stdoutlog/internal/x/features.go | Defines Observability feature flag |
| exporters/stdout/stdoutlog/internal/x/features_test.go | Tests for Observability feature |
| exporters/stdout/stdoutlog/internal/x/README.md | Documents experimental observability feature usage |
| exporters/stdout/stdoutlog/internal/version.go | Defines version constant for the exporter |
| exporters/stdout/stdoutlog/internal/partialsuccess.go | Implements partial success error type |
| exporters/stdout/stdoutlog/internal/partialsuccess_test.go | Tests for partial success error formatting |
| exporters/stdout/stdoutlog/internal/observ/instrumentation.go | Core instrumentation logic for metrics collection |
| exporters/stdout/stdoutlog/internal/observ/instrumentation_test.go | Comprehensive tests including benchmarks for instrumentation |
| exporters/stdout/stdoutlog/internal/gen.go | Code generation directives for template-based code |
| exporters/stdout/stdoutlog/go.mod | Adds metric and sdk/metric dependencies |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add colon after "failed to create" in error messages for consistency - Update error message for inflight metric creation - Update error message for exported metric creation - Update error message for duration metric creation - Fix comment grammar: "logs exporter" to "logs exported" - Fix newline at end of versions.yaml file - Improve clarity and consistency of error formatting and documentation
4988821 to
52cf0f8
Compare
|
todo: I need to go fix the problem in the x.go later. // source: internal/shared/x/x_text.go.tmpl
// Copyright The OpenTelemetry Authors
// source: internal/shared/x/x_test.go.tmpl
Copyright The OpenTelemetry Authors |
Add go.opentelemetry.io/otel/metric and go.opentelemetry.io/otel/sdk/metric as direct dependencies Remove go.opentelemetry.io/otel/metric from indirect dependencies
|
@open-telemetry/go-maintainers all done, please check. |
|
CI needs to be fixed. |
…into inst-stdout-log
- Added new metric dependencies in go.mod: `go.opentelemetry.io/otel/metric` and `go.opentelemetry.io/otel/sdk/metric`. - Updated the version constant in version.go from "1.39.0" to "v1.42.0" to reflect the current release.
- Updated import paths for `semconv` and `otelconv` in `instrumentation.go` and `instrumentation_test.go` to use the latest version v1.40.0.
done. |
Co-authored-by: Damien Mathieu <42@dmathieu.com>
a part of #7020
goos: windows goarch: amd64 pkg: go.opentelemetry.io/otel/exporters/stdout/stdoutlog/internal/observ cpu: Intel(R) Core(TM) i7-14700 │ result.txt │ │ sec/op │ InstrumentationExportLogs/NoError-28 47.68n ± 5% InstrumentationExportLogs/PartialError-28 471.6n ± 2% InstrumentationExportLogs/FullError-28 471.9n ± 10% geomean 219.7n │ result.txt │ │ B/op │ InstrumentationExportLogs/NoError-28 0.000 ± 0% InstrumentationExportLogs/PartialError-28 305.0 ± 0% InstrumentationExportLogs/FullError-28 305.0 ± 0% geomean ¹ ¹ summaries must be >0 to compute geomean │ result.txt │ │ allocs/op │ InstrumentationExportLogs/NoError-28 0.000 ± 0% InstrumentationExportLogs/PartialError-28 4.000 ± 0% InstrumentationExportLogs/FullError-28 4.000 ± 0% geomean ¹ ¹ summaries must be >0 to compute geomean