0

I am making a monitor about Server starting times.In my imagine ,when the Server start,Prometheus will get a report if my mtrics do something like "metrics.Set(1);",so I could get the number of starting times by count(metrics{}) on Grafana.

But unluckly,the count is always 1 no matter how many times I start Server.

Is there something wrong with my idea or lack of some operations? Help me please.

What I mean is the count of "samples"(named by official document means timestample-value). When my code run metrics.Set(1),or metrics.Inc(1);,I think my client server will report a sample to the Prometheus server and stored in the Prometheus server.So How can I get the count number of the samples my client server reported?

Sorry for my poor English.

xjtd
  • 1
  • 1
  • `count(metrics{})` shows the number of metrics that are available not their specific value, which is 1 (metrics from 1 server) Also how are the metrics being sent to Prometheus? – rohatgisanat Feb 08 '21 at 20:32
  • I am sorry for my poor English. What I mean is the count of "samples"(named by official document means timestample-value). When my code run metrics.Set(1),or metrics.Inc(1);,I think my client server will report a sample to the Prometheus server and stored in the Prometheus server.So How can I get the count number of the samples my client server reported?I need your help and thank you for your comment. – xjtd Feb 09 '21 at 08:21
  • can you paste the response of the server, which goes tk Prometheus? – rohatgisanat Feb 10 '21 at 18:13

0 Answers0