Skip to content

chore: sdk/log/internal/x - generate x package from x component template - #7389

Merged
dmathieu merged 5 commits into
open-telemetry:mainfrom
nikhilmantri0902:imp/log_internal_x
Sep 22, 2025
Merged

chore: sdk/log/internal/x - generate x package from x component template #7389
dmathieu merged 5 commits into
open-telemetry:mainfrom
nikhilmantri0902:imp/log_internal_x

Conversation

@nikhilmantri0902

Copy link
Copy Markdown
Contributor

Closes #7382

Idea from #7361

Ref: #7361
Components that need to be processed: sdk/log/internal/x

@flc1125 flc1125 added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Sep 20, 2025
@codecov

codecov Bot commented Sep 20, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.5%. Comparing base (a579a3e) to head (a8027f5).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #7389   +/-   ##
=====================================
  Coverage   85.5%   85.5%           
=====================================
  Files        274     275    +1     
  Lines      24614   24614           
=====================================
+ Hits       21047   21048    +1     
+ Misses      3188    3187    -1     
  Partials     379     379           
Files with missing lines Coverage Δ
sdk/log/internal/x/features.go 100.0% <100.0%> (ø)
sdk/log/internal/x/x.go 100.0% <ø> (ø)

... and 2 files with indirect coverage changes

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

flc1125 commented Sep 20, 2025

Copy link
Copy Markdown
Member

Please fix the lint; we can run local checks with make ci.

@flc1125 flc1125 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall perfect

Comment thread sdk/log/internal/x/features.go
@nikhilmantri0902

Copy link
Copy Markdown
Contributor Author

@flc1125 I have made the changes and fixed the lint.

Comment thread sdk/log/internal/x/features.go
@nikhilmantri0902

Copy link
Copy Markdown
Contributor Author

Can we merge this @flc1125 ?

@dmathieu
dmathieu merged commit 56498ab into open-telemetry:main Sep 22, 2025
30 checks passed
MrAlias added a commit that referenced this pull request Sep 27, 2025
 (#7411)

Fix #7385

### Summary

This PR adds code generation for the `sdk/trace/internal/x` package
using the shared x component template.

It mirrors the implementation in `sdk/log/internal/x` (#7389) for the
trace SDK.

### Changes

- Added `gen.go` to run `go:generate` for `x.go` and `x_test.go`.
- Generated `x/x.go` and `x/x_test.go` using the shared template.
- Added `feature.go` with the `Observability` experimental feature flag
for the trace SDK,
  following the pattern used in the log SDK.

### Verification

- `go generate ./...` successfully generates the files.
- Unit tests in `x_test.go` pass.

### References

- Log implementation for reference: #7389
- Trace issue: #7385

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
nikhilmantri0902 added a commit to nikhilmantri0902/opentelemetry-go that referenced this pull request Oct 12, 2025
- Add sdk/internal/gen.go with gotmpl directives to generate x/x.go and x/x_test.go
- Refactor sdk/internal/x/x.go to generic Feature[T] with multi-key support and Keys()
- Move Resource feature into sdk/internal/x/features.go (case-insensitive true enables)
- Add tests: generic feature tests in x_test.go and Resource tests in features_test.go
- Aligns with sdk/log/internal/x pattern introduced in PR open-telemetry#7389

Internal note: replaces Key() with Keys() for internal Feature API.
Build and lints pass
@MrAlias MrAlias added this to the v1.39.0 milestone Oct 14, 2025
dmathieu added a commit that referenced this pull request Oct 16, 2025
Closes #7384 

- Add sdk/internal/gen.go with gotmpl directives to generate x/x.go and
x/x_test.go
- Refactor sdk/internal/x/x.go to generic Feature[T] with multi-key
support and Keys()
- Move Resource feature into sdk/internal/x/features.go
(case-insensitive true enables)
- Add tests: generic feature tests in x_test.go and Resource tests in
features_test.go
- Aligns with sdk/log/internal/x pattern introduced in PR #7389

Internal note: replaces Key() with Keys() for internal Feature API.
Build and lints pass

---------

Co-authored-by: Damien Mathieu <42@dmathieu.com>
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

5 participants