Skip to content

[processor/tailsampling] add sampling_strategy config with trace-complete and span-ingest modes#46762

Merged
andrzej-stencel merged 14 commits into
open-telemetry:mainfrom
carsonip:tailsampling-trace-complete-span-ingest-clean
Mar 24, 2026
Merged

[processor/tailsampling] add sampling_strategy config with trace-complete and span-ingest modes#46762
andrzej-stencel merged 14 commits into
open-telemetry:mainfrom
carsonip:tailsampling-trace-complete-span-ingest-clean

Conversation

@carsonip
Copy link
Copy Markdown
Contributor

@carsonip carsonip commented Mar 9, 2026

Description

Add sampling_strategy config to processor/tailsampling with two explicit modes:

  • trace-complete (default): classic timer-based tail sampling with full-trace evaluation context.
  • span-ingest: evaluate each incoming batch on ingest, finalize terminal outcomes (sampled/dropped) immediately, and cleanup-finalize unresolved traces as not sampled without policy re-evaluation.

This implementation also:

  • validates strategy values and defaults to trace-complete.
  • enforces stateless policies in span-ingest mode (IsStateful() == false).
  • records ingest-time decision telemetry for span-ingest.
  • aligns tests/docs/schema/comments with implemented behavior.
  • supports earlier batch timing after root-span arrival via decision_wait_after_root_received in both modes (earlier decision in trace-complete, earlier pending cleanup finalization in span-ingest).

Link to tracking issue

Fixes #46600.

Testing

  • go test ./... (in processor/tailsamplingprocessor)
  • Updated/added tests for:
    • ingest-time terminal decisions in span-ingest
    • pending cleanup finalization behavior
    • ingest ordering behavior
    • telemetry emission paths

Documentation

  • Updated processor/tailsamplingprocessor/README.md for strategy semantics and flow.
  • Updated processor/tailsamplingprocessor/config.schema.yaml descriptions for strategy/timer behavior.
  • Updated strategy/timer comments in processor/tailsamplingprocessor/config.go.
  • Added changelog entry: .chloggen/tailsampling-sampling-strategy-config.yaml.

…an-ingest

Consolidate sampling strategy behavior around two explicit modes by removing root-only ingest and updating processor, validation, tests, and docs to match the final decision model.

Assisted-by: ChatGPT 5.3 Codex
Made-with: Cursor
@carsonip carsonip changed the title [processor/tailsampling] Simplify sampling_strategy terminology to trace-complete and span-ingest [processor/tailsampling] Add trace-complete and span-ingest strategies as alternative to #46600 Mar 9, 2026
@carsonip carsonip changed the title [processor/tailsampling] Add trace-complete and span-ingest strategies as alternative to #46600 [processor/tailsampling] Add trace-complete and span-ingest strategies to enable optimizations Mar 9, 2026
carsonip added 7 commits March 9, 2026 15:02
Keep processTrace root-span presence as a boolean and pass trace.rootSpan != nil at the call site so this PR does not introduce unnecessary signature churn unrelated to strategy behavior.

Assisted-by: ChatGPT 5.3 Codex
Made-with: Cursor
…construction

Remove traceDataWithCurrentBatch and build the ingest-time one-batch TraceData inline to avoid an unnecessary helper while preserving batch isolation semantics.

Assisted-by: ChatGPT 5.3 Codex
Made-with: Cursor
…path

Construct the ingest-time one-batch TraceData by moving the current ResourceSpans into an isolated evaluation view and then moving it into buffered trace data, eliminating the previous CopyTo deep-copy in this hot path.

Assisted-by: ChatGPT 5.3 Codex
Made-with: Cursor
…nup timing

Apply decision_wait_after_root_received batch acceleration whenever a root span arrives so pending traces in span-ingest mode can be cleanup-finalized earlier, and document the strategy-specific timer semantics.

Assisted-by: ChatGPT 5.3 Codex
Made-with: Cursor
…havior

Update config comments and schema descriptions to match current trace-complete and span-ingest semantics, including root-wait timer effects on span-ingest cleanup finalization.

Assisted-by: ChatGPT 5.3 Codex
Made-with: Cursor
… heading

Condense sampling strategy documentation into a shorter high-signal section and add a dedicated policy decision flow header so README structure remains easy to scan.

Assisted-by: ChatGPT 5.3 Codex
Made-with: Cursor
Update config comments, schema, and README wording so decision_wait behavior is described correctly for both trace-complete decision timing and span-ingest pending cleanup finalization timing.

Assisted-by: ChatGPT 5.3 Codex
Made-with: Cursor
@carsonip carsonip changed the title [processor/tailsampling] Add trace-complete and span-ingest strategies to enable optimizations [processor/tailsampling] add sampling_strategy config with trace-complete and span-ingest modes Mar 9, 2026
…nfig

Add a chloggen entry describing the new sampling_strategy configuration with trace-complete and span-ingest modes, linked to issue open-telemetry#46600.

Assisted-by: ChatGPT 5.3 Codex
Made-with: Cursor
carsonip added 4 commits March 9, 2026 20:01
… mock evaluator

Make mockPolicyEvaluator thread-safe with mutex-guarded decision and count accessors and update span-ingest tests to use those synchronized methods, eliminating race-detector failures while keeping the mock-based test style.

Assisted-by: ChatGPT 5.3 Codex
Made-with: Cursor
…fe access

Make mockPolicyEvaluator field access private and expose synchronized helpers with names aligned to existing evaluator style (SetDecision, SetError, EvaluationCount), then update tests to use those methods consistently.

Assisted-by: ChatGPT 5.3 Codex
Made-with: Cursor
@carsonip carsonip marked this pull request as ready for review March 9, 2026 20:58
@carsonip carsonip requested review from a team and jmacd as code owners March 9, 2026 20:58
@github-actions github-actions Bot added the processor/tailsampling Tail sampling processor label Mar 9, 2026
Copy link
Copy Markdown
Contributor

@axw axw left a comment

Choose a reason for hiding this comment

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

@carsonip I haven't looked at much of the code, mostly the config & description. I'm just wondering about restricting span-ingest to stateless policies.

This would mean you can't have rate limiting or reservoir sampling on root spans with the same name, for example. Is that intentional?

@carsonip
Copy link
Copy Markdown
Contributor Author

I'm just wondering about restricting span-ingest to stateless policies.

It is intentional in this PR to keep the PR simple by banning all stateful ones. In longer term we may loosen the restraction to make it work with more stateful ones. This is because stateful policy evaluation in its current state will create some obviously incorrect interaction.

For example, with byte limiting, in its current state, as it adds the counter at evaluation time. Let's say there are 10 traces, each with 1 root span with 100 bytes and child span with 1 bytes. At a 10-byte limit, if it sees all child spans before root spans, all of them will reach a terminal decision of sample=true and end up ingesting 1010 bytes instead of 10 bytes.

At a high level, stateful policies that concern individual spans, e.g. rate limiting, should be okay, but ones that concern trace completeness may be theoretically infeasible without certain delay like "decision wait"

This would mean you can't have rate limiting or reservoir sampling on root spans with the same name, for example. Is that intentional?

TLDR it will be in follow up PRs

@andrzej-stencel andrzej-stencel merged commit be3f433 into open-telemetry:main Mar 24, 2026
191 checks passed
@csmarchbanks
Copy link
Copy Markdown
Contributor

Sadly I didn't see this until after it was merged, it is similar to some work I tried before implementing the after root span change: #44456. What I found in practice was that most of our instances only positively sample something like 1-10% of traces, so this didn't help with memory as much as I would have liked. I am curious if you found something different when working on this?

In addition, I worry that this solution could cause excessive CPU usage for large traces. Wouldn't each new batch that arrives re-run expensive evaluators such as ottl on each span, not just the new ones? I used a different interface to avoid this in my work, but I also like how simple the IsStateful interface is.

@carsonip
Copy link
Copy Markdown
Contributor Author

carsonip commented Apr 8, 2026

What I found in practice was that most of our instances only positively sample something like 1-10% of traces, so this didn't help with memory as much as I would have liked. I am curious if you found something different when working on this?

This is a limitation by design I'm afraid. For buffered spans to be released, we'll either have to

  • get an early terminal decision (sampled or dropped); or
  • wait for decision_wait or decision_wait_after_root_received

and if the policies don't really explicitly "drop", then you can only effectively save memory by early releasing the sampled ones, which would be 1-10% like you said.

Therefore, I tend to agree that unless the policies are tuned very well to sample / drop, the memory savings in its current state would not be significant. However, the true motivation behind this span-ingest mode is to unblock a long running feature request around disk offloading in #42326

In addition, I worry that this solution could cause excessive CPU usage for large traces. Wouldn't each new batch that arrives re-run expensive evaluators such as ottl on each span, not just the new ones?

