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

Store sampling.probability in sampled span attributes #2215

Closed

Conversation

pmm-sumo
Copy link
Contributor

Description:

Adds sampling.probability attribute to all spans sampled by probabilisticsamplerprocessor.

This makes it consistent with Java probabilisitic sampler design and the ongoing specification update

Probably, if this is going to be merged then after the specification PR gets accepted

Link to tracking Issue: Related specification change open-telemetry/opentelemetry-specification#570

Testing: Unit tests added

Documentation: README.md updated with description of attribute added

cc @Oberon00

@pmm-sumo pmm-sumo requested a review from a team November 25, 2020 19:53
@pmm-sumo pmm-sumo marked this pull request as draft November 25, 2020 19:55
@pmm-sumo
Copy link
Contributor Author

Since the linked PR is currently neither required-for-ga nor allowed-for-ga I am converting it to draft for the time being to not interfere with GA progress

@codecov
Copy link

codecov bot commented Nov 25, 2020

Codecov Report

Merging #2215 (ae407ee) into master (47ffc51) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2215      +/-   ##
==========================================
- Coverage   91.95%   91.92%   -0.03%     
==========================================
  Files         271      271              
  Lines       15664    15658       -6     
==========================================
- Hits        14404    14394      -10     
- Misses        857      860       +3     
- Partials      403      404       +1     
Impacted Files Coverage Δ
translator/conventions/opentelemetry.go 100.00% <ø> (ø)
...babilisticsamplerprocessor/probabilisticsampler.go 92.03% <100.00%> (+0.52%) ⬆️
internal/data/traceid.go 84.61% <0.00%> (-7.70%) ⬇️
exporter/exporterhelper/metricshelper.go 94.59% <0.00%> (-5.41%) ⬇️
exporter/otlpexporter/otlp.go 71.79% <0.00%> (-2.57%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 47ffc51...ae407ee. Read the comment docs.

samplingProbability := tsp.samplingProbability
attr, found := sampledSpanAttributes.Get(conventions.AttributeSamplingProbability)
if found && attr.Type() == pdata.AttributeValueDOUBLE {
samplingProbability *= attr.DoubleVal()
Copy link
Member

Choose a reason for hiding this comment

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

Is this really a multiplication here? I think it depends on the algorithm used, may be a min or multiplication.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2020

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Dec 4, 2020
@github-actions
Copy link
Contributor

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions bot closed this Dec 11, 2020
@Oberon00
Copy link
Member

@jkwatson I guess the probability attribute should be removed from Java for now, as it seems there is no agreement on adding it.

@pmm-sumo
Copy link
Contributor Author

pmm-sumo commented Dec 11, 2020

@jkwatson I guess the probability attribute should be removed from Java for now, as it seems there is no agreement on adding it.

@Oberon00 I think both this PR and the Spec PR were closed due to lack of recent activity rather than lack of agreement. Also, I think the discussion under the Spec PR mostly touches "how" of doing probability sampling rather than the need for sampling.probability tag (or lack of thereof). From my point of view - it is very usable for the backend. Perhaps worth bringing up during the next Spec SIG? Or reviving Sampling WG? (Even if that would be post-GA for tracing)

@Oberon00
Copy link
Member

I didn't mean to imply that people are against it, I don't think that's the case. The missing agreement (in form of approving reviews and a merge) seems to be due to lack of interest relative to other things currently in progress.

And I actually wanted to comment on the related spec PR which was also closed due to inactivity open-telemetry/opentelemetry-specification#570, but it kinda fits here too I guess 😃

@pmm-sumo
Copy link
Contributor Author

pmm-sumo commented Dec 11, 2020

@Oberon00 yeah, it's all towards getting the GA out and I agree that this might not be above the cutoff line of what's really important and what's not 😀

MovieStoreGuy pushed a commit to atlassian-forks/opentelemetry-collector that referenced this pull request Nov 11, 2021
hughesjj pushed a commit to hughesjj/opentelemetry-collector that referenced this pull request Apr 27, 2023
Troels51 pushed a commit to Troels51/opentelemetry-collector that referenced this pull request Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants