exporters: support SLICE attributes#8216
Merged
pellared merged 9 commits intoopen-telemetry:mainfrom Apr 20, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8216 +/- ##
=======================================
+ Coverage 82.5% 82.6% +0.1%
=======================================
Files 310 310
Lines 24595 24647 +52
=======================================
+ Hits 20305 20375 +70
+ Misses 3913 3893 -20
- Partials 377 379 +2
🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds end-to-end handling of attribute.SLICE across remaining exporter/transform paths so slice attributes are preserved instead of being treated as invalid or falling back to formatting.
Changes:
- Encode
attribute.SLICEas OTLPAnyValue_ArrayValuefor trace, log, and metric attribute transforms (including shared templates + generated outputs). - Add regression tests for slice conversion (trace/auto, OTLP trace transform, OTLP log/metric transforms, Zipkin string serialization).
- Update
CHANGELOG.mdwith new SLICE exporter support entries.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| trace/auto_test.go | Adds recursive slice conversion coverage for convAttrValue. |
| internal/shared/otlp/otlpmetric/transform/attribute.go.tmpl | Adds attribute.SLICE → OTLP ArrayValue conversion in metric transform template. |
| internal/shared/otlp/otlpmetric/transform/attribute_test.go.tmpl | Adds slice transform tests/fixtures to metric template tests. |
| internal/shared/otlp/otlplog/transform/log.go.tmpl | Adds attribute.SLICE → OTLP ArrayValue conversion in log transform template. |
| internal/shared/otlp/otlplog/transform/attr_test.go.tmpl | Adds slice transform tests/fixtures to log template tests. |
| exporters/otlp/otlptrace/internal/tracetransform/attribute.go | Adds attribute.SLICE → OTLP ArrayValue conversion for trace exporter transform. |
| exporters/otlp/otlptrace/internal/tracetransform/attribute_test.go | Adds trace transform regression coverage for slice → array conversion. |
| exporters/otlp/otlplog/otlploggrpc/internal/transform/log.go | Enables SLICE conversion for OTLP log gRPC path. |
| exporters/otlp/otlplog/otlploggrpc/internal/transform/attr_test.go | Adds SLICE regression tests for OTLP log gRPC path. |
| exporters/otlp/otlplog/otlploghttp/internal/transform/log.go | Enables SLICE conversion for OTLP log HTTP path. |
| exporters/otlp/otlplog/otlploghttp/internal/transform/attr_test.go | Adds SLICE regression tests for OTLP log HTTP path. |
| exporters/otlp/otlpmetric/otlpmetricgrpc/internal/transform/attribute.go | Enables SLICE conversion for OTLP metric gRPC path. |
| exporters/otlp/otlpmetric/otlpmetricgrpc/internal/transform/attribute_test.go | Adds SLICE regression tests for OTLP metric gRPC path. |
| exporters/otlp/otlpmetric/otlpmetrichttp/internal/transform/attribute.go | Enables SLICE conversion for OTLP metric HTTP path. |
| exporters/otlp/otlpmetric/otlpmetrichttp/internal/transform/attribute_test.go | Adds SLICE regression tests for OTLP metric HTTP path. |
| exporters/zipkin/model.go | Adds best-effort SLICE serialization using Value.String() AnyValue formatting. |
| exporters/zipkin/model_test.go | Adds Zipkin SLICE serialization regression test. |
| CHANGELOG.md | Documents SLICE exporter support in Unreleased notes. |
pellared
commented
Apr 16, 2026
MrAlias
approved these changes
Apr 16, 2026
dmathieu
approved these changes
Apr 17, 2026
dashpole
approved these changes
Apr 17, 2026
pellared
added a commit
to pellared/opentelemetry-go
that referenced
this pull request
Apr 23, 2026
Fixes open-telemetry#8162 Follow-up to open-telemetry#8153 for `attribute.SLICE`. Add end-to-end exporter handling for `attribute.SLICE` in the remaining paths that still treated it as invalid or relied on fallback formatting. Changes: - encode `attribute.SLICE` as OTLP `AnyValue_ArrayValue` for trace, log, and metric transforms - serialize Zipkin `SLICE` attributes using the non-OTLP AnyValue string representation - add trace-side coverage for recursive `convAttrValue` slice conversion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #8162
Note
I was testing #8215 using Codex CLI with GPT 5.4 Medium when working on this PR.
It worked very nice. Initially, I added only minimal changes in the code and some where caused by patterns that already existed and I do not agree with (e.g. usage of
t.Parallel). I also added a comment inmodel.goand moved changed log entries from "Fixed" to "Added". Then I applied a few refinements and started addressing the Copilot review comments.Follow-up to #8153 for
attribute.SLICE.Add end-to-end exporter handling for
attribute.SLICEin the remaining paths that still treated it as invalid or relied on fallback formatting.Changes:
attribute.SLICEas OTLPAnyValue_ArrayValuefor trace, log, and metric transformsSLICEattributes using the non-OTLP AnyValue string representationconvAttrValueslice conversion