Skip to content

Query metrics for messages viewer #4052

@patrickpang

Description

@patrickpang

Issue submitter TODO list

  • I've searched for an already existing issues here
  • I'm running a supported version of the application which is listed here and the feature is not present there

Is your proposal related to a problem?

The messages viewer is genuinely powerful. However, we would like to find a way to monitor the query latency and understand the usage pattern. This will help monitor the additional traffic on our Kafka clusters. Given that a new consumer is created for each query, we think this would be important for us to keep an eye on how many queries are executed, which topics are the most popular, etc.

Describe the feature you're interested in

Add more metrics

On each query for messages, we should record metrics of number of messages queried (counter), total time taken (counter). This is inspired by http.server.requests provided out of the box by Spring Boot. In terms of metrics API, we can leverage the Micrometer registry built-in for Spring Boot apps. Tags can be topic names to allow more granular analysis on topic level.

Add Prometheus as metrics export interface

Spring Boot 3 has native integration with Prometheus to allow us export metrics at /actuator/prometheus, which allows us to collect and visualize metrics via Prometheus. This is useful for creating dashboard and track historical trends.

Ref: https://docs.spring.io/spring-boot/docs/current/actuator-api/htmlsingle/#prometheus

Describe alternatives you've considered

Log scraping

Log does provide some metrics of topic queried, and number of messages queried. However, it is not efficient to scrape log, extract keywords, and analyze every time.

Actuator metrics endpoint

Spring Boot provides /actuator/metrics to quickly check what metrics are available. However, this is only useful for ad-hoc analysis. Long term metrics storage is not possible.

Version you're running

56fa824

Additional context

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions