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

Fixed regex the metrics of kafka client #443

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

alvarobacelar
Copy link
Contributor

@brian-brazil. I fixed the regexs the patterns of kafka consumer and producer (clients) created by Saada.

The Metrics of consumer, for exemple, appear like this:
https://gist.githubusercontent.com/alvarobacelar/a5cc687b72f86b9291f4efb88cd8f4c3/raw/e0abeb582e7282e7c2c978b86698b2cf09d18670/metric-consumer

Signed-off-by: Álvaro Bacelar <alvarobacelar@outlook.com>
Signed-off-by: Álvaro Bacelar <alvarobacelar@outlook.com>
Signed-off-by: Álvaro Bacelar <alvarobacelar@outlook.com>
Signed-off-by: Álvaro Bacelar <alvarobacelar@outlook.com>
@brian-brazil
Copy link
Contributor

Can you explain what's wrong with the existing config?

I'd prefer not to have the kafka client here, applications should handle that themselves.

@alvarobacelar
Copy link
Contributor Author

Before, this pattern below captured everything after clien-id and was added in label clientId:

  - pattern: kafka.(.+)<type=(.+)-metrics, client-id=(.+)><>([a-z-]+)
    name: kafka_$1_$2_$4
    labels:
      clientId: "$3"
    help: "Kafka client JMX metric $1 $2"
    type: GAUGE

I Added another pattern that captured and add in the label correct.

 - pattern: kafka.(.+)<type=(.+)-metrics, client-id=(.+), topic=(.+), partition=(.+)><>([a-z-]+)
    name: kafka_$1_$2_$6
    labels:
      clientId: "$3"
      topic: "$4"
      partition: "$5"
    help: "Kafka client JMX metric $1 $2"
    type: GAUGE
  - pattern: kafka.(.+)<type=(.+)-metrics, client-id=(.+), topic=(.+)><>([a-z-]+)
    name: kafka_$1_$2_$5
    labels:
      clientId: "$3"
      topic: "$4"
    help: "Kafka client JMX metric $1 $2"
    type: GAUGE
  - pattern: kafka.(.+)<type=(.+)-metrics, client-id=(.+), node-id=(.+)><>([a-z-]+)
    name: kafka_$1_$2_$5
    labels:
      clientId: "$3"
      nodeId: "$4"
    help: "Kafka client JMX metric $1 $2"
    type: GAUGE

I understand you don't want have kafka clients here, but in the ecosistem Apache Kafka is very important to monitory end-to-end the peaces mainly the clients.

@brian-brazil
Copy link
Contributor

Before, this pattern below captured everything after clien-id and was added in label clientId:

There's something off here, can you ensure your branch is up to date?

Apache Kafka is very important to monitory end-to-end the peaces mainly the clients.

That doesn't mean we should be encouraging using JMX unnecessarily to monitor them.

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.

None yet

2 participants