-
Notifications
You must be signed in to change notification settings - Fork 843
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 probability to decision when appropriate #1116
Add probability to decision when appropriate #1116
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO, this must go through spec first, otherwise we risk coming up with incompatible definitions for these attributes relative to other languages.
You might add an entry in the |
@@ -125,5 +125,9 @@ | |||
/** JDBC substring like "mysql://db.example.com:3306" */ | |||
public static final StringAttributeSetter DB_URL = StringAttributeSetter.create("db.url"); | |||
|
|||
/** Probability value used by a probability-based Span sampling strategy. */ | |||
public static final DoubleAttributeSetter SAMPLING_PROBABILITY = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would put this in the SDK since it is SDK specific.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably also useful for vendor API implementations though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you give an example of how an API user would want to use this attribute?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jkwatson this is for the moment only in java so we cannot have it here. I would suggest two things:
- Open a PR in specs to add this
- Move it as internal member in probability sampler for the moment. and document that we need to follow the specs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, strong agree. I'll make it happen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Do you think there's a whole class of stuff that an alternate SDK implementation would want to use from the default SDK?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if that is the case, I am not sure we can have this in the API: Sampler is not part of the API (and explicitly removed from the API any "sampling" logic).
So I think this should be moved to SDK anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just wondering if there was going to be a need for some sort of "SDK Support" module that could contain this kind of thing. I'm not suggesting we do that now, though. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
open-telemetry/opentelemetry-specification#570 for the spec change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, moved into the SDK. PTAL, @bogdandrutu
@@ -125,5 +125,9 @@ | |||
/** JDBC substring like "mysql://db.example.com:3306" */ | |||
public static final StringAttributeSetter DB_URL = StringAttributeSetter.create("db.url"); | |||
|
|||
/** Probability value used by a probability-based Span sampling strategy. */ | |||
public static final DoubleAttributeSetter SAMPLING_PROBABILITY = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if that is the case, I am not sure we can have this in the API: Sampler is not part of the API (and explicitly removed from the API any "sampling" logic).
So I think this should be moved to SDK anyway.
Codecov Report
@@ Coverage Diff @@
## master #1116 +/- ##
============================================
+ Coverage 85.68% 85.73% +0.05%
- Complexity 1081 1082 +1
============================================
Files 138 138
Lines 3974 3981 +7
Branches 351 351
============================================
+ Hits 3405 3413 +8
+ Misses 427 426 -1
Partials 142 142
Continue to review full report at Codecov.
|
public static final DoubleAttributeSetter SAMPLING_PROBABILITY = | ||
DoubleAttributeSetter.create("sampling.probability"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I mentioned in a previous comment, I would make this internal in the Samplers
until a decision in the specs is made. I think this was the confusion from the other thread, but would not expose it for the moment, my comment there was that if we decide to expose it will definitely not going to be in the API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh yeah. I somehow spaced on that part of things. I'll move it in there for the nonce.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, please do it before merging :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also good to wait for @Oberon00 because they requested changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved into the Samplers, near the usage.
public static final DoubleAttributeSetter SAMPLING_PROBABILITY = | ||
DoubleAttributeSetter.create("sampling.probability"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, please do it before merging :)
@Oberon00 you requested changes. Are you ok with moving forward with this being an internal member for the moment until specs are written? |
@Oberon00 ping :) |
Thanks for the PR @jkwatson |
* add the sampling probability to the decision, when appropriate. * formatting * normalize a method name and move attribute to semantic convention attributes * move the sampling attribute to its own class in the SDK * Move the sampling priority attribute to a non-public spot
Resolves #1087
Does this look like what you're looking for, @pavolloffay ?