# What is the meaning of null value?

Been plotting things with Grafana with prometheus as datasource. One thing that i am not really clear about is null and Nan values. I wonder:

1. What is the meaning of null in prometheus ?
2. When can a time series return the value null ?
3. Is the value null the same as NaN ?
4. In grafana, graph panel, we can interpret null as zero, as null, or connected ? What does that mean exactly ?

Been plotting things with Grafana with prometheus as datasource. One thing
that i am not really clear about is null and Nan values. I wonder:

1. What is the meaning of null in prometheus ?

I canâ€™t answer that because Iâ€™m not familiar with Prometheus, but hopefully
someone else can.

1. When can a time series return the value null ?

When there is no value (result) for the time period covered by the query.

Either the query has asked for a period when there was not intended to be a
measurement, or maybe a measurement failed or went missing and just isnâ€™t in
the database.

1. Is the value null the same as NaN ?

I thought NaN (not a number) was something Python-specific (although
say â€śno, itâ€™s not the same as nullâ€ť because null means â€śnothingâ€ť, whereas
â€śNaNâ€ť means â€śnot a numberâ€ť, but it could still be something else which isnâ€™t
â€śnothingâ€ť. â€śNullâ€ť is more specific to me than â€śNaNâ€ť, because â€śnullâ€ť means
â€śthere is no informationâ€ť, whereas â€śNaNâ€ť could mean â€śorangesâ€ť.

1. In grafana, graph panel, we can interpret null as zero, as null, or
connected ? What does that mean exactly ?

â€śNull as zeroâ€ť means â€śif you get a null value, substitute zero and use that as
the value for this time sampleâ€ť.

â€śNull as nullâ€ť means â€śif you get a null value, substitute nothing - itâ€™s
nullâ€ť. Most graphs will leave a gap between the preceding and succeeding data
points in this case.

â€śConnectedâ€ť means â€śif you get a null value, join the preceding and succeeding
values with a straight line, effectively pretenting that you didnâ€™t expect to
get a measurement where the null appearedâ€ť.

Regards,

Antony.

2 Likes