Skip to content

exporters: support SLICE attributes#8216

Merged
pellared merged 9 commits intoopen-telemetry:mainfrom
pellared:slice-exporters-codex
Apr 20, 2026
Merged

exporters: support SLICE attributes#8216
pellared merged 9 commits intoopen-telemetry:mainfrom
pellared:slice-exporters-codex

Conversation

@pellared
Copy link
Copy Markdown
Member

@pellared pellared commented Apr 16, 2026

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 in model.go and 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.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

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.6%. Comparing base (3384d39) to head (5d0599b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           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     
Files with missing lines Coverage Δ
...otlp/otlplog/otlploggrpc/internal/transform/log.go 96.3% <100.0%> (+0.1%) ⬆️
...otlp/otlplog/otlploghttp/internal/transform/log.go 96.3% <100.0%> (+0.1%) ⬆️
...ric/otlpmetricgrpc/internal/transform/attribute.go 97.0% <100.0%> (+0.3%) ⬆️
...ric/otlpmetrichttp/internal/transform/attribute.go 97.0% <100.0%> (+0.3%) ⬆️
...tlp/otlptrace/internal/tracetransform/attribute.go 97.1% <100.0%> (+0.3%) ⬆️
exporters/zipkin/model.go 99.4% <100.0%> (+<0.1%) ⬆️

... 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.

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

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.SLICE as OTLP AnyValue_ArrayValue for 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.md with 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.

Comment thread internal/shared/otlp/otlpmetric/transform/attribute_test.go.tmpl
Comment thread internal/shared/otlp/otlplog/transform/attr_test.go.tmpl
Comment thread exporters/otlp/otlplog/otlploggrpc/internal/transform/attr_test.go
Comment thread exporters/otlp/otlplog/otlploghttp/internal/transform/attr_test.go
Comment thread exporters/zipkin/model.go Outdated
Comment thread internal/shared/otlp/otlpmetric/transform/attribute_test.go.tmpl 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

Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.

Comment thread CHANGELOG.md Outdated
Comment thread internal/shared/otlp/otlpmetric/transform/attribute_test.go.tmpl Outdated
Comment thread internal/shared/otlp/otlplog/transform/attr_test.go.tmpl 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

Copilot reviewed 21 out of 21 changed files in this pull request and generated no new comments.

@pellared pellared marked this pull request as ready for review April 16, 2026 14:09
@pellared pellared merged commit fa9276b into open-telemetry:main Apr 20, 2026
34 checks passed
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

exporters: Handle SLICE type

5 participants