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

An example / proof of concept for stratified sampling in OpenTelemetry.NET #4208

Merged

Conversation

kalyanaj
Copy link
Contributor

This is an example / proof of concept for a basic stratified sampling in OpenTelemetry.NET.
Fixes #4207

Changes

Certain customers using OpenTelemetry want to do achieve stratified sampling. Stratified sampling is a way to divide a population (e.g., "all queries to a service") into mutually exclusive sub-populations aka "strata". For example, the strata here could be "all user-initiated queries", "all programmatic queries". Each stratum is then sampled using a probabilistic sampling method. This ensures that all sub-populations are represented.

For significant contributions please make sure you have completed the following items:

  • Appropriate CHANGELOG.md updated for non-trivial changes
  • Design discussion issue #
  • Changes in public API reviewed

@kalyanaj kalyanaj requested a review from a team February 18, 2023 21:25
@codecov
Copy link

codecov bot commented Feb 18, 2023

Codecov Report

Merging #4208 (9985aee) into main (1b1e4e5) will increase coverage by 1.44%.
The diff coverage is n/a.

❗ Current head 9985aee differs from pull request most recent head 5c5b2bc. Consider uploading reports for the commit 5c5b2bc to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4208      +/-   ##
==========================================
+ Coverage   83.27%   84.72%   +1.44%     
==========================================
  Files         296      295       -1     
  Lines       11685    11475     -210     
==========================================
- Hits         9731     9722       -9     
+ Misses       1954     1753     -201     
Impacted Files Coverage Δ
...ZPages/Implementation/ZPagesExporterEventSource.cs 56.25% <0.00%> (-6.25%) ⬇️
...ter.ZPages/Implementation/ZPagesActivityTracker.cs 97.14% <0.00%> (-2.86%) ⬇️
...Telemetry/Internal/SelfDiagnosticsEventListener.cs 96.87% <0.00%> (-0.79%) ⬇️
...Telemetry/Metrics/MetricPointOptionalComponents.cs 100.00% <0.00%> (ø)
...emetry/Metrics/Exemplar/SimpleExemplarReservoir.cs
src/OpenTelemetry/Metrics/AggregatorStore.cs 80.97% <0.00%> (+0.65%) ⬆️
src/OpenTelemetry/Metrics/MetricPoint.cs 64.94% <0.00%> (+22.15%) ⬆️

Copy link
Member

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

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

LGTM. Couple of nits, not blockers

@cijothomas
Copy link
Member

@utpilla one more person proof reading would be good before merge.

@cijothomas cijothomas merged commit 735dd0d into open-telemetry:main Mar 3, 2023
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.

Need an example / proof of concept of how to achieve stratified sampling in OpenTelemetry.NET
6 participants