Skip to content
This repository has been archived by the owner on Nov 5, 2021. It is now read-only.

Add a way to export gauge metrics and other changes. #604

Merged
merged 2 commits into from
Jun 3, 2021

Conversation

manugarg
Copy link
Contributor

@manugarg manugarg commented Jun 3, 2021

  • Introduce the ability to transform metrics before exporting. Currently implementing two types of transformations:

    • Add "failure" metric to EventMetrics.
    • Convert cumulative metrics to gauge metrics.
  • To calculate gauge metrics from cumulative metrics, we keep a "last-value" cache of EventMetrics by a key that consists of metric names and label keys and values. We subtract last EventMetrics from the new EventMetrics and export the results.

  • This requires implementing subtract logic through the metrics stack: from EventMetrics to individual value types. We need to also take into account that metrics may be reset.

Ref: #494
PiperOrigin-RevId: 377179096

= Introduce the ability to transform metrics before exporting. Currently implementing two types of transformations:
  - Add "failure" metric to EventMetrics.
  - Convert cumulative metrics to gauge metrics.

= To calculate gauge metrics from cumulative metrics, we keep a "last-value" cache of EventMetrics by a key that consists of metric names and label keys and values. We subtract last EventMetrics from the new EventMetrics and export the results.

= This requires implementing subtract logic through the metrics stack: from EventMetrics to individual value types. We need to also take into account that metrics may be reset.

Ref: #494
PiperOrigin-RevId: 377179096
@manugarg manugarg added this to the v0.11.3 milestone Jun 3, 2021
@manugarg manugarg merged commit 6a737ea into master Jun 3, 2021
@manugarg manugarg deleted the 63729A23134379909BFCA3AC3C378B48 branch June 3, 2021 15:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant