Advice to provide attributes at span creation time
What needs to be changed? Tracing docs for all language should advice to provide attributes at span creation time, as opposed to providing it later, wherever feasible. https://github.com/open-telemetry/opentelemetry.io/pull/3927#discussion_r1475378395
What is the name + path of the page that needs changed? All.
Workshopping the text:
Attributes let you attach key/value pairs to a span so it carries more information about the current operation that it’s tracking.
There are two ways you can add attributes to a span - during creation, or after creation.
Generally speaking, you should try to add all attributes that you can during creation. This is so that you can use these attribute values to guide SDK sampling decisions, which are made only during span creation. If you can't feasibly add an attribute until after span creation, then that attribute cannot be used to influence an SDKsampling decision.
@cijothomas how do you feel about this wording? Note that I mentioned SDK sampling decision, since post-creation attributes can absolutely be used for tail-based sampling decisions.
Yes, it makes sense to call out that we are talking the Sampling in tracing SDK, not tail-based. Thanks!