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

Autodetect consumer producer names #178

Merged
merged 12 commits into from
Jul 1, 2022

Conversation

sigilioso
Copy link
Contributor

@sigilioso sigilioso commented Jun 17, 2022

Closes #159

This PR introduces support to detect automatically consumer/producer client.id. As agreed in this internal link, we made the name field optional for consumers and producers and introduced the default alias, so:

    PRODUCERS: '[{"host": "localhost", "port": 24, "username": "me", "password": "secret"}]' # get metrics from all producers detected in localhost:24

    PRODUCERS: '[{}]' # Get metrics from all producers detected in DEFAULT_JMX_HOST:DEFAULT_JMX_PORT
    
    PRODUCERS: 'default' # It is an alias of '[{}]' (will gather metrics from all producers in default host:port)

    PRODUCERS: '[]' # (default value), no Java metrics from producers are got

    PRODUCERS: '[{"name": "myProducer"}]' # get metrics only the producer whose client.id is "myProducer" in DEFAULT_JMX_HOST:DEFAULT_JMX_PORT

@sigilioso sigilioso force-pushed the autodetect-consumer-producer-names branch from 86c12d2 to 3bd6cca Compare June 20, 2022 14:46
@sigilioso sigilioso force-pushed the autodetect-consumer-producer-names branch from e032b7e to 1e89e11 Compare June 27, 2022 07:11
@sigilioso sigilioso force-pushed the autodetect-consumer-producer-names branch from 803d23b to bd0b261 Compare June 27, 2022 07:49
src/client/id_detection.go Outdated Show resolved Hide resolved
Copy link
Contributor

@alvarocabanas alvarocabanas left a comment

Choose a reason for hiding this comment

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

LGTM! Nice job!

src/client/id_detection.go Outdated Show resolved Hide resolved
src/client/id_detection.go Outdated Show resolved Hide resolved
Copy link
Contributor

@alvarocabanas alvarocabanas left a comment

Choose a reason for hiding this comment

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

I left a comment.

@sigilioso sigilioso requested review from alvarocabanas and a team and removed request for paologallinaharbur June 29, 2022 16:23
Copy link
Contributor

@alvarocabanas alvarocabanas left a comment

Choose a reason for hiding this comment

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

LGTM, like this we are behaving like we used to and making the fallback to app-info

@sigilioso sigilioso merged commit 8a2db9d into master Jul 1, 2022
@sigilioso sigilioso deleted the autodetect-consumer-producer-names branch July 1, 2022 07:25
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.

Improve Consumer/Producer JMX metrics collection
2 participants