This is not wrong, but evaluators are still effectively run per span, right? This would only introduce extra overhead in calling the evaluators more frequently on smaller collections of spans.

I used a different interface to avoid this in my work, but I also like how simple the IsStateful interface is.

IsStateful is more for correctness purposes, because I'd like to avoid some obviously incorrect interactions where a trace is sampled because byte_limiting likes the first span of this trace, without knowledge of the size of subsequent spans of the same trace.

@csmarchbanks
Copy link
Copy Markdown
Contributor

Unblocking the disk offloading work makes sense! Thanks!

In addition, I worry that this solution could cause excessive CPU usage for large traces. Wouldn't each new batch that arrives re-run expensive evaluators such as ottl on each span, not just the new ones?

This is not wrong, but evaluators are still effectively run per span, right? This would only introduce extra overhead in calling the evaluators more frequently on smaller collections of spans.

My concern is that the TSP now effectively calls the evaluators n_batches * n_spans times instead of just n_spans. Probably fine for small traces, but a large trace with lots of spans and batches would be doing a lot of repeat work.

Related to correctness I did open #47476 for some issues I saw and had ran into when doing my work as well :).

@carsonip
Copy link
Copy Markdown
Contributor Author

carsonip commented Apr 8, 2026

My concern is that the TSP now effectively calls the evaluators n_batches * n_spans times instead of just n_spans. Probably fine for small traces, but a large trace with lots of spans and batches would be doing a lot of repeat work.

On top of it, I'm concerned about the background goroutine being busier and causing backpressure to senders. But I haven't seen a bottleneck in practice so I didn't jump to the conclusion of adding sharded processing immediately. We may need to revisit this later, especially when span buffering involves more expensive IO.

Related to correctness I did open #47476 for some issues I saw and had ran into when doing my work as well :).

Thanks for creating the PR and pointing me to it! I'll take a look later.

