Skip to content

Commit

Permalink
Add code.stacktrace attribute (#435)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Wert <alexander.wert@elastic.co>
  • Loading branch information
AlexanderWert authored Nov 9, 2023
1 parent 65a3cc7 commit e3da931
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ release.

### Features

- Add `code.stacktrace` attribute
([#435](https://github.com/open-telemetry/semantic-conventions/pull/435))

### Fixes

## v1.23.0 (2023-11-03)
Expand Down
1 change: 1 addition & 0 deletions docs/attributes-registry/code.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ These attributes allow to report this unit of code and therefore to provide more
| `code.function` | string | The method or function name, or equivalent (usually rightmost part of the code unit's name). | `serveRequest` |
| `code.lineno` | int | The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. | `42` |
| `code.namespace` | string | The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. | `com.example.MyHttpService` |
| `code.stacktrace` | string | A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. | `at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n at com.example.GenerateTrace.main(GenerateTrace.java:5)` |
<!-- endsemconv -->
1 change: 1 addition & 0 deletions docs/general/attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ about the span.
| [`code.function`](../attributes-registry/code.md) | string | The method or function name, or equivalent (usually rightmost part of the code unit's name). | `serveRequest` | Recommended |
| [`code.lineno`](../attributes-registry/code.md) | int | The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. | `42` | Recommended |
| [`code.namespace`](../attributes-registry/code.md) | string | The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. | `com.example.MyHttpService` | Recommended |
| [`code.stacktrace`](../attributes-registry/code.md) | string | A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. | `at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n at com.example.GenerateTrace.main(GenerateTrace.java:5)` | Opt-In |
<!-- endsemconv -->

[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/document-status.md
2 changes: 2 additions & 0 deletions model/general.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ groups:
- ref: code.filepath
- ref: code.lineno
- ref: code.column
- ref: code.stacktrace
requirement_level: opt_in
8 changes: 8 additions & 0 deletions model/registry/code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,11 @@ groups:
brief: >
The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`.
examples: 16
- id: stacktrace
type: string
brief: >
A stacktrace as a string in the natural representation for the language runtime.
The representation is to be determined and documented by each language SIG.
examples: 'at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n
at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n
at com.example.GenerateTrace.main(GenerateTrace.java:5)'

0 comments on commit e3da931

Please sign in to comment.