mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2026-06-03 18:35:08 +02:00
cf2a4a180f7ee93e3f237a8281f82a83baffa533
1240 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
cf2a4a180f |
chore(deps): update module mvdan.cc/gofumpt to v0.10.0 (#8304)
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [mvdan.cc/gofumpt](https://redirect.github.com/mvdan/gofumpt) | `v0.9.2` → `v0.10.0` |  |  | --- ### Release Notes <details> <summary>mvdan/gofumpt (mvdan.cc/gofumpt)</summary> ### [`v0.10.0`](https://redirect.github.com/mvdan/gofumpt/blob/HEAD/CHANGELOG.md#v0100---2026-05-04) [Compare Source](https://redirect.github.com/mvdan/gofumpt/compare/v0.9.2...v0.10.0) This release is based on Go 1.26's gofmt, and requires Go 1.25 or later. A new rule is introduced to drop unnecessary parentheses around expressions where the inner expression is unambiguous on its own, such as `f((3))`. Parentheses are kept where they are useful, such as on binary expressions. See [#​44](https://redirect.github.com/mvdan/gofumpt/issues/44). A new rule is introduced to require multi-line function calls to match the opening and closing parenthesis in terms of the use of newlines. See [#​74](https://redirect.github.com/mvdan/gofumpt/issues/74). The `-extra` flag now accepts a comma-separated list of rule names to enable individual extra rules, rather than enabling all of them at once. See [#​339](https://redirect.github.com/mvdan/gofumpt/issues/339). The following changes are included as well: - Avoid crashing on `go.mod` files without a `module` directive - [#​350](https://redirect.github.com/mvdan/gofumpt/issues/350) - Avoid failing when an ignored directory cannot be read - [#​351](https://redirect.github.com/mvdan/gofumpt/issues/351) - Avoid prefixing more kinds of commented-out Go code with spaces - [#​230](https://redirect.github.com/mvdan/gofumpt/issues/230) - Avoid prefixing a shebang comment with a space - [#​237](https://redirect.github.com/mvdan/gofumpt/issues/237) - Narrow the newlines on assignments rule to ignore complex cases - [#​354](https://redirect.github.com/mvdan/gofumpt/issues/354) - Fix three bugs which caused a second gofumpt run to make changes - [#​132](https://redirect.github.com/mvdan/gofumpt/issues/132), [#​345](https://redirect.github.com/mvdan/gofumpt/issues/345) </details> --- ### Configuration 📅 **Schedule**: (UTC) - 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 is behind base branch, 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-go). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNTkuMiIsInVwZGF0ZWRJblZlciI6IjQzLjE1OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJTa2lwIENoYW5nZWxvZyIsImRlcGVuZGVuY2llcyJdfQ==--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Tyler Yahn <codingalias@gmail.com> |
||
|
|
25f973a298 | fix(deps): update module golang.org/x/sys to v0.44.0 (#8322) | ||
|
|
8bc88510d3 |
Optimize metrics sdk measurement with AlwaysOff exemplar filter (#8267)
Follow-up to https://github.com/open-telemetry/opentelemetry-go/pull/8211. Because the exemplar reservoir is an interface, it can't be in-lined even when it is a no-op, so it has significant overhead. Skip it when a drop reservoir is used. This seems to have an overhead of something like ~10ns, which shows up mostly on the precomputed benchmarks. Benchmarks ``` goarch: amd64 pkg: go.opentelemetry.io/otel/sdk/metric cpu: Intel(R) Xeon(R) CPU @ 2.20GHz │ benchmark_results_before.txt │ benchmark_results_after.txt │ │ sec/op │ sec/op vs base │ EndToEndCounterAdd/NoFilter/Attributes/1/Precomputed/WithAttributeSet-24 62.65n ± 15% 54.59n ± 12% -12.88% (p=0.026 n=6) EndToEndCounterAdd/NoFilter/Attributes/1/Precomputed/WithAttributes-24 63.67n ± 10% 52.21n ± 6% -17.99% (p=0.002 n=6) EndToEndCounterAdd/NoFilter/Attributes/1/Dynamic/WithAttributeSet-24 238.8n ± 14% 240.0n ± 10% ~ (p=1.000 n=6) EndToEndCounterAdd/NoFilter/Attributes/1/Dynamic/WithAttributes-24 220.7n ± 14% 245.6n ± 13% ~ (p=0.180 n=6) EndToEndCounterAdd/NoFilter/Attributes/1/Naive/WithAttributes-24 373.4n ± 26% 352.9n ± 11% ~ (p=0.240 n=6) EndToEndCounterAdd/NoFilter/Attributes/5/Precomputed/WithAttributeSet-24 69.73n ± 16% 48.85n ± 14% -29.94% (p=0.002 n=6) EndToEndCounterAdd/NoFilter/Attributes/5/Precomputed/WithAttributes-24 61.32n ± 3% 49.01n ± 5% -20.08% (p=0.002 n=6) EndToEndCounterAdd/NoFilter/Attributes/5/Dynamic/WithAttributeSet-24 988.4n ± 48% 759.9n ± 55% -23.12% (p=0.041 n=6) EndToEndCounterAdd/NoFilter/Attributes/5/Dynamic/WithAttributes-24 954.1n ± 90% 667.9n ± 19% -30.00% (p=0.002 n=6) EndToEndCounterAdd/NoFilter/Attributes/5/Naive/WithAttributes-24 1.515µ ± 32% 1.233µ ± 12% ~ (p=0.240 n=6) EndToEndCounterAdd/NoFilter/Attributes/10/Precomputed/WithAttributeSet-24 70.86n ± 11% 53.90n ± 16% -23.94% (p=0.002 n=6) EndToEndCounterAdd/NoFilter/Attributes/10/Precomputed/WithAttributes-24 69.20n ± 21% 48.95n ± 12% -29.27% (p=0.004 n=6) EndToEndCounterAdd/NoFilter/Attributes/10/Dynamic/WithAttributeSet-24 1.483µ ± 28% 1.283µ ± 29% ~ (p=0.310 n=6) EndToEndCounterAdd/NoFilter/Attributes/10/Dynamic/WithAttributes-24 1.421µ ± 41% 1.664µ ± 49% ~ (p=0.394 n=6) EndToEndCounterAdd/NoFilter/Attributes/10/Naive/WithAttributes-24 2.784µ ± 66% 2.109µ ± 19% -24.23% (p=0.041 n=6) geomean 299.2n 252.1n -15.75% ``` --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> |
||
|
|
1a877475b7 |
Apply attribute value limit for BYTESLICE and KindBytes (#7990)
Fixes https://github.com/open-telemetry/opentelemetry-go/issues/7954 Apply the SDK attribute value limit to the new BYTESLICE attribute type. The limiter has been implemented for trace and log attributes, ensuring values are truncated according to the configured attribute size limit (counting each byte as 1). ``` goos: darwin goarch: arm64 pkg: go.opentelemetry.io/otel/sdk/trace cpu: Apple M1 BenchmarkSpanLimits/None-8 275883 4062 ns/op 12448 B/op 38 allocs/op BenchmarkSpanLimits/AttributeValueLengthLimit-8 266834 4407 ns/op 13012 B/op 47 allocs/op BenchmarkSpanLimits/AttributeCountLimit-8 299941 4025 ns/op 11616 B/op 38 allocs/op BenchmarkSpanLimits/EventCountLimit-8 305880 3795 ns/op 11376 B/op 35 allocs/op BenchmarkSpanLimits/LinkCountLimit-8 314924 4375 ns/op 10976 B/op 35 allocs/op BenchmarkSpanLimits/AttributePerEventCountLimit-8 275667 4125 ns/op 12448 B/op 38 allocs/op BenchmarkSpanLimits/AttributePerLinkCountLimit-8 285484 4022 ns/op 12448 B/op 38 allocs/op PASS ok go.opentelemetry.io/otel/sdk/trace 9.394s ``` --------- Co-authored-by: Robert Pająk <pellared@hotmail.com> |
||
|
|
760898d668 |
Run benchmarks using Settable for more accurate comparrisons (#8252)
I had avoided using Settable in our benchmarks in https://github.com/open-telemetry/opentelemetry-go/pull/8178 because I thought it would introduce a dependency on the x package in our go.mod file. But it turns out it doesn't (based on https://github.com/open-telemetry/opentelemetry-go/pull/8251). This will make it easier to compare WithAttributeSet to WithUnsafeAttributes. ``` │ before_bench.txt │ after_bench.txt │ │ sec/op │ sec/op vs base │ EndToEndCounterAdd/NoFilter/Attributes/1/Precomputed/WithAttributeSet-24 60.48n ± 7% 61.83n ± 20% ~ (p=1.000 n=6) EndToEndCounterAdd/NoFilter/Attributes/1/Precomputed/WithAttributes-24 60.18n ± 9% 65.46n ± 8% ~ (p=0.065 n=6) EndToEndCounterAdd/NoFilter/Attributes/1/Dynamic/WithAttributeSet-24 256.2n ± 6% 272.4n ± 18% +6.34% (p=0.041 n=6) EndToEndCounterAdd/NoFilter/Attributes/1/Dynamic/WithAttributes-24 311.4n ± 18% 282.4n ± 26% ~ (p=0.132 n=6) EndToEndCounterAdd/NoFilter/Attributes/1/Naive/WithAttributes-24 350.4n ± 13% 331.2n ± 45% ~ (p=0.818 n=6) EndToEndCounterAdd/NoFilter/Attributes/5/Precomputed/WithAttributeSet-24 64.50n ± 10% 71.22n ± 11% ~ (p=0.093 n=6) EndToEndCounterAdd/NoFilter/Attributes/5/Precomputed/WithAttributes-24 61.45n ± 15% 69.04n ± 18% ~ (p=0.180 n=6) EndToEndCounterAdd/NoFilter/Attributes/5/Dynamic/WithAttributeSet-24 700.1n ± 36% 776.0n ± 22% ~ (p=0.394 n=6) EndToEndCounterAdd/NoFilter/Attributes/5/Dynamic/WithAttributes-24 868.4n ± 14% 738.2n ± 8% -14.99% (p=0.015 n=6) EndToEndCounterAdd/NoFilter/Attributes/5/Naive/WithAttributes-24 974.8n ± 19% 1083.5n ± 10% ~ (p=0.180 n=6) EndToEndCounterAdd/NoFilter/Attributes/10/Precomputed/WithAttributeSet-24 67.68n ± 15% 64.42n ± 20% ~ (p=1.000 n=6) EndToEndCounterAdd/NoFilter/Attributes/10/Precomputed/WithAttributes-24 67.59n ± 7% 63.41n ± 21% ~ (p=0.937 n=6) EndToEndCounterAdd/NoFilter/Attributes/10/Dynamic/WithAttributeSet-24 1.310µ ± 27% 1.323µ ± 20% ~ (p=0.589 n=6) EndToEndCounterAdd/NoFilter/Attributes/10/Dynamic/WithAttributes-24 2.077µ ± 34% 1.492µ ± 19% -28.15% (p=0.002 n=6) EndToEndCounterAdd/NoFilter/Attributes/10/Naive/WithAttributes-24 2.041µ ± 35% 1.977µ ± 43% ~ (p=0.485 n=6) EndToEndCounterAdd/Filtered/Attributes/1/Precomputed/WithAttributeSet-24 208.9n ± 7% 214.3n ± 12% ~ (p=0.784 n=6) EndToEndCounterAdd/Filtered/Attributes/1/Precomputed/WithAttributes-24 202.5n ± 6% 201.7n ± 19% ~ (p=0.937 n=6) EndToEndCounterAdd/Filtered/Attributes/1/Dynamic/WithAttributeSet-24 417.5n ± 7% 403.9n ± 16% ~ (p=0.394 n=6) EndToEndCounterAdd/Filtered/Attributes/1/Dynamic/WithAttributes-24 496.8n ± 13% 383.1n ± 8% -22.89% (p=0.002 n=6) EndToEndCounterAdd/Filtered/Attributes/1/Naive/WithAttributes-24 542.8n ± 54% 521.7n ± 18% ~ (p=0.589 n=6) EndToEndCounterAdd/Filtered/Attributes/5/Precomputed/WithAttributeSet-24 732.6n ± 15% 822.3n ± 23% ~ (p=0.065 n=6) EndToEndCounterAdd/Filtered/Attributes/5/Precomputed/WithAttributes-24 803.0n ± 12% 813.9n ± 27% ~ (p=0.818 n=6) EndToEndCounterAdd/Filtered/Attributes/5/Dynamic/WithAttributeSet-24 1.389µ ± 28% 1.546µ ± 16% ~ (p=0.699 n=6) EndToEndCounterAdd/Filtered/Attributes/5/Dynamic/WithAttributes-24 1.756µ ± 12% 1.399µ ± 12% -20.36% (p=0.002 n=6) EndToEndCounterAdd/Filtered/Attributes/5/Naive/WithAttributes-24 1.730µ ± 21% 1.824µ ± 20% ~ (p=0.818 n=6) EndToEndCounterAdd/Filtered/Attributes/10/Precomputed/WithAttributeSet-24 5.500µ ± 155% 1.433µ ± 22% -73.94% (p=0.002 n=6) EndToEndCounterAdd/Filtered/Attributes/10/Precomputed/WithAttributes-24 2.566µ ± 65% 1.365µ ± 23% -46.82% (p=0.002 n=6) EndToEndCounterAdd/Filtered/Attributes/10/Dynamic/WithAttributeSet-24 6.198µ ± 78% 3.188µ ± 14% -48.57% (p=0.002 n=6) EndToEndCounterAdd/Filtered/Attributes/10/Dynamic/WithAttributes-24 5.343µ ± 63% 2.963µ ± 10% -44.55% (p=0.002 n=6) EndToEndCounterAdd/Filtered/Attributes/10/Naive/WithAttributes-24 4.293µ ± 279% 3.213µ ± 30% ~ (p=0.065 n=6) geomean 591.5n 518.3n -12.37% │ before_bench.txt │ after_bench.txt │ │ B/op │ B/op vs base │ EndToEndCounterAdd/NoFilter/Attributes/1/Precomputed/WithAttributeSet-24 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/NoFilter/Attributes/1/Precomputed/WithAttributes-24 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/NoFilter/Attributes/1/Dynamic/WithAttributeSet-24 88.00 ± 0% 64.00 ± 0% -27.27% (p=0.002 n=6) EndToEndCounterAdd/NoFilter/Attributes/1/Dynamic/WithAttributes-24 152.00 ± 0% 64.00 ± 0% -57.89% (p=0.002 n=6) EndToEndCounterAdd/NoFilter/Attributes/1/Naive/WithAttributes-24 232.0 ± 0% 232.0 ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/NoFilter/Attributes/5/Precomputed/WithAttributeSet-24 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/NoFilter/Attributes/5/Precomputed/WithAttributes-24 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/NoFilter/Attributes/5/Dynamic/WithAttributeSet-24 344.0 ± 0% 320.0 ± 0% -6.98% (p=0.002 n=6) EndToEndCounterAdd/NoFilter/Attributes/5/Dynamic/WithAttributes-24 664.0 ± 0% 320.0 ± 0% -51.81% (p=0.002 n=6) EndToEndCounterAdd/NoFilter/Attributes/5/Naive/WithAttributes-24 1000.0 ± 0% 1000.0 ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/NoFilter/Attributes/10/Precomputed/WithAttributeSet-24 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/NoFilter/Attributes/10/Precomputed/WithAttributes-24 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/NoFilter/Attributes/10/Dynamic/WithAttributeSet-24 729.0 ± 0% 705.0 ± 0% -3.29% (p=0.002 n=6) EndToEndCounterAdd/NoFilter/Attributes/10/Dynamic/WithAttributes-24 1434.0 ± 0% 705.0 ± 0% -50.84% (p=0.002 n=6) EndToEndCounterAdd/NoFilter/Attributes/10/Naive/WithAttributes-24 2.102Ki ± 0% 2.102Ki ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/Filtered/Attributes/1/Precomputed/WithAttributeSet-24 64.00 ± 0% 64.00 ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/Filtered/Attributes/1/Precomputed/WithAttributes-24 64.00 ± 0% 64.00 ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/Filtered/Attributes/1/Dynamic/WithAttributeSet-24 152.0 ± 0% 128.0 ± 0% -15.79% (p=0.002 n=6) EndToEndCounterAdd/Filtered/Attributes/1/Dynamic/WithAttributes-24 216.0 ± 0% 128.0 ± 0% -40.74% (p=0.002 n=6) EndToEndCounterAdd/Filtered/Attributes/1/Naive/WithAttributes-24 296.0 ± 0% 296.0 ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/Filtered/Attributes/5/Precomputed/WithAttributeSet-24 576.0 ± 0% 576.0 ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/Filtered/Attributes/5/Precomputed/WithAttributes-24 576.0 ± 0% 576.0 ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/Filtered/Attributes/5/Dynamic/WithAttributeSet-24 921.0 ± 0% 898.0 ± 0% -2.50% (p=0.002 n=6) EndToEndCounterAdd/Filtered/Attributes/5/Dynamic/WithAttributes-24 1241.0 ± 0% 897.0 ± 0% -27.72% (p=0.002 n=6) EndToEndCounterAdd/Filtered/Attributes/5/Naive/WithAttributes-24 1.539Ki ± 0% 1.539Ki ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/Filtered/Attributes/10/Precomputed/WithAttributeSet-24 1.312Ki ± 0% 1.312Ki ± 0% ~ (p=1.000 n=6) EndToEndCounterAdd/Filtered/Attributes/10/Precomputed/WithAttributes-24 1.312Ki ± 0% 1.312Ki ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/Filtered/Attributes/10/Dynamic/WithAttributeSet-24 2.025Ki ± 0% 2.004Ki ± 0% -1.06% (p=0.002 n=6) EndToEndCounterAdd/Filtered/Attributes/10/Dynamic/WithAttributes-24 2.713Ki ± 0% 2.002Ki ± 0% -26.19% (p=0.002 n=6) EndToEndCounterAdd/Filtered/Attributes/10/Naive/WithAttributes-24 3.414Ki ± 0% 3.414Ki ± 0% ~ (p=1.000 n=6) geomean ² -12.74% ² ¹ all samples are equal ² summaries must be >0 to compute geomean │ before_bench.txt │ after_bench.txt │ │ allocs/op │ allocs/op vs base │ EndToEndCounterAdd/NoFilter/Attributes/1/Precomputed/WithAttributeSet-24 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/NoFilter/Attributes/1/Precomputed/WithAttributes-24 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/NoFilter/Attributes/1/Dynamic/WithAttributeSet-24 2.000 ± 0% 1.000 ± 0% -50.00% (p=0.002 n=6) EndToEndCounterAdd/NoFilter/Attributes/1/Dynamic/WithAttributes-24 3.000 ± 0% 1.000 ± 0% -66.67% (p=0.002 n=6) EndToEndCounterAdd/NoFilter/Attributes/1/Naive/WithAttributes-24 5.000 ± 0% 5.000 ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/NoFilter/Attributes/5/Precomputed/WithAttributeSet-24 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/NoFilter/Attributes/5/Precomputed/WithAttributes-24 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/NoFilter/Attributes/5/Dynamic/WithAttributeSet-24 2.000 ± 0% 1.000 ± 0% -50.00% (p=0.002 n=6) EndToEndCounterAdd/NoFilter/Attributes/5/Dynamic/WithAttributes-24 3.000 ± 0% 1.000 ± 0% -66.67% (p=0.002 n=6) EndToEndCounterAdd/NoFilter/Attributes/5/Naive/WithAttributes-24 5.000 ± 0% 5.000 ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/NoFilter/Attributes/10/Precomputed/WithAttributeSet-24 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/NoFilter/Attributes/10/Precomputed/WithAttributes-24 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/NoFilter/Attributes/10/Dynamic/WithAttributeSet-24 2.000 ± 0% 1.000 ± 0% -50.00% (p=0.002 n=6) EndToEndCounterAdd/NoFilter/Attributes/10/Dynamic/WithAttributes-24 3.000 ± 0% 1.000 ± 0% -66.67% (p=0.002 n=6) EndToEndCounterAdd/NoFilter/Attributes/10/Naive/WithAttributes-24 5.000 ± 0% 5.000 ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/Filtered/Attributes/1/Precomputed/WithAttributeSet-24 1.000 ± 0% 1.000 ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/Filtered/Attributes/1/Precomputed/WithAttributes-24 1.000 ± 0% 1.000 ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/Filtered/Attributes/1/Dynamic/WithAttributeSet-24 3.000 ± 0% 2.000 ± 0% -33.33% (p=0.002 n=6) EndToEndCounterAdd/Filtered/Attributes/1/Dynamic/WithAttributes-24 4.000 ± 0% 2.000 ± 0% -50.00% (p=0.002 n=6) EndToEndCounterAdd/Filtered/Attributes/1/Naive/WithAttributes-24 6.000 ± 0% 6.000 ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/Filtered/Attributes/5/Precomputed/WithAttributeSet-24 2.000 ± 0% 2.000 ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/Filtered/Attributes/5/Precomputed/WithAttributes-24 2.000 ± 0% 2.000 ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/Filtered/Attributes/5/Dynamic/WithAttributeSet-24 4.000 ± 0% 3.000 ± 0% -25.00% (p=0.002 n=6) EndToEndCounterAdd/Filtered/Attributes/5/Dynamic/WithAttributes-24 5.000 ± 0% 3.000 ± 0% -40.00% (p=0.002 n=6) EndToEndCounterAdd/Filtered/Attributes/5/Naive/WithAttributes-24 7.000 ± 0% 7.000 ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/Filtered/Attributes/10/Precomputed/WithAttributeSet-24 2.000 ± 0% 2.000 ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/Filtered/Attributes/10/Precomputed/WithAttributes-24 2.000 ± 0% 2.000 ± 0% ~ (p=1.000 n=6) ¹ EndToEndCounterAdd/Filtered/Attributes/10/Dynamic/WithAttributeSet-24 4.000 ± 0% 3.000 ± 0% -25.00% (p=0.002 n=6) EndToEndCounterAdd/Filtered/Attributes/10/Dynamic/WithAttributes-24 5.000 ± 0% 3.000 ± 0% -40.00% (p=0.002 n=6) EndToEndCounterAdd/Filtered/Attributes/10/Naive/WithAttributes-24 7.000 ± 0% 7.000 ± 0% ~ (p=1.000 n=6) ¹ geomean ² -23.59% ² ¹ all samples are equal ² summaries must be >0 to compute geomean ``` |
||
|
|
25ba7a7218 |
Revert "Optimize fixedsize reservoir (#7447)" (#8249)
This reverts commit
|
||
|
|
5f80184b57 |
sdk/metric: apply default cardinality limit of 2000 (#8247)
Per https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#cardinality-limits: > If none of the previous values are defined, the default value of 2000 SHOULD be used. |
||
|
|
6f81801cd8 |
Use a DropReservoir when an exemplar.AlwaysOffFilter is provided (#8211)
Fixes https://github.com/open-telemetry/opentelemetry-go/issues/6260, https://github.com/open-telemetry/opentelemetry-go/issues/6333 The [spec for always off](https://github.com/open-telemetry/opentelemetry-specification/blob/d500678e4612b56ff2cd5f03e67cd845977d1746/specification/metrics/sdk.md#alwaysoff) suggests this should "disable" the Exemplar feature: > An ExemplarFilter which makes no measurements eligible for being an Exemplar. Using this ExemplarFilter is as good as disabling the Exemplar feature. There were a few reports of much higher memory usage when exemplars were added. I looked into the reports, and it looks like exemplar reservoirs are expensive in terms of memory compared to the aggregation itself. Ideally, we shouldn't construct the reservoir when an AlwaysOff exemplar filter is used. I couldn't find a super clean way to do this... `exemplar.AlwaysOffFilter` is a function, so I couldn't easily compare it without comparing the pointers. I'm open to other suggestions. The internet says that compiler optimizations could cause this logic to fail, but worst-case you get the existing behavior. ### Benchmarks I needed a benchmark that creates a new attribute set for each call to be able to see how much memory each attribute set uses, so I added a new one, and ran it against main. Overall, it reduces the amount of memory used per-attribute-set by 70-88%, which is pretty substantial. Overall, ``` │ old.txt │ new.txt │ │ sec/op │ sec/op vs base │ BenchmarkMeasureNewAttributeSet/AlwaysOn/Int64Counter-24 3.523µ ± 2% 3.745µ ± 29% +6.32% (p=0.002 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOn/Float64Counter-24 3.714µ ± 6% 3.879µ ± 5% ~ (p=0.132 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOn/Int64UpDownCounter-24 3.811µ ± 8% 3.941µ ± 5% ~ (p=0.065 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOn/Float64UpDownCounter-24 3.714µ ± 5% 3.822µ ± 1% ~ (p=0.132 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOn/Int64Histogram-24 3.126µ ± 4% 3.333µ ± 4% +6.61% (p=0.004 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOn/Float64Histogram-24 3.099µ ± 4% 3.204µ ± 8% ~ (p=0.093 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOn/Int64Gauge-24 3.745µ ± 7% 3.902µ ± 4% ~ (p=0.240 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOn/Float64Gauge-24 3.746µ ± 7% 3.862µ ± 2% ~ (p=0.102 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOff/Int64Counter-24 3.621µ ± 3% 1.665µ ± 1% -54.00% (p=0.002 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOff/Float64Counter-24 3.639µ ± 2% 1.686µ ± 4% -53.68% (p=0.002 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOff/Int64UpDownCounter-24 3.563µ ± 4% 1.700µ ± 4% -52.29% (p=0.002 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOff/Float64UpDownCounter-24 3.634µ ± 1% 1.690µ ± 4% -53.49% (p=0.002 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOff/Int64Histogram-24 2.892µ ± 2% 2.005µ ± 2% -30.66% (p=0.002 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOff/Float64Histogram-24 2.962µ ± 5% 2.057µ ± 6% -30.55% (p=0.002 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOff/Int64Gauge-24 3.692µ ± 5% 1.599µ ± 2% -56.68% (p=0.002 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOff/Float64Gauge-24 3.651µ ± 3% 1.612µ ± 2% -55.86% (p=0.002 n=6) geomean 3.495µ 2.541µ -27.30% │ old.txt │ new.txt │ │ B/op │ B/op vs base │ BenchmarkMeasureNewAttributeSet/AlwaysOn/Int64Counter-24 3.107Ki ± 0% 3.107Ki ± 0% ~ (p=0.121 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOn/Float64Counter-24 3.108Ki ± 0% 3.107Ki ± 0% ~ (p=0.177 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOn/Int64UpDownCounter-24 3.108Ki ± 0% 3.108Ki ± 0% ~ (p=0.675 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOn/Float64UpDownCounter-24 3.107Ki ± 0% 3.107Ki ± 0% ~ (p=1.000 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOn/Int64Histogram-24 2.622Ki ± 0% 2.622Ki ± 0% ~ (p=0.394 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOn/Float64Histogram-24 2.622Ki ± 0% 2.622Ki ± 0% ~ (p=0.636 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOn/Int64Gauge-24 3.108Ki ± 0% 3.107Ki ± 0% ~ (p=0.167 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOn/Float64Gauge-24 3.107Ki ± 0% 3.108Ki ± 0% ~ (p=0.182 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOff/Int64Counter-24 3182.0 ± 0% 361.0 ± 0% -88.65% (p=0.002 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOff/Float64Counter-24 3182.5 ± 0% 360.5 ± 0% -88.67% (p=0.002 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOff/Int64UpDownCounter-24 3182.0 ± 0% 359.5 ± 1% -88.70% (p=0.002 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOff/Float64UpDownCounter-24 3182.0 ± 0% 361.0 ± 0% -88.65% (p=0.002 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOff/Int64Histogram-24 2684.0 ± 0% 773.0 ± 0% -71.20% (p=0.002 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOff/Float64Histogram-24 2684.0 ± 0% 773.0 ± 0% -71.20% (p=0.002 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOff/Int64Gauge-24 3182.0 ± 0% 361.0 ± 1% -88.65% (p=0.002 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOff/Float64Gauge-24 3182.0 ± 0% 361.0 ± 0% -88.65% (p=0.002 n=6) geomean 2.978Ki 1.127Ki -62.17% │ old.txt │ new.txt │ │ allocs/op │ allocs/op vs base │ BenchmarkMeasureNewAttributeSet/AlwaysOn/Int64Counter-24 12.00 ± 0% 12.00 ± 0% ~ (p=1.000 n=6) ¹ BenchmarkMeasureNewAttributeSet/AlwaysOn/Float64Counter-24 12.00 ± 0% 12.00 ± 0% ~ (p=1.000 n=6) ¹ BenchmarkMeasureNewAttributeSet/AlwaysOn/Int64UpDownCounter-24 12.00 ± 0% 12.00 ± 0% ~ (p=1.000 n=6) ¹ BenchmarkMeasureNewAttributeSet/AlwaysOn/Float64UpDownCounter-24 12.00 ± 0% 12.00 ± 0% ~ (p=1.000 n=6) ¹ BenchmarkMeasureNewAttributeSet/AlwaysOn/Int64Histogram-24 13.00 ± 0% 13.00 ± 0% ~ (p=1.000 n=6) ¹ BenchmarkMeasureNewAttributeSet/AlwaysOn/Float64Histogram-24 13.00 ± 0% 13.00 ± 0% ~ (p=1.000 n=6) ¹ BenchmarkMeasureNewAttributeSet/AlwaysOn/Int64Gauge-24 12.00 ± 0% 12.00 ± 0% ~ (p=1.000 n=6) ¹ BenchmarkMeasureNewAttributeSet/AlwaysOn/Float64Gauge-24 12.00 ± 0% 12.00 ± 0% ~ (p=1.000 n=6) ¹ BenchmarkMeasureNewAttributeSet/AlwaysOff/Int64Counter-24 12.000 ± 0% 7.000 ± 0% -41.67% (p=0.002 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOff/Float64Counter-24 12.000 ± 0% 7.000 ± 0% -41.67% (p=0.002 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOff/Int64UpDownCounter-24 12.000 ± 0% 7.000 ± 0% -41.67% (p=0.002 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOff/Float64UpDownCounter-24 12.000 ± 0% 7.000 ± 0% -41.67% (p=0.002 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOff/Int64Histogram-24 13.000 ± 0% 9.000 ± 0% -30.77% (p=0.002 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOff/Float64Histogram-24 13.000 ± 0% 9.000 ± 0% -30.77% (p=0.002 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOff/Int64Gauge-24 12.000 ± 0% 7.000 ± 0% -41.67% (p=0.002 n=6) BenchmarkMeasureNewAttributeSet/AlwaysOff/Float64Gauge-24 12.000 ± 0% 7.000 ± 0% -41.67% (p=0.002 n=6) geomean 12.24 9.553 -21.97% ¹ all samples are equal ``` Gemini helped me write this. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> |
||
|
|
bec9f66b45 |
sdk/trace: apply AttributeValueLengthLimit to attribute.SLICE (#8217)
Fixes #7955 Per the OTel spec, attribute value limits must be applied recursively to array elements. Previously truncateAttr only handled STRING and STRINGSLICE. Add a SLICE case to truncateAttr and two unexported helpers: - truncateValue: recursively truncates STRING, STRINGSLICE, and SLICE - needsTruncation: pre-scan guard that avoids allocating a new slice when no element would be modified (mirrors sdk/log's pattern) ``` goarch: amd64 pkg: go.opentelemetry.io/otel/sdk/trace cpu: 13th Gen Intel(R) Core(TM) i7-13800H BenchmarkSpanLimits/None-20 205869 6757 ns/op 11296 B/op 38 allocs/op BenchmarkSpanLimits/AttributeValueLengthLimit-20 189799 5271 ns/op 11712 B/op 45 allocs/op BenchmarkSpanLimits/AttributeCountLimit-20 135494 9970 ns/op 10592 B/op 38 allocs/op BenchmarkSpanLimits/EventCountLimit-20 121084 9672 ns/op 10224 B/op 35 allocs/op BenchmarkSpanLimits/LinkCountLimit-20 110524 9419 ns/op 9824 B/op 35 allocs/op BenchmarkSpanLimits/AttributePerEventCountLimit-20 123159 9308 ns/op 11296 B/op 38 allocs/op BenchmarkSpanLimits/AttributePerLinkCountLimit-20 146022 9337 ns/op 11296 B/op 38 allocs/op ``` The new `attribute.SLICE` item makes `BenchmarkSpanLimits/AttributeValueLengthLimit` ~12% slower with 5 extra allocs in that path compared to `main`. This is fine as 3 strings and 2 arrays need to be allocated because of the limits+truncation. ``` SpanLimits/AttributeValueLengthLimit 5.030µs ± 2% 5.651µs ± 2% +12.34% (p=0.000 n=10) SpanLimits/AttributeValueLengthLimit 10.53KiB ± 0% 11.44KiB ± 0% +8.61% (p=0.000 n=10) SpanLimits/AttributeValueLengthLimit 40.00 allocs 45.00 allocs +12.50% (p=0.000 n=10) ``` |
||
|
|
ac9a33d214 |
test: truncate attribute string values using Unicode rune count (#8219)
Add test cases to ensure correct behavior. From https://opentelemetry.io/docs/specs/otel/common/#attribute-limits: > set an attribute value length limit such that for each attribute value: > - if it is a string, if it exceeds that limit (counting any character in it as 1), SDKs MUST truncate that value, so that its length is at most equal to the limit, |
||
|
|
3356ad3f1a |
Fix typos found by copilot (#8221)
Found during copilot code reviews on other PRs. https://github.com/open-telemetry/opentelemetry-go/pull/8211#discussion_r3094951812 |
||
|
|
d13f8ecb2d |
attribute: add SLICE type support (#8166)
Fixes https://github.com/open-telemetry/opentelemetry-go/issues/7934 ``` $ go test -run=^$ -bench=BenchmarkSlice goos: linux goarch: amd64 pkg: go.opentelemetry.io/otel/attribute cpu: 13th Gen Intel(R) Core(TM) i7-13800H BenchmarkSlice/Len3/Value-20 25297926 52.56 ns/op 144 B/op 1 allocs/op BenchmarkSlice/Len3/KeyValue-20 21315132 55.97 ns/op 144 B/op 1 allocs/op BenchmarkSlice/Len3/AsSlice-20 24214248 50.03 ns/op 144 B/op 1 allocs/op BenchmarkSlice/Len3/String-20 14148270 86.48 ns/op 48 B/op 1 allocs/op BenchmarkSlice/Len3/Emit-20 13605388 85.18 ns/op 48 B/op 1 allocs/op BenchmarkSlice/Len5Nested/Value-20 16086171 71.30 ns/op 240 B/op 1 allocs/op BenchmarkSlice/Len5Nested/KeyValue-20 15547844 75.81 ns/op 240 B/op 1 allocs/op BenchmarkSlice/Len5Nested/AsSlice-20 17806996 66.16 ns/op 240 B/op 1 allocs/op BenchmarkSlice/Len5Nested/String-20 7409064 165.2 ns/op 64 B/op 1 allocs/op BenchmarkSlice/Len5Nested/Emit-20 7666302 161.0 ns/op 64 B/op 1 allocs/op PASS ok go.opentelemetry.io/otel/attribute 12.980s ``` ``` $ go test -run=^$ -bench=BenchmarkHashKVs goos: linux goarch: amd64 pkg: go.opentelemetry.io/otel/attribute cpu: 13th Gen Intel(R) Core(TM) i7-13800H BenchmarkHashKVs-20 1268742 940.5 ns/op 0 B/op 0 allocs/op PASS ok go.opentelemetry.io/otel/attribute 1.198s ``` |
||
|
|
c56c84380c |
sdk/trace: propagate SpanExporter.Shutdown error from BatchSpanProcessor (#8197)
Fixes #6878. `bsp.e.Shutdown(ctx)` was called with `:=` inside an `if` statement, creating a new variable that shadowed the outer `err`. The error was handled via `otel.Handle` but never returned to the caller of `BatchSpanProcessor.Shutdown`. ### Fix Use a dedicated `exportErr` variable. The goroutine writes it before closing the `wait` channel; the caller reads it only in the `<-wait` select case (where the goroutine is guaranteed done). This is race-free — addressing the concern raised by @seh in #6878. All existing `TestBatchSpanProcessor*` tests pass. --------- Signed-off-by: alliasgher <alliasgher123@gmail.com> Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com> Co-authored-by: Robert Pająk <pellared@hotmail.com> |
||
|
|
88a71eeb67 |
Fix exemplar tests in containerized environments (#8188)
The actual default reservoir provider uses runtime.GOMAXPROCS(0) to work properly in containerized environments. When I was running the test, the fact that the test used runtime.NumCPU() caused the test to fail. https://github.com/open-telemetry/opentelemetry-go/blob/48dd8b1a0975e14a09d615f8ee80212b20f1e107/sdk/metric/exemplar.go#L70-L73 |
||
|
|
d96b420138 |
Add support for the development attributes advisory parameter (#8135)
From [the spec](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#instrument-advisory-parameter-attributes): > ##### Instrument advisory parameter: `Attributes` > **Status**: [Development](../document-status.md) > Applies to all instrument types. > `Attributes` (a list of [attribute keys](../common/README.md#attribute)) is the recommended set of attribute keys to be used for the resulting metrics. We already have `WithAttributes` options, so i've opted to name this `WithDefaultAttributes` to avoid naming collisions. We could also consider `WithAttributeKeys`, or `WithDefaultAttributeKeys` Follows the pattern for experimental options introduced in https://github.com/open-telemetry/opentelemetry-go/pull/8111 --------- Co-authored-by: Robert Pająk <pellared@hotmail.com> |
||
|
|
1519eb8c33 |
attribute: Set.MarshalLog to use Value.String instead of Value.Emit (#8169)
Towards https://github.com/open-telemetry/opentelemetry-go/issues/8145 |
||
|
|
ace6b2479e |
metricdatatest: support BYTESLICE attribute comparisons (#8167)
Address https://github.com/open-telemetry/opentelemetry-go/pull/7948#discussion_r3058370139 |
||
|
|
f92fc890b6 |
fix(deps): update module golang.org/x/tools to v0.44.0 (#8173)
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/tools](https://pkg.go.dev/golang.org/x/tools) | [`v0.43.0` → `v0.44.0`](https://cs.opensource.google/go/x/tools/+/refs/tags/v0.43.0...refs/tags/v0.44.0) |  |  | --- > [!WARNING] > Some dependencies could not be looked up. Check the [Dependency Dashboard](../issues/5322) for more information. --- ### Configuration 📅 **Schedule**: (UTC) - 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 is behind base branch, 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-go). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMTAuMiIsInVwZGF0ZWRJblZlciI6IjQzLjExMC4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJTa2lwIENoYW5nZWxvZyIsImRlcGVuZGVuY2llcyJdfQ==--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: dmathieu <damien.mathieu@elastic.co> |
||
|
|
0c09e08e7f |
Add experimental support for batching in periodic reader (#8071)
Adds experimental support for maxExportBatchSize using the `OTEL_GO_X_METRIC_EXPORT_BATCH_SIZE=<size>` environment variable. Previous prototype: https://github.com/open-telemetry/opentelemetry-go/pull/7930 This preserves existing behavior for timeouts when batching is not used, but individually applies the timeout to export calls when batching is used. |
||
|
|
edd072f2c9 |
Improve test coverage for exponential histogram edge cases (#8129)
Some small testing improvements forked from https://github.com/open-telemetry/opentelemetry-go/pull/8077. This also fixes a flake where the order in which sums are added can change the resulting sum. Use assertSumEqual to handle this similar to other places in the test. Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com> |
||
|
|
3157d0a7d9 |
fix(deps): update module golang.org/x/sys to v0.43.0 (#8156)
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/sys](https://pkg.go.dev/golang.org/x/sys) | [`v0.42.0` → `v0.43.0`](https://cs.opensource.google/go/x/sys/+/refs/tags/v0.42.0...refs/tags/v0.43.0) |  |  | --- > [!WARNING] > Some dependencies could not be looked up. Check the [Dependency Dashboard](../issues/5322) for more information. --- ### 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 is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates 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-go). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMDIuMTEiLCJ1cGRhdGVkSW5WZXIiOiI0My4xMDIuMTEiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbIlNraXAgQ2hhbmdlbG9nIiwiZGVwZW5kZW5jaWVzIl19--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> |
||
|
|
3b18b21580 |
unwrap error chains created with fmt.Errorf (#8133)
Fixes https://github.com/open-telemetry/opentelemetry-go/issues/7975 Per https://github.com/open-telemetry/opentelemetry-go/issues/7975#issuecomment-4183251694 Per https://github.com/open-telemetry/semantic-conventions/issues/3588 Credits: - Balaji01-4D for https://github.com/open-telemetry/opentelemetry-go/pull/8018 - seh for providing valuable feedback |
||
|
|
28df982c8b |
Add support for experimental options in the metrics API (#8111)
Part of https://github.com/open-telemetry/opentelemetry-go/issues/8110 Related to https://github.com/open-telemetry/opentelemetry-go/issues/5882. I'm hoping to find a better way to support experimental Options types in our API packages. This is one approach to consider. This contains no public API changes. It introduces a type: `ExperimentalOption` in `/metric/internal/x`, which can be used by our experimental options defined outside of the module. Options that embed this interface are ignored by `New*Config` builder functions in the metrics API to prevent them from panicing when used. Only SDKs that explicitly support the experimental option in question will respect it. Alternative SDKs will ignore the experimental options. We would still need to treat ExperimentalOption as a stable artifact, since the SDK will indirectly depend on it. See https://github.com/open-telemetry/opentelemetry-go/compare/main...dashpole:opentelemetry-go:attributes_advisory for how this would be used to support the advisory attributes parameter. |
||
|
|
9276201a64 |
Release v1.43.0 / v0.65.0 / v0.19.0 (#8128)
Release issue: https://github.com/open-telemetry/opentelemetry-go/issues/8127 ## Added - Add `IsRandom` and `WithRandom` on `TraceFlags`, and `IsRandom` on `SpanContext` in `go.opentelemetry.io/otel/trace` for [W3C Trace Context Level 2 Random Trace ID Flag](https://www.w3.org/TR/trace-context-2/#random-trace-id-flag) support. (#8012) - Add service detection with `WithService` in `go.opentelemetry.io/otel/sdk/resource`. (#7642) - Add `DefaultWithContext` and `EnvironmentWithContext` in `go.opentelemetry.io/otel/sdk/resource` to support plumbing `context.Context` through default and environment detectors. (#8051) - Support attributes with empty value (`attribute.EMPTY`) in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`. (#8038) - Support attributes with empty value (`attribute.EMPTY`) in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`. (#8038) - Support attributes with empty value (`attribute.EMPTY`) in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc`. (#8038) - Support attributes with empty value (`attribute.EMPTY`) in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#8038) - Support attributes with empty value (`attribute.EMPTY`) in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#8038) - Support attributes with empty value (`attribute.EMPTY`) in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`. (#8038) - Support attributes with empty value (`attribute.EMPTY`) in `go.opentelemetry.io/otel/sdk/metric/metricdata/metricdatatest`. (#8038) - Add support for per-series start time tracking for cumulative metrics in `go.opentelemetry.io/otel/sdk/metric`. Set `OTEL_GO_X_PER_SERIES_START_TIMESTAMPS=true` to enable. (#8060) - Add `WithCardinalityLimitSelector` for metric reader for configuring cardinality limits specific to the instrument kind. (#7855) ## Changed - Introduce the `EMPTY` Type in `go.opentelemetry.io/otel/attribute` to reflect that an empty value is now a valid value, with `INVALID` remaining as a deprecated alias of `EMPTY`. (#8038) - Refactor slice handling in `go.opentelemetry.io/otel/attribute` to optimize short slice values with fixed-size fast paths. (#8039) - Improve performance of span metric recording in `go.opentelemetry.io/otel/sdk/trace` by returning early if self-observability is not enabled. (#8067) - Improve formatting of metric data diffs in `go.opentelemetry.io/otel/sdk/metric/metricdata/metricdatatest`. (#8073) ## Deprecated - Deprecate `INVALID` in `go.opentelemetry.io/otel/attribute`. Use `EMPTY` instead. (#8038) ## Fixed - Return spec-compliant `TraceIdRatioBased` description. This is a breaking behavioral change, but it is necessary to make the implementation [spec-compliant](https://opentelemetry.io/docs/specs/otel/trace/sdk/#traceidratiobased). (#8027) - Fix a race condition in `go.opentelemetry.io/otel/sdk/metric` where the lastvalue aggregation could collect the value 0 even when no zero-value measurements were recorded. (#8056) - Limit HTTP response body to 4 MiB in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp` to mitigate excessive memory usage caused by a misconfigured or malicious server. Responses exceeding the limit are treated as non-retryable errors. (#8108) - Limit HTTP response body to 4 MiB in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` to mitigate excessive memory usage caused by a misconfigured or malicious server. Responses exceeding the limit are treated as non-retryable errors. (#8108) - Limit HTTP response body to 4 MiB in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp` to mitigate excessive memory usage caused by a misconfigured or malicious server. Responses exceeding the limit are treated as non-retryable errors. (#8108) - `WithHostID` detector in `go.opentelemetry.io/otel/sdk/resource` to use full path for `kenv` command on BSD. (#8113) - Fix missing `request.GetBody` in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp` to correctly handle HTTP2 GOAWAY frame. (#8096) --------- Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com> |
||
|
|
35214b6013 |
Use an absolute path when calling bsd kenv (#8113)
Co-authored-by: Robert Pająk <pellared@hotmail.com> |
||
|
|
ab27913693 |
metricdatatest: Improve printing of diffs (#8073)
I've been getting tired of trying to parse blobs of OTLP-like text when
debugging metrics SDK test failures. This PR updating the printing of
diffs between metrics.
### Changes
This combines the `compareDiff`, and `diffSlices` functions into a
single `diffSlices` function. The `compare` parameter now returns a
`[]string` instead of a bool, to allow us to get a list of specific
differences between elements. `diffSlices` now also accepts a
`formatContext` parameter that provides the context (e.g. which scope,
which metric, etc) to print before printing the difference itself.
I've chosen to use the scope name, metric name, and attributes as the
context for scope, metric, and datapoint respectively. We could print
out more (as those are not the only identifying fields), but that is
usually enough to point to the problem.
### Example
I "broke" one of the OpenCensus tests by changing the expected SpanID
from 2 -> 1. You can see the resulting error message before and after
below:
Before:
```
--- FAIL: TestConvertMetrics (0.00s)
--- FAIL: TestConvertMetrics/normal_Histogram,_summary,_gauges,_and_sums (0.00s)
metric_test.go:940: [ScopeMetrics Metrics not equal:
missing expected values:
metricdata.Metrics{Name:"foo.com/histogram-a", Description:"a testing histogram", Unit:"1",
Data:metricdata.Histogram[float64]{DataPoints:[]metricdata.HistogramDataPoint[float64]
{metricdata.HistogramDataPoint[float64]{Attributes:attribute.Set{hash:0x83dbf482c8017da3, data:
[2]attribute.KeyValue{attribute.KeyValue{Key:"a", Value:attribute.Value{vtype:4, numeric:0x0, stringly:"hello",
slice:interface {}(nil)}}, attribute.KeyValue{Key:"b", Value:attribute.Value{vtype:4, numeric:0x0, stringly:"world",
slice:interface {}(nil)}}}}, StartTime:time.Date(2026, time.March, 18, 15, 46, 53, 76753334, time.Local),
Time:time.Date(2026, time.March, 18, 15, 47, 53, 77753334, time.Local), Count:0x8, Bounds:[]float64{1, 2, 3},
BucketCounts:[]uint64{0x1, 0x2, 0x5}, Min:metricdata.Extrema[float64]{value:0, valid:false},
Max:metricdata.Extrema[float64]{value:0, valid:false}, Sum:100, Exemplars:[]metricdata.Exemplar[float64]
{metricdata.Exemplar[float64]{FilteredAttributes:[]attribute.KeyValue{attribute.KeyValue{Key:"bool",
Value:attribute.Value{vtype:1, numeric:0x1, stringly:"", slice:interface {}(nil)}}}, Time:time.Date(2026, time.March, 18, 15,
47, 43, 77753334, time.Local), Value:0.8, SpanID:[]uint8{0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, TraceID:[]uint8{0x1, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}, metricdata.Exemplar[float64]{FilteredAttributes:
[]attribute.KeyValue(nil), Time:time.Date(2026, time.March, 18, 15, 47, 43, 77753334, time.Local), Value:1.5, SpanID:
[]uint8{0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, TraceID:[]uint8{0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0}}, metricdata.Exemplar[float64]{FilteredAttributes:[]attribute.KeyValue(nil), Time:time.Date(2026,
time.March, 18, 15, 47, 43, 77753334, time.Local), Value:2.6, SpanID:[]uint8{0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
TraceID:[]uint8{0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}}},
metricdata.HistogramDataPoint[float64]{Attributes:attribute.Set{hash:0x83dbf482c8017da3, data:
[2]attribute.KeyValue{attribute.KeyValue{Key:"a", Value:attribute.Value{vtype:4, numeric:0x0, stringly:"hello",
slice:interface {}(nil)}}, attribute.KeyValue{Key:"b", Value:attribute.Value{vtype:4, numeric:0x0, stringly:"world",
slice:interface {}(nil)}}}}, StartTime:time.Date(2026, time.March, 18, 15, 46, 53, 76753334, time.Local),
Time:time.Date(2026, time.March, 18, 15, 47, 53, 76753334, time.Local), Count:0xa, Bounds:[]float64{1, 2, 3},
BucketCounts:[]uint64{0x1, 0x4, 0x5}, Min:metricdata.Extrema[float64]{value:0, valid:false},
Max:metricdata.Extrema[float64]{value:0, valid:false}, Sum:110, Exemplars:[]metricdata.Exemplar[float64]
{metricdata.Exemplar[float64]{FilteredAttributes:[]attribute.KeyValue(nil), Time:time.Date(2026, time.March, 18, 15, 47,
43, 77753334, time.Local), Value:0.9, SpanID:[]uint8{0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, TraceID:[]uint8{0x7, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}, metricdata.Exemplar[float64]{FilteredAttributes:
[]attribute.KeyValue(nil), Time:time.Date(2026, time.March, 18, 15, 47, 43, 77753334, time.Local), Value:1.1, SpanID:
[]uint8{0xa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, TraceID:[]uint8{0x9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0}}, metricdata.Exemplar[float64]{FilteredAttributes:[]attribute.KeyValue(nil), Time:time.Date(2026,
time.March, 18, 15, 47, 43, 77753334, time.Local), Value:2.7, SpanID:[]uint8{0xc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
TraceID:[]uint8{0xb, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}}}}, Temporality:0x1}}
unexpected additional values:
metricdata.Metrics{Name:"foo.com/histogram-a", Description:"a testing histogram", Unit:"1",
Data:metricdata.Histogram[float64]{DataPoints:[]metricdata.HistogramDataPoint[float64]
{metricdata.HistogramDataPoint[float64]{Attributes:attribute.Set{hash:0x83dbf482c8017da3, data:
[2]attribute.KeyValue{attribute.KeyValue{Key:"a", Value:attribute.Value{vtype:4, numeric:0x0, stringly:"hello",
slice:interface {}(nil)}}, attribute.KeyValue{Key:"b", Value:attribute.Value{vtype:4, numeric:0x0, stringly:"world",
slice:interface {}(nil)}}}}, StartTime:time.Date(2026, time.March, 18, 15, 46, 53, 76753334, time.Local),
Time:time.Date(2026, time.March, 18, 15, 47, 53, 77753334, time.Local), Count:0x8, Bounds:[]float64{1, 2, 3},
BucketCounts:[]uint64{0x1, 0x2, 0x5}, Min:metricdata.Extrema[float64]{value:0, valid:false},
Max:metricdata.Extrema[float64]{value:0, valid:false}, Sum:100, Exemplars:[]metricdata.Exemplar[float64]
{metricdata.Exemplar[float64]{FilteredAttributes:[]attribute.KeyValue{attribute.KeyValue{Key:"bool",
Value:attribute.Value{vtype:1, numeric:0x1, stringly:"", slice:interface {}(nil)}}}, Time:time.Date(2026, time.March, 18, 15,
47, 43, 77753334, time.Local), Value:0.8, SpanID:[]uint8{0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, TraceID:[]uint8{0x1, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}, metricdata.Exemplar[float64]{FilteredAttributes:
[]attribute.KeyValue(nil), Time:time.Date(2026, time.March, 18, 15, 47, 43, 77753334, time.Local), Value:1.5, SpanID:
[]uint8{0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, TraceID:[]uint8{0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0}}, metricdata.Exemplar[float64]{FilteredAttributes:[]attribute.KeyValue(nil), Time:time.Date(2026,
time.March, 18, 15, 47, 43, 77753334, time.Local), Value:2.6, SpanID:[]uint8{0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
TraceID:[]uint8{0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}}},
metricdata.HistogramDataPoint[float64]{Attributes:attribute.Set{hash:0x83dbf482c8017da3, data:
[2]attribute.KeyValue{attribute.KeyValue{Key:"a", Value:attribute.Value{vtype:4, numeric:0x0, stringly:"hello",
slice:interface {}(nil)}}, attribute.KeyValue{Key:"b", Value:attribute.Value{vtype:4, numeric:0x0, stringly:"world",
slice:interface {}(nil)}}}}, StartTime:time.Date(2026, time.March, 18, 15, 46, 53, 76753334, time.Local),
Time:time.Date(2026, time.March, 18, 15, 47, 53, 76753334, time.Local), Count:0xa, Bounds:[]float64{1, 2, 3},
BucketCounts:[]uint64{0x1, 0x4, 0x5}, Min:metricdata.Extrema[float64]{value:0, valid:false},
Max:metricdata.Extrema[float64]{value:0, valid:false}, Sum:110, Exemplars:[]metricdata.Exemplar[float64]
{metricdata.Exemplar[float64]{FilteredAttributes:[]attribute.KeyValue(nil), Time:time.Date(2026, time.March, 18, 15, 47,
43, 77753334, time.Local), Value:0.9, SpanID:[]uint8{0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, TraceID:[]uint8{0x7, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}, metricdata.Exemplar[float64]{FilteredAttributes:
[]attribute.KeyValue(nil), Time:time.Date(2026, time.March, 18, 15, 47, 43, 77753334, time.Local), Value:1.1, SpanID:
[]uint8{0xa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, TraceID:[]uint8{0x9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0}}, metricdata.Exemplar[float64]{FilteredAttributes:[]attribute.KeyValue(nil), Time:time.Date(2026,
time.March, 18, 15, 47, 43, 77753334, time.Local), Value:2.7, SpanID:[]uint8{0xc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
TraceID:[]uint8{0xb, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}}}}, Temporality:0x1}}
]
FAIL
FAIL go.opentelemetry.io/otel/bridge/opencensus/internal/ocmetric 0.037s
```
After:
```
--- FAIL: TestConvertMetrics (0.00s)
--- FAIL: TestConvertMetrics/normal_Histogram,_summary,_gauges,_and_sums (0.00s)
metric_test.go:940: [ScopeMetrics Metrics not equal:
Metric "foo.com/histogram-a":
Metrics Data not equal:
Histogram not equal:
Histogram DataPoints not equal:
HistogramDataPoint [a=hello,b=world]:
Exemplars not equal:
Exemplar:
SpanID not equal:
expected: [2 0 0 0 0 0 0 0]
actual: [1 0 0 0 0 0 0 0]
]
FAIL
FAIL go.opentelemetry.io/otel/bridge/opencensus/internal/ocmetric 0.036s
```
|
||
|
|
015ed1a7a4 |
sdk/metric: Support specifying cardinality limits per instrument kinds (#7855)
Previously, we only had `WithCardinalityLimit()`, which adds a global cardinality limit. This PR adds a new API on the reader `WithCardinalityLimitSelector` that can be used to specify limits per instrument kinds. [spec](https://github.com/open-telemetry/opentelemetry-specification/blob/49845849d2d8df07059f82033f39e96c561927cf/specification/metrics/sdk.md?plain=1#L1282) [schema](https://github.com/open-telemetry/opentelemetry-configuration/blob/3dbebe292912f0c0c96ce5dcfefc45dfe5e20f39/snippets/CardinalityLimits_kitchen_sink.yaml#L11-L18) closes #7786 --------- Co-authored-by: David Ashpole <dashpole@google.com> Co-authored-by: Damien Mathieu <42@dmathieu.com> |
||
|
|
911ed35fa0 |
Cleanup exemplar featuregate readme (#8072)
Exemplars are no longer behind a feature gate. |
||
|
|
528ebabbf0 |
sdk/trace/internal/observ: guard SpanStarted and spanLive with Enabled (#8067)
Guards SpanStarted and spanLive with Enabled(ctx) to avoid building metric options/attributes when instruments are disabled. ``` BenchmarkTracer (noop MeterProvider): SpanStarted: ~1.77 ns/op -> ~0.48 ns/op (~3.7x) SpanLive: ~2.05 ns/op -> ~0.52 ns/op (~3.9x) SpanEnded: ~2.05 ns/op -> ~0.52 ns/op (~3.9x) ``` No behavior change when enabled; existing tests cover enabled path. ~~No CHANGELOG entry, following #7848.~~ Issue: #7800 --------- Co-authored-by: Damien Mathieu <42@dmathieu.com> |
||
|
|
025b01be59 |
Add support for the development per-series starttime feature (#8060)
Add a feature to use per-series start times to match the spec: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#start-timestamps This is a prerequisite to [finishing / closing](https://github.com/open-telemetry/opentelemetry-specification/pull/4702). Previous prototype: https://github.com/open-telemetry/opentelemetry-go/pull/7719 --------- Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com> Co-authored-by: Robert Pająk <pellared@hotmail.com> |
||
|
|
5576bc22e7 |
Use atomics for exponential histogram buckets (#8057)
Follows https://github.com/open-telemetry/opentelemetry-go/pull/8025 This is the second PR towards a lockless fast-path for the exponential histogram aggregation. It replaces use of uint64 with atomic.Uint64. It does not make buckets concurrent-safe. That will come in future PRs. This is a refactor to make future PRs easier to review since it has a large diff, but is relatively simple. The record and measure calls are still guarded by a lock at this point. You can see the full set of planned changes in https://github.com/open-telemetry/opentelemetry-go/compare/main...dashpole:opentelemetry-go:lockless_exphist_ai. The implementation is largely based on https://github.com/open-telemetry/opentelemetry-go/pull/7535 (which I implemented by hand), but with help from an AI to break it down into smaller PRs, and simplify aspects of the design. Part of https://github.com/open-telemetry/opentelemetry-go/issues/7796 |
||
|
|
d5f403cab5 |
sdk/resource: add WithContext variants for Default and Environment (#7808) (#8051)
## Description Address issue #7808 by plumbing `context.Context` through `resource.Environment` and `resource.Default`. Currently, these functions hardcode `context.Background()`, which prevents detectors (especially those that might perform network lookups or OS calls) from respecting timeouts or cancellations provided by the caller. ## Changes - Adds `EnvironmentWithContext(ctx context.Context)` as a new public function. - Adds `DefaultWithContext(ctx context.Context)` as a new public function. - Maintains backward compatibility by making `Environment()` and `Default()` thin wrappers around the new WithContext variants. ## Testing - Added unit tests in `sdk/resource/resource_test.go` to verify the new functions. - Verified that all `sdk/resource` tests pass. - Verified that make `golangci-lint` passes repository-wide. Fixes #7808 --------- Co-authored-by: Damien Mathieu <42@dmathieu.com> |
||
|
|
206ac291d0 |
Fix race in the lastvalue aggregation where 0 could be observed (#8056)
This initializes the value of the gauge with the correct value before it is stored in the map. We end up storing the same thing twice on the first call, but that isn't a big deal performance-wise. Discovered during https://github.com/open-telemetry/opentelemetry-go/pull/8021 |
||
|
|
4c89d3345a |
exphist: replace min, max, sum, and count with atomics (#8025)
This is the first PR towards a lockless fast-path for the exponential histogram aggregation. It just replaces use of min, max, sum and counts with atomic types. You can see the full set of planned changes in https://github.com/open-telemetry/opentelemetry-go/compare/main...dashpole:opentelemetry-go:lockless_exphist_ai. The implementation is largely based on https://github.com/open-telemetry/opentelemetry-go/pull/7535 (which I implemented by hand), but with help from an AI to break it down into smaller PRs, and simplify aspects of the design. Part of https://github.com/open-telemetry/opentelemetry-go/issues/7796 |
||
|
|
82d57cc8b6 |
Add tests for exponential histogram concurrent-safety edge-cases (#8024)
Part of https://github.com/open-telemetry/opentelemetry-go/issues/7796 Improve test coverage of the concurrent-safety of exponential histogram aggregations. This adds two tests: * ZeroValues, which checks that the handling of zero values is correct in concurrent scenarios * RescalingStress, which generates inputs that intentionally cause lots of concurrent rescales. The RescalingStress test inputs the same values into a serial version and parallel version of the exponential histogram aggregation and verifies that the output buckets match afterwards. I used AI to identify where we were missing coverage, and to design and help implement the tests. I've reviewed and modified the tests as needed. |
||
|
|
65f85fc93a |
Improve aggregation concurrent safe tests (#8021)
I'm taking a stab at improving the ConcurrentSafe tests for aggregations before taking on the lockless exponential histogram implementation again. Part of https://github.com/open-telemetry/opentelemetry-go/issues/7796 This PR includes a few improvements: * All concurrent-safe tests now use 10 different attribute sets to make sure we are testing concurrent increments that result in an overflow (the cardinality limit of the test is 3). * All concurrent-safe tests for floats now include decimal valued-inputs. * Improved the validation of the collected metrics: * Validate the total after multiple collects. * Validate that increments are made to the correct bucket for histograms * Validate that the overflow attribute set has the correct total value. This uncovered an apparent race condition where the lastvalue aggregation can collect a value of zero even when no zero-value is recorded. I added a TODO, and will fix this in a follow-up. I used AI to help me design and implement tests, but requested each of the changes, and reviewed the output. --------- Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com> |
||
|
|
f0294a3921 |
Add benchmarks for end-to-end metrics SDK usage (#7768)
### Objective Part of https://github.com/open-telemetry/opentelemetry-go/issues/7743. I need a benchmark that can demonstrate the performance of using our API, SDK, and attributes packages together when following our performance guide. https://github.com/open-telemetry/opentelemetry-go/blob/main/CONTRIBUTING.md#attribute-and-option-allocation-management. I settled on benchmarking three scenarios: "Precomputed", "Dynamic", and "Naive". In the "Precomputed" scenario, it is assumed that the attribute set being measured against is known ahead of time, and that the instrumentation author can enumerate all possible sets, and precompute whatever they want, and keep references to it. In the "Dynamic" scenario, it is assumed that the attribute set being measured against is not known ahead of time, and that it is not feasible to enumerate all possible attribute sets ahead of time. However, this scenario still assumes bounded cardinality, as writing metrics with an unbounded cardinality is not the intended use of the API. I had originally written these benchmarks with varying overall cardinality, but the cardinality does not impact the test results, as long as it is reasonable and bounded (e.g. < 100,000). In the "Naive" scenario, it is assumed the user uses the API in the simplest, most ergonomic way. This is an attempt to measure the "default" experience of our API + SDK that users get when they use it. I also found that relative benchmark results did not change when different levels of parallelism are used, so all benchmark results are single-threaded. ### Results ``` goos: linux goarch: amd64 pkg: go.opentelemetry.io/otel/sdk/metric cpu: Intel(R) Xeon(R) CPU @ 2.20GHz │ out.txt │ │ sec/op │ EndToEndCounterAdd/NoFilter/Attributes/1/Precomputed/WithAttributeSet-24 59.47n ± 12% EndToEndCounterAdd/NoFilter/Attributes/1/Precomputed/WithAttributes-24 54.50n ± 3% EndToEndCounterAdd/NoFilter/Attributes/1/Dynamic/WithAttributeSet-24 164.3n ± 16% EndToEndCounterAdd/NoFilter/Attributes/1/Dynamic/WithAttributes-24 219.5n ± 4% EndToEndCounterAdd/NoFilter/Attributes/1/Naive/WithAttributes-24 268.9n ± 7% EndToEndCounterAdd/NoFilter/Attributes/5/Precomputed/WithAttributeSet-24 51.78n ± 6% EndToEndCounterAdd/NoFilter/Attributes/5/Precomputed/WithAttributes-24 52.95n ± 8% EndToEndCounterAdd/NoFilter/Attributes/5/Dynamic/WithAttributeSet-24 434.9n ± 3% EndToEndCounterAdd/NoFilter/Attributes/5/Dynamic/WithAttributes-24 646.0n ± 3% EndToEndCounterAdd/NoFilter/Attributes/5/Naive/WithAttributes-24 802.3n ± 4% EndToEndCounterAdd/NoFilter/Attributes/10/Precomputed/WithAttributeSet-24 52.00n ± 5% EndToEndCounterAdd/NoFilter/Attributes/10/Precomputed/WithAttributes-24 51.88n ± 8% EndToEndCounterAdd/NoFilter/Attributes/10/Dynamic/WithAttributeSet-24 815.9n ± 3% EndToEndCounterAdd/NoFilter/Attributes/10/Dynamic/WithAttributes-24 1.202µ ± 3% EndToEndCounterAdd/NoFilter/Attributes/10/Naive/WithAttributes-24 1.527µ ± 7% EndToEndCounterAdd/Filtered/Attributes/1/Precomputed/WithAttributeSet-24 136.6n ± 5% EndToEndCounterAdd/Filtered/Attributes/1/Precomputed/WithAttributes-24 138.4n ± 3% EndToEndCounterAdd/Filtered/Attributes/1/Dynamic/WithAttributeSet-24 251.6n ± 5% EndToEndCounterAdd/Filtered/Attributes/1/Dynamic/WithAttributes-24 314.7n ± 7% EndToEndCounterAdd/Filtered/Attributes/1/Naive/WithAttributes-24 357.9n ± 6% EndToEndCounterAdd/Filtered/Attributes/5/Precomputed/WithAttributeSet-24 499.7n ± 4% EndToEndCounterAdd/Filtered/Attributes/5/Precomputed/WithAttributes-24 510.5n ± 5% EndToEndCounterAdd/Filtered/Attributes/5/Dynamic/WithAttributeSet-24 987.1n ± 6% EndToEndCounterAdd/Filtered/Attributes/5/Dynamic/WithAttributes-24 1.169µ ± 9% EndToEndCounterAdd/Filtered/Attributes/5/Naive/WithAttributes-24 1.297µ ± 5% EndToEndCounterAdd/Filtered/Attributes/10/Precomputed/WithAttributeSet-24 1.044µ ± 7% EndToEndCounterAdd/Filtered/Attributes/10/Precomputed/WithAttributes-24 992.6n ± 7% EndToEndCounterAdd/Filtered/Attributes/10/Dynamic/WithAttributeSet-24 1.838µ ± 6% EndToEndCounterAdd/Filtered/Attributes/10/Dynamic/WithAttributes-24 2.258µ ± 4% EndToEndCounterAdd/Filtered/Attributes/10/Naive/WithAttributes-24 2.553µ ± 6% geomean 375.7n │ out.txt │ │ B/op │ EndToEndCounterAdd/NoFilter/Attributes/1/Precomputed/WithAttributeSet-24 0.000 ± 0% EndToEndCounterAdd/NoFilter/Attributes/1/Precomputed/WithAttributes-24 0.000 ± 0% EndToEndCounterAdd/NoFilter/Attributes/1/Dynamic/WithAttributeSet-24 88.00 ± 0% EndToEndCounterAdd/NoFilter/Attributes/1/Dynamic/WithAttributes-24 152.0 ± 0% EndToEndCounterAdd/NoFilter/Attributes/1/Naive/WithAttributes-24 232.0 ± 0% EndToEndCounterAdd/NoFilter/Attributes/5/Precomputed/WithAttributeSet-24 0.000 ± 0% EndToEndCounterAdd/NoFilter/Attributes/5/Precomputed/WithAttributes-24 0.000 ± 0% EndToEndCounterAdd/NoFilter/Attributes/5/Dynamic/WithAttributeSet-24 345.0 ± 0% EndToEndCounterAdd/NoFilter/Attributes/5/Dynamic/WithAttributes-24 665.0 ± 0% EndToEndCounterAdd/NoFilter/Attributes/5/Naive/WithAttributes-24 1000.0 ± 0% EndToEndCounterAdd/NoFilter/Attributes/10/Precomputed/WithAttributeSet-24 0.000 ± 0% EndToEndCounterAdd/NoFilter/Attributes/10/Precomputed/WithAttributes-24 0.000 ± 0% EndToEndCounterAdd/NoFilter/Attributes/10/Dynamic/WithAttributeSet-24 730.0 ± 0% EndToEndCounterAdd/NoFilter/Attributes/10/Dynamic/WithAttributes-24 1.401Ki ± 0% EndToEndCounterAdd/NoFilter/Attributes/10/Naive/WithAttributes-24 2.102Ki ± 0% EndToEndCounterAdd/Filtered/Attributes/1/Precomputed/WithAttributeSet-24 64.00 ± 0% EndToEndCounterAdd/Filtered/Attributes/1/Precomputed/WithAttributes-24 64.00 ± 0% EndToEndCounterAdd/Filtered/Attributes/1/Dynamic/WithAttributeSet-24 152.0 ± 0% EndToEndCounterAdd/Filtered/Attributes/1/Dynamic/WithAttributes-24 216.0 ± 0% EndToEndCounterAdd/Filtered/Attributes/1/Naive/WithAttributes-24 296.0 ± 0% EndToEndCounterAdd/Filtered/Attributes/5/Precomputed/WithAttributeSet-24 576.0 ± 0% EndToEndCounterAdd/Filtered/Attributes/5/Precomputed/WithAttributes-24 576.0 ± 0% EndToEndCounterAdd/Filtered/Attributes/5/Dynamic/WithAttributeSet-24 922.0 ± 0% EndToEndCounterAdd/Filtered/Attributes/5/Dynamic/WithAttributes-24 1.213Ki ± 0% EndToEndCounterAdd/Filtered/Attributes/5/Naive/WithAttributes-24 1.539Ki ± 0% EndToEndCounterAdd/Filtered/Attributes/10/Precomputed/WithAttributeSet-24 1.312Ki ± 0% EndToEndCounterAdd/Filtered/Attributes/10/Precomputed/WithAttributes-24 1.312Ki ± 0% EndToEndCounterAdd/Filtered/Attributes/10/Dynamic/WithAttributeSet-24 2.027Ki ± 0% EndToEndCounterAdd/Filtered/Attributes/10/Dynamic/WithAttributes-24 2.716Ki ± 0% EndToEndCounterAdd/Filtered/Attributes/10/Naive/WithAttributes-24 3.414Ki ± 0% geomean ¹ ¹ summaries must be >0 to compute geomean │ out.txt │ │ allocs/op │ EndToEndCounterAdd/NoFilter/Attributes/1/Precomputed/WithAttributeSet-24 0.000 ± 0% EndToEndCounterAdd/NoFilter/Attributes/1/Precomputed/WithAttributes-24 0.000 ± 0% EndToEndCounterAdd/NoFilter/Attributes/1/Dynamic/WithAttributeSet-24 2.000 ± 0% EndToEndCounterAdd/NoFilter/Attributes/1/Dynamic/WithAttributes-24 3.000 ± 0% EndToEndCounterAdd/NoFilter/Attributes/1/Naive/WithAttributes-24 5.000 ± 0% EndToEndCounterAdd/NoFilter/Attributes/5/Precomputed/WithAttributeSet-24 0.000 ± 0% EndToEndCounterAdd/NoFilter/Attributes/5/Precomputed/WithAttributes-24 0.000 ± 0% EndToEndCounterAdd/NoFilter/Attributes/5/Dynamic/WithAttributeSet-24 2.000 ± 0% EndToEndCounterAdd/NoFilter/Attributes/5/Dynamic/WithAttributes-24 3.000 ± 0% EndToEndCounterAdd/NoFilter/Attributes/5/Naive/WithAttributes-24 5.000 ± 0% EndToEndCounterAdd/NoFilter/Attributes/10/Precomputed/WithAttributeSet-24 0.000 ± 0% EndToEndCounterAdd/NoFilter/Attributes/10/Precomputed/WithAttributes-24 0.000 ± 0% EndToEndCounterAdd/NoFilter/Attributes/10/Dynamic/WithAttributeSet-24 2.000 ± 0% EndToEndCounterAdd/NoFilter/Attributes/10/Dynamic/WithAttributes-24 3.000 ± 0% EndToEndCounterAdd/NoFilter/Attributes/10/Naive/WithAttributes-24 5.000 ± 0% EndToEndCounterAdd/Filtered/Attributes/1/Precomputed/WithAttributeSet-24 1.000 ± 0% EndToEndCounterAdd/Filtered/Attributes/1/Precomputed/WithAttributes-24 1.000 ± 0% EndToEndCounterAdd/Filtered/Attributes/1/Dynamic/WithAttributeSet-24 3.000 ± 0% EndToEndCounterAdd/Filtered/Attributes/1/Dynamic/WithAttributes-24 4.000 ± 0% EndToEndCounterAdd/Filtered/Attributes/1/Naive/WithAttributes-24 6.000 ± 0% EndToEndCounterAdd/Filtered/Attributes/5/Precomputed/WithAttributeSet-24 2.000 ± 0% EndToEndCounterAdd/Filtered/Attributes/5/Precomputed/WithAttributes-24 2.000 ± 0% EndToEndCounterAdd/Filtered/Attributes/5/Dynamic/WithAttributeSet-24 4.000 ± 0% EndToEndCounterAdd/Filtered/Attributes/5/Dynamic/WithAttributes-24 5.000 ± 0% EndToEndCounterAdd/Filtered/Attributes/5/Naive/WithAttributes-24 7.000 ± 0% EndToEndCounterAdd/Filtered/Attributes/10/Precomputed/WithAttributeSet-24 2.000 ± 0% EndToEndCounterAdd/Filtered/Attributes/10/Precomputed/WithAttributes-24 2.000 ± 0% EndToEndCounterAdd/Filtered/Attributes/10/Dynamic/WithAttributeSet-24 4.000 ± 0% EndToEndCounterAdd/Filtered/Attributes/10/Dynamic/WithAttributes-24 5.000 ± 0% EndToEndCounterAdd/Filtered/Attributes/10/Naive/WithAttributes-24 7.000 ± 0% geomean ¹ ¹ summaries must be >0 to compute geomean ``` ### Observations * When the attributes are known ahead of time (Precomputed), WithAttributes and WithAttributeSet have equal performance. * When attributes are not known ahead of time (Dynamic), WithAttributes is worse than WithAttributeSet (mostly 1 extra allocation). * When an attribute filter is applied, the performance of the SDK degrades significantly. In the Precomputed case with 10 attributes, the performance goes from 50ns to 1000ns, and from 0 allocations to 2 allocations. |
||
|
|
6d79ac3936 |
fix(deps): update golang.org/x (#8045)
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | Type | Update | |---|---|---|---|---|---| | [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) |  |  | indirect | minor | | [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) |  |  | indirect | minor | | [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) |  |  | indirect | minor | | [golang.org/x/telemetry](https://pkg.go.dev/golang.org/x/telemetry) | `e526e8a` → `579e4da` |  |  | indirect | digest | | [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) |  |  | indirect | minor | | [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) |  |  | require | minor | --- > [!WARNING] > Some dependencies could not be looked up. Check the [Dependency Dashboard](../issues/5322) for more information. --- ### 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 is behind base branch, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.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-go). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My41OS4wIiwidXBkYXRlZEluVmVyIjoiNDMuNTkuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiU2tpcCBDaGFuZ2Vsb2ciLCJkZXBlbmRlbmNpZXMiXX0=--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: dmathieu <damien.mathieu@elastic.co> |
||
|
|
88f8c10823 |
linting: add depguard rule to enforce semconv version (#8041)
### Description This PR adds a `depguard` linter rule to [.golangci.yml](file:///Users/ijasahammed/Documents/open_source/opentelemetry-go/.golangci.yml) to enforce the use of the latest semantic convention version (`v1.40.0`). This rule ensures that: - Any new code importing `otel/semconv` must use `v1.40.0`. - The `semconv/` directory itself is excluded from this check to avoid linting legacy definitions. - The `zipkin exporter` is excluded from this check - Updated `semconv` version to v1.40.0 in the `sdk/log/logger_bench_test.go` test. ### Verification Results I verified this change locally using the following steps: 1. **Full Linter Run**: Ran `make precommit` (which executes `golangci-lint run`). It passed with **0 issues** across the entire repository. 2. **Smoke Test**: Added a temporary import of `go.opentelemetry.io/otel/semconv/v1.20.0` in trace.go. The linter correctly reported the violation: > `trace.go:7:2: import 'go.opentelemetry.io/otel/semconv/v1.20.0' is not allowed from list 'semconv': Use go.opentelemetry.io/otel/semconv/v1.40.0 instead. (depguard)` This change is not performance-critical and does not affect the library's runtime behavior. ### Checklist - [x] Signed CLA - [x] `make precommit` passes. - [x] CHANGELOG.md updated. (Not required) Fixes #7842 --------- Co-authored-by: Robert Pająk <pellared@hotmail.com> Co-authored-by: Damien Mathieu <42@dmathieu.com> |
||
|
|
ddd2b0e398 |
fix(sdk/trace): return spec-compliant TraceIdRatioBased description (#8027)
Optimize performance when sampling is disabled - no need to calculate fraction based on trace id (in `traceIDRatioSampler`) if fraction is zero. --------- Co-authored-by: David Ashpole <dashpole@google.com> Co-authored-by: Damien Mathieu <42@dmathieu.com> |
||
|
|
f4da59e651 |
attribute: change INVALID Type to EMPTY and mark INVALID as deprecated (#8038)
Fixes https://github.com/open-telemetry/opentelemetry-go/issues/7932 Noticeable comment from previous PR: https://github.com/open-telemetry/opentelemetry-go/pull/7942#discussion_r2913179215 Print the empty value as empty string per https://opentelemetry.io/docs/specs/otel/common/#empty-values |
||
|
|
aff375ac62 |
chore(sdk/trace): join errors properly (#8030)
Co-authored-by: Robert Pająk <pellared@hotmail.com> |
||
|
|
fabe66658f |
resource: add WithService detector option (#7642)
I was looking at implementing resource detection in otelconf and was finding that all the detectors were implemented in a similar way except for the service detector. Added the resource options in this PR for feedback. Will add tests if the go approvers/maintainers support this approach. --------- Signed-off-by: alex boten <223565+codeboten@users.noreply.github.com> Co-authored-by: Damien Mathieu <42@dmathieu.com> |
||
|
|
1f39f186db |
fix(deps): update golang.org/x (#8023)
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/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) |  |  | | [golang.org/x/sys](https://pkg.go.dev/golang.org/x/sys) | [`v0.41.0` → `v0.42.0`](https://cs.opensource.google/go/x/sys/+/refs/tags/v0.41.0...refs/tags/v0.42.0) |  |  | --- > [!WARNING] > Some dependencies could not be looked up. Check the [Dependency Dashboard](../issues/5322) for more information. --- ### 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 is behind base branch, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.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-go). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My41OS4wIiwidXBkYXRlZEluVmVyIjoiNDMuNTkuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiU2tpcCBDaGFuZ2Vsb2ciLCJkZXBlbmRlbmNpZXMiXX0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> |
||
|
|
8b05173581 |
fix(deps): update module github.com/golangci/golangci-lint/v2 to v2.11.1 (#8011)
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [github.com/golangci/golangci-lint/v2](https://redirect.github.com/golangci/golangci-lint) | `v2.8.0` → `v2.11.1` |  |  | --- > [!WARNING] > Some dependencies could not be looked up. Check the [Dependency Dashboard](../issues/5322) for more information. --- ### Release Notes <details> <summary>golangci/golangci-lint (github.com/golangci/golangci-lint/v2)</summary> ### [`v2.11.1`](https://redirect.github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v2111) [Compare Source](https://redirect.github.com/golangci/golangci-lint/compare/v2.11.0...v2.11.1) *Released on 2026-03-06* Due to an error related to AUR, some artifacts of the v2.11.0 release have not been published. This release contains the same things as v2.11.0. ### [`v2.11.0`](https://redirect.github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v2110) [Compare Source](https://redirect.github.com/golangci/golangci-lint/compare/v2.10.1...v2.11.0) *Released on 2026-03-06* 1. Linters new features or changes - `errcheck`: from 1.9.0 to 1.10.0 (exclude `crypto/rand.Read` by default) - `gosec`: from 2.23.0 to 2.24.6 (new rules: `G113`, `G118`, `G119`, `G120`, `G121`, `G122`, `G123`, `G408`, `G707`) - `noctx`: from 0.4.0 to 0.5.0 (new detection: `httptest.NewRequestWithContext`) - `prealloc`: from 1.0.2 to 1.1.0 - `revive`: from 1.14.0 to 1.15.0 (⚠️ Breaking change: package-related checks moved from `var-naming` to a new rule `package-naming`) 2. Linters bug fixes - `gocognit`: from 1.2.0 to 1.2.1 - `gosec`: from 2.24.6 to 2.24.7 - `unqueryvet`: from 1.5.3 to 1.5.4 ### [`v2.10.1`](https://redirect.github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v2101) [Compare Source](https://redirect.github.com/golangci/golangci-lint/compare/v2.10.0...v2.10.1) *Released on 2026-02-17* 1. Fixes - buildssa panic ### [`v2.10.0`](https://redirect.github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v2100) [Compare Source](https://redirect.github.com/golangci/golangci-lint/compare/v2.9.0...v2.10.0) *Released on 2026-02-17* 1. Linters new features or changes - `ginkgolinter`: from 0.22.0 to 0.23.0 - `gosec`: from 2.22.11 to 2.23.0 (new rules: `G117`, `G602`, `G701`, `G702`, `G703`, `G704`, `G705`, `G706`) - `staticcheck`: from 0.6.1 to 0.7.0 2. Linters bug fixes - `godoclint`: from 0.11.1 to 0.11.2 ### [`v2.9.0`](https://redirect.github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v290) [Compare Source](https://redirect.github.com/golangci/golangci-lint/compare/v2.8.0...v2.9.0) *Released on 2026-02-10* 1. Enhancements - 🎉 go1.26 support 2. Linters new features or changes - `arangolint`: from 0.3.1 to 0.4.0 (new rule: detect potential query injections) - `ginkgolinter`: from 0.21.2 to 0.22.0 (support for wrappers) - `golines`: from 0.14.0 to 0.15.0 - `misspell`: from 0.7.0 to 0.8.0 - `unqueryvet`: from 1.4.0 to 1.5.3 (new options: `check-n1`, `check-sql-injection`, `check-tx-leaks`, `allow`, `custom-rules`) - `wsl`: from 5.3.0 to 5.6.0 (new rule: `after-block`) 3. Linters bug fixes - `modernize`: from 0.41.0 to 0.42.0 - `prealloc`: from 1.0.1 to 1.0.2 - `protogetter`: from 0.3.18 to 0.3.20 4. Misc. - Log information about files when configuration verification - Emit an error when no linters enabled - Do not collect VCS information when loading code </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 is behind base branch, 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-go). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My41Ni4wIiwidXBkYXRlZEluVmVyIjoiNDMuNTkuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiU2tpcCBDaGFuZ2Vsb2ciLCJkZXBlbmRlbmNpZXMiXX0=--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Tyler Yahn <codingalias@gmail.com> |
||
|
|
a3941ff595 |
Release v1.42.0/v0.64.0/v0.18.0/v0.0.16 (#8006)
### Added - Add `go.opentelemetry.io/otel/semconv/v1.40.0` package. The package contains semantic conventions from the `v1.40.0` version of the OpenTelemetry Semantic Conventions. See the [migration documentation](./semconv/v1.40.0/MIGRATION.md) for information on how to upgrade from `go.opentelemetry.io/otel/semconv/v1.39.0`. (#7985) - Add `Err` and `SetErr` on `Record` in `go.opentelemetry.io/otel/log` to attach an error and set record exception attributes in `go.opentelemetry.io/otel/log/sdk`. (#7924) ### Changed - `TracerProvider.ForceFlush` in `go.opentelemetry.io/otel/sdk/trace` joins errors together and continues iteration through SpanProcessors as opposed to returning the first encountered error without attempting exports on subsequent SpanProcessors. (#7856) ### Fixed - Fix missing `request.GetBody` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` to correctly handle HTTP2 GOAWAY frame. (#7931) - Fix semconv v1.39.0 generated metric helpers skipping required attributes when extra attributes were empty. (#7964) - Preserve W3C TraceFlags bitmask (including the random Trace ID flag) during trace context extraction and injection in `go.opentelemetry.io/otel/propagation`. (#7834) ### Removed - Drop support for [Go 1.24]. (#7984) |
||
|
|
c9d20155fc |
log: add error field to Record and make SDK to emit exception attributes (#7924)
Fixes #7923 ```sh $ go test -run=^$ -bench=BenchmarkLoggerEmitExceptionAttributes -benchmem -count=5 -benchtime=500ms -cpu=1 goos: darwin goarch: arm64 pkg: go.opentelemetry.io/otel/sdk/log cpu: Apple M4 Pro BenchmarkLoggerSetErrAndEmit 628162 1023 ns/op 5371 B/op 1 allocs/op BenchmarkLoggerSetErrAndEmit 663955 863.3 ns/op 5105 B/op 1 allocs/op BenchmarkLoggerSetErrAndEmit 653888 1067 ns/op 5177 B/op 1 allocs/op BenchmarkLoggerSetErrAndEmit 716438 824.8 ns/op 4764 B/op 1 allocs/op BenchmarkLoggerSetErrAndEmit 746902 999.2 ns/op 5630 B/op 1 allocs/op BenchmarkLoggerSetExceptionAttributesAndEmit 650696 1042 ns/op 5200 B/op 1 allocs/op BenchmarkLoggerSetExceptionAttributesAndEmit 574962 980.7 ns/op 4743 B/op 1 allocs/op BenchmarkLoggerSetExceptionAttributesAndEmit 536736 989.2 ns/op 5049 B/op 1 allocs/op BenchmarkLoggerSetExceptionAttributesAndEmit 558511 1190 ns/op 4870 B/op 1 allocs/op BenchmarkLoggerSetExceptionAttributesAndEmit 669452 978.8 ns/op 5067 B/op 1 allocs/op PASS ok go.opentelemetry.io/otel/sdk/log 6.994s ``` TODO after merged: - https://github.com/open-telemetry/opentelemetry-go/pull/7924#discussion_r2832906451 --------- Signed-off-by: Israel Blancas <iblancasa@gmail.com> Co-authored-by: Robert Pająk <pellared@hotmail.com> Co-authored-by: Damien Mathieu <42@dmathieu.com> |
||
|
|
fdd1320c39 |
TracerProvider ForceFlush() Error Fix (#7856)
Previously upon a SpanProcessor's ForceFlush returning an error, it would return that error and not attempt to flush subsequent SpanProcessors. Now when an error is encountered, it will Join the new error with the existing errors and continue iterating through the SpanProcessors and return the consolidated error at the end of iteration. This is in line with the workflow found in LoggerProvider's ForceFlush. --------- Co-authored-by: Robert Pająk <pellared@hotmail.com> |
||
|
|
60161f97c4 |
refactor: replace uint64 and int32 with atomic types in tests (#7941)
Because [atomic types](https://go.dev/doc/go1.19#atomic_types) are easier to use. |
||
|
|
5b5c2c5d6d | Upgrade to semconv/v1.40.0 (#7991) |