Skip to content

Add a section for OTel specific values in TraceState.#1852

Merged
jmacd merged 30 commits intoopen-telemetry:mainfrom
carlosalberto:trace_state_otel_values
Oct 15, 2021
Merged

Add a section for OTel specific values in TraceState.#1852
jmacd merged 30 commits intoopen-telemetry:mainfrom
carlosalberto:trace_state_otel_values

Conversation

@carlosalberto
Copy link
Copy Markdown
Contributor

Related to open-telemetry/oteps#168 as we want to be able to specify OTel-specific values how in tracestate (in the case of the aforementioned OTEP, as we want to store probability and a random number, for sampling purposes).

This is a draft for now, in order to get OTEP 168 make progress.

cc @yurishkuro

carlosalberto and others added 3 commits August 5, 2021 17:37
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
@carlosalberto
Copy link
Copy Markdown
Contributor Author

@yurishkuro Please review, as I've updated this PR based on your feedback ;)

@carlosalberto
Copy link
Copy Markdown
Contributor Author

carlosalberto commented Aug 19, 2021

@yurishkuro @Oberon00 Updated the document to use the same notation used by the TraceContext specification. Specific changes:

  1. Mentioned the entire list MUST NOT exceed 256 characters, as the related TraceContext's value section specifies.

  2. Keys are limited to two characters, mostly being alphanumeric (p, rs or t1, for example). I think this will give OTel concerns enough range of sub-keys. Otherwise, happy to change it.

  3. Values are limited to a-z / A-Z / 0-9 / "-" / "_" / "." - I think it makes sense to start with a small range of allowed characters, but have otherwise no opinion (will cc a few people who may know more).

  4. Did NOT put a limit on the sub values, as choosing anything feels rather random - should it be 10? Should it be 6? Should it be 4? For now, I only mentioned again that 256 is the maximum length for the entire list.

cc @dyladan @mwear

@carlosalberto
Copy link
Copy Markdown
Contributor Author

Hey @yurishkuro

Iterated and updated over this PR. Left a small note regarding SDKs being encouraged to discard a value update if it ends up exceeding the 256 char limit.

I would consider instead requiring API-only access, like SetInclusionProbabilityLog2(p). This may be a question for a different PR though

Agreed. Having such abstraction would be a good thing to have. I'd vow for specifying them in a follow up, once the foundation here is done (more specifically on the SetInclusionProbabilityLog2() operation (and such) operations, I imagine we defining them in their own concerns, way down the road).

A final note is that I feel now that this handling should be a SDK-wide part, more than a Trace one.

@carlosalberto
Copy link
Copy Markdown
Contributor Author

Updated the PR to reflect the latest feedback:

  • Mention that ONLY keys defined in the Specification should be used - instrumentation libraries and clients MUST use their own entry.
  • Upon updates, no order needs to be preserved.

Question: Should we really go back to otel as the entry key?

@carlosalberto
Copy link
Copy Markdown
Contributor Author

Ping @bogdandrutu - I think we are ready to go, unless you think there's something we need to tune still.

@github-actions
Copy link
Copy Markdown

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 Sep 29, 2021
@carlosalberto
Copy link
Copy Markdown
Contributor Author

Ping @Oberon00 @bogdandrutu - hopefully we can iterate on the remaining bits so this can be merged ;)

@jmacd jmacd merged commit ef6e2f4 into open-telemetry:main Oct 15, 2021
@carlosalberto carlosalberto deleted the trace_state_otel_values branch March 17, 2023 13:05
carlosalberto added a commit to carlosalberto/opentelemetry-specification that referenced this pull request Oct 31, 2024
…#1852)

* Add a section for OTel specific values in TraceState.

* Update specification/trace/api.md

Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>

* Update specification/trace/api.md

Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>

* Fix sample.

* Apply feedback.

* Use same notation as TraceContext.

* Remove unused OWS mention.

* Fix link.

* Update specification/trace/sdk.md

Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>

* Clarify values.

* Prevent larger than 256 char values.

* Fix typo.

* Update specification/trace/sdk.md

Co-authored-by: Christian Neumüller <christian+github@neumueller.me>

* Move trace state handling to its own document.

* Update specification/trace/tracestate-handling.md

Co-authored-by: John Watson <jkwatson@gmail.com>

* Fix lint.

* Apply feedback.

* Fix typo.

* s/SHOULD/MUST

* Update specification/trace/tracestate-handling.md

Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>

Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
Co-authored-by: Christian Neumüller <christian+github@neumueller.me>
Co-authored-by: John Watson <jkwatson@gmail.com>
Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
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.

9 participants