Skip to content

Commit 93ce165

Browse files
committed
add docs for @WithSpan params.
1 parent 722beb5 commit 93ce165

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

content/en/docs/zero-code/java/agent/annotations.md

+19
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,25 @@ types listed below, then the span will not be ended until the future completes.
8080
- [io.reactivex.Flowable](https://reactivex.io/RxJava/2.x/javadoc/index.html?io/reactivex/Flowable.html)
8181
- [io.reactivex.parallel.ParallelFlowable](https://reactivex.io/RxJava/2.x/javadoc/index.html?io/reactivex/parallel/ParallelFlowable.html)
8282

83+
### Parameters
84+
85+
The `@WithSpan` attribute supports two optional parameters to allow
86+
customization of spans:
87+
88+
| name | type | default | description |
89+
|------------------|-------------------|------------|----------------------------------------------------------------------------------------------------------------------------------------------|
90+
| `kind` | `SpanKind` (enum) | `INTERNAL` | The [kind of span](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#spankind). |
91+
| `inheritContext` | `boolean` | `true` | Since 2.14.0. Controls whether or not the new span will be parented in the existing (current) context. If `false`, a new context is created. |
92+
93+
Example parameter usage:
94+
95+
```java
96+
@WithSpan(kind = SpanKind.CLIENT, inheritContext = false)
97+
public void myMethod() {
98+
<...>
99+
}
100+
```
101+
83102
## Adding attributes to the span with `@SpanAttribute`
84103

85104
When a [span](/docs/concepts/signals/traces/#spans) is created for an annotated

0 commit comments

Comments
 (0)