The value for first time operation is minus 1

53 views
Skip to first unread message

David5228 WANG

unread,
Apr 29, 2020, 4:34:29 AM4/29/20
to Prometheus Users
Hi 

My production gets data via prometheus API like "http://******:9090/api/v1/query?query=". 
And the formual like : delta(com_nokia_neo_metrics_subscriber_counter_perfsdb_total[5m]) 

The FIRST TIME for below elements(action=ent, action=rtrv),  the value is 0 but in fact it is 1. 

ElementValue
{action="ent",instance="localhost:9620",job="provision",key="Fs2System^Fs2System^Fs2Switch^utas3^Fs2Fsdb^fsdb0",key_mbean_attribute_name="Value",key_mbean_domain_name="com.nokia.neo.metrics",kind="counter",result="fail",tags_checksum="-765728571",type="subscriber_counter_perFsdb"}0
{action="rtrv",instance="localhost:9620",job="provision",key="Fs2System^Fs2System^Fs2Switch^utas3^Fs2Fsdb^fsdb0",key_mbean_attribute_name="Value",key_mbean_domain_name="com.nokia.neo.metrics",kind="counter",result="fail",tags_checksum="866673650",type="subscriber_counter_perFsdb"}0

For the second time, I do same operation(action=ent, action=rtrv), it will get correct value. 

If I do other operation(action=dlt) one time, the element for (action=dlt) will display, but the value is 0.  In fact it is 1. 

Anyone occurs this issue? 
Thanks in advance. 

thanks


Brian Candler

unread,
Apr 29, 2020, 6:17:08 AM4/29/20
to Prometheus Users
Can you show the result of com_nokia_neo_metrics_subscriber_counter_perfsdb_total, without the delta() wrapper, using query_range over the 5 minute window in question?

delta()[5m] shows the difference between the first and last values in the time window(*).  So if the value at the start of the window is 1, and the value at the end is 1, then delta() will correctly return zero.

(*) actually it's extrapolated from the first and last point within the window, to the values it would have had at the very start and very end of the window. For details:

David5228 WANG

unread,
Apr 29, 2020, 11:59:48 PM4/29/20
to Prometheus Users
Hi Brian,

Thanks very much for your quick response.

The result of com_nokia_neo_metrics_subscriber_counter_perfsdb_total as below. There are 6 Elements including action=ent/rtrv. 
ElementValue
com_nokia_neo_metrics_subscriber_counter_perfsdb_total{action="ent",instance="localhost:9620",job="provision",key="Fs2System^Fs2System^Fs2Switch^utas3^Fs2Fsdb^fsdb0",key_mbean_attribute_name="Value",key_mbean_domain_name="com.nokia.neo.metrics",kind="counter",result="fail",tags_checksum="-765728571",type="subscriber_counter_perFsdb"}1
com_nokia_neo_metrics_subscriber_counter_perfsdb_total{action="rtrv",instance="localhost:9620",job="provision",key="Fs2System^Fs2System^Fs2Switch^comNtas^Fs2Fsdb^fsdb0",key_mbean_attribute_name="Value",key_mbean_domain_name="com.nokia.neo.metrics",kind="counter",result="fail",tags_checksum="-623073749",type="subscriber_counter_perFsdb"}1
com_nokia_neo_metrics_subscriber_counter_perfsdb_total{action="rtrv",instance="localhost:9620",job="provision",key="Fs2System^Fs2System^Fs2Switch^comntas^Fs2Fsdb^fsdb0",key_mbean_attribute_name="Value",key_mbean_domain_name="com.nokia.neo.metrics",kind="counter",result="fail",tags_checksum="1667709291",type="subscriber_counter_perFsdb"}4
com_nokia_neo_metrics_subscriber_counter_perfsdb_total{action="rtrv",instance="localhost:9620",job="provision",key="Fs2System^Fs2System^Fs2Switch^reinaNtas^Fs2Fsdb^fsdb0",key_mbean_attribute_name="Value",key_mbean_domain_name="com.nokia.neo.metrics",kind="counter",result="fail",tags_checksum="1690729883",type="subscriber_counter_perFsdb"}3
com_nokia_neo_metrics_subscriber_counter_perfsdb_total{action="rtrv",instance="localhost:9620",job="provision",key="Fs2System^Fs2System^Fs2Switch^utas3^Fs2Fsdb^fsdb0",key_mbean_attribute_name="Value",key_mbean_domain_name="com.nokia.neo.metrics",kind="counter",result="fail",tags_checksum="866673650",type="subscriber_counter_perFsdb"}10
com_nokia_neo_metrics_subscriber_counter_perfsdb_total{action="rtrv",instance="localhost:9620",job="provision",key="Unspecified",key_mbean_attribute_name="Value",key_mbean_domain_name="com.nokia.neo.metrics",kind="counter",result="fail",tags_checksum="-196785181",type="subscriber_counter_perFsdb"}1



Since there is no dlt action in above elements,  I do action=dlt  ONE TIME and element action=dlt is displayed as below the first one and the value is 1:
ElementValue
com_nokia_neo_metrics_subscriber_counter_perfsdb_total{action="dlt",instance="localhost:9620",job="provision",key="Fs2System^Fs2System^Fs2Switch^utas3^Fs2Fsdb^fsdb0",key_mbean_attribute_name="Value",key_mbean_domain_name="com.nokia.neo.metrics",kind="counter",result="fail",tags_checksum="-1916054270",type="subscriber_counter_perFsdb"}1
com_nokia_neo_metrics_subscriber_counter_perfsdb_total{action="ent",instance="localhost:9620",job="provision",key="Fs2System^Fs2System^Fs2Switch^utas3^Fs2Fsdb^fsdb0",key_mbean_attribute_name="Value",key_mbean_domain_name="com.nokia.neo.metrics",kind="counter",result="fail",tags_checksum="-765728571",type="subscriber_counter_perFsdb"}1
com_nokia_neo_metrics_subscriber_counter_perfsdb_total{action="rtrv",instance="localhost:9620",job="provision",key="Fs2System^Fs2System^Fs2Switch^comNtas^Fs2Fsdb^fsdb0",key_mbean_attribute_name="Value",key_mbean_domain_name="com.nokia.neo.metrics",kind="counter",result="fail",tags_checksum="-623073749",type="subscriber_counter_perFsdb"}1
com_nokia_neo_metrics_subscriber_counter_perfsdb_total{action="rtrv",instance="localhost:9620",job="provision",key="Fs2System^Fs2System^Fs2Switch^comntas^Fs2Fsdb^fsdb0",key_mbean_attribute_name="Value",key_mbean_domain_name="com.nokia.neo.metrics",kind="counter",result="fail",tags_checksum="1667709291",type="subscriber_counter_perFsdb"}4
com_nokia_neo_metrics_subscriber_counter_perfsdb_total{action="rtrv",instance="localhost:9620",job="provision",key="Fs2System^Fs2System^Fs2Switch^reinaNtas^Fs2Fsdb^fsdb0",key_mbean_attribute_name="Value",key_mbean_domain_name="com.nokia.neo.metrics",kind="counter",result="fail",tags_checksum="1690729883",type="subscriber_counter_perFsdb"}3
com_nokia_neo_metrics_subscriber_counter_perfsdb_total{action="rtrv",instance="localhost:9620",job="provision",key="Fs2System^Fs2System^Fs2Switch^utas3^Fs2Fsdb^fsdb0",key_mbean_attribute_name="Value",key_mbean_domain_name="com.nokia.neo.metrics",kind="counter",result="fail",tags_checksum="866673650",type="subscriber_counter_perFsdb"}10
com_nokia_neo_metrics_subscriber_counter_perfsdb_total{action="rtrv",instance="localhost:9620",job="provision",key="Unspecified",key_mbean_attribute_name="Value",key_mbean_domain_name="com.nokia.neo.metrics",kind="counter",result="fail",tags_checksum="-196785181",type="subscriber_counter_perFsdb"}1


then I run "delta(com_nokia_neo_metrics_subscriber_counter_perfsdb_total[5m])" ,  the result is 0. I think it is 1. 
ElementValue
{action="dlt",instance="localhost:9620",job="provision",key="Fs2System^Fs2System^Fs2Switch^utas3^Fs2Fsdb^fsdb0",key_mbean_attribute_name="Value",key_mbean_domain_name="com.nokia.neo.metrics",kind="counter",result="fail",tags_checksum="-1916054270",type="subscriber_counter_perFsdb"}0
{action="ent",instance="localhost:9620",job="provision",key="Fs2System^Fs2System^Fs2Switch^utas3^Fs2Fsdb^fsdb0",key_mbean_attribute_name="Value",key_mbean_domain_name="com.nokia.neo.metrics",kind="counter",result="fail",tags_checksum="-765728571",type="subscriber_counter_perFsdb"}0
{action="rtrv",instance="localhost:9620",job="provision",key="Fs2System^Fs2System^Fs2Switch^comNtas^Fs2Fsdb^fsdb0",key_mbean_attribute_name="Value",key_mbean_domain_name="com.nokia.neo.metrics",kind="counter",result="fail",tags_checksum="-623073749",type="subscriber_counter_perFsdb"}0
{action="rtrv",instance="localhost:9620",job="provision",key="Fs2System^Fs2System^Fs2Switch^comntas^Fs2Fsdb^fsdb0",key_mbean_attribute_name="Value",key_mbean_domain_name="com.nokia.neo.metrics",kind="counter",result="fail",tags_checksum="1667709291",type="subscriber_counter_perFsdb"}0
{action="rtrv",instance="localhost:9620",job="provision",key="Fs2System^Fs2System^Fs2Switch^reinaNtas^Fs2Fsdb^fsdb0",key_mbean_attribute_name="Value",key_mbean_domain_name="com.nokia.neo.metrics",kind="counter",result="fail",tags_checksum="1690729883",type="subscriber_counter_perFsdb"}0
{action="rtrv",instance="localhost:9620",job="provision",key="Fs2System^Fs2System^Fs2Switch^utas3^Fs2Fsdb^fsdb0",key_mbean_attribute_name="Value",key_mbean_domain_name="com.nokia.neo.metrics",kind="counter",result="fail",tags_checksum="866673650",type="subscriber_counter_perFsdb"}0
{action="rtrv",instance="localhost:9620",job="provision",key="Unspecified",key_mbean_attribute_name="Value",key_mbean_domain_name="com.nokia.neo.metrics",kind="counter",result="fail",tags_checksum="-196785181",type="subscriber_counter_perFsdb"}0


The delta is for  calculating the difference between the first and last value of each time series element.
The value for the start for action=dlt is 0. 
The value for the end for action=dlt is 1. 
so the delta()[5m] is 1. right ? 

thanks



在 2020年4月29日星期三 UTC+8下午6:17:08,Brian Candler写道:

David5228 WANG

unread,
Apr 30, 2020, 12:21:23 AM4/30/20
to Prometheus Users
The 

The result for "com_nokia_neo_metrics_subscriber_counter_perfsdb_total[5m]" is 

