Expose Kafka metrics for User Event consumer as json endpoint#4665
Expose Kafka metrics for User Event consumer as json endpoint#4665chetanmeh merged 1 commit intoapache:masterfrom
Conversation
|
For complete metrics json see kafka-metrics.txt |
Codecov Report
@@ Coverage Diff @@
## master #4665 +/- ##
==========================================
- Coverage 84.59% 78.43% -6.16%
==========================================
Files 184 185 +1
Lines 8438 8454 +16
Branches 591 589 -2
==========================================
- Hits 7138 6631 -507
- Misses 1300 1823 +523
Continue to review full report at Codecov.
|
rabbah
left a comment
There was a problem hiding this comment.
should the admin interfaces have some basic auth protection out of the box?
For now I think its fine. The 2 endpoints exposed are around metrics only (support GET with no state change) and further such microservices are meant to be exposed within network only and not for outside access |
This PR expose the metrics related to specific Kafka producer or consumer over
/metrics/kafkaendpoint.Description
For now this feature is enabled for User Event service where the event consumer's Kafka consumer instance metrics are exposed. Such metrics can provide insight into the Kafka consumers processing stats.
The http endpoint is not exposed to end user and meant for developers and system admins to understand the performance characteristics of the consumer at any given time by direct access
It also registers the
KamonMetricsReporter(introduced via #4481) with the User Event consumer to expose some of those metrics as Kamon metricsA typical response for the
/metrics/kafkaendpoint is like below ( > 100 entries)[ { "description": "The number of responses received per second", "group": "consumer-node-metrics", "name": "response-rate", "tags": { "client-id": "event-consumer", "node-id": "node--1" }, "value": 0.05848409232688709 }, { "description": "The total number of connections with successful authentication", "group": "consumer-metrics", "name": "successful-authentication-total", "tags": { "client-id": "event-consumer" }, "value": 0 }, { "description": "The maximum size of any request sent.", "group": "consumer-metrics", "name": "request-size-max", "tags": { "client-id": "event-consumer" }, "value": 179 }, { "description": "The total number of bytes consumed", "group": "consumer-fetch-manager-metrics", "name": "bytes-consumed-total", "tags": { "client-id": "event-consumer" }, "value": 0 } ]Later we plan to enable this feature with Activation Persister Service (#4632) also
Related issue and scope
My changes affect the following components
Types of changes
Checklist: