@@ -164,15 +164,14 @@ Once a span has completed, it is immutable and can no longer be modified.
164
164
165
165
### Span Attributes
166
166
167
- Attributes are keys and values that are applied as metadata to your spans and
167
+ [ Attributes] are keys and values that are applied as metadata to your spans and
168
168
are useful for aggregating, filtering, and grouping traces. Attributes can be
169
169
added at span creation, or at any other time during the lifecycle of a span
170
170
before it has completed.
171
171
172
- Generally speaking, you should try to set attributes during span creation.
173
- This will incur less overhead compared to setting attributes after
174
- span creation, and also allow these attributes to factor into SDK sampling
175
- decisions.
172
+ Generally speaking, you should try to set attributes during span creation. This
173
+ will incur less overhead compared to setting attributes after span creation, and
174
+ also allow these attributes to factor into SDK sampling decisions.
176
175
177
176
The following example adds attributes at creation:
178
177
@@ -183,9 +182,8 @@ ctx, span = tracer.Start(ctx, "attributesAtCreation",
183
182
)
184
183
```
185
184
186
- If you need to set an attribute after creation, such as adding
187
- a value that isn't known until after the span is started, the
188
- following example shows how:
185
+ If you need to set an attribute after creation, such as adding a value that
186
+ isn't known until after the span is started, the following example shows how:
189
187
190
188
``` go
191
189
span.SetAttributes (
@@ -923,3 +921,4 @@ telemetry backends.
923
921
https://pkg.go.dev/go.opentelemetry.io/otel/sdk/metric
924
922
[ ` go.opentelemetry.io/otel/sdk/resource ` ] :
925
923
https://pkg.go.dev/go.opentelemetry.io/otel/sdk/resource
924
+ [ Attributes ] : /docs/concepts/signals/traces/#attributes
0 commit comments