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

Feat/telemetry grouped counter #7

Merged
merged 8 commits into from
Dec 1, 2022
Merged

Conversation

codeflyer
Copy link
Contributor

Add a metric of type GROUPED_COUNT

      telemetry.createMetric('counter', 'COUNTER', METRIC_GROUPED_COUNT)

That can be updated using:

telemetry.increaseCountWithKey('counter', '{id="123"}')
telemetry.decreaseCountWithKey('counter', '{id="123"}')

end exports:

     # HELP counter_grouped_count_total COUNTER (grouped-count)
      # TYPE counter_grouped_count_total counter
      counter_grouped_count_total{id="123"} 1 now
      counter_grouped_count_total{id="456"} 2 now

Copy link

@simone-sanfratello simone-sanfratello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd add documentation for the new part

src/telemetry.js Outdated Show resolved Hide resolved
@codeflyer codeflyer merged commit f4d0535 into main Dec 1, 2022
@codeflyer codeflyer deleted the feat/telemetry-grouped-counter branch December 1, 2022 09:42
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