Element
Value
com_nokia_neo_metrics_subscriber_counter_perfsdb_total{action="dlt",instance="localhost:9620",job="provision",key="Fs2System^Fs2System^Fs2Switch^utas3^Fs2Fsdb^fsdb0",key_mbean_attribute_name="Value",key_mbean_domain_name="com.nokia.neo.metrics",kind="counter",result="fail",tags_checksum="-1916054270",type="subscriber_counter_perFsdb"} 1 @1588219949.283
1 @1588219951.283
1 @1588219953.283
1 @1588219955.283
1 @1588219957.283
1 @1588219959.283
1 @1588219961.283
1 @1588219963.283
1 @1588219965.283
1 @1588219967.283
1 @1588219969.283
1 @1588219971.283
1 @1588219973.283
1 @1588219975.283
1 @1588219977.283
1 @1588219979.283
1 @1588219981.283
1 @1588219983.283
1 @1588219985.283
1 @1588219987.283
1 @1588219989.283
1 @1588219991.283
1 @1588219993.283
1 @1588219995.283
1 @1588219997.283
1 @1588219999.283
1 @1588220001.283
1 @1588220003.283
1 @1588220005.283
1 @1588220007.283
1 @1588220009.283
1 @1588220011.283
1 @1588220013.283
1 @1588220015.283
1 @1588220017.283
1 @1588220019.285
1 @1588220021.283
1 @1588220023.283
1 @1588220025.283
1 @1588220027.283
1 @1588220029.283
1 @1588220031.283
1 @1588220033.283
1 @1588220035.283
1 @1588220037.283
1 @1588220039.283
1 @1588220041.283
1 @1588220043.283
1 @1588220045.283
1 @1588220047.283
1 @1588220049.283
1 @1588220051.283
1 @1588220053.283
1 @1588220055.283
1 @1588220057.283
1 @1588220059.283
1 @1588220061.283
1 @1588220063.283
1 @1588220065.283
1 @1588220067.283
1 @1588220069.283
1 @1588220071.283
1 @1588220073.283
1 @1588220075.283
1 @1588220077.283
1 @1588220079.283
1 @1588220081.283
1 @1588220083.283
1 @1588220085.283
1 @1588220087.283
1 @1588220089.283
1 @1588220091.283
1 @1588220093.283
1 @1588220095.283
1 @1588220097.283
1 @1588220099.283
1 @1588220101.283
1 @1588220103.283
1 @1588220105.283
1 @1588220107.283
1 @1588220109.283
1 @1588220111.283
1 @1588220113.283
1 @1588220115.283
1 @1588220117.283
1 @1588220119.283
1 @1588220121.283
1 @1588220123.283
1 @1588220125.283
1 @1588220127.283
1 @1588220129.283
1 @1588220131.283
1 @1588220133.283
1 @1588220135.283
1 @1588220137.283
1 @1588220139.283
1 @1588220141.283
1 @1588220143.283
1 @1588220145.283
1 @1588220147.283
1 @1588220149.283
1 @1588220151.283
1 @1588220153.283
1 @1588220155.283
1 @1588220157.283
1 @1588220159.283
1 @1588220161.283
1 @1588220163.283
1 @1588220165.283
1 @1588220167.283
1 @1588220169.283
1 @1588220171.283
1 @1588220173.283
1 @1588220175.284
1 @1588220177.289
1 @1588220179.283
1 @1588220181.283
1 @1588220183.283
1 @1588220185.283
1 @1588220187.283
1 @1588220189.283
1 @1588220191.283
1 @1588220193.283
1 @1588220195.283
1 @1588220197.283
1 @1588220199.283
1 @1588220201.283
1 @1588220203.283
1 @1588220205.283
1 @1588220207.283
1 @1588220209.283
1 @1588220211.283
1 @1588220213.283
1 @1588220215.283
1 @1588220217.283
1 @1588220219.283
1 @1588220221.283
1 @1588220223.283
1 @1588220225.283
1 @1588220227.283
1 @1588220229.283
1 @1588220231.283
1 @1588220233.283
1 @1588220235.283
1 @1588220237.283
1 @1588220239.283
1 @1588220241.283
1 @1588220243.283
1 @1588220245.283
1 @1588220247.283


thanks

Value
com_nokia_neo_metrics_subscriber_counter_perfsdb_total{action="dlt",instance="localhost:9620",job="provision",key="Fs2System^Fs2System^Fs2Switch^utas3^Fs2Fsdb^fsdb0",key_mbean_attribute_name="Value",key_mbean_domain_name="com.nokia.neo.metrics",kind="counter",result="fail",tags_checksum="-1916054270",type="subscriber_counter_perFsdb"} 1 @1588219949.283
1 @1588219951.283
1 @1588219953.283
1 @1588219955.283
1 @1588219957.283
1 @1588219959.283
1 @1588219961.283
1 @1588219963.283
1 @1588219965.283
1 @1588219967.283
1 @1588219969.283
1 @1588219971.283
1 @1588219973.283
1 @1588219975.283
1 @1588219977.283
1 @1588219979.283
1 @1588219981.283
1 @1588219983.283
1 @1588219985.283
1 @1588219987.283
1 @1588219989.283
1 @1588219991.283
1 @1588219993.283
1 @1588219995.283
1 @1588219997.283
1 @1588219999.283
1 @1588220001.283
1 @1588220003.283
1 @1588220005.283
1 @1588220007.283
1 @1588220009.283
1 @1588220011.283
1 @1588220013.283
1 @1588220015.283
1 @1588220017.283
1 @1588220019.285
1 @1588220021.283
1 @1588220023.283
1 @1588220025.283
1 @1588220027.283
1 @1588220029.283
1 @1588220031.283
1 @1588220033.283
1 @1588220035.283
1 @1588220037.283
1 @1588220039.283
1 @1588220041.283
1 @1588220043.283
1 @1588220045.283
1 @1588220047.283
1 @1588220049.283
1 @1588220051.283
1 @1588220053.283
1 @1588220055.283
1 @1588220057.283
1 @1588220059.283
1 @1588220061.283
1 @1588220063.283
1 @1588220065.283
1 @1588220067.283
1 @1588220069.283
1 @1588220071.283
1 @1588220073.283
1 @1588220075.283
1 @1588220077.283
1 @1588220079.283
1 @1588220081.283
1 @1588220083.283
1 @1588220085.283
1 @1588220087.283
1 @1588220089.283
1 @1588220091.283
1 @1588220093.283
1 @1588220095.283
1 @1588220097.283
1 @1588220099.283
1 @1588220101.283
1 @1588220103.283
1 @1588220105.283
1 @1588220107.283
1 @1588220109.283
1 @1588220111.283
1 @1588220113.283
1 @1588220115.283
1 @1588220117.283
1 @1588220119.283
1 @1588220121.283
1 @1588220123.283
1 @1588220125.283
1 @1588220127.283
1 @1588220129.283
1 @1588220131.283
1 @1588220133.283
1 @1588220135.283
1 @1588220137.283
1 @1588220139.283
1 @1588220141.283
1 @1588220143.283
1 @1588220145.283
1 @1588220147.283
1 @1588220149.283
1 @1588220151.283
1 @1588220153.283
1 @1588220155.283
1 @1588220157.283
1 @1588220159.283
1 @1588220161.283
1 @1588220163.283
1 @1588220165.283
1 @1588220167.283
1 @1588220169.283
1 @1588220171.283
1 @1588220173.283
1 @1588220175.284
1 @1588220177.289
1 @1588220179.283
1 @1588220181.283
1 @1588220183.283
1 @1588220185.283
1 @1588220187.283
1 @1588220189.283
1 @1588220191.283
1 @1588220193.283
1 @1588220195.283
1 @1588220197.283
1 @1588220199.283
1 @1588220201.283
1 @1588220203.283
1 @1588220205.283
1 @1588220207.283
1 @1588220209.283
1 @1588220211.283
1 @1588220213.283
1 @1588220215.283
1 @1588220217.283
1 @1588220219.283
1 @1588220221.283
1 @1588220223.283
1 @1588220225.283
1 @1588220227.283
1 @1588220229.283
1 @1588220231.283
1 @1588220233.283
1 @1588220235.283
1 @1588220237.283
1 @1588220239.283
1 @1588220241.283
1 @1588220243.283
1 @1588220245.283
1 @1588220247.283

