DIFFERENCE(s) functionality visualization in Grafana?

This is a highly critical stage of production implementation for us now.

Is there DIFFERENCE(s) (last_value()) functionality/visualization in Grafana, like it exists in Elastic, SevOne and on many other similar platforms?

We hope such a popular function, or data transformation, or Lucene query syntax, etc. also exists in Grafana. Please give as a reference/link to your documentation related.

What is your datasource?

1 Like

Grafana Elastic - Log files.

Grafana Elastic - Log files.

what do these functions do, can you share some documentation

Thank you for your reply. This is how exactly the query looks in Elastic/Kibana:

difference(last(metric_name)) AND host.hostname:$host_name

And we simply want to repeat the same logic in Grafana (function, or data transformation, or Lucene query syntax, etc.)

Hi @yosiasz hi @grant2 let us find some more Kibana doc references for you to explain the task in more details.

1 Like

Elasticsearch formula reference/doc:

"
differences(metric: number)
Calculates the difference to the last value of a metric over time. To use this function, you need to configure a date histogram dimension as well. Differences requires the data to be sequential. If your data is empty when using differences, try increasing the date histogram interval.

This calculation will be done separately for separate series defined by filters or top values dimensions.

Example: Visualize the change in bytes received over time: differences(sum(bytes)) "

Elasticsearch formula reference/doc:

"
differences(metric: number)
Calculates the difference to the last value of a metric over time. To use this function, you need to configure a date histogram dimension as well. Differences requires the data to be sequential. If your data is empty when using differences, try increasing the date histogram interval.

This calculation will be done separately for separate series defined by filters or top values dimensions.

Example: Visualize the change in bytes received over time: differences(sum(bytes)) "

Can we do the same in Grafana visualization?

Hi @grantHi @grant2 hi @yosiasz do you think above formula can be configured in Grafana somewhere here: Query Type → … → Metric - > Extended stats → Derivatives - > Script? We clearly understand, that Grafana doesn’t support Kibana query language or its functions. But we are looking for a logical analog of below discussed formula. DIFFERENCE is a very common and popular logic for many platforms. Maybe it can be programmed in Script by Extended Stats of Metric query?