elastic / integrations

Elastic Integrations
https://www.elastic.co/integrations
Other
24 stars 436 forks source link

Choosing the right metric_type mapping and aggregator function for the Airflow dashboard's `scheduler.heartbeat` field in the context of TSDB. #7504

Open ritalwar opened 1 year ago

ritalwar commented 1 year ago

Previously, the sum aggregator function was used to display scheduler.heartbeat in the Airflow dashboard before TSDB integration. Although the sum aggregator isn't ideal for representing this field, it was switched to max to address visualization issues. This was done as sum, avg aggregators, etc., do not align well with counter fields. It's required to update an appropriate aggregator to accurately represent this field in TSDB-enabled mode too.

ritalwar commented 1 year ago

This PR is updating the metric_type of airflow.scheduler.heartbeat from counter to gauge. While the field is designated as a counter in the airflow documentation, the behaviour of the values—consistently 1 or 2—suggests it aligns better with the characteristics of a gauge metric.

Additionally, dashboard is modified to accurately represent this data, with the aggregator function updated to use last_value.

We will keep an eye on this issue and revisit it if any changes in behavior are observed or if updates become necessary in the future.

ritalwar commented 1 year ago

Following discussions in this PR, leaving this issue open to prevent conflicts with the airflow documentation. We've opted not to assign any metric_type mapping for the 'airflow.scheduler.heartbeat' field. However, we have updated the aggregator function to use 'last_value' for data visualization.

We'll maintain this issue in our backlog for future review, especially if there are changes in the documentation or data related to this field.