-
Notifications
You must be signed in to change notification settings - Fork 1k
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
KafkaMetrics - renameTag with "client.id" no longer works instead "client-id" #2256
Comments
The JMX-based |
This also makes the `client.id` tag the same as it was in `KafkaConsumerMetrics`. Notably, `kafka-version` tag has also been changed to `kafka.version`. With some meter registries, this will effectively be no change (e.g. Prometheus), but for others it may be a breaking change to the tag name, but the goal is to correct the oversight of not aligning KafkaMetrics with KafkaConsumerMetrics initially. Behavior can be restored with a MeterFilter. Resolves micrometer-metrics#2256
#2316 will switches the tag naming back to what it was with Users who want Going forward we intend to stick with the canonical naming by default ( |
This also makes the `client.id` tag the same as it was in `KafkaConsumerMetrics`. Notably, `kafka-version` tag has also been changed to `kafka.version`. With some meter registries, this will effectively be no change (e.g. Prometheus), but for others it may be a breaking change to the tag name, but the goal is to correct the oversight of not aligning KafkaMetrics with KafkaConsumerMetrics initially. Behavior can be restored with a MeterFilter. Resolves #2256
@shakuzen thanks and sounds good! My only request is if you can try to call out the change back in the 1.6 release notes? As I'll probably forget what you said by the time I go to upgrade next to 1.6? And, I imagine, Spring Boot 2.4ish? |
Absolutely plan on doing so (hence the |
Hey, I'm upgrading our application from Spring Boot 2.1.X to 2.3.3 and bumped our Micrometer version from 1.3.2 to 1.5.4 (Also bumping Spring Cloud Streams from Greenwich.RC2 to Hoston.SR8). In doing these upgrades I noticed that we were logging a ton of (lines for each kafka meter):
As that error is quite unhelpful and wouldn't go away on a application refresh I decided to search further.
StackOverflow -- Spring Boot 2.3.2.RELEASE - Micrometer - KafkaMetrics - Failed to bind meter logs
- Had the same error but wasn't answered
So I searched this repo for "However, this could happen" I found the following lines:
https://github.com/micrometer-metrics/micrometer/blob/master/micrometer-core/src/main/java/io/micrometer/core/instrument/binder/kafka/KafkaMetrics.java#L195-L204
Knowing that we are using
Prometheus
I then went about break pointing our application at thatif
check and got the following:Being that the
client-id
was still the super long name that we don't care (because we want to group by topic name) I checked out our filter system which is copied as follows:KafkaMetrics.kt
That's in a "common-lib" that is then included in the Spring application with:
I noticed that
client-id
from the error didn't match theclient.id
that I was looking. Although, we knew thatclient.id
worked in the past I decided to try the naive approach of updating the name toclient-id
which subsequently seemed to resolve the original error. e.g.:My question is was this changed in some release of Micrometer?
I want to make sure my system is resilient for future upgrades and doesn't break again with a mystery error that creates a lot of logs.
Micrometer v1.4.0 appears to have some big Kafka changes https://github.com/micrometer-metrics/micrometer/releases/tag/v1.4.0
- Specifically #1835 which does remove a number of
client.id
magic stringsCurrently
client-id
appears hard coded inKafkaMetrics.java
line 65
so maybe that's why? But the current test suite all looks forclient.id
as far as I can tell see kafka test dir for1.5.4
The text was updated successfully, but these errors were encountered: