Skip to content

Fix ExpandedValue sanitization on struct collection#14413

Merged
mx-psi merged 12 commits into
open-telemetry:mainfrom
theomagellan:fix-expandedvalue-sanitization-on-struct-collection
Jan 20, 2026
Merged

Fix ExpandedValue sanitization on struct collection#14413
mx-psi merged 12 commits into
open-telemetry:mainfrom
theomagellan:fix-expandedvalue-sanitization-on-struct-collection

Conversation

@theomagellan
Copy link
Copy Markdown
Contributor

Description

useExpandedValue would resolve ExpandedValues after checking if a collection's type was "stringy." For collections of structs, isStringy always returns false, causing all ExpandedValues to be sanitized to their parsed values and breaking decoding of string fields if the parsed value was not string.

Now, useExpandedValue checks if it's dealing with a collection of structs; in which case, skip sanitization and rely on mapstructure's per-field decoding.

Testing

Added tests relying on configopaque.MapList which is an alias on the struct collection []Pair

theomagellan and others added 2 commits January 8, 2026 18:07
… unmarshalling a confmap

  `useExpandedValue` would resolve ExpandedValues after checking if a
  collection's type was "stringy." For collections of structs, `isStringy`
  always returns false, causing all ExpandedValues to be sanitized to their
  parsed values and breaking decoding of string fields if the parsed
  value was not `string`.

  Now, `useExpandedValue` checks if it's dealing with a collection of
  structs; in which case, skip sanitization and rely on mapstructure's
  per-field decoding.
@theomagellan theomagellan marked this pull request as ready for review January 12, 2026 16:21
@theomagellan theomagellan requested review from a team, evan-bradley and mx-psi as code owners January 12, 2026 16:21
@theomagellan
Copy link
Copy Markdown
Contributor Author

As discussed with @mx-psi, I'm kindly pinging @jade-guiton-dd to this PR!

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 13, 2026

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.79%. Comparing base (97f66a9) to head (80a019a).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
confmap/internal/decoder.go 0.00% 5 Missing and 1 partial ⚠️

❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #14413      +/-   ##
==========================================
- Coverage   91.83%   91.79%   -0.04%     
==========================================
  Files         677      677              
  Lines       42679    42680       +1     
==========================================
- Hits        39195    39180      -15     
- Misses       2427     2439      +12     
- Partials     1057     1061       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@jade-guiton-dd
Copy link
Copy Markdown
Contributor

jade-guiton-dd commented Jan 14, 2026

Hello 👋 Sorry, even after reading the existing code and your PR, I still don't really understand what the problem was. Could you expand on:

causing all ExpandedValues to be sanitized to their parsed values and breaking decoding of string fields if the parsed value was not string.

Reading the code, it seems to me that an array of structs should already be kept as-is by the sanitization operation. Did I miss something?

@theomagellan
Copy link
Copy Markdown
Contributor Author

Reading the code, it seems to me that an array of structs should already be kept as-is by the sanitization operation. Did I miss something?

The issue used to happen in cases like what this test does.

When decoding an ExpandedValue inside a struct field in a collection, the code would decode the ExpandedValue as its Value field (of any type) because we were deeming that a struct type was not stringy.
This would break cases like mentioned above where we would, later on in the unmarshalling process, try to set the result of our decoded ExpandedValue inside a struct field that would have been decoded as stringy if the decoding operation would've been delayed.

Commenting the fix and running the added tests fails with the error:

FAIL: TestMapListWithExpandedValueIntValue (0.00s)
[...]
'headers[0].value' expected type 'configopaque.String', got unconvertible type 'int'

Since the ExpandedValue was decoded as its Value because useExpandedValue called isStringyStructure on the type of the collection (collection is []Pair, so the type is Pair) which is not a stringy type.

Sorry if I wasn't clear enough before, I hope my explanations help!

@jade-guiton-dd
Copy link
Copy Markdown
Contributor

jade-guiton-dd commented Jan 14, 2026

Ah, it seems there was a misunderstanding on my part (isStringyStructure checks the type of the destination, whereas sanitizeExpanded switches over the type of the source). The PR makes sense to me now.

One thing I thought about is that, in the same way your PR delegates to mapstructure the task of inspecting the struct so we can more accurately tell when we're assigning ExpandedValues to strings, have you tried completely deleting the switch to.Kind() { blocks, so that arrays/slices/maps all get mapped by mapstructure instead of the sanitize functions, and we just rely on the initial test to identify values to keep as strings? It's possible there's an edge case I'm not thinking of where that wouldn't work, but I feel like that would be worth a try to simplify the logic instead of making it more complex.

