Questions tagged [prometheus-java]

Refers to specific questions about the library for JVM applications

Prometheus instrumentation library for JVM applications

Java Doc: http://prometheus.github.io/client_java/

Source code: https://github.com/prometheus/client_java

81 questions
20
votes
2 answers

Dynamic tag values for the Counter metric in Micrometer

Newbie here, trying to learn more about the micrometer. I'm currently exploring ways on how to accomplish this: I'm using Spring boot 2 with actuator and micrometer enabled. Consider the following class: @Component class MyService { @Autowired …
Vimalraj Selvam
  • 2,155
  • 3
  • 23
  • 52
10
votes
1 answer

Prometheus java/Spring API for fetching metrics

I need to query for collected metrics in my application and the only way I found to do it is via Prometheus rest api as described here: https://prometheus.io/docs/prometheus/latest/querying/api/ Does any Spring or java api for fetching metrics from…
dev123
  • 477
  • 8
  • 20
7
votes
1 answer

GraalVM native-image jvm metrics

When running a native-image of a Micronaut application retrieving Prometheus metrics fails because it cannot get jvm metrics. Of course native-image pre-compiles the application and includes only what's actually being used, but what kind of JVM is…
6
votes
3 answers

Using prometheus custom metrics with SpringBoot

I'm not sure it's a bug but I'm trying to implement this library in the past day without any results. I think maybe it's a conflict with the dependencies versions but I tried everything. So I have a very simple spring boot project that serves the…
5
votes
1 answer

Initializing prometheus counters to 0 whenever a new time series is created

I am working on a use case in which new time series gets created whenever metrics are pushed. I am using counter for my metrics. And I am using sum(increase(metric_name{_namespace_="elvis", Label1=~"d1", Label2=~"d2", Label3=~"d3"}[2m])) by (Label1,…
Anky
  • 111
  • 15
5
votes
2 answers

Prometheus not working after upgrading to Spring Boot Version 2

I was able to use Prometheus with the Spring Boot Version 2 before without any problem. After updating Spring Boot version to 2.1.1. Release I come across with the following error. I upgraded Prometheus version from 0.2.0 to 0.6.0 but I still come…
4
votes
2 answers

How to get all metric names from Prometheus server filtered by a particular label

We want to get all metric names from Prometheus server filtered by a particular label. Step 1 : Used following query to get all metric names, query succeeded with all metric names. curl -g 'http://localhost:9090/api/v1/label/__name__/values Step 2…
3
votes
1 answer

initialize counter value to 0 in prometheus

I'm using a simple client Prometheus version 0.6.0 I have a set of counters that are defined this way private static final Counter CD_PRODUCT_SUCCESS_CREATED = new Counter.Builder() .name("cd_Product_success_created") …
R0b0t0
  • 390
  • 6
  • 20
3
votes
1 answer

Springboot gateway Prometheus collecting huge data

I am using springboot as microservice. I have around 20 microservices in my k8s cluster. I am using promethues to collect data to show in grafana. In that application there are some url which uses Path variable like as…
3
votes
0 answers

Error "unsupported character in float" when scraping metrics in Prometheus

I instrumented Prometheus Metrics and while I try to scrape them I got the "unsupported character in float" error. Any idea why this error occurs?
N.Chandimali
  • 799
  • 1
  • 8
  • 23
3
votes
1 answer

Prometheus not exporting Kafka Consumer data upon upgrade from Spring Boot 2.1.6 to 2.2.2

We upgraded Spring Boot version from 2.1.6 to 2.2.2. Some of the properties being seen in the Prometheus endpoint in 2.1.6 is not visible in…
3
votes
1 answer

Using sbt-native-packager to instrument prometheus exporter via JavaServerAppPackaging

I am trying to instrument a java app with prometheus exporter using sbt-native-packager: This is what I have: plugin.sbt addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.5.1") build.sbt import…
irrelevantUser
  • 1,172
  • 18
  • 35
3
votes
0 answers

How to access and export WebSocketMessageBrokerStats internal counts

I've created a spring boot app with websocket support, and I would like to expose the WebSocketMessageBrokerStats on the prometheus scrape endpoint provided by acuator. I'm able to get access to the WebSocketMessageBrokerStats object via…
Derek Mok
  • 253
  • 1
  • 7
3
votes
4 answers

How to include Method Parameters in @Timed annotation used on arbitrary method name

In my application, I have a use case where I have to monitor a method by the argument value it is supplied. I have to expose the metrics to Prometheus endpoint. However, the function is a common function and is used by many different classes. I am…
3
votes
1 answer

Prometheus alertmanager custom receiver

I'm currently trying to setup Prometheus and Alertmanager, the issue I have come to and haven't found solution yet, is that I want alert to be send to our custom application with oauth2 authorization. Is there any way how to build/configure own…
Kamil
  • 990
  • 1
  • 7
  • 24
1
2 3 4 5 6