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

Add metrics from samplers #704

Closed
kentquirk opened this issue Jun 5, 2023 · 0 comments · Fixed by #714
Closed

Add metrics from samplers #704

kentquirk opened this issue Jun 5, 2023 · 0 comments · Fixed by #714
Labels
type: enhancement New feature or request
Milestone

Comments

@kentquirk
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Supporting samplers is hard because they have no metrics and no visibility into their internal state. We'd like to be able to see some things like the size of the keyspace in the samplers.

Describe the solution you'd like

Samplers have metrics and Refinery reports those metrics

Additional context

This PR adds metrics support to dynsampler-go. Once that merges, Refinery could use it.

@kentquirk kentquirk added the type: enhancement New feature or request label Jun 5, 2023
@kentquirk kentquirk added this to the v2.0 milestone Jun 5, 2023
kentquirk added a commit that referenced this issue 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant