-
-
Notifications
You must be signed in to change notification settings - Fork 197
Select individual metrics #24
Comments
Thanks for your interest @NeQuissimus. That's the exact sort of use case I was hoping to enable! Kafka Lag Exporter was meant to work within the Prometheus ecosystem. When its endpoint is scraped by a Prometheus server you can then query for the exact metrics you need with PromQL (prometheus query language). This project exposes its endpoint with the Prometheus simple Java HTTP client library, which provides a simplistic way of publishing the metrics endpoint and AFAICT doesn't offer any sort of filtering criteria. I understand that you may not be interested in setting up a full Prometheus stack so I'm open to discussing other solutions (kafka-lag-exporter as a library? a separate queryable API?), but if you're still in the prototype phase of your project the easiest path forward would be to run Prometheus server, configure it to scrape or discover Kafka Lag Exporter's endpoint, and query that. |
I am planning to have my metrics delivered to DataDog, I am currently not really looking to change that. I found something like this may work :D
Maybe I'll wrap this in something, we'll see :) This is not super high on my list right now but I will definitely come back to it. |
Got it. That should do the trick for a quick experiment! I don't have much experience with datadog, but it looks like the agent supports prometheus endpoints too, so that's another option.
You're welcome! It's still early days so if you have anything you'd like to see in the backlog LMK. :) |
@NeQuissimus I was poking around the Prometheus HTTP simple client and I noticed it does have a filtering mechanism (though I couldn't find any GitHub issue or documentation around it). You can filter by some arbitrary metric name with the query param Ex)
EDIT: The parsing code for reference: https://github.com/prometheus/client_java/blob/4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f/simpleclient_httpserver/src/main/java/io/prometheus/client/exporter/HTTPServer.java#L101 |
That is both weird and awesome :-) good find! |
Documented in #29 |
I am looking to use this to build a Kubernetes HPA based on consumer lag.
In order for this to be much easier, it would be nice if I could select a single specific metric.
If something like
http://localhost:8000/kafka_consumergroup_group_lag_seconds?cluster_name=dev&topic=high-volume-topic&group=consumer-group
returned just those metrics I am querying for, I could easily grab the max value and use that to have Kubernetes decide whether I need more pods. Similarly, I could spin down pods if that number is low.The text was updated successfully, but these errors were encountered: