Skip to content

support stdlib request.GetBody on metrics - #7931

Merged
dmathieu merged 7 commits into
open-telemetry:mainfrom
marifari-hue:fix-request.GetBody-for-metrics
Mar 3, 2026
Merged

support stdlib request.GetBody on metrics#7931
dmathieu merged 7 commits into
open-telemetry:mainfrom
marifari-hue:fix-request.GetBody-for-metrics

Conversation

@marifari-hue

@marifari-hue marifari-hue commented Feb 20, 2026

Copy link
Copy Markdown
Contributor

Based on #7794

This solves the exact same problem but on metrics.

traces export: Post "https://***/v1/metrics": http2: Transport: cannot retry err [http2: Transport received Server's graceful shutdown GOAWAY] after Request.Body was written; define Request.GetBody to avoid this error

@linux-foundation-easycla

linux-foundation-easycla Bot commented Feb 20, 2026

Copy link
Copy Markdown

CLA Signed

The committers listed above are authorized under a signed CLA.

@marifari-hue marifari-hue changed the title [WIP] support stdlib request.GetBody on metrics Feb 20, 2026
@marifari-hue
marifari-hue marked this pull request as ready for review February 20, 2026 09:10
@codecov

codecov Bot commented Feb 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.7%. Comparing base (5dee2eb) to head (76d7033).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #7931   +/-   ##
=====================================
  Coverage   81.7%   81.7%           
=====================================
  Files        304     304           
  Lines      23337   23342    +5     
=====================================
+ Hits       19081   19091   +10     
+ Misses      3867    3863    -4     
+ Partials     389     388    -1     
Files with missing lines Coverage Δ
exporters/otlp/otlpmetric/otlpmetrichttp/client.go 81.6% <100.0%> (+0.5%) ⬆️

... and 4 files with indirect coverage changes

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

Copy link
Copy Markdown
Contributor Author

Anything else I need to do to get this through :)?

Comment thread CHANGELOG.md
Comment thread CHANGELOG.md Outdated
Comment thread CHANGELOG.md
@dmathieu
dmathieu merged commit a866564 into open-telemetry:main Mar 3, 2026
33 checks passed
pellared added a commit that referenced this pull request Mar 6, 2026
### 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)
@pellared pellared added this to the v1.42.0 milestone Mar 12, 2026
Tpuljak added a commit to Tpuljak/opentelemetry-go that referenced this pull request Mar 26, 2026
Based on open-telemetry#7931

Signed-off-by: Toma Puljak <toma.puljak@hotmail.com>
dmathieu added a commit that referenced this pull request Apr 1, 2026
Based on #7931

Adding another `getBody` PR to the chain 😄.

This one is harder to catch if it's a problem since logs aren't being
sent in case of error.

---------

Signed-off-by: Toma Puljak <toma.puljak@hotmail.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Damien Mathieu <42@dmathieu.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants