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

Micrometer Prometheus metrics export fails due to conditional proxy.address tag #3218

Closed
Stephan202 opened this issue May 2, 2024 · 2 comments · Fixed by #3230
Closed

Micrometer Prometheus metrics export fails due to conditional proxy.address tag #3218

Stephan202 opened this issue May 2, 2024 · 2 comments · Fixed by #3230
Assignees
Labels
type/bug A general bug warn/regression A regression from a previous release
Milestone

Comments

@Stephan202
Copy link

With the introduction of the proxy.address metrics tag in #3081, we started to observe that Micrometer Prometheus metrics registration started to fail, due to the requirement that metrics with the same name have the same set of tags:

2024-05-01 14:03:54.728 ERROR 1 --- [or-http-epoll-4] PrometheusMetricsConfig () : Failed to register meter_id='MeterId{name='reactor.netty.http.client.data.received', tags=[tag(country=REDACTED),tag(proxy.address=REDACTED),tag(remote.address=REDACTED),tag(uri=http)]}': Prometheus requires that all meters with the same name have the same set of tag keys. There is already an existing meter named 'reactor.netty.http.client.data.received' containing tag keys [country, remote_address, uri]. The meter you are attempting to register has keys [country, proxy_address, remote_address, uri].

Besides reduced observability, this causes a stream of error logs. This happens because in one of our Spring Boot applications we use Netty to connect to multiple other systems, only one of which involves a proxy.

Would be possible to e.g. either have the proxy.address tag be conditionally omitted, or to always include it, with a default value (the empty string?) where relevant? (Maybe there are other approaches; just proposing the two "obvious" ones 😄.)

NB: In the log line shown above, tag(uri=http) looks rather uninformative 👀. Didn't investigate that aspect.

@Stephan202 Stephan202 added status/need-triage A new issue that still need to be evaluated as a whole type/bug A general bug labels May 2, 2024
@jtorkkel
Copy link

jtorkkel commented May 3, 2024

All meters with the same name have the same set of tag keys. If mixed tag set used then Spring start fails.

If proxy not used the value like "na" should be set to it.

Sounds that some code path does not set this new tag --> conflict

Prometheus when scraping can mix tag sets.

@violetagg violetagg removed the status/need-triage A new issue that still need to be evaluated as a whole label May 5, 2024
@violetagg violetagg self-assigned this May 5, 2024
@violetagg violetagg added this to the 1.1.19 milestone May 5, 2024
@violetagg
Copy link
Member

@Stephan202 Thanks for the report. I confirm that this is an issue and it will be fixed for the next release.

@violetagg violetagg added the warn/regression A regression from a previous release label May 5, 2024
violetagg added a commit that referenced this issue May 7, 2024
When there is no proxy add `na` as a value tag.

Fixes #3218
@violetagg violetagg linked a pull request May 7, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug A general bug warn/regression A regression from a previous release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants