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 Meters Missing with Boot 2.3 #914

Closed
garyrussell opened this issue Jun 10, 2020 · 7 comments
Closed

Micrometer Meters Missing with Boot 2.3 #914

garyrussell opened this issue Jun 10, 2020 · 7 comments
Assignees

Comments

@garyrussell
Copy link
Contributor

Boot 2.3 switched from JMX scraping to native Micrometer meters in 2.3.

This is facilitated by adding a listener to the producer/consumer factory.

Since the binder creates its own factories; these meters are now missing.

https://stackoverflow.com/questions/62292889/kafka-consumer-metrics-gone-upon-upgrade-from-spring-boot-2-2-2-to-2-3-0

@garyrussell garyrussell self-assigned this Jun 10, 2020
garyrussell added a commit to garyrussell/spring-cloud-stream-binder-kafka that referenced this issue Jun 10, 2020
Resolves spring-cloud#914

Boot no longer uses the deprecated JMX MBean scraping provided by Micrometer.

Add configuration to add Micrometer Meters when Micrometer and spring-kafka 2.5.x are on
the class path.
sobychacko pushed a commit to sobychacko/spring-cloud-stream-binder-kafka that referenced this issue Jun 15, 2020
Resolves spring-cloud#914

Boot no longer uses the deprecated JMX MBean scraping provided by Micrometer.

Add configuration to add Micrometer Meters when Micrometer and spring-kafka 2.5.x are on
the class path.

Micrometer for Streams

- work around until SK 2.5.3
@blacksab
Copy link

blacksab commented Oct 7, 2020

We are also seeing this issue.

The fix provided was for metrics to appear when spring-kafka is on the classpath. Our classpath does not have spring-kafka. It has:

+--- org.apache.kafka:kafka-streams:2.6.0
|    +--- org.apache.kafka:kafka-clients:2.6.0

We also set spring.jmx.enabled=true
Using spring-boot 2.3.4

Any suggestions as to getting the metrics back?

@garyrussell
Copy link
Contributor Author

Boot only does auto configuration when spring-kafka is present.

@blacksab
Copy link

Thanks, @garyrussell.

We ended up manually binding our KafkaStreams to the Micrometer registry.

private void bind(
      org.apache.kafka.streams.KafkaStreams kafkaStreams, 
      io.micrometer.core.instrument.MeterRegistry meterRegistry
  ) {
    new KafkaStreamsMetrics(
        kafkaStreams,
        defaultTagSet()
    ).bindTo(
        meterRegistry
    );
  }

@dlipofsky
Copy link

I encountered this too, and I tried adding org.springframework.kafka:spring-kafka:2.7.9 to my classpath but it did not help. In my case I am moving from SpringBoot 2.1.18 to 2.5.7, micrometer 1.6.9 to 1.7.6, and kafka 2.8.0 to 2.8.1.

@sobychacko
Copy link
Contributor

@dlipofsky This is a closed issue. Could you please create a new issue and link to this one? Please provide more context as to what is not working, sample code, configuration, etc. Thanks!

@dlipofsky
Copy link

@sobychacko since it is closed, is there a solution? There's no milestone, and I was hoping someone on this thread would tell me what the actual fix is.

@sobychacko
Copy link
Contributor

It was fixed before (see the commit above). I am not sure if the issues you are running into are the same or if there were some regressions that happened with the recent releases. That's why I suggested creating a new issue and then we can re-evaluate things. Looks like we missed adding a milestone marker on this issue. This change was originally part of the 3.0.6.RELEASE.

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 a pull request may close this issue.

4 participants