在 2020年4月29日星期三 UTC+8下午6:17:08,Brian Candler写道:
Can you show the result of com_nokia_neo_metrics_subscriber_counter_perfsdb_total, without the delta() wrapper, using query_range over the 5 minute window in question?

Brian Candler

unread,
Apr 30, 2020, 3:55:55 AM4/30/20
to Prometheus Users
I don't see the problem here.  I see no time in your range output where the value is not 1, and the difference between <no value> and 1 is not 1.

Looking at values in that 5 minute time window, I would expect the following for delta:

<no values>   => nothing
1             => nothing or 0 (I'm not sure which)
1  1          => 0

David5228 WANG

unread,
Apr 30, 2020, 5:54:08 AM4/30/20
to Prometheus Users
Thanks for your support.

The result for com_nokia_neo_metrics_subscriber_counter_perfsdb_total for (action="dlt") and com_nokia_neo_metrics_subscriber_counter_perfsdb_total [5m] is right.  The value are all 1.   

Initially there is no this element(action="dlt"). 
When I do one time action="dlt"  in 5 minutes, the delta should be 1.  but now why it is 0 ? 

thanks


在 2020年4月30日星期四 UTC+8下午3:55:55,Brian Candler写道:

David5228 WANG

unread,
Apr 30, 2020, 6:26:36 AM4/30/20
to Prometheus Users
Hi Brian 

I think I can understand the output for com_nokia_neo_metrics_subscriber_counter_perip_total[5m]. 
when I do one time action="dlt", the first value is the inital value for 5min and the value is 1 not 0.  The end value is also 1. so the delta is 0. 

In my mind, I think the first value is growing out of nothing, so the first value should be 0, the end value is 1, so the delta is 1. 

thanks

在 2020年4月30日星期四 UTC+8下午3:55:55,Brian Candler写道:
I don't see the problem here.  I see no time in your range output where the value is not 1, and the difference between <no value> and 1 is not 1.

David5228 WANG

unread,
Apr 30, 2020, 6:40:34 AM4/30/20
to Prometheus Users
Hi Brian

Do you think the design for the first value with 1 is reasonable ?   

thanks


在 2020年4月30日星期四 UTC+8下午3:55:55,Brian Candler写道:
I don't see the problem here.  I see no time in your range output where the value is not 1, and the difference between <no value> and 1 is not 1.
Reply all
Reply to author
Forward
0 new messages