@theomagellan
Copy link
Copy Markdown
Contributor Author

I tested it and it also solves the issue and doesn't break any other tests.
My understanding of the code was that these checks were here for performance improvements, as for cases like []string we can avoid subsequent hook calls since we already know that the collection is only composed of stringy elements.

I do agree that removing the switch altogether would make the code simpler and would also resolve any edge cases like the one I brought up. What do you think?

@jade-guiton-dd
Copy link
Copy Markdown
Contributor

Regardless of Pablo's intent 2 years ago, I suspect it's not actually an optimization: I think mapstructure will walk the sanitized slice/map returned by the hook and call it again on each contained items regardless. So I don't think removing the switch should cause a performance regression; I'd say it's an unconditional improvement.

However, I'm not 100% confident that this won't break someone somewhere (mapstructure's behavior and the interactions between our hooks can be a bit arcane in my experience), so I think it may be prudent to introduce a beta feature gate and run the latter part of the function if the gate has been disabled. That way we have a quick solution if someone encounters breakage; and if we don't receive any complaints, we can stabilize the gate and fully remove the code in a few releases.

Comment thread confmap/internal/featuregates.go Outdated
featuregate.StageBeta,
featuregate.WithRegisterFromVersion("v0.144.0"),
featuregate.WithRegisterDescription("Disables early sanitization of ExpandedValue during config unmarshalling, allowing mapstructure to handle type conversion at the field level. Fixes decoding errors when environment variable values are parsed as non-string types (e.g., numbers, booleans) but need to be assigned to string fields."),
featuregate.WithRegisterReferenceURL("https://github.com/open-telemetry/opentelemetry-collector/pull/14413#issuecomment-3754949484"),
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

All other featuregates reference issues directly instead of PRs.
Should I create an issue or is this good enough? Sorry.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think referencing a PR should be fine.

Comment thread confmap/internal/decoder.go Outdated
Comment on lines +102 to +105
// converted based on its target field type.
if elemType.Kind() == reflect.Struct {
return data, nil
}
Copy link
Copy Markdown
Contributor Author

@theomagellan theomagellan Jan 15, 2026

Choose a reason for hiding this comment

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

I still kept the original fix inside the old behavior since it's still required to fix the problem I encountered.
I'm happy to remove it if you think it's unnecessary.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hm, I doubt the original fix would cause issues, but out of caution, I'd rather have disabling the feature gate return to the previous behavior, bug included. I figure that if someone's setup is broken by the new fix, I think there's a reasonable chance they will be broken by the original fix as well.

@mx-psi
Copy link
Copy Markdown
Member

mx-psi commented Jan 15, 2026

Regardless of Pablo's intent 2 years ago, I suspect it's not actually an optimization: I think mapstructure will walk the sanitized slice/map returned by the hook and call it again on each contained items regardless. So I don't think removing the switch should cause a performance regression; I'd say it's an unconditional improvement.

To be clear although I don't remember exactly what I was thinking at that point I don't think my intent here was performance-related, it was probably more just an oversight/something behavior-related.

However, I'm not 100% confident that this won't break someone somewhere (mapstructure's behavior and the interactions between our hooks can be a bit arcane in my experience), so I think it may be prudent to introduce a beta feature gate and run the latter part of the function if the gate has been disabled. That way we have a quick solution if someone encounters breakage; and if we don't receive any complaints, we can stabilize the gate and fully remove the code in a few releases.

I agree with this, mapstructure is always arcane!

  - revert to old behavior when feature gate disabled, bug included
  - test unmarshalling with both behaviors and expect error when feature
    gate disabled
Copy link
Copy Markdown
Contributor

@jade-guiton-dd jade-guiton-dd left a comment

Choose a reason for hiding this comment

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

Looks good, just need to run make gotidy and add a change log entry (make chlog-new).

Codecov is claiming the old code in the if is completely untested, so I would also recommend confirming with a debugger whether the old code is being reached in the latter half of TestMapListWithExpandedValueIntValue. It could just be an issue with Codecov however.

Comment thread confmap/internal/featuregates.go Outdated
@theomagellan theomagellan force-pushed the fix-expandedvalue-sanitization-on-struct-collection branch from 0e6ef84 to 3f49486 Compare January 16, 2026 12:28
}

// TestStringyStructureWithExpandedValue tests the isStringyStructure path in useExpandValue
func TestStringyStructureWithExpandedValue(t *testing.T) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

With this new test, we should now cover all cases in both the new and old behavior.

@theomagellan theomagellan force-pushed the fix-expandedvalue-sanitization-on-struct-collection branch from 3f49486 to 68015e6 Compare January 16, 2026 12:50
  - renamed featuregate
  - added test with a stringy collection
  - added changelog entry
Co-authored-by: Jade Guiton <jade.guiton@datadoghq.com>
@theomagellan theomagellan force-pushed the fix-expandedvalue-sanitization-on-struct-collection branch from 68015e6 to 97efc61 Compare January 16, 2026 13:09
  The e2e test module was not recording coverage for the parent
  `confmap/internal` package that it tests. This caused test coverage
  to appear as 0% even though the tests exercise the code.

  This adds the parent package to COVER_PKGS so coverage of
  `confmap/internal` is properly tracked for e2e tests.
Comment thread confmap/internal/e2e/Makefile Outdated
include ../../../Makefile.Common

# Override COVER_PKGS to include the parent package that this e2e module tests
COVER_PKGS := go.opentelemetry.io/collector/confmap/internal,$(COVER_PKGS)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This seems to be needed since I am covering code in confmap/internal from the e2e module.
This feels out of scope of the PR to me and I would appreciate any suggestions on how we could handle this coverage issue!

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.

I think we can do this in a separate PR if you are up to contributing it. In any case it's not a requirement for merging this PR (codecov is not a required check)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thank you. I will revert this commit and open a new PR.
In the meantime, do you have any ideas why the changelog validate is unhappy? I don't really understand the issue here.

Copy link
Copy Markdown
Contributor

@jade-guiton-dd jade-guiton-dd Jan 16, 2026

Choose a reason for hiding this comment

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

I think that's an issue from other changelogs on main, so no worries.

Comment thread .chloggen/fix-expandedvalue-sanitization-on-struct-collection.yaml Outdated
Copy link
Copy Markdown
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

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

Almost there!

Comment thread .chloggen/fix-expandedvalue-sanitization-on-struct-collection.yaml Outdated
Comment thread .chloggen/fix-expandedvalue-sanitization-on-struct-collection.yaml Outdated
theomagellan and others added 2 commits January 19, 2026 14:11
Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
@mx-psi
Copy link
Copy Markdown
Member

mx-psi commented Jan 20, 2026

Can you solve the merge conflict? Once you have dealt with that I can merge it

@mx-psi mx-psi enabled auto-merge January 20, 2026 15:09
@mx-psi mx-psi added this pull request to the merge queue Jan 20, 2026
Merged via the queue into open-telemetry:main with commit 246e428 Jan 20, 2026
60 of 61 checks passed
@otelbot
Copy link
Copy Markdown
Contributor

otelbot Bot commented Jan 20, 2026

Thank you for your contribution @theomagellan! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey.

github-merge-queue Bot pushed a commit that referenced this pull request Jan 21, 2026
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
The e2e test module was not recording coverage for the parent
`confmap/internal` package that it tests. This caused test coverage to
appear as 0% even though the tests exercise the code.

This adds the parent package to `COVER_PKGS` so coverage of
`confmap/internal` is properly tracked for e2e tests.
When looking at overall coverage of `confmap/internal/decoder.go`, it
goes from 91.4% to 96.3% of statements.
#### Link to tracking issue

Issue was found in PR
#14413 (review).

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Running `make gotest-with-cover` without the fix, then looking at
coverage in percentage with
```bash
go tool covdata percent -i=./coverage/unit -pkg=go.opentelemetry.io/collector/confmap/internal
```
Running these commands again with the fix added shows the improvement.

The e2e tests can also be run individually to verify they're tracking
parent package coverage:
```bash
make -C confmap/internal/e2e test-with-cover
# [...] coverage: 45.3% of statements in go.opentelemetry.io/collector/confmap/internal, go.opentelemetry.io/collector/confmap/internal/e2e, )
```
<!--Describe the documentation added.-->
zeekay pushed a commit to hanzoai/telemetry that referenced this pull request Feb 22, 2026
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
The e2e test module was not recording coverage for the parent
`confmap/internal` package that it tests. This caused test coverage to
appear as 0% even though the tests exercise the code.

This adds the parent package to `COVER_PKGS` so coverage of
`confmap/internal` is properly tracked for e2e tests.
When looking at overall coverage of `confmap/internal/decoder.go`, it
goes from 91.4% to 96.3% of statements.
#### Link to tracking issue

Issue was found in PR
open-telemetry/opentelemetry-collector#14413 (review).

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Running `make gotest-with-cover` without the fix, then looking at
coverage in percentage with
```bash
go tool covdata percent -i=./coverage/unit -pkg=go.opentelemetry.io/collector/confmap/internal
```
Running these commands again with the fix added shows the improvement.

The e2e tests can also be run individually to verify they're tracking
parent package coverage:
```bash
make -C confmap/internal/e2e test-with-cover
# [...] coverage: 45.3% of statements in go.opentelemetry.io/collector/confmap/internal, go.opentelemetry.io/collector/confmap/internal/e2e, )
```
<!--Describe the documentation added.-->
TimoBehrendt pushed a commit to TimoBehrendt/tracebasedlogsampler that referenced this pull request Mar 19, 2026
…ocessortest to v0.147.0 (#38)

This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [go.opentelemetry.io/collector/processor/processortest](https://github.com/open-telemetry/opentelemetry-collector) | `v0.144.0` → `v0.147.0` | ![age](https://developer.mend.io/api/mc/badges/age/go/go.opentelemetry.io%2fcollector%2fprocessor%2fprocessortest/v0.147.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/go/go.opentelemetry.io%2fcollector%2fprocessor%2fprocessortest/v0.144.0/v0.147.0?slim=true) |

---

### Release Notes

<details>
<summary>open-telemetry/opentelemetry-collector (go.opentelemetry.io/collector/processor/processortest)</summary>

### [`v0.147.0`](https://github.com/open-telemetry/opentelemetry-collector/blob/HEAD/CHANGELOG.md#v1530v01470)

[Compare Source](open-telemetry/opentelemetry-collector@v0.146.1...v0.147.0)

##### 💡 Enhancements 💡

- `exporter/debug`: Output bucket counts for exponential histogram data points in normal verbosity. ([#&#8203;10463](open-telemetry/opentelemetry-collector#10463))
- `pkg/exporterhelper`: Add `metadata_keys` configuration to `sending_queue.batch.partition` to partition batches by client metadata ([#&#8203;14139](open-telemetry/opentelemetry-collector#14139))
  The `metadata_keys` configuration option is now available in the `sending_queue.batch.partition` section for all exporters.
  When specified, batches are partitioned based on the values of the listed metadata keys, allowing separate batching per metadata partition. This feature
  is automatically configured when using `exporterhelper.WithQueue()`.

##### 🧰 Bug fixes 🧰

- `cmd/builder`: Fix duplicate error output when CLI command execution fails in the builder tool. ([#&#8203;14436](open-telemetry/opentelemetry-collector#14436))

- `cmd/mdatagen`: Fix duplicate error output when CLI command execution fails in the mdatagen tool. ([#&#8203;14436](open-telemetry/opentelemetry-collector#14436))

- `cmd/mdatagen`: Fix semconv URL validation for metrics with underscores in their names ([#&#8203;14583](open-telemetry/opentelemetry-collector#14583))
  Metrics like `system.disk.io_time` now correctly validate against semantic convention URLs containing underscores in the anchor tag.

- `extension/memory_limiter`: Use ChainUnaryInterceptor instead of UnaryInterceptor to allow multiple interceptors. ([#&#8203;14634](open-telemetry/opentelemetry-collector#14634))
  If multiple extensions that use the UnaryInterceptor are set the binary panics at start time.

- `extension/memory_limiter`: Add support for streaming services. ([#&#8203;14634](open-telemetry/opentelemetry-collector#14634))

- `pkg/config/configmiddleware`: Add context.Context to HTTP middleware interface constructors. ([#&#8203;14523](open-telemetry/opentelemetry-collector#14523))
  This is a breaking API change for components that implement or use extensionmiddleware.

- `pkg/confmap`: Fix another issue where configs could fail to decode when using interpolated values in string fields. ([#&#8203;14034](open-telemetry/opentelemetry-collector#14034))
  For example, a resource attribute can be set via an environment variable to a string that is parseable as a number, e.g. `1234`.

  (A similar bug was fixed in a previous release: that one was triggered when the field was nested in a struct,
  whereas this one is triggered when the field internally has type "pointer to string" rather than "string".)

- `pkg/otelcol`: The featuregate subcommand now rejects extra positional arguments instead of silently ignoring them. ([#&#8203;14554](open-telemetry/opentelemetry-collector#14554))

- `pkg/queuebatch`: Fix data race in partition\_batcher where resetTimer() was called outside mutex, causing concurrent timer.Reset() calls and unpredictable batch flush timing under load. ([#&#8203;14491](open-telemetry/opentelemetry-collector#14491))

- `pkg/scraperhelper`: Log scrapers now emit log-appropriate receiver telemetry ([#&#8203;14654](open-telemetry/opentelemetry-collector#14654))
  Log scrapers previously emitted the same receiver telemetry as metric scrapers,
  such as the otelcol\_receiver\_accepted\_metric\_points metric (instead of otelcol\_receiver\_accepted\_log\_records),
  or spans named receiver/myreceiver/MetricsReceived (instead of receiver/myreceiver/LogsReceived).

  This did not affect scraper-specific spans and metrics.

- `processor/batch`: Fixes a bug where the batch processor would not copy `SchemaUrl` metadata from resource and scope containers during partial batch splits. ([#&#8203;12279](open-telemetry/opentelemetry-collector#12279), [#&#8203;14620](open-telemetry/opentelemetry-collector#14620))

<!-- previous-version -->

### [`v0.146.1`](https://github.com/open-telemetry/opentelemetry-collector/blob/HEAD/CHANGELOG.md#v1520v01461)

[Compare Source](open-telemetry/opentelemetry-collector@v0.146.0...v0.146.1)

<!-- previous-version -->

### [`v0.146.0`](https://github.com/open-telemetry/opentelemetry-collector/blob/HEAD/CHANGELOG.md#v01460)

[Compare Source](open-telemetry/opentelemetry-collector@v0.145.0...v0.146.0)

##### 🛑 Breaking changes 🛑

- `all`: Increase minimum Go version to 1.25 ([#&#8203;14567](open-telemetry/opentelemetry-collector#14567))

##### 🚩 Deprecations 🚩

- `pdata/pprofile`: Declare removed aggregation elements as deprecated. ([#&#8203;14528](open-telemetry/opentelemetry-collector#14528))

##### 💡 Enhancements 💡

- `all`: Add detailed failure attributes to exporter send\_failed metrics at detailed telemetry level. ([#&#8203;13956](open-telemetry/opentelemetry-collector#13956))
  The `otelcol_exporter_send_failed_{spans,metric_points,log_records}` metrics now include
  failure attributes when telemetry level is Detailed: `error.type` (OpenTelemetry semantic convention
  describing the error class) and `error.permanent` (indicates if error is permanent/non-retryable).
  The `error.type` attribute captures gRPC status codes (e.g., "Unavailable", "ResourceExhausted"),
  standard Go context errors (e.g., "canceled", "deadline\_exceeded"),
  and collector-specific errors (e.g., "shutdown").
  This enables better alerting and debugging by providing standardized error classification.

- `cmd/builder`: Introduce new experimental `init` subcommand ([#&#8203;14530](open-telemetry/opentelemetry-collector#14530))
  The new `init` subcommand initializes a new custom collector

- `cmd/builder`: Add "telemetry" field to allow configuring telemetry providers ([#&#8203;14575](open-telemetry/opentelemetry-collector#14575))
  Most users should not need to use this, this field should only be set if you
  intend to provide your own OpenTelemetry SDK.

- `cmd/mdatagen`: Introduce additional metadata (the version since the deprecation started, and the deprecation reason) for deprecated metrics. ([#&#8203;14113](open-telemetry/opentelemetry-collector#14113))

- `cmd/mdatagen`: Add optional `relationships` field to entity schema in metadata.yaml ([#&#8203;14284](open-telemetry/opentelemetry-collector#14284))

- `exporter/debug`: Add `output_paths` configuration option to control output destination when `use_internal_logger` is false. ([#&#8203;10472](open-telemetry/opentelemetry-collector#10472))
  When `use_internal_logger` is set to `false`, the debug exporter now supports configuring the output destination via the `output_paths` option.
  This allows users to send debug exporter output to `stdout`, `stderr`, or a file path.
  The default value is `["stdout"]` to maintain backward compatibility.

- `pkg/confmap`: Add experimental `ToStringMapRaw` function to decode `confmap.Conf` into a string map without losing internal types ([#&#8203;14480](open-telemetry/opentelemetry-collector#14480))
  This method exposes the internal structure of a `confmap.Conf` which may change at any time without prior notice

##### 🧰 Bug fixes 🧰

- `cmd/mdatagen`: Reset aggDataPoints during metric init to avoid index out of range panic across emit cycles when reaggregation is enabled. ([#&#8203;14569](open-telemetry/opentelemetry-collector#14569))
- `cmd/mdatagen`: Fix panic when mdatagen is run without arguments. ([#&#8203;14506](open-telemetry/opentelemetry-collector#14506))
- `pdata/pprofile`: Fix off-by-one issue in dictionary lookups. ([#&#8203;14534](open-telemetry/opentelemetry-collector#14534))
- `pkg/config/confighttp`: Fix high cardinality span name from request method from confighttp server internal telemetry ([#&#8203;14516](open-telemetry/opentelemetry-collector#14516))
  Follow spec to bound request method cardinality.
- `pkg/otelcol`: Ignore component aliases in the `otelcol components` command ([#&#8203;14492](open-telemetry/opentelemetry-collector#14492))
- `pkg/otelcol`: Order providers and converters in alphabetical order in the `components` subcommand. ([#&#8203;14476](open-telemetry/opentelemetry-collector#14476))

<!-- previous-version -->

### [`v0.145.0`](https://github.com/open-telemetry/opentelemetry-collector/blob/HEAD/CHANGELOG.md#v1510v01450)

[Compare Source](open-telemetry/opentelemetry-collector@v0.144.0...v0.145.0)

##### 💡 Enhancements 💡

- `pkg/scraperhelper`: ScraperID has been added to the logs for metrics, logs, and profiles ([#&#8203;14461](open-telemetry/opentelemetry-collector#14461))

##### 🧰 Bug fixes 🧰

- `exporter/otlp_grpc`: Fix the OTLP exporter balancer to use round\_robin by default, as intended. ([#&#8203;14090](open-telemetry/opentelemetry-collector#14090))

- `pkg/config/configoptional`: Fix `Unmarshal` methods not being called when config is wrapped inside `Optional` ([#&#8203;14500](open-telemetry/opentelemetry-collector#14500))
  This bug notably manifested in the fact that the `sending_queue::batch::sizer` config for exporters
  stopped defaulting to `sending_queue::sizer`, which sometimes caused the wrong units to be used
  when configuring `sending_queue::batch::min_size` and `max_size`.

  As part of the fix, `xconfmap` exposes a new `xconfmap.WithForceUnmarshaler` option, to be used in the `Unmarshal` methods
  of wrapper types like `configoptional.Optional` to make sure the `Unmarshal` method of the inner type is called.

  The default behavior remains that calling `conf.Unmarshal` on the `confmap.Conf` passed as argument to an `Unmarshal`
  method will skip any top-level `Unmarshal` methods to avoid infinite recursion in standard use cases.

- `pkg/confmap`: Fix an issue where configs could fail to decode when using interpolated values in string fields. ([#&#8203;14413](open-telemetry/opentelemetry-collector#14413))
  For example, a header can be set via an environment variable to a string that is parseable as a number, e.g. `1234`

- `pkg/service`: Don't error on startup when process metrics are enabled on unsupported OSes (e.g. AIX) ([#&#8203;14307](open-telemetry/opentelemetry-collector#14307))

<!-- previous-version -->

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My41LjQiLCJ1cGRhdGVkSW5WZXIiOiI0My41LjQiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbXX0=-->

Reviewed-on: https://gitea.t000-n.de/t.behrendt/tracebasedlogsampler/pulls/38
Reviewed-by: t.behrendt <t.behrendt@noreply.localhost>
Co-authored-by: Renovate Bot <renovate@t00n.de>
Co-committed-by: Renovate Bot <renovate@t00n.de>
TimoBehrendt pushed a commit to TimoBehrendt/tracebasedlogsampler that referenced this pull request Mar 26, 2026
…1.54.0 (#33)

This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [go.opentelemetry.io/collector/confmap](https://github.com/open-telemetry/opentelemetry-collector) | `v1.50.0` → `v1.54.0` | ![age](https://developer.mend.io/api/mc/badges/age/go/go.opentelemetry.io%2fcollector%2fconfmap/v1.54.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/go/go.opentelemetry.io%2fcollector%2fconfmap/v1.50.0/v1.54.0?slim=true) |

---

### Release Notes

<details>
<summary>open-telemetry/opentelemetry-collector (go.opentelemetry.io/collector/confmap)</summary>

### [`v1.54.0`](https://github.com/open-telemetry/opentelemetry-collector/blob/HEAD/CHANGELOG.md#v1540v01480)

##### ❗ Known Issues ❗

- `service`: The collector's internal Prometheus metrics endpoint (`:8888`) now emits OTel service labels with underscore
  names (`service_name`, `service_instance_id`, `service_version`) instead of dot-notation names (`service.name`,
  `service.instance.id`, `service.version`). Users scraping this endpoint with the Prometheus receiver will see these renamed
  labels in resource and datapoint attributes. As a workaround, add the following `metric_relabel_configs` to your scrape
  config in prometheus receiver:
  ```yaml
  metric_relabel_configs:
    - source_labels: [service_name]
      target_label: service.name
    - source_labels: [service_instance_id]
      target_label: service.instance.id
    - source_labels: [service_version]
      target_label: service.version
    - regex: service_name|service_instance_id|service_version
      action: labeldrop
  ```
  See [#&#8203;14814](open-telemetry/opentelemetry-collector#14814) for details and updates.

##### 🛑 Breaking changes 🛑

- `all`: Change metric units to be singular to match OTel specification, e.g. `{requests}` -> `{request}` ([#&#8203;14753](open-telemetry/opentelemetry-collector#14753))

##### 💡 Enhancements 💡

- `cmd/mdatagen`: Add deprecated\_type field to allow specifying an alias for component types. ([#&#8203;14718](open-telemetry/opentelemetry-collector#14718))
- `cmd/mdatagen`: Generate entity-scoped MetricsBuilder API that enforces entity-metric associations at compile time ([#&#8203;14659](open-telemetry/opentelemetry-collector#14659))
- `cmd/mdatagen`: Skip generating reaggregation config options for metrics that have no aggregatable attributes. ([#&#8203;14689](open-telemetry/opentelemetry-collector#14689))
- `pkg/service`: The internal status reporter no longer drops repeated Ok and RecoverableError statuses ([#&#8203;14282](open-telemetry/opentelemetry-collector#14282))
  Status events can now carry metadata and there's value in allowing them to be emitted despite the status value itself
  not changing.

##### 🧰 Bug fixes 🧰

- `cmd/builder`: Add `.exe` to output binary names when building for Windows targets. ([#&#8203;12591](open-telemetry/opentelemetry-collector#12591))

- `exporter/debug`: Add printing of metric metadata in detailed verbosity. ([#&#8203;14667](open-telemetry/opentelemetry-collector#14667))

- `exporter/otlp_grpc`: Prevent nil pointer panic when push methods are called before the OTLP exporter initializes its gRPC clients. ([#&#8203;14663](open-telemetry/opentelemetry-collector#14663))
  When the sending queue and retry are disabled, calling ConsumeTraces,
  ConsumeMetrics, ConsumeLogs, or ConsumeProfiles before the OTLP exporter
  initializes its gRPC clients could cause a nil pointer dereference panic.
  The push methods now return an error instead of panicking.

- `exporter/otlp_http`: Show the actual destination URL in error messages when request URL is modified by middleware. ([#&#8203;14673](open-telemetry/opentelemetry-collector#14673))
  Unwraps the `*url.Error` returned by `http.Client.Do()` to prevent misleading error logs when a middleware extension dynamically updates the endpoint.

- `pdata/pprofile`: Switch the dictionary of dictionary tables entries only once when merging profiles ([#&#8203;14709](open-telemetry/opentelemetry-collector#14709))
  For dictionary table data, we used to switch their dictionaries when doing
  the switch for the data that uses them.
  However, when an entry is associated with multiple other data (several
  samples can use the same stack), we would have been switching the
  dictionaries of the entry multiple times.

  We now switch dictionaries for dictionary table data only once, before
  switching the resource profiles.

<!-- previous-version -->

### [`v1.53.0`](https://github.com/open-telemetry/opentelemetry-collector/blob/HEAD/CHANGELOG.md#v1530v01470)

##### 💡 Enhancements 💡

- `exporter/debug`: Output bucket counts for exponential histogram data points in normal verbosity. ([#&#8203;10463](open-telemetry/opentelemetry-collector#10463))
- `pkg/exporterhelper`: Add `metadata_keys` configuration to `sending_queue.batch.partition` to partition batches by client metadata ([#&#8203;14139](open-telemetry/opentelemetry-collector#14139))
  The `metadata_keys` configuration option is now available in the `sending_queue.batch.partition` section for all exporters.
  When specified, batches are partitioned based on the values of the listed metadata keys, allowing separate batching per metadata partition. This feature
  is automatically configured when using `exporterhelper.WithQueue()`.

##### 🧰 Bug fixes 🧰

- `cmd/builder`: Fix duplicate error output when CLI command execution fails in the builder tool. ([#&#8203;14436](open-telemetry/opentelemetry-collector#14436))

- `cmd/mdatagen`: Fix duplicate error output when CLI command execution fails in the mdatagen tool. ([#&#8203;14436](open-telemetry/opentelemetry-collector#14436))

- `cmd/mdatagen`: Fix semconv URL validation for metrics with underscores in their names ([#&#8203;14583](open-telemetry/opentelemetry-collector#14583))
  Metrics like `system.disk.io_time` now correctly validate against semantic convention URLs containing underscores in the anchor tag.

- `extension/memory_limiter`: Use ChainUnaryInterceptor instead of UnaryInterceptor to allow multiple interceptors. ([#&#8203;14634](open-telemetry/opentelemetry-collector#14634))
  If multiple extensions that use the UnaryInterceptor are set the binary panics at start time.

- `extension/memory_limiter`: Add support for streaming services. ([#&#8203;14634](open-telemetry/opentelemetry-collector#14634))

- `pkg/config/configmiddleware`: Add context.Context to HTTP middleware interface constructors. ([#&#8203;14523](open-telemetry/opentelemetry-collector#14523))
  This is a breaking API change for components that implement or use extensionmiddleware.

- `pkg/confmap`: Fix another issue where configs could fail to decode when using interpolated values in string fields. ([#&#8203;14034](open-telemetry/opentelemetry-collector#14034))
  For example, a resource attribute can be set via an environment variable to a string that is parseable as a number, e.g. `1234`.

  (A similar bug was fixed in a previous release: that one was triggered when the field was nested in a struct,
  whereas this one is triggered when the field internally has type "pointer to string" rather than "string".)

- `pkg/otelcol`: The featuregate subcommand now rejects extra positional arguments instead of silently ignoring them. ([#&#8203;14554](open-telemetry/opentelemetry-collector#14554))

- `pkg/queuebatch`: Fix data race in partition\_batcher where resetTimer() was called outside mutex, causing concurrent timer.Reset() calls and unpredictable batch flush timing under load. ([#&#8203;14491](open-telemetry/opentelemetry-collector#14491))

- `pkg/scraperhelper`: Log scrapers now emit log-appropriate receiver telemetry ([#&#8203;14654](open-telemetry/opentelemetry-collector#14654))
  Log scrapers previously emitted the same receiver telemetry as metric scrapers,
  such as the otelcol\_receiver\_accepted\_metric\_points metric (instead of otelcol\_receiver\_accepted\_log\_records),
  or spans named receiver/myreceiver/MetricsReceived (instead of receiver/myreceiver/LogsReceived).

  This did not affect scraper-specific spans and metrics.

- `processor/batch`: Fixes a bug where the batch processor would not copy `SchemaUrl` metadata from resource and scope containers during partial batch splits. ([#&#8203;12279](open-telemetry/opentelemetry-collector#12279), [#&#8203;14620](open-telemetry/opentelemetry-collector#14620))

<!-- previous-version -->

### [`v1.52.0`](https://github.com/open-telemetry/opentelemetry-collector/blob/HEAD/CHANGELOG.md#v1520v01461)

<!-- previous-version -->

### [`v1.51.0`](https://github.com/open-telemetry/opentelemetry-collector/blob/HEAD/CHANGELOG.md#v1510v01450)

##### 💡 Enhancements 💡

- `pkg/scraperhelper`: ScraperID has been added to the logs for metrics, logs, and profiles ([#&#8203;14461](open-telemetry/opentelemetry-collector#14461))

##### 🧰 Bug fixes 🧰

- `exporter/otlp_grpc`: Fix the OTLP exporter balancer to use round\_robin by default, as intended. ([#&#8203;14090](open-telemetry/opentelemetry-collector#14090))

- `pkg/config/configoptional`: Fix `Unmarshal` methods not being called when config is wrapped inside `Optional` ([#&#8203;14500](open-telemetry/opentelemetry-collector#14500))
  This bug notably manifested in the fact that the `sending_queue::batch::sizer` config for exporters
  stopped defaulting to `sending_queue::sizer`, which sometimes caused the wrong units to be used
  when configuring `sending_queue::batch::min_size` and `max_size`.

  As part of the fix, `xconfmap` exposes a new `xconfmap.WithForceUnmarshaler` option, to be used in the `Unmarshal` methods
  of wrapper types like `configoptional.Optional` to make sure the `Unmarshal` method of the inner type is called.

  The default behavior remains that calling `conf.Unmarshal` on the `confmap.Conf` passed as argument to an `Unmarshal`
  method will skip any top-level `Unmarshal` methods to avoid infinite recursion in standard use cases.

- `pkg/confmap`: Fix an issue where configs could fail to decode when using interpolated values in string fields. ([#&#8203;14413](open-telemetry/opentelemetry-collector#14413))
  For example, a header can be set via an environment variable to a string that is parseable as a number, e.g. `1234`

- `pkg/service`: Don't error on startup when process metrics are enabled on unsupported OSes (e.g. AIX) ([#&#8203;14307](open-telemetry/opentelemetry-collector#14307))

<!-- previous-version -->

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My41LjQiLCJ1cGRhdGVkSW5WZXIiOiI0My41LjQiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbXX0=-->

Reviewed-on: https://gitea.t000-n.de/t.behrendt/tracebasedlogsampler/pulls/33
Reviewed-by: t.behrendt <t.behrendt@noreply.localhost>
Co-authored-by: Renovate Bot <renovate@t00n.de>
Co-committed-by: Renovate Bot <renovate@t00n.de>
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.

3 participants