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

rename some code attributes #1624

Merged
merged 24 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
df9f28f
rename things
SylvainJuge Nov 27, 2024
556dbd4
add changelog
SylvainJuge Nov 27, 2024
cc9c646
update schema-next.yaml
SylvainJuge Nov 27, 2024
528affe
fix changelog
SylvainJuge Nov 27, 2024
f86eb82
update markdown
SylvainJuge Nov 27, 2024
fe2bd7b
keep deprecated attributes for compatibility
SylvainJuge Nov 27, 2024
c15674d
Merge branch 'main' of github.com:open-telemetry/semantic-conventions…
SylvainJuge Dec 3, 2024
22c0413
update schema-next post 1.29 semconv release
SylvainJuge Dec 3, 2024
f27d311
Merge branch 'main' of github.com:open-telemetry/semantic-conventions…
SylvainJuge Dec 3, 2024
4262528
Merge branch 'main' into code-rename
lmolkova Dec 3, 2024
f5d4a27
Merge branch 'main' of github.com:open-telemetry/semantic-conventions…
SylvainJuge Dec 11, 2024
9303339
rename code.filepath to code.file.path
SylvainJuge Dec 11, 2024
feb012a
Merge branch 'main' into code-rename
lmolkova Dec 12, 2024
4fb9d03
Merge branch 'main' of github.com:open-telemetry/semantic-conventions…
SylvainJuge Dec 18, 2024
07c6660
add missing attribute in schema next
SylvainJuge Dec 18, 2024
0783448
update references to 'code.function'
SylvainJuge Dec 18, 2024
4ae0d44
update more references to code.filepath
SylvainJuge Dec 18, 2024
c108ab2
add warning to not migrate until stable
SylvainJuge Jan 2, 2025
dba322e
fix mising markdown ref
SylvainJuge Jan 2, 2025
70b3ed4
try to fix readme again
SylvainJuge Jan 2, 2025
627914d
Merge branch 'main' of github.com:open-telemetry/semantic-conventions…
SylvainJuge Jan 2, 2025
c523c56
Merge branch 'main' of github.com:open-telemetry/semantic-conventions…
SylvainJuge Jan 6, 2025
8e458ac
Apply suggestions from code review
SylvainJuge Jan 7, 2025
e75629a
Merge branch 'main' of github.com:open-telemetry/semantic-conventions…
SylvainJuge Jan 7, 2025
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
25 changes: 25 additions & 0 deletions .chloggen/code-rename.yaml
lmolkova marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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: breaking

# 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: rename `code.function`, `code.lineno` and `code.column`

# 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, 1599 ]

# (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: |
`code.function` renamed to `code.function.name`
`code.lineno` renamed to `code.line.number`
`code.column` renamed to `code.column.number`
23 changes: 18 additions & 5 deletions docs/attributes-registry/code.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,28 @@

# Code

- [Code Attributes](#code-attributes)
- [Deprecated Code Attributes](#deprecated-code-attributes)

## Code Attributes

These attributes allow to report this unit of code and therefore to provide more context about the span.
These attributes provide context about source code

| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
| <a id="code-column" href="#code-column">`code.column`</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-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-function" href="#code-function">`code.function`</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-lineno" href="#code-lineno">`code.lineno`</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` 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` | ![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) |
trask marked this conversation as resolved.
Show resolved Hide resolved
| <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) |
| <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 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)` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

## Deprecated Code Attributes

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-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` |
8 changes: 4 additions & 4 deletions docs/general/attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -489,11 +489,11 @@ about the span.

| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`code.column`](/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.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.function`](/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.lineno`](/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` 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` | ![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) |
| [`code.stacktrace`](/docs/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` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

<!-- markdownlint-restore -->
Expand Down
8 changes: 4 additions & 4 deletions model/code/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ groups:
- id: code
type: attribute_group
brief: >
These attributes allow to report this unit of code and therefore to provide more context about the span.
These attributes provide context about source code
attributes:
- ref: code.function
- ref: code.function.name
- ref: code.namespace
- ref: code.filepath
- ref: code.lineno
- ref: code.column
- ref: code.line.number
- ref: code.column.number
- ref: code.stacktrace
requirement_level: opt_in
28 changes: 28 additions & 0 deletions model/code/registry-deprecated.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
groups:
- id: registry.code.deprecated
type: attribute_group
display_name: Deprecated Code Attributes
brief: >
These deprecated attributes provide context about source code
attributes:
- id: code.function
type: string
stability: experimental
deprecated: Replaced by `code.function.name`
brief: >
Deprecated, use `code.function.name` instead
examples: serveRequest
- id: code.lineno
type: int
stability: experimental
deprecated: Replaced by `code.line.number`
brief: >
Deprecated, use `code.line.number` instead
examples: 42
- id: code.column
type: int
stability: experimental
deprecated: Replaced by `code.column.number`
brief: >
Deprecated, use `code.column.number`
examples: 16
12 changes: 6 additions & 6 deletions model/code/registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ groups:
type: attribute_group
display_name: Code Attributes
brief: >
These attributes allow to report this unit of code and therefore to provide more context about the span.
These attributes provide context about source code
attributes:
- id: code.function
- id: code.function.name
type: string
stability: experimental
brief: >
Expand All @@ -15,22 +15,22 @@ groups:
type: string
stability: experimental
brief: >
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.
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
type: string
stability: experimental
brief: >
The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path).
examples: /usr/local/MyApplication/content_root/app/index.php
- id: code.lineno
- id: code.line.number
lmolkova marked this conversation as resolved.
Show resolved Hide resolved
type: int
stability: experimental
brief: >
The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`.
examples: 42
- id: code.column
- id: code.column.number
type: int
stability: experimental
brief: >
Expand Down
8 changes: 8 additions & 0 deletions schema-next.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ file_format: 1.1.0
schema_url: https://opentelemetry.io/schemas/next
versions:
next:
all:
changes:
# https://github.com/open-telemetry/semantic-conventions/pull/1624
- rename_attributes:
attribute_map:
code.function: code.function.name
code.lineno: code.line.number
code.column: code.column.number
SylvainJuge marked this conversation as resolved.
Show resolved Hide resolved
1.29.0:
all:
changes:
Expand Down
Loading