Skip to content

Commit

Permalink
rename code.filepath to code.file.path
Browse files Browse the repository at this point in the history
  • Loading branch information
SylvainJuge committed Dec 11, 2024
1 parent f5d4a27 commit 9303339
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .chloggen/code-rename.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ change_type: breaking
component: code

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: rename `code.function`, `code.lineno` and `code.column`
note: rename `code.function`, `code.lineno`, `code.column` and `code.filepath`

# 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.
Expand All @@ -23,3 +23,4 @@ subtext: |
`code.function` renamed to `code.function.name`
`code.lineno` renamed to `code.line.number`
`code.column` renamed to `code.column.number`
`code.filepath` renamed to `code.file.path`
3 changes: 2 additions & 1 deletion docs/attributes-registry/code.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ 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.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. | `16` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="code-filepath" href="#code-filepath">`code.filepath`</a> | string | The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). | `/usr/local/MyApplication/content_root/app/index.php` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <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). | `/usr/local/MyApplication/content_root/app/index.php` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="code-function-name" href="#code-function-name">`code.function.name`</a> | string | The method or function name, or equivalent (usually rightmost part of the code unit's name). | `serveRequest` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="code-line-number" href="#code-line-number">`code.line.number`</a> | int | The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. | `42` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="code-namespace" href="#code-namespace">`code.namespace`</a> | string | The "namespace" within which `code.function.name` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function.name` form a unique identifier for the code unit. | `com.example.MyHttpService` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
Expand All @@ -29,5 +29,6 @@ These deprecated attributes provide context about source code
| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
| <a id="code-column" href="#code-column">`code.column`</a> | int | Deprecated, use `code.column.number` | `16` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `code.column.number` |
| <a id="code-filepath" href="#code-filepath">`code.filepath`</a> | string | Deprecated, use `code.file.path` instead | `/usr/local/MyApplication/content_root/app/index.php` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="code-function" href="#code-function">`code.function`</a> | string | Deprecated, use `code.function.name` instead | `serveRequest` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `code.function.name` |
| <a id="code-lineno" href="#code-lineno">`code.lineno`</a> | int | Deprecated, use `code.line.number` instead | `42` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `code.line.number` |
2 changes: 1 addition & 1 deletion docs/general/attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ about the span.
| 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.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. | `16` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`code.filepath`](/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). | `/usr/local/MyApplication/content_root/app/index.php` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`code.filepath`](/docs/attributes-registry/code.md) | string | Deprecated, use `code.file.path` instead | `/usr/local/MyApplication/content_root/app/index.php` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`code.function.name`](/docs/attributes-registry/code.md) | string | The method or function name, or equivalent (usually rightmost part of the code unit's name). | `serveRequest` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`code.line.number`](/docs/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` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`code.namespace`](/docs/attributes-registry/code.md) | string | The "namespace" within which `code.function.name` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function.name` form a unique identifier for the code unit. | `com.example.MyHttpService` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
Expand Down
6 changes: 6 additions & 0 deletions model/code/registry-deprecated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ groups:
brief: >
Deprecated, use `code.function.name` instead
examples: serveRequest
- id: code.filepath
type: string
stability: experimental
brief: >
Deprecated, use `code.file.path` instead
examples: /usr/local/MyApplication/content_root/app/index.php
- id: code.lineno
type: int
stability: experimental
Expand Down
2 changes: 1 addition & 1 deletion model/code/registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ groups:
The "namespace" within which `code.function.name` is defined. Usually the qualified class or module name,
such that `code.namespace` + some separator + `code.function.name` form a unique identifier for the code unit.
examples: com.example.MyHttpService
- id: code.filepath
- id: code.file.path
type: string
stability: experimental
brief: >
Expand Down

0 comments on commit 9303339

Please sign in to comment.