Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify that counters are monotonic #442

Merged
merged 2 commits into from
Dec 6, 2023
Merged

Conversation

acrmp
Copy link
Member

@acrmp acrmp commented Dec 5, 2023

Description

Sums must be declared as monotonic in order to be represented in prometheus as counters.

Note that this causes the otel collector to rename metrics when using the prometheus exporter. Counters have _total appended to the name.

There are cases where loggregator counters aren't monotonic, in particular when counters are emitted only as deltas (V1) and the counter totals are reset in the Forwarder Agent. In this case we mark the otel sum as not monotonic and it will be represented as a gauge when using the prometheus exporter.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Testing performed?

  • Unit tests
  • Integration tests
  • Acceptance tests

Checklist:

  • This PR is being made against the main branch, or relevant version branch
  • I have made corresponding changes to the documentation
  • I have added testing for my changes

If you have any questions, or want to get attention for a PR or issue please reach out on the #logging-and-metrics channel in the cloudfoundry slack

Sums must be declared as monotonic in order to be represented in
prometheus as counters.

Note that this causes the otel collector to rename metrics when using
the prometheus exporter. Counters have `_total` appended to the name.

There are cases where counters aren't monotonic, in particular when
counters are emitted only as deltas (V1) and the counter totals are
reset in the Forwarder Agent.

Signed-off-by: Rebecca Roberts <robertsre@vmware.com>
@acrmp acrmp requested a review from a team as a code owner December 5, 2023 19:36
@acrmp acrmp marked this pull request as draft December 5, 2023 21:52
- Envelopes that are emitted only with a delta are decorated by the
  counter aggregator within Forwarder Agent to have both a delta and a
  total.
- The envelope totals are not monotonic as the Forwarder Agent will
  discard totals once the map of totals grows over a set size.
- Envelopes that are emitted only with totals will not have a delta
  present.

Signed-off-by: Andrew Crump <crumpan@vmware.com>
@acrmp acrmp marked this pull request as ready for review December 5, 2023 22:59
@acrmp acrmp merged commit bbbd515 into main Dec 6, 2023
7 checks passed
@acrmp acrmp deleted the otel-make-counters-monotonic branch December 6, 2023 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants