Skip to content

Added the internal/observ package to stdoutlog#7735

Merged
dmathieu merged 22 commits intoopen-telemetry:mainfrom
yumosx:inst-stdout-log
Mar 18, 2026
Merged

Added the internal/observ package to stdoutlog#7735
dmathieu merged 22 commits intoopen-telemetry:mainfrom
yumosx:inst-stdout-log

Conversation

@yumosx
Copy link
Copy Markdown
Member

@yumosx yumosx commented Dec 22, 2025

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

@yumosx yumosx marked this pull request as draft December 22, 2025 07:13
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 22, 2025

Codecov Report

❌ Patch coverage is 98.64865% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.7%. Comparing base (5576bc2) to head (2844487).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...tdout/stdoutlog/internal/observ/instrumentation.go 98.2% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@           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             
Files with missing lines Coverage Δ
...orters/stdout/stdoutlog/internal/partialsuccess.go 100.0% <100.0%> (ø)
exporters/stdout/stdoutlog/internal/x/features.go 100.0% <100.0%> (ø)
exporters/stdout/stdoutlog/internal/x/x.go 100.0% <100.0%> (ø)
...tdout/stdoutlog/internal/observ/instrumentation.go 98.2% <98.2%> (ø)

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@yumosx yumosx changed the title [WIP] Added the internal/observ package to stdout log Added the internal/observ package to stdoutlog Jan 2, 2026
@yumosx yumosx marked this pull request as ready for review January 2, 2026 18:23
Copy link
Copy Markdown
Member

@flc1125 flc1125 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall it looks good.

Comment thread versions.yaml Outdated
@flc1125 flc1125 added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Jan 4, 2026
Comment thread versions.yaml Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/observ package with instrumentation for tracking log export metrics (inflight, exported, and operation duration)
  • Adds internal/x package for experimental feature flag management, specifically the Observability feature 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.

Comment thread exporters/stdout/stdoutlog/internal/observ/instrumentation.go
Comment thread exporters/stdout/stdoutlog/internal/observ/instrumentation_test.go
Comment thread exporters/stdout/stdoutlog/internal/x/x_test.go Outdated
Comment thread exporters/stdout/stdoutlog/internal/observ/instrumentation.go Outdated
Comment thread exporters/stdout/stdoutlog/internal/observ/instrumentation.go Outdated
Comment thread exporters/stdout/stdoutlog/internal/observ/instrumentation.go Outdated
Comment thread exporters/stdout/stdoutlog/internal/observ/instrumentation.go Outdated
Comment thread exporters/stdout/stdoutlog/internal/observ/instrumentation.go Outdated
yumosx added 2 commits January 9, 2026 09:39
- 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
@yumosx
Copy link
Copy Markdown
Member Author

yumosx commented Jan 27, 2026

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
@yumosx
Copy link
Copy Markdown
Member Author

yumosx commented Feb 16, 2026

@open-telemetry/go-maintainers all done, please check.

@dmathieu
Copy link
Copy Markdown
Member

CI needs to be fixed.

yumosx and others added 6 commits March 18, 2026 09:01
- 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.
@yumosx
Copy link
Copy Markdown
Member Author

yumosx commented Mar 18, 2026

CI needs to be fixed.

done.

Comment thread exporters/stdout/stdoutlog/internal/version.go Outdated
Co-authored-by: Damien Mathieu <42@dmathieu.com>
@dmathieu dmathieu merged commit 768e930 into open-telemetry:main Mar 18, 2026
33 checks passed
@pellared pellared added this to the v1.43.0 milestone Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog PRs that do not require a CHANGELOG.md entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants