Re: [prometheus-users] How could I trucate data after pull in Java client.
Each combination of metric name plus set of label names and values defines a new metric (timeseries). If you change a label, then you're creating a new metric. Not knowing the Java API, I'd suspect that you have to explicitly delete the old metric. On Monday, 15 August 2022 at 03:47:31 UTC+1 hello...@gmail.com wrote: > Thanks very much. > I query data from anthor metrics system and handle it to prometheus > format. Like my comment, the `app_version{version=a} ` is in changing, > there will generate new label value and the old label value may not used > anymore. But it still in query result. > > 在2022年8月12日星期五 UTC+8 17:14:11 写道: > >> On 09/08/2022 08:56, Hello Wood wrote: >> > Hi, I using Prometheus to collect Spring Boot service metrics in Java. >> > But I found a problem that data still exsit after pull, that made the >> > instant data is not correct. >> > >> > Like at now there has one label like 'app_version{version=a} 100', >> > then the metrics updated, and add a new label value b, the metrics >> > come to 'app_version{version=a} 50' and 'app_version{version=b} 50'; >> > Then, label a no longer update, and metrics come to >> > 'app_version{version=b} 100'. >> > >> > When I pull metrics form Spring Boot service, the metrics is >> > 'app_version{version=a} 50' and 'app_version{version=b} 100'. But >> > expect data should be 'app_version{version=b} 100' only. >> > >> > How could I fix this issue? Thanks. >> >> I think possibly you aren't using labels in the way expected. >> >> Labels are used to "slice & dice" the data, so for example to be able to >> see which specific HTTP response code was returned from a web call, etc. >> >> What is the value of the metric app_version supposed to signify? >> >> -- >> Stuart Clark >> >> -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/dc93daf3-df95-4173-9f41-6da29a215425n%40googlegroups.com.
Re: [prometheus-users] How could I trucate data after pull in Java client.
Thanks very much. I query data from anthor metrics system and handle it to prometheus format. Like my comment, the `app_version{version=a} ` is in changing, there will generate new label value and the old label value may not used anymore. But it still in query result. 在2022年8月12日星期五 UTC+8 17:14:11 写道: > On 09/08/2022 08:56, Hello Wood wrote: > > Hi, I using Prometheus to collect Spring Boot service metrics in Java. > > But I found a problem that data still exsit after pull, that made the > > instant data is not correct. > > > > Like at now there has one label like 'app_version{version=a} 100', > > then the metrics updated, and add a new label value b, the metrics > > come to 'app_version{version=a} 50' and 'app_version{version=b} 50'; > > Then, label a no longer update, and metrics come to > > 'app_version{version=b} 100'. > > > > When I pull metrics form Spring Boot service, the metrics is > > 'app_version{version=a} 50' and 'app_version{version=b} 100'. But > > expect data should be 'app_version{version=b} 100' only. > > > > How could I fix this issue? Thanks. > > I think possibly you aren't using labels in the way expected. > > Labels are used to "slice & dice" the data, so for example to be able to > see which specific HTTP response code was returned from a web call, etc. > > What is the value of the metric app_version supposed to signify? > > -- > Stuart Clark > > -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/4dfa9688-f79f-4de8-8fca-214ab9bb8c59n%40googlegroups.com.
Re: [prometheus-users] How could I trucate data after pull in Java client.
On 09/08/2022 08:56, Hello Wood wrote: Hi, I using Prometheus to collect Spring Boot service metrics in Java. But I found a problem that data still exsit after pull, that made the instant data is not correct. Like at now there has one label like 'app_version{version=a} 100', then the metrics updated, and add a new label value b, the metrics come to 'app_version{version=a} 50' and 'app_version{version=b} 50'; Then, label a no longer update, and metrics come to 'app_version{version=b} 100'. When I pull metrics form Spring Boot service, the metrics is 'app_version{version=a} 50' and 'app_version{version=b} 100'. But expect data should be 'app_version{version=b} 100' only. How could I fix this issue? Thanks. I think possibly you aren't using labels in the way expected. Labels are used to "slice & dice" the data, so for example to be able to see which specific HTTP response code was returned from a web call, etc. What is the value of the metric app_version supposed to signify? -- Stuart Clark -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/8ba27ec4-9c10-d6e3-1b8d-4e48b209010f%40Jahingo.com.
[prometheus-users] How could I trucate data after pull in Java client.
Hi, I using Prometheus to collect Spring Boot service metrics in Java. But I found a problem that data still exsit after pull, that made the instant data is not correct. Like at now there has one label like 'app_version{version=a} 100', then the metrics updated, and add a new label value b, the metrics come to 'app_version{version=a} 50' and 'app_version{version=b} 50'; Then, label a no longer update, and metrics come to 'app_version{version=b} 100'. When I pull metrics form Spring Boot service, the metrics is 'app_version{version=a} 50' and 'app_version{version=b} 100'. But expect data should be 'app_version{version=b} 100' only. How could I fix this issue? Thanks. -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/31873740-2030-43ab-b905-d8f98570f647n%40googlegroups.com.