Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

otlp: Clients to close body uniformly #5954

Merged

Conversation

mark-pictor-csec
Copy link
Contributor

There were inconsistencies in closing the response body. For traces, the Close happened in a defer statement and any error was logged. Logs and metrics were less rigorous. It appeared Close() wasn't always called, and when it was, errors were returned sometimes and ignored at other times.

This applies the defer logic from traces to the other two and removes other Close() calls.

This was part of PR #5929, and has been split out as requested.

There were inconsistencies in closing the response body. For traces, the
Close happened in a defer statement and any error was logged. Logs and
metrics were less rigorous. It appeared Close() wasn't always called,
and when it was, errors were returned sometimes and ignored at other
times.

This applies the defer logic from traces to the other two and removes
other Close() calls.
Copy link

codecov bot commented Nov 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.6%. Comparing base (ac5caea) to head (bb09ba1).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #5954   +/-   ##
=====================================
  Coverage   84.6%   84.6%           
=====================================
  Files        272     272           
  Lines      22896   22897    +1     
=====================================
+ Hits       19389   19390    +1     
  Misses      3163    3163           
  Partials     344     344           

see 4 files with indirect coverage changes

@dmathieu
Copy link
Member

dmathieu commented Nov 8, 2024

Could you add a changelog entry? (the check wasn't failing, but it appears that's because your branch was a bit far behind main).

@mark-pictor-csec
Copy link
Contributor Author

Could you add a changelog entry? (the check wasn't failing, but it appears that's because your branch was a bit far behind main).

I added it under Fixed - I assume that's where it belongs.

CHANGELOG.md Show resolved Hide resolved
@pellared pellared changed the title log, metric, trace clients: close body uniformly otlp: clients to close body uniformly Nov 12, 2024
@pellared pellared changed the title otlp: clients to close body uniformly otlp: Clients to close body uniformly Nov 12, 2024
@pellared pellared merged commit 0bf9572 into open-telemetry:main Nov 12, 2024
32 checks passed
@pellared
Copy link
Member

@mark-pictor-csec, thanks for your contribution ❤️

@mark-pictor-csec
Copy link
Contributor Author

And thank you all for the massive amount of effort you put in!

@pellared pellared added this to the v1.33.0 milestone Nov 25, 2024
@MrAlias MrAlias mentioned this pull request Dec 12, 2024
MrAlias added a commit that referenced this pull request Dec 12, 2024
### Added

- Add `Reset` method to `SpanRecorder` in
`go.opentelemetry.io/otel/sdk/trace/tracetest`. (#5994)
- Add `EnabledInstrument` interface in
`go.opentelemetry.io/otel/sdk/metric/internal/x`. This is an
experimental interface that is implemented by synchronous instruments
provided by `go.opentelemetry.io/otel/sdk/metric`. Users can use it to
avoid performing computationally expensive operations when recording
measurements. It does not fall within the scope of the OpenTelemetry Go
versioning and stability [policy](./VERSIONING.md) and it may be changed
in backwards incompatible ways or removed in feature releases. (#6016)

### Changed

- The default global API now supports full auto-instrumentation from the
`go.opentelemetry.io/auto` package. See that package for more
information. (#5920)
- Propagate non-retryable error messages to client in
`go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`. (#5929)
- Propagate non-retryable error messages to client in
`go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`.
(#5929)
- Propagate non-retryable error messages to client in
`go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`.
(#5929)
- Performance improvements for attribute value `AsStringSlice`,
`AsFloat64Slice`, `AsInt64Slice`, `AsBoolSlice`. (#6011)
- Change `EnabledParameters` to have a `Severity` field instead of a
getter and setter in `go.opentelemetry.io/otel/log`. (#6009)

### Fixed

- Fix inconsistent request body closing in
`go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`. (#5954)
- Fix inconsistent request body closing in
`go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`.
(#5954)
- Fix inconsistent request body closing in
`go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`.
(#5954)
- Fix invalid exemplar keys in
`go.opentelemetry.io/otel/exporters/prometheus`. (#5995)
- Fix attribute value truncation in
`go.opentelemetry.io/otel/sdk/trace`. (#5997)
- Fix attribute value truncation in `go.opentelemetry.io/otel/sdk/log`.
(#6032)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants