Skip to content

Stop percent-encoding the header environment variables in otlplog exporters #6392

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

Merged
merged 18 commits into from
Mar 12, 2025

Conversation

tongoss
Copy link
Contributor

@tongoss tongoss commented Mar 2, 2025

Bugfixes for #5623

Based on the conversation #5623 (comment), only OTLP log exporters need bugfixes.

Copy link

linux-foundation-easycla bot commented Mar 2, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@tongoss tongoss force-pushed the bugfix/otlp-exporter-logs-env branch from e1bfe9a to dd3776a Compare March 2, 2025 07:08
@dmathieu dmathieu changed the title Bugfix/otlp exporter logs env Stop percent-encoding the header environment variables in otlplog exporters Mar 3, 2025
Copy link
Member

@dmathieu dmathieu left a comment

Choose a reason for hiding this comment

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

This needs to be tested.
I'd recommend looking at https://github.com/open-telemetry/opentelemetry-go/pull/5705/files for inspiration on how to write those tests.

Copy link

codecov bot commented Mar 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.8%. Comparing base (fb89a38) to head (bfbb5aa).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #6392     +/-   ##
=======================================
- Coverage   81.8%   81.8%   -0.1%     
=======================================
  Files        283     283             
  Lines      24899   24927     +28     
=======================================
+ Hits       20379   20400     +21     
- Misses      4117    4122      +5     
- Partials     403     405      +2     

see 3 files with indirect coverage changes

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

@tongoss
Copy link
Contributor Author

tongoss commented Mar 3, 2025

This needs to be tested. I'd recommend looking at https://github.com/open-telemetry/opentelemetry-go/pull/5705/files for inspiration on how to write those tests.

@dmathieu , the required test cases have been added.

@tongoss tongoss requested a review from dmathieu March 4, 2025 00:26
@tongoss tongoss closed this Mar 4, 2025
@pellared
Copy link
Member

pellared commented Mar 4, 2025

@tongoss, why have your closed the PR?

@tongoss tongoss reopened this Mar 4, 2025
@tongoss
Copy link
Contributor Author

tongoss commented Mar 4, 2025

@tongoss, why have your closed the PR?

@pellared , Thanks so much for reminding me. I happened to click the wrong button...

Copy link
Member

@dmathieu dmathieu left a comment

Choose a reason for hiding this comment

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

When errors are returned (and therefore handled), we shouldn't be logging them.

@tongoss tongoss requested a review from dmathieu March 4, 2025 17:53
@tongoss tongoss force-pushed the bugfix/otlp-exporter-logs-env branch from 3d55867 to 2904171 Compare March 6, 2025 03:57
tongoss and others added 9 commits March 6, 2025 08:06
2. Fix the code in order to parse valid header keys only
3. Add global error messages
Apply the suggested changes

Co-authored-by: Damien Mathieu <[email protected]>
Apply the suggested changes

Co-authored-by: Damien Mathieu <[email protected]>
Apply the suggested changes

Co-authored-by: Damien Mathieu <[email protected]>
Apply the suggested changes

Co-authored-by: Damien Mathieu <[email protected]>
Apply the suggested changes

Co-authored-by: Damien Mathieu <[email protected]>
@tongoss tongoss force-pushed the bugfix/otlp-exporter-logs-env branch from 2904171 to edcfc43 Compare March 6, 2025 13:06
Copy link
Member

@pellared pellared left a comment

Choose a reason for hiding this comment

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

Good overall 👍 Just two comments related to unit tests.

@tongoss
Copy link
Contributor Author

tongoss commented Mar 7, 2025

Good overall 👍 Just two comments related to unit tests.

@pellared , Thanks very much for the comments. They are all very helpful. I have pushed the new changes.

@pellared pellared requested a review from dmathieu March 10, 2025 22:20
@pellared
Copy link
Member

@open-telemetry/go-maintainers, planning to merge tomorrow.

@pellared pellared merged commit efe325a into open-telemetry:main Mar 12, 2025
31 of 32 checks passed
@MrAlias MrAlias added this to the v1.36.0 milestone Mar 15, 2025
dmathieu added a commit that referenced this pull request May 21, 2025
# Overview

Closes #6786

### Added

