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: Add sampler metrics #714

Merged
merged 2 commits into from
Jun 12, 2023
Merged

feat: Add sampler metrics #714

merged 2 commits into from
Jun 12, 2023

Conversation

kentquirk
Copy link
Contributor

@kentquirk kentquirk commented Jun 12, 2023

Which problem is this PR solving?

  • Adds sampler-specific metrics now that dynsampler-go supports them.

Short description of the changes

  • Add getMetricType function to get the type from a metric by its name. This is required because Metrics can only increment counters, not set them to a value, so we need to treat metrics ending in _count specially by keeping track of their previous value so we can get a delta.
  • Register all metrics provided by the sampler
  • Record them on every call to GetSampleRate
  • Add metrics to DeterministicSampler following the same pattern
  • Update rules to do the same (and add support for new downstream sampler types)

Closes #704.
Closes #554.

@kentquirk kentquirk requested a review from a team as a code owner June 12, 2023 19:58
@kentquirk kentquirk added this to the v2.0 milestone Jun 12, 2023
@kentquirk kentquirk merged commit a943a8d into main Jun 12, 2023
@kentquirk kentquirk deleted the kent.add_sampler_metrics branch June 12, 2023 20:40
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.

Add metrics from samplers Add maxkeys and keyspace size as metrics for dynamic samplers
2 participants