Skip to content

chore(deps): update github.com/prometheus/client_golang to v1.21.1#6433

Merged
dmathieu merged 2 commits intoopen-telemetry:mainfrom
ajatprabha:update-prometheus-client
Mar 18, 2025
Merged

chore(deps): update github.com/prometheus/client_golang to v1.21.1#6433
dmathieu merged 2 commits intoopen-telemetry:mainfrom
ajatprabha:update-prometheus-client

Conversation

@ajatprabha
Copy link
Copy Markdown
Contributor

There are changes in how testutil.GatherAndCompare behaves in tests, this PR updates the testcases and bumps the github.com/prometheus/client_golang dependency to v1.21.1

@dmathieu
Copy link
Copy Markdown
Member

Could you provide us with a doc explaining how this is not a breaking change with attribute names?

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

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

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #6433     +/-   ##
=======================================
- Coverage   81.8%   81.8%   -0.1%     
=======================================
  Files        283     283             
  Lines      24910   24910             
=======================================
- Hits       20385   20384      -1     
- Misses      4120    4121      +1     
  Partials     405     405             

see 2 files with indirect coverage changes

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

@ajatprabha
Copy link
Copy Markdown
Contributor Author

ajatprabha commented Mar 12, 2025

I looked thoroughly, and #6198 already upgraded to prometheus/common@v0.62.0 which has the model.NameValidationScheme change.
The release notes mention that it can be switched back manually, but #6198 didn't set model.NameValidationScheme to model.LegacyValidation.

What do you think the expected behaviour should be? It seems like prometheus/client_golang@v1.20.5 was not honoring model.NameValidationScheme == model.UTF8Validation as it does in v1.21.1.

And how does it affect the decision, given that prometheus/common is already upgraded?

@ajatprabha ajatprabha force-pushed the update-prometheus-client branch 3 times, most recently from 28b7721 to b7cf248 Compare March 12, 2025 09:33
@ajatprabha
Copy link
Copy Markdown
Contributor Author

Explicitly setting the model.NameValidationScheme to LegacyValidation requires no change to test cases.
b7cf248

@ajatprabha ajatprabha force-pushed the update-prometheus-client branch from b7cf248 to 35b4652 Compare March 12, 2025 09:39
@dmathieu
Copy link
Copy Markdown
Member

Explicitly setting the model.NameValidationScheme to LegacyValidation requires no change to test cases.

This is what we need. Can you document it in the CHANGELOG? So folks can keep the previous behavior if they wish.

This is still a breaking change. But the prometheus exporter is not stable. So we should be good as long as there's a way to keep the previous behavior.

Attribute name changes is a breaking change, because that change breaks dashboards and alerts.

@ajatprabha ajatprabha force-pushed the update-prometheus-client branch from 7c5d272 to 0cb2b73 Compare March 12, 2025 10:12
@ajatprabha
Copy link
Copy Markdown
Contributor Author

Can you document it in the CHANGELOG?

Updated, PTAL.

Comment thread CHANGELOG.md Outdated
Comment thread exporters/prometheus/exporter.go Outdated
@ajatprabha ajatprabha force-pushed the update-prometheus-client branch 2 times, most recently from 8e2ffc2 to 13c4f3b Compare March 13, 2025 06:04
Signed-off-by: ajatprabha <ajat.prabha.leo@gmail.com>
@ajatprabha ajatprabha force-pushed the update-prometheus-client branch from 13c4f3b to cecd76c Compare March 13, 2025 06:07
@ajatprabha ajatprabha requested a review from dmathieu March 13, 2025 06:09
Comment thread CHANGELOG.md
Copy link
Copy Markdown
Contributor

@GiedriusS GiedriusS left a comment

Choose a reason for hiding this comment

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

🙇

@dmathieu dmathieu merged commit 921e0e6 into open-telemetry:main Mar 18, 2025
31 checks passed
@MrAlias MrAlias added this to the v1.36.0 milestone Mar 27, 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 <MrAlias@users.noreply.github.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
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