I have implementation on java and Grafana/prometheus
From our java service we are ingesting payload to grafana and it plots
I have defined a Metric using java
public class MyPayloadService {
private final AtomicInteger lastPayloadValue = new AtomicInteger(0);
public MyPayloadService(MeterRegistry registry) {
Gauge.builder("my.payload.value", this.lastPayloadValue, AtomicInteger::get)
.description("The value from the most recently processed payload")
.register(registry);
}
public void processPayload(int newPayloadValue) {
this.lastPayloadValue.set(newPayloadValue);
System.out.println("New payload value set to: " + newPayloadValue);
}
}
Current it working with the same point is plotting again and again over a period of time
I am looking for something like if I ingest data1 in 12:00 and data2 12:30 in graph it should plot only once. something like in graph against 12:00 should be one point and 12:30 second point
but now its plotted again and again.
anyone can give suggestion may be using registry can we delete old one and keep only once.