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写道:
>
> Can you show the result of 
> com_nokia_neo_metrics_subscriber_counter_perfsdb_total, without the delta() 
> wrapper, using query_range 
> <https://prometheus.io/docs/prometheus/latest/querying/api/#range-queries> 
> 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:
> https://prometheus.io/docs/prometheus/latest/querying/functions/#delta 
> <https://www.google.com/url?q=https%3A%2F%2Fprometheus.io%2Fdocs%2Fprometheus%2Flatest%2Fquerying%2Ffunctions%2F%23delta&sa=D&sntz=1&usg=AFQjCNEDyo0ngYNJFqUwF5qrYauUpaFFgw>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/f147f655-101c-46b8-87b8-0d2801eb4a4b%40googlegroups.com.

Reply via email to