- Add exponential histogram support in
`go.opentelemetry.io/otel/exporters/prometheus`. (#6421)
- The `go.opentelemetry.io/otel/semconv/v1.31.0` package.
The package contains semantic conventions from the `v1.31.0` version of
the OpenTelemetry Semantic Conventions.
See the [migration documentation](./semconv/v1.31.0/MIGRATION.md) for
information on how to upgrade from
`go.opentelemetry.io/otel/semconv/v1.30.0`. (#6479)
- Add `Recording`, `Scope`, and `Record` types in
`go.opentelemetry.io/otel/log/logtest`. (#6507)
- Add `WithHTTPClient` option to configure the `http.Client` used by
`go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`.
(#6751)
- Add `WithHTTPClient` option to configure the `http.Client` used by
`go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`.
(#6752)
- Add `WithHTTPClient` option to configure the `http.Client` used by
`go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`. (#6688)
- Add `ValuesGetter` in `go.opentelemetry.io/otel/propagation`, a
`TextMapCarrier` that supports retrieving multiple values for a single
key. (#5973)
- Add `Values` method to `HeaderCarrier` to implement the new
`ValuesGetter` interface in `go.opentelemetry.io/otel/propagation`.
(#5973)
- Update `Baggage` in `go.opentelemetry.io/otel/propagation` to retrieve
multiple values for a key when the carrier implements `ValuesGetter`.
(#5973)
- Add `AssertEqual` function in `go.opentelemetry.io/otel/log/logtest`.
(#6662)
- The `go.opentelemetry.io/otel/semconv/v1.32.0` package.
The package contains semantic conventions from the `v1.32.0` version of
the OpenTelemetry Semantic Conventions.
See the [migration documentation](./semconv/v1.32.0/MIGRATION.md) for
information on how to upgrade from
`go.opentelemetry.io/otel/semconv/v1.31.0`(#6782)
- Add `Transform` option in `go.opentelemetry.io/otel/log/logtest`.
(#6794)
- Add `Desc` option in `go.opentelemetry.io/otel/log/logtest`. (#6796)

### Removed

- Drop support for [Go 1.22]. (#6381, #6418)
- Remove `Resource` field from `EnabledParameters` in
`go.opentelemetry.io/otel/sdk/log`. (#6494)
- Remove `RecordFactory` type from
`go.opentelemetry.io/otel/log/logtest`. (#6492)
- Remove `ScopeRecords`, `EmittedRecord`, and `RecordFactory` types from
`go.opentelemetry.io/otel/log/logtest`. (#6507)
- Remove `AssertRecordEqual` function in
`go.opentelemetry.io/otel/log/logtest`, use `AssertEqual` instead.
(#6662)

### Changed

- ⚠️ Update `github.com/prometheus/client_golang` to `v1.21.1`, which
changes the `NameValidationScheme` to `UTF8Validation`.
This allows metrics names to keep original delimiters (e.g. `.`), rather
than replacing with underscores.
This can be reverted by setting
`github.com/prometheus/common/model.NameValidationScheme` to
`LegacyValidation` in `github.com/prometheus/common/model`. (#6433)
- Initialize map with `len(keys)` in `NewAllowKeysFilter` and
`NewDenyKeysFilter` to avoid unnecessary allocations in
`go.opentelemetry.io/otel/attribute`. (#6455)
- `go.opentelemetry.io/otel/log/logtest` is now a separate Go module.
(#6465)
- `go.opentelemetry.io/otel/sdk/log/logtest` is now a separate Go
module. (#6466)
- `Recorder` in `go.opentelemetry.io/otel/log/logtest` no longer
separately stores records emitted by loggers with the same
instrumentation scope. (#6507)
- Improve performance of `BatchProcessor` in
`go.opentelemetry.io/otel/sdk/log` by not exporting when exporter cannot
accept more. (#6569, #6641)

### Deprecated

- Deprecate support for `model.LegacyValidation` for
`go.opentelemetry.io/otel/exporters/prometheus`. (#6449)

### Fixes

- Stop percent encoding header environment variables in
`go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc` and
`go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`. (#6392)
- Ensure the `noopSpan.tracerProvider` method is not inlined in
`go.opentelemetry.io/otel/trace` so the `go.opentelemetry.io/auto`
instrumentation can instrument non-recording spans. (#6456)
- Use a `sync.Pool` instead of allocating `metricdata.ResourceMetrics`
in `go.opentelemetry.io/otel/exporters/prometheus`. (#6472)

---------

Co-authored-by: Tyler Yahn <[email protected]>
Co-authored-by: Robert Pająk <[email protected]>
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.

5 participants