You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ri...@apache.org on 2026/06/09 13:35:09 UTC

(streampipes) 01/01: fix: Use prometheus collector bridge

This is an automated email from the ASF dual-hosted git repository.

dominikriemer pushed a commit to branch fix-prometheus-config
in repository https://gitbox.apache.org/repos/asf/streampipes.git

commit c734e949277b2a89fea6f0f562be540767e431c2
Author: Dominik Riemer <do...@gmail.com>
AuthorDate: Tue Jun 9 15:34:48 2026 +0200

    fix: Use prometheus collector bridge
---
 streampipes-service-base/pom.xml                             |  4 ++++
 .../service/base/StreamPipesPrometheusConfig.java            | 12 ++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/streampipes-service-base/pom.xml b/streampipes-service-base/pom.xml
index c4acac5a69..92bc8cd723 100644
--- a/streampipes-service-base/pom.xml
+++ b/streampipes-service-base/pom.xml
@@ -78,6 +78,10 @@
             <groupId>io.micrometer</groupId>
             <artifactId>micrometer-registry-prometheus</artifactId>
         </dependency>
+        <dependency>
+            <groupId>io.prometheus</groupId>
+            <artifactId>prometheus-metrics-simpleclient-bridge</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-actuator</artifactId>
diff --git a/streampipes-service-base/src/main/java/org/apache/streampipes/service/base/StreamPipesPrometheusConfig.java b/streampipes-service-base/src/main/java/org/apache/streampipes/service/base/StreamPipesPrometheusConfig.java
index de45fa8d91..d707136c20 100644
--- a/streampipes-service-base/src/main/java/org/apache/streampipes/service/base/StreamPipesPrometheusConfig.java
+++ b/streampipes-service-base/src/main/java/org/apache/streampipes/service/base/StreamPipesPrometheusConfig.java
@@ -22,6 +22,8 @@ package org.apache.streampipes.service.base;
 import org.apache.streampipes.commons.prometheus.StreamPipesCollectorRegistry;
 
 import io.prometheus.client.CollectorRegistry;
+import io.prometheus.metrics.model.registry.PrometheusRegistry;
+import io.prometheus.metrics.simpleclient.bridge.SimpleclientCollector;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 
@@ -33,4 +35,14 @@ public class StreamPipesPrometheusConfig {
     return StreamPipesCollectorRegistry.getCollectorRegistry();
   }
 
+  @Bean
+  public PrometheusRegistry prometheusRegistry(CollectorRegistry collectorRegistry) {
+    PrometheusRegistry prometheusRegistry = new PrometheusRegistry();
+    SimpleclientCollector.builder()
+        .collectorRegistry(collectorRegistry)
+        .register(prometheusRegistry);
+
+    return prometheusRegistry;
+  }
+
 }