Prometheux exporter can't expose state store metrics if the topology contains rocksdb and in memory store #218
Closed
Description
Description
Use this topology with prometheus exporter, all state store metrics are not available due to an internal exception when the exporter try to create gauge ..
IKStream<string, string> stream = builder.Stream<string, string>(inputTopic);
stream
.GroupByKey()
.WindowedBy(TumblingWindowOptions.Of(windowSize))
.Count()
.ToStream()
.To<StringWindowSerdes, Int64SerDes>(outputTopic);
stream
.GroupByKey()
.Count(
InMemory.As<string, long>("count-store")
.WithKeySerdes<StringSerDes>()
.WithValueSerdes<Int64SerDes>());
Workaround
- Use
OpenTelemetry
exporter package with Prometheus exporter, it works !
config.UseOpenTelemetryReporter((builder) =>
{
builder.AddPrometheusExporter((options) =>
{
options.StartHttpListener = true;
// Use your endpoint and port here
options.HttpListenerPrefixes = new string[] {$"http://localhost:{9099}/"};
options.ScrapeResponseCacheDurationMilliseconds = 0;
});
}, true);