JaredTan95 pushed a commit to openinsight-proj/opentelemetry-collector-contrib that referenced this pull request Apr 14, 2026
* Update module github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common to v1.3.61 (#47071)

This PR contains the following updates:

| Package | Change |
[Age](https://docs.renovatebot.com/merge-confidence/) |
[Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
|
[github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common](https://github.com/tencentcloud/tencentcloud-sdk-go)
| `v1.3.54` → `v1.3.61` |
![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2ftencentcloud%2ftencentcloud-sdk-go%2ftencentcloud%2fcommon/v1.3.61?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2ftencentcloud%2ftencentcloud-sdk-go%2ftencentcloud%2fcommon/v1.3.54/v1.3.61?slim=true)
|

---

> [!WARNING]
> Some dependencies could not be looked up. Check the [Dependency
Dashboard](../issues/20907) for more information.

---

### Release Notes

<details>
<summary>tencentcloud/tencentcloud-sdk-go
(github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common)</summary>

###
[`v1.3.61`](https://github.com/tencentcloud/tencentcloud-sdk-go/compare/v1.3.60...v1.3.61)

[Compare
Source](https://github.com/tencentcloud/tencentcloud-sdk-go/compare/v1.3.60...v1.3.61)

###
[`v1.3.60`](https://github.com/tencentcloud/tencentcloud-sdk-go/compare/v1.3.59...v1.3.60)

[Compare
Source](https://github.com/tencentcloud/tencentcloud-sdk-go/compare/v1.3.59...v1.3.60)

###
[`v1.3.59`](https://github.com/tencentcloud/tencentcloud-sdk-go/compare/v1.3.58...v1.3.59)

[Compare
Source](https://github.com/tencentcloud/tencentcloud-sdk-go/compare/v1.3.58...v1.3.59)

###
[`v1.3.58`](https://github.com/tencentcloud/tencentcloud-sdk-go/compare/v1.3.57...v1.3.58)

[Compare
Source](https://github.com/tencentcloud/tencentcloud-sdk-go/compare/v1.3.57...v1.3.58)

###
[`v1.3.57`](https://github.com/tencentcloud/tencentcloud-sdk-go/compare/v1.3.56...v1.3.57)

[Compare
Source](https://github.com/tencentcloud/tencentcloud-sdk-go/compare/v1.3.56...v1.3.57)

###
[`v1.3.56`](https://github.com/tencentcloud/tencentcloud-sdk-go/compare/v1.3.55...v1.3.56)

[Compare
Source](https://github.com/tencentcloud/tencentcloud-sdk-go/compare/v1.3.55...v1.3.56)

###
[`v1.3.55`](https://github.com/tencentcloud/tencentcloud-sdk-go/compare/v1.3.54...v1.3.55)

[Compare
Source](https://github.com/tencentcloud/tencentcloud-sdk-go/compare/v1.3.54...v1.3.55)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "on tuesday" (UTC), 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 was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/open-telemetry/opentelemetry-collector-contrib).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My42Ni40IiwidXBkYXRlZEluVmVyIjoiNDMuNjYuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIiwicmVub3ZhdGVib3QiXX0=-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>
Co-authored-by: Yang Song <songy23@users.noreply.github.com>

* Update module github.com/SAP/go-hdb to v1.16.2 (#47078)

This PR contains the following updates:

| Package | Change |
[Age](https://docs.renovatebot.com/merge-confidence/) |
[Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [github.com/SAP/go-hdb](https://github.com/SAP/go-hdb) |
`v1.15.2` → `v1.16.2` |
![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fSAP%2fgo-hdb/v1.16.2?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fSAP%2fgo-hdb/v1.15.2/v1.16.2?slim=true)
|

---

> [!WARNING]
> Some dependencies could not be looked up. Check the [Dependency
Dashboard](../issues/20907) for more information.

---

### Release Notes

<details>
<summary>SAP/go-hdb (github.com/SAP/go-hdb)</summary>

###
[`v1.16.2`](https://github.com/SAP/go-hdb/blob/HEAD/RELEASENOTES.md#v1162)

[Compare
Source](https://github.com/SAP/go-hdb/compare/v1.16.1...v1.16.2)

- deleted test certificates
- cleanups

###
[`v1.16.1`](https://github.com/SAP/go-hdb/blob/HEAD/RELEASENOTES.md#v1161)

[Compare
Source](https://github.com/SAP/go-hdb/compare/v1.16.0...v1.16.1)

- fixed typo

###
[`v1.16.0`](https://github.com/SAP/go-hdb/blob/HEAD/RELEASENOTES.md#v1160)

[Compare
Source](https://github.com/SAP/go-hdb/compare/v1.15.4...v1.16.0)

##### Minor revisions

##### v1.16.2

- deleted test certificates
- cleanups

##### v1.16.1

- fixed typo

##### Changes

- Added support of LDAP authentication
([#&#8203;159](https://github.com/SAP/go-hdb/pull/159))

###
[`v1.15.4`](https://github.com/SAP/go-hdb/blob/HEAD/RELEASENOTES.md#v1154)

[Compare
Source](https://github.com/SAP/go-hdb/compare/v1.15.3...v1.15.4)

- bumped github actions

###
[`v1.15.3`](https://github.com/SAP/go-hdb/blob/HEAD/RELEASENOTES.md#v1153)

[Compare
Source](https://github.com/SAP/go-hdb/compare/v1.15.2...v1.15.3)

- updated dependencies
- added docstore enabled check to test

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "on tuesday" (UTC), 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 was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/open-telemetry/opentelemetry-collector-contrib).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My42Ni40IiwidXBkYXRlZEluVmVyIjoiNDMuNjYuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIiwicmVub3ZhdGVib3QiXX0=-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>
Co-authored-by: Yang Song <songy23@users.noreply.github.com>

* Update module gitlab.com/gitlab-org/api/client-go/v2 to v2.7.0 (#47079)

This PR contains the following updates:

| Package | Change |
[Age](https://docs.renovatebot.com/merge-confidence/) |
[Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
|
[gitlab.com/gitlab-org/api/client-go/v2](https://gitlab.com/gitlab-org/api/client-go)
| `v2.5.0` → `v2.7.0` |
![age](https://developer.mend.io/api/mc/badges/age/go/gitlab.com%2fgitlab-org%2fapi%2fclient-go%2fv2/v2.7.0?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/go/gitlab.com%2fgitlab-org%2fapi%2fclient-go%2fv2/v2.5.0/v2.7.0?slim=true)
|

---

> [!WARNING]
> Some dependencies could not be looked up. Check the [Dependency
Dashboard](../issues/20907) for more information.

---

### Release Notes

<details>
<summary>gitlab-org/api/client-go
(gitlab.com/gitlab-org/api/client-go/v2)</summary>

###
[`v2.7.0`](https://gitlab.com/gitlab-org/api/client-go/blob/HEAD/CHANGELOG.md#170-2025-12-06)

[Compare
Source](https://gitlab.com/gitlab-org/api/client-go/compare/v2.6.0...v2.7.0)

##### Features

- **users:** Add support for a user to see only one file diff per page
([e2a9e09](https://gitlab.com/gitlab-org/api/client-go/commit/e2a9e09e79e7949e0b19dcfc97e3b7b533541856))

#### 1.6.0

##### 🚀 Features

- feat: add admin compliance policy settings API
([!2610](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2610))
by [Hannes Lange](https://gitlab.com/hlange4)

##### 🔄 Other Changes

- doc: fix typo
([!2603](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2603))
by [Guilhem Bonnefille](https://gitlab.com/gbonnefille)
- chore(deps): update golangci/golangci-lint docker tag to v2.7.1
([!2611](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2611))
by [GitLab Dependency
Bot](https://gitlab.com/gitlab-dependency-update-bot)
- chore(deps): update docker docker tag to v29.1.2
([!2609](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2609))
by [GitLab Dependency
Bot](https://gitlab.com/gitlab-dependency-update-bot)
- chore(deps): update golangci/golangci-lint docker tag to v2.7.0
([!2608](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2608))
by [GitLab Dependency
Bot](https://gitlab.com/gitlab-dependency-update-bot)

###
[`v2.6.0`](https://gitlab.com/gitlab-org/api/client-go/blob/HEAD/CHANGELOG.md#01590-2025-11-04)

[Compare
Source](https://gitlab.com/gitlab-org/api/client-go/compare/v2.5.0...v2.6.0)

##### Features

- **integrations:** add group integration API endpoints for Jira
([09e18ee](https://gitlab.com/gitlab-org/api/client-go/commit/09e18ee598bb7805ac8221f6a05426b1785f9011))

#### 0.158.0

##### 🚀 Features

- Add support to send variables for GraphQL queries
([!2562](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2562))
by [rafasf](https://gitlab.com/rafasf)

##### 🔄 Other Changes

- chore(deps): update module cel.dev/expr to v0.25.0
([!2560](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2560))
by [GitLab Dependency
Bot](https://gitlab.com/gitlab-dependency-update-bot)
- chore(no-release): standardize GitLab name capitalization
([!2551](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2551))
by [Zubeen](https://gitlab.com/syedzubeen)
- chore(deps): update golangci/golangci-lint docker tag to v2.6.0
([!2558](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2558))
by [GitLab Dependency
Bot](https://gitlab.com/gitlab-dependency-update-bot)
- refactor: moved comments to interface 2
([!2557](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2557))
by [Zubeen](https://gitlab.com/syedzubeen)
- refactor: moved comments to interface
([!2556](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2556))
by [Zubeen](https://gitlab.com/syedzubeen)
- refactor(test): avoid panic in tests with goroutines
([!2553](https://gitlab.com/gitlab-org/api/client-go/-/merge_requests/2553))
by [Oleksandr Redko](https://gitlab.com/alexandear)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "on tuesday" (UTC), 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 was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/open-telemetry/opentelemetry-collector-contrib).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My42Ni40IiwidXBkYXRlZEluVmVyIjoiNDMuNjYuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIiwicmVub3ZhdGVib3QiXX0=-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>
Co-authored-by: Yang Song <songy23@users.noreply.github.com>

* Update module modernc.org/sqlite to v1.47.0 (#47080)

This PR contains the following updates:

| Package | Change |
[Age](https://docs.renovatebot.com/merge-confidence/) |
[Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [modernc.org/sqlite](https://gitlab.com/cznic/sqlite) | `v1.46.1` →
`v1.47.0` |
![age](https://developer.mend.io/api/mc/badges/age/go/modernc.org%2fsqlite/v1.47.0?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/go/modernc.org%2fsqlite/v1.46.1/v1.47.0?slim=true)
|

---

> [!WARNING]
> Some dependencies could not be looked up. Check the [Dependency
Dashboard](../issues/20907) for more information.

---

### Release Notes

<details>
<summary>cznic/sqlite (modernc.org/sqlite)</summary>

###
[`v1.47.0`](https://gitlab.com/cznic/sqlite/compare/v1.46.2...v1.47.0)

[Compare
Source](https://gitlab.com/cznic/sqlite/compare/v1.46.2...v1.47.0)

###
[`v1.46.2`](https://gitlab.com/cznic/sqlite/compare/v1.46.1...v1.46.2)

[Compare
Source](https://gitlab.com/cznic/sqlite/compare/v1.46.1...v1.46.2)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "on tuesday" (UTC), 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 was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/open-telemetry/opentelemetry-collector-contrib).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My42Ni40IiwidXBkYXRlZEluVmVyIjoiNDMuNjYuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIiwicmVub3ZhdGVib3QiXX0=-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>
Co-authored-by: Yang Song <songy23@users.noreply.github.com>

* Update module github.com/goccy/go-json to v0.10.6 (#47070)

This PR contains the following updates:

| Package | Change |
[Age](https://docs.renovatebot.com/merge-confidence/) |
[Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [github.com/goccy/go-json](https://github.com/goccy/go-json)
| `v0.10.5` → `v0.10.6` |
![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fgoccy%2fgo-json/v0.10.6?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fgoccy%2fgo-json/v0.10.5/v0.10.6?slim=true)
|

---

> [!WARNING]
> Some dependencies could not be looked up. Check the [Dependency
Dashboard](../issues/20907) for more information.

---

### Release Notes

<details>
<summary>goccy/go-json (github.com/goccy/go-json)</summary>

###
[`v0.10.6`](https://github.com/goccy/go-json/releases/tag/v0.10.6):
0.10.6

[Compare
Source](https://github.com/goccy/go-json/compare/v0.10.5...v0.10.6)

#### What's Changed

- fix: panic on embedded struct with recursive by
[@&#8203;NgoKimPhu](https://github.com/NgoKimPhu) in
[#&#8203;483](https://github.com/goccy/go-json/pull/483)

#### New Contributors

- [@&#8203;NgoKimPhu](https://github.com/NgoKimPhu) made their
first contribution in
[#&#8203;483](https://github.com/goccy/go-json/pull/483)

**Full Changelog**:
<https://github.com/goccy/go-json/compare/v0.10.5...v0.10.6>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "on tuesday" (UTC), 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 was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/open-telemetry/opentelemetry-collector-contrib).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My42Ni40IiwidXBkYXRlZEluVmVyIjoiNDMuNjYuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIiwicmVub3ZhdGVib3QiXX0=-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>
Co-authored-by: Yang Song <songy23@users.noreply.github.com>

* Fix CouchDB Reciever Readme (#47063)

#### Description
Standardize naming in the `couchdbreceiver` README so human-readable
references consistently use `CouchDB` instead of mixed variants like
`couchdb` and `Couchdb` in prose. Technical identifiers such as the
`couchdb` receiver name, config keys, and metric names are left
unchanged.


#### Link to tracking issue
Fixes

#### Testing
Verified the README updates and confirmed the remaining `couchdb`
references are intentional technical identifiers.

#### Documentation
Updated `receiver/couchdbreceiver/README.md` to use consistent `CouchDB`
wording in user-facing documentation.

---------

Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
Co-authored-by: Yang Song <songy23@users.noreply.github.com>

* [receiver/sqlqueryreceiver] Adds row_condition to filter pivot-style result sets (#46219)

#### Description

Add `row_condition` (optional): when set, only rows where the specified
column equals the specified value are used
to produce this metric. Rows that do not match are silently skipped.
This is useful for pivot-style result
sets where each row encodes a different metric (e.g. `SHOW LISTS` in
pgbouncer).

  - `column` (required): the column name to evaluate.
- `value` (required): the expected string value the column must equal
for the row to be included.
  
closes:
https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/45862

* [receiver/filelog] fix: corrupted log entries upon rotation (#46239)

#### Description

Fixes corrupted log entries when the filelog receiver reads a compressed
(`.gz`) file that was produced by rotating and compressing a plaintext
log file while `compression: auto` is configured.

**Root cause**: When a plaintext file (e.g. `app.log`) is rotated and
compressed (e.g. `app.log.gz`), fingerprint matching succeeds because
the decompressed content of the `.gz` begins with the same bytes as the
original plaintext fingerprint. `NewReaderFromMetadata` was previously
reusing the stale plaintext `Offset` and `FileType` without re-detecting
the file format. The scanner then seek'd to the old plaintext byte
position inside the raw compressed stream and read gzip-encoded bytes as
plaintext, producing corrupted log entries.

**Fix**: `NewReaderFromMetadata` now re-detects the file type whenever
`compression` is configured and compares against the persisted
`FileType`. On a plaintext → gzip format transition:

- The old plaintext `Offset` (decompressed bytes already consumed) is
moved into a transient `decompressedBytesToSkip` field on the reader.
- `m.Offset` is zeroed so that if `ReadToEnd` is never called before
`Close()` (e.g. context cancellation), the checkpointed metadata carries
`Offset=0` and `FileType=".gz"` — preventing the same corruption on the
subsequent poll.
- `createGzipReader` starts decompression from byte 0 and discards the
already-consumed decompressed bytes via `io.CopyN`, so only new content
is emitted.

On a gzip → plaintext transition the offset is reset to 0, **which can
cause potential duplicates** - But this is an edge case

Additionally fixes a latent bug in `createGzipReader` where
`io.NewSectionReader` was passed the total file size as the byte-count
parameter instead of `currentEOF - compressedStart`, causing the section
to span past the actual file boundary.

#### Link to tracking issue

Fixes #46105

#### Testing

- Added `TestNewReaderFromMetadataForRotationWithCompression`, a
regression test that:
- Creates a plaintext file, reads lines 1–2, and saves the resulting
metadata (`Offset > 0`, `FileType=""`).
  - Simulates rotation by writing a `.gz` containing all 4 lines.
- Calls `NewReaderFromMetadata` with the stale plaintext metadata
against the new `.gz` file.
- Asserts `FileType=".gz"`, `Offset=0`, and that only lines 3–4 are
emitted (no corruption, no duplicates).
- Existing `TestNewReaderFromMetadataConcurrentAccess` validates no data
race on `FileAttributes` map access.
- Validated end-to-end with a locally built `otelcontribcol` binary
using `compression: auto`, a `file_storage` extension for checkpoint
persistence, and a shell script that writes 2 plaintext lines, waits for
the collector to consume them, then atomically compresses the file to
`.gz` with 4 lines — confirming only lines 3 and 4 are emitted after
rotation with no corrupted output.
- Validated with user reproduce steps in issue (resulted in no corrupted
output)

#### Documentation

Added changelog yaml entry summarizing the issue and fix.

---------

Co-authored-by: Andrzej Stencel <andrzej.stencel@elastic.co>

* feat(pkg/stanza): Parse unparsed fields in log body for Windows Events (#46944)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Stanza parses Windows Event XML into a structured log body, but several
fields present in the raw XML were being silently dropped:

- RenderingInfo was consumed internally to populate the top-level level,
task, opcode, keywords, and message fields, but was never itself emitted
into the body. Fields it carries that have no top-level equivalent —
culture, channel, and provider (the human-readable publisher name) —
were lost entirely on every event rendered via the deep path.
- UserData was not parsed at all. Some providers (e.g.
Microsoft-Windows-Eventlog, which uses UserData for event 1102 — audit
log cleared) use UserData as a structured alternative to EventData.
Those events produced an empty event_data in the body with no indication
that structured data existed.
- ProcessingErrorData, DebugData, and BinaryEventData are valid
top-level elements defined in the Windows Event Schema that the
receiver's EventXML struct had no fields for, so they were silently
discarded during XML unmarshalling.

This PR exposes all previously dropped fields in the structured log
body:

- Emit RenderingInfo as a top-level rendering_info key in the body,
containing all fields: message, level, task, opcode, keywords, culture,
channel, and provider. The existing behavior of using RenderingInfo
values to populate the top-level level, task, opcode, keywords, and
message fields would be preserved — rendering_info is an addition, not a
replacement.
- Parse and emit UserData as a top-level user_data key containing the
event type name (the local name of the first child element) and a data
map of key-value pairs from its children. This allows events that use
UserData instead of EventData to be fully represented in the body.
- Map ProcessingErrorData, DebugData, and BinaryEventData to struct
fields in EventXML and emit them as processing_error_data, debug_data,
and binary_event_data body keys respectively when present. All three are
rare in practice on modern Windows but are defined in the [official
schema with Microsoft
documentation](https://learn.microsoft.com/en-us/windows/win32/wes/eventschema-schema)
and should be captured rather than silently dropped.

<!-- Issue number (e.g. #1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes
https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/46943

<!--Describe what testing was performed and which tests were added.-->
#### Testing

- Manual testing with log.record.original enabled and verification that
the log body contained all fields for RenderingInfo and UserData. Unit
test verification of these fields to prevent regressions.
- Unit testing based on the documentation for ProcessingErrorData,
DebugData, and BinaryEventData - these fields are legacy artifacts from
older Windows systems, but are well-documented as being present in the
Event body.

<!--Describe the documentation added.-->
#### Documentation

Documentation updated to describe new fields.

<!--Please delete paragraphs that you did not use before submitting.-->

* [chore][exporter/awss3] log object keys uploaded to s3 (#47007)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
plumb the logger through to the upload manager and add a debug log for
the object keys being written to S3. I want something similar to what we
have in the [clickhouse
exporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/clickhouseexporter/exporter_logs.go#L186)

* [chore] Add configuration schemas for vcr receiver (#46975)

Add configuration schemas for azure functions receiver.

#### Link to tracking issue
Updates
https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/42214

Signed-off-by: Israel Blancas <iblancasa@gmail.com>

* Mysql add samples session status (#46273)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
"Added `mysql.session.status` attribute to query samples, which
indicates the session status (e.g., 'wait', 'running') at the time of
the sample. This provides additional context for understanding query
performance and behavior."

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Added to existing scraper test

<!--Please delete paragraphs that you did not use before submitting.-->

* receiver/awsfirehose: deprecate built-in encodings (#46986)

#### Description

Deprecate the built-in encodings, and direct users to the equivalent
encoding extensions.

#### Link to tracking issue

Relates to #45830

#### Testing

Confirmed that warnings are logged when the built-in encodings are used,
e.g. when no encoding is specified at all.

#### Documentation

Updated README.

* [chore] Add configuration schemas for extensions (#46972)

Add configuration schemas for extensions.

#### Link to tracking issue
Updates
https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/42214

Signed-off-by: Israel Blancas <iblancasa@gmail.com>

* [chore] run make-generate-schemas (#47110)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Run missing make generate-schemas to fix schema config.

Introduced by #46972

Signed-off-by: Shaanveer Singh <shaanver.singh@gmail.com>

* [receiver/docker_stats] feat: add tls for docker stats (#46497)

#### Description

A new optional `tls` configuration block is available in `docker_stats`
receiver config (and the
shared `internal/docker` package). When omitted the connection remains
insecure (plain HTTP or
Unix socket), preserving existing behavior. When provided it supports
the standard
`configtls.ClientConfig` fields: `ca_file`, `cert_file`, `key_file`,
`insecure_skip_verify`,
  `min_version`, and `max_version`.
A warning is now emitted when a plain `tcp://` or `http://` endpoint is
used without TLS,
reflecting Docker's deprecation of unauthenticated TCP connections since
Docker v26.0
(see
https://docs.docker.com/engine/deprecated/#unauthenticated-tcp-connections).

#### Link to tracking issue


[Fixes](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/33557)

#### Testing

Unit tests

* Add component event attributes to serialized output (#43744)

#### Link to tracking issue
Fixes #43606

---------

Signed-off-by: Israel Blancas <iblancasa@gmail.com>
Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>

* [receiver/yanggrpc] Collect all metrics in the tree (#47054)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
The receiver would not collect all metrics previously, this changes the
response parsing to collect all metrics.

* [receiver/datadog] Propagate datadog sampling across trace chunks (#47107)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
In `datadogreceiver`, `sampling.priority` was only set when a span
itself carried `_sampling_priority_v1`. This meant spans in the same
trace chunk could end up with different sampling priority attributes,
and if the priority was only set on the trace chunk, no translated span
got `sampling.priority` at all.

This PR fixes that by resolving sampling priority once per trace chunk,
preferring the chunk priority when present.

#### Link to tracking issue
Fixes #45402

### Testing
Added test

---------

Signed-off-by: Shaanveer Singh <shaanver.singh@gmail.com>

* [chore] Add paulojmdias as codeowner for filelog receiver and fileconsumer package (#47134)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

I would like to propose adding myself as a codeowner for the filelog
receiver and fileconsumer packages. I already did some PRs, handled
issues, and I accept the challenge to help maintain those components.

Some recent important improvements that I proposed:
-
https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/45097
-
https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/46739

All the PRs and issues in which I was involved:
-
https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Apr%20involves%3Apaulojmdias%20label%3Apkg%2Fstanza%2Ffileconsumer
-
https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Apr%20involves%3Apaulojmdias%20label%3Areceiver%2Ffilelog
-
https://github.com/open-telemetry/opentelemetry-collector-contrib/pulls?q=is%3Apr+author%3Apaulojmdias+label%3Apkg%2Fstanza%2Ffileconsumer
-
https://github.com/open-telemetry/opentelemetry-collector-contrib/pulls?q=is%3Apr+author%3Apaulojmdias+label%3Areceiver%2Ffilelog

This was discussed in person at KubeCon EU. Thanks for your vote of
confidence @andrzej-stencel 🙏

Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>

* [chore][receiver/filelog] add VihasMakwana as a codeowner (#47142)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

I had a discussion with @andrzej-stencel regarding this. I'm adding
myself as a codeowner.

PRs reviewed by me:

https://github.com/open-telemetry/opentelemetry-collector-contrib/pulls?q=is%3Aopen+is%3Apr+label%3Apkg%2Fstanza+reviewed-by%3A%40me+


https://github.com/open-telemetry/opentelemetry-collector-contrib/pulls?q=is%3Aopen+is%3Apr+label%3Areceiver%2Ffilelog+reviewed-by%3A%40me

PRs authored by me related to the receiver:


https://github.com/open-telemetry/opentelemetry-collector-contrib/pulls?q=is%3Apr+label%3Apkg%2Fstanza+author%3AVihasMakwana+is%3Amerged+

---------

Co-authored-by: Andrzej Stencel <andrzej.stencel@elastic.co>

* [processor/tailsampling] add sampling_strategy config with trace-complete and span-ingest modes (#46762)

#### Description

Add `sampling_strategy` config to `processor/tailsampling` with two
explicit modes:

- `trace-complete` (default): classic timer-based tail sampling with
full-trace evaluation context.
- `span-ingest`: evaluate each incoming batch on ingest, finalize
terminal outcomes (`sampled`/`dropped`) immediately, and
cleanup-finalize unresolved traces as `not sampled` without policy
re-evaluation.

This implementation also:

- validates strategy values and defaults to `trace-complete`.
- enforces stateless policies in `span-ingest` mode (`IsStateful() ==
false`).
- records ingest-time decision telemetry for `span-ingest`.
- aligns tests/docs/schema/comments with implemented behavior.
- supports earlier batch timing after root-span arrival via
`decision_wait_after_root_received` in both modes (earlier decision in
`trace-complete`, earlier pending cleanup finalization in
`span-ingest`).

#### Link to tracking issue

Fixes #46600.

#### Testing

- `go test ./...` (in `processor/tailsamplingprocessor`)
- Updated/added tests for:
  - ingest-time terminal decisions in `span-ingest`
  - pending cleanup finalization behavior
  - ingest ordering behavior
  - telemetry emission paths

#### Documentation

- Updated `processor/tailsamplingprocessor/README.md` for strategy
semantics and flow.
- Updated `processor/tailsamplingprocessor/config.schema.yaml`
descriptions for strategy/timer behavior.
- Updated strategy/timer comments in
`processor/tailsamplingprocessor/config.go`.
- Added changelog entry:
`.chloggen/tailsampling-sampling-strategy-config.yaml`.

* [pkg/stanza] Ensure router operator does not split batches of entries (#45162)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Updates the `router` operator to process batches of entries without
splitting them. The parser now writes all entries as a single batch,
rather than processing them individually.

<!-- Issue number (e.g. #1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes #42393

<!--Describe what testing was performed and which tests were added.-->
#### Testing

Added unit tests to ensure the batches are not split.

---------

Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>

* [receiver/docker_stats] feat: add stream read for docker stats (#46493)

#### Description
When `stream_stats: true` is set, each container maintains a persistent
open Docker stats
stream instead of opening and closing a new connection on every scrape
cycle. The scraper
  reads from the cached latest value, which reduces connection overhead.

(see also here:
https://docs.docker.com/reference/api/engine/version/v1.53/#tag/Container/operation/ContainerStats)
One stats call will wait two cycles within docker engine:
<img width="804" height="227" alt="image"
src="https://github.com/user-attachments/assets/1c264ad5-2e00-4b47-833a-4683c9c4dcc7"
/>


#### Testing
Unit test

* [chore] [receiver/filelog] Add braydonk to CODEOWNERS (#47147)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
This PR is to propose adding myself to the active group of `filelog`
receiver codeowners.

I have made some code contributions to the receiver:
#44734  
#43777  

I have participated in some issue discussions:
#46496  
#43693 

I also have previous experience working on Fluent Bit, which is a
similar technology that solves a lot of the same problems in different
ways than Stanza.
https://github.com/fluent/fluent-bit/pulls/braydonk    
https://www.youtube.com/watch?v=KrlvWBCGagI 

I look forward to increasing my contributions and reviews on this
component to help push it toward stability!

---------

Co-authored-by: Andrzej Stencel <andrzej.stencel@elastic.co>

* [receiver/filelog] Add max_log_size_behavior config option for truncation (#45323)

Description
new approach after previous pr's
(https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/44929)
approach was decided as problematic

Link to tracking issue
Fixes
https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/44371

Testing
Documentation

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Vihas Makwana <121151420+VihasMakwana@users.noreply.github.com>
Co-authored-by: Andrzej Stencel <andrzej.stencel@elastic.co>

* [chore][pkg/stanza/fileconsumer] Remove unused SaveProto, LoadProto, LoadKeyProto checkpoint functions (#47180)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Remove three unused exported functions (`SaveProto`, `LoadProto`, and
`LoadKeyProto`) from `checkpoint_protobuf.go`.

Also make `saveKeyProto` as unexported since it is not used outside of
checkpoint package.

---------

Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>

* [chore][pkg/stanza/fileconsumer] Remove unused archivePollsToArchiveKey constant (#47181)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Remove unused `archivePollsToArchiveKey` constant from `archive.go`. The
constant is not referenced anywhere in the repository and contains a
typo (`"knonwFiles"` instead of `"knownFiles"`).

Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>

* [chore][pkg/stanza] Remove deprecated NilField type from entry package (#47182)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Remove the deprecated `NilField` type and its tests from
`pkg/stanza/entry`.

The type was marked deprecated with an instruction to use
`Field.IsEmpty` and is only referenced in its own test file.

Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>

* [exporter/elasticsearch] Cache metric attributes per session instead of per document (#47170)

#### Description
- syncBulkIndexerSession.Add() was calling getAttributesFromMetadataKeys
+ attribute.NewSet + metric.WithAttributeSet on every document added to
the bulk request. This allocates ~192 bytes per document and dominated
the metric recording path in high-throughput deployments.

- The attribute set is derived from metadata keys on the request
context, which is constant for the lifetime of a single bulk session
(the sending_queue with metadata_keys partitions batches by metadata
value, so all documents in one Consume* call share the same context).
Computing it once in StartSession and caching it on the session struct
is safe and correct.

```
  Before: getAttributesFromMetadataKeys called N times (once per document)
  After: called once per bulk session flush
```

* [exporter/elasticsearch] optimise document serialisation (#47171)

#### Description

Optimise Elasticsearch document JSON serialisation by reducing
allocations.
These changes are inspired by https://github.com/elastic/go-fastjson.

Benchstat:

```
goos: linux
goarch: amd64
pkg: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/elasticsearchexporter/internal/serializer/otelserializer
cpu: Intel(R) Core(TM) Ultra 7 155U
                                            │ /tmp/old.txt  │            /tmp/new.txt             │
                                            │    sec/op     │    sec/op     vs base               │
SerializeLog/minimal-14                        626.7n ±  4%   246.5n ±  5%  -60.67% (p=0.002 n=6)
SerializeLog/with_attributes-14                2.270µ ± 10%   1.286µ ± 15%  -43.37% (p=0.002 n=6)
SerializeLog/with_map_body-14                 1496.5n ± 13%   627.7n ± 14%  -58.06% (p=0.002 n=6)
SerializeLog/with_data_stream_index-14        1214.0n ±  6%   567.9n ±  4%  -53.22% (p=0.002 n=6)
SerializeMetrics/single_gauge-14              1369.0n ±  8%   934.8n ± 10%  -31.72% (p=0.002 n=6)
SerializeMetrics/multiple_gauges-14            2.237µ ± 11%   1.665µ ±  7%  -25.53% (p=0.002 n=6)
SerializeMetrics/histogram-14                  2.819µ ±  9%   2.215µ ±  7%  -21.44% (p=0.002 n=6)
SerializeMetrics/summary-14                    1.462µ ±  5%   1.023µ ±  5%  -30.03% (p=0.002 n=6)
SerializeMetrics/exponential_histogram-14      4.721µ ± 25%   4.203µ ±  7%  -10.97% (p=0.002 n=6)
SerializeSpan/minimal-14                       677.5n ± 12%   316.9n ± 16%  -53.22% (p=0.002 n=6)
SerializeSpan/with_attributes_and_status-14    2.757µ ±  8%   1.590µ ± 10%  -42.34% (p=0.002 n=6)
SerializeSpan/with_links-14                    2.140µ ±  4%   1.121µ ±  6%  -47.62% (p=0.002 n=6)
SerializeSpanEvent/minimal-14                  912.9n ±  9%   396.6n ±  5%  -56.56% (p=0.002 n=6)
SerializeSpanEvent/with_attributes-14          1.954µ ±  7%   1.293µ ± 10%  -33.84% (p=0.002 n=6)
SerializeProfile-14                            1.180µ ±  5%   1.337µ ± 12%  +13.31% (p=0.011 n=6)
geomean                                        1.612µ         971.5n        -39.75%

                                            │ /tmp/old.txt │               /tmp/new.txt               │
                                            │     B/op     │     B/op      vs base                    │
SerializeLog/minimal-14                         288.0 ± 0%       0.0 ± 0%  -100.00% (p=0.002 n=6)
SerializeLog/with_attributes-14                 288.0 ± 0%       0.0 ± 0%  -100.00% (p=0.002 n=6)
SerializeLog/with_map_body-14                   288.0 ± 0%       0.0 ± 0%  -100.00% (p=0.002 n=6)
SerializeLog/with_data_stream_index-14          288.0 ± 0%       0.0 ± 0%  -100.00% (p=0.002 n=6)
SerializeMetrics/single_gauge-14                608.0 ± 0%     416.0 ± 0%   -31.58% (p=0.002 n=6)
SerializeMetrics/multiple_gauges-14             856.0 ± 0%     664.0 ± 0%   -22.43% (p=0.002 n=6)
SerializeMetrics/histogram-14                  1096.0 ± 0%     904.0 ± 0%   -17.52% (p=0.002 n=6)
SerializeMetrics/summary-14                     752.0 ± 0%     552.0 ± 0%   -26.60% (p=0.002 n=6)
SerializeMetrics/exponential_histogram-14     2.016Ki ± 0%   1.820Ki ± 0%    -9.69% (p=0.002 n=6)
SerializeSpan/minimal-14                        240.0 ± 0%       0.0 ± 0%  -100.00% (p=0.002 n=6)
SerializeSpan/with_attributes_and_status-14     304.0 ± 0%       0.0 ± 0%  -100.00% (p=0.002 n=6)
SerializeSpan/with_links-14                     432.0 ± 0%       0.0 ± 0%  -100.00% (p=0.002 n=6)
SerializeSpanEvent/minimal-14                  368.00 ± 0%     80.00 ± 0%   -78.26% (p=0.002 n=6)
SerializeSpanEvent/with_attributes-14           672.0 ± 0%     384.0 ± 0%   -42.86% (p=0.002 n=6)
SerializeProfile-14                           1.702Ki ± 0%   1.704Ki ± 0%    +0.09% (p=0.028 n=6)
geomean                                         534.4                      ?                      ¹ ²
¹ summaries must be >0 to compute geomean
² ratios must be >0 to compute geomean

                                            │ /tmp/old.txt │              /tmp/new.txt              │
                                            │  allocs/op   │ allocs/op   vs base                    │
SerializeLog/minimal-14                         9.000 ± 0%   0.000 ± 0%  -100.00% (p=0.002 n=6)
SerializeLog/with_attributes-14                 9.000 ± 0%   0.000 ± 0%  -100.00% (p=0.002 n=6)
SerializeLog/with_map_body-14                   9.000 ± 0%   0.000 ± 0%  -100.00% (p=0.002 n=6)
SerializeLog/with_data_stream_index-14          9.000 ± 0%   0.000 ± 0%  -100.00% (p=0.002 n=6)
SerializeMetrics/single_gauge-14               10.000 ± 0%   7.000 ± 0%   -30.00% (p=0.002 n=6)
SerializeMetrics/multiple_gauges-14             23.00 ± 0%   20.00 ± 0%   -13.04% (p=0.002 n=6)
SerializeMetrics/histogram-14                   31.00 ± 0%   28.00 ± 0%    -9.68% (p=0.002 n=6)
SerializeMetrics/summary-14                     16.00 ± 0%   12.00 ± 0%   -25.00% (p=0.002 n=6)
SerializeMetrics/exponential_histogram-14       61.00 ± 0%   57.00 ± 0%    -6.56% (p=0.002 n=6)
SerializeSpan/minimal-14                        6.000 ± 0%   0.000 ± 0%  -100.00% (p=0.002 n=6)
SerializeSpan/with_attributes_and_status-14     10.00 ± 0%    0.00 ± 0%  -100.00% (p=0.002 n=6)
SerializeSpan/with_links-14                     14.00 ± 0%    0.00 ± 0%  -100.00% (p=0.002 n=6)
SerializeSpanEvent/minimal-14                  12.000 ± 0%   4.000 ± 0%   -66.67% (p=0.002 n=6)
SerializeSpanEvent/with_attributes-14          16.000 ± 0%   8.000 ± 0%   -50.00% (p=0.002 n=6)
SerializeProfile-14                             21.00 ± 0%   21.00 ± 0%         ~ (p=1.000 n=6) ¹
geomean                                         13.99                    ?                      ² ³
¹ all samples are equal
² summaries must be >0 to compute geomean
³ ratios must be >0 to compute geomean
```

#### Link to tracking issue

N/A

#### Testing

Benchmark tests expanded. All unit tests pass.

#### Documentation

N/A

---------

Co-authored-by: Carson Ip <carsonip@users.noreply.github.com>

* connector/signaltometricsconnector: pre-compute prefixed collector key (#47183)

#### Description

- Since the key is derived from package-level constants that never
change at runtime, compute it once at package init and reuse it in
Copy().This eliminates one string allocation per (signal × metric-def)
processed by the connector, reducing steady-state GC pressure at high
throughput.

* chore:update ReportsRemoteConfig status (#47145)

* [connector/signaltometrics]OTTL based dynamic attribute filtering (#47177)

## Summary

Adds an `ottl_expression` field to the `Attribute` config struct,
enabling dynamic attribute key resolution at runtime
for both `include_resource_attributes` and `attributes`. This is an
alternative to #46884 that avoids custom OTTL
  functions entirely.

The OTTL expression evaluates to a list of attribute keys
(`pcommon.Slice` or `[]string`) at runtime. Each resolved key
is looked up in the source attributes and included in the output. This
enables use cases like dynamically selecting
attributes based on `client.Metadata` or other cases which can be
accessed by ottl:

  ```yaml
  include_resource_attributes:
    - key: service.name
- ottl_expression:
otelcol.client.metadata["x-dynamic-resource-attributes"]
      optional: true
```

  Benchmark results (vs main)


| Benchmark | Time | Memory | Allocs |
|-----------|------|--------|--------|
| Traces    | ~0%  | ~0%    | ~0%    |
| Metrics   | -28% | -49%   | -18%   |
| Logs      | ~0%  | ~0%    | ~0%    |

  Test plan

  - Unit tests added/updated

  🤖 Generated with Claude Code

  Alternative to #46884

* [exporter/splunkhec] Fix timestamp precision in Splunk HEC exporter (#47195)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

The Splunk HEC exporter was truncating event timestamps to millisecond
precision due to explicit rounding in the timestamp conversion functions
(`math.Round` in metrics, `time.Duration.Round` in logs). This caused
sub-millisecond data to be lost before sending to Splunk HEC.

The fix removes the rounding and consolidates the two duplicate
timestamp functions (`nanoTimestampToEpochMilliseconds` in logs and
`timestampToSecondsWithMillisecondPrecision` in metrics) into a single
shared `nanoToEpochSeconds` function in `common.go`, used by logs,
metrics, and traces. The result is microsecond precision in the HEC time
field, which is the practical limit of float64 for current epoch
timestamps.

Tests were added to `common_test.go` to cover the conversion function
directly, and an end-to-end test in the HEC exporter verifies
microsecond precision is preserved in the final JSON payload sent to
Splunk.

<!-- Issue number (e.g. #1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes
https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/47175

<!--Describe what testing was performed and which tests were added.-->
#### Testing

Test run with this code version in Splunk. 
<img width="1407" height="361" alt="image"
src="https://github.com/user-attachments/assets/1c062612-28b0-4d8c-9d07-346ade13b72f"
/>
On the top this code version, on the bottom there is a version from the
main branch.

<!--Describe the documentation added.-->
#### Documentation

<!--Please delete paragraphs that you did not use before submitting.-->

* [chore](receiver/postgresqlreceiver) migrate feature gates to metadata-based… (#47085)

Part of #46116

- [receiver/postgresqlreceiver] Move feature gates to metadata.yaml
- migrate connectionPool, preciseLagMetrics, and separateSchemaAttr to
metadata-generated feature gates
- remove manual registration and usage
- update code and tests accordingly
- regenerate metadata

---------

Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>

* [chore] Update core dependencies (#47205)

This PR updates the opentelemetry-collector dependencies to
open-telemetry/opentelemetry-collector@c04f6776a74c9f146e49539cf67b2b009d86951a.

Changes included in this PR:
https://github.com/open-telemetry/opentelemetry-collector/compare/v0.148.0...c04f6776a74c9f146e49539cf67b2b009d86951a

---------

Signed-off-by: otelbot <197425009+otelbot@users.noreply.github.com>
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>

* fix(deps): update module github.com/antchfx/xmlquery to v1.5.1 (#47136)

This PR contains the following updates:

| Package | Change |
[Age](https://docs.renovatebot.com/merge-confidence/) |
[Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
|
[github.com/antchfx/xmlquery](https://github.com/antchfx/xmlquery)
| `v1.5.0` → `v1.5.1` |
![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fantchfx%2fxmlquery/v1.5.1?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fantchfx%2fxmlquery/v1.5.0/v1.5.1?slim=true)
|

---

> [!WARNING]
> Some dependencies could not be looked up. Check the [Dependency
Dashboard](../issues/20907) for more information.

---

### Release Notes

<details>
<summary>antchfx/xmlquery (github.com/antchfx/xmlquery)</summary>

###
[`v1.5.1`](https://github.com/antchfx/xmlquery/releases/tag/v1.5.1)

[Compare
Source](https://github.com/antchfx/xmlquery/compare/v1.5.0...v1.5.1)

##### Update packages:

- update `github.com/antchfx/xpath` from v1.3.5 to v1.3.6

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "on tuesday" (UTC), 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 was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/open-telemetry/opentelemetry-collector-contrib).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My42Ni40IiwidXBkYXRlZEluVmVyIjoiNDMuNjYuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIiwicmVub3ZhdGVib3QiXX0=-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>

* Update All golang.org/x packages (#47072)

This PR contains the following updates:

| Package | Change |
[Age](https://docs.renovatebot.com/merge-confidence/) |
[Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [golang.org/x/crypto](https://pkg.go.dev/golang.org/x/crypto) |
[`v0.48.0` →
`v0.49.0`](https://cs.opensource.google/go/x/crypto/+/refs/tags/v0.48.0...refs/tags/v0.49.0)
|
![age](https://developer.mend.io/api/mc/badges/age/go/golang.org%2fx%2fcrypto/v0.49.0?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/go/golang.org%2fx%2fcrypto/v0.48.0/v0.49.0?slim=true)
|
| [golang.org/x/mod](https://pkg.go.dev/golang.org/x/mod) | [`v0.33.0` →
`v0.34.0`](https://cs.opensource.google/go/x/mod/+/refs/tags/v0.33.0...refs/tags/v0.34.0)
|
![age](https://developer.mend.io/api/mc/badges/age/go/golang.org%2fx%2fmod/v0.34.0?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/go/golang.org%2fx%2fmod/v0.33.0/v0.34.0?slim=true)
|
| [golang.org/x/net](https://pkg.go.dev/golang.org/x/net) | [`v0.51.0` →
`v0.52.0`](https://cs.opensource.google/go/x/net/+/refs/tags/v0.51.0...refs/tags/v0.52.0)
|
![age](https://developer.mend.io/api/mc/badges/age/go/golang.org%2fx%2fnet/v0.52.0?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/go/golang.org%2fx%2fnet/v0.51.0/v0.52.0?slim=true)
|
| [golang.org/x/sync](https://pkg.go.dev/golang.org/x/sync) | [`v0.19.0`
→
`v0.20.0`](https://cs.opensource.google/go/x/sync/+/refs/tags/v0.19.0...refs/tags/v0.20.0)
|
![age](https://developer.mend.io/api/mc/badges/age/go/golang.org%2fx%2fsync/v0.20.0?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/go/golang.org%2fx%2fsync/v0.19.0/v0.20.0?slim=true)
|
| [golang.org/x/text](https://pkg.go.dev/golang.org/x/text) | [`v0.34.0`
→
`v0.35.0`](https://cs.opensource.google/go/x/text/+/refs/tags/v0.34.0...refs/tags/v0.35.0)
|
![age](https://developer.mend.io/api/mc/badges/age/go/golang.org%2fx%2ftext/v0.35.0?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/go/golang.org%2fx%2ftext/v0.34.0/v0.35.0?slim=true)
|
| [golang.org/x/tools](https://pkg.go.dev/golang.org/x/tools) |
[`v0.42.0` →
`v0.43.0`](https://cs.opensource.google/go/x/tools/+/refs/tags/v0.42.0...refs/tags/v0.43.0)
|
![age](https://developer.mend.io/api/mc/badges/age/go/golang.org%2fx%2ftools/v0.43.0?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/go/golang.org%2fx%2ftools/v0.42.0/v0.43.0?slim=true)
|

---

> [!WARNING]
> Some dependencies could not be looked up. Check the [Dependency
Dashboard](../issues/20907) for more information.

---

### Configuration

📅 **Schedule**: Branch creation - "on tuesday" (UTC), 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.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://github.com/renovatebot/renovate/discussions) if
that's undesired.

---

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

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/open-telemetry/opentelemetry-collector-contrib).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My42Ni40IiwidXBkYXRlZEluVmVyIjoiNDMuNjYuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIiwicmVub3ZhdGVib3QiXX0=-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>
Co-authored-by: Yang Song <songy23@users.noreply.github.com>
Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
Co-authored-by: Sean Marciniak <30928402+MovieStoreGuy@users.noreply.github.com>

* [connector/signaltometrics]reduce hot-path allocations (#47197)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Building on top of
https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/47185
PR to adapt it to the OTTL changes introduced in
https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/47177
- Replace per-signal `FilterAttributes` map allocation with a pooled
hash-based ID check (`ComputeAttributesHash`), deferring the actual
`pcommon.Map` creation to a lazy `FilterAttrsFunc` closure that is only
called when the aggregator encounters a new unique attribute set
- Cache filtered resource attributes per metric definition within each
resource batch (`resAttrsCache`), avoiding repeated OTTL expression
evaluation and map allocation for the same resource
- Add table-driven benchmarks for all 4 signal types (traces, metrics,
logs, profiles) with `no_match`, `all_match`, `partial_match`, and
`keys_expression` scenarios
  - Add `BenchmarkConnectorWithProfiles` (previously missing)
- Add priority ordering e2e test (`ottl_expression_priority`) validating
that later entries in the config override earlier ones

  ### Benchmark results (vs main, which includes #47177)

  | Benchmark | Time | Memory | Allocs |
  |-----------|------|--------|--------|
  | Traces/no_match | +14.9% | ~ | ~ |
  | **Traces/all_match** | **-15.7%** | **-34.2%** | **-60.4%** |
  | **Traces/partial_match** | **-8.0%** | **-9.2%** | **-21.7%** |
  | **Traces/keys_expression** | **-27.7%** | **-38.9%** | **-68.4%** |
  | Metrics/no_match | +6.1% | ~ | ~ |
  | **Metrics/all_match** | **-22.4%** | **-62.8%** | **-75.8%** |
  | **Metrics/partial_match** | **-25.6%** | **-56.2%** | **-69.0%** |
  | **Metrics/keys_expression** | **-38.1%** | **-68.5%** | **-83.4%** |
  | Logs/no_match | +12.5% | ~ | ~ |
  | **Logs/all_match** | **-11.7%** | **-20.3%** | **-43.1%** |
  | **Logs/partial_match** | **-9.8%** | **-11.9%** | **-24.3%** |
  | **Logs/keys_expression** | **-19.0%** | **-22.9%** | **-51.2%** |
  | Profiles/no_match | +7.0% | ~ | ~ |
  | **Profiles/all_match** | **-6.5%** | **-9.4%** | **-23.3%** |
  | Profiles/partial_match | +1.8% | +0.7% | +0.8% |
| **Profiles/keys_expression** | **-11.7%** | **-10.5%** | **-31.0%** |

\* `no_match` time regressions absolute values are very minimal
(<100ns). Memory and allocs are identical to main.

  ## Test plan
- [x] All existing e2e golden file tests pass (traces, metrics, logs,
profiles)
- [x] New `ottl_expression_priority` e2e test validates config ordering
  - [x] `make tidy`, `make fmt`, `make lint`, `make test` all pass

  Closes #47185

---------

Co-authored-by: vigneshshanmugam <vignesh.shanmugam22@gmail.com>

* Bump github.com/buger/jsonparser from 1.1.1 to 1.1.2 in /exporter/prometheusexporter (#47169)

Bumps [github.com/buger/jsonparser](https://github.com/buger/jsonparser)
from 1.1.1 to 1.1.2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/buger/jsonparser/releases">github.com/buger/jsonparser's
releases</a>.</em></p>
<blockquote>
<h2>v1.1.2</h2>
<h2>What's Changed</h2>
<ul>
<li>Updated travis to build for 1.13 to 1.15 by <a
href="https://github.com/janreggie"><code>@​janreggie</code></a> in <a
href="https://github.com/buger/jsonparser/pull/225">buger/jsonparser#225</a></li>
<li>
<ul>
<li>eliminate 2 allocations in EachKey() by <a
href="https://github.com/Villenny"><code>@​Villenny</code></a> in <a
href="https://github.com/buger/jsonparser/pull/223">buger/jsonparser#223</a></li>
</ul>
</li>
<li>fix issue <a
href="https://github.com/buger/jsonparser/issues/150">#150</a>
(in deleting case) by <a
href="https://github.com/daria-kay"><code>@​daria-kay</code></a> in <a
href="https://github.com/buger/jsonparser/pull/226">buger/jsonparser#226</a></li>
<li>fixing the oss-fuzz issue by <a
href="https://github.com/daria-kay"><code>@​daria-kay</code></a> in <a
href="https://github.com/buger/jsonparser/pull/227">buger/jsonparser#227</a></li>
<li>Fix parseInt overflow check false negative by <a
href="https://github.com/carsonip"><code>@​carsonip</code></a> in <a
href="https://github.com/buger/jsonparser/pull/231">buger/jsonparser#231</a></li>
<li>Added bespoke error for null cases by <a
href="https://github.com/jonomacd"><code>@​jonomacd</code></a> in <a
href="https://github.com/buger/jsonparser/pull/228">buger/jsonparser#228</a></li>
<li>Fuzzing: Add CIFuzz by <a
href="https://github.com/AdamKorcz"><code>@​AdamKorcz</code></a> in <a
href="https://github.com/buger/jsonparser/pull/239">buger/jsonparser#239</a></li>
<li>Added latest versions of go to tests by <a
href="https://github.com/moredure"><code>@​moredure</code></a> in <a
href="https://github.com/buger/jsonparser/pull/244">buger/jsonparser#244</a></li>
<li>fix EachKey pIdxFlags allocation by <a
href="https://github.com/unxcepted"><code>@​unxcepted</code></a> in <a
href="https://github.com/buger/jsonparser/pull/241">buger/jsonparser#241</a></li>
<li>fix: prevent panic on negative slice index in Delete with malformed
JSON (GO-2026-4514) by <a
href="https://github.com/dbarrosop"><code>@​dbarrosop</code></a> in <a
href="https://github.com/buger/jsonparser/pull/276">buger/jsonparser#276</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/janreggie"><code>@​janreggie</code></a>
made their first contribution in <a
href="https://github.com/buger/jsonparser/pull/225">buger/jsonparser#225</a></li>
<li><a href="https://github.com/Villenny"><code>@​Villenny</code></a>
made their first contribution in <a
href="https://github.com/buger/jsonparser/pull/223">buger/jsonparser#223</a></li>
<li><a href="https://github.com/daria-kay"><code>@​daria-kay</code></a>
made their first contribution in <a
href="https://github.com/buger/jsonparser/pull/226">buger/jsonparser#226</a></li>
<li><a href="https://github.com/carsonip"><code>@​carsonip</code></a>
made their first contribution in <a
href="https://github.com/buger/jsonparser/pull/231">buger/jsonparser#231</a></li>
<li><a href="https://github.com/jonomacd"><code>@​jonomacd</code></a>
made their first contribution in <a
href="https://github.com/buger/jsonparser/pull/228">buger/jsonparser#228</a></li>
<li><a href="https://github.com/moredure"><code>@​moredure</code></a>
made their first contribution in <a
href="https://github.com/buger/jsonparser/pull/244">buger/jsonparser#244</a></li>
<li><a href="https://github.com/unxcepted"><code>@​unxcepted</code></a>
made their first contribution in <a
href="https://github.com/buger/jsonparser/pull/241">buger/jsonparser#241</a></li>
<li><a href="https://github.com/dbarrosop"><code>@​dbarrosop</code></a>
made their first contribution in <a
href="https://github.com/buger/jsonparser/pull/276">buger/jsonparser#276</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/buger/jsonparser/compare/v1.1.1...v1.1.2">https://github.com/buger/jsonparser/compare/v1.1.1...v1.1.2</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/buger/jsonparser/commit/a69e7e01cd4ad67bdfd3ac2c080b9212af16f4b0"><code>a69e7e0</code></a>
Merge pull request <a
href="https://github.com/buger/jsonparser/issues/276">#276</a>
from dbarrosop/master</li>
<li><a
href="https://github.com/buger/jsonparser/commit/d3eacc0bab779d6cf98221f5268828fff287876e"><code>d3eacc0</code></a>
fix: prevent panic on negative slice index in Delete with malformed JSON
(GO-...</li>
<li><a
href="https://github.com/buger/jsonparser/commit/61b32cfdfa0f5d368ef7c7daef28ce12d538740f"><code>61b32cf</code></a>
Merge pull request <a
href="https://github.com/buger/jsonparser/issues/241">#241</a>
from unxcepted/master</li>
<li><a
href="https://github.com/buger/jsonparser/commit/2181e8398f18397c9cacbaea9889314bb585e868"><code>2181e83</code></a>
Merge pull request <a
href="https://github.com/buger/jsonparser/issues/244">#244</a>
from ScaleChamp/patch-2</li>
<li><a
href="https://github.com/buger/jsonparser/commit/1510b5194182fc2fb898f28cdbceb42fd7258bfa"><code>1510b51</code></a>
Added latest versions of go to tests</li>
<li><a
href="https://github.com/buger/jsonparser/commit/6fc2e488ed3cc4f1f1debec3b0c70715bd7be6fd"><code>6fc2e48</code></a>
fix: eachkey allocation</li>
<li><a
href="https://github.com/buger/jsonparser/commit/a6f867eb7787e4ec54536b77b5d628ddf5c4f73d"><code>a6f867e</code></a>
Merge pull request <a
href="https://github.com/buger/jsonparser/issues/239">#239</a>
from AdamKorcz/cifuzz1</li>
<li><a
href="https://github.com/buger/jsonparser/commit/cbc01fdbbe131706e89eeaaf0cd917760d8d3949"><code>cbc01fd</code></a>
Fuzzing: Add CIFuzz</li>
<li><a
href="https://github.com/buger/jsonparser/commit/dc92d6932a1272b4d8f485f798a88c3a75106256"><code>dc92d69</code></a>
Merge pull request <a
href="https://github.com/buger/jsonparser/issues/228">#228</a>
from jonomacd/null-handling</li>
<li><a
href="https://github.com/buger/jsonparser/commit/2d9d6343e8621ddc18c70749663f74bc584c0de4"><code>2d9d634</code></a>
Merge pull request <a
href="https://github.com/buger/jsonparser/issues/231">#231</a>
from carsonip/fix-parseint-overflow-check</li>
<li>Additional commits viewable in <a
href="https://github.com/buger/jsonparser/compare/v1.1.1...v1.1.2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/buger/jsonparser&package-manager=go_modules&previous-version=1.1.1&new-version=1.1.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will s…
atoulme pushed a commit that referenced this pull request Apr 23, 2026
…47535)

#### Description

Replaces @Logiraptor with @csmarchbanks as a codeowner of the tail
sampling processor as I have been more active recently and @Logiraptor
is working on other efforts. In addition, adds @carsonip as a new code
owner.

Some of my TSP efforts:
*
#42573
*
#44878
*
#45286
*
#46161

TSP work that @carsonip has done:
*
#43561
*
#46762
*
#42326
AndrewCharlesHay pushed a commit to AndrewCharlesHay/opentelemetry-collector-contrib that referenced this pull request Apr 23, 2026
…pen-telemetry#47535)

#### Description

Replaces @Logiraptor with @csmarchbanks as a codeowner of the tail
sampling processor as I have been more active recently and @Logiraptor
is working on other efforts. In addition, adds @carsonip as a new code
owner.

Some of my TSP efforts:
*
open-telemetry#42573
*
open-telemetry#44878
*
open-telemetry#45286
*
open-telemetry#46161

TSP work that @carsonip has done:
*
open-telemetry#43561
*
open-telemetry#46762
*
open-telemetry#42326
gracewehner pushed a commit to gracewehner/opentelemetry-collector-contrib that referenced this pull request Apr 29, 2026
…pen-telemetry#47535)

#### Description

Replaces @Logiraptor with @csmarchbanks as a codeowner of the tail
sampling processor as I have been more active recently and @Logiraptor
is working on other efforts. In addition, adds @carsonip as a new code
owner.

Some of my TSP efforts:
*
open-telemetry#42573
*
open-telemetry#44878
*
open-telemetry#45286
*
open-telemetry#46161

TSP work that @carsonip has done:
*
open-telemetry#43561
*
open-telemetry#46762
*
open-telemetry#42326
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

processor/tailsampling Tail sampling processor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[processor/tailsampling] Optimize performance by adjusting policy evaluation timing

6 participants