Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
22 changes: 22 additions & 0 deletions .chloggen/code-stable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Use this changelog template to create an entry for release notes.
#
# If your change doesn't affect end users you should instead start
# your pull request title with [chore] or use the "Skip Changelog" label.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
component: code

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Mark `code.*` semantic conventions as stable

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
# The values here must be integers.
issues: [ 1377 ]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
10 changes: 5 additions & 5 deletions docs/attributes-registry/code.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ These attributes provide context about source code

| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
| <a id="code-column-number" href="#code-column-number">`code.column.number`</a> | int | The column number in `code.file.path` best representing the operation. It SHOULD point within the code unit named in `code.function.name`. This attribute MUST NOT be used on the Profile signal since the data is already captured in 'message Line'. This constraint is imposed to prevent redundancy and maintain data integrity. | `16` | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| <a id="code-file-path" href="#code-file-path">`code.file.path`</a> | string | The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). This attribute MUST NOT be used on the Profile signal since the data is already captured in 'message Function'. This constraint is imposed to prevent redundancy and maintain data integrity. | `/usr/local/MyApplication/content_root/app/index.php` | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| <a id="code-function-name" href="#code-function-name">`code.function.name`</a> | string | The method or function fully-qualified name without arguments. The value should fit the natural representation of the language runtime, which is also likely the same used within `code.stacktrace` attribute value. This attribute MUST NOT be used on the Profile signal since the data is already captured in 'message Function'. This constraint is imposed to prevent redundancy and maintain data integrity. [1] | `com.example.MyHttpService.serveRequest`; `GuzzleHttp\Client::transfer`; `fopen` | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| <a id="code-line-number" href="#code-line-number">`code.line.number`</a> | int | The line number in `code.file.path` best representing the operation. It SHOULD point within the code unit named in `code.function.name`. This attribute MUST NOT be used on the Profile signal since the data is already captured in 'message Line'. This constraint is imposed to prevent redundancy and maintain data integrity. | `42` | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| <a id="code-stacktrace" href="#code-stacktrace">`code.stacktrace`</a> | string | A stacktrace as a string in the natural representation for the language runtime. The representation is identical to [`exception.stacktrace`](/docs/exceptions/exceptions-spans.md#stacktrace-representation). This attribute MUST NOT be used on the Profile signal since the data is already captured in 'message Location'. This constraint is imposed to prevent redundancy and maintain data integrity. | `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)` | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| <a id="code-column-number" href="#code-column-number">`code.column.number`</a> | int | The column number in `code.file.path` best representing the operation. It SHOULD point within the code unit named in `code.function.name`. This attribute MUST NOT be used on the Profile signal since the data is already captured in 'message Line'. This constraint is imposed to prevent redundancy and maintain data integrity. | `16` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| <a id="code-file-path" href="#code-file-path">`code.file.path`</a> | string | The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). This attribute MUST NOT be used on the Profile signal since the data is already captured in 'message Function'. This constraint is imposed to prevent redundancy and maintain data integrity. | `/usr/local/MyApplication/content_root/app/index.php` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| <a id="code-function-name" href="#code-function-name">`code.function.name`</a> | string | The method or function fully-qualified name without arguments. The value should fit the natural representation of the language runtime, which is also likely the same used within `code.stacktrace` attribute value. This attribute MUST NOT be used on the Profile signal since the data is already captured in 'message Function'. This constraint is imposed to prevent redundancy and maintain data integrity. [1] | `com.example.MyHttpService.serveRequest`; `GuzzleHttp\Client::transfer`; `fopen` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| <a id="code-line-number" href="#code-line-number">`code.line.number`</a> | int | The line number in `code.file.path` best representing the operation. It SHOULD point within the code unit named in `code.function.name`. This attribute MUST NOT be used on the Profile signal since the data is already captured in 'message Line'. This constraint is imposed to prevent redundancy and maintain data integrity. | `42` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| <a id="code-stacktrace" href="#code-stacktrace">`code.stacktrace`</a> | string | A stacktrace as a string in the natural representation for the language runtime. The representation is identical to [`exception.stacktrace`](/docs/exceptions/exceptions-spans.md#stacktrace-representation). This attribute MUST NOT be used on the Profile signal since the data is already captured in 'message Location'. This constraint is imposed to prevent redundancy and maintain data integrity. | `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)` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

**[1] `code.function.name`:** Values and format depends on each language runtime, thus it is impossible to provide an exhaustive list of examples.
The values are usually the same (or prefixes of) the ones found in native stack trace representation stored in
Expand Down
21 changes: 6 additions & 15 deletions docs/code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,10 @@ linkTitle: Code

# Semantic conventions for code

**Status**: [Release Candidate][DocumentStatus]
**Status**: [Stable][DocumentStatus]

This document defines semantic conventions for source code.

> **Warning**
>
> Existing code instrumentations that are using
> [v1.29.0 of `code` conventions](https://github.com/open-telemetry/semantic-conventions/blob/v1.29.0/docs/attributes-registry/code.md)
> (or prior):
>
> * SHOULD NOT change the version of the `code` conventions that they emit by default
> until the `code` semantic conventions are marked stable.

## Attributes

<!-- semconv code -->
Expand All @@ -28,11 +19,11 @@ This document defines semantic conventions for source code.

| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`code.column.number`](/docs/attributes-registry/code.md) | int | The column number in `code.file.path` best representing the operation. It SHOULD point within the code unit named in `code.function.name`. This attribute MUST NOT be used on the Profile signal since the data is already captured in 'message Line'. This constraint is imposed to prevent redundancy and maintain data integrity. | `16` | `Recommended` | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| [`code.file.path`](/docs/attributes-registry/code.md) | string | The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). This attribute MUST NOT be used on the Profile signal since the data is already captured in 'message Function'. This constraint is imposed to prevent redundancy and maintain data integrity. | `/usr/local/MyApplication/content_root/app/index.php` | `Recommended` | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| [`code.function.name`](/docs/attributes-registry/code.md) | string | The method or function fully-qualified name without arguments. The value should fit the natural representation of the language runtime, which is also likely the same used within `code.stacktrace` attribute value. This attribute MUST NOT be used on the Profile signal since the data is already captured in 'message Function'. This constraint is imposed to prevent redundancy and maintain data integrity. [1] | `com.example.MyHttpService.serveRequest`; `GuzzleHttp\Client::transfer`; `fopen` | `Recommended` | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| [`code.line.number`](/docs/attributes-registry/code.md) | int | The line number in `code.file.path` best representing the operation. It SHOULD point within the code unit named in `code.function.name`. This attribute MUST NOT be used on the Profile signal since the data is already captured in 'message Line'. This constraint is imposed to prevent redundancy and maintain data integrity. | `42` | `Recommended` | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| [`code.stacktrace`](/docs/attributes-registry/code.md) | string | A stacktrace as a string in the natural representation for the language runtime. The representation is identical to [`exception.stacktrace`](/docs/exceptions/exceptions-spans.md#stacktrace-representation). This attribute MUST NOT be used on the Profile signal since the data is already captured in 'message Location'. This constraint is imposed to prevent redundancy and maintain data integrity. | `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` | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| [`code.column.number`](/docs/attributes-registry/code.md) | int | The column number in `code.file.path` best representing the operation. It SHOULD point within the code unit named in `code.function.name`. This attribute MUST NOT be used on the Profile signal since the data is already captured in 'message Line'. This constraint is imposed to prevent redundancy and maintain data integrity. | `16` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`code.file.path`](/docs/attributes-registry/code.md) | string | The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). This attribute MUST NOT be used on the Profile signal since the data is already captured in 'message Function'. This constraint is imposed to prevent redundancy and maintain data integrity. | `/usr/local/MyApplication/content_root/app/index.php` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`code.function.name`](/docs/attributes-registry/code.md) | string | The method or function fully-qualified name without arguments. The value should fit the natural representation of the language runtime, which is also likely the same used within `code.stacktrace` attribute value. This attribute MUST NOT be used on the Profile signal since the data is already captured in 'message Function'. This constraint is imposed to prevent redundancy and maintain data integrity. [1] | `com.example.MyHttpService.serveRequest`; `GuzzleHttp\Client::transfer`; `fopen` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`code.line.number`](/docs/attributes-registry/code.md) | int | The line number in `code.file.path` best representing the operation. It SHOULD point within the code unit named in `code.function.name`. This attribute MUST NOT be used on the Profile signal since the data is already captured in 'message Line'. This constraint is imposed to prevent redundancy and maintain data integrity. | `42` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`code.stacktrace`](/docs/attributes-registry/code.md) | string | A stacktrace as a string in the natural representation for the language runtime. The representation is identical to [`exception.stacktrace`](/docs/exceptions/exceptions-spans.md#stacktrace-representation). This attribute MUST NOT be used on the Profile signal since the data is already captured in 'message Location'. This constraint is imposed to prevent redundancy and maintain data integrity. | `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` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

**[1] `code.function.name`:** Values and format depends on each language runtime, thus it is impossible to provide an exhaustive list of examples.
The values are usually the same (or prefixes of) the ones found in native stack trace representation stored in
Expand Down
10 changes: 5 additions & 5 deletions model/code/registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ groups:
attributes:
- id: code.function.name
type: string
stability: release_candidate
stability: stable
brief: >
The method or function fully-qualified name without arguments. The value should fit the natural representation of the language
runtime, which is also likely the same used within `code.stacktrace` attribute value.
Expand All @@ -34,28 +34,28 @@ groups:
* C function: `fopen`
- id: code.file.path
type: string
stability: release_candidate
stability: stable
brief: >
The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path).
This attribute MUST NOT be used on the Profile signal since the data is already captured in 'message Function'. This constraint is imposed to prevent redundancy and maintain data integrity.
examples: /usr/local/MyApplication/content_root/app/index.php
- id: code.line.number
type: int
stability: release_candidate
stability: stable
brief: >
The line number in `code.file.path` best representing the operation. It SHOULD point within the code unit named in `code.function.name`.
This attribute MUST NOT be used on the Profile signal since the data is already captured in 'message Line'. This constraint is imposed to prevent redundancy and maintain data integrity.
examples: 42
- id: code.column.number
type: int
stability: release_candidate
stability: stable
brief: >
The column number in `code.file.path` best representing the operation. It SHOULD point within the code unit named in `code.function.name`.
This attribute MUST NOT be used on the Profile signal since the data is already captured in 'message Line'. This constraint is imposed to prevent redundancy and maintain data integrity.
examples: 16
- id: code.stacktrace
type: string
stability: release_candidate
stability: stable
brief: >
A stacktrace as a string in the natural representation for the language runtime.
The representation is identical to [`exception.stacktrace`](/docs/exceptions/exceptions-spans.md#stacktrace-representation).
Expand Down
Loading