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

Does the sampler instance always need to return the same attributes per decision? #783

Closed
Oberon00 opened this issue Aug 11, 2020 · 3 comments · Fixed by #835
Closed

Does the sampler instance always need to return the same attributes per decision? #783

Oberon00 opened this issue Aug 11, 2020 · 3 comments · Fixed by #835
Labels
area:sampling Related to trace sampling area:sdk Related to the SDK release:after-ga Not required before GA release, and not going to work on before GA spec:trace Related to the specification/trace directory

Comments

@Oberon00
Copy link
Member

Related to #634.

In https://github.com/open-telemetry/opentelemetry-specification/blob/bc272ab52869df2145065d55300d721ff008e34b/specification/trace/sdk.md#shouldsample, the spec says:

The list of attributes returned by SamplingResult MUST be immutable. Caller may call this method any number of times and can safely cache the returned value.

I'm not sure what is meant by this. Does the same sampler instance always need to return the same attributes for the same decision? That would seem very restrictive. Or is this just specifying that the runtime instance returned needs to be immutable? If the latter, I think this is an implementation detail and should not be added to the specification, because it is language dependent. We also don't say for the attributes "string values must be copied so that modifications to them are not reflected on the Span", which would make sense e.g. for C++ with its modifiable std::strings.

CC @alolita, should I assign this to you too?

@Oberon00 Oberon00 added area:sdk Related to the SDK area:sampling Related to trace sampling spec:trace Related to the specification/trace directory labels Aug 11, 2020
@bogdandrutu
Copy link
Member

@Oberon00 it means the object returned is immutable, not that every time returns the same object.

@bogdandrutu
Copy link
Member

Happy to remove that, maybe over-specify :)

@Oberon00
Copy link
Member Author

I would be OK with removing it, but making more clear what is meant would also be fine.

@andrewhsu andrewhsu added the release:after-ga Not required before GA release, and not going to work on before GA label Aug 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:sampling Related to trace sampling area:sdk Related to the SDK release:after-ga Not required before GA release, and not going to work on before GA spec:trace Related to the specification/trace directory
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants