fix(collector): support declarative telemetry resource format#5229
Open
ozzywalsh wants to merge 4 commits into
Open
fix(collector): support declarative telemetry resource format#5229ozzywalsh wants to merge 4 commits into
ozzywalsh wants to merge 4 commits into
Conversation
ozzywalsh
force-pushed
the
fix/telemetry-resource-declarative-format
branch
from
June 19, 2026 12:13
1ce7efc to
1da7283
Compare
ozzywalsh
marked this pull request as ready for review
June 19, 2026 12:39
pavolloffay
reviewed
Jun 24, 2026
|
|
||
| tel := GetTelemetry(&svc, logr.Discard()) | ||
| require.NotNil(t, tel) | ||
| assert.Equal(t, "detailed", tel.Metrics.Level) |
Member
There was a problem hiding this comment.
if possible it's better to assert on the entire telemetry object, rather than pieces of it.
| require.False(t, *reader.Pull.Exporter.Prometheus.WithoutScopeInfo) | ||
| } | ||
|
|
||
| func TestGetTelemetryWithLegacyResource(t *testing.T) { |
Member
There was a problem hiding this comment.
could you please dry this test with table driven approach? In in single test we could execute the apply defaults and get telemetry.
ozzywalsh
force-pushed
the
fix/telemetry-resource-declarative-format
branch
from
July 7, 2026 14:13
1da7283 to
a71a4fa
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5229 +/- ##
==========================================
+ Coverage 63.05% 63.07% +0.01%
==========================================
Files 215 215
Lines 15261 15261
==========================================
+ Hits 9623 9626 +3
+ Misses 4959 4956 -3
Partials 679 679
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Summary
Fixes #5207.
Telemetry.Resourcefield was typed asmap[string]*string, which rejected the declarativeresource.attributesarray format introduced in Collector v0.151.0GetTelemetryfailed to unmarshal, returned nil, andServiceApplyDefaultsoverwrote the entire telemetry block with defaults — dropping user-provided resource attributes, metrics level, and custom readersResourcetojson.RawMessageso both legacy and declarative formats pass through without interpretationTest plan
GetTelemetry,ServiceApplyDefaults, andTelemetryToAnyConfig