Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Refactor the probabilistic sampler processor; add FailClosed configuration, prepare for OTEP 235 support #31946
Refactor the probabilistic sampler processor; add FailClosed configuration, prepare for OTEP 235 support #31946
Changes from 114 commits
e822a9b
1bc6017
d1fd891
85e4472
bb75f8a
6a57b77
7fa8130
36230e7
7bae35c
9010a67
0e27e40
efcdc3d
939c758
b9a1e56
a31266c
690cd64
c8baf29
7f47e4a
422e0b2
787b9fd
ed36f03
d795210
09000f7
a4d467b
e373b9b
fe6a085
396efb1
36de5dd
f1aa0ad
700734e
ae50bdd
a94b8e7
4edcbcb
53bf119
3cdb957
e506847
2cddfeb
f69d6ee
cc02934
1eecc4a
2159107
e0898a6
d0991ed
a002774
3a49922
fca0184
f11e0a4
3f495a6
581095c
7b8fd31
1a6be4f
712cf17
34c0d3b
7742668
8d60168
3779caa
c261ac1
34469e4
8dabf47
d44afb5
1cf9991
365d35d
12a3047
8655f42
468e6c6
23b4423
07841e5
6936bc4
c132f4c
bd13ac9
aa33b1c
06556dc
a4940e6
4f616e9
b4ca3aa
fdd26ac
b2d7504
fe20788
72f03e4
7fbe81a
252c568
f73994a
dddf03e
35f45d1
4282212
6162804
a0567cc
c51c90e
41ffde0
560f1a5
e5e29bc
7e48d0f
e33b28d
cdb359d
92561e6
83245cc
9fc8c3e
ea0773f
ab93f2f
7784b71
328cd9a
a95c83b
73588c1
434a560
8c60fca
08bf3f5
5e0ba11
9c1d6e2
f5a57a1
8fbf133
d98ff2f
af8f19c
1475569
95f5c13
b0fd487
b3f84ac
594852f
7abdf2d
2012193
d3abdd7
e331268
1ff0053
b937dbe
00ab52f
d2cde83
487aad8
1049de3
21ef16d
fecd75e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This would also deserve some explanation: what's a sampler here? It wasn't defined yet. Is this about chaining collectors together, where the first samples 100%, and the second 90%, and the assumption is that all those 80% would be within the 90%?
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.
See revised text. 594852f
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.
Alright -- I think we might want to make it easier to digest in the future, but let's wait for users to provide feedback.
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.
Perhaps add a link to the semconv?
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'm removing the "semantic convention" from the sentence. We don't have a semantic convention, and when I discovered the inconsistency documented here, I decided we probably don't need one. I'm just trying to preserver what's here, which doesn't make a lot of sense.
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.
Is there a reason for this mismatch?
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 very surprised by this. I have preserved the inconsistency and I am not sure what we should do about it.
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.
We could unify the solutions by varying behavior according to the type of the attribute. If numeric, it's the priority, and if a string, it's the name of the numeric attribute containing the priority.
Personally, I'd prefer to choose one for the long term, something like:
sampling.priority
is deprecated and that the logs behavior is desired.sampling.priority
, it is interpreted as the configured probability, but that a string value will be treated as the name of the attribute to be used for priority.It would be just as valid to do it the other way, if we preferred less configuration.
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 think this might be the perfect opportunity for this change, but not necessarily part of this PR.
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.
is this a change in behavior from the current implementation?
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.
The current implementation has an odd inconsistency which this is meant to resolve in a user-configurable way. In cases where there is no randomness, the sampling decision is fixed and therefore depends on the configured probability. For some probabilities, the failure would be open, and for other probabilities, the failure would be closed--depending on the hash seed.
I added this test to demonstrate:
So for empty TraceIDs (16 bytes of 0s) are sampled at 56.8% and above, and logs with missing attribute values (0 bytes) are sampled at 82.9% and above. Since I expect most users are configuring probabilities at 50% or below, most users would never see these items of telemetry and never knew there was a problem.
This is how I justify the decision to use FailClosed=true by default, because users would have had to be sampling above 56% to see these records before, with the default seed. I am open to both default values, but slightly prefer FailClosed=true.
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.
Sounds good!