From e3da931d08a0f76af34afea2183d31ba081d8887 Mon Sep 17 00:00:00 2001 From: Alexander Wert Date: Thu, 9 Nov 2023 08:17:32 -0600 Subject: [PATCH] Add `code.stacktrace` attribute (#435) Signed-off-by: Alexander Wert --- CHANGELOG.md | 3 +++ docs/attributes-registry/code.md | 1 + docs/general/attributes.md | 1 + model/general.yaml | 2 ++ model/registry/code.yaml | 8 ++++++++ 5 files changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a1368259..136e4ed08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/docs/attributes-registry/code.md b/docs/attributes-registry/code.md index a337e239e..651caa99f 100644 --- a/docs/attributes-registry/code.md +++ b/docs/attributes-registry/code.md @@ -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)` | \ No newline at end of file diff --git a/docs/general/attributes.md b/docs/general/attributes.md index 59ec7e552..b18317a4f 100644 --- a/docs/general/attributes.md +++ b/docs/general/attributes.md @@ -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 | [DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/document-status.md diff --git a/model/general.yaml b/model/general.yaml index cfcce21ce..a4fcb77c6 100644 --- a/model/general.yaml +++ b/model/general.yaml @@ -53,3 +53,5 @@ groups: - ref: code.filepath - ref: code.lineno - ref: code.column + - ref: code.stacktrace + requirement_level: opt_in diff --git a/model/registry/code.yaml b/model/registry/code.yaml index 373a4bc6c..d5afceeae 100644 --- a/model/registry/code.yaml +++ b/model/registry/code.yaml @@ -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)'