I want to publish record-e2e-latency p90, p95, p99 to datadog. Apache Kafka. For what I can see KafkaStreams only publishes min, avg, and max by attaching the corresponding Min, Avg, and Max MeasurableStats to the record-e2e-latency sensors in StreamTask.
KafkaStreams.metrics() does publish all metrics. But there is no way to get to the parent Sensor of a Metric. If KafkaStreams also had a sensors() function, I would be able to filter for the record-e2e-latency sensors that I am interested in, and add a Percentiles stat to have KafkaStreams compute the p90, p95, p99 that I need. Alternatively, I could even add a custom made MeasurableStats that published directly to a micrometer Timer, i.e.
@Override
public void record(final MetricConfig config, final double value, final long timeMs) {
e2eMicrometerTimer.record((long) value, TimeUnit.MILLISECONDS);
}
Another possibility to get to KafkaStreams’ Sensors would be if the MetricsReporter provided them, but similarly to KafkaStreams.metrics(), it only exposes KafkaMetric.
Questions:
- is there another possibility to have kafka compute and publish p90, p95 and p99 for record-e2e-latency?
- are there any plans to add a method in KafkaStreams to get the list of all Sensors, similar to what streams() does.
- are there plans to publish Sensors in MetricsReporter?
- are there plans to add a getSensor() property in KafkaMetric?
- is there a clever way to get to the record-e2e-latency sensors?
Thanks.