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

Add docs for @WithSpan params. #6543

Merged
merged 9 commits into from
Mar 14, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions content/en/docs/zero-code/java/agent/annotations.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,25 @@ types listed below, then the span will not be ended until the future completes.
- [io.reactivex.Flowable](https://reactivex.io/RxJava/2.x/javadoc/index.html?io/reactivex/Flowable.html)
- [io.reactivex.parallel.ParallelFlowable](https://reactivex.io/RxJava/2.x/javadoc/index.html?io/reactivex/parallel/ParallelFlowable.html)

### Parameters

The `@WithSpan` attribute supports two optional parameters to allow
customization of spans:

| name | type | default | description |
|------------------|-------------------|------------|----------------------------------------------------------------------------------------------------------------------------------------------|
| `kind` | `SpanKind` (enum) | `INTERNAL` | The [kind of span](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#spankind). |
| `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. |

Example parameter usage:

```java
@WithSpan(kind = SpanKind.CLIENT, inheritContext = false)
public void myMethod() {
<...>
}
```

## Adding attributes to the span with `@SpanAttribute`

When a [span](/docs/concepts/signals/traces/#spans) is created for an annotated
Expand Down
4 changes: 4 additions & 0 deletions static/refcache.json
Original file line number Diff line number Diff line change
Expand Up @@ -9739,6 +9739,10 @@
"StatusCode": 206,
"LastSeen": "2025-02-06T02:17:59.999Z"
},
"https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#spankind": {
"StatusCode": 206,
"LastSeen": "2025-03-13T17:21:15.569829279Z"
},
"https://github.com/open-telemetry/opentelemetry-specification/blob/v1.14.0/specification/sdk-environment-variables.md#general-sdk-configuration": {
"StatusCode": 200,
"LastSeen": "2025-02-06T02:17:12.345Z"
Expand Down
Loading