Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upCounter not start from zero #1853
Comments
This comment has been minimized.
This comment has been minimized.
|
There's not much we can do here, irate only looks at two samples at a time. Without a sample to go before the 15 value, we don't have anything to compare it to. If we did what you suggested it'd be far worse, as every network blip would lead to a massive spurious spike in your graphs. |
brian-brazil
added
the
kind/question
label
Jul 28, 2016
This comment has been minimized.
This comment has been minimized.
|
hmm sorry ask this because i really confuse, |
This comment has been minimized.
This comment has been minimized.
|
You appear to be doing this correctly, this is what this sort of query produces on a sparse metric where you don't know the label values in advance. If you can pre-populate the metric with 0 for all potential timeseries you would get better results, but I'm guessing that's not possible here. See https://prometheus.io/docs/practices/instrumentation/#avoid-missing-metrics |
This comment has been minimized.
This comment has been minimized.
|
Oh now i got it, thanks |
This comment has been minimized.
This comment has been minimized.
|
There's #1673 discussing this, but I don't see any way to make this workable in a sane way. There's other features in future that may let you implement such a thing yourself. |
This comment has been minimized.
This comment has been minimized.
|
thank you |
chocopowwwa
closed this
Jul 28, 2016
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 24, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
chocopowwwa commentedJul 28, 2016
What did you do?
Tailing Nginx log and parse and publish it using Mtail (mine quiet similar like https://github.com/ipfs/infrastructure/blob/master/mtail/progs/nginx.mtail), the probem is that when the mtail starts it publish metrics like this
and after i make several http requests ( for example 15 http requests ), mtail will read the logs and publish metrics like
but prometheus will assume that the counters starts from 15 not 0

MY Query:
irate(http_requests_total{job="apache2",airlines=~"$airlines",code!="500"}[$interval])
NB: $airlines is ZumaAir
as you see on the image, becausei didn't introduce the metrics first to prometheus and set its initial value ( like for example 0 ) the total values of the query it will be less than the actual sum of the metrics
What did you expect to see?
i expect the total of the query is the same as the total of the vents, is the any possible to assume that if the metrics hasn't introduced to promethus it will assume that the metrics starts from zero?
What did you see instead? Under which circumstances?
the total of the query isn't the same as the total of the metrics
also it makes no change the the graph
Environment
Linux 4.4.12-boot2docker x86_64
1.0.1
scrape_interval: 5s
static_configs: