diff --git a/.chloggen/1112.yaml b/.chloggen/1112.yaml deleted file mode 100644 index 454aa19d76..0000000000 --- a/.chloggen/1112.yaml +++ /dev/null @@ -1,4 +0,0 @@ -change_type: enhancement -component: messaging -note: Define span kind for unspecified cases of messaging `publish` and `process` spans. -issues: [1112] diff --git a/.chloggen/1290.yaml b/.chloggen/1290.yaml deleted file mode 100644 index c9b4d85bfa..0000000000 --- a/.chloggen/1290.yaml +++ /dev/null @@ -1,4 +0,0 @@ -change_type: enhancement -component: db -note: Change description of `db.client.connection.pending_requests` from cumulative to current value -issues: [ 1290 ] diff --git a/.chloggen/1302.yaml b/.chloggen/1302.yaml deleted file mode 100644 index 4f2cc12296..0000000000 --- a/.chloggen/1302.yaml +++ /dev/null @@ -1,4 +0,0 @@ -change_type: enhancement -component: docs -note: Add note on tooling limitations for attribute names and enforce name format. -issues: [1124] diff --git a/.chloggen/1330.yaml b/.chloggen/1330.yaml deleted file mode 100644 index ec0d7fb8ee..0000000000 --- a/.chloggen/1330.yaml +++ /dev/null @@ -1,4 +0,0 @@ -change_type: enhancement -component: az, db -note: Define `db.operation.name` values for Cosmos DB, declare `az.namespace` attribute and add proper reference to it. -issues: [1330] diff --git a/.chloggen/1393.yaml b/.chloggen/1393.yaml new file mode 100644 index 0000000000..c62971bbc9 --- /dev/null +++ b/.chloggen/1393.yaml @@ -0,0 +1,4 @@ +change_type: enhancement +component: gen_ai +note: Add system-specific conventions for Azure AI Inference. +issues: [1393] diff --git a/.chloggen/2921.yaml b/.chloggen/2921.yaml deleted file mode 100644 index e26eb173a4..0000000000 --- a/.chloggen/2921.yaml +++ /dev/null @@ -1,30 +0,0 @@ -# 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: other - -# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Update resource to include stability in the YAML file - -# 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: [1399] - -# (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: | - Makes the following changes: - - - Require `name` on resource groups. - - Enforce backwards compatibility stability requirements on resource groups. - - Rename `telemetry` to `telemetry.sdk`, attributes are unchanged. - - Mark `telemetry.sdk` and `resource` as stable in YAML model. - - Markdown templates for resource groups NOW includes header describing - the reosurce `type`, `stability` and `description`. diff --git a/.chloggen/993.yaml b/.chloggen/993.yaml deleted file mode 100755 index a4a55ace39..0000000000 --- a/.chloggen/993.yaml +++ /dev/null @@ -1,4 +0,0 @@ -change_type: enhancement -component: process -note: Add additional process fields from ECS -issues: [993] diff --git a/.chloggen/add_container_cpu_usage.yaml b/.chloggen/add_container_cpu_usage.yaml deleted file mode 100755 index c1c4706b97..0000000000 --- a/.chloggen/add_container_cpu_usage.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# 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: container - -# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Add container.cpu.usage metric - -# 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: [1128] - -# (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: diff --git a/.chloggen/add_container_csi_attributes.yaml b/.chloggen/add_container_csi_attributes.yaml deleted file mode 100644 index 8bcfe8a961..0000000000 --- a/.chloggen/add_container_csi_attributes.yaml +++ /dev/null @@ -1,7 +0,0 @@ -change_type: enhancement -component: container -note: >- - Add CSI (Container Storage Interface) attributes: - `container.csi.plugin.name` and `container.csi.volume.id`. -issues: [1119] -subtext: diff --git a/.chloggen/add_filesystem_limit.yaml b/.chloggen/add_filesystem_limit.yaml deleted file mode 100755 index 36228d7da0..0000000000 --- a/.chloggen/add_filesystem_limit.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# 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: system - -# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Add the `system.filesystem.limit` metric - -# 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: [127] - -# (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: diff --git a/.chloggen/add_k8s_cpu_metrics.yaml b/.chloggen/add_k8s_cpu_metrics.yaml deleted file mode 100755 index fe52d97d1c..0000000000 --- a/.chloggen/add_k8s_cpu_metrics.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# 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: k8s - -# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Add `k8s.pod.cpu.time`, `k8s.pod.cpu.usage`, `k8s.node.cpu.time`, `k8s.node.cpu.usage` metrics - -# 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: [1320] - -# (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: diff --git a/.chloggen/add_k8s_memory_usage.yaml b/.chloggen/add_k8s_memory_usage.yaml deleted file mode 100755 index a57b9d7f42..0000000000 --- a/.chloggen/add_k8s_memory_usage.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# 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: k8s - -# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Add k8s.pod.memory usage and k8s.node.memory.usage metrics - -# 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: [1406] - -# (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: diff --git a/.chloggen/add_k8s_volume_type.yaml b/.chloggen/add_k8s_volume_type.yaml deleted file mode 100755 index c9be5f9027..0000000000 --- a/.chloggen/add_k8s_volume_type.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# 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: k8s - -# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Adds `k8s.volume.name` and `k8s.volume.type` attributes to the registry - -# 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: [1164] - -# (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: diff --git a/.chloggen/add_lookup_for_os.yaml b/.chloggen/add_lookup_for_os.yaml deleted file mode 100644 index 8c709d0de0..0000000000 --- a/.chloggen/add_lookup_for_os.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# 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: os - -# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: add lookup for os.build_id - -# 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: [1318] - -# (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: diff --git a/.chloggen/add_system_disk_limit.yaml b/.chloggen/add_paging_device_attr.yaml similarity index 90% rename from .chloggen/add_system_disk_limit.yaml rename to .chloggen/add_paging_device_attr.yaml index 51d8b29b17..7937ed28f6 100755 --- a/.chloggen/add_system_disk_limit.yaml +++ b/.chloggen/add_paging_device_attr.yaml @@ -4,17 +4,17 @@ # your pull request title with [chore] or use the "Skip Changelog" label. # One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' -change_type: 'enhancement' +change_type: 'breaking' # The name of the area of concern in the attributes-registry, (e.g. http, cloud, db) component: system # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Add the `system.disk.limit` metric +note: Add system.device attribute to system paging metrics # 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: [127] +issues: [1408] # (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. diff --git a/.chloggen/clr-runtime.yaml b/.chloggen/clr-runtime.yaml deleted file mode 100644 index ecad868a1c..0000000000 --- a/.chloggen/clr-runtime.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# 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: new_component - -# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db) -component: dotnet - -# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Adds experimental metrics for the .NET Common Language Runtime (CLR)." - -# 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: [956] - -# (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: diff --git a/.chloggen/file_leftovers.yaml b/.chloggen/file_leftovers.yaml deleted file mode 100755 index 099d6d9e3c..0000000000 --- a/.chloggen/file_leftovers.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# 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: file - -# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Add additional attributes from ECS to the `file` namespace. - -# 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: [914] - -# (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: diff --git a/.chloggen/fix-deprecated-messaging-servicebus.yaml b/.chloggen/fix-deprecated-messaging-servicebus.yaml deleted file mode 100755 index 996b4a4deb..0000000000 --- a/.chloggen/fix-deprecated-messaging-servicebus.yaml +++ /dev/null @@ -1,4 +0,0 @@ -change_type: 'bug_fix' -component: messaging -note: Fix deprecated note for service bus attributes -issues: [1418] diff --git a/.chloggen/fix_docker_link.yaml b/.chloggen/fix_docker_link.yaml deleted file mode 100755 index 4fb908699a..0000000000 --- a/.chloggen/fix_docker_link.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# 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: bug_fix - -# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db) -component: container - -# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Fixes broken link - -# 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: [1332] - -# (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: diff --git a/.chloggen/make_cpu_util_optin.yaml b/.chloggen/make_cpu_util_optin.yaml deleted file mode 100755 index 80f7d5cb72..0000000000 --- a/.chloggen/make_cpu_util_optin.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# 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: system - -# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Make system.cpu.utilization and process.cpu.utilization opt-in - -# 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: [1130] - -# (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: diff --git a/.chloggen/messaging-parent-child-trace.yaml b/.chloggen/messaging-parent-child-trace.yaml deleted file mode 100755 index 6cf1fd1c10..0000000000 --- a/.chloggen/messaging-parent-child-trace.yaml +++ /dev/null @@ -1,4 +0,0 @@ -change_type: enhancement -component: messaging -note: Clarify the possibility to have a parent-child trace structure in messaging conventions -issues: [1282] diff --git a/.chloggen/nodejs-runtime-utilization.yaml b/.chloggen/nodejs-runtime-utilization.yaml deleted file mode 100644 index a0a2272770..0000000000 --- a/.chloggen/nodejs-runtime-utilization.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# 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: nodejs - -# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Adding `nodejs.eventloop.time` metric to Node.js runtime metrics. - -# 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: [1259] diff --git a/.chloggen/process-build_id.yaml b/.chloggen/process-build_id.yaml deleted file mode 100755 index c59e5fc7bb..0000000000 --- a/.chloggen/process-build_id.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# 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: process - -# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Extend process.executable with build_id attributes. - -# 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: [1329] - -# (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: For correct symbolization it is important to uniquely identify executables. diff --git a/.chloggen/profiles-convention.yaml b/.chloggen/profiles-convention.yaml deleted file mode 100755 index d778733484..0000000000 --- a/.chloggen/profiles-convention.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# 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: new_component - -# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db) -component: profile - -# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Introduce semantic convention for OTel Profiles. - -# 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: [1188] - -# (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: diff --git a/.chloggen/remove_body_field_ref.yaml b/.chloggen/remove_body_field_ref.yaml deleted file mode 100644 index d1ae09f088..0000000000 --- a/.chloggen/remove_body_field_ref.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# 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: deprecation - -# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db) -component: event - -# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Remove support for the event `fields` supporting referencing / inheriting fields from global attributes. - -# 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: [1341] - -# (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: diff --git a/.chloggen/update-graphql-span-name.yaml b/.chloggen/update-graphql-span-name.yaml new file mode 100644 index 0000000000..1f0cc3f50e --- /dev/null +++ b/.chloggen/update-graphql-span-name.yaml @@ -0,0 +1,4 @@ +change_type: breaking +component: graphql +note: Update the GraphQL Span name convention +issues: [1361] diff --git a/.chloggen/updete_host.id_lookup.yaml b/.chloggen/updete_host.id_lookup.yaml deleted file mode 100644 index 133269633e..0000000000 --- a/.chloggen/updete_host.id_lookup.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# 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: host - -# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: update lookup for os.build_id - -# 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: [1396] - -# (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: diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index d0efd84320..e4e6d6b430 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -30,6 +30,7 @@ body: - area:client - area:cloud - area:cloudevents + - area:cloudfoundry - area:code - area:container - area:cpu diff --git a/.github/ISSUE_TEMPLATE/change_proposal.yaml b/.github/ISSUE_TEMPLATE/change_proposal.yaml index 206cc1c715..4c9316ddf1 100644 --- a/.github/ISSUE_TEMPLATE/change_proposal.yaml +++ b/.github/ISSUE_TEMPLATE/change_proposal.yaml @@ -22,6 +22,7 @@ body: - area:client - area:cloud - area:cloudevents + - area:cloudfoundry - area:code - area:container - area:cpu diff --git a/.github/ISSUE_TEMPLATE/new-conventions.yaml b/.github/ISSUE_TEMPLATE/new-conventions.yaml index 1c9cfe8ef9..e6e543158e 100644 --- a/.github/ISSUE_TEMPLATE/new-conventions.yaml +++ b/.github/ISSUE_TEMPLATE/new-conventions.yaml @@ -31,6 +31,7 @@ body: - area:client - area:cloud - area:cloudevents + - area:cloudfoundry - area:code - area:container - area:cpu diff --git a/.github/workflows/generate-registry-area-labels.yml b/.github/workflows/generate-registry-area-labels.yml index 1b8ea3a59d..e59c0c6e8b 100644 --- a/.github/workflows/generate-registry-area-labels.yml +++ b/.github/workflows/generate-registry-area-labels.yml @@ -5,7 +5,7 @@ on: paths: - model/** - ./.github/workflows/generate-registry-area-labels.yml - - ./.github/workflows/scripts/generate-registry-area-labels.sh + - ./internal/tools/scripts/generate-registry-area-labels.sh workflow_dispatch: @@ -15,14 +15,11 @@ jobs: if: ${{ github.repository_owner == 'open-telemetry' }} steps: - uses: actions/checkout@v4 + + # areas.txt is generated by the Make target generate-gh-issue-templates - name: Generate registry area labels run: | make generate-gh-issue-templates - - - name: Run update permissions - run: chmod +x ./.github/workflows/scripts/generate-registry-area-labels.sh - - - name: Generate registry area labels - run: ./.github/workflows/scripts/generate-registry-area-labels.sh + ./internal/tools/scripts/generate-registry-area-labels.sh ./internal/tools/bin/areas.txt env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 6aae34d1d4..a9498fcc34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,73 @@ +## v1.28.0 + +### πŸ›‘ Breaking changes πŸ›‘ + +- `database`: Add new `db.response.status_code` attribute, deprecate `db.cosmos.status_code`. (#1424) +- `gen_ai`: Deprecate `gen_ai.prompt` and `gen_ai.completion` attributes, introduce log-based events for GenAI inputs and outputs. (#834, #980) +- `system`: Make `system.cpu.utilization` and `process.cpu.utilization` opt-in (#1130) +- `messaging`: Mark `*.size` messaging attributes as opt-in (#474) + +### 🚩 Deprecations 🚩 + +- `event`: Remove support for the event `fields` supporting referencing / inheriting fields from global attributes. (#1341) + +### πŸš€ New components πŸš€ + +- `cloudfoundry`: Adds a resource convention for Cloud Foundry applications and system components. (#622, #624) + Introduces a description for CloudFoundry resources. These can either be + applications deployed on the runtime or system components of Cloud Foundry + itself. It also extends to the runtime logs and metrics, e.g. Gorouter access + logs and container metrics. + +- `dotnet`: Adds experimental metrics for the .NET Common Language Runtime (CLR). (#956) +- `profile`: Introduce semantic convention for OTel Profiles. (#1188) + +### πŸ’‘ Enhancements πŸ’‘ + +- `db`: Mark database semantic conventions as release candidate (#1101) +- `messaging`: Define span kind for unspecified cases of messaging `publish` and `process` spans. (#1112) +- `db`: Change description of `db.client.connection.pending_requests` from cumulative to current value (#1290) +- `docs`: Add note on tooling limitations for attribute names and enforce name format. (#1124) +- `az, db`: Define `db.operation.name` values for Cosmos DB, declare `az.namespace` attribute and add proper reference to it. (#1330) +- `db`: Recommend to capture `db.namespace` from initial connection over not capturing any, also specify `db.namespace` value for PostgreSQL, MySQL and MariaDB (#1437) +- `messaging`: Add recommendation to report "Create" spans for batch send calls only and to allow to disable "Create" spans. + (#1273) +- `other`: Update resource to include stability in the YAML file (#1399) + Makes the following changes: + + - Require `name` on resource groups. + - Enforce backwards compatibility stability requirements on resource groups. + - Rename `telemetry` to `telemetry.sdk`, attributes are unchanged. + - Mark `telemetry.sdk` and `resource` as stable in YAML model. + - Markdown templates for resource groups NOW includes header describing + the resource `type`, `stability` and `description`. + +- `process`: Add additional process fields from ECS (#993) +- `container`: Add `container.cpu.usage` metric (#1128) +- `container`: Add CSI (Container Storage Interface) attributes: `container.csi.plugin.name` and `container.csi.volume.id`. (#1119) +- `system`: Add the `system.filesystem.limit` metric (#127) +- `k8s`: Add `k8s.pod.cpu.time`, `k8s.pod.cpu.usage`, `k8s.node.cpu.time`, `k8s.node.cpu.usage` metrics (#1320) +- `k8s`: Add k8s.pod.memory usage and k8s.node.memory.usage metrics (#1406) +- `k8s`: Adds `k8s.volume.name` and `k8s.volume.type` attributes to the registry (#1164) +- `os`: add lookup for `os.build_id` (#1318) +- `gen_ai`: Add system specific conventions for OpenAI. (#1370) +- `system`: Add the `system.disk.limit` metric (#127) +- `file`: Add additional attributes from ECS to the `file` namespace. (#914) +- `messaging`: Clarify the possibility to have a parent-child trace structure in messaging conventions (#1282) +- `nodejs`: Adding `nodejs.eventloop.time` metric to Node.js runtime metrics. (#1259) +- `process`: Extend process.executable with build_id attributes. (#1329) + For correct symbolization it is important to uniquely identify executables. +- `messaging`: Change messaging.operation.type = publish to messaging.operation.type = send (#1285) +- `host`: update lookup for os.build_id (#1396) + +### 🧰 Bug fixes 🧰 + +- `messaging`: Fix deprecated note for service bus attributes (#1418) +- `container`: Fixes broken link (#1332) + ## 1.27.0 ### πŸ›‘ Breaking changes πŸ›‘ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 27a66ed954..e91fa46805 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -404,6 +404,6 @@ exists in some form in ECS, consider the following guidelines: entirely. See the [ECS field reference] for existing namespaces. [nvm]: https://github.com/nvm-sh/nvm/blob/master/README.md#installing-and-updating -[stability guarantees]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.35.0/specification/versioning-and-stability.md#semantic-conventions-stability +[stability guarantees]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.37.0/specification/versioning-and-stability.md#semantic-conventions-stability [otep222]: https://github.com/open-telemetry/oteps/pull/222 [ECS field reference]: https://www.elastic.co/guide/en/ecs/current/ecs-field-reference.html diff --git a/Makefile b/Makefile index 3f9eba31c4..26e7a2cf83 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ else SED := sed endif -TOOLS_DIR := ./internal/tools +TOOLS_DIR := $(PWD)/internal/tools MISSPELL_BINARY=bin/misspell MISSPELL = $(TOOLS_DIR)/$(MISSPELL_BINARY) @@ -150,12 +150,12 @@ table-check: --mount 'type=bind,source=$(PWD)/model,target=/home/weaver/source,readonly' \ --mount 'type=bind,source=$(PWD)/docs,target=/home/weaver/target,readonly' \ $(WEAVER_CONTAINER) registry update-markdown \ - --registry=/home/weaver/target \ + --registry=/home/weaver/source \ --attribute-registry-base-url=/docs/attributes-registry \ --templates=/home/weaver/templates \ --target=markdown \ --dry-run \ - /spec + /home/weaver/target .PHONY: schema-check schema-check: diff --git a/README.md b/README.md index 7d7d68c7d8..6227be7ca2 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Checks](https://github.com/open-telemetry/semantic-conventions/workflows/Checks/badge.svg?branch=main)](https://github.com/open-telemetry/semantic-conventions/actions?query=workflow%3A%22Checks%22+branch%3Amain) [![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/open-telemetry/semantic-conventions.svg?logo=opentelemetry&&color=f5a800&label=Latest%20release)](https://github.com/open-telemetry/semantic-conventions/releases/latest) -[![Specification Version](https://img.shields.io/badge/OTel_specification_version-v1.35.0-blue?logo=opentelemetry&color=f5a800)](https://github.com/open-telemetry/opentelemetry-specification/releases/tag/v1.35.0) +[![Specification Version](https://img.shields.io/badge/OTel_specification_version-v1.37.0-blue?logo=opentelemetry&color=f5a800)](https://github.com/open-telemetry/opentelemetry-specification/releases/tag/v1.37.0) Semantic Conventions define a common set of (semantic) attributes which provide meaning to data when collecting, producing and consuming it. @@ -34,6 +34,9 @@ Maintainers ([@open-telemetry/specs-semconv-maintainers](https://github.com/orgs - [Johannes Tax](https://github.com/pyohannes), Grafana Labs - [Josh Suereth](https://github.com/jsuereth), Google - [Liudmila Molkova](https://github.com/lmolkova), Microsoft -- [Reiley Yang](https://github.com/reyang), Microsoft + +Emeritus Maintainers: + +- [Reiley Yang](https://github.com/reyang) _Find more about the maintainer role in [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#maintainer)._ diff --git a/dependencies.Dockerfile b/dependencies.Dockerfile index 9423ce0749..ec9d99157d 100644 --- a/dependencies.Dockerfile +++ b/dependencies.Dockerfile @@ -6,7 +6,7 @@ FROM otel/weaver:v0.10.0 AS weaver # OPA is used to test policies enforced by weaver. -FROM openpolicyagent/opa:0.68.0 AS opa +FROM openpolicyagent/opa:0.69.0 AS opa # Semconv gen is used for backwards compatibility checks. # TODO(jsuereth): Remove this when no longer used. diff --git a/docs/attributes-registry/README.md b/docs/attributes-registry/README.md index b5688cac23..35356a67cb 100644 --- a/docs/attributes-registry/README.md +++ b/docs/attributes-registry/README.md @@ -41,6 +41,7 @@ Currently, the following namespaces exist: - [Client](client.md) - [Cloud](cloud.md) - [CloudEvents](cloudevents.md) +- [CloudFoundry](cloudfoundry.md) - [Code](code.md) - [Container](container.md) - [CPU](cpu.md) diff --git a/docs/attributes-registry/cloudfoundry.md b/docs/attributes-registry/cloudfoundry.md new file mode 100644 index 0000000000..fd3d26194f --- /dev/null +++ b/docs/attributes-registry/cloudfoundry.md @@ -0,0 +1,84 @@ + + + + + +# CloudFoundry + +## CloudFoundry Attributes + +CloudFoundry resource attributes. + +| Attribute | Type | Description | Examples | Stability | +| --------------------------------- | ------ | ------------------------------------------------------------------------------ | -------------------------------------- | ---------------------------------------------------------------- | +| `cloudfoundry.app.id` | string | The guid of the application. [1] | `218fc5a9-a5f1-4b54-aa05-46717d0ab26d` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `cloudfoundry.app.instance.id` | string | The index of the application instance. 0 when just one instance is active. [2] | `0`; `1` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `cloudfoundry.app.name` | string | The name of the application. [3] | `my-app-name` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `cloudfoundry.org.id` | string | The guid of the CloudFoundry org the application is running in. [4] | `218fc5a9-a5f1-4b54-aa05-46717d0ab26d` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `cloudfoundry.org.name` | string | The name of the CloudFoundry organization the app is running in. [5] | `my-org-name` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `cloudfoundry.process.id` | string | The UID identifying the process. [6] | `218fc5a9-a5f1-4b54-aa05-46717d0ab26d` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `cloudfoundry.process.type` | string | The type of process. [7] | `web` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `cloudfoundry.space.id` | string | The guid of the CloudFoundry space the application is running in. [8] | `218fc5a9-a5f1-4b54-aa05-46717d0ab26d` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `cloudfoundry.space.name` | string | The name of the CloudFoundry space the application is running in. [9] | `my-space-name` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `cloudfoundry.system.id` | string | A guid or another name describing the event source. [10] | `cf/gorouter` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `cloudfoundry.system.instance.id` | string | A guid describing the concrete instance of the event source. [11] | `218fc5a9-a5f1-4b54-aa05-46717d0ab26d` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[1]:** Application instrumentation should use the value from environment +variable `VCAP_APPLICATION.application_id`. This is the same value as +reported by `cf app --guid`. + +**[2]:** CloudFoundry defines the `instance_id` in the [Loggregator v2 envelope](https://github.com/cloudfoundry/loggregator-api#v2-envelope). +It is used for logs and metrics emitted by CloudFoundry. It is +supposed to contain the application instance index for applications +deployed on the runtime. + +Application instrumentation should use the value from environment +variable `CF_INSTANCE_INDEX`. + +**[3]:** Application instrumentation should use the value from environment +variable `VCAP_APPLICATION.application_name`. This is the same value +as reported by `cf apps`. + +**[4]:** Application instrumentation should use the value from environment +variable `VCAP_APPLICATION.org_id`. This is the same value as +reported by `cf org --guid`. + +**[5]:** Application instrumentation should use the value from environment +variable `VCAP_APPLICATION.org_name`. This is the same value as +reported by `cf orgs`. + +**[6]:** Application instrumentation should use the value from environment +variable `VCAP_APPLICATION.process_id`. It is supposed to be equal to +`VCAP_APPLICATION.app_id` for applications deployed to the runtime. +For system components, this could be the actual PID. + +**[7]:** CloudFoundry applications can consist of multiple jobs. Usually the +main process will be of type `web`. There can be additional background +tasks or side-cars with different process types. + +**[8]:** Application instrumentation should use the value from environment +variable `VCAP_APPLICATION.space_id`. This is the same value as +reported by `cf space --guid`. + +**[9]:** Application instrumentation should use the value from environment +variable `VCAP_APPLICATION.space_name`. This is the same value as +reported by `cf spaces`. + +**[10]:** CloudFoundry defines the `source_id` in the [Loggregator v2 envelope](https://github.com/cloudfoundry/loggregator-api#v2-envelope). +It is used for logs and metrics emitted by CloudFoundry. It is +supposed to contain the component name, e.g. "gorouter", for +CloudFoundry components. + +When system components are instrumented, values from the +[Bosh spec](https://bosh.io/docs/jobs/#properties-spec) +should be used. The `system.id` should be set to +`spec.deployment/spec.name`. + +**[11]:** CloudFoundry defines the `instance_id` in the [Loggregator v2 envelope](https://github.com/cloudfoundry/loggregator-api#v2-envelope). +It is used for logs and metrics emitted by CloudFoundry. It is +supposed to contain the vm id for CloudFoundry components. + +When system components are instrumented, values from the +[Bosh spec](https://bosh.io/docs/jobs/#properties-spec) +should be used. The `system.instance.id` should be set to `spec.id`. diff --git a/docs/attributes-registry/db.md b/docs/attributes-registry/db.md index e2633dddd9..1fd6727bf7 100644 --- a/docs/attributes-registry/db.md +++ b/docs/attributes-registry/db.md @@ -29,34 +29,42 @@ This group defines the attributes used to describe telemetry in the context of d | `db.operation.name` | string | The name of the operation or command being executed. [4] | `findAndModify`; `HMSET`; `SELECT` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.query.parameter.` | string | A query parameter used in `db.query.text`, with `` being the parameter name, and the attribute value being a string representation of the parameter value. [5] | `someval`; `55` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.query.text` | string | The database query being executed. [6] | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.record.id` | string | The record identifier if present. [7] | `1`; `W0tpsmIBdwcYyG50zbta` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.response.status_code` | string | Database response status code. [7] | `102`; `ORA-17002`; `08P01`; `404` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.system` | string | The database management system (DBMS) product as identified by the client instrumentation. [8] | `other_sql`; `adabas`; `cache` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. If the collection name is parsed from the query text, it SHOULD be the first collection name found in the query and it SHOULD match the value provided in the query text including any schema and database name prefix. For batch operations, if the individual operations are known to have the same collection name then that collection name SHOULD be used, otherwise `db.collection.name` SHOULD NOT be captured. +This attribute has stability level RELEASE CANDIDATE. **[2]:** If a database system has multiple namespace components, they SHOULD be concatenated (potentially using database system specific conventions) from most general to most specific namespace component, and more specific namespaces SHOULD NOT be captured without the more general namespaces, to ensure that "startswith" queries for the more general namespaces will be valid. Semantic conventions for individual database systems SHOULD document what `db.namespace` means in the context of that system. It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. +This attribute has stability level RELEASE CANDIDATE. **[3]:** Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` SHOULD never be `1`. +This attribute has stability level RELEASE CANDIDATE. **[4]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. If the operation name is parsed from the query text, it SHOULD be the first operation name found in the query. For batch operations, if the individual operations are known to have the same operation name then that operation name SHOULD be used prepended by `BATCH `, otherwise `db.operation.name` SHOULD be `BATCH` or some other database system specific term if more applicable. +This attribute has stability level RELEASE CANDIDATE. **[5]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders. If a parameter has no name and instead is referenced only by index, then `` SHOULD be the 0-based index. +This attribute has stability level RELEASE CANDIDATE. **[6]:** For sanitization see [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext). For batch operations, if the individual operations are known to have the same query text then that query text SHOULD be used, otherwise all of the individual query texts SHOULD be concatenated with separator `; ` or some other database system specific separator if more applicable. Even though parameterized query text can potentially have sensitive data, by using a parameterized query the user is giving a strong signal that any sensitive data will be passed as parameter values, and the benefit to observability of capturing the static part of the query text by default outweighs the risk. +This attribute has stability level RELEASE CANDIDATE. -**[7]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. -If the record id is parsed from the query text, it SHOULD be the first id found in the query. +**[7]:** The status code returned by the database. Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes. +Semantic conventions for individual database systems SHOULD document what `db.response.status_code` means in the context of that system. +This attribute has stability level RELEASE CANDIDATE. **[8]:** The actual DBMS may differ from the one identified by the client. For example, when using PostgreSQL client libraries to connect to a CockroachDB, the `db.system` is set to `postgresql` based on the instrumentation's best knowledge. +This attribute has stability level RELEASE CANDIDATE. `db.client.connection.state` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. @@ -67,62 +75,62 @@ If the record id is parsed from the query text, it SHOULD be the first id found `db.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. -| Value | Description | Stability | -| -------------------- | --------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | -| `adabas` | Adabas (Adaptable Database System) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `cache` | Deprecated, use `intersystems_cache` instead. | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `intersystems_cache`. | -| `cassandra` | Apache Cassandra | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `clickhouse` | ClickHouse | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `cloudscape` | Deprecated, use `other_sql` instead. | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `other_sql`. | -| `cockroachdb` | CockroachDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `coldfusion` | Deprecated, no replacement at this time. | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed. | -| `cosmosdb` | Microsoft Azure Cosmos DB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `couchbase` | Couchbase | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `couchdb` | CouchDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db2` | IBM Db2 | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `derby` | Apache Derby | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `dynamodb` | Amazon DynamoDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `edb` | EnterpriseDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `elasticsearch` | Elasticsearch | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `filemaker` | FileMaker | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `firebird` | Firebird | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `firstsql` | Deprecated, use `other_sql` instead. | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `other_sql`. | -| `geode` | Apache Geode | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `h2` | H2 | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `hanadb` | SAP HANA | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `hbase` | Apache HBase | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `hive` | Apache Hive | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `hsqldb` | HyperSQL DataBase | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `influxdb` | InfluxDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `informix` | Informix | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `ingres` | Ingres | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `instantdb` | InstantDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `interbase` | InterBase | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `intersystems_cache` | InterSystems CachΓ© | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `mariadb` | MariaDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `maxdb` | SAP MaxDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `memcached` | Memcached | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `mongodb` | MongoDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `mssql` | Microsoft SQL Server | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `mssqlcompact` | Deprecated, Microsoft SQL Server Compact is discontinued. | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed, use `other_sql` instead. | -| `mysql` | MySQL | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `neo4j` | Neo4j | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `netezza` | Netezza | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `opensearch` | OpenSearch | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `oracle` | Oracle Database | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `other_sql` | Some other SQL database. Fallback only. See notes. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `pervasive` | Pervasive PSQL | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `pointbase` | PointBase | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `postgresql` | PostgreSQL | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `progress` | Progress Database | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `redis` | Redis | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `redshift` | Amazon Redshift | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `spanner` | Cloud Spanner | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `sqlite` | SQLite | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `sybase` | Sybase | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `teradata` | Teradata | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `trino` | Trino | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `vertica` | Vertica | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| Value | Description | Stability | +| -------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | +| `adabas` | Adabas (Adaptable Database System) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `cache` | Deprecated, use `intersystems_cache` instead. | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `intersystems_cache`. | +| `cassandra` | Apache Cassandra | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `clickhouse` | ClickHouse | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `cloudscape` | Deprecated, use `other_sql` instead. | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `other_sql`. | +| `cockroachdb` | CockroachDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `coldfusion` | Deprecated, no replacement at this time. | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed. | +| `cosmosdb` | Microsoft Azure Cosmos DB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `couchbase` | Couchbase | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `couchdb` | CouchDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db2` | IBM Db2 | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `derby` | Apache Derby | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `dynamodb` | Amazon DynamoDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `edb` | EnterpriseDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `elasticsearch` | Elasticsearch | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `filemaker` | FileMaker | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `firebird` | Firebird | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `firstsql` | Deprecated, use `other_sql` instead. | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `other_sql`. | +| `geode` | Apache Geode | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `h2` | H2 | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `hanadb` | SAP HANA | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `hbase` | Apache HBase | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `hive` | Apache Hive | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `hsqldb` | HyperSQL DataBase | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `influxdb` | InfluxDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `informix` | Informix | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `ingres` | Ingres | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `instantdb` | InstantDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `interbase` | InterBase | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `intersystems_cache` | InterSystems CachΓ© | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `mariadb` | MariaDB (This value has stability level RELEASE CANDIDATE) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `maxdb` | SAP MaxDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `memcached` | Memcached | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `mongodb` | MongoDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `mssql` | Microsoft SQL Server (This value has stability level RELEASE CANDIDATE) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `mssqlcompact` | Deprecated, Microsoft SQL Server Compact is discontinued. | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed, use `other_sql` instead. | +| `mysql` | MySQL (This value has stability level RELEASE CANDIDATE) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `neo4j` | Neo4j | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `netezza` | Netezza | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `opensearch` | OpenSearch | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `oracle` | Oracle Database | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `other_sql` | Some other SQL database. Fallback only. See notes. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `pervasive` | Pervasive PSQL | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `pointbase` | PointBase | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `postgresql` | PostgreSQL (This value has stability level RELEASE CANDIDATE) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `progress` | Progress Database | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `redis` | Redis | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `redshift` | Amazon Redshift | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `spanner` | Cloud Spanner | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `sqlite` | SQLite | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `sybase` | Sybase | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `teradata` | Teradata | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `trino` | Trino | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `vertica` | Vertica | ![Experimental](https://img.shields.io/badge/-experimental-blue) | ## Cassandra Attributes @@ -164,7 +172,6 @@ This group defines attributes for Azure Cosmos DB. | `db.cosmosdb.operation_type` | string | Cosmos DB Operation Type. | `batch`; `create`; `delete` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.cosmosdb.request_charge` | double | RU consumed for that operation | `46.18`; `1.0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.cosmosdb.request_content_length` | int | Request payload size in bytes | | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.cosmosdb.status_code` | int | Cosmos DB status code. | `200`; `201` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.cosmosdb.sub_status_code` | int | Cosmos DB sub status code. | `1000`; `1002` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | `db.cosmosdb.connection_mode` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. @@ -205,33 +212,6 @@ This group defines attributes for Elasticsearch. **[9]:** Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. -## Search attributes - -This group defines attributes for Search. - -| Attribute | Type | Description | Examples | Stability | -| ----------------------------- | ------ | ------------------------------------- | -------- | ---------------------------------------------------------------- | -| `db.search.similarity_metric` | string | The metric used in similarity search. | `cosine` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - -`db.search.similarity_metric` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. - -| Value | Description | Stability | -| ----------- | ------------------------------ | ---------------------------------------------------------------- | -| `cosine` | The cosine metric. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `dot` | The dot product metric. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `euclidean` | The euclidean distance metric. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `manhattan` | The Manhattan distance metric. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - -## Db Vector Attributes - -This group defines attributes for vector databases. - -| Attribute | Type | Description | Examples | Stability | -| --------------------------- | ------ | ---------------------------------------------------- | -------- | ---------------------------------------------------------------- | -| `db.vector.dimension_count` | int | The dimension of the vector. | `3` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.vector.field_name` | string | The name field as of the vector (e.g. a field name). | `vector` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.vector.query.top_k` | int | The top-k most similar vectors returned by a query. | `5` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - ## Deprecated Database Attributes "Describes deprecated db attributes." @@ -241,6 +221,7 @@ This group defines attributes for vector databases. | `db.cassandra.table` | string | Deprecated, use `db.collection.name` instead. | `mytable` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.collection.name`. | | `db.connection_string` | string | Deprecated, use `server.address`, `server.port` attributes instead. | `Server=(localdb)\v11.0;Integrated Security=true;` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `server.address` and `server.port`. | | `db.cosmosdb.container` | string | Deprecated, use `db.collection.name` instead. | `mytable` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.collection.name`. | +| `db.cosmosdb.status_code` | int | Deprecated, use `db.response.status_code` instead. | `200`; `201` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.response.status_code`. | | `db.elasticsearch.cluster.name` | string | Deprecated, use `db.namespace` instead. | `e9106fc68e3044f0b1475b04bf4ffd5f` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.namespace`. | | `db.instance.id` | string | Deprecated, no general replacement at this time. For Elasticsearch, use `db.elasticsearch.node.name` instead. | `mysql-e26b99z.example.com` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Deprecated, no general replacement at this time. For Elasticsearch, use `db.elasticsearch.node.name` instead. | | `db.jdbc.driver_classname` | string | Removed, no replacement at this time. | `org.postgresql.Driver`; `com.microsoft.sqlserver.jdbc.SQLServerDriver` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed as not used. | diff --git a/docs/attributes-registry/gen-ai.md b/docs/attributes-registry/gen-ai.md index fd8e8ee117..b4e8b64599 100644 --- a/docs/attributes-registry/gen-ai.md +++ b/docs/attributes-registry/gen-ai.md @@ -7,40 +7,35 @@ # Gen AI - [GenAI Attributes](#genai-attributes) +- [OpenAI Attributes](#openai-attributes) - [Deprecated GenAI Attributes](#deprecated-genai-attributes) ## GenAI Attributes This document defines the attributes used to describe telemetry in the context of Generative Artificial Intelligence (GenAI) Models requests and responses. -| Attribute | Type | Description | Examples | Stability | -| ---------------------------------- | -------- | ------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------- | ---------------------------------------------------------------- | -| `gen_ai.completion` | string | The full response received from the GenAI model. [1] | `[{'role': 'assistant', 'content': 'The capital of France is Paris.'}]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `gen_ai.operation.name` | string | The name of the operation being performed. [2] | `chat`; `text_completion` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `gen_ai.prompt` | string | The full prompt sent to the GenAI model. [3] | `[{'role': 'user', 'content': 'What is the capital of France?'}]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `gen_ai.request.frequency_penalty` | double | The frequency penalty setting for the GenAI request. | `0.1` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `gen_ai.request.max_tokens` | int | The maximum number of tokens the model generates for a request. | `100` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `gen_ai.request.model` | string | The name of the GenAI model a request is being made to. | `gpt-4` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `gen_ai.request.presence_penalty` | double | The presence penalty setting for the GenAI request. | `0.1` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `gen_ai.request.stop_sequences` | string[] | List of sequences that the model will use to stop generating further tokens. | `["forest", "lived"]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `gen_ai.request.temperature` | double | The temperature setting for the GenAI request. | `0.0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `gen_ai.request.top_k` | double | The top_k sampling setting for the GenAI request. | `1.0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `gen_ai.request.top_p` | double | The top_p sampling setting for the GenAI request. | `1.0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `gen_ai.response.finish_reasons` | string[] | Array of reasons the model stopped generating tokens, corresponding to each generation received. | `["stop"]`; `["stop", "length"]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `gen_ai.response.id` | string | The unique identifier for the completion. | `chatcmpl-123` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `gen_ai.response.model` | string | The name of the model that generated the response. | `gpt-4-0613` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `gen_ai.system` | string | The Generative AI product as identified by the client or server instrumentation. [4] | `openai` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `gen_ai.token.type` | string | The type of token being counted. | `input`; `output` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `gen_ai.usage.input_tokens` | int | The number of tokens used in the GenAI input (prompt). | `100` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `gen_ai.usage.output_tokens` | int | The number of tokens used in the GenAI response (completion). | `180` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - -**[1]:** It's RECOMMENDED to format completions as JSON string matching [OpenAI messages format](https://platform.openai.com/docs/guides/text-generation) - -**[2]:** If one of the predefined values applies, but specific system uses a different name it's RECOMMENDED to document it in the semantic conventions for specific GenAI system and use system-specific name in the instrumentation. If a different name is not documented, instrumentation libraries SHOULD use applicable predefined value. - -**[3]:** It's RECOMMENDED to format prompts as JSON string matching [OpenAI messages format](https://platform.openai.com/docs/guides/text-generation) - -**[4]:** The `gen_ai.system` describes a family of GenAI models with specific model identified +| Attribute | Type | Description | Examples | Stability | +| ---------------------------------- | -------- | ------------------------------------------------------------------------------------------------ | -------------------------------- | ---------------------------------------------------------------- | +| `gen_ai.operation.name` | string | The name of the operation being performed. [1] | `chat`; `text_completion` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gen_ai.request.frequency_penalty` | double | The frequency penalty setting for the GenAI request. | `0.1` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gen_ai.request.max_tokens` | int | The maximum number of tokens the model generates for a request. | `100` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gen_ai.request.model` | string | The name of the GenAI model a request is being made to. | `gpt-4` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gen_ai.request.presence_penalty` | double | The presence penalty setting for the GenAI request. | `0.1` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gen_ai.request.stop_sequences` | string[] | List of sequences that the model will use to stop generating further tokens. | `["forest", "lived"]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gen_ai.request.temperature` | double | The temperature setting for the GenAI request. | `0.0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gen_ai.request.top_k` | double | The top_k sampling setting for the GenAI request. | `1.0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gen_ai.request.top_p` | double | The top_p sampling setting for the GenAI request. | `1.0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gen_ai.response.finish_reasons` | string[] | Array of reasons the model stopped generating tokens, corresponding to each generation received. | `["stop"]`; `["stop", "length"]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gen_ai.response.id` | string | The unique identifier for the completion. | `chatcmpl-123` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gen_ai.response.model` | string | The name of the model that generated the response. | `gpt-4-0613` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gen_ai.system` | string | The Generative AI product as identified by the client or server instrumentation. [2] | `openai` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gen_ai.token.type` | string | The type of token being counted. | `input`; `output` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gen_ai.usage.input_tokens` | int | The number of tokens used in the GenAI input (prompt). | `100` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gen_ai.usage.output_tokens` | int | The number of tokens used in the GenAI response (completion). | `180` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[1]:** If one of the predefined values applies, but specific system uses a different name it's RECOMMENDED to document it in the semantic conventions for specific GenAI system and use system-specific name in the instrumentation. If a different name is not documented, instrumentation libraries SHOULD use applicable predefined value. + +**[2]:** The `gen_ai.system` describes a family of GenAI models with specific model identified by `gen_ai.request.model` and `gen_ai.response.model` attributes. The actual GenAI product may differ from the one identified by the client. @@ -59,12 +54,13 @@ If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. `gen_ai.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. -| Value | Description | Stability | -| ----------- | ----------- | ---------------------------------------------------------------- | -| `anthropic` | Anthropic | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `cohere` | Cohere | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `openai` | OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `vertex_ai` | Vertex AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| Value | Description | Stability | +| ----------------- | ------------------ | ---------------------------------------------------------------- | +| `anthropic` | Anthropic | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `az.ai.inference` | Azure AI Inference | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `cohere` | Cohere | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `openai` | OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `vertex_ai` | Vertex AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | `gen_ai.token.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. @@ -73,11 +69,39 @@ If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. | `input` | Input tokens (prompt, input, etc.) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `output` | Output tokens (completion, response, etc.) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +## OpenAI Attributes + +Thie group defines attributes for OpenAI. + +| Attribute | Type | Description | Examples | Stability | +| --------------------------------------- | ------ | --------------------------------------------------------------------- | ------------------ | ---------------------------------------------------------------- | +| `gen_ai.openai.request.response_format` | string | The response format that is requested. | `json` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gen_ai.openai.request.seed` | int | Requests with same seed value more likely to return same result. | `100` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gen_ai.openai.request.service_tier` | string | The service tier requested. May be a specific tier, detault, or auto. | `auto`; `default` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gen_ai.openai.response.service_tier` | string | The service tier used for the response. | `scale`; `detault` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +`gen_ai.openai.request.response_format` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. + +| Value | Description | Stability | +| ------------- | --------------------------- | ---------------------------------------------------------------- | +| `json_object` | JSON object response format | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `json_schema` | JSON schema response format | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `text` | Text response format | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +`gen_ai.openai.request.service_tier` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. + +| Value | Description | Stability | +| --------- | -------------------------------------------------------------------- | ---------------------------------------------------------------- | +| `auto` | The system will utilize scale tier credits until they are exhausted. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `default` | The system will utilize the default scale tier. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + ## Deprecated GenAI Attributes Describes deprecated `gen_ai` attributes. -| Attribute | Type | Description | Examples | Stability | -| -------------------------------- | ---- | ----------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------ | -| `gen_ai.usage.completion_tokens` | int | Deprecated, use `gen_ai.usage.output_tokens` instead. | `42` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `gen_ai.usage.output_tokens` attribute. | -| `gen_ai.usage.prompt_tokens` | int | Deprecated, use `gen_ai.usage.input_tokens` instead. | `42` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `gen_ai.usage.input_tokens` attribute. | +| Attribute | Type | Description | Examples | Stability | +| -------------------------------- | ------ | --------------------------------------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | +| `gen_ai.completion` | string | Deprecated, use Event API to report completions contents. | `[{'role': 'assistant', 'content': 'The capital of France is Paris.'}]` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed, no replacement at this time. | +| `gen_ai.prompt` | string | Deprecated, use Event API to report prompt contents. | `[{'role': 'user', 'content': 'What is the capital of France?'}]` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed, no replacement at this time. | +| `gen_ai.usage.completion_tokens` | int | Deprecated, use `gen_ai.usage.output_tokens` instead. | `42` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `gen_ai.usage.output_tokens` attribute. | +| `gen_ai.usage.prompt_tokens` | int | Deprecated, use `gen_ai.usage.input_tokens` instead. | `42` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `gen_ai.usage.input_tokens` attribute. | diff --git a/docs/attributes-registry/http.md b/docs/attributes-registry/http.md index 069666a943..3c9015d6bc 100644 --- a/docs/attributes-registry/http.md +++ b/docs/attributes-registry/http.md @@ -88,9 +88,9 @@ Describes deprecated HTTP attributes. | `http.flavor` | string | Deprecated, use `network.protocol.name` instead. | `1.0`; `1.1`; `2.0` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `network.protocol.name`. | | `http.host` | string | Deprecated, use one of `server.address`, `client.address` or `http.request.header.host` instead, depending on the usage. | `www.example.org` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by one of `server.address`, `client.address` or `http.request.header.host`, depending on the usage. | | `http.method` | string | Deprecated, use `http.request.method` instead. | `GET`; `POST`; `HEAD` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `http.request.method`. | -| `http.request_content_length` | int | Deprecated, use `http.request.header.content-length` instead. | `3495` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `http.request.header.content-length`. | +| `http.request_content_length` | int | Deprecated, use `http.request.header.` instead. | `3495` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `http.request.header.`. | | `http.request_content_length_uncompressed` | int | Deprecated, use `http.request.body.size` instead. | `5493` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `http.request.body.size`. | -| `http.response_content_length` | int | Deprecated, use `http.response.header.content-length` instead. | `3495` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `http.response.header.content-length`. | +| `http.response_content_length` | int | Deprecated, use `http.response.header.` instead. | `3495` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `http.response.header.`. | | `http.response_content_length_uncompressed` | int | Deprecated, use `http.response.body.size` instead. | `5493` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replace by `http.response.body.size`. | | `http.scheme` | string | Deprecated, use `url.scheme` instead. | `http`; `https` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `url.scheme` instead. | | `http.server_name` | string | Deprecated, use `server.address` instead. | `example.com` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `server.address`. | diff --git a/docs/attributes-registry/messaging.md b/docs/attributes-registry/messaging.md index 396c632efc..c0ca549af8 100644 --- a/docs/attributes-registry/messaging.md +++ b/docs/attributes-registry/messaging.md @@ -35,7 +35,7 @@ Attributes describing telemetry around messaging systems and messaging activitie | `messaging.message.envelope.size` | int | The size of the message body and metadata in bytes. [7] | `2738` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `messaging.message.id` | string | A value used by the messaging system as an identifier for the message, represented as a string. | `452a7c7c7c7048c2f887f61572b18fc2` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `messaging.operation.name` | string | The system-specific name of the messaging operation. | `ack`; `nack`; `send` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `messaging.operation.type` | string | A string identifying the type of the messaging operation. [8] | `publish`; `create`; `receive` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `messaging.operation.type` | string | A string identifying the type of the messaging operation. [8] | `create`; `send`; `receive` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `messaging.system` | string | The messaging system as identified by the client instrumentation. [9] | `activemq`; `aws_sqs`; `eventgrid` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** Instrumentations SHOULD NOT set `messaging.batch.message_count` on spans that operate with a single message. When a messaging client library supports both batch and single-message API for the same operation, instrumentations SHOULD use `messaging.batch.message_count` for batching APIs and SHOULD NOT use it for single-message APIs. @@ -61,14 +61,15 @@ size should be used. `messaging.operation.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. -| Value | Description | Stability | -| --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `create` | A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch publishing scenarios. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `deliver` | Deprecated. Use `process` instead. | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `process`. | -| `process` | One or more messages are processed by a consumer. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `publish` | One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `receive` | One or more messages are requested by a consumer. This operation refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive messages. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `settle` | One or more messages are settled. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| Value | Description | Stability | +| --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `create` | A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch sending scenarios. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `deliver` | Deprecated. Use `process` instead. | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `process`. | +| `process` | One or more messages are processed by a consumer. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `publish` | Deprecated. Use `send` instead. | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `send`. | +| `receive` | One or more messages are requested by a consumer. This operation refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive messages. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `send` | One or more messages are provided for sending to an intermediary. If a single message is sent, the context of the "Send" span can be used as the creation context and no "Create" span needs to be created. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `settle` | One or more messages are settled. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | `messaging.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. diff --git a/docs/azure/events.md b/docs/azure/events.md index b832dc4371..aba71f17db 100644 --- a/docs/azure/events.md +++ b/docs/azure/events.md @@ -26,9 +26,6 @@ The event name MUST be `az.resource.log`. **[1]:** Event names are subject to the same rules as [attribute names](/docs/general/attribute-naming.md). Notably, event names are namespaced to avoid collisions and provide a clean separation of semantics for events in separate domains like browser, mobile, and kubernetes. - - - diff --git a/docs/cloud-providers/aws-sdk.md b/docs/cloud-providers/aws-sdk.md index c9857d47fb..33d6e7bc03 100644 --- a/docs/cloud-providers/aws-sdk.md +++ b/docs/cloud-providers/aws-sdk.md @@ -42,8 +42,6 @@ with the naming guidelines for RPC client spans. **[2]:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). - - `rpc.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -54,8 +52,6 @@ with the naming guidelines for RPC client spans. | `grpc` | gRPC | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `java_rmi` | Java RMI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - diff --git a/docs/cloudevents/cloudevents-spans.md b/docs/cloudevents/cloudevents-spans.md index 79672b8e15..7e833a13b7 100644 --- a/docs/cloudevents/cloudevents-spans.md +++ b/docs/cloudevents/cloudevents-spans.md @@ -62,7 +62,6 @@ attributes on spans created from the conventions described above. | [`cloudevents.event_subject`](/docs/attributes-registry/cloudevents.md) | string | The [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) of the event in the context of the event producer (identified by source). | `mynewfile.jpg` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`cloudevents.event_type`](/docs/attributes-registry/cloudevents.md) | string | The [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) contains a value describing the type of event related to the originating occurrence. | `com.github.pull_request.opened`; `com.example.object.deleted.v2` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - diff --git a/docs/database/README.md b/docs/database/README.md index 7fcb8d42a8..361708dbe7 100644 --- a/docs/database/README.md +++ b/docs/database/README.md @@ -7,17 +7,36 @@ path_base_for_github_subdir: # Semantic Conventions for Database Calls and Systems -**Status**: [Experimental][DocumentStatus] +**Status**: [Mixed][DocumentStatus] This document defines semantic conventions for database client spans as well as database metrics and logs. > **Warning** +> > Existing database instrumentations that are using -> [v1.24.0 of this document](https://github.com/open-telemetry/semantic-conventions/blob/v1.24.0/docs/database/README.md) -> (or prior) SHOULD NOT change the version of the database conventions that they emit by default -> until a transition plan to the (future) stable semantic conventions has been published. -> Conventions include, but are not limited to, attributes, metric and span names, and unit of measure. +> [v1.24.0 of this document](https://github.com/open-telemetry/semantic-conventions/blob/v1.24.0/docs/database/database-spans.md) +> (or prior): +> +> * SHOULD NOT change the version of the database conventions that they emit by default +> until the database semantic conventions are marked stable. +> Conventions include, but are not limited to, attributes, +> metric and span names, and unit of measure. +> * SHOULD introduce an environment variable `OTEL_SEMCONV_STABILITY_OPT_IN` +> in the existing major version which is a comma-separated list of values. +> If the list of values includes: +> * `database` - emit the new, stable database conventions, +> and stop emitting the old experimental database conventions +> that the instrumentation emitted previously. +> * `database/dup` - emit both the old and the stable database conventions, +> allowing for a seamless transition. +> * The default behavior (in the absence of one of these values) is to continue +> emitting whatever version of the old experimental database conventions +> the instrumentation was emitting previously. +> * Note: `database/dup` has higher precedence than `database` in case both values are present +> * SHOULD maintain (security patching at a minimum) the existing major version +> for at least six months after it starts emitting both sets of conventions. +> * SHOULD drop the environment variable in the next major version. Semantic conventions for database operations are defined for the following signals: diff --git a/docs/database/cassandra.md b/docs/database/cassandra.md index 18940ece55..505819847b 100644 --- a/docs/database/cassandra.md +++ b/docs/database/cassandra.md @@ -22,56 +22,74 @@ The Semantic Conventions for [Cassandra](https://cassandra.apache.org/) extend a | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`db.collection.name`](/docs/attributes-registry/db.md) | string | The name of the Cassandra table that the operation is acting upon. [1] | `public.users`; `customers` | `Conditionally Required` [2] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`db.namespace`](/docs/attributes-registry/db.md) | string | The Cassandra keyspace name. [3] | `mykeyspace` | `Conditionally Required` If available. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.namespace`](/docs/attributes-registry/db.md) | string | The keyspace associated with the session. [3] | `mykeyspace` | `Conditionally Required` If available. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.operation.name`](/docs/attributes-registry/db.md) | string | The name of the operation or command being executed. [4] | `findAndModify`; `HMSET`; `SELECT` | `Conditionally Required` [5] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [6] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [7] | `80`; `8080`; `443` | `Conditionally Required` [8] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.response.status_code`](/docs/attributes-registry/db.md) | string | [Cassandra protocol error code](https://github.com/apache/cassandra/blob/cassandra-5.0/doc/native_protocol_v5.spec) represented as a string. [6] | `102`; `40020` | `Conditionally Required` [7] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [8] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [9] | `80`; `8080`; `443` | `Conditionally Required` [10] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`db.cassandra.consistency_level`](/docs/attributes-registry/db.md) | string | The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). | `all`; `each_quorum`; `quorum` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.cassandra.coordinator.dc`](/docs/attributes-registry/db.md) | string | The data center of the coordinating node for a query. | `us-west-2` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.cassandra.coordinator.id`](/docs/attributes-registry/db.md) | string | The ID of the coordinating node for a query. | `be13faa2-8574-4d71-926d-27f16cf8a7af` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.cassandra.idempotence`](/docs/attributes-registry/db.md) | boolean | Whether or not the query is idempotent. | | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.cassandra.page_size`](/docs/attributes-registry/db.md) | int | The fetch size used for paging, i.e. how many rows will be returned at once. | `5000` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.cassandra.speculative_execution_count`](/docs/attributes-registry/db.md) | int | The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. | `0`; `2` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`db.query.text`](/docs/attributes-registry/db.md) | string | The database query being executed. [9] | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` | `Recommended` [10] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`network.peer.address`](/docs/attributes-registry/network.md) | string | Peer address of the database node where the operation was performed. [11] | `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.operation.batch.size`](/docs/attributes-registry/db.md) | int | The number of queries included in a batch operation. [11] | `2`; `3`; `4` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.query.text`](/docs/attributes-registry/db.md) | string | The database query being executed. [12] | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` | `Recommended` [13] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`network.peer.address`](/docs/attributes-registry/network.md) | string | Peer address of the database node where the operation was performed. [14] | `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`network.peer.port`](/docs/attributes-registry/network.md) | int | Peer port number of the network connection. | `65123` | `Recommended` if and only if `network.peer.address` is set. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [12] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`db.query.parameter.`](/docs/attributes-registry/db.md) | string | A query parameter used in `db.query.text`, with `` being the parameter name, and the attribute value being a string representation of the parameter value. [13] | `someval`; `55` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [15] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.query.parameter.`](/docs/attributes-registry/db.md) | string | A query parameter used in `db.query.text`, with `` being the parameter name, and the attribute value being a string representation of the parameter value. [16] | `someval`; `55` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. If the collection name is parsed from the query text, it SHOULD be the first collection name found in the query and it SHOULD match the value provided in the query text including any schema and database name prefix. For batch operations, if the individual operations are known to have the same collection name then that collection name SHOULD be used, otherwise `db.collection.name` SHOULD NOT be captured. +This attribute has stability level RELEASE CANDIDATE. **[2]:** If readily available. The collection name MAY be parsed from the query text, in which case it SHOULD be the first collection name found in the query. -**[3]:** For commands that switch the keyspace, this SHOULD be set to the target keyspace (even if the command fails). +**[3]:** If a database system has multiple namespace components, they SHOULD be concatenated (potentially using database system specific conventions) from most general to most specific namespace component, and more specific namespaces SHOULD NOT be captured without the more general namespaces, to ensure that "startswith" queries for the more general namespaces will be valid. +Semantic conventions for individual database systems SHOULD document what `db.namespace` means in the context of that system. +It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. +This attribute has stability level RELEASE CANDIDATE. **[4]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. If the operation name is parsed from the query text, it SHOULD be the first operation name found in the query. For batch operations, if the individual operations are known to have the same operation name then that operation name SHOULD be used prepended by `BATCH `, otherwise `db.operation.name` SHOULD be `BATCH` or some other database system specific term if more applicable. +This attribute has stability level RELEASE CANDIDATE. **[5]:** If readily available. The operation name MAY be parsed from the query text, in which case it SHOULD be the first operation name found in the query. -**[6]:** The `error.type` SHOULD match the error code returned by the database or the client library, the canonical name of exception that occurred, or another low-cardinality error identifier. Instrumentations SHOULD document the list of errors they report. +**[6]:** The status code returned by the database. Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes. +Semantic conventions for individual database systems SHOULD document what `db.response.status_code` means in the context of that system. +This attribute has stability level RELEASE CANDIDATE. -**[7]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. +**[7]:** If the operation failed and status code is available. -**[8]:** If using a port other than the default port for this DBMS and if `server.address` is set. +**[8]:** The `error.type` SHOULD match the `db.response.status_code` returned by the database or the client library, or the canonical name of exception that occurred. +When using canonical exception type name, instrumentation SHOULD do the best effort to report the most relevant type. For example, if the original exception is wrapped into a generic one, the original exception SHOULD be preferred. +Instrumentations SHOULD document how `error.type` is populated. -**[9]:** For sanitization see [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext). +**[9]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. + +**[10]:** If using a port other than the default port for this DBMS and if `server.address` is set. + +**[11]:** Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` SHOULD never be `1`. +This attribute has stability level RELEASE CANDIDATE. + +**[12]:** For sanitization see [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext). For batch operations, if the individual operations are known to have the same query text then that query text SHOULD be used, otherwise all of the individual query texts SHOULD be concatenated with separator `; ` or some other database system specific separator if more applicable. Even though parameterized query text can potentially have sensitive data, by using a parameterized query the user is giving a strong signal that any sensitive data will be passed as parameter values, and the benefit to observability of capturing the static part of the query text by default outweighs the risk. +This attribute has stability level RELEASE CANDIDATE. -**[10]:** SHOULD be collected by default only if there is sanitization that excludes sensitive information. See [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext). +**[13]:** SHOULD be collected by default only if there is sanitization that excludes sensitive information. See [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext). -**[11]:** If a database operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. +**[14]:** If a database operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. -**[12]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. +**[15]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. -**[13]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders. +**[16]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders. If a parameter has no name and instead is referenced only by index, then `` SHOULD be the 0-based index. - - +This attribute has stability level RELEASE CANDIDATE. The following attributes can be important for making sampling decisions and SHOULD be provided **at span creation time** (if provided at all): @@ -99,15 +117,12 @@ and SHOULD be provided **at span creation time** (if provided at all): | `three` | three | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `two` | two | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - `error.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - diff --git a/docs/database/cosmosdb.md b/docs/database/cosmosdb.md index 1200fc7ee8..2c93330c50 100644 --- a/docs/database/cosmosdb.md +++ b/docs/database/cosmosdb.md @@ -28,19 +28,20 @@ Cosmos DB instrumentation includes call-level (public API) surface spans and net | [`db.cosmosdb.connection_mode`](/docs/attributes-registry/db.md) | string | Cosmos client connection mode. | `gateway`; `direct` | `Conditionally Required` [2] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.cosmosdb.operation_type`](/docs/attributes-registry/db.md) | string | Cosmos DB Operation Type. | `batch`; `create`; `delete` | `Conditionally Required` when performing one of the operations in this list | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.cosmosdb.request_charge`](/docs/attributes-registry/db.md) | double | RU consumed for that operation | `46.18`; `1.0` | `Conditionally Required` when available | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`db.cosmosdb.status_code`](/docs/attributes-registry/db.md) | int | Cosmos DB status code. | `200`; `201` | `Conditionally Required` if response was received | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.cosmosdb.sub_status_code`](/docs/attributes-registry/db.md) | int | Cosmos DB sub status code. | `1000`; `1002` | `Conditionally Required` when response was received and contained sub-code. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.namespace`](/docs/attributes-registry/db.md) | string | The name of the database, fully qualified within the server address and port. | `customers`; `test.users` | `Conditionally Required` If available. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.operation.name`](/docs/attributes-registry/db.md) | string | The name of the operation or command being executed. [3] | `create_item`; `query_items`; `read_item` | `Conditionally Required` [4] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [5] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [6] | `80`; `8080`; `443` | `Conditionally Required` If not default (443). | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`az.namespace`](/docs/attributes-registry/azure.md) | string | [Azure Resource Provider Namespace](https://learn.microsoft.com/azure/azure-resource-manager/management/azure-services-resource-providers) as recognized by the client. [7] | `Microsoft.DocumentDB` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.response.status_code`](/docs/attributes-registry/db.md) | string | Cosmos DB status code. [5] | `200`; `201` | `Conditionally Required` if response was received | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [6] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [7] | `80`; `8080`; `443` | `Conditionally Required` If not default (443). | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`az.namespace`](/docs/attributes-registry/azure.md) | string | [Azure Resource Provider Namespace](https://learn.microsoft.com/azure/azure-resource-manager/management/azure-services-resource-providers) as recognized by the client. [8] | `Microsoft.DocumentDB` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.cosmosdb.client_id`](/docs/attributes-registry/db.md) | string | Unique Cosmos client instance id. | `3ba4827d-4422-483f-b59f-85b74211c11d` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.cosmosdb.request_content_length`](/docs/attributes-registry/db.md) | int | Request payload size in bytes | | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`db.query.text`](/docs/attributes-registry/db.md) | string | The database query being executed. [8] | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` | `Recommended` [9] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [10] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`user_agent.original`](/docs/attributes-registry/user-agent.md) | string | Full user-agent string is generated by Cosmos DB SDK [11] | `cosmos-netstandard-sdk/3.23.0\|3.23.1\|1\|X64\|Linux 5.4.0-1098-azure 104 18\|.NET Core 3.1.32\|S\|` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`db.query.parameter.`](/docs/attributes-registry/db.md) | string | A query parameter used in `db.query.text`, with `` being the parameter name, and the attribute value being a string representation of the parameter value. [12] | `someval`; `55` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.operation.batch.size`](/docs/attributes-registry/db.md) | int | The number of queries included in a batch operation. [9] | `2`; `3`; `4` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.query.text`](/docs/attributes-registry/db.md) | string | The database query being executed. [10] | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` | `Recommended` [11] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [12] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`user_agent.original`](/docs/attributes-registry/user-agent.md) | string | Full user-agent string is generated by Cosmos DB SDK [13] | `cosmos-netstandard-sdk/3.23.0\|3.23.1\|1\|X64\|Linux 5.4.0-1098-azure 104 18\|.NET Core 3.1.32\|S\|` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.query.parameter.`](/docs/attributes-registry/db.md) | string | A query parameter used in `db.query.text`, with `` being the parameter name, and the attribute value being a string representation of the parameter value. [14] | `someval`; `55` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. @@ -172,28 +173,37 @@ additional values when introducing new operations. **[4]:** If readily available. The operation name MAY be parsed from the query text, in which case it SHOULD be the first operation name found in the query. -**[5]:** The `error.type` SHOULD match the error code returned by the database or the client library, the canonical name of exception that occurred, or another low-cardinality error identifier. Instrumentations SHOULD document the list of errors they report. +**[5]:** The status code returned by the database. Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes. +Semantic conventions for individual database systems SHOULD document what `db.response.status_code` means in the context of that system. +This attribute has stability level RELEASE CANDIDATE. -**[6]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. +**[6]:** The `error.type` SHOULD match the `db.response.status_code` returned by the database or the client library, or the canonical name of exception that occurred. +When using canonical exception type name, instrumentation SHOULD do the best effort to report the most relevant type. For example, if the original exception is wrapped into a generic one, the original exception SHOULD be preferred. +Instrumentations SHOULD document how `error.type` is populated. -**[7]:** When `az.namespace` attribute is populated, it MUST be set to `Microsoft.DocumentDB` for all operations performed by Cosmos DB client. +**[7]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. -**[8]:** For sanitization see [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext). +**[8]:** When `az.namespace` attribute is populated, it MUST be set to `Microsoft.DocumentDB` for all operations performed by Cosmos DB client. + +**[9]:** Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` SHOULD never be `1`. +This attribute has stability level RELEASE CANDIDATE. + +**[10]:** For sanitization see [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext). For batch operations, if the individual operations are known to have the same query text then that query text SHOULD be used, otherwise all of the individual query texts SHOULD be concatenated with separator `; ` or some other database system specific separator if more applicable. Even though parameterized query text can potentially have sensitive data, by using a parameterized query the user is giving a strong signal that any sensitive data will be passed as parameter values, and the benefit to observability of capturing the static part of the query text by default outweighs the risk. +This attribute has stability level RELEASE CANDIDATE. -**[9]:** SHOULD be collected by default only if there is sanitization that excludes sensitive information. See [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext). +**[11]:** SHOULD be collected by default only if there is sanitization that excludes sensitive information. See [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext). -**[10]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. +**[12]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. -**[11]:** The user-agent value is generated by SDK which is a combination of
`sdk_version` : Current version of SDK. e.g. 'cosmos-netstandard-sdk/3.23.0'
`direct_pkg_version` : Direct package version used by Cosmos DB SDK. e.g. '3.23.1'
`number_of_client_instances` : Number of cosmos client instances created by the application. e.g. '1'
`type_of_machine_architecture` : Machine architecture. e.g. 'X64'
`operating_system` : Operating System. e.g. 'Linux 5.4.0-1098-azure 104 18'
`runtime_framework` : Runtime Framework. e.g. '.NET Core 3.1.32'
`failover_information` : Generated key to determine if region failover enabled. +**[13]:** The user-agent value is generated by SDK which is a combination of
`sdk_version` : Current version of SDK. e.g. 'cosmos-netstandard-sdk/3.23.0'
`direct_pkg_version` : Direct package version used by Cosmos DB SDK. e.g. '3.23.1'
`number_of_client_instances` : Number of cosmos client instances created by the application. e.g. '1'
`type_of_machine_architecture` : Machine architecture. e.g. 'X64'
`operating_system` : Operating System. e.g. 'Linux 5.4.0-1098-azure 104 18'
`runtime_framework` : Runtime Framework. e.g. '.NET Core 3.1.32'
`failover_information` : Generated key to determine if region failover enabled. Format Reg-{D (Disabled discovery)}-S(application region)|L(List of preferred regions)|N(None, user did not configure it). Default value is "NS". -**[12]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders. +**[14]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders. If a parameter has no name and instead is referenced only by index, then `` SHOULD be the 0-based index. - - +This attribute has stability level RELEASE CANDIDATE. The following attributes can be important for making sampling decisions and SHOULD be provided **at span creation time** (if provided at all): @@ -212,7 +222,6 @@ and SHOULD be provided **at span creation time** (if provided at all): | `direct` | Direct connection. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `gateway` | Gateway (HTTP) connections mode | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - `db.cosmosdb.operation_type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -233,15 +242,12 @@ and SHOULD be provided **at span creation time** (if provided at all): | `replace` | replace | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `upsert` | upsert | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - `error.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - diff --git a/docs/database/couchdb.md b/docs/database/couchdb.md index 6e2bf13444..3da577dde2 100644 --- a/docs/database/couchdb.md +++ b/docs/database/couchdb.md @@ -23,23 +23,34 @@ The Semantic Conventions for [CouchDB](https://couchdb.apache.org/) extend and o |---|---|---|---|---|---| | [`db.namespace`](/docs/attributes-registry/db.md) | string | The name of the database, fully qualified within the server address and port. | `customers`; `test.users` | `Conditionally Required` If available. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.operation.name`](/docs/attributes-registry/db.md) | string | The HTTP method + the target REST route. [1] | `GET /{db}/{docid}` | `Conditionally Required` [2] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [3] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [4] | `80`; `8080`; `443` | `Conditionally Required` [5] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [6] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.response.status_code`](/docs/attributes-registry/db.md) | string | The HTTP response code returned by the Couch DB. [3] | `200`; `201`; `429` | `Conditionally Required` [4] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [5] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [6] | `80`; `8080`; `443` | `Conditionally Required` [7] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.operation.batch.size`](/docs/attributes-registry/db.md) | int | The number of queries included in a batch operation. [8] | `2`; `3`; `4` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [9] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | **[1]:** In **CouchDB**, `db.operation.name` should be set to the HTTP method + the target REST route according to the API reference documentation. For example, when retrieving a document, `db.operation.name` would be set to (literally, i.e., without replacing the placeholders with concrete values): [`GET /{db}/{docid}`](https://docs.couchdb.org/en/stable/api/document/common.html#get--db-docid). **[2]:** If readily available. The operation name MAY be parsed from the query text, in which case it SHOULD be the first operation name found in the query. -**[3]:** The `error.type` SHOULD match the error code returned by the database or the client library, the canonical name of exception that occurred, or another low-cardinality error identifier. Instrumentations SHOULD document the list of errors they report. +**[3]:** The status code returned by the database. Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes. +Semantic conventions for individual database systems SHOULD document what `db.response.status_code` means in the context of that system. +This attribute has stability level RELEASE CANDIDATE. -**[4]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. +**[4]:** If response was received and the HTTP response code is available. -**[5]:** If using a port other than the default port for this DBMS and if `server.address` is set. +**[5]:** The `error.type` SHOULD match the `db.response.status_code` returned by the database or the client library, or the canonical name of exception that occurred. +When using canonical exception type name, instrumentation SHOULD do the best effort to report the most relevant type. For example, if the original exception is wrapped into a generic one, the original exception SHOULD be preferred. +Instrumentations SHOULD document how `error.type` is populated. -**[6]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. +**[6]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. +**[7]:** If using a port other than the default port for this DBMS and if `server.address` is set. +**[8]:** Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` SHOULD never be `1`. +This attribute has stability level RELEASE CANDIDATE. + +**[9]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. The following attributes can be important for making sampling decisions and SHOULD be provided **at span creation time** (if provided at all): @@ -55,8 +66,6 @@ and SHOULD be provided **at span creation time** (if provided at all): |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - diff --git a/docs/database/database-metrics.md b/docs/database/database-metrics.md index 9178b35f77..30056e1c13 100644 --- a/docs/database/database-metrics.md +++ b/docs/database/database-metrics.md @@ -2,14 +2,9 @@ linkTitle: Metrics ---> -# Semantic Conventions for Database Metrics +# Semantic Conventions for Database Client Metrics -**Status**: [Experimental][DocumentStatus] - -The conventions described in this section are specific to SQL and NoSQL clients. - -**Disclaimer:** These are initial database client metric instruments -and attributes but more may be added in the future. +**Status**: [Mixed][DocumentStatus] @@ -17,16 +12,17 @@ and attributes but more may be added in the future. - [Database operation](#database-operation) - [Metric: `db.client.operation.duration`](#metric-dbclientoperationduration) -- [Connection pools](#connection-pools) - - [Metric: `db.client.connection.count`](#metric-dbclientconnectioncount) - - [Metric: `db.client.connection.idle.max`](#metric-dbclientconnectionidlemax) - - [Metric: `db.client.connection.idle.min`](#metric-dbclientconnectionidlemin) - - [Metric: `db.client.connection.max`](#metric-dbclientconnectionmax) - - [Metric: `db.client.connection.pending_requests`](#metric-dbclientconnectionpending_requests) - - [Metric: `db.client.connection.timeouts`](#metric-dbclientconnectiontimeouts) - - [Metric: `db.client.connection.create_time`](#metric-dbclientconnectioncreate_time) - - [Metric: `db.client.connection.wait_time`](#metric-dbclientconnectionwait_time) - - [Metric: `db.client.connection.use_time`](#metric-dbclientconnectionuse_time) +- [Experimental](#experimental) + - [Connection pools](#connection-pools) + - [Metric: `db.client.connection.count`](#metric-dbclientconnectioncount) + - [Metric: `db.client.connection.idle.max`](#metric-dbclientconnectionidlemax) + - [Metric: `db.client.connection.idle.min`](#metric-dbclientconnectionidlemin) + - [Metric: `db.client.connection.max`](#metric-dbclientconnectionmax) + - [Metric: `db.client.connection.pending_requests`](#metric-dbclientconnectionpending_requests) + - [Metric: `db.client.connection.timeouts`](#metric-dbclientconnectiontimeouts) + - [Metric: `db.client.connection.create_time`](#metric-dbclientconnectioncreate_time) + - [Metric: `db.client.connection.wait_time`](#metric-dbclientconnectionwait_time) + - [Metric: `db.client.connection.use_time`](#metric-dbclientconnectionuse_time) @@ -60,14 +56,14 @@ and attributes but more may be added in the future. ### Metric: `db.client.operation.duration` -**Status**: [Experimental][DocumentStatus] +**Status**: [Release Candidate][DocumentStatus] This metric is [required][MetricRequired]. When this metric is reported alongside a database operation span, the metric value SHOULD be the same as the database operation span duration. This metric SHOULD be specified with -[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/metrics/api.md#instrument-advisory-parameters) +[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/metrics/api.md#instrument-advisory-parameters) of `[ 0.001, 0.005, 0.01, 0.05, 0.1, 0.5, 1, 5, 10 ]`. @@ -81,52 +77,61 @@ of `[ 0.001, 0.005, 0.01, 0.05, 0.1, 0.5, 1, 5, 10 ]`. | -------- | --------------- | ----------- | -------------- | --------- | | `db.client.operation.duration` | Histogram | `s` | Duration of database client operations. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Batch operations SHOULD be recorded as a single operation. - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`db.system`](/docs/attributes-registry/db.md) | string | The database management system (DBMS) product as identified by the client instrumentation. [1] | `other_sql`; `adabas`; `cache` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.collection.name`](/docs/attributes-registry/db.md) | string | The name of a collection (table, container) within the database. [2] | `public.users`; `customers` | `Conditionally Required` [3] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.namespace`](/docs/attributes-registry/db.md) | string | The name of the database, fully qualified within the server address and port. [4] | `customers`; `test.users` | `Conditionally Required` If available. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.operation.name`](/docs/attributes-registry/db.md) | string | The name of the operation or command being executed. [5] | `findAndModify`; `HMSET`; `SELECT` | `Conditionally Required` [6] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [7] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [8] | `80`; `8080`; `443` | `Conditionally Required` [9] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`network.peer.address`](/docs/attributes-registry/network.md) | string | Peer address of the database node where the operation was performed. [10] | `10.1.2.80`; `/tmp/my.sock` | `Recommended` If applicable for this database system. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.response.status_code`](/docs/attributes-registry/db.md) | string | Database response status code. [7] | `102`; `ORA-17002`; `08P01`; `404` | `Conditionally Required` [8] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [9] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [10] | `80`; `8080`; `443` | `Conditionally Required` [11] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`network.peer.address`](/docs/attributes-registry/network.md) | string | Peer address of the database node where the operation was performed. [12] | `10.1.2.80`; `/tmp/my.sock` | `Recommended` If applicable for this database system. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`network.peer.port`](/docs/attributes-registry/network.md) | int | Peer port number of the network connection. | `65123` | `Recommended` If and only if `network.peer.address` is set. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [11] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [13] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | **[1]:** The actual DBMS may differ from the one identified by the client. For example, when using PostgreSQL client libraries to connect to a CockroachDB, the `db.system` is set to `postgresql` based on the instrumentation's best knowledge. +This attribute has stability level RELEASE CANDIDATE. **[2]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. If the collection name is parsed from the query text, it SHOULD be the first collection name found in the query and it SHOULD match the value provided in the query text including any schema and database name prefix. For batch operations, if the individual operations are known to have the same collection name then that collection name SHOULD be used, otherwise `db.collection.name` SHOULD NOT be captured. +This attribute has stability level RELEASE CANDIDATE. **[3]:** If readily available. The collection name MAY be parsed from the query text, in which case it SHOULD be the first collection name in the query. **[4]:** If a database system has multiple namespace components, they SHOULD be concatenated (potentially using database system specific conventions) from most general to most specific namespace component, and more specific namespaces SHOULD NOT be captured without the more general namespaces, to ensure that "startswith" queries for the more general namespaces will be valid. Semantic conventions for individual database systems SHOULD document what `db.namespace` means in the context of that system. It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. +This attribute has stability level RELEASE CANDIDATE. **[5]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. If the operation name is parsed from the query text, it SHOULD be the first operation name found in the query. For batch operations, if the individual operations are known to have the same operation name then that operation name SHOULD be used prepended by `BATCH `, otherwise `db.operation.name` SHOULD be `BATCH` or some other database system specific term if more applicable. +This attribute has stability level RELEASE CANDIDATE. **[6]:** If readily available. The operation name MAY be parsed from the query text, in which case it SHOULD be the first operation name found in the query. -**[7]:** The `error.type` SHOULD match the error code returned by the database or the client library, the canonical name of exception that occurred, or another low-cardinality error identifier. Instrumentations SHOULD document the list of errors they report. +**[7]:** The status code returned by the database. Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes. +Semantic conventions for individual database systems SHOULD document what `db.response.status_code` means in the context of that system. +This attribute has stability level RELEASE CANDIDATE. -**[8]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. +**[8]:** If the operation failed and status code is available. -**[9]:** If using a port other than the default port for this DBMS and if `server.address` is set. +**[9]:** The `error.type` SHOULD match the `db.response.status_code` returned by the database or the client library, or the canonical name of exception that occurred. +When using canonical exception type name, instrumentation SHOULD do the best effort to report the most relevant type. For example, if the original exception is wrapped into a generic one, the original exception SHOULD be preferred. +Instrumentations SHOULD document how `error.type` is populated. -**[10]:** Semantic conventions for individual database systems SHOULD document whether `network.peer.*` attributes are applicable. Network peer address and port are useful when the application interacts with individual database nodes directly. -If a database operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. +**[10]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. -**[11]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. +**[11]:** If using a port other than the default port for this DBMS and if `server.address` is set. +**[12]:** Semantic conventions for individual database systems SHOULD document whether `network.peer.*` attributes are applicable. Network peer address and port are useful when the application interacts with individual database nodes directly. +If a database operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. +**[13]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. `db.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. @@ -158,12 +163,12 @@ If a database operation involved multiple network calls (for example retries), t | `instantdb` | InstantDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `interbase` | InterBase | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `intersystems_cache` | InterSystems CachΓ© | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `mariadb` | MariaDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `mariadb` | MariaDB (This value has stability level RELEASE CANDIDATE) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `maxdb` | SAP MaxDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `memcached` | Memcached | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `mongodb` | MongoDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `mssql` | Microsoft SQL Server | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `mysql` | MySQL | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `mssql` | Microsoft SQL Server (This value has stability level RELEASE CANDIDATE) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `mysql` | MySQL (This value has stability level RELEASE CANDIDATE) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `neo4j` | Neo4j | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `netezza` | Netezza | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `opensearch` | OpenSearch | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -171,7 +176,7 @@ If a database operation involved multiple network calls (for example retries), t | `other_sql` | Some other SQL database. Fallback only. See notes. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `pervasive` | Pervasive PSQL | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `pointbase` | PointBase | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `postgresql` | PostgreSQL | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `postgresql` | PostgreSQL (This value has stability level RELEASE CANDIDATE) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `progress` | Progress Database | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `redis` | Redis | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `redshift` | Amazon Redshift | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -182,25 +187,24 @@ If a database operation involved multiple network calls (for example retries), t | `trino` | Trino | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `vertica` | Vertica | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - `error.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - -## Connection pools +## Experimental + +### Connection pools The following metric instruments describe database client connection pool operations. -### Metric: `db.client.connection.count` +#### Metric: `db.client.connection.count` This metric is [required][MetricRequired]. @@ -227,13 +231,12 @@ This metric is [required][MetricRequired]. | `idle` | idle | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `used` | used | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - -### Metric: `db.client.connection.idle.max` + +#### Metric: `db.client.connection.idle.max` This metric is [recommended][MetricRecommended]. @@ -252,13 +255,12 @@ This metric is [recommended][MetricRecommended]. |---|---|---|---|---|---| | [`db.client.connection.pool.name`](/docs/attributes-registry/db.md) | string | The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, instrumentation SHOULD use a combination of parameters that would make the name unique, for example, combining attributes `server.address`, `server.port`, and `db.namespace`, formatted as `server.address:server.port/db.namespace`. Instrumentations that generate connection pool name following different patterns SHOULD document it. | `myDataSource` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - -### Metric: `db.client.connection.idle.min` +#### Metric: `db.client.connection.idle.min` This metric is [recommended][MetricRecommended]. @@ -277,13 +279,12 @@ This metric is [recommended][MetricRecommended]. |---|---|---|---|---|---| | [`db.client.connection.pool.name`](/docs/attributes-registry/db.md) | string | The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, instrumentation SHOULD use a combination of parameters that would make the name unique, for example, combining attributes `server.address`, `server.port`, and `db.namespace`, formatted as `server.address:server.port/db.namespace`. Instrumentations that generate connection pool name following different patterns SHOULD document it. | `myDataSource` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - -### Metric: `db.client.connection.max` +#### Metric: `db.client.connection.max` This metric is [recommended][MetricRecommended]. @@ -302,13 +303,12 @@ This metric is [recommended][MetricRecommended]. |---|---|---|---|---|---| | [`db.client.connection.pool.name`](/docs/attributes-registry/db.md) | string | The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, instrumentation SHOULD use a combination of parameters that would make the name unique, for example, combining attributes `server.address`, `server.port`, and `db.namespace`, formatted as `server.address:server.port/db.namespace`. Instrumentations that generate connection pool name following different patterns SHOULD document it. | `myDataSource` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - -### Metric: `db.client.connection.pending_requests` +#### Metric: `db.client.connection.pending_requests` This metric is [recommended][MetricRecommended]. @@ -327,13 +327,12 @@ This metric is [recommended][MetricRecommended]. |---|---|---|---|---|---| | [`db.client.connection.pool.name`](/docs/attributes-registry/db.md) | string | The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, instrumentation SHOULD use a combination of parameters that would make the name unique, for example, combining attributes `server.address`, `server.port`, and `db.namespace`, formatted as `server.address:server.port/db.namespace`. Instrumentations that generate connection pool name following different patterns SHOULD document it. | `myDataSource` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - -### Metric: `db.client.connection.timeouts` +#### Metric: `db.client.connection.timeouts` This metric is [recommended][MetricRecommended]. @@ -352,13 +351,12 @@ This metric is [recommended][MetricRecommended]. |---|---|---|---|---|---| | [`db.client.connection.pool.name`](/docs/attributes-registry/db.md) | string | The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, instrumentation SHOULD use a combination of parameters that would make the name unique, for example, combining attributes `server.address`, `server.port`, and `db.namespace`, formatted as `server.address:server.port/db.namespace`. Instrumentations that generate connection pool name following different patterns SHOULD document it. | `myDataSource` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - -### Metric: `db.client.connection.create_time` +#### Metric: `db.client.connection.create_time` This metric is [recommended][MetricRecommended]. @@ -377,13 +375,12 @@ This metric is [recommended][MetricRecommended]. |---|---|---|---|---|---| | [`db.client.connection.pool.name`](/docs/attributes-registry/db.md) | string | The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, instrumentation SHOULD use a combination of parameters that would make the name unique, for example, combining attributes `server.address`, `server.port`, and `db.namespace`, formatted as `server.address:server.port/db.namespace`. Instrumentations that generate connection pool name following different patterns SHOULD document it. | `myDataSource` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - -### Metric: `db.client.connection.wait_time` +#### Metric: `db.client.connection.wait_time` This metric is [recommended][MetricRecommended]. @@ -402,13 +399,12 @@ This metric is [recommended][MetricRecommended]. |---|---|---|---|---|---| | [`db.client.connection.pool.name`](/docs/attributes-registry/db.md) | string | The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, instrumentation SHOULD use a combination of parameters that would make the name unique, for example, combining attributes `server.address`, `server.port`, and `db.namespace`, formatted as `server.address:server.port/db.namespace`. Instrumentations that generate connection pool name following different patterns SHOULD document it. | `myDataSource` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - -### Metric: `db.client.connection.use_time` +#### Metric: `db.client.connection.use_time` This metric is [recommended][MetricRecommended]. @@ -427,7 +423,6 @@ This metric is [recommended][MetricRecommended]. |---|---|---|---|---|---| | [`db.client.connection.pool.name`](/docs/attributes-registry/db.md) | string | The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, instrumentation SHOULD use a combination of parameters that would make the name unique, for example, combining attributes `server.address`, `server.port`, and `db.namespace`, formatted as `server.address:server.port/db.namespace`. Instrumentations that generate connection pool name following different patterns SHOULD document it. | `myDataSource` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - diff --git a/docs/database/database-spans.md b/docs/database/database-spans.md index ab5a1b334b..da5b18579d 100644 --- a/docs/database/database-spans.md +++ b/docs/database/database-spans.md @@ -4,7 +4,7 @@ linkTitle: Client Calls # Semantic Conventions for Database Client Calls -**Status**: [Experimental][DocumentStatus] +**Status**: [Release Candidate][DocumentStatus], unless otherwise specified @@ -52,7 +52,7 @@ with all retries. ## Name -Database spans MUST follow the overall [guidelines for span names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/trace/api.md#span). +Database spans MUST follow the overall [guidelines for span names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/trace/api.md#span). @@ -94,53 +94,70 @@ These attributes will usually be the same for all operations performed over the | [`db.collection.name`](/docs/attributes-registry/db.md) | string | The name of a collection (table, container) within the database. [2] | `public.users`; `customers` | `Conditionally Required` [3] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.namespace`](/docs/attributes-registry/db.md) | string | The name of the database, fully qualified within the server address and port. [4] | `customers`; `test.users` | `Conditionally Required` If available. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.operation.name`](/docs/attributes-registry/db.md) | string | The name of the operation or command being executed. [5] | `findAndModify`; `HMSET`; `SELECT` | `Conditionally Required` [6] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [7] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [8] | `80`; `8080`; `443` | `Conditionally Required` [9] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`db.query.text`](/docs/attributes-registry/db.md) | string | The database query being executed. [10] | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` | `Recommended` [11] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`network.peer.address`](/docs/attributes-registry/network.md) | string | Peer address of the database node where the operation was performed. [12] | `10.1.2.80`; `/tmp/my.sock` | `Recommended` If applicable for this database system. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.response.status_code`](/docs/attributes-registry/db.md) | string | Database response status code. [7] | `102`; `ORA-17002`; `08P01`; `404` | `Conditionally Required` [8] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [9] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [10] | `80`; `8080`; `443` | `Conditionally Required` [11] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.operation.batch.size`](/docs/attributes-registry/db.md) | int | The number of queries included in a batch operation. [12] | `2`; `3`; `4` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.query.text`](/docs/attributes-registry/db.md) | string | The database query being executed. [13] | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` | `Recommended` [14] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`network.peer.address`](/docs/attributes-registry/network.md) | string | Peer address of the database node where the operation was performed. [15] | `10.1.2.80`; `/tmp/my.sock` | `Recommended` If applicable for this database system. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`network.peer.port`](/docs/attributes-registry/network.md) | int | Peer port number of the network connection. | `65123` | `Recommended` if and only if `network.peer.address` is set. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [13] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`db.query.parameter.`](/docs/attributes-registry/db.md) | string | A query parameter used in `db.query.text`, with `` being the parameter name, and the attribute value being a string representation of the parameter value. [14] | `someval`; `55` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [16] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.query.parameter.`](/docs/attributes-registry/db.md) | string | A query parameter used in `db.query.text`, with `` being the parameter name, and the attribute value being a string representation of the parameter value. [17] | `someval`; `55` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** The actual DBMS may differ from the one identified by the client. For example, when using PostgreSQL client libraries to connect to a CockroachDB, the `db.system` is set to `postgresql` based on the instrumentation's best knowledge. +This attribute has stability level RELEASE CANDIDATE. **[2]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. If the collection name is parsed from the query text, it SHOULD be the first collection name found in the query and it SHOULD match the value provided in the query text including any schema and database name prefix. For batch operations, if the individual operations are known to have the same collection name then that collection name SHOULD be used, otherwise `db.collection.name` SHOULD NOT be captured. +This attribute has stability level RELEASE CANDIDATE. **[3]:** If readily available. The collection name MAY be parsed from the query text, in which case it SHOULD be the first collection name found in the query. **[4]:** If a database system has multiple namespace components, they SHOULD be concatenated (potentially using database system specific conventions) from most general to most specific namespace component, and more specific namespaces SHOULD NOT be captured without the more general namespaces, to ensure that "startswith" queries for the more general namespaces will be valid. Semantic conventions for individual database systems SHOULD document what `db.namespace` means in the context of that system. It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. +This attribute has stability level RELEASE CANDIDATE. **[5]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. If the operation name is parsed from the query text, it SHOULD be the first operation name found in the query. For batch operations, if the individual operations are known to have the same operation name then that operation name SHOULD be used prepended by `BATCH `, otherwise `db.operation.name` SHOULD be `BATCH` or some other database system specific term if more applicable. +This attribute has stability level RELEASE CANDIDATE. **[6]:** If readily available. The operation name MAY be parsed from the query text, in which case it SHOULD be the first operation name found in the query. -**[7]:** The `error.type` SHOULD match the error code returned by the database or the client library, the canonical name of exception that occurred, or another low-cardinality error identifier. Instrumentations SHOULD document the list of errors they report. +**[7]:** The status code returned by the database. Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes. +Semantic conventions for individual database systems SHOULD document what `db.response.status_code` means in the context of that system. +This attribute has stability level RELEASE CANDIDATE. -**[8]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. +**[8]:** If the operation failed and status code is available. -**[9]:** If using a port other than the default port for this DBMS and if `server.address` is set. +**[9]:** The `error.type` SHOULD match the `db.response.status_code` returned by the database or the client library, or the canonical name of exception that occurred. +When using canonical exception type name, instrumentation SHOULD do the best effort to report the most relevant type. For example, if the original exception is wrapped into a generic one, the original exception SHOULD be preferred. +Instrumentations SHOULD document how `error.type` is populated. -**[10]:** For sanitization see [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext). +**[10]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. + +**[11]:** If using a port other than the default port for this DBMS and if `server.address` is set. + +**[12]:** Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` SHOULD never be `1`. +This attribute has stability level RELEASE CANDIDATE. + +**[13]:** For sanitization see [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext). For batch operations, if the individual operations are known to have the same query text then that query text SHOULD be used, otherwise all of the individual query texts SHOULD be concatenated with separator `; ` or some other database system specific separator if more applicable. Even though parameterized query text can potentially have sensitive data, by using a parameterized query the user is giving a strong signal that any sensitive data will be passed as parameter values, and the benefit to observability of capturing the static part of the query text by default outweighs the risk. +This attribute has stability level RELEASE CANDIDATE. -**[11]:** SHOULD be collected by default only if there is sanitization that excludes sensitive information. See [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext). +**[14]:** SHOULD be collected by default only if there is sanitization that excludes sensitive information. See [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext). -**[12]:** Semantic conventions for individual database systems SHOULD document whether `network.peer.*` attributes are applicable. Network peer address and port are useful when the application interacts with individual database nodes directly. +**[15]:** Semantic conventions for individual database systems SHOULD document whether `network.peer.*` attributes are applicable. Network peer address and port are useful when the application interacts with individual database nodes directly. If a database operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. -**[13]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. +**[16]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. -**[14]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders. +**[17]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders. If a parameter has no name and instead is referenced only by index, then `` SHOULD be the 0-based index. - - +This attribute has stability level RELEASE CANDIDATE. The following attributes can be important for making sampling decisions and SHOULD be provided **at span creation time** (if provided at all): @@ -183,12 +200,12 @@ and SHOULD be provided **at span creation time** (if provided at all): | `instantdb` | InstantDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `interbase` | InterBase | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `intersystems_cache` | InterSystems CachΓ© | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `mariadb` | MariaDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `mariadb` | MariaDB (This value has stability level RELEASE CANDIDATE) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `maxdb` | SAP MaxDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `memcached` | Memcached | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `mongodb` | MongoDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `mssql` | Microsoft SQL Server | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `mysql` | MySQL | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `mssql` | Microsoft SQL Server (This value has stability level RELEASE CANDIDATE) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `mysql` | MySQL (This value has stability level RELEASE CANDIDATE) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `neo4j` | Neo4j | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `netezza` | Netezza | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `opensearch` | OpenSearch | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -196,7 +213,7 @@ and SHOULD be provided **at span creation time** (if provided at all): | `other_sql` | Some other SQL database. Fallback only. See notes. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `pervasive` | Pervasive PSQL | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `pointbase` | PointBase | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `postgresql` | PostgreSQL | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `postgresql` | PostgreSQL (This value has stability level RELEASE CANDIDATE) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `progress` | Progress Database | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `redis` | Redis | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `redshift` | Amazon Redshift | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -207,15 +224,12 @@ and SHOULD be provided **at span creation time** (if provided at all): | `trino` | Trino | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `vertica` | Vertica | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - `error.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - diff --git a/docs/database/dynamodb.md b/docs/database/dynamodb.md index bb83447e94..9955a2032b 100644 --- a/docs/database/dynamodb.md +++ b/docs/database/dynamodb.md @@ -33,8 +33,6 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex **[2]:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). - - `rpc.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -45,8 +43,6 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex | `grpc` | gRPC | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `java_rmi` | Java RMI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -75,8 +71,6 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex **[2]:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). - - `rpc.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -87,8 +81,6 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex | `grpc` | gRPC | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `java_rmi` | Java RMI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -121,8 +113,6 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex **[2]:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). - - `rpc.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -133,8 +123,6 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex | `grpc` | gRPC | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `java_rmi` | Java RMI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -163,8 +151,6 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex **[2]:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). - - `rpc.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -175,8 +161,6 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex | `grpc` | gRPC | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `java_rmi` | Java RMI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -203,8 +187,6 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex **[2]:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). - - `rpc.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -215,8 +197,6 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex | `grpc` | gRPC | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `java_rmi` | Java RMI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -243,8 +223,6 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex **[2]:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). - - `rpc.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -255,8 +233,6 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex | `grpc` | gRPC | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `java_rmi` | Java RMI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -286,8 +262,6 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex **[2]:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). - - `rpc.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -298,8 +272,6 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex | `grpc` | gRPC | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `java_rmi` | Java RMI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -328,8 +300,6 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex **[2]:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). - - `rpc.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -340,8 +310,6 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex | `grpc` | gRPC | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `java_rmi` | Java RMI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -370,8 +338,6 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex **[2]:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). - - `rpc.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -382,8 +348,6 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex | `grpc` | gRPC | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `java_rmi` | Java RMI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -418,8 +382,6 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex **[2]:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). - - `rpc.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -430,8 +392,6 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex | `grpc` | gRPC | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `java_rmi` | Java RMI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -469,8 +429,6 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex **[2]:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). - - `rpc.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -481,8 +439,6 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex | `grpc` | gRPC | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `java_rmi` | Java RMI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -511,8 +467,6 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex **[2]:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). - - `rpc.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -523,8 +477,6 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex | `grpc` | gRPC | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `java_rmi` | Java RMI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -556,8 +508,6 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex **[2]:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). - - `rpc.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -568,8 +518,6 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex | `grpc` | gRPC | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `java_rmi` | Java RMI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - diff --git a/docs/database/elasticsearch.md b/docs/database/elasticsearch.md index 3fc7cae64c..2cccdc5a36 100644 --- a/docs/database/elasticsearch.md +++ b/docs/database/elasticsearch.md @@ -29,13 +29,15 @@ The **span name** follows the [general database span name guidelines](database-s | [`http.request.method`](/docs/attributes-registry/http.md) | string | HTTP request method. [2] | `GET`; `POST`; `HEAD` | `Required` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`url.full`](/docs/attributes-registry/url.md) | string | Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) [3] | `https://localhost:9200/index/_search?q=user.id:kimchy` | `Required` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`db.elasticsearch.path_parts.`](/docs/attributes-registry/db.md) | string | A dynamic value in the url path. [4] | `db.elasticsearch.path_parts.index=test-index`; `db.elasticsearch.path_parts.doc_id=123` | `Conditionally Required` when the url has dynamic values | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [5] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [6] | `80`; `8080`; `443` | `Conditionally Required` [7] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`db.collection.name`](/docs/attributes-registry/db.md) | string | The index or data stream against which the query is executed. [8] | `my_index`; `index1, index2` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`db.elasticsearch.node.name`](/docs/attributes-registry/db.md) | string | Represents the human-readable identifier of the node/instance to which a request was routed. [9] | `instance-0000000001` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`db.namespace`](/docs/attributes-registry/db.md) | string | The name of the Elasticsearch cluster which the client connects to. [10] | `customers`; `test.users` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`db.query.text`](/docs/attributes-registry/db.md) | string | The request body for a [search-type query](https://www.elastic.co/guide/en/elasticsearch/reference/current/search.html), as a json string. [11] | `"{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}"` | `Recommended` [12] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [13] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.response.status_code`](/docs/attributes-registry/db.md) | string | The HTTP response code returned by the Elasticsearch cluster. [5] | `200`; `201`; `429` | `Conditionally Required` If response was received. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [6] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [7] | `80`; `8080`; `443` | `Conditionally Required` [8] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.collection.name`](/docs/attributes-registry/db.md) | string | The index or data stream against which the query is executed. [9] | `my_index`; `index1, index2` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.elasticsearch.node.name`](/docs/attributes-registry/db.md) | string | Represents the human-readable identifier of the node/instance to which a request was routed. [10] | `instance-0000000001` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.namespace`](/docs/attributes-registry/db.md) | string | The name of the Elasticsearch cluster which the client connects to. [11] | `customers`; `test.users` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.operation.batch.size`](/docs/attributes-registry/db.md) | int | The number of queries included in a batch operation. [12] | `2`; `3`; `4` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.query.text`](/docs/attributes-registry/db.md) | string | The request body for a [search-type query](https://www.elastic.co/guide/en/elasticsearch/reference/current/search.html), as a json string. [13] | `"{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}"` | `Recommended` [14] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [15] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | **[1]:** The `db.operation.name` SHOULD match the endpoint identifier provided in the request (see the [Elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json)). @@ -60,27 +62,35 @@ Tracing instrumentations that do so, MUST also set `http.request.method_original **[4]:** Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. -**[5]:** The `error.type` SHOULD match the error code returned by the database or the client library, the canonical name of exception that occurred, or another low-cardinality error identifier. Instrumentations SHOULD document the list of errors they report. +**[5]:** The status code returned by the database. Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes. +Semantic conventions for individual database systems SHOULD document what `db.response.status_code` means in the context of that system. +This attribute has stability level RELEASE CANDIDATE. -**[6]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. +**[6]:** The `error.type` SHOULD match the `db.response.status_code` returned by the database or the client library, or the canonical name of exception that occurred. +When using canonical exception type name, instrumentation SHOULD do the best effort to report the most relevant type. For example, if the original exception is wrapped into a generic one, the original exception SHOULD be preferred. +Instrumentations SHOULD document how `error.type` is populated. -**[7]:** If using a port other than the default port for this DBMS and if `server.address` is set. +**[7]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. -**[8]:** The query may target multiple indices or data streams, in which case it SHOULD be a comma separated list of those. If the query doesn't target a specific index, this field MUST NOT be set. +**[8]:** If using a port other than the default port for this DBMS and if `server.address` is set. -**[9]:** When communicating with an Elastic Cloud deployment, this should be collected from the "X-Found-Handling-Instance" HTTP response header. +**[9]:** The query may target multiple indices or data streams, in which case it SHOULD be a comma separated list of those. If the query doesn't target a specific index, this field MUST NOT be set. -**[10]:** When communicating with an Elastic Cloud deployment, this should be collected from the "X-Found-Handling-Cluster" HTTP response header. +**[10]:** When communicating with an Elastic Cloud deployment, this should be collected from the "X-Found-Handling-Instance" HTTP response header. -**[11]:** For sanitization see [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext). -For batch operations, if the individual operations are known to have the same query text then that query text SHOULD be used, otherwise all of the individual query texts SHOULD be concatenated with separator `; ` or some other database system specific separator if more applicable. -Even though parameterized query text can potentially have sensitive data, by using a parameterized query the user is giving a strong signal that any sensitive data will be passed as parameter values, and the benefit to observability of capturing the static part of the query text by default outweighs the risk. +**[11]:** When communicating with an Elastic Cloud deployment, this should be collected from the "X-Found-Handling-Cluster" HTTP response header. -**[12]:** Should be collected by default for search-type queries and only if there is sanitization that excludes sensitive information. +**[12]:** Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` SHOULD never be `1`. +This attribute has stability level RELEASE CANDIDATE. -**[13]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. +**[13]:** For sanitization see [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext). +For batch operations, if the individual operations are known to have the same query text then that query text SHOULD be used, otherwise all of the individual query texts SHOULD be concatenated with separator `; ` or some other database system specific separator if more applicable. +Even though parameterized query text can potentially have sensitive data, by using a parameterized query the user is giving a strong signal that any sensitive data will be passed as parameter values, and the benefit to observability of capturing the static part of the query text by default outweighs the risk. +This attribute has stability level RELEASE CANDIDATE. +**[14]:** Should be collected by default for search-type queries and only if there is sanitization that excludes sensitive information. +**[15]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. The following attributes can be important for making sampling decisions and SHOULD be provided **at span creation time** (if provided at all): @@ -100,7 +110,6 @@ and SHOULD be provided **at span creation time** (if provided at all): |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `http.request.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -116,8 +125,6 @@ and SHOULD be provided **at span creation time** (if provided at all): | `PUT` | PUT method. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `TRACE` | TRACE method. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - diff --git a/docs/database/hbase.md b/docs/database/hbase.md index c6cac4340f..ffc09e0651 100644 --- a/docs/database/hbase.md +++ b/docs/database/hbase.md @@ -24,29 +24,42 @@ The Semantic Conventions for [HBase](https://hbase.apache.org/) extend and overr | [`db.collection.name`](/docs/attributes-registry/db.md) | string | The HBase table name. [1] | `mytable`; `ns:table` | `Conditionally Required` If applicable. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.namespace`](/docs/attributes-registry/db.md) | string | The HBase namespace. [2] | `mynamespace` | `Conditionally Required` If applicable. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.operation.name`](/docs/attributes-registry/db.md) | string | The name of the operation or command being executed. [3] | `findAndModify`; `HMSET`; `SELECT` | `Conditionally Required` [4] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [5] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [6] | `80`; `8080`; `443` | `Conditionally Required` [7] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [8] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.response.status_code`](/docs/attributes-registry/db.md) | string | Protocol-specific response code recorded as string. [5] | `200`; `409`; `14` | `Conditionally Required` If response was received. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [6] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [7] | `80`; `8080`; `443` | `Conditionally Required` [8] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.operation.batch.size`](/docs/attributes-registry/db.md) | int | The number of queries included in a batch operation. [9] | `2`; `3`; `4` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [10] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | **[1]:** If table name includes the namespace, the `db.collection.name` SHOULD be set to the full table name. -**[2]:** When performing table-related operations, the instrumentations SHOULD extract the namespace from the table name according to the [HBase table naming conventions](https://hbase.apache.org/book.html#namespace_creation). If namespace is not provided, instrumentation SHOULD set `db.namespace` value to `default`. +**[2]:** If a database system has multiple namespace components, they SHOULD be concatenated (potentially using database system specific conventions) from most general to most specific namespace component, and more specific namespaces SHOULD NOT be captured without the more general namespaces, to ensure that "startswith" queries for the more general namespaces will be valid. +Semantic conventions for individual database systems SHOULD document what `db.namespace` means in the context of that system. +It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. +This attribute has stability level RELEASE CANDIDATE. **[3]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. If the operation name is parsed from the query text, it SHOULD be the first operation name found in the query. For batch operations, if the individual operations are known to have the same operation name then that operation name SHOULD be used prepended by `BATCH `, otherwise `db.operation.name` SHOULD be `BATCH` or some other database system specific term if more applicable. +This attribute has stability level RELEASE CANDIDATE. **[4]:** If readily available. The operation name MAY be parsed from the query text, in which case it SHOULD be the first operation name found in the query. -**[5]:** The `error.type` SHOULD match the error code returned by the database or the client library, the canonical name of exception that occurred, or another low-cardinality error identifier. Instrumentations SHOULD document the list of errors they report. +**[5]:** The status code returned by the database. Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes. +Semantic conventions for individual database systems SHOULD document what `db.response.status_code` means in the context of that system. +This attribute has stability level RELEASE CANDIDATE. -**[6]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. +**[6]:** The `error.type` SHOULD match the `db.response.status_code` returned by the database or the client library, or the canonical name of exception that occurred. +When using canonical exception type name, instrumentation SHOULD do the best effort to report the most relevant type. For example, if the original exception is wrapped into a generic one, the original exception SHOULD be preferred. +Instrumentations SHOULD document how `error.type` is populated. -**[7]:** If using a port other than the default port for this DBMS and if `server.address` is set. +**[7]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. -**[8]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. +**[8]:** If using a port other than the default port for this DBMS and if `server.address` is set. +**[9]:** Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` SHOULD never be `1`. +This attribute has stability level RELEASE CANDIDATE. +**[10]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. The following attributes can be important for making sampling decisions and SHOULD be provided **at span creation time** (if provided at all): @@ -63,8 +76,6 @@ and SHOULD be provided **at span creation time** (if provided at all): |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - diff --git a/docs/database/mariadb.md b/docs/database/mariadb.md new file mode 100644 index 0000000000..894665d15b --- /dev/null +++ b/docs/database/mariadb.md @@ -0,0 +1,138 @@ + + +# Semantic Conventions for MariaDB + +**Status**: [Release Candidate][DocumentStatus] + +The Semantic Conventions for *MariaDB* extend and override the [Database Semantic Conventions](database-spans.md). + +`db.system` MUST be set to `"mariadb"` and SHOULD be provided **at span creation time**. + +## Attributes + + + + + + + + +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | +|---|---|---|---|---|---| +| [`db.collection.name`](/docs/attributes-registry/db.md) | string | The name of the SQL table that the operation is acting upon. [1] | `users`; `dbo.products` | `Conditionally Required` [2] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.namespace`](/docs/attributes-registry/db.md) | string | The database associated with the connection. [3] | `products`; `customers` | `Conditionally Required` If available without an additional network call. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.operation.name`](/docs/attributes-registry/db.md) | string | The name of the operation or command being executed. [4] | `SELECT`; `INSERT`; `UPDATE`; `DELETE`; `CREATE`; `mystoredproc` | `Conditionally Required` [5] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.response.status_code`](/docs/attributes-registry/db.md) | string | [Maria DB error code](https://mariadb.com/kb/en/mariadb-error-code-reference/) represented as a string. [6] | `1008`; `3058` | `Conditionally Required` If response has ended with warning or an error. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [7] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [8] | `80`; `8080`; `443` | `Conditionally Required` [9] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.operation.batch.size`](/docs/attributes-registry/db.md) | int | The number of queries included in a batch operation. [10] | `2`; `3`; `4` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.query.text`](/docs/attributes-registry/db.md) | string | The database query being executed. [11] | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` | `Recommended` [12] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [13] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.query.parameter.`](/docs/attributes-registry/db.md) | string | A query parameter used in `db.query.text`, with `` being the parameter name, and the attribute value being a string representation of the parameter value. [14] | `someval`; `55` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[1]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. +If the collection name is parsed from the query text, it SHOULD be the first collection name found in the query and it SHOULD match the value provided in the query text including any schema and database name prefix. +For batch operations, if the individual operations are known to have the same collection name then that collection name SHOULD be used, otherwise `db.collection.name` SHOULD NOT be captured. +This attribute has stability level RELEASE CANDIDATE. + +**[2]:** If readily available. The collection name MAY be parsed from the query text, in which case it SHOULD be the first collection name found in the query. + +**[3]:** A connection's currently associated database may change during its lifetime, e.g. from executing `USE `. + +If instrumentation is unable to capture the connection's currently associated database on each query +without triggering an additional query to be executed (e.g. `SELECT DATABASE()`), +then it is RECOMMENDED to fallback and use the database provided when the connection was established. + +Instrumentation SHOULD document if `db.namespace` reflects the database provided when the connection was established. + +It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. + +**[4]:** This SHOULD be the SQL command such as `SELECT`, `INSERT`, `UPDATE`, `CREATE`, `DROP`. +In the case of `EXEC`, this SHOULD be the stored procedure name that is being executed. + +**[5]:** If readily available. The operation name MAY be parsed from the query text, in which case it SHOULD be the first operation name found in the query. + +**[6]:** SQL defines [SQLSTATE](https://wikipedia.org/wiki/SQLSTATE) as a database +return code which is adopted by some database systems like PostgreSQL. +See [PostgreSQL error codes](https://www.postgresql.org/docs/current/errcodes-appendix.html) +for the details. + +Other systems like MySQL, Oracle, or MS SQL Server define vendor-specific +error codes. Database SQL drivers usually provide access to both properties. +For example, in Java, the [`SQLException`](https://docs.oracle.com/javase/8/docs/api/java/sql/SQLException.html) +class reports them with `getSQLState()` and `getErrorCode()` methods. + +Instrumentations SHOULD populate the `db.response.status_code` with the +the most specific code available to them. + +Here's a non-exhaustive list of databases that report vendor-specific +codes with granularity higher than SQLSTATE (or don't report SQLSTATE +at all): + +- [DB2 SQL codes](https://www.ibm.com/docs/db2-for-zos/12?topic=codes-sql). +- [Maria DB error codes](https://mariadb.com/kb/en/mariadb-error-code-reference/) +- [Microsoft SQL Server errors](https://docs.microsoft.com/sql/relational-databases/errors-events/database-engine-events-and-errors) +- [MySQL error codes](https://dev.mysql.com/doc/mysql-errors/9.0/en/error-reference-introduction.html) +- [Oracle error codes](https://docs.oracle.com/cd/B28359_01/server.111/b28278/toc.htm) +- [SQLite result codes](https://www.sqlite.org/rescode.html) + +These systems SHOULD set the `db.response.status_code` to a +known vendor-specific error code. If only SQLSTATE is available, +it SHOULD be used. + +When multiple error codes are available and specificity is unclear, +instrumentation SHOULD set the `db.response.status_code` to the +concatenated string of all codes with '/' used as a separator. + +For example, generic DB instrumentation that detected an error and has +SQLSTATE `"42000"` and vendor-specific `1071` should set +`db.response.status_code` to `"42000/1071"`." + +**[7]:** The `error.type` SHOULD match the `db.response.status_code` returned by the database or the client library, or the canonical name of exception that occurred. +When using canonical exception type name, instrumentation SHOULD do the best effort to report the most relevant type. For example, if the original exception is wrapped into a generic one, the original exception SHOULD be preferred. +Instrumentations SHOULD document how `error.type` is populated. + +**[8]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. + +**[9]:** If using a port other than the default port for this DBMS and if `server.address` is set. + +**[10]:** Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` SHOULD never be `1`. +This attribute has stability level RELEASE CANDIDATE. + +**[11]:** For sanitization see [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext). +For batch operations, if the individual operations are known to have the same query text then that query text SHOULD be used, otherwise all of the individual query texts SHOULD be concatenated with separator `; ` or some other database system specific separator if more applicable. +Even though parameterized query text can potentially have sensitive data, by using a parameterized query the user is giving a strong signal that any sensitive data will be passed as parameter values, and the benefit to observability of capturing the static part of the query text by default outweighs the risk. +This attribute has stability level RELEASE CANDIDATE. + +**[12]:** SHOULD be collected by default only if there is sanitization that excludes sensitive information. See [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext). + +**[13]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. + +**[14]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders. +If a parameter has no name and instead is referenced only by index, then `` SHOULD be the 0-based index. +This attribute has stability level RELEASE CANDIDATE. + +The following attributes can be important for making sampling decisions +and SHOULD be provided **at span creation time** (if provided at all): + +* [`db.collection.name`](/docs/attributes-registry/db.md) +* [`db.namespace`](/docs/attributes-registry/db.md) +* [`db.operation.name`](/docs/attributes-registry/db.md) +* [`db.query.text`](/docs/attributes-registry/db.md) +* [`server.address`](/docs/attributes-registry/server.md) +* [`server.port`](/docs/attributes-registry/server.md) + +`error.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. + +| Value | Description | Stability | +|---|---|---| +| `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | + + + + + + +[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status diff --git a/docs/database/mongodb.md b/docs/database/mongodb.md index 6063a4678a..9f25c62276 100644 --- a/docs/database/mongodb.md +++ b/docs/database/mongodb.md @@ -24,27 +24,39 @@ The Semantic Conventions for [MongoDB](https://www.mongodb.com/) extend and over | [`db.collection.name`](/docs/attributes-registry/db.md) | string | The MongoDB collection being accessed within the database stated in `db.namespace`. [1] | `public.users`; `customers` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.namespace`](/docs/attributes-registry/db.md) | string | The MongoDB database name. | `customers`; `test.users` | `Conditionally Required` If available. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.operation.name`](/docs/attributes-registry/db.md) | string | The name of the command being executed. [2] | `findAndModify`; `getMore`; `update` | `Conditionally Required` [3] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [4] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [5] | `80`; `8080`; `443` | `Conditionally Required` [6] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [7] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.response.status_code`](/docs/attributes-registry/db.md) | string | [MongoDB error code](https://www.mongodb.com/docs/manual/reference/error-codes/) represented as a string. [4] | `36`; `11602` | `Conditionally Required` [5] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [6] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [7] | `80`; `8080`; `443` | `Conditionally Required` [8] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.operation.batch.size`](/docs/attributes-registry/db.md) | int | The number of queries included in a batch operation. [9] | `2`; `3`; `4` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [10] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | **[1]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. If the collection name is parsed from the query text, it SHOULD be the first collection name found in the query and it SHOULD match the value provided in the query text including any schema and database name prefix. For batch operations, if the individual operations are known to have the same collection name then that collection name SHOULD be used, otherwise `db.collection.name` SHOULD NOT be captured. +This attribute has stability level RELEASE CANDIDATE. **[2]:** See [MongoDB database commands](https://www.mongodb.com/docs/manual/reference/command/). **[3]:** If readily available. The operation name MAY be parsed from the query text, in which case it SHOULD be the first operation name found in the query. -**[4]:** The `error.type` SHOULD match the error code returned by the database or the client library, the canonical name of exception that occurred, or another low-cardinality error identifier. Instrumentations SHOULD document the list of errors they report. +**[4]:** The status code returned by the database. Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes. +Semantic conventions for individual database systems SHOULD document what `db.response.status_code` means in the context of that system. +This attribute has stability level RELEASE CANDIDATE. -**[5]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. +**[5]:** If the operation failed and error code is available. -**[6]:** If using a port other than the default port for this DBMS and if `server.address` is set. +**[6]:** The `error.type` SHOULD match the `db.response.status_code` returned by the database or the client library, or the canonical name of exception that occurred. +When using canonical exception type name, instrumentation SHOULD do the best effort to report the most relevant type. For example, if the original exception is wrapped into a generic one, the original exception SHOULD be preferred. +Instrumentations SHOULD document how `error.type` is populated. -**[7]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. +**[7]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. +**[8]:** If using a port other than the default port for this DBMS and if `server.address` is set. +**[9]:** Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` SHOULD never be `1`. +This attribute has stability level RELEASE CANDIDATE. + +**[10]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. The following attributes can be important for making sampling decisions and SHOULD be provided **at span creation time** (if provided at all): @@ -61,8 +73,6 @@ and SHOULD be provided **at span creation time** (if provided at all): |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - diff --git a/docs/database/mssql.md b/docs/database/mssql.md index 75ba20ccdf..ac80b7125b 100644 --- a/docs/database/mssql.md +++ b/docs/database/mssql.md @@ -4,7 +4,7 @@ linkTitle: MSSQL # Semantic Conventions for MSSQL -**Status**: [Experimental][DocumentStatus] +**Status**: [Release Candidate][DocumentStatus] The Semantic Conventions for the *Microsoft SQL Server* extend and override the [Database Semantic Conventions](database-spans.md). @@ -22,46 +22,67 @@ The Semantic Conventions for the *Microsoft SQL Server* extend and override the | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`db.collection.name`](/docs/attributes-registry/db.md) | string | The name of the SQL table that the operation is acting upon. [1] | `users`; `dbo.products` | `Conditionally Required` [2] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`db.namespace`](/docs/attributes-registry/db.md) | string | The name of the database, fully qualified within the server address and port. [3] | `instance1.products`; `customers` | `Conditionally Required` If available. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.namespace`](/docs/attributes-registry/db.md) | string | The database associated with the connection, qualified by the instance name. [3] | `instance1.products`; `customers` | `Conditionally Required` If available without an additional network call. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.operation.name`](/docs/attributes-registry/db.md) | string | The name of the operation or command being executed. [4] | `SELECT`; `INSERT`; `UPDATE`; `DELETE`; `CREATE`; `mystoredproc` | `Conditionally Required` [5] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [6] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [7] | `80`; `8080`; `443` | `Conditionally Required` [8] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`db.query.text`](/docs/attributes-registry/db.md) | string | The database query being executed. [9] | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` | `Recommended` [10] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [11] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`db.query.parameter.`](/docs/attributes-registry/db.md) | string | A query parameter used in `db.query.text`, with `` being the parameter name, and the attribute value being a string representation of the parameter value. [12] | `someval`; `55` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.response.status_code`](/docs/attributes-registry/db.md) | string | [Microsoft SQL Server error](https://learn.microsoft.com/sql/relational-databases/errors-events/database-engine-events-and-errors) number represented as a string. [6] | `102`; `40020` | `Conditionally Required` If response has ended with warning or an error. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [7] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [8] | `80`; `8080`; `443` | `Conditionally Required` [9] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.operation.batch.size`](/docs/attributes-registry/db.md) | int | The number of queries included in a batch operation. [10] | `2`; `3`; `4` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.query.text`](/docs/attributes-registry/db.md) | string | The database query being executed. [11] | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` | `Recommended` [12] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [13] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.query.parameter.`](/docs/attributes-registry/db.md) | string | A query parameter used in `db.query.text`, with `` being the parameter name, and the attribute value being a string representation of the parameter value. [14] | `someval`; `55` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. If the collection name is parsed from the query text, it SHOULD be the first collection name found in the query and it SHOULD match the value provided in the query text including any schema and database name prefix. For batch operations, if the individual operations are known to have the same collection name then that collection name SHOULD be used, otherwise `db.collection.name` SHOULD NOT be captured. +This attribute has stability level RELEASE CANDIDATE. **[2]:** If readily available. The collection name MAY be parsed from the query text, in which case it SHOULD be the first collection name found in the query. -**[3]:** When connecting to a default instance, `db.namespace` SHOULD be set to the name of the database. When connecting to a [named instance](https://learn.microsoft.com/sql/connect/jdbc/building-the-connection-url#named-and-multiple-sql-server-instances), `db.namespace` SHOULD be set to the combination of instance and database name following the `{instance_name}.{database_name}` pattern. -For commands that switch the database, this SHOULD be set to the target database (even if the command fails). +**[3]:** When connected to a default instance, `db.namespace` SHOULD be set to the name of +the database. When connected to a [named instance](https://learn.microsoft.com/sql/connect/jdbc/building-the-connection-url#named-and-multiple-sql-server-instances), +`db.namespace` SHOULD be set to the combination of instance and database name following the `{instance_name}.{database_name}` pattern. + +A connection's currently associated database may change during its lifetime, e.g. from executing `USE `. + +If instrumentation is unable to capture the connection's currently associated database on each query +without triggering an additional query to be executed (e.g. `SELECT DB_NAME()`), +then it is RECOMMENDED to fallback and use the database provided when the connection was established. + +Instrumentation SHOULD document if `db.namespace` reflects the database provided when the connection was established. + +It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. **[4]:** This SHOULD be the SQL command such as `SELECT`, `INSERT`, `UPDATE`, `CREATE`, `DROP`. In the case of `EXEC`, this SHOULD be the stored procedure name that is being executed. **[5]:** If readily available. The operation name MAY be parsed from the query text, in which case it SHOULD be the first operation name found in the query. -**[6]:** The `error.type` SHOULD match the error code returned by the database or the client library, the canonical name of exception that occurred, or another low-cardinality error identifier. Instrumentations SHOULD document the list of errors they report. +**[6]:** Microsoft SQL Server does not report SQLSTATE. + +**[7]:** The `error.type` SHOULD match the `db.response.status_code` returned by the database or the client library, or the canonical name of exception that occurred. +When using canonical exception type name, instrumentation SHOULD do the best effort to report the most relevant type. For example, if the original exception is wrapped into a generic one, the original exception SHOULD be preferred. +Instrumentations SHOULD document how `error.type` is populated. -**[7]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. +**[8]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. -**[8]:** If using a port other than the default port for this DBMS and if `server.address` is set. +**[9]:** If using a port other than the default port for this DBMS and if `server.address` is set. -**[9]:** For sanitization see [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext). +**[10]:** Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` SHOULD never be `1`. +This attribute has stability level RELEASE CANDIDATE. + +**[11]:** For sanitization see [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext). For batch operations, if the individual operations are known to have the same query text then that query text SHOULD be used, otherwise all of the individual query texts SHOULD be concatenated with separator `; ` or some other database system specific separator if more applicable. Even though parameterized query text can potentially have sensitive data, by using a parameterized query the user is giving a strong signal that any sensitive data will be passed as parameter values, and the benefit to observability of capturing the static part of the query text by default outweighs the risk. +This attribute has stability level RELEASE CANDIDATE. -**[10]:** SHOULD be collected by default only if there is sanitization that excludes sensitive information. See [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext). +**[12]:** SHOULD be collected by default only if there is sanitization that excludes sensitive information. See [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext). -**[11]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. +**[13]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. -**[12]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders. +**[14]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders. If a parameter has no name and instead is referenced only by index, then `` SHOULD be the 0-based index. - - +This attribute has stability level RELEASE CANDIDATE. The following attributes can be important for making sampling decisions and SHOULD be provided **at span creation time** (if provided at all): @@ -79,8 +100,6 @@ and SHOULD be provided **at span creation time** (if provided at all): |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - diff --git a/docs/database/mysql.md b/docs/database/mysql.md new file mode 100644 index 0000000000..a52bd8211c --- /dev/null +++ b/docs/database/mysql.md @@ -0,0 +1,138 @@ + + +# Semantic Conventions for MySQL + +**Status**: [Release Candidate][DocumentStatus] + +The Semantic Conventions for *MySQL* extend and override the [Database Semantic Conventions](database-spans.md). + +`db.system` MUST be set to `"mysql"` and SHOULD be provided **at span creation time**. + +## Attributes + + + + + + + + +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | +|---|---|---|---|---|---| +| [`db.collection.name`](/docs/attributes-registry/db.md) | string | The name of the SQL table that the operation is acting upon. [1] | `users`; `dbo.products` | `Conditionally Required` [2] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.namespace`](/docs/attributes-registry/db.md) | string | The database associated with the connection. [3] | `products`; `customers` | `Conditionally Required` If available without an additional network call. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.operation.name`](/docs/attributes-registry/db.md) | string | The name of the operation or command being executed. [4] | `SELECT`; `INSERT`; `UPDATE`; `DELETE`; `CREATE`; `mystoredproc` | `Conditionally Required` [5] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.response.status_code`](/docs/attributes-registry/db.md) | string | [MySQL error number](https://dev.mysql.com/doc/mysql-errors/9.0/en/error-reference-introduction.html). [6] | `1005`; `MY-010016` | `Conditionally Required` If response has ended with warning or an error. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [7] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [8] | `80`; `8080`; `443` | `Conditionally Required` [9] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.operation.batch.size`](/docs/attributes-registry/db.md) | int | The number of queries included in a batch operation. [10] | `2`; `3`; `4` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.query.text`](/docs/attributes-registry/db.md) | string | The database query being executed. [11] | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` | `Recommended` [12] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [13] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.query.parameter.`](/docs/attributes-registry/db.md) | string | A query parameter used in `db.query.text`, with `` being the parameter name, and the attribute value being a string representation of the parameter value. [14] | `someval`; `55` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[1]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. +If the collection name is parsed from the query text, it SHOULD be the first collection name found in the query and it SHOULD match the value provided in the query text including any schema and database name prefix. +For batch operations, if the individual operations are known to have the same collection name then that collection name SHOULD be used, otherwise `db.collection.name` SHOULD NOT be captured. +This attribute has stability level RELEASE CANDIDATE. + +**[2]:** If readily available. The collection name MAY be parsed from the query text, in which case it SHOULD be the first collection name found in the query. + +**[3]:** A connection's currently associated database may change during its lifetime, e.g. from executing `USE `. + +If instrumentation is unable to capture the connection's currently associated database on each query +without triggering an additional query to be executed (e.g. `SELECT DATABASE()`), +then it is RECOMMENDED to fallback and use the database provided when the connection was established. + +Instrumentation SHOULD document if `db.namespace` reflects the database provided when the connection was established. + +It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. + +**[4]:** This SHOULD be the SQL command such as `SELECT`, `INSERT`, `UPDATE`, `CREATE`, `DROP`. +In the case of `EXEC`, this SHOULD be the stored procedure name that is being executed. + +**[5]:** If readily available. The operation name MAY be parsed from the query text, in which case it SHOULD be the first operation name found in the query. + +**[6]:** SQL defines [SQLSTATE](https://wikipedia.org/wiki/SQLSTATE) as a database +return code which is adopted by some database systems like PostgreSQL. +See [PostgreSQL error codes](https://www.postgresql.org/docs/current/errcodes-appendix.html) +for the details. + +Other systems like MySQL, Oracle, or MS SQL Server define vendor-specific +error codes. Database SQL drivers usually provide access to both properties. +For example, in Java, the [`SQLException`](https://docs.oracle.com/javase/8/docs/api/java/sql/SQLException.html) +class reports them with `getSQLState()` and `getErrorCode()` methods. + +Instrumentations SHOULD populate the `db.response.status_code` with the +the most specific code available to them. + +Here's a non-exhaustive list of databases that report vendor-specific +codes with granularity higher than SQLSTATE (or don't report SQLSTATE +at all): + +- [DB2 SQL codes](https://www.ibm.com/docs/db2-for-zos/12?topic=codes-sql). +- [Maria DB error codes](https://mariadb.com/kb/en/mariadb-error-code-reference/) +- [Microsoft SQL Server errors](https://docs.microsoft.com/sql/relational-databases/errors-events/database-engine-events-and-errors) +- [MySQL error codes](https://dev.mysql.com/doc/mysql-errors/9.0/en/error-reference-introduction.html) +- [Oracle error codes](https://docs.oracle.com/cd/B28359_01/server.111/b28278/toc.htm) +- [SQLite result codes](https://www.sqlite.org/rescode.html) + +These systems SHOULD set the `db.response.status_code` to a +known vendor-specific error code. If only SQLSTATE is available, +it SHOULD be used. + +When multiple error codes are available and specificity is unclear, +instrumentation SHOULD set the `db.response.status_code` to the +concatenated string of all codes with '/' used as a separator. + +For example, generic DB instrumentation that detected an error and has +SQLSTATE `"42000"` and vendor-specific `1071` should set +`db.response.status_code` to `"42000/1071"`." + +**[7]:** The `error.type` SHOULD match the `db.response.status_code` returned by the database or the client library, or the canonical name of exception that occurred. +When using canonical exception type name, instrumentation SHOULD do the best effort to report the most relevant type. For example, if the original exception is wrapped into a generic one, the original exception SHOULD be preferred. +Instrumentations SHOULD document how `error.type` is populated. + +**[8]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. + +**[9]:** If using a port other than the default port for this DBMS and if `server.address` is set. + +**[10]:** Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` SHOULD never be `1`. +This attribute has stability level RELEASE CANDIDATE. + +**[11]:** For sanitization see [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext). +For batch operations, if the individual operations are known to have the same query text then that query text SHOULD be used, otherwise all of the individual query texts SHOULD be concatenated with separator `; ` or some other database system specific separator if more applicable. +Even though parameterized query text can potentially have sensitive data, by using a parameterized query the user is giving a strong signal that any sensitive data will be passed as parameter values, and the benefit to observability of capturing the static part of the query text by default outweighs the risk. +This attribute has stability level RELEASE CANDIDATE. + +**[12]:** SHOULD be collected by default only if there is sanitization that excludes sensitive information. See [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext). + +**[13]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. + +**[14]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders. +If a parameter has no name and instead is referenced only by index, then `` SHOULD be the 0-based index. +This attribute has stability level RELEASE CANDIDATE. + +The following attributes can be important for making sampling decisions +and SHOULD be provided **at span creation time** (if provided at all): + +* [`db.collection.name`](/docs/attributes-registry/db.md) +* [`db.namespace`](/docs/attributes-registry/db.md) +* [`db.operation.name`](/docs/attributes-registry/db.md) +* [`db.query.text`](/docs/attributes-registry/db.md) +* [`server.address`](/docs/attributes-registry/server.md) +* [`server.port`](/docs/attributes-registry/server.md) + +`error.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. + +| Value | Description | Stability | +|---|---|---| +| `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | + + + + + + +[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status diff --git a/docs/database/postgresql.md b/docs/database/postgresql.md new file mode 100644 index 0000000000..cb394a781b --- /dev/null +++ b/docs/database/postgresql.md @@ -0,0 +1,145 @@ + + +# Semantic Conventions for PostgreSQL + +**Status**: [Release Candidate][DocumentStatus] + +The Semantic Conventions for *PostgreSQL* extend and override the [Database Semantic Conventions](database-spans.md). + +`db.system` MUST be set to `"postgresql"` and SHOULD be provided **at span creation time**. + +## Attributes + + + + + + + + +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | +|---|---|---|---|---|---| +| [`db.collection.name`](/docs/attributes-registry/db.md) | string | The name of the SQL table that the operation is acting upon. [1] | `users`; `dbo.products` | `Conditionally Required` [2] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.namespace`](/docs/attributes-registry/db.md) | string | The schema associated with the connection, qualified by the database name. [3] | `mydatabase.products`; `mydatabase.customers` | `Conditionally Required` If available without an additional network call. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.operation.name`](/docs/attributes-registry/db.md) | string | The name of the operation or command being executed. [4] | `SELECT`; `INSERT`; `UPDATE`; `DELETE`; `CREATE`; `mystoredproc` | `Conditionally Required` [5] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.response.status_code`](/docs/attributes-registry/db.md) | string | [PostgreSQL error code](https://www.postgresql.org/docs/current/errcodes-appendix.html). [6] | `08000`; `08P01` | `Conditionally Required` If response has ended with warning or an error. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [7] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [8] | `80`; `8080`; `443` | `Conditionally Required` [9] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.operation.batch.size`](/docs/attributes-registry/db.md) | int | The number of queries included in a batch operation. [10] | `2`; `3`; `4` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.query.text`](/docs/attributes-registry/db.md) | string | The database query being executed. [11] | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` | `Recommended` [12] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [13] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.query.parameter.`](/docs/attributes-registry/db.md) | string | A query parameter used in `db.query.text`, with `` being the parameter name, and the attribute value being a string representation of the parameter value. [14] | `someval`; `55` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[1]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. +If the collection name is parsed from the query text, it SHOULD be the first collection name found in the query and it SHOULD match the value provided in the query text including any schema and database name prefix. +For batch operations, if the individual operations are known to have the same collection name then that collection name SHOULD be used, otherwise `db.collection.name` SHOULD NOT be captured. +This attribute has stability level RELEASE CANDIDATE. + +**[2]:** If readily available. The collection name MAY be parsed from the query text, in which case it SHOULD be the first collection name found in the query. + +**[3]:** `db.namespace` SHOULD be set to the combination of database and schema name following the `{database}.{schema}` pattern. + +A connection's currently associated database may change during its lifetime, e.g. from executing `SET search_path TO `. +If the search path has multiple schemas, the first schema in the search path SHOULD be used. + +If instrumentation is unable to capture the connection's currently associated schema on each query +without triggering an additional query to be executed (e.g. `SELECT current_schema()`), +then it is RECOMMENDED to fallback and use the schema provided when the connection was established. + +Instrumentation SHOULD document if `db.namespace` reflects the schema provided when the connection was established. + +Instrumentation MAY use the user name when the connection was established as a stand-in for the schema name. + +Instrumentation SHOULD document if `db.namespace` reflects the user provided when the connection was established. + +It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. + +**[4]:** This SHOULD be the SQL command such as `SELECT`, `INSERT`, `UPDATE`, `CREATE`, `DROP`. +In the case of `EXEC`, this SHOULD be the stored procedure name that is being executed. + +**[5]:** If readily available. The operation name MAY be parsed from the query text, in which case it SHOULD be the first operation name found in the query. + +**[6]:** SQL defines [SQLSTATE](https://wikipedia.org/wiki/SQLSTATE) as a database +return code which is adopted by some database systems like PostgreSQL. +See [PostgreSQL error codes](https://www.postgresql.org/docs/current/errcodes-appendix.html) +for the details. + +Other systems like MySQL, Oracle, or MS SQL Server define vendor-specific +error codes. Database SQL drivers usually provide access to both properties. +For example, in Java, the [`SQLException`](https://docs.oracle.com/javase/8/docs/api/java/sql/SQLException.html) +class reports them with `getSQLState()` and `getErrorCode()` methods. + +Instrumentations SHOULD populate the `db.response.status_code` with the +the most specific code available to them. + +Here's a non-exhaustive list of databases that report vendor-specific +codes with granularity higher than SQLSTATE (or don't report SQLSTATE +at all): + +- [DB2 SQL codes](https://www.ibm.com/docs/db2-for-zos/12?topic=codes-sql). +- [Maria DB error codes](https://mariadb.com/kb/en/mariadb-error-code-reference/) +- [Microsoft SQL Server errors](https://docs.microsoft.com/sql/relational-databases/errors-events/database-engine-events-and-errors) +- [MySQL error codes](https://dev.mysql.com/doc/mysql-errors/9.0/en/error-reference-introduction.html) +- [Oracle error codes](https://docs.oracle.com/cd/B28359_01/server.111/b28278/toc.htm) +- [SQLite result codes](https://www.sqlite.org/rescode.html) + +These systems SHOULD set the `db.response.status_code` to a +known vendor-specific error code. If only SQLSTATE is available, +it SHOULD be used. + +When multiple error codes are available and specificity is unclear, +instrumentation SHOULD set the `db.response.status_code` to the +concatenated string of all codes with '/' used as a separator. + +For example, generic DB instrumentation that detected an error and has +SQLSTATE `"42000"` and vendor-specific `1071` should set +`db.response.status_code` to `"42000/1071"`." + +**[7]:** The `error.type` SHOULD match the `db.response.status_code` returned by the database or the client library, or the canonical name of exception that occurred. +When using canonical exception type name, instrumentation SHOULD do the best effort to report the most relevant type. For example, if the original exception is wrapped into a generic one, the original exception SHOULD be preferred. +Instrumentations SHOULD document how `error.type` is populated. + +**[8]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. + +**[9]:** If using a port other than the default port for this DBMS and if `server.address` is set. + +**[10]:** Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` SHOULD never be `1`. +This attribute has stability level RELEASE CANDIDATE. + +**[11]:** For sanitization see [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext). +For batch operations, if the individual operations are known to have the same query text then that query text SHOULD be used, otherwise all of the individual query texts SHOULD be concatenated with separator `; ` or some other database system specific separator if more applicable. +Even though parameterized query text can potentially have sensitive data, by using a parameterized query the user is giving a strong signal that any sensitive data will be passed as parameter values, and the benefit to observability of capturing the static part of the query text by default outweighs the risk. +This attribute has stability level RELEASE CANDIDATE. + +**[12]:** SHOULD be collected by default only if there is sanitization that excludes sensitive information. See [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext). + +**[13]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. + +**[14]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders. +If a parameter has no name and instead is referenced only by index, then `` SHOULD be the 0-based index. +This attribute has stability level RELEASE CANDIDATE. + +The following attributes can be important for making sampling decisions +and SHOULD be provided **at span creation time** (if provided at all): + +* [`db.collection.name`](/docs/attributes-registry/db.md) +* [`db.namespace`](/docs/attributes-registry/db.md) +* [`db.operation.name`](/docs/attributes-registry/db.md) +* [`db.query.text`](/docs/attributes-registry/db.md) +* [`server.address`](/docs/attributes-registry/server.md) +* [`server.port`](/docs/attributes-registry/server.md) + +`error.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. + +| Value | Description | Stability | +|---|---|---| +| `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | + + + + + + +[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status diff --git a/docs/database/redis.md b/docs/database/redis.md index f6441b7d8c..f7478e9710 100644 --- a/docs/database/redis.md +++ b/docs/database/redis.md @@ -21,45 +21,62 @@ The Semantic Conventions for [Redis](https://redis.com/) extend and override the | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| -| [`db.namespace`](/docs/attributes-registry/db.md) | string | The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select) (captured as a string). [1] | `0`; `1`; `15` | `Conditionally Required` If and only if it can be captured reliably. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.namespace`](/docs/attributes-registry/db.md) | string | The [database index] associated with the connection, represented as a string. [1] | `0`; `1`; `15` | `Conditionally Required` If and only if it can be captured reliably. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.operation.name`](/docs/attributes-registry/db.md) | string | The name of the operation or command being executed. [2] | `findAndModify`; `HMSET`; `SELECT` | `Conditionally Required` [3] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [4] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [5] | `80`; `8080`; `443` | `Conditionally Required` [6] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`db.query.text`](/docs/attributes-registry/db.md) | string | The full syntax of the Redis CLI command. [7] | `HMSET myhash field1 'Hello' field2 'World'` | `Recommended` [8] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`network.peer.address`](/docs/attributes-registry/network.md) | string | Peer address of the database node where the operation was performed. [9] | `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.response.status_code`](/docs/attributes-registry/db.md) | string | The Redis [simple error](https://redis.io/docs/latest/develop/reference/protocol-spec/#simple-errors) prefix. [4] | `ERR`; `WRONGTYPE`; `CLUSTERDOWN` | `Conditionally Required` [5] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [6] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [7] | `80`; `8080`; `443` | `Conditionally Required` [8] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.operation.batch.size`](/docs/attributes-registry/db.md) | int | The number of queries included in a batch operation. [9] | `2`; `3`; `4` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.query.text`](/docs/attributes-registry/db.md) | string | The full syntax of the Redis CLI command. [10] | `HMSET myhash field1 'Hello' field2 'World'` | `Recommended` [11] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`network.peer.address`](/docs/attributes-registry/network.md) | string | Peer address of the database node where the operation was performed. [12] | `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`network.peer.port`](/docs/attributes-registry/network.md) | int | Peer port number of the network connection. | `65123` | `Recommended` if and only if `network.peer.address` is set. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [10] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`db.query.parameter.`](/docs/attributes-registry/db.md) | string | A query parameter used in `db.query.text`, with `` being the parameter name, and the attribute value being a string representation of the parameter value. [11] | `someval`; `55` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [13] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.query.parameter.`](/docs/attributes-registry/db.md) | string | A query parameter used in `db.query.text`, with `` being the parameter name, and the attribute value being a string representation of the parameter value. [14] | `someval`; `55` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -**[1]:** The database index for current connection can be changed by the application dynamically. Instrumentations MAY use the initial database index provided in the connection string and keep track of the currently selected database to capture the `db.namespace`. -Instrumentations SHOULD NOT set this attribute if capturing it would require additional network calls to Redis. -For commands that switch the database, this SHOULD be set to the target database (even if the command fails). +**[1]:** A connection's currently associated database index may change during its lifetime, e.g. from executing `SELECT `. + +If instrumentation is unable to capture the connection's currently associated database index on each query +without triggering an additional query to be executed, +then it is RECOMMENDED to fallback and use the database index provided when the connection was established. + +Instrumentation SHOULD document if `db.namespace` reflects the database index provided when the connection was established. **[2]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. If the operation name is parsed from the query text, it SHOULD be the first operation name found in the query. For batch operations, if the individual operations are known to have the same operation name then that operation name SHOULD be used prepended by `BATCH `, otherwise `db.operation.name` SHOULD be `BATCH` or some other database system specific term if more applicable. +This attribute has stability level RELEASE CANDIDATE. **[3]:** If readily available. The operation name MAY be parsed from the query text, in which case it SHOULD be the first operation name found in the query. -**[4]:** The `error.type` SHOULD match the error code returned by the database or the client library, the canonical name of exception that occurred, or another low-cardinality error identifier. Instrumentations SHOULD document the list of errors they report. +**[4]:** The status code returned by the database. Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes. +Semantic conventions for individual database systems SHOULD document what `db.response.status_code` means in the context of that system. +This attribute has stability level RELEASE CANDIDATE. -**[5]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. +**[5]:** If the operation failed and status code is available. -**[6]:** If using a port other than the default port for this DBMS and if `server.address` is set. +**[6]:** The `error.type` SHOULD match the `db.response.status_code` returned by the database or the client library, or the canonical name of exception that occurred. +When using canonical exception type name, instrumentation SHOULD do the best effort to report the most relevant type. For example, if the original exception is wrapped into a generic one, the original exception SHOULD be preferred. +Instrumentations SHOULD document how `error.type` is populated. -**[7]:** For **Redis**, the value provided for `db.query.text` SHOULD correspond to the syntax of the Redis CLI. If, for example, the [`HMSET` command](https://redis.io/commands/hmset) is invoked, `"HMSET myhash field1 'Hello' field2 'World'"` would be a suitable value for `db.query.text`. +**[7]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. -**[8]:** Non-parameterized query text SHOULD NOT be collected by default unless there is sanitization that excludes sensitive data, e.g. by redacting all literal values present in the query text. -Parameterized query text SHOULD be collected by default (the query parameter values themselves are opt-in, see [`db.query.parameter.`](../../docs/attributes-registry/db.md)). +**[8]:** If using a port other than the default port for this DBMS and if `server.address` is set. -**[9]:** If a database operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. +**[9]:** Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` SHOULD never be `1`. +This attribute has stability level RELEASE CANDIDATE. -**[10]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. +**[10]:** For **Redis**, the value provided for `db.query.text` SHOULD correspond to the syntax of the Redis CLI. If, for example, the [`HMSET` command](https://redis.io/commands/hmset) is invoked, `"HMSET myhash field1 'Hello' field2 'World'"` would be a suitable value for `db.query.text`. -**[11]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders. -If a parameter has no name and instead is referenced only by index, then `` SHOULD be the 0-based index. +**[11]:** Non-parameterized query text SHOULD NOT be collected by default unless there is sanitization that excludes sensitive data, e.g. by redacting all literal values present in the query text. +Parameterized query text SHOULD be collected by default (the query parameter values themselves are opt-in, see [`db.query.parameter.`](../../docs/attributes-registry/db.md)). +**[12]:** If a database operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. +**[13]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. + +**[14]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders. +If a parameter has no name and instead is referenced only by index, then `` SHOULD be the 0-based index. +This attribute has stability level RELEASE CANDIDATE. The following attributes can be important for making sampling decisions and SHOULD be provided **at span creation time** (if provided at all): @@ -76,8 +93,6 @@ and SHOULD be provided **at span creation time** (if provided at all): |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - diff --git a/docs/database/sql.md b/docs/database/sql.md index bca96789ce..1a95d04e92 100644 --- a/docs/database/sql.md +++ b/docs/database/sql.md @@ -4,7 +4,7 @@ linkTitle: SQL # Semantic Conventions for SQL Databases -**Status**: [Experimental][DocumentStatus] +**Status**: [Release Candidate][DocumentStatus] The SQL databases Semantic Conventions describes how common [Database Semantic Conventions](database-spans.md) apply to SQL databases. @@ -46,21 +46,24 @@ Instrumentations applied to generic SQL drivers SHOULD adhere to SQL semantic co | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`db.collection.name`](/docs/attributes-registry/db.md) | string | The name of the SQL table that the operation is acting upon. [1] | `users`; `dbo.products` | `Conditionally Required` [2] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`db.namespace`](/docs/attributes-registry/db.md) | string | The name of the database, fully qualified within the server address and port. [3] | `customers`; `test.users` | `Conditionally Required` If available. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.namespace`](/docs/attributes-registry/db.md) | string | The database associated with the connection, fully qualified within the server address and port. [3] | `customers`; `test.users` | `Conditionally Required` If available without an additional network call. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.operation.name`](/docs/attributes-registry/db.md) | string | The name of the operation or command being executed. [4] | `SELECT`; `INSERT`; `UPDATE`; `DELETE`; `CREATE`; `mystoredproc` | `Conditionally Required` [5] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [6] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [7] | `80`; `8080`; `443` | `Conditionally Required` [8] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`db.query.text`](/docs/attributes-registry/db.md) | string | The database query being executed. [9] | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` | `Recommended` [10] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [11] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`db.query.parameter.`](/docs/attributes-registry/db.md) | string | A query parameter used in `db.query.text`, with `` being the parameter name, and the attribute value being a string representation of the parameter value. [12] | `someval`; `55` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.response.status_code`](/docs/attributes-registry/db.md) | string | Database response code recorded as string. [6] | `ORA-17027`; `1052`; `2201B` | `Conditionally Required` If response has ended with warning or an error. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [7] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [8] | `80`; `8080`; `443` | `Conditionally Required` [9] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.operation.batch.size`](/docs/attributes-registry/db.md) | int | The number of queries included in a batch operation. [10] | `2`; `3`; `4` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.query.text`](/docs/attributes-registry/db.md) | string | The database query being executed. [11] | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` | `Recommended` [12] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [13] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.query.parameter.`](/docs/attributes-registry/db.md) | string | A query parameter used in `db.query.text`, with `` being the parameter name, and the attribute value being a string representation of the parameter value. [14] | `someval`; `55` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. If the collection name is parsed from the query text, it SHOULD be the first collection name found in the query and it SHOULD match the value provided in the query text including any schema and database name prefix. For batch operations, if the individual operations are known to have the same collection name then that collection name SHOULD be used, otherwise `db.collection.name` SHOULD NOT be captured. +This attribute has stability level RELEASE CANDIDATE. **[2]:** If readily available. The collection name MAY be parsed from the query text, in which case it SHOULD be the first collection name found in the query. -**[3]:** If a database system has multiple namespace components, they SHOULD be concatenated +**[3]:** If a database system has multiple namespace components (e.g. schema name and database name), they SHOULD be concatenated (potentially using database system specific conventions) from most general to most specific namespace component, and more specific namespaces SHOULD NOT be captured without the more general namespaces, to ensure that "startswith" queries for the more general namespaces will be valid. @@ -68,41 +71,80 @@ the more general namespaces, to ensure that "startswith" queries for the more ge Unless specified by the system-specific semantic convention, the `db.namespace` attribute matches the name of the database being accessed. -The database name can usually be obtained with database driver API such as -[JDBC `Connection.getCatalog()`](https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html#getCatalog--) -or [.NET `SqlConnection.Database`](https://learn.microsoft.com/dotnet/api/system.data.sqlclient.sqlconnection.database). +A connection's currently associated database may change during its lifetime, e.g. from executing `USE `. -Some database drivers don't detect when the current database is changed (for example, with SQL `USE database` statement). -Instrumentations that parse SQL statements MAY use the database name provided -in the connection string and keep track of the currently selected database name. +If instrumentation is unable to capture the connection's currently associated database on each query +without triggering an additional query to be executed (e.g. `SELECT DATABASE()`), +then it is RECOMMENDED to fallback and use the database provided when the connection was established. -For commands that switch the database, this SHOULD be set to the target database (even if the command fails). +Instrumentation SHOULD document if `db.namespace` reflects the database provided when the connection was established. -If instrumentation cannot reliably determine the current database name, it SHOULD NOT set `db.namespace`. +It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. **[4]:** This SHOULD be the SQL command such as `SELECT`, `INSERT`, `UPDATE`, `CREATE`, `DROP`. In the case of `EXEC`, this SHOULD be the stored procedure name that is being executed. **[5]:** If readily available. The operation name MAY be parsed from the query text, in which case it SHOULD be the first operation name found in the query. -**[6]:** The `error.type` SHOULD match the error code returned by the database or the client library, the canonical name of exception that occurred, or another low-cardinality error identifier. Instrumentations SHOULD document the list of errors they report. +**[6]:** SQL defines [SQLSTATE](https://wikipedia.org/wiki/SQLSTATE) as a database +return code which is adopted by some database systems like PostgreSQL. +See [PostgreSQL error codes](https://www.postgresql.org/docs/current/errcodes-appendix.html) +for the details. -**[7]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. +Other systems like MySQL, Oracle, or MS SQL Server define vendor-specific +error codes. Database SQL drivers usually provide access to both properties. +For example, in Java, the [`SQLException`](https://docs.oracle.com/javase/8/docs/api/java/sql/SQLException.html) +class reports them with `getSQLState()` and `getErrorCode()` methods. -**[8]:** If using a port other than the default port for this DBMS and if `server.address` is set. +Instrumentations SHOULD populate the `db.response.status_code` with the +the most specific code available to them. -**[9]:** For sanitization see [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext). +Here's a non-exhaustive list of databases that report vendor-specific +codes with granularity higher than SQLSTATE (or don't report SQLSTATE +at all): + +- [DB2 SQL codes](https://www.ibm.com/docs/db2-for-zos/12?topic=codes-sql). +- [Maria DB error codes](https://mariadb.com/kb/en/mariadb-error-code-reference/) +- [Microsoft SQL Server errors](https://docs.microsoft.com/sql/relational-databases/errors-events/database-engine-events-and-errors) +- [MySQL error codes](https://dev.mysql.com/doc/mysql-errors/9.0/en/error-reference-introduction.html) +- [Oracle error codes](https://docs.oracle.com/cd/B28359_01/server.111/b28278/toc.htm) +- [SQLite result codes](https://www.sqlite.org/rescode.html) + +These systems SHOULD set the `db.response.status_code` to a +known vendor-specific error code. If only SQLSTATE is available, +it SHOULD be used. + +When multiple error codes are available and specificity is unclear, +instrumentation SHOULD set the `db.response.status_code` to the +concatenated string of all codes with '/' used as a separator. + +For example, generic DB instrumentation that detected an error and has +SQLSTATE `"42000"` and vendor-specific `1071` should set +`db.response.status_code` to `"42000/1071"`." + +**[7]:** The `error.type` SHOULD match the `db.response.status_code` returned by the database or the client library, or the canonical name of exception that occurred. +When using canonical exception type name, instrumentation SHOULD do the best effort to report the most relevant type. For example, if the original exception is wrapped into a generic one, the original exception SHOULD be preferred. +Instrumentations SHOULD document how `error.type` is populated. + +**[8]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. + +**[9]:** If using a port other than the default port for this DBMS and if `server.address` is set. + +**[10]:** Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` SHOULD never be `1`. +This attribute has stability level RELEASE CANDIDATE. + +**[11]:** For sanitization see [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext). For batch operations, if the individual operations are known to have the same query text then that query text SHOULD be used, otherwise all of the individual query texts SHOULD be concatenated with separator `; ` or some other database system specific separator if more applicable. Even though parameterized query text can potentially have sensitive data, by using a parameterized query the user is giving a strong signal that any sensitive data will be passed as parameter values, and the benefit to observability of capturing the static part of the query text by default outweighs the risk. +This attribute has stability level RELEASE CANDIDATE. -**[10]:** SHOULD be collected by default only if there is sanitization that excludes sensitive information. See [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext). +**[12]:** SHOULD be collected by default only if there is sanitization that excludes sensitive information. See [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext). -**[11]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. +**[13]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. -**[12]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders. +**[14]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders. If a parameter has no name and instead is referenced only by index, then `` SHOULD be the 0-based index. - - +This attribute has stability level RELEASE CANDIDATE. The following attributes can be important for making sampling decisions and SHOULD be provided **at span creation time** (if provided at all): @@ -119,8 +161,6 @@ and SHOULD be provided **at span creation time** (if provided at all): |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - diff --git a/docs/dns/dns-metrics.md b/docs/dns/dns-metrics.md index 8de3632705..ca0c7555e7 100644 --- a/docs/dns/dns-metrics.md +++ b/docs/dns/dns-metrics.md @@ -24,7 +24,7 @@ This document defines semantic conventions to apply when instrumenting DNS queri This metric is optional. This metric SHOULD be specified with -[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/metrics/api.md#instrument-advisory-parameters) +[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/metrics/api.md#instrument-advisory-parameters) of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 ]`. @@ -47,16 +47,12 @@ of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 **[2]:** Instrumentations SHOULD use error code such as one of errors reported by `getaddrinfo`([Linux or other POSIX systems](https://man7.org/linux/man-pages/man3/getaddrinfo.3.html) / [Windows](https://learn.microsoft.com/windows/win32/api/ws2tcpip/nf-ws2tcpip-getaddrinfo)) or one reported by the runtime or client library. If error code is not available, the full name of exception type SHOULD be used. - - `error.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - diff --git a/docs/dotnet/dotnet-aspnetcore-metrics.md b/docs/dotnet/dotnet-aspnetcore-metrics.md index 3b9829258a..4593cede39 100644 --- a/docs/dotnet/dotnet-aspnetcore-metrics.md +++ b/docs/dotnet/dotnet-aspnetcore-metrics.md @@ -43,10 +43,8 @@ All routing metrics are reported by the `Microsoft.AspNetCore.Routing` meter. | -------- | --------------- | ----------- | -------------- | --------- | | `aspnetcore.routing.match_attempts` | Counter | `{match_attempt}` | Number of requests that were attempted to be matched to an endpoint. [1] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - **[1]:** Meter name: `Microsoft.AspNetCore.Routing`; Added in: ASP.NET Core 8.0 - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`aspnetcore.routing.match_status`](/docs/attributes-registry/aspnetcore.md) | string | Match result - success or failure | `success`; `failure` | `Required` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | @@ -56,8 +54,6 @@ All routing metrics are reported by the `Microsoft.AspNetCore.Routing` meter. **[1]:** MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it. SHOULD include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one. - - `aspnetcore.routing.match_status` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -65,8 +61,6 @@ SHOULD include the [application root](/docs/http/http-spans.md#http-server-defin | `failure` | Match failed | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `success` | Match succeeded | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - @@ -89,10 +83,8 @@ Exceptions Metric is reported by the `Microsoft.AspNetCore.Diagnostics` meter. | -------- | --------------- | ----------- | -------------- | --------- | | `aspnetcore.diagnostics.exceptions` | Counter | `{exception}` | Number of exceptions caught by exception handling middleware. [1] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - **[1]:** Meter name: `Microsoft.AspNetCore.Diagnostics`; Added in: ASP.NET Core 8.0 - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`aspnetcore.diagnostics.exception.result`](/docs/attributes-registry/aspnetcore.md) | string | ASP.NET Core exception middleware handling result | `handled`; `unhandled` | `Required` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | @@ -121,8 +113,6 @@ it's RECOMMENDED to: **[2]:** if and only if the exception was handled by this handler. - - `aspnetcore.diagnostics.exception.result` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -132,15 +122,12 @@ it's RECOMMENDED to: | `skipped` | Exception handling was skipped because the response had started. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `unhandled` | Exception was not handled by the exception handling middleware. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `error.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - @@ -163,19 +150,14 @@ All rate-limiting metrics are reported by the `Microsoft.AspNetCore.RateLimiting | -------- | --------------- | ----------- | -------------- | --------- | | `aspnetcore.rate_limiting.active_request_leases` | UpDownCounter | `{request}` | Number of requests that are currently active on the server that hold a rate limiting lease. [1] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - **[1]:** Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0 - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`aspnetcore.rate_limiting.policy`](/docs/attributes-registry/aspnetcore.md) | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | `Conditionally Required` [1] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | **[1]:** if the matched endpoint for the request had a rate-limiting policy. - - - @@ -184,7 +166,7 @@ All rate-limiting metrics are reported by the `Microsoft.AspNetCore.RateLimiting ### Metric: `aspnetcore.rate_limiting.request_lease.duration` this metric SHOULD be specified with -[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/metrics/api.md#instrument-advisory-parameters) +[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/metrics/api.md#instrument-advisory-parameters) of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 ]`. @@ -198,19 +180,14 @@ of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 | -------- | --------------- | ----------- | -------------- | --------- | | `aspnetcore.rate_limiting.request_lease.duration` | Histogram | `s` | The duration of rate limiting lease held by requests on the server. [1] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - **[1]:** Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0 - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`aspnetcore.rate_limiting.policy`](/docs/attributes-registry/aspnetcore.md) | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | `Conditionally Required` [1] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | **[1]:** if the matched endpoint for the request had a rate-limiting policy. - - - @@ -229,19 +206,14 @@ of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 | -------- | --------------- | ----------- | -------------- | --------- | | `aspnetcore.rate_limiting.queued_requests` | UpDownCounter | `{request}` | Number of requests that are currently queued, waiting to acquire a rate limiting lease. [1] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - **[1]:** Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0 - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`aspnetcore.rate_limiting.policy`](/docs/attributes-registry/aspnetcore.md) | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | `Conditionally Required` [1] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | **[1]:** if the matched endpoint for the request had a rate-limiting policy. - - - @@ -250,7 +222,7 @@ of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 ### Metric: `aspnetcore.rate_limiting.request.time_in_queue` this metric SHOULD be specified with -[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/metrics/api.md#instrument-advisory-parameters) +[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/metrics/api.md#instrument-advisory-parameters) of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 ]`. @@ -264,10 +236,8 @@ of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 | -------- | --------------- | ----------- | -------------- | --------- | | `aspnetcore.rate_limiting.request.time_in_queue` | Histogram | `s` | The time the request spent in a queue waiting to acquire a rate limiting lease. [1] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - **[1]:** Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0 - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`aspnetcore.rate_limiting.result`](/docs/attributes-registry/aspnetcore.md) | string | Rate-limiting result, shows whether the lease was acquired or contains a rejection reason | `acquired`; `request_canceled` | `Required` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | @@ -275,8 +245,6 @@ of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 **[1]:** if the matched endpoint for the request had a rate-limiting policy. - - `aspnetcore.rate_limiting.result` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -286,8 +254,6 @@ of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 | `global_limiter` | Lease request was rejected by the global limiter | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `request_canceled` | Lease request was canceled | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - @@ -306,7 +272,6 @@ of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 | -------- | --------------- | ----------- | -------------- | --------- | | `aspnetcore.rate_limiting.requests` | Counter | `{request}` | Number of requests that tried to acquire a rate limiting lease. [1] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - **[1]:** Requests could be: * Rejected by global or endpoint rate limiting policies @@ -314,7 +279,6 @@ of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0 - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`aspnetcore.rate_limiting.result`](/docs/attributes-registry/aspnetcore.md) | string | Rate-limiting result, shows whether the lease was acquired or contains a rejection reason | `acquired`; `request_canceled` | `Required` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | @@ -322,8 +286,6 @@ Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0 **[1]:** if the matched endpoint for the request had a rate-limiting policy. - - `aspnetcore.rate_limiting.result` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -333,8 +295,6 @@ Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0 | `global_limiter` | Lease request was rejected by the global limiter | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `request_canceled` | Lease request was canceled | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - diff --git a/docs/dotnet/dotnet-dns-metrics.md b/docs/dotnet/dotnet-dns-metrics.md index 9da0ca43e0..332a0aa02d 100644 --- a/docs/dotnet/dotnet-dns-metrics.md +++ b/docs/dotnet/dotnet-dns-metrics.md @@ -20,7 +20,7 @@ This article defines semantic conventions for DNS metrics emitted by .NET. ### Metric: `dns.lookup.duration` This metric SHOULD be specified with -[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/metrics/api.md#instrument-advisory-parameters) +[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/metrics/api.md#instrument-advisory-parameters) of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 ]`. diff --git a/docs/dotnet/dotnet-http-metrics.md b/docs/dotnet/dotnet-http-metrics.md index e6633d60e7..15553651b1 100644 --- a/docs/dotnet/dotnet-http-metrics.md +++ b/docs/dotnet/dotnet-http-metrics.md @@ -77,7 +77,7 @@ Notes: ### Metric: `http.client.connection.duration` this metric SHOULD be specified with -[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/metrics/api.md#instrument-advisory-parameters) +[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/metrics/api.md#instrument-advisory-parameters) of `[ 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 30, 60, 120, 300 ]`. @@ -106,7 +106,7 @@ of `[ 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 30, 60, 120, 300 ]`. ### Metric: `http.client.request.time_in_queue` this metric SHOULD be specified with -[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/metrics/api.md#instrument-advisory-parameters) +[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/metrics/api.md#instrument-advisory-parameters) of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 ]`. diff --git a/docs/dotnet/dotnet-kestrel-metrics.md b/docs/dotnet/dotnet-kestrel-metrics.md index 5400e57d38..10d5866727 100644 --- a/docs/dotnet/dotnet-kestrel-metrics.md +++ b/docs/dotnet/dotnet-kestrel-metrics.md @@ -43,10 +43,8 @@ In case instrumentation does not recognize `EndPoint` implementation, it sets th | -------- | --------------- | ----------- | -------------- | --------- | | `kestrel.active_connections` | UpDownCounter | `{connection}` | Number of connections that are currently active on the server. [1] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - **[1]:** Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`network.transport`](/docs/attributes-registry/network.md) | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). [1] | `tcp`; `unix` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | @@ -66,8 +64,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. **[4]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - - `network.transport` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -78,7 +74,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | `udp` | UDP | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `unix` | Unix domain socket | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `network.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -86,8 +81,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | `ipv4` | IPv4 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `ipv6` | IPv6 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - @@ -96,7 +89,7 @@ different processes could be listening on TCP port 12345 and UDP port 12345. ## Metric: `kestrel.connection.duration` this metric SHOULD be specified with -[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/metrics/api.md#instrument-advisory-parameters) +[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/metrics/api.md#instrument-advisory-parameters) of `[ 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 30, 60, 120, 300 ]`. @@ -110,10 +103,8 @@ of `[ 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 30, 60, 120, 300 ]`. | -------- | --------------- | ----------- | -------------- | --------- | | `kestrel.connection.duration` | Histogram | `s` | The duration of connections on the server. [1] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - **[1]:** Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`error.type`](/docs/attributes-registry/error.md) | string | The full name of exception type. [1] | `System.OperationCanceledException`; `Contoso.MyException` | `Conditionally Required` if and only if an error has occurred. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | @@ -143,15 +134,12 @@ different processes could be listening on TCP port 12345 and UDP port 12345. **[7]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - - `error.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `network.transport` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -162,7 +150,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | `udp` | UDP | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `unix` | Unix domain socket | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `network.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -170,8 +157,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | `ipv4` | IPv4 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `ipv6` | IPv6 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - @@ -190,11 +175,9 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | -------- | --------------- | ----------- | -------------- | --------- | | `kestrel.rejected_connections` | Counter | `{connection}` | Number of connections rejected by the server. [1] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - **[1]:** Connections are rejected when the currently active count exceeds the value configured with `MaxConcurrentConnections`. Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`network.transport`](/docs/attributes-registry/network.md) | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). [1] | `tcp`; `unix` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | @@ -214,8 +197,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. **[4]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - - `network.transport` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -226,7 +207,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | `udp` | UDP | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `unix` | Unix domain socket | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `network.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -234,8 +214,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | `ipv4` | IPv4 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `ipv6` | IPv6 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - @@ -254,10 +232,8 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | -------- | --------------- | ----------- | -------------- | --------- | | `kestrel.queued_connections` | UpDownCounter | `{connection}` | Number of connections that are currently queued and are waiting to start. [1] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - **[1]:** Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`network.transport`](/docs/attributes-registry/network.md) | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). [1] | `tcp`; `unix` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | @@ -277,8 +253,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. **[4]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - - `network.transport` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -289,7 +263,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | `udp` | UDP | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `unix` | Unix domain socket | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `network.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -297,8 +270,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | `ipv4` | IPv4 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `ipv6` | IPv6 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - @@ -317,10 +288,8 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | -------- | --------------- | ----------- | -------------- | --------- | | `kestrel.queued_requests` | UpDownCounter | `{request}` | Number of HTTP requests on multiplexed connections (HTTP/2 and HTTP/3) that are currently queued and are waiting to start. [1] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - **[1]:** Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`network.protocol.name`](/docs/attributes-registry/network.md) | string | [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. [1] | `http`; `web_sockets` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | @@ -346,8 +315,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. **[6]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - - `network.transport` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -358,7 +325,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | `udp` | UDP | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `unix` | Unix domain socket | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `network.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -366,8 +332,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | `ipv4` | IPv4 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `ipv6` | IPv6 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - @@ -386,12 +350,10 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | -------- | --------------- | ----------- | -------------- | --------- | | `kestrel.upgraded_connections` | UpDownCounter | `{connection}` | Number of connections that are currently upgraded (WebSockets). . [1] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - **[1]:** The counter only tracks HTTP/1.1 connections. Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`network.transport`](/docs/attributes-registry/network.md) | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). [1] | `tcp`; `unix` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | @@ -411,8 +373,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. **[4]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - - `network.transport` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -423,7 +383,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | `udp` | UDP | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `unix` | Unix domain socket | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `network.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -431,8 +390,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | `ipv4` | IPv4 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `ipv6` | IPv6 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - @@ -441,7 +398,7 @@ different processes could be listening on TCP port 12345 and UDP port 12345. ## Metric: `kestrel.tls_handshake.duration` this metric SHOULD be specified with -[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/metrics/api.md#instrument-advisory-parameters) +[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/metrics/api.md#instrument-advisory-parameters) of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 ]`. @@ -455,10 +412,8 @@ of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 | -------- | --------------- | ----------- | -------------- | --------- | | `kestrel.tls_handshake.duration` | Histogram | `s` | The duration of TLS handshakes on the server. [1] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - **[1]:** Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`error.type`](/docs/attributes-registry/error.md) | string | The full name of exception type. [1] | `System.OperationCanceledException`; `Contoso.MyException` | `Conditionally Required` if and only if an error has occurred. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | @@ -482,15 +437,12 @@ different processes could be listening on TCP port 12345 and UDP port 12345. **[5]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - - `error.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `network.transport` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -501,7 +453,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | `udp` | UDP | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `unix` | Unix domain socket | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `network.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -509,8 +460,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | `ipv4` | IPv4 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `ipv6` | IPv6 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - @@ -529,10 +478,8 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | -------- | --------------- | ----------- | -------------- | --------- | | `kestrel.active_tls_handshakes` | UpDownCounter | `{handshake}` | Number of TLS handshakes that are currently in progress on the server. [1] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - **[1]:** Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`network.transport`](/docs/attributes-registry/network.md) | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). [1] | `tcp`; `unix` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | @@ -552,8 +499,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. **[4]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - - `network.transport` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -564,7 +509,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | `udp` | UDP | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `unix` | Unix domain socket | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `network.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -572,8 +516,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | `ipv4` | IPv4 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `ipv6` | IPv6 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - diff --git a/docs/dotnet/dotnet-signalr-metrics.md b/docs/dotnet/dotnet-signalr-metrics.md index 60de202d91..d398ef6780 100644 --- a/docs/dotnet/dotnet-signalr-metrics.md +++ b/docs/dotnet/dotnet-signalr-metrics.md @@ -18,7 +18,7 @@ This article defines semantic conventions for SignalR metrics emitted by .NET co ## Metric: `signalr.server.connection.duration` this metric SHOULD be specified with -[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/metrics/api.md#instrument-advisory-parameters) +[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/metrics/api.md#instrument-advisory-parameters) of `[ 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 30, 60, 120, 300 ]`. @@ -32,10 +32,8 @@ of `[ 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 30, 60, 120, 300 ]`. | -------- | --------------- | ----------- | -------------- | --------- | | `signalr.server.connection.duration` | Histogram | `s` | The duration of connections on the server. [1] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - **[1]:** Meter name: `Microsoft.AspNetCore.Http.Connections`; Added in: ASP.NET Core 8.0 - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`signalr.connection.status`](/docs/attributes-registry/signalr.md) | string | SignalR HTTP connection closure status. | `app_shutdown`; `timeout` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | @@ -49,7 +47,6 @@ of `[ 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 30, 60, 120, 300 ]`. | `normal_closure` | The connection was closed normally. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `timeout` | The connection was closed due to a timeout. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `signalr.transport` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -58,8 +55,6 @@ of `[ 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 30, 60, 120, 300 ]`. | `server_sent_events` | ServerSentEvents protocol | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `web_sockets` | WebSockets protocol | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - @@ -78,10 +73,8 @@ of `[ 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 30, 60, 120, 300 ]`. | -------- | --------------- | ----------- | -------------- | --------- | | `signalr.server.active_connections` | UpDownCounter | `{connection}` | Number of connections that are currently active on the server. [1] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - **[1]:** Meter name: `Microsoft.AspNetCore.Http.Connections`; Added in: ASP.NET Core 8.0 - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`signalr.connection.status`](/docs/attributes-registry/signalr.md) | string | SignalR HTTP connection closure status. | `app_shutdown`; `timeout` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | @@ -95,7 +88,6 @@ of `[ 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 30, 60, 120, 300 ]`. | `normal_closure` | The connection was closed normally. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `timeout` | The connection was closed due to a timeout. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `signalr.transport` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -104,8 +96,6 @@ of `[ 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 30, 60, 120, 300 ]`. | `server_sent_events` | ServerSentEvents protocol | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `web_sockets` | WebSockets protocol | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - diff --git a/docs/exceptions/exceptions-logs.md b/docs/exceptions/exceptions-logs.md index 1a0f774ef1..58b83c7ade 100644 --- a/docs/exceptions/exceptions-logs.md +++ b/docs/exceptions/exceptions-logs.md @@ -7,8 +7,8 @@ linkTitle: Logs **Status**: [Stable][DocumentStatus] This document defines semantic conventions for recording exceptions on -[logs](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/logs/bridge-api.md#emit-a-logrecord) and [events](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/logs/event-api.md#emit-event) -emitted through the [Logger API](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/logs/bridge-api.md#logger). +[logs](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/logs/bridge-api.md#emit-a-logrecord) and [events](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/logs/event-api.md#emit-event) +emitted through the [Logger API](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/logs/bridge-api.md#logger). @@ -21,7 +21,7 @@ emitted through the [Logger API](https://github.com/open-telemetry/opentelemetry ## Recording an Exception Exceptions SHOULD be recorded as attributes on the -[LogRecord](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/logs/data-model.md#log-and-event-record-definition) passed to the [Logger](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/logs/bridge-api.md#logger) emit +[LogRecord](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/logs/data-model.md#log-and-event-record-definition) passed to the [Logger](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/logs/bridge-api.md#logger) emit operations. Exceptions MAY be recorded on "logs" or "events" depending on the context. @@ -33,7 +33,7 @@ the language runtime. ## Attributes The table below indicates which attributes should be added to the -[LogRecord](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/logs/data-model.md#log-and-event-record-definition) and their types. +[LogRecord](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/logs/data-model.md#log-and-event-record-definition) and their types. @@ -52,9 +52,6 @@ The table below indicates which attributes should be added to the **[2]:** Required if `exception.message` is not set, recommended otherwise. - - - diff --git a/docs/exceptions/exceptions-spans.md b/docs/exceptions/exceptions-spans.md index 34fdb487c2..4fd632587c 100644 --- a/docs/exceptions/exceptions-spans.md +++ b/docs/exceptions/exceptions-spans.md @@ -23,7 +23,7 @@ An exception SHOULD be recorded as an `Event` on the span during which it occurr The name of the event MUST be `"exception"`. A typical template for an auto-instrumentation implementing this semantic convention -using an [API-provided `recordException` method](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/trace/api.md#record-exception) +using an [API-provided `recordException` method](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/trace/api.md#record-exception) could look like this (pseudo-Java): ```java @@ -80,9 +80,6 @@ even if the `exception.escaped` attribute was not set or set to false, since the event might have been recorded at a time where it was not clear whether the exception will escape. - - - diff --git a/docs/faas/aws-lambda.md b/docs/faas/aws-lambda.md index 5855204291..b65ab0b6a8 100644 --- a/docs/faas/aws-lambda.md +++ b/docs/faas/aws-lambda.md @@ -57,9 +57,6 @@ and the [cloud resource conventions][cloud]. The following AWS Lambda-specific a **[1]:** This may be different from `cloud.resource_id` if an alias is involved. - - - @@ -166,7 +163,7 @@ be ` process`. If there are multiple sources in the batch, the nam For every message in the event, the [message system attributes][] (not message attributes, which are provided by the user) SHOULD be checked for the key `AWSTraceHeader`. If it is present, an OpenTelemetry `Context` SHOULD be -parsed from the value of the attribute using the [AWS X-Ray Propagator](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/context/api-propagators.md) and +parsed from the value of the attribute using the [AWS X-Ray Propagator](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/context/api-propagators.md) and added as a link to the span. This means the span may have as many links as messages in the batch. See [compatibility](../non-normative/compatibility/aws.md#context-propagation) for more info. @@ -179,7 +176,7 @@ See [compatibility](../non-normative/compatibility/aws.md#context-propagation) f For the SQS message span, the name MUST be ` process`. The parent MUST be the `CONSUMER` span corresponding to the SQS event. The [message system attributes][] (not message attributes, which are provided by the user) SHOULD be checked for the key `AWSTraceHeader`. If it is present, an OpenTelemetry `Context` SHOULD be -parsed from the value of the attribute using the [AWS X-Ray Propagator](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/context/api-propagators.md) and +parsed from the value of the attribute using the [AWS X-Ray Propagator](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/context/api-propagators.md) and added as a link to the span. See [compatibility](../non-normative/compatibility/aws.md#context-propagation) for more info. diff --git a/docs/faas/faas-metrics.md b/docs/faas/faas-metrics.md index d436d7e078..d6dbb135c9 100644 --- a/docs/faas/faas-metrics.md +++ b/docs/faas/faas-metrics.md @@ -46,7 +46,7 @@ The following metrics are recorded by the FaaS instance. This metric is [recommended][MetricRecommended]. This metric SHOULD be specified with -[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/metrics/api.md#instrument-advisory-parameters) +[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/metrics/api.md#instrument-advisory-parameters) of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 ]`. @@ -74,8 +74,6 @@ of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 | `pubsub` | A function is set to be executed when messages are sent to a messaging system | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `timer` | A function is scheduled to be executed regularly | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -86,7 +84,7 @@ of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 This metric is [recommended][MetricRecommended]. This metric SHOULD be specified with -[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/metrics/api.md#instrument-advisory-parameters) +[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/metrics/api.md#instrument-advisory-parameters) of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 ]`. @@ -114,8 +112,6 @@ of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 | `pubsub` | A function is set to be executed when messages are sent to a messaging system | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `timer` | A function is scheduled to be executed regularly | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -150,8 +146,6 @@ This metric is [recommended][MetricRecommended]. | `pubsub` | A function is set to be executed when messages are sent to a messaging system | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `timer` | A function is scheduled to be executed regularly | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -186,8 +180,6 @@ This metric is [recommended][MetricRecommended]. | `pubsub` | A function is set to be executed when messages are sent to a messaging system | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `timer` | A function is scheduled to be executed regularly | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -222,8 +214,6 @@ This metric is [recommended][MetricRecommended]. | `pubsub` | A function is set to be executed when messages are sent to a messaging system | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `timer` | A function is scheduled to be executed regularly | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -258,8 +248,6 @@ This metric is [recommended][MetricRecommended]. | `pubsub` | A function is set to be executed when messages are sent to a messaging system | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `timer` | A function is scheduled to be executed regularly | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -294,8 +282,6 @@ This metric is [recommended][MetricRecommended]. | `pubsub` | A function is set to be executed when messages are sent to a messaging system | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `timer` | A function is scheduled to be executed regularly | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -306,7 +292,7 @@ This metric is [recommended][MetricRecommended]. This metric is [recommended][MetricRecommended]. This metric SHOULD be specified with -[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/metrics/api.md#instrument-advisory-parameters) +[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/metrics/api.md#instrument-advisory-parameters) of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 ]`. @@ -334,8 +320,6 @@ of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 | `pubsub` | A function is set to be executed when messages are sent to a messaging system | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `timer` | A function is scheduled to be executed regularly | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -370,8 +354,6 @@ This metric is [recommended][MetricRecommended]. | `pubsub` | A function is set to be executed when messages are sent to a messaging system | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `timer` | A function is scheduled to be executed regularly | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - diff --git a/docs/faas/faas-spans.md b/docs/faas/faas-spans.md index c249fcd786..225bf960ce 100644 --- a/docs/faas/faas-spans.md +++ b/docs/faas/faas-spans.md @@ -79,8 +79,6 @@ trigger that corresponding incoming would have (i.e., this has nothing to do with the underlying transport used to make the API call to invoke the lambda, which is often HTTP). - - `faas.trigger` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -91,8 +89,6 @@ call to invoke the lambda, which is often HTTP). | `pubsub` | A function is set to be executed when messages are sent to a messaging system | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `timer` | A function is scheduled to be executed regularly | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -155,8 +151,6 @@ trigger that corresponding incoming would have (i.e., this has nothing to do with the underlying transport used to make the API call to invoke the lambda, which is often HTTP). - - `faas.trigger` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -167,8 +161,6 @@ call to invoke the lambda, which is often HTTP). | `pubsub` | A function is set to be executed when messages are sent to a messaging system | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `timer` | A function is scheduled to be executed regularly | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -217,8 +209,6 @@ which the invoked FaaS instance reports about itself, if it's instrumented. **[4]:** For some cloud providers, like AWS or GCP, the region in which a function is hosted is essential to uniquely identify the function and also part of its endpoint. Since it's part of the endpoint being called, the region is always known to clients. In these cases, `faas.invoked_region` MUST be set accordingly. If the region is unknown to the client or not required for identifying the invoked function, setting `faas.invoked_region` is optional. - - `faas.invoked_provider` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -229,8 +219,6 @@ which the invoked FaaS instance reports about itself, if it's instrumented. | `gcp` | Google Cloud Platform | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `tencent_cloud` | Tencent Cloud | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -270,8 +258,6 @@ FaaS instrumentations that produce `faas` spans with trigger `datasource`, SHOUL | `edit` | When an object is modified. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `insert` | When a new object is created. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -305,7 +291,6 @@ A function is scheduled to be executed regularly. The following additional attri | [`faas.cron`](/docs/attributes-registry/faas.md) | string | A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). | `0/5 * * * ? *` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`faas.time`](/docs/attributes-registry/faas.md) | string | A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). | `2020-01-23T13:47:06Z` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - diff --git a/docs/feature-flags/feature-flags-logs.md b/docs/feature-flags/feature-flags-logs.md index 4ab5622ed5..f9c3bfa4eb 100644 --- a/docs/feature-flags/feature-flags-logs.md +++ b/docs/feature-flags/feature-flags-logs.md @@ -7,8 +7,8 @@ linkTitle: Logs **Status**: [Experimental][DocumentStatus] This document defines semantic conventions for recording feature flag evaluations as -a [log record](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/logs/data-model.md#log-and-event-record-definition) emitted through the -[Logger API](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/logs/bridge-api.md#emit-a-logrecord). +a [log record](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/logs/data-model.md#log-and-event-record-definition) emitted through the +[Logger API](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/logs/bridge-api.md#emit-a-logrecord). This is useful when a flag is evaluated outside of a transaction context such as when the application loads or on a timer. To record a flag evaluation as a part of a transaction context, @@ -28,14 +28,14 @@ section of the trace semantic convention for feature flag evaluations. ## Recording an Evaluation Feature flag evaluations SHOULD be recorded as attributes on the -[LogRecord](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/logs/data-model.md#log-and-event-record-definition) passed to the [Logger](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/logs/bridge-api.md#logger) emit +[LogRecord](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/logs/data-model.md#log-and-event-record-definition) passed to the [Logger](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/logs/bridge-api.md#logger) emit operations. Evaluations MAY be recorded on "logs" or "events" depending on the context. ## Attributes The table below indicates which attributes should be added to the -[LogRecord](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/logs/data-model.md#log-and-event-record-definition) and their types. +[LogRecord](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/logs/data-model.md#log-and-event-record-definition) and their types. @@ -61,9 +61,6 @@ A stringified version of the value can be used in situations where a semantic identifier is unavailable. String representation of the value should be determined by the implementer. - - - diff --git a/docs/feature-flags/feature-flags-spans.md b/docs/feature-flags/feature-flags-spans.md index f877fce133..842045e72e 100644 --- a/docs/feature-flags/feature-flags-spans.md +++ b/docs/feature-flags/feature-flags-spans.md @@ -65,9 +65,6 @@ A stringified version of the value can be used in situations where a semantic identifier is unavailable. String representation of the value should be determined by the implementer. - - - diff --git a/docs/gen-ai/README.md b/docs/gen-ai/README.md index 086a6d327f..d9fc8d3c69 100644 --- a/docs/gen-ai/README.md +++ b/docs/gen-ai/README.md @@ -16,7 +16,13 @@ use the conventions in limited non-critical workloads and share the feedback Semantic conventions for Generative AI operations are defined for the following signals: +* [Events](gen-ai-events.md): Semantic Conventions for Generative AI inputs and outputs - *events*. * [Metrics](gen-ai-metrics.md): Semantic Conventions for Generative AI operations - *metrics*. * [Spans](gen-ai-spans.md): Semantic Conventions for Generative AI requests - *spans*. +Technology specific semantic conventions are defined for the following GenAI system: + +* [Azure AI Inference](./azure-ai-inference.md): Semantic Conventions for Azure AI Inference. +* [OpenAI](./openai.md): Semantic Conventions for OpenAI. + [DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status diff --git a/docs/gen-ai/azure-ai-inference.md b/docs/gen-ai/azure-ai-inference.md new file mode 100644 index 0000000000..7275e19c67 --- /dev/null +++ b/docs/gen-ai/azure-ai-inference.md @@ -0,0 +1,82 @@ + + +# Semantic Conventions for Azure AI Inference + +**Status**: [Experimental][DocumentStatus] + +The Semantic Conventions for [Azure AI Inference](https://learn.microsoft.com/azure/ai-studio) extend and override the [GenAI Semantic Conventions](README.md). + +## Azure AI Inference Spans + +`gen_ai.system` MUST be set to `"az.ai.inference"` and SHOULD be provided **at span creation time**. + +### Attributes + + + + + + + + +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | +|---|---|---|---|---|---| +| [`gen_ai.operation.name`](/docs/attributes-registry/gen-ai.md) | string | The name of the operation being performed. [1] | `chat`; `text_completion` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [2] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` if the operation ended in an error | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`gen_ai.request.model`](/docs/attributes-registry/gen-ai.md) | string | The name of the GenAI model a request is being made to. [3] | `gpt-4` | `Conditionally Required` If available. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`server.port`](/docs/attributes-registry/server.md) | int | GenAI server port. [4] | `80`; `8080`; `443` | `Conditionally Required` If not default (443). | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`az.namespace`](/docs/attributes-registry/azure.md) | string | [Azure Resource Provider Namespace](https://learn.microsoft.com/azure/azure-resource-manager/management/azure-services-resource-providers) as recognized by the client. [5] | `Microsoft.CognitiveServices` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.request.frequency_penalty`](/docs/attributes-registry/gen-ai.md) | double | The frequency penalty setting for the GenAI request. | `0.1` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.request.max_tokens`](/docs/attributes-registry/gen-ai.md) | int | The maximum number of tokens the model generates for a request. | `100` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.request.presence_penalty`](/docs/attributes-registry/gen-ai.md) | double | The presence penalty setting for the GenAI request. | `0.1` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.request.stop_sequences`](/docs/attributes-registry/gen-ai.md) | string[] | List of sequences that the model will use to stop generating further tokens. | `["forest", "lived"]` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.request.temperature`](/docs/attributes-registry/gen-ai.md) | double | The temperature setting for the GenAI request. | `0.0` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.request.top_p`](/docs/attributes-registry/gen-ai.md) | double | The top_p sampling setting for the GenAI request. | `1.0` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.response.finish_reasons`](/docs/attributes-registry/gen-ai.md) | string[] | Array of reasons the model stopped generating tokens, corresponding to each generation received. | `["stop"]`; `["stop", "length"]` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.response.id`](/docs/attributes-registry/gen-ai.md) | string | The unique identifier for the completion. | `chatcmpl-123` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.response.model`](/docs/attributes-registry/gen-ai.md) | string | The name of the model that generated the response. [6] | `gpt-4-0613` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.usage.input_tokens`](/docs/attributes-registry/gen-ai.md) | int | The number of prompt tokens as reported in the usage prompt_tokens property of the response. | `100` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.usage.output_tokens`](/docs/attributes-registry/gen-ai.md) | int | The number of completion tokens as reported in the usage completion_tokens property of the response. | `180` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`server.address`](/docs/attributes-registry/server.md) | string | GenAI server address. [7] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | + +**[1]:** If one of the predefined values applies, but specific system uses a different name it's RECOMMENDED to document it in the semantic conventions for specific GenAI system and use system-specific name in the instrumentation. If a different name is not documented, instrumentation libraries SHOULD use applicable predefined value. + +**[2]:** The `error.type` SHOULD match the error code returned by the Generative AI provider or the client library, +the canonical name of exception that occurred, or another low-cardinality error identifier. +Instrumentations SHOULD document the list of errors they report. + +**[3]:** The name of the GenAI model a request is being made to. If the model is supplied by a vendor, then the value must be the exact name of the model requested. If the model is a fine-tuned custom model, the value should have a more specific name than the base model that's been fine-tuned. + +**[4]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. + +**[5]:** When `az.namespace` attribute is populated, it MUST be set to `Microsoft.CognitiveServices` for all operations performed by Azure AI Inference clients. + +**[6]:** If available. The name of the GenAI model that provided the response. If the model is supplied by a vendor, then the value must be the exact name of the model actually used. If the model is a fine-tuned custom model, the value should have a more specific name than the base model that's been fine-tuned. + +**[7]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. + +`error.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. + +| Value | Description | Stability | +|---|---|---| +| `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | + +`gen_ai.operation.name` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. + +| Value | Description | Stability | +|---|---|---| +| `chat` | Chat completion operation such as [OpenAI Chat API](https://platform.openai.com/docs/api-reference/chat) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + + + + + + +## Azure AI Inference Metrics + +Azure AI Inference metrics follow generic [Generative AI metrics](gen-ai-metrics.md). + +[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status diff --git a/docs/gen-ai/gen-ai-events.md b/docs/gen-ai/gen-ai-events.md new file mode 100644 index 0000000000..44eeadc31d --- /dev/null +++ b/docs/gen-ai/gen-ai-events.md @@ -0,0 +1,380 @@ + + +# Semantic Conventions for GenAI events + +**Status**: [Experimental][DocumentStatus] + + + + + +- [Common attributes](#common-attributes) +- [System event](#system-event) +- [User event](#user-event) +- [Assistant event](#assistant-event) + - [`ToolCall` object](#toolcall-object) + - [`Function` object](#function-object) +- [Tool event](#tool-event) +- [Choice event](#choice-event) + - [`Message` object](#message-object) +- [Custom events](#custom-events) +- [Examples](#examples) + - [Chat completion](#chat-completion) + - [Tools](#tools) + - [Chat completion with multiple choices](#chat-completion-with-multiple-choices) + + + +GenAI instrumentations MAY capture user inputs sent to the model and responses received from it as [events](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/logs/event-api.md). + +> Note: +> Event API is experimental and not yet available in some languages. Check [spec-compliance matrix](https://github.com/open-telemetry/opentelemetry-specification/blob/main/spec-compliance-matrix.md#events) to see the implementation status in corresponding language. + +Instrumentations MAY capture inputs and outputs if and only if application has enabled the collection of this data. +This is for three primary reasons: + +1. Data privacy concerns. End users of GenAI applications may input sensitive information or personally identifiable information (PII) that they do not wish to be sent to a telemetry backend. +2. Data size concerns. Although there is no specified limit to sizes, there are practical limitations in programming languages and telemetry systems. Some GenAI systems allow for extremely large context windows that end users may take full advantage of. +3. Performance concerns. Sending large amounts of data to a telemetry backend may cause performance issues for the application. + +Body fields that contain user input, model output, or other potentially sensitive and verbose data +SHOULD NOT be captured by default. + +Semantic conventions for individual systems which extend content events SHOULD document all additional body fields and specify whether they +should be captured by default or need application to opt into capturing them. + +Telemetry consumers SHOULD expect to receive unknown body fields. + +Instrumentations SHOULD NOT capture undocumented body fields and MUST follow the documented defaults for known fields. +Instrumentations MAY offer configuration options allowing to disable events or allowing to capture all fields. + +## Common attributes + +The following attributes apply to all GenAI events. + + + + + + + + +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | +|---|---|---|---|---|---| +| [`gen_ai.system`](/docs/attributes-registry/gen-ai.md) | string | The Generative AI product as identified by the client or server instrumentation. [1] | `openai` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[1]:** The `gen_ai.system` describes a family of GenAI models with specific model identified +by `gen_ai.request.model` and `gen_ai.response.model` attributes. + +The actual GenAI product may differ from the one identified by the client. +For example, when using OpenAI client libraries to communicate with Mistral, the `gen_ai.system` +is set to `openai` based on the instrumentation's best knowledge. + +For custom model, a custom friendly name SHOULD be used. +If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. + +`gen_ai.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. + +| Value | Description | Stability | +|---|---|---| +| `anthropic` | Anthropic | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `az.ai.inference` | Azure AI Inference | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `cohere` | Cohere | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `openai` | OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `vertex_ai` | Vertex AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + + + + + + +## System event + +This event describes the instructions passed to the GenAI model. + +The event name MUST be `gen_ai.system.message`. + +| Body Field | Type | Description | Examples | Requirement Level | +|---|---|---|---|---| +| `role` | string | The actual role of the message author as passed in the message. | `"system"`, `"instructions"` | `Conditionally Required`: if available and not equal to `system` | +| `content` | `AnyValue` | The contents of the system message. | `"You're a friendly bot that answers questions about OpenTelemetry."` | `Opt-In` | + +## User event + +This event describes the prompt message specified by the user. + +The event name MUST be `gen_ai.user.message`. + +| Body Field | Type | Description | Examples | Requirement Level | +|---|---|---|---|---| +| `role` | string | The actual role of the message author as passed in the message. | `"user"`, `"customer"` | `Conditionally Required`: if available and if not equal to `user` | +| `content` | `AnyValue` | The contents of the user message. | `What telemetry is reported by OpenAI instrumentations?` | `Opt-In` | + +## Assistant event + +This event describes the assistant message. + +The event name MUST be `gen_ai.assistant.message`. + +| Body Field | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | +|--------------|--------------------------------|----------------------------------------|-------------------------------------------------|-------------------| +| `role` | string | The actual role of the message author as passed in the message. | `"assistant"`, `"bot"` | `Conditionally Required`: if available and if not equal to `assistant` | +| `content` | `AnyValue` | The contents of the assistant message. | `Spans, events, metrics defined by the GenAI semantic conventions.` | `Opt-In` | +| `tool_calls` | [ToolCall](#toolcall-object)[] | The tool calls generated by the model, such as function calls. | `[{"id":"call_mszuSIzqtI65i1wAUOE8w5H4", "function":{"name":"get_link_to_otel_semconv", "arguments":{"semconv":"gen_ai"}}, "type":"function"}]` | `Conditionally Required`: if available | + +### `ToolCall` object + +| Body Field | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | +|------------|-----------------------------|------------------------------------|-------------------------------------------------|-------------------| +| `id` | string | The id of the tool call | `call_mszuSIzqtI65i1wAUOE8w5H4` | `Required` | +| `type` | string | The type of the tool | `function` | `Required` | +| `function` | [Function](#function-object)| The function that the model called | `{"name":"get_link_to_otel_semconv", "arguments":{"semconv":"gen_ai"}}` | `Required` | + +### `Function` object + +| Body Field | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | +|-------------|------------|----------------------------------------|----------------------------|-------------------| +| `name` | string | The name of the function to call | `get_link_to_otel_semconv` | `Required` | +| `arguments` | `AnyValue` | The arguments to pass the the function | `{"semconv": "gen_ai"}` | `Opt-In` | + +## Tool event + +This event describes the output of the tool or function submitted back to the model. + +The event name MUST be `gen_ai.tool.message`. + +| Body Field | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | +|----------------|--------|-----------------------------------------------|---------------------------------|-------------------| +| `role` | string | The actual role of the message author as passed in the message. | `"tool"`, `"function"` | `Conditionally Required`: if available and if not equal to `tool` | +| `content` | AnyValue | The contents of the tool message. | `opentelemetry.io` | `Opt-In` | +| `id` | string | Tool call that this message is responding to. | `call_mszuSIzqtI65i1wAUOE8w5H4` | `Required` | + +## Choice event + +This event describes model-generated individual chat response (choice). +If GenAI model returns multiple choices, each choice SHOULD be recorded as an individual event. + +When response is streamed, instrumentations that report response events MUST reconstruct and report the full message and MUST NOT report individual chunks as events. +If the request to GenAI model fails with an error before content is received, instrumentation SHOULD report an event with truncated content (if enabled). If `finish_reason` was not received, it MUST be set to `error`. + +The event name MUST be `gen_ai.choice`. + +Choice event body has the following fields: + +| Body Field | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | +|-----------------|----------------------------|-------------------------------------------------|----------------------------------------|-------------------| +| `finish_reason` | string | The reason the model stopped generating tokens. | `stop`, `tool_calls`, `content_filter` | `Required` | +| `index` | int | The index of the choice in the list of choices. | `1` | `Required` | +| `message` | [Message](#message-object) | GenAI response message | `{"content":"The OpenAI semantic conventions are available at opentelemetry.io"}` | `Recommended` | + +### `Message` object + +| Body Field | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | +|----------------|--------------------------------|-----------------------------------------------|---------------------------------|-------------------| +| `role` | string | The actual role of the message author as passed in the message. | `"assistant"`, `"bot"` | `Conditionally Required`: if available and if not equal to `assistant` | +| `content` | `AnyValue` | The contents of the assistant message. | `Spans, events, metrics defined by the GenAI semantic conventions.` | `Opt-In` | +| `tool_calls` | [ToolCall](#toolcall-object)[] | The tool calls generated by the model, such as function calls. | `[{"id":"call_mszuSIzqtI65i1wAUOE8w5H4", "function":{"name":"get_link_to_otel_semconv", "arguments":"{\"semconv\":\"gen_ai\"}"}, "type":"function"}]` | `Conditionally Required`: if available | + +## Custom events + +System-specific events that are not covered in this document SHOULD be documented in corresponding Semantic Conventions extensions and +SHOULD follow `gen_ai.{gen_ai.system}.*` naming pattern for system-specific events. + +## Examples + +### Chat completion + +This example covers the following scenario: + +- user requests chat completion from OpenAI GPT-4 model for the following prompt: + - System message: `You're a friendly bot that answers questions about OpenTelemetry.` + - User message: `How to instrument GenAI library with OTel?` + +- The model responds with `"Follow GenAI semantic conventions available at opentelemetry.io."` message + +Span: + +| Attribute name | Value | +|---------------------------------|--------------------------------------------| +| Span name | `"chat gpt-4"` | +| `gen_ai.system` | `"openai"` | +| `gen_ai.request.model` | `"gpt-4"` | +| `gen_ai.request.max_tokens` | `200` | +| `gen_ai.request.top_p` | `1.0` | +| `gen_ai.response.id` | `"chatcmpl-9J3uIL87gldCFtiIbyaOvTeYBRA3l"` | +| `gen_ai.response.model` | `"gpt-4-0613"` | +| `gen_ai.usage.output_tokens` | `47` | +| `gen_ai.usage.input_tokens` | `52` | +| `gen_ai.response.finish_reasons`| `["stop"]` | + +Events: + +1. `gen_ai.system.message`. + + | Property | Value | + |---------------------|-------------------------------------------------------| + | `gen_ai.system` | `"openai"` | + | Event body | `{"content": "You're a friendly bot that answers questions about OpenTelemetry."}` | + +2. `gen_ai.user.message` + + | Property | Value | + |---------------------|-------------------------------------------------------| + | `gen_ai.system` | `"openai"` | + | Event body | `{"content":"How to instrument GenAI library with OTel?"}` | + +3. `gen_ai.choice` + + | Property | Value | + |---------------------|-------------------------------------------------------| + | `gen_ai.system` | `"openai"` | + | Event body (with content enabled) | `{"index":0,"finish_reason":"stop","message":{"content":"Follow GenAI semantic conventions available at opentelemetry.io."}}` | + | Event body (without content) | `{"index":0,"finish_reason":"stop","message":{}}` | + +### Tools + +This example covers the following scenario: + +1. Application requests chat completion from OpenAI GPT-4 model and provides a function definition. + + - Application provides the following prompt: + - User message: `How to instrument GenAI library with OTel?` + - Application defines a tool (a function) names `get_link_to_otel_semconv` with single string argument named `semconv` + +2. The model responds with a tool call request which application executes +3. The application requests chat completion again now with the tool execution result + +Here's the telemetry generated for each step in this scenario: + +1. Chat completion resulting in a tool call. + + | Attribute name | Value | + |---------------------|-------------------------------------------------------| + | Span name | `"chat gpt-4"` | + | `gen_ai.system` | `"openai"` | + | `gen_ai.request.model`| `"gpt-4"` | + | `gen_ai.request.max_tokens`| `200` | + | `gen_ai.request.top_p`| `1.0` | + | `gen_ai.response.id`| `"chatcmpl-9J3uIL87gldCFtiIbyaOvTeYBRA3l"` | + | `gen_ai.response.model`| `"gpt-4-0613"` | + | `gen_ai.usage.output_tokens`| `17` | + | `gen_ai.usage.input_tokens`| `47` | + | `gen_ai.response.finish_reasons`| `["tool_calls"]` | + + Events parented to this span: + + - `gen_ai.user.message` (not reported when capturing content is disabled) + + | Property | Value | + |---------------------|-------------------------------------------------------| + | `gen_ai.system` | `"openai"` | + | Event body | `{"content":"How to instrument GenAI library with OTel?"}` | + + - `gen_ai.choice` + + | Property | Value | + |---------------------|-------------------------------------------------------| + | `gen_ai.system` | `"openai"` | + | Event body (with content) | `{"index":0,"finish_reason":"tool_calls","message":{"tool_calls":[{"id":"call_VSPygqKTWdrhaFErNvMV18Yl","function":{"name":"get_link_to_otel_semconv","arguments":"{\"semconv\":\"GenAI\"}"},"type":"function"}]}` | + | Event body (without content) | `{"index":0,"finish_reason":"tool_calls","message":{"tool_calls":[{"id":"call_VSPygqKTWdrhaFErNvMV18Yl","function":{"name":"get_link_to_otel_semconv"},"type":"function"}]}` | + +2. Application executes the tool call. Application may create span which is not covered by this semantic convention. +3. Final chat completion call + + | Attribute name | Value | + |---------------------------------|-------------------------------------------------------| + | Span name | `"chat gpt-4"` | + | `gen_ai.system` | `"openai"` | + | `gen_ai.request.model` | `"gpt-4"` | + | `gen_ai.request.max_tokens` | `200` | + | `gen_ai.request.top_p` | `1.0` | + | `gen_ai.response.id` | `"chatcmpl-call_VSPygqKTWdrhaFErNvMV18Yl"` | + | `gen_ai.response.model` | `"gpt-4-0613"` | + | `gen_ai.usage.output_tokens` | `52` | + | `gen_ai.usage.input_tokens` | `47` | + | `gen_ai.response.finish_reasons`| `["stop"]` | + + Events parented to this span: + (in this example, the event content matches the original messages, but applications may also drop messages or change their content) + + - `gen_ai.user.message` (not reported when capturing content is not enabled) + + | Property | Value | + |----------------------------------|------------------------------------------------------------| + | `gen_ai.system` | `"openai"` | + | Event body | `{"content":"How to instrument GenAI library with OTel?"}` | + + - `gen_ai.assistant.message` + + | Property | Value | + |----------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------| + | `gen_ai.system` | `"openai"` | + | Event body (content enabled) | `{"tool_calls":[{"id":"call_VSPygqKTWdrhaFErNvMV18Yl","function":{"name":"get_link_to_otel_semconv","arguments":"{\"semconv\":\"GenAI\"}"},"type":"function"}]}` | + | Event body (content not enabled) | `{"tool_calls":[{"id":"call_VSPygqKTWdrhaFErNvMV18Yl","function":{"name":"get_link_to_otel_semconv"},"type":"function"}]}` | + + - `gen_ai.tool.message` + + | Property | Value | + |----------------------------------|------------------------------------------------------------------------------------------------| + | `gen_ai.system` | `"openai"` | + | Event body (content enabled) | `{"content":"opentelemetry.io/semconv/gen-ai","id":"call_VSPygqKTWdrhaFErNvMV18Yl"}` | + | Event body (content not enabled) | `{"id":"call_VSPygqKTWdrhaFErNvMV18Yl"}` | + + - `gen_ai.choice` + + | Property | Value | + |----------------------------------|-------------------------------------------------------------------------------------------------------------------------------| + | `gen_ai.system` | `"openai"` | + | Event body (content enabled) | `{"index":0,"finish_reason":"stop","message":{"content":"Follow OTel semconv available at opentelemetry.io/semconv/gen-ai"}}` | + | Event body (content not enabled) | `{"index":0,"finish_reason":"stop","message":{}}` | + +### Chat completion with multiple choices + +This example covers the following scenario: + +- user requests 2 chat completion from OpenAI GPT-4 model for the following prompt: + + - System message: `You're a friendly bot that answers questions about OpenTelemetry.` + - User message: `How to instrument GenAI library with OTel?` + +- The model responds with two choices + + - `"Follow GenAI semantic conventions available at opentelemetry.io."` message + - `"Use OpenAI instrumentation library."` message + +Span: + +| Attribute name | Value | +|---------------------|--------------------------------------------| +| Span name | `"chat gpt-4"` | +| `gen_ai.system` | `"openai"` | +| `gen_ai.request.model`| `"gpt-4"` | +| `gen_ai.request.max_tokens`| `200` | +| `gen_ai.request.top_p`| `1.0` | +| `gen_ai.response.id`| `"chatcmpl-9J3uIL87gldCFtiIbyaOvTeYBRA3l"` | +| `gen_ai.response.model`| `"gpt-4-0613"` | +| `gen_ai.usage.output_tokens`| `77` | +| `gen_ai.usage.input_tokens`| `52` | +| `gen_ai.response.finish_reasons`| `["stop"]` | + +Events: + +1. `gen_ai.system.message`: the same as in the [Chat Completion](#chat-completion) example +2. `gen_ai.user.message`: the same as in the previous example +3. `gen_ai.choice` + + | Property | Value | + |------------------------------|-------------------------------------------------------| + | `gen_ai.system` | `"openai"` | + | Event body (content enabled) | `{"index":0,"finish_reason":"stop","message":{"content":"Follow GenAI semantic conventions available at opentelemetry.io."}}` | + +4. `gen_ai.choice` + + | Property | Value | + |------------------------------|-------------------------------------------------------| + | `gen_ai.system` | `"openai"` | + | Event body (content enabled) | `{"index":1,"finish_reason":"stop","message":{"content":"Use OpenAI instrumentation library."}}` | + +[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status diff --git a/docs/gen-ai/gen-ai-metrics.md b/docs/gen-ai/gen-ai-metrics.md index ed54390b46..c8cba89124 100644 --- a/docs/gen-ai/gen-ai-metrics.md +++ b/docs/gen-ai/gen-ai-metrics.md @@ -32,6 +32,9 @@ The following metric instruments describe Generative AI operations. An operation may be a request to an LLM, a function call, or some other distinct action within a larger Generative AI workflow. +Individual systems may include additional system-specific attributes. +It is recommended to check system-specific documentation, if available. + ### Metric: `gen_ai.client.token.usage` This metric is [recommended][MetricRecommended] when an operation involves the usage @@ -59,9 +62,9 @@ This metric SHOULD be specified with [ExplicitBucketBoundaries] of [1, 4, 16, 64 | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`gen_ai.operation.name`](/docs/attributes-registry/gen-ai.md) | string | The name of the operation being performed. [1] | `chat`; `text_completion` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`gen_ai.request.model`](/docs/attributes-registry/gen-ai.md) | string | The name of the GenAI model a request is being made to. | `gpt-4` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`gen_ai.system`](/docs/attributes-registry/gen-ai.md) | string | The Generative AI product as identified by the client or server instrumentation. [2] | `openai` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`gen_ai.token.type`](/docs/attributes-registry/gen-ai.md) | string | The type of token being counted. | `input`; `output` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.request.model`](/docs/attributes-registry/gen-ai.md) | string | The name of the GenAI model a request is being made to. | `gpt-4` | `Conditionally Required` If available. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`server.port`](/docs/attributes-registry/server.md) | int | GenAI server port. [3] | `80`; `8080`; `443` | `Conditionally Required` If `server.address` is set. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`gen_ai.response.model`](/docs/attributes-registry/gen-ai.md) | string | The name of the model that generated the response. | `gpt-4-0613` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`server.address`](/docs/attributes-registry/server.md) | string | GenAI server address. [4] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | @@ -82,8 +85,6 @@ If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. **[4]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - - `gen_ai.operation.name` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -91,17 +92,16 @@ If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. | `chat` | Chat completion operation such as [OpenAI Chat API](https://platform.openai.com/docs/api-reference/chat) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - `gen_ai.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| | `anthropic` | Anthropic | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `az.ai.inference` | Azure AI Inference | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `cohere` | Cohere | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `openai` | OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `vertex_ai` | Vertex AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - `gen_ai.token.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -109,8 +109,6 @@ If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. | `input` | Input tokens (prompt, input, etc.) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `output` | Output tokens (completion, response, etc.) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -136,9 +134,9 @@ This metric SHOULD be specified with [ExplicitBucketBoundaries] of [0.01, 0.02, | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`gen_ai.operation.name`](/docs/attributes-registry/gen-ai.md) | string | The name of the operation being performed. [1] | `chat`; `text_completion` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`gen_ai.request.model`](/docs/attributes-registry/gen-ai.md) | string | The name of the GenAI model a request is being made to. | `gpt-4` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`gen_ai.system`](/docs/attributes-registry/gen-ai.md) | string | The Generative AI product as identified by the client or server instrumentation. [2] | `openai` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [3] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` if the operation ended in an error | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`gen_ai.request.model`](/docs/attributes-registry/gen-ai.md) | string | The name of the GenAI model a request is being made to. | `gpt-4` | `Conditionally Required` If available. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`server.port`](/docs/attributes-registry/server.md) | int | GenAI server port. [4] | `80`; `8080`; `443` | `Conditionally Required` If `server.address` is set. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`gen_ai.response.model`](/docs/attributes-registry/gen-ai.md) | string | The name of the model that generated the response. | `gpt-4-0613` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`server.address`](/docs/attributes-registry/server.md) | string | GenAI server address. [5] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | @@ -163,15 +161,12 @@ Instrumentations SHOULD document the list of errors they report. **[5]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - - `error.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `gen_ai.operation.name` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -179,18 +174,16 @@ Instrumentations SHOULD document the list of errors they report. | `chat` | Chat completion operation such as [OpenAI Chat API](https://platform.openai.com/docs/api-reference/chat) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - `gen_ai.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| | `anthropic` | Anthropic | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `az.ai.inference` | Azure AI Inference | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `cohere` | Cohere | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `openai` | OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `vertex_ai` | Vertex AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -223,9 +216,9 @@ This metric SHOULD be specified with [ExplicitBucketBoundaries] of | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`gen_ai.operation.name`](/docs/attributes-registry/gen-ai.md) | string | The name of the operation being performed. [1] | `chat`; `text_completion` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`gen_ai.request.model`](/docs/attributes-registry/gen-ai.md) | string | The name of the GenAI model a request is being made to. | `gpt-4` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`gen_ai.system`](/docs/attributes-registry/gen-ai.md) | string | The Generative AI product as identified by the client or server instrumentation. [2] | `openai` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [3] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` if the operation ended in an error | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`gen_ai.request.model`](/docs/attributes-registry/gen-ai.md) | string | The name of the GenAI model a request is being made to. | `gpt-4` | `Conditionally Required` If available. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`server.port`](/docs/attributes-registry/server.md) | int | GenAI server port. [4] | `80`; `8080`; `443` | `Conditionally Required` If `server.address` is set. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`gen_ai.response.model`](/docs/attributes-registry/gen-ai.md) | string | The name of the model that generated the response. | `gpt-4-0613` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`server.address`](/docs/attributes-registry/server.md) | string | GenAI server address. [5] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | @@ -250,15 +243,12 @@ Instrumentations SHOULD document the list of errors they report. **[5]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - - `error.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `gen_ai.operation.name` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -266,18 +256,16 @@ Instrumentations SHOULD document the list of errors they report. | `chat` | Chat completion operation such as [OpenAI Chat API](https://platform.openai.com/docs/api-reference/chat) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - `gen_ai.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| | `anthropic` | Anthropic | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `az.ai.inference` | Azure AI Inference | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `cohere` | Cohere | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `openai` | OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `vertex_ai` | Vertex AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -310,8 +298,8 @@ This metric SHOULD be specified with [ExplicitBucketBoundaries] of | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`gen_ai.operation.name`](/docs/attributes-registry/gen-ai.md) | string | The name of the operation being performed. [1] | `chat`; `text_completion` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`gen_ai.request.model`](/docs/attributes-registry/gen-ai.md) | string | The name of the GenAI model a request is being made to. | `gpt-4` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`gen_ai.system`](/docs/attributes-registry/gen-ai.md) | string | The Generative AI product as identified by the client or server instrumentation. [2] | `openai` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.request.model`](/docs/attributes-registry/gen-ai.md) | string | The name of the GenAI model a request is being made to. | `gpt-4` | `Conditionally Required` If available. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`server.port`](/docs/attributes-registry/server.md) | int | GenAI server port. [3] | `80`; `8080`; `443` | `Conditionally Required` If `server.address` is set. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`gen_ai.response.model`](/docs/attributes-registry/gen-ai.md) | string | The name of the model that generated the response. | `gpt-4-0613` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`server.address`](/docs/attributes-registry/server.md) | string | GenAI server address. [4] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | @@ -332,8 +320,6 @@ If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. **[4]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - - `gen_ai.operation.name` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -341,18 +327,16 @@ If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. | `chat` | Chat completion operation such as [OpenAI Chat API](https://platform.openai.com/docs/api-reference/chat) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - `gen_ai.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| | `anthropic` | Anthropic | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `az.ai.inference` | Azure AI Inference | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `cohere` | Cohere | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `openai` | OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `vertex_ai` | Vertex AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -384,8 +368,8 @@ This metric SHOULD be specified with [ExplicitBucketBoundaries] of | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`gen_ai.operation.name`](/docs/attributes-registry/gen-ai.md) | string | The name of the operation being performed. [1] | `chat`; `text_completion` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`gen_ai.request.model`](/docs/attributes-registry/gen-ai.md) | string | The name of the GenAI model a request is being made to. | `gpt-4` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`gen_ai.system`](/docs/attributes-registry/gen-ai.md) | string | The Generative AI product as identified by the client or server instrumentation. [2] | `openai` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.request.model`](/docs/attributes-registry/gen-ai.md) | string | The name of the GenAI model a request is being made to. | `gpt-4` | `Conditionally Required` If available. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`server.port`](/docs/attributes-registry/server.md) | int | GenAI server port. [3] | `80`; `8080`; `443` | `Conditionally Required` If `server.address` is set. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`gen_ai.response.model`](/docs/attributes-registry/gen-ai.md) | string | The name of the model that generated the response. | `gpt-4-0613` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`server.address`](/docs/attributes-registry/server.md) | string | GenAI server address. [4] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | @@ -406,8 +390,6 @@ If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. **[4]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - - `gen_ai.operation.name` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -415,18 +397,16 @@ If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. | `chat` | Chat completion operation such as [OpenAI Chat API](https://platform.openai.com/docs/api-reference/chat) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - `gen_ai.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| | `anthropic` | Anthropic | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `az.ai.inference` | Azure AI Inference | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `cohere` | Cohere | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `openai` | OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `vertex_ai` | Vertex AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -435,4 +415,4 @@ If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. [DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status [MetricRequired]: /docs/general/metric-requirement-level.md#required [MetricRecommended]: /docs/general/metric-requirement-level.md#recommended -[ExplicitBucketBoundaries]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/metrics/api.md#instrument-advisory-parameters +[ExplicitBucketBoundaries]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/metrics/api.md#instrument-advisory-parameters diff --git a/docs/gen-ai/gen-ai-spans.md b/docs/gen-ai/gen-ai-spans.md index 0a3eec44b4..56db7ab898 100644 --- a/docs/gen-ai/gen-ai-spans.md +++ b/docs/gen-ai/gen-ai-spans.md @@ -2,7 +2,7 @@ linkTitle: Generative AI traces ---> -# Semantic Conventions for GenAI operations +# Semantic Conventions for GenAI spans **Status**: [Experimental][DocumentStatus] @@ -11,9 +11,8 @@ linkTitle: Generative AI traces - [Name](#name) -- [Configuration](#configuration) - [GenAI attributes](#genai-attributes) -- [Events](#events) +- [Capturing inputs and outputs](#capturing-inputs-and-outputs) @@ -23,24 +22,15 @@ A request to an Generative AI is modeled as a span in a trace. ## Name -GenAI spans MUST follow the overall [guidelines for span names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/trace/api.md#span). +GenAI spans MUST follow the overall [guidelines for span names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/trace/api.md#span). The **span name** SHOULD be `{gen_ai.operation.name} {gen_ai.request.model}`. Semantic conventions for individual GenAI systems and frameworks MAY specify different span name format. -## Configuration - -Instrumentations for Generative AI clients MAY capture prompts and completions. -Instrumentations that support it, MUST offer the ability to turn off capture of prompts and completions. This is for three primary reasons: - -1. Data privacy concerns. End users of GenAI applications may input sensitive information or personally identifiable information (PII) that they do not wish to be sent to a telemetry backend. -2. Data size concerns. Although there is no specified limit to sizes, there are practical limitations in programming languages and telemetry systems. Some GenAI systems allow for extremely large context windows that end users may take full advantage of. -3. Performance concerns. Sending large amounts of data to a telemetry backend may cause performance issues for the application. - ## GenAI attributes These attributes track input data and metadata for a request to an GenAI model. Each attribute represents a concept that is common to most Generative AI clients. - + @@ -50,9 +40,9 @@ These attributes track input data and metadata for a request to an GenAI model. | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`gen_ai.operation.name`](/docs/attributes-registry/gen-ai.md) | string | The name of the operation being performed. [1] | `chat`; `text_completion` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`gen_ai.request.model`](/docs/attributes-registry/gen-ai.md) | string | The name of the GenAI model a request is being made to. [2] | `gpt-4` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`gen_ai.system`](/docs/attributes-registry/gen-ai.md) | string | The Generative AI product as identified by the client or server instrumentation. [3] | `openai` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [4] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` if the operation ended in an error | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`gen_ai.system`](/docs/attributes-registry/gen-ai.md) | string | The Generative AI product as identified by the client or server instrumentation. [2] | `openai` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [3] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` if the operation ended in an error | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`gen_ai.request.model`](/docs/attributes-registry/gen-ai.md) | string | The name of the GenAI model a request is being made to. [4] | `gpt-4` | `Conditionally Required` If available. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`server.port`](/docs/attributes-registry/server.md) | int | GenAI server port. [5] | `80`; `8080`; `443` | `Conditionally Required` If `server.address` is set. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`gen_ai.request.frequency_penalty`](/docs/attributes-registry/gen-ai.md) | double | The frequency penalty setting for the GenAI request. | `0.1` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`gen_ai.request.max_tokens`](/docs/attributes-registry/gen-ai.md) | int | The maximum number of tokens the model generates for a request. | `100` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -70,9 +60,7 @@ These attributes track input data and metadata for a request to an GenAI model. **[1]:** If one of the predefined values applies, but specific system uses a different name it's RECOMMENDED to document it in the semantic conventions for specific GenAI system and use system-specific name in the instrumentation. If a different name is not documented, instrumentation libraries SHOULD use applicable predefined value. -**[2]:** The name of the GenAI model a request is being made to. If the model is supplied by a vendor, then the value must be the exact name of the model requested. If the model is a fine-tuned custom model, the value should have a more specific name than the base model that's been fine-tuned. - -**[3]:** The `gen_ai.system` describes a family of GenAI models with specific model identified +**[2]:** The `gen_ai.system` describes a family of GenAI models with specific model identified by `gen_ai.request.model` and `gen_ai.response.model` attributes. The actual GenAI product may differ from the one identified by the client. @@ -82,25 +70,24 @@ is set to `openai` based on the instrumentation's best knowledge. For custom model, a custom friendly name SHOULD be used. If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. -**[4]:** The `error.type` SHOULD match the error code returned by the Generative AI provider or the client library, +**[3]:** The `error.type` SHOULD match the error code returned by the Generative AI provider or the client library, the canonical name of exception that occurred, or another low-cardinality error identifier. Instrumentations SHOULD document the list of errors they report. +**[4]:** The name of the GenAI model a request is being made to. If the model is supplied by a vendor, then the value must be the exact name of the model requested. If the model is a fine-tuned custom model, the value should have a more specific name than the base model that's been fine-tuned. + **[5]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. **[6]:** If available. The name of the GenAI model that provided the response. If the model is supplied by a vendor, then the value must be the exact name of the model actually used. If the model is a fine-tuned custom model, the value should have a more specific name than the base model that's been fine-tuned. **[7]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - - `error.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `gen_ai.operation.name` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -108,71 +95,23 @@ Instrumentations SHOULD document the list of errors they report. | `chat` | Chat completion operation such as [OpenAI Chat API](https://platform.openai.com/docs/api-reference/chat) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - `gen_ai.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| | `anthropic` | Anthropic | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `az.ai.inference` | Azure AI Inference | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `cohere` | Cohere | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `openai` | OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `vertex_ai` | Vertex AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - -## Events - -In the lifetime of a GenAI span, an event for prompts sent and completions received MAY be created, depending on the configuration of the instrumentation. - - - - - - - - -The event name MUST be `gen_ai.content.prompt`. - -| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | -|---|---|---|---|---|---| -| [`gen_ai.prompt`](/docs/attributes-registry/gen-ai.md) | string | The full prompt sent to the GenAI model. [1] | `[{'role': 'user', 'content': 'What is the capital of France?'}]` | `Conditionally Required` if and only if corresponding event is enabled | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - -**[1]:** It's RECOMMENDED to format prompts as JSON string matching [OpenAI messages format](https://platform.openai.com/docs/guides/text-generation) - - +## Capturing inputs and outputs +User inputs and model responses may be recorded as events parented to GenAI operation span. See [Semantic Conventions for GenAI events](./gen-ai-events.md) for the details. - - - - - - - - - - - - -The event name MUST be `gen_ai.content.completion`. - -| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | -|---|---|---|---|---|---| -| [`gen_ai.completion`](/docs/attributes-registry/gen-ai.md) | string | The full response received from the GenAI model. [1] | `[{'role': 'assistant', 'content': 'The capital of France is Paris.'}]` | `Conditionally Required` if and only if corresponding event is enabled | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - -**[1]:** It's RECOMMENDED to format completions as JSON string matching [OpenAI messages format](https://platform.openai.com/docs/guides/text-generation) - - - - - - - - - -[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.22.0/specification/document-status.md +[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status diff --git a/docs/gen-ai/openai.md b/docs/gen-ai/openai.md new file mode 100644 index 0000000000..5acce4fb88 --- /dev/null +++ b/docs/gen-ai/openai.md @@ -0,0 +1,160 @@ + + +# Semantic Conventions for OpenAI operations + +**Status**: [Experimental][DocumentStatus] + + + + + +- [OpenAI Spans](#openai-spans) +- [OpenAI Metrics](#openai-metrics) + - [Metric: `gen_ai.client.token.usage`](#metric-gen_aiclienttokenusage) + - [Metric: `gen_ai.client.operation.duration`](#metric-gen_aiclientoperationduration) + + + +The Semantic Conventions for [OpenAI](https://openai.com/) extend and override the semantic conventions +for [Gen AI Spans](gen-ai-spans.md) and [Gen AI Metrics](gen-ai-metrics.md). + +`gen_ai.system` MUST be set to `"openai"`. + +## OpenAI Spans + +These attributes track input data and metadata for a request to an OpenAI model. The attributes include general Generative AI +attributes and ones specific the OpenAI. + + + + + + + + +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | +|---|---|---|---|---|---| +| [`gen_ai.operation.name`](/docs/attributes-registry/gen-ai.md) | string | The name of the operation being performed. [1] | `chat`; `text_completion` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.request.model`](/docs/attributes-registry/gen-ai.md) | string | The name of the GenAI model a request is being made to. [2] | `gpt-4` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [3] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` if the operation ended in an error | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`gen_ai.openai.request.response_format`](/docs/attributes-registry/gen-ai.md) | string | The response format that is requested. | `json` | `Conditionally Required` if the request includes a response_format | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.openai.request.seed`](/docs/attributes-registry/gen-ai.md) | int | Requests with same seed value more likely to return same result. | `100` | `Conditionally Required` if the request includes a seed | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.openai.request.service_tier`](/docs/attributes-registry/gen-ai.md) | string | The service tier requested. May be a specific tier, detault, or auto. | `auto`; `default` | `Conditionally Required` [4] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.openai.response.service_tier`](/docs/attributes-registry/gen-ai.md) | string | The service tier used for the response. | `scale`; `detault` | `Conditionally Required` [5] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`server.port`](/docs/attributes-registry/server.md) | int | GenAI server port. [6] | `80`; `8080`; `443` | `Conditionally Required` If `server.address` is set. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`gen_ai.request.frequency_penalty`](/docs/attributes-registry/gen-ai.md) | double | The frequency penalty setting for the GenAI request. | `0.1` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.request.max_tokens`](/docs/attributes-registry/gen-ai.md) | int | The maximum number of tokens the model generates for a request. | `100` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.request.presence_penalty`](/docs/attributes-registry/gen-ai.md) | double | The presence penalty setting for the GenAI request. | `0.1` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.request.stop_sequences`](/docs/attributes-registry/gen-ai.md) | string[] | List of sequences that the model will use to stop generating further tokens. | `["forest", "lived"]` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.request.temperature`](/docs/attributes-registry/gen-ai.md) | double | The temperature setting for the GenAI request. | `0.0` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.request.top_p`](/docs/attributes-registry/gen-ai.md) | double | The top_p sampling setting for the GenAI request. | `1.0` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.response.finish_reasons`](/docs/attributes-registry/gen-ai.md) | string[] | Array of reasons the model stopped generating tokens, corresponding to each generation received. | `["stop"]`; `["stop", "length"]` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.response.id`](/docs/attributes-registry/gen-ai.md) | string | The unique identifier for the completion. | `chatcmpl-123` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.response.model`](/docs/attributes-registry/gen-ai.md) | string | The name of the model that generated the response. [7] | `gpt-4-0613` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.usage.input_tokens`](/docs/attributes-registry/gen-ai.md) | int | The number of tokens used in the prompt sent to OpenAI. | `100` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.usage.output_tokens`](/docs/attributes-registry/gen-ai.md) | int | The number of tokens used in the completions from OpenAI. | `180` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`server.address`](/docs/attributes-registry/server.md) | string | GenAI server address. [8] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | + +**[1]:** If one of the predefined values applies, but specific system uses a different name it's RECOMMENDED to document it in the semantic conventions for specific GenAI system and use system-specific name in the instrumentation. If a different name is not documented, instrumentation libraries SHOULD use applicable predefined value. + +**[2]:** The name of the GenAI model a request is being made to. If the model is supplied by a vendor, then the value must be the exact name of the model requested. If the model is a fine-tuned custom model, the value should have a more specific name than the base model that's been fine-tuned. + +**[3]:** The `error.type` SHOULD match the error code returned by the Generative AI provider or the client library, +the canonical name of exception that occurred, or another low-cardinality error identifier. +Instrumentations SHOULD document the list of errors they report. + +**[4]:** if the request includes a service_tier and the value is not 'auto' + +**[5]:** if the response was received and includes a service_tier + +**[6]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. + +**[7]:** If available. The name of the GenAI model that provided the response. If the model is supplied by a vendor, then the value must be the exact name of the model actually used. If the model is a fine-tuned custom model, the value should have a more specific name than the base model that's been fine-tuned. + +**[8]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. + +`error.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. + +| Value | Description | Stability | +|---|---|---| +| `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | + +`gen_ai.openai.request.response_format` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. + +| Value | Description | Stability | +|---|---|---| +| `json_object` | JSON object response format | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `json_schema` | JSON schema response format | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `text` | Text response format | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +`gen_ai.openai.request.service_tier` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. + +| Value | Description | Stability | +|---|---|---| +| `auto` | The system will utilize scale tier credits until they are exhausted. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `default` | The system will utilize the default scale tier. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +`gen_ai.operation.name` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. + +| Value | Description | Stability | +|---|---|---| +| `chat` | Chat completion operation such as [OpenAI Chat API](https://platform.openai.com/docs/api-reference/chat) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + + + + + + +## OpenAI Metrics + +OpenAI metrics follow [Generative AI metrics](gen-ai-metrics.md) with the noted additional attributes. +Individual systems may include additional system-specific attributes. It is recommended to check system-specific documentation, if available. + +### Metric: `gen_ai.client.token.usage` + +Reports the usage of tokens following the common [gen_ai.client.token.usage](./gen-ai-metrics.md#metric-gen_aiclienttokenusage) definition. + +Additional attributes: + + + + + + + + +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | +|---|---|---|---|---|---| +| [`gen_ai.openai.response.service_tier`](/docs/attributes-registry/gen-ai.md) | string | The service tier used for the response. | `scale`; `detault` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + + + + + + +### Metric: `gen_ai.client.operation.duration` + +Measures the to complete an operation following the common [gen_ai.client.operation.duration](./gen-ai-metrics.md#metric-gen_aiclientoperationduration) definition. + +Additional attributes: + + + + + + + + +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | +|---|---|---|---|---|---| +| [`gen_ai.openai.response.service_tier`](/docs/attributes-registry/gen-ai.md) | string | The service tier used for the response. | `scale`; `detault` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + + + + + + +[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status diff --git a/docs/general/attributes.md b/docs/general/attributes.md index e59e4e5688..f0d26bbdd8 100644 --- a/docs/general/attributes.md +++ b/docs/general/attributes.md @@ -82,9 +82,6 @@ if they do not cause breaking changes to HTTP semantic conventions. **[2]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - - - @@ -132,9 +129,6 @@ if they do not cause breaking changes to HTTP semantic conventions. **[2]:** When observed from the server side, and when communicating through an intermediary, `client.port` SHOULD represent the client port behind any intermediaries, for example proxies, if it's available. - - - @@ -165,9 +159,6 @@ This also covers unidirectional UDP flows and peer-to-peer communication where t **[1]:** When observed from the destination side, and when communicating through an intermediary, `source.address` SHOULD represent the source address behind any intermediaries, for example proxies, if it's available. - - - @@ -191,9 +182,6 @@ Destination fields capture details about the receiver of a network exchange/pack **[1]:** When observed from the source side, and when communicating through an intermediary, `destination.address` SHOULD represent the destination address behind any intermediaries, for example proxies, if it's available. - - - @@ -238,8 +226,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. **[4]:** The value SHOULD be normalized to lowercase. - - `network.transport` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -250,7 +236,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | `udp` | UDP | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `unix` | Unix domain socket | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `network.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -258,8 +243,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | `ipv4` | IPv4 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `ipv6` | IPv6 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - @@ -348,7 +331,6 @@ Note that `network.local.*` attributes are not included in these examples since | `td_scdma` | TD-SCDMA | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `umts` | UMTS | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - `network.connection.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -359,8 +341,6 @@ Note that `network.local.*` attributes are not included in these examples since | `wifi` | wifi | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `wired` | wired | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -385,7 +365,6 @@ Instrumentations SHOULD provide a way for users to configure this name. |---|---|---|---|---|---| | [`peer.service`](/docs/attributes-registry/peer.md) | string | The [`service.name`](/docs/resource/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. | `AuthTokenCache` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - @@ -413,7 +392,6 @@ These attributes may be used for any operation with an authenticated and/or auth | [`enduser.role`](/docs/attributes-registry/enduser.md) | string | Deprecated, use `user.roles` instead. | `admin` | `Recommended` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `user.roles` attribute. | | [`enduser.scope`](/docs/attributes-registry/enduser.md) | string | Deprecated, no replacement at this time. | `read:message, write:files` | `Recommended` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed. | - @@ -470,7 +448,6 @@ a thread that started a span. | [`thread.id`](/docs/attributes-registry/thread.md) | int | Current "managed" thread ID (as opposed to OS thread ID). | `42` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`thread.name`](/docs/attributes-registry/thread.md) | string | Current thread name. | `main` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - @@ -511,7 +488,6 @@ about the span. | [`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.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) | - diff --git a/docs/general/events.md b/docs/general/events.md index 9ab0c8ec0f..73bf87be5c 100644 --- a/docs/general/events.md +++ b/docs/general/events.md @@ -47,9 +47,6 @@ structure and semantics will also be defined. **[1]:** Event names are subject to the same rules as [attribute names](/docs/general/attribute-naming.md). Notably, event names are namespaced to avoid collisions and provide a clean separation of semantics for events in separate domains like browser, mobile, and kubernetes. - - - @@ -58,7 +55,7 @@ structure and semantics will also be defined. ### General event semantics * An event MUST have an `event.name` attribute that uniquely identifies the event. -* It MAY have [standard](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/common#attribute) +* It MAY have [standard](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/common#attribute) attributes that provide additional context about the event. * It MAY contain a _payload_ (body) that describes the specific details of the named event. @@ -73,7 +70,7 @@ structure and semantics will also be defined. Recommendations for defining events: * Use the _payload_ (body) to represent the details of the event instead of a - collection of [standard](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/common#attribute) + collection of [standard](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/common#attribute) attributes. * Events SHOULD be generated / produced / recorded using the [Event API](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/event-api.md) diff --git a/docs/general/logs.md b/docs/general/logs.md index 6d27241933..4f3f8e9af8 100644 --- a/docs/general/logs.md +++ b/docs/general/logs.md @@ -28,7 +28,7 @@ The following semantic conventions for logs are defined: * [Feature Flags](/docs/feature-flags/feature-flags-logs.md): Semantic attributes that may be used in describing feature flag evaluations in logs. Apart from semantic conventions for logs, [events](events.md), [traces](trace.md), and [metrics](metrics.md), -OpenTelemetry also defines the concept of overarching [Resources](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/resource/sdk.md) with their own +OpenTelemetry also defines the concept of overarching [Resources](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/resource/sdk.md) with their own [Resource Semantic Conventions](/docs/resource/README.md). ## General log identification attributes @@ -52,9 +52,6 @@ These attributes may be used for identifying a Log Record. **[2]:** If an id is provided, other log records with the same id will be considered duplicates and can be removed safely. This means, that two distinguishable log records MUST have different values. The id MAY be an [Universally Unique Lexicographically Sortable Identifier (ULID)](https://github.com/ulid/spec), but other identifiers (e.g. UUID) may be used as needed. - - - @@ -64,7 +61,7 @@ The id MAY be an [Universally Unique Lexicographically Sortable Identifier (ULID This section describes attributes for log media in OpenTelemetry. Log media are mechanisms by which logs are transmitted. Types of media include files, streams, network protocols, and os-specific logging services such as journald and Windows Event Log. -**Note:** The OpenTelemetry specification defines a [Resource](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/resource/sdk.md) as `an immutable representation of the entity producing telemetry`. +**Note:** The OpenTelemetry specification defines a [Resource](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/resource/sdk.md) as `an immutable representation of the entity producing telemetry`. The following attributes do not describe entities that produce telemetry. Rather, they describe mechanisms of log transmission. As such, these should be recorded as Log Record attributes when applicable. They should not be recorded as Resource attributes. @@ -86,7 +83,6 @@ As such, these should be recorded as Log Record attributes when applicable. They | [`log.file.path`](/docs/attributes-registry/log.md) | string | The full path to the file. | `/var/log/mysql/audit.log` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`log.file.path_resolved`](/docs/attributes-registry/log.md) | string | The full path to the file, with symlinks resolved. | `/var/lib/docker/uuid.log` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - @@ -114,8 +110,6 @@ As such, these should be recorded as Log Record attributes when applicable. They | `stderr` | Events from stderr stream | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `stdout` | Logs from stdout stream | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - diff --git a/docs/general/metrics.md b/docs/general/metrics.md index 4d6e1060de..b69930e674 100644 --- a/docs/general/metrics.md +++ b/docs/general/metrics.md @@ -40,7 +40,7 @@ The following semantic conventions surrounding metrics are defined: * [Runtime Environment](/docs/runtime/README.md#metrics): For runtime environment metrics. Apart from semantic conventions for metrics, [traces](trace.md), [logs](logs.md), and [events](events.md), OpenTelemetry also -defines the concept of overarching [Resources](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/resource/sdk.md) with +defines the concept of overarching [Resources](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/resource/sdk.md) with their own [Resource Semantic Conventions](/docs/resource/README.md). ## General Guidelines @@ -124,7 +124,7 @@ usable. When building components that interoperate between OpenTelemetry and a system using the OpenMetrics exposition format, use the -[OpenMetrics Guidelines](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/compatibility/prometheus_and_openmetrics.md). +[OpenMetrics Guidelines](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/compatibility/prometheus_and_openmetrics.md). ### Naming rules for Counters and UpDownCounters diff --git a/docs/general/profiles.md b/docs/general/profiles.md index 93efd6a67c..5a6c0f3666 100644 --- a/docs/general/profiles.md +++ b/docs/general/profiles.md @@ -1,6 +1,5 @@ # General Profiles Attributes @@ -45,8 +44,6 @@ They may be used in any Profiles record they apply to. | `ruby` | [Ruby](https://wikipedia.org/wiki/Ruby_(programming_language)) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `v8js` | [V8JS](https://wikipedia.org/wiki/V8_(JavaScript_engine)) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - diff --git a/docs/general/session.md b/docs/general/session.md index 99ab4d63f5..8302097127 100644 --- a/docs/general/session.md +++ b/docs/general/session.md @@ -29,7 +29,6 @@ backends can link the two sessions (see [Session Start Event](#session-start-eve | [`session.id`](/docs/attributes-registry/session.md) | string | A unique id to identify a session. | `00112233-4455-6677-8899-aabbccddeeff` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`session.previous_id`](/docs/attributes-registry/session.md) | string | The previous `session.id` for this user, when known. | `00112233-4455-6677-8899-aabbccddeeff` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - diff --git a/docs/general/trace-compatibility.md b/docs/general/trace-compatibility.md index 2aa617fc8f..c3a22cf2e3 100644 --- a/docs/general/trace-compatibility.md +++ b/docs/general/trace-compatibility.md @@ -37,8 +37,6 @@ between a child Span and a parent Span, as defined by **[1]:** The causal relationship between a child Span and a parent Span. - - `opentracing.ref_type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -46,8 +44,6 @@ between a child Span and a parent Span, as defined by | `child_of` | The parent Span depends on the child Span in some capacity | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `follows_from` | The parent Span doesn't depend in any way on the result of the child Span | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - diff --git a/docs/general/trace.md b/docs/general/trace.md index d7b0e2375b..09b164af16 100644 --- a/docs/general/trace.md +++ b/docs/general/trace.md @@ -34,7 +34,7 @@ The following semantic conventions for spans are defined: * [RPC/RMI](/docs/rpc/rpc-spans.md): For remote procedure call (e.g., gRPC) spans. Apart from semantic conventions for traces, [metrics](metrics.md), [logs](logs.md), and [events](events.md), -OpenTelemetry also defines the concept of overarching [Resources](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/resource/sdk.md) with their own +OpenTelemetry also defines the concept of overarching [Resources](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/resource/sdk.md) with their own [Resource Semantic Conventions](/docs/resource/README.md). [DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status diff --git a/docs/graphql/graphql-spans.md b/docs/graphql/graphql-spans.md index ed193571b3..d4ab893567 100644 --- a/docs/graphql/graphql-spans.md +++ b/docs/graphql/graphql-spans.md @@ -9,10 +9,18 @@ linkTitle: GraphQL Server This document defines semantic conventions to apply when instrumenting the GraphQL implementation. They map GraphQL operations to attributes on a Span. -The **span name** MUST be of the format ` ` provided that -`graphql.operation.type` and `graphql.operation.name` are available. If `graphql.operation.name` is not available, the -span SHOULD be named ``. When `` is not available, `GraphQL Operation` -MAY be used as span name. +The **span name** SHOULD be of the format `{graphql.operation.type}` provided +`graphql.operation.type` is available. If `graphql.operation.type` is not available, +the span SHOULD be named `GraphQL Operation`. + +> **Warning** +> The `graphql.operation.name` value is provided by the client and can have high +> cardinality. Using it in the GraphQL server span name (by default) is +> NOT RECOMMENDED. +> +> Instrumentation MAY provide a configuration option to enable a more descriptive +> span name following `{graphql.operation.type} {graphql.operation.name}` format +> when `graphql.operation.name` is available. @@ -29,8 +37,6 @@ MAY be used as span name. **[1]:** The value may be sanitized to exclude sensitive information. - - `graphql.operation.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -39,8 +45,6 @@ MAY be used as span name. | `query` | GraphQL query | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `subscription` | GraphQL subscription | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - diff --git a/docs/hardware/common.md b/docs/hardware/common.md index b2af5fad63..e8b924af71 100644 --- a/docs/hardware/common.md +++ b/docs/hardware/common.md @@ -26,7 +26,7 @@ The below metrics apply to any type of hardware component. These common `hw.` metrics include the below attributes to describe the monitored component: - + @@ -42,8 +42,6 @@ monitored component: **[1]:** Describes the category of the hardware component for which `hw.state` is being reported. For example, `hw.type=temperature` along with `hw.state=degraded` would indicate that the temperature of the hardware component has been reported as `degraded`. - - `hw.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -63,8 +61,6 @@ monitored component: | `temperature` | Temperature | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `voltage` | Voltage | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -74,7 +70,7 @@ monitored component: This metric is [recommended][MetricRecommended]. - + @@ -94,8 +90,6 @@ This metric is [recommended][MetricRecommended]. **[1]:** Describes the category of the hardware component for which `hw.state` is being reported. For example, `hw.type=temperature` along with `hw.state=degraded` would indicate that the temperature of the hardware component has been reported as `degraded`. - - `hw.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -115,8 +109,6 @@ This metric is [recommended][MetricRecommended]. | `temperature` | Temperature | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `voltage` | Voltage | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -126,7 +118,7 @@ This metric is [recommended][MetricRecommended]. This metric is [recommended][MetricRecommended]. - + @@ -149,15 +141,12 @@ This metric is [recommended][MetricRecommended]. **[2]:** The `error.type` SHOULD match the error code reported by the component, the canonical name of the error, or another low-cardinality error identifier. Instrumentations SHOULD document the list of errors they report. - - `error.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `hw.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -177,8 +166,6 @@ This metric is [recommended][MetricRecommended]. | `temperature` | Temperature | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `voltage` | Voltage | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -188,7 +175,7 @@ This metric is [recommended][MetricRecommended]. This metric is [recommended][MetricRecommended]. - + @@ -199,10 +186,8 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `hw.power` | Gauge | `W` | Instantaneous power consumed by the component [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** It is recommended to report `hw.energy` instead of `hw.power` when possible. - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`hw.id`](/docs/attributes-registry/hardware.md) | string | An identifier for the hardware component, unique within the monitored host | `win32battery_battery_testsysa33_1` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -212,8 +197,6 @@ This metric is [recommended][MetricRecommended]. **[1]:** Describes the category of the hardware component for which `hw.state` is being reported. For example, `hw.type=temperature` along with `hw.state=degraded` would indicate that the temperature of the hardware component has been reported as `degraded`. - - `hw.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -233,8 +216,6 @@ This metric is [recommended][MetricRecommended]. | `temperature` | Temperature | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `voltage` | Voltage | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -244,7 +225,7 @@ This metric is [recommended][MetricRecommended]. This metric is [recommended][MetricRecommended]. - + @@ -255,10 +236,8 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `hw.status` | UpDownCounter | `1` | Operational status: `1` (true) or `0` (false) for each of the possible states [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** `hw.status` is currently specified as an *UpDownCounter* but would ideally be represented using a [*StateSet* as defined in OpenMetrics](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#stateset). This semantic convention will be updated once *StateSet* is specified in OpenTelemetry. This planned change is not expected to have any consequence on the way users query their timeseries backend to retrieve the values of `hw.status` over time. - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`hw.id`](/docs/attributes-registry/hardware.md) | string | An identifier for the hardware component, unique within the monitored host | `win32battery_battery_testsysa33_1` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -269,8 +248,6 @@ This metric is [recommended][MetricRecommended]. **[1]:** Describes the category of the hardware component for which `hw.state` is being reported. For example, `hw.type=temperature` along with `hw.state=degraded` would indicate that the temperature of the hardware component has been reported as `degraded`. - - `hw.state` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -279,7 +256,6 @@ This metric is [recommended][MetricRecommended]. | `failed` | Failed | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `ok` | Ok | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - `hw.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -299,8 +275,6 @@ This metric is [recommended][MetricRecommended]. | `temperature` | Temperature | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `voltage` | Voltage | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - diff --git a/docs/http/http-metrics.md b/docs/http/http-metrics.md index 434f060c95..eaad9db366 100644 --- a/docs/http/http-metrics.md +++ b/docs/http/http-metrics.md @@ -65,7 +65,7 @@ This metric is required. When this metric is reported alongside an HTTP server span, the metric value SHOULD be the same as the HTTP server span duration. This metric SHOULD be specified with -[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/metrics/api.md#instrument-advisory-parameters) +[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/metrics/api.md#instrument-advisory-parameters) of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 ]`. @@ -144,15 +144,12 @@ SHOULD include the [application root](/docs/http/http-spans.md#http-server-defin > Since this attribute is based on HTTP headers, opting in to it may allow an attacker > to trigger cardinality limits, degrading the usefulness of the metric. - - `error.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `http.request.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -168,8 +165,6 @@ SHOULD include the [application root](/docs/http/http-spans.md#http-server-defin | `PUT` | PUT method. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `TRACE` | TRACE method. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - @@ -222,8 +217,6 @@ Tracing instrumentations that do so, MUST also set `http.request.method_original > Since this attribute is based on HTTP headers, opting in to it may allow an attacker > to trigger cardinality limits, degrading the usefulness of the metric. - - `http.request.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -239,8 +232,6 @@ Tracing instrumentations that do so, MUST also set `http.request.method_original | `PUT` | PUT method. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `TRACE` | TRACE method. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - @@ -261,10 +252,8 @@ This metric is optional. | -------- | --------------- | ----------- | -------------- | --------- | | `http.server.request.body.size` | Histogram | `By` | Size of HTTP server request bodies. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`http.request.method`](/docs/attributes-registry/http.md) | string | HTTP request method. [1] | `GET`; `POST`; `HEAD` | `Required` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | @@ -330,15 +319,12 @@ SHOULD include the [application root](/docs/http/http-spans.md#http-server-defin > Since this attribute is based on HTTP headers, opting in to it may allow an attacker > to trigger cardinality limits, degrading the usefulness of the metric. - - `error.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `http.request.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -354,8 +340,6 @@ SHOULD include the [application root](/docs/http/http-spans.md#http-server-defin | `PUT` | PUT method. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `TRACE` | TRACE method. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - @@ -376,10 +360,8 @@ This metric is optional. | -------- | --------------- | ----------- | -------------- | --------- | | `http.server.response.body.size` | Histogram | `By` | Size of HTTP server response bodies. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`http.request.method`](/docs/attributes-registry/http.md) | string | HTTP request method. [1] | `GET`; `POST`; `HEAD` | `Required` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | @@ -445,15 +427,12 @@ SHOULD include the [application root](/docs/http/http-spans.md#http-server-defin > Since this attribute is based on HTTP headers, opting in to it may allow an attacker > to trigger cardinality limits, degrading the usefulness of the metric. - - `error.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `http.request.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -469,8 +448,6 @@ SHOULD include the [application root](/docs/http/http-spans.md#http-server-defin | `PUT` | PUT method. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `TRACE` | TRACE method. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - @@ -485,7 +462,7 @@ This metric is required. When this metric is reported alongside an HTTP client span, the metric value SHOULD be the same as the HTTP client span duration. This metric SHOULD be specified with -[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/metrics/api.md#instrument-advisory-parameters) +[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/metrics/api.md#instrument-advisory-parameters) of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 ]`. @@ -552,15 +529,12 @@ If the request has completed successfully, instrumentations SHOULD NOT set `erro **[7]:** If protocol version is subject to negotiation (for example using [ALPN](https://www.rfc-editor.org/rfc/rfc7301.html)), this attribute SHOULD be set to the negotiated version. If the actual protocol version is not known, this attribute SHOULD NOT be set. - - `error.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `http.request.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -576,8 +550,6 @@ If the request has completed successfully, instrumentations SHOULD NOT set `erro | `PUT` | PUT method. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `TRACE` | TRACE method. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - @@ -602,9 +574,6 @@ Instrumentations MAY allow users to enable additional experimental attributes. **[1]:** The `url.template` MUST have low cardinality. It is not usually available on HTTP clients, but may be known by the application or specialized HTTP instrumentation. - - - @@ -625,10 +594,8 @@ This metric is optional. | -------- | --------------- | ----------- | -------------- | --------- | | `http.client.request.body.size` | Histogram | `By` | Size of HTTP client request bodies. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`http.request.method`](/docs/attributes-registry/http.md) | string | HTTP request method. [1] | `GET`; `POST`; `HEAD` | `Required` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | @@ -685,15 +652,12 @@ If the request has completed successfully, instrumentations SHOULD NOT set `erro **[8]:** If protocol version is subject to negotiation (for example using [ALPN](https://www.rfc-editor.org/rfc/rfc7301.html)), this attribute SHOULD be set to the negotiated version. If the actual protocol version is not known, this attribute SHOULD NOT be set. - - `error.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `http.request.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -709,8 +673,6 @@ If the request has completed successfully, instrumentations SHOULD NOT set `erro | `PUT` | PUT method. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `TRACE` | TRACE method. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - @@ -731,10 +693,8 @@ This metric is optional. | -------- | --------------- | ----------- | -------------- | --------- | | `http.client.response.body.size` | Histogram | `By` | Size of HTTP client response bodies. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`http.request.method`](/docs/attributes-registry/http.md) | string | HTTP request method. [1] | `GET`; `POST`; `HEAD` | `Required` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | @@ -791,15 +751,12 @@ If the request has completed successfully, instrumentations SHOULD NOT set `erro **[8]:** If protocol version is subject to negotiation (for example using [ALPN](https://www.rfc-editor.org/rfc/rfc7301.html)), this attribute SHOULD be set to the negotiated version. If the actual protocol version is not known, this attribute SHOULD NOT be set. - - `error.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `http.request.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -815,8 +772,6 @@ If the request has completed successfully, instrumentations SHOULD NOT set `erro | `PUT` | PUT method. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `TRACE` | TRACE method. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - @@ -852,8 +807,6 @@ This metric is optional. **[3]:** If protocol version is subject to negotiation (for example using [ALPN](https://www.rfc-editor.org/rfc/rfc7301.html)), this attribute SHOULD be set to the negotiated version. If the actual protocol version is not known, this attribute SHOULD NOT be set. - - `http.connection.state` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -861,8 +814,6 @@ This metric is optional. | `active` | active state. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `idle` | idle state. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -871,7 +822,7 @@ This metric is optional. ### Metric: `http.client.connection.duration` This metric SHOULD be specified with -[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/metrics/api.md#instrument-advisory-parameters) +[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/metrics/api.md#instrument-advisory-parameters) of `[ 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 30, 60, 120, 300 ]`. This metric is optional. @@ -901,9 +852,6 @@ This metric is optional. **[3]:** If protocol version is subject to negotiation (for example using [ALPN](https://www.rfc-editor.org/rfc/rfc7301.html)), this attribute SHOULD be set to the negotiated version. If the actual protocol version is not known, this attribute SHOULD NOT be set. - - - @@ -955,8 +903,6 @@ HTTP method names are case-sensitive and `http.request.method` attribute value M Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent. Tracing instrumentations that do so, MUST also set `http.request.method_original` to the original value. - - `http.request.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -972,8 +918,6 @@ Tracing instrumentations that do so, MUST also set `http.request.method_original | `PUT` | PUT method. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `TRACE` | TRACE method. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - diff --git a/docs/http/http-spans.md b/docs/http/http-spans.md index 8ad95e8097..24d73933ab 100644 --- a/docs/http/http-spans.md +++ b/docs/http/http-spans.md @@ -66,7 +66,7 @@ and various HTTP versions like 1.1, 2 and SPDY. ## Name -HTTP spans MUST follow the overall [guidelines for span names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/trace/api.md#span). +HTTP spans MUST follow the overall [guidelines for span names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/trace/api.md#span). HTTP span names SHOULD be `{method} {target}` if there is a (low-cardinality) `target` available. If there is no (low-cardinality) `{target}` available, HTTP span names SHOULD be `{method}`. @@ -88,7 +88,7 @@ Instrumentation MUST NOT default to using URI path as a `{target}`. ## Status -[Span Status](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/trace/api.md#set-status) MUST be left unset if HTTP status code was in the +[Span Status](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/trace/api.md#set-status) MUST be left unset if HTTP status code was in the 1xx, 2xx or 3xx ranges, unless there was another error (e.g., network error receiving the response body; or 3xx codes with max redirects exceeded), in which case status MUST be set to `Error`. @@ -220,8 +220,6 @@ The attribute value MUST consist of either multiple header values as an array of **[13]:** Generally `tcp` for `HTTP/1.0`, `HTTP/1.1`, and `HTTP/2`. Generally `udp` for `HTTP/3`. Other obscure implementations are possible. - - The following attributes can be important for making sampling decisions and SHOULD be provided **at span creation time** (if provided at all): @@ -236,7 +234,6 @@ and SHOULD be provided **at span creation time** (if provided at all): |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `http.request.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -252,7 +249,6 @@ and SHOULD be provided **at span creation time** (if provided at all): | `PUT` | PUT method. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `TRACE` | TRACE method. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `network.transport` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -263,8 +259,6 @@ and SHOULD be provided **at span creation time** (if provided at all): | `udp` | UDP | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `unix` | Unix domain socket | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - @@ -293,9 +287,6 @@ Instrumentations MAY allow users to enable additional experimental attributes. **[1]:** The `url.template` MUST have low cardinality. It is not usually available on HTTP clients, but may be known by the application or specialized HTTP instrumentation. - - - @@ -480,8 +471,6 @@ The attribute value MUST consist of either multiple header values as an array of **[17]:** Generally `tcp` for `HTTP/1.0`, `HTTP/1.1`, and `HTTP/2`. Generally `udp` for `HTTP/3`. Other obscure implementations are possible. - - The following attributes can be important for making sampling decisions and SHOULD be provided **at span creation time** (if provided at all): @@ -501,7 +490,6 @@ and SHOULD be provided **at span creation time** (if provided at all): |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `http.request.method` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -517,7 +505,6 @@ and SHOULD be provided **at span creation time** (if provided at all): | `PUT` | PUT method. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `TRACE` | TRACE method. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `network.transport` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -528,8 +515,6 @@ and SHOULD be provided **at span creation time** (if provided at all): | `udp` | UDP | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `unix` | Unix domain socket | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - @@ -557,7 +542,6 @@ Instrumentations MAY allow users to enable additional experimental attributes. | [`http.response.body.size`](/docs/attributes-registry/http.md) | int | The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. | `3495` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`http.response.size`](/docs/attributes-registry/http.md) | int | The total size of the response in bytes. This should be the total number of bytes sent over the wire, including the status line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and response body and trailers if any. | `1437` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - @@ -734,4 +718,4 @@ Span name: `POST /uploads/:document_id`. | `error.type` | `WebSocketDisconnect` | [DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status -[SpanProcessor]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/trace/sdk.md#span-processor +[SpanProcessor]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/trace/sdk.md#span-processor diff --git a/docs/messaging/azure-messaging.md b/docs/messaging/azure-messaging.md index 72ef2814e2..fcd5c05817 100644 --- a/docs/messaging/azure-messaging.md +++ b/docs/messaging/azure-messaging.md @@ -29,7 +29,7 @@ The following additional attributes are defined: | [`messaging.batch.message_count`](/docs/attributes-registry/messaging.md) | int | The number of messages sent, received, or processed in the scope of the batching operation. [3] | `0`; `1`; `2` | `Conditionally Required` [4] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.destination.name`](/docs/attributes-registry/messaging.md) | string | The message destination name [5] | `MyQueue`; `MyTopic` | `Conditionally Required` [6] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.destination.subscription.name`](/docs/attributes-registry/messaging.md) | string | Azure Service Bus [subscription name](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-queues-topics-subscriptions#topics-and-subscriptions). | `subscription-a` | `Conditionally Required` If messages are received from the subscription. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`messaging.operation.type`](/docs/attributes-registry/messaging.md) | string | A string identifying the type of the messaging operation. [7] | `publish`; `create`; `receive` | `Conditionally Required` If applicable. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`messaging.operation.type`](/docs/attributes-registry/messaging.md) | string | A string identifying the type of the messaging operation. [7] | `create`; `send`; `receive` | `Conditionally Required` If applicable. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.servicebus.disposition_status`](/docs/attributes-registry/messaging.md) | string | Describes the [settlement type](https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock). | `complete`; `abandon`; `dead_letter` | `Conditionally Required` if and only if `messaging.operation` is `settle`. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.servicebus.message.delivery_count`](/docs/attributes-registry/messaging.md) | int | Number of deliveries that have been attempted for this message. | `2` | `Conditionally Required` [8] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`server.address`](/docs/attributes-registry/server.md) | string | Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [9] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Conditionally Required` If available. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | @@ -86,8 +86,6 @@ the broker doesn't have such notion, the destination name SHOULD uniquely identi **[10]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - - The following attributes can be important for making sampling decisions and SHOULD be provided **at span creation time** (if provided at all): @@ -104,18 +102,16 @@ and SHOULD be provided **at span creation time** (if provided at all): |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `messaging.operation.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| -| `create` | A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch publishing scenarios. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `create` | A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch sending scenarios. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process` | One or more messages are processed by a consumer. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `publish` | One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `receive` | One or more messages are requested by a consumer. This operation refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive messages. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `send` | One or more messages are provided for sending to an intermediary. If a single message is sent, the context of the "Send" span can be used as the creation context and no "Create" span needs to be created. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `settle` | One or more messages are settled. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - `messaging.servicebus.disposition_status` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -125,8 +121,6 @@ and SHOULD be provided **at span creation time** (if provided at all): | `dead_letter` | Message is sent to dead letter queue | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `defer` | Message is deferred | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -154,7 +148,7 @@ The following additional attributes are defined: | [`messaging.consumer.group.name`](/docs/attributes-registry/messaging.md) | string | Azure Event Hubs [consumer group name](https://learn.microsoft.com/en-us/azure/event-hubs/event-hubs-features#consumer-groups). | `my-group`; `indexer` | `Conditionally Required` On consumer spans. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.destination.name`](/docs/attributes-registry/messaging.md) | string | The message destination name [5] | `MyQueue`; `MyTopic` | `Conditionally Required` [6] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.destination.partition.id`](/docs/attributes-registry/messaging.md) | string | String representation of the partition id messages are sent to or received from, unique within the Event Hub. | `1` | `Conditionally Required` If available. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`messaging.operation.type`](/docs/attributes-registry/messaging.md) | string | A string identifying the type of the messaging operation. [7] | `publish`; `create`; `receive` | `Conditionally Required` If applicable. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`messaging.operation.type`](/docs/attributes-registry/messaging.md) | string | A string identifying the type of the messaging operation. [7] | `create`; `send`; `receive` | `Conditionally Required` If applicable. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`server.address`](/docs/attributes-registry/server.md) | string | Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [8] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Conditionally Required` If available. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`messaging.eventhubs.message.enqueued_time`](/docs/attributes-registry/messaging.md) | int | The UTC epoch seconds at which the message has been accepted and stored in the entity. | `1701393730` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.message.id`](/docs/attributes-registry/messaging.md) | string | A value used by the messaging system as an identifier for the message, represented as a string. | `452a7c7c7c7048c2f887f61572b18fc2` | `Recommended` If span describes operation on a single message. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -207,8 +201,6 @@ the broker doesn't have such notion, the destination name SHOULD uniquely identi **[9]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - - The following attributes can be important for making sampling decisions and SHOULD be provided **at span creation time** (if provided at all): @@ -226,19 +218,16 @@ and SHOULD be provided **at span creation time** (if provided at all): |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `messaging.operation.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| -| `create` | A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch publishing scenarios. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `create` | A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch sending scenarios. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process` | One or more messages are processed by a consumer. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `publish` | One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `receive` | One or more messages are requested by a consumer. This operation refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive messages. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `send` | One or more messages are provided for sending to an intermediary. If a single message is sent, the context of the "Send" span can be used as the creation context and no "Create" span needs to be created. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `settle` | One or more messages are settled. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - diff --git a/docs/messaging/gcp-pubsub.md b/docs/messaging/gcp-pubsub.md index 9bbcc160ed..166f7cbcdc 100644 --- a/docs/messaging/gcp-pubsub.md +++ b/docs/messaging/gcp-pubsub.md @@ -28,7 +28,7 @@ For Google Cloud Pub/Sub, the following additional attributes are defined: | [`messaging.batch.message_count`](/docs/attributes-registry/messaging.md) | int | The number of messages sent, received, or processed in the scope of the batching operation. [3] | `0`; `1`; `2` | `Conditionally Required` [4] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.destination.name`](/docs/attributes-registry/messaging.md) | string | The message destination name [5] | `MyQueue`; `MyTopic` | `Conditionally Required` [6] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.gcp_pubsub.message.ordering_key`](/docs/attributes-registry/messaging.md) | string | The ordering key for a given message. If the attribute is not present, the message does not have an ordering key. | `ordering_key` | `Conditionally Required` If the message type has an ordering key set. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`messaging.operation.type`](/docs/attributes-registry/messaging.md) | string | A string identifying the type of the messaging operation. [7] | `publish`; `create`; `receive` | `Conditionally Required` If applicable. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`messaging.operation.type`](/docs/attributes-registry/messaging.md) | string | A string identifying the type of the messaging operation. [7] | `create`; `send`; `receive` | `Conditionally Required` If applicable. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`server.address`](/docs/attributes-registry/server.md) | string | Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [8] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Conditionally Required` If available. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`messaging.destination.subscription.name`](/docs/attributes-registry/messaging.md) | string | Google Pub/Sub [subscription name](https://cloud.google.com/pubsub/docs/subscription-overview). | `subscription-a` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.gcp_pubsub.message.ack_deadline`](/docs/attributes-registry/messaging.md) | int | The ack deadline in seconds set for the modify ack deadline request. | `10` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -81,8 +81,6 @@ the broker doesn't have such notion, the destination name SHOULD uniquely identi **[9]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - - The following attributes can be important for making sampling decisions and SHOULD be provided **at span creation time** (if provided at all): @@ -99,19 +97,16 @@ and SHOULD be provided **at span creation time** (if provided at all): |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `messaging.operation.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| -| `create` | A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch publishing scenarios. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `create` | A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch sending scenarios. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process` | One or more messages are processed by a consumer. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `publish` | One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `receive` | One or more messages are requested by a consumer. This operation refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive messages. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `send` | One or more messages are provided for sending to an intermediary. If a single message is sent, the context of the "Send" span can be used as the creation context and no "Create" span needs to be created. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `settle` | One or more messages are settled. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -129,7 +124,7 @@ flowchart LR; direction LR CA[Span Create A] CB[Span Create B] - P[Span Publish A B] + P[Span Send A B] end CA-. link .-P; CB-. link .-P; @@ -141,7 +136,7 @@ flowchart LR; linkStyle 0,1 color:green,stroke:green ``` -| Field or Attribute | Span Create A | Span Create B | Span Publish A B | +| Field or Attribute | Producer Span Create A | Producer Span Create B | Producer Span Send A B | |-|-|-|-| | Span name | `create T` | `create T` | `send T` | | Parent | | | | @@ -151,7 +146,7 @@ flowchart LR; | `messaging.batch.message_count` | | | 2 | | `messaging.destination.name` | `"T"` | `"T"` | `"T"` | | `messaging.operation.name` | `"create"` | `"create"` | `"send"` | -| `messaging.operation.type` | `"create"` | `"create"` | `"publish"` | +| `messaging.operation.type` | `"create"` | `"create"` | `"send"` | | `messaging.message.id` | `"a1"` | `"a2"` | | | `messaging.message.envelope.size` | `1` | `1` | | | `messaging.system` | `"gcp_pubsub"` | `"gcp_pubsub"` | `"gcp_pubsub"` | @@ -162,14 +157,14 @@ flowchart LR; flowchart TD; subgraph CONSUMER direction LR - R1[Receive m1] - SM1[Ack m1] - EM1[Modack m1] + R1[Receive A] + SM1[Ack A] + EM1[Modack A] end subgraph PRODUCER direction LR - CM1[Create m1] - PM1[Publish] + CM1[Create A] + PM1[Send] end %% Link 0 CM1-. link .-PM1; @@ -200,7 +195,7 @@ flowchart TD; linkStyle 3 color:#0560f2,stroke:#0560f2 ``` -| Field or Attribute | Span Create A | Span Publish A | Span Receive A | Span Modack A | Span Ack A | +| Field or Attribute | Producer Span Create A | Producer Span Send | Consumer Span Receive A | Consumer Span Modack A | Consumer Span Ack A | |-|-|-|-|-|-| | Span name | `create T` | `send T` | `receive S` | `modack S` | `ack S` | | Parent | | | | | | @@ -210,7 +205,7 @@ flowchart TD; | `messaging.destination.name` | `"T"`| `"T"`| `"S"` | `"S"` |`"S"` | | `messaging.system` | `"gcp_pubsub"` | `"gcp_pubsub"` | `"gcp_pubsub"` | `"gcp_pubsub"` | `"gcp_pubsub"` | | `messaging.operation.name` | `"create"` | `"send"` | `"receive"` | `"modack"` | `"ack"` | -| `messaging.operation.type` | `"create"` | `"publish"` | `"receive"` | | `"settle"` | +| `messaging.operation.type` | `"create"` | `"send"` | `"receive"` | | `"settle"` | | `messaging.message.id` | `"a1"` | | `"a1"` | | | | `messaging.message.envelope.size` | `1` | `1` | `1` | | | | `messaging.gcp_pubsub.message.ack_id` | | | | `"ack_id1"` |`"ack_id1"` | diff --git a/docs/messaging/kafka.md b/docs/messaging/kafka.md index 5890dcac3f..3b1704af26 100644 --- a/docs/messaging/kafka.md +++ b/docs/messaging/kafka.md @@ -36,16 +36,16 @@ For Apache Kafka, the following additional attributes are defined: | [`messaging.batch.message_count`](/docs/attributes-registry/messaging.md) | int | The number of messages sent, received, or processed in the scope of the batching operation. [2] | `0`; `1`; `2` | `Conditionally Required` [3] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.destination.name`](/docs/attributes-registry/messaging.md) | string | The message destination name [4] | `MyQueue`; `MyTopic` | `Conditionally Required` [5] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.kafka.message.tombstone`](/docs/attributes-registry/messaging.md) | boolean | A boolean that is true if the message is a tombstone. | | `Conditionally Required` [6] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`messaging.operation.type`](/docs/attributes-registry/messaging.md) | string | A string identifying the type of the messaging operation. [7] | `publish`; `create`; `receive` | `Conditionally Required` If applicable. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`messaging.operation.type`](/docs/attributes-registry/messaging.md) | string | A string identifying the type of the messaging operation. [7] | `create`; `send`; `receive` | `Conditionally Required` If applicable. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`server.address`](/docs/attributes-registry/server.md) | string | Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [8] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Conditionally Required` If available. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`messaging.client.id`](/docs/attributes-registry/messaging.md) | string | A unique identifier for the client that consumes or produces a message. | `client-5`; `myhost@8742@s8083jm` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.consumer.group.name`](/docs/attributes-registry/messaging.md) | string | Kafka [consumer group id](https://docs.confluent.io/platform/current/clients/consumer.html). | `my-group`; `indexer` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.destination.partition.id`](/docs/attributes-registry/messaging.md) | string | String representation of the partition id the message (or batch) is sent to or received from. | `1` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.kafka.message.key`](/docs/attributes-registry/messaging.md) | string | Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message.id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set. [9] | `myKey` | `Recommended` If span describes operation on a single message. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.kafka.offset`](/docs/attributes-registry/messaging.md) | int | The offset of a record in the corresponding Kafka partition. | `42` | `Recommended` If span describes operation on a single message. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`messaging.message.body.size`](/docs/attributes-registry/messaging.md) | int | The size of the message body in bytes. [10] | `1439` | `Recommended` If span describes operation on a single message. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.message.id`](/docs/attributes-registry/messaging.md) | string | A value used by the messaging system as an identifier for the message, represented as a string. | `452a7c7c7c7048c2f887f61572b18fc2` | `Recommended` If span describes operation on a single message. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [11] | `80`; `8080`; `443` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [10] | `80`; `8080`; `443` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`messaging.message.body.size`](/docs/attributes-registry/messaging.md) | int | The size of the message body in bytes. Only applicable for spans describing single message operations. [11] | `1439` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** The `error.type` SHOULD be predictable, and SHOULD have low cardinality. @@ -84,12 +84,10 @@ the broker doesn't have such notion, the destination name SHOULD uniquely identi **[9]:** If the key type is not string, it's string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value. -**[10]:** This can refer to both the compressed or uncompressed body size. If both sizes are known, the uncompressed -body size should be used. - -**[11]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - +**[10]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. +**[11]:** This can refer to both the compressed or uncompressed body size. If both sizes are known, the uncompressed +body size should be used. The following attributes can be important for making sampling decisions and SHOULD be provided **at span creation time** (if provided at all): @@ -108,19 +106,16 @@ and SHOULD be provided **at span creation time** (if provided at all): |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `messaging.operation.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| -| `create` | A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch publishing scenarios. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `create` | A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch sending scenarios. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process` | One or more messages are processed by a consumer. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `publish` | One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `receive` | One or more messages are requested by a consumer. This operation refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive messages. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `send` | One or more messages are provided for sending to an intermediary. If a single message is sent, the context of the "Send" span can be used as the creation context and no "Create" span needs to be created. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `settle` | One or more messages are settled. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -165,7 +160,7 @@ flowchart LR; linkStyle 1 color:green,stroke:green ``` -| Field or Attribute | Span Send | Span Poll | Span Process | Span Commit T | +| Field or Attribute | Producer | Consumer Span Poll | Consumer Span Process | Consumer Span Commit T | |-|-|-|-|-| | Span name | `"send T"` | `"poll T"` | `"process T"` | `"commit T"` | | Parent | | | (optional) Span Send | Span Process | @@ -177,7 +172,7 @@ flowchart LR; | `messaging.destination.consumer.group` | | `"my-group"` | `"my-group"` | `"my-group"` | | `messaging.destination.partition.id` | `"1"` | `"1"` | `"1"` | `"1"` | | `messaging.operation.name` | `"send"` | `"poll"` | `"process"` | `"commit"` | -| `messaging.operation.type` | `"publish"` | `"receive"` | `"process"` | `"settle"` | +| `messaging.operation.type` | `"send"` | `"receive"` | `"process"` | `"settle"` | | `messaging.client.id` | `"5"` | `"8"` | `"8"` | `"8"` | | `messaging.kafka.message.key` | `"myKey"` | `"myKey"` | `"myKey"` | | | `messaging.kafka.message.offset` | | `"12"` | `"12"` | `"12"` | diff --git a/docs/messaging/messaging-metrics.md b/docs/messaging/messaging-metrics.md index afd8bff072..d116989b58 100644 --- a/docs/messaging/messaging-metrics.md +++ b/docs/messaging/messaging-metrics.md @@ -9,7 +9,7 @@ - [Common metrics](#common-metrics) - [Metric: `messaging.client.operation.duration`](#metric-messagingclientoperationduration) - [Producer metrics](#producer-metrics) - - [Metric: `messaging.client.published.messages`](#metric-messagingclientpublishedmessages) + - [Metric: `messaging.client.sent.messages`](#metric-messagingclientsentmessages) - [Consumer metrics](#consumer-metrics) - [Metric: `messaging.client.consumed.messages`](#metric-messagingclientconsumedmessages) - [Metric: `messaging.process.duration`](#metric-messagingprocessduration) @@ -32,7 +32,7 @@ When this metric is reported alongside a messaging span, the metric value SHOULD This metric is [required][MetricRequired]. This metric SHOULD be specified with -[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/metrics/api.md#instrument-advisory-parameters) +[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/metrics/api.md#instrument-advisory-parameters) of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 ]`. @@ -46,10 +46,8 @@ of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 | -------- | --------------- | ----------- | -------------- | --------- | | `messaging.client.operation.duration` | Histogram | `s` | Duration of messaging operation initiated by a producer or consumer client. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** This metric SHOULD NOT be used to report processing duration - processing duration is reported in `messaging.process.duration` metric. - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`messaging.operation.name`](/docs/attributes-registry/messaging.md) | string | The system-specific name of the messaging operation. | `send`; `receive`; `ack` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -59,7 +57,7 @@ of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 | [`messaging.destination.name`](/docs/attributes-registry/messaging.md) | string | The message destination name [4] | `MyQueue`; `MyTopic` | `Conditionally Required` [5] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.destination.subscription.name`](/docs/attributes-registry/messaging.md) | string | The name of the destination subscription from which a message is consumed. [6] | `subscription-a` | `Conditionally Required` if applicable. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.destination.template`](/docs/attributes-registry/messaging.md) | string | Low cardinality representation of the messaging destination name [7] | `/customers/{customerId}` | `Conditionally Required` if available. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`messaging.operation.type`](/docs/attributes-registry/messaging.md) | string | A string identifying the type of the messaging operation. [8] | `publish`; `create`; `receive` | `Conditionally Required` If applicable. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`messaging.operation.type`](/docs/attributes-registry/messaging.md) | string | A string identifying the type of the messaging operation. [8] | `create`; `send`; `receive` | `Conditionally Required` If applicable. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`server.address`](/docs/attributes-registry/server.md) | string | Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [9] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Conditionally Required` If available. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`messaging.destination.partition.id`](/docs/attributes-registry/messaging.md) | string | The identifier of the partition messages are sent to or received from, unique within the `messaging.destination.name`. | `1` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [10] | `80`; `8080`; `443` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | @@ -103,26 +101,22 @@ the broker doesn't have such notion, the destination name SHOULD uniquely identi **[10]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - - `error.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `messaging.operation.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| -| `create` | A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch publishing scenarios. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `create` | A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch sending scenarios. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process` | One or more messages are processed by a consumer. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `publish` | One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `receive` | One or more messages are requested by a consumer. This operation refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive messages. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `send` | One or more messages are provided for sending to an intermediary. If a single message is sent, the context of the "Send" span can be used as the creation context and no "Create" span needs to be created. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `settle` | One or more messages are settled. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - `messaging.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -139,8 +133,6 @@ the broker doesn't have such notion, the destination name SHOULD uniquely identi | `rocketmq` | Apache RocketMQ | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `servicebus` | Azure Service Bus | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -148,11 +140,11 @@ the broker doesn't have such notion, the destination name SHOULD uniquely identi ## Producer metrics -### Metric: `messaging.client.published.messages` +### Metric: `messaging.client.sent.messages` This metric is [required][MetricRequired]. - + @@ -161,11 +153,9 @@ This metric is [required][MetricRequired]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `messaging.client.published.messages` | Counter | `{message}` | Number of messages producer attempted to publish to the broker. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - -**[1]:** This metric MUST NOT count messages that were created haven't yet been attempted to be published. +| `messaging.client.sent.messages` | Counter | `{message}` | Number of messages producer attempted to send to the broker. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +**[1]:** This metric MUST NOT count messages that were created but haven't yet been sent. | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| @@ -211,15 +201,12 @@ the broker doesn't have such notion, the destination name SHOULD uniquely identi **[7]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - - `error.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `messaging.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -236,8 +223,6 @@ the broker doesn't have such notion, the destination name SHOULD uniquely identi | `rocketmq` | Apache RocketMQ | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `servicebus` | Azure Service Bus | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -260,11 +245,9 @@ This metric is [required][MetricRequired]. | -------- | --------------- | ----------- | -------------- | --------- | | `messaging.client.consumed.messages` | Counter | `{message}` | Number of messages that were delivered to the application. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Records the number of messages pulled from the broker or number of messages dispatched to the application in push-based scenarios. The metric SHOULD be reported once per message delivery. For example, if receiving and processing operations are both instrumented for a single message delivery, this counter is incremented when the message is received and not reported when it is processed. - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`messaging.operation.name`](/docs/attributes-registry/messaging.md) | string | The system-specific name of the messaging operation. | `receive`; `peek`; `poll`; `consume` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -315,15 +298,12 @@ the broker doesn't have such notion, the destination name SHOULD uniquely identi **[9]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - - `error.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `messaging.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -340,8 +320,6 @@ the broker doesn't have such notion, the destination name SHOULD uniquely identi | `rocketmq` | Apache RocketMQ | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `servicebus` | Azure Service Bus | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -354,7 +332,7 @@ When this metric is reported alongside a messaging process span, the metric valu This metric is [required][MetricRequired] for push-based message delivery and is [recommended][MetricRecommended] for processing operations instrumented for pull-based scenarios. This metric SHOULD be specified with -[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/metrics/api.md#instrument-advisory-parameters) +[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/metrics/api.md#instrument-advisory-parameters) of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 ]`. @@ -368,10 +346,8 @@ of `[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 | -------- | --------------- | ----------- | -------------- | --------- | | `messaging.process.duration` | Histogram | `s` | Duration of processing operation. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** This metric MUST be reported for operations with `messaging.operation.type` that matches `process`. - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`messaging.operation.name`](/docs/attributes-registry/messaging.md) | string | The system-specific name of the messaging operation. | `process`; `consume`; `handle` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -422,15 +398,12 @@ the broker doesn't have such notion, the destination name SHOULD uniquely identi **[9]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - - `error.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `messaging.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -447,8 +420,6 @@ the broker doesn't have such notion, the destination name SHOULD uniquely identi | `rocketmq` | Apache RocketMQ | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `servicebus` | Azure Service Bus | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - diff --git a/docs/messaging/messaging-spans.md b/docs/messaging/messaging-spans.md index 5ffc36c97d..c13f39a8f6 100644 --- a/docs/messaging/messaging-spans.md +++ b/docs/messaging/messaging-spans.md @@ -31,7 +31,8 @@ - [Examples](#examples) - [Topic with multiple consumers](#topic-with-multiple-consumers) - [Batch receiving](#batch-receiving) - - [Batch publishing](#batch-publishing) + - [Batch publishing with "Create" spans](#batch-publishing-with-create-spans) + - [Batch publishing without "Create" spans](#batch-publishing-without-create-spans) @@ -62,8 +63,9 @@ Messages can be delivered to 0, 1, or multiple consumers depending on the dispat ### Producer The "producer" is a specific instance, process or device that creates and -publishes a message. "Publishing" is the process of sending a message or batch -of messages to the intermediary or consumer. +sends a message. "Sending" is the process of transmitting a message or batch +of messages to the intermediary or consumer. Some intermediaries use "publishing" +as a synonym to sending. ### Consumer @@ -83,7 +85,7 @@ might be another intermediary or a consumer. ### Destinations A destination represents the entity within a messaging system where -messages are published to and consumed from. +messages are sent to and consumed from. A destination is usually uniquely identified by its name within the messaging system instance. @@ -164,7 +166,7 @@ in such a way that it cannot be changed by intermediaries. ### Span name -Messaging spans SHOULD follow the overall [guidelines for span names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.31.0/specification/trace/api.md#span). +Messaging spans SHOULD follow the overall [guidelines for span names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/trace/api.md#span). @@ -185,6 +187,7 @@ If a corresponding `{destination}` value is not available for a specific operati Examples: * `publish shop.orders` +* `send shop.orders` * `subscribe shop.orders` * `ack shop.orders` * `nack print_jobs` @@ -197,8 +200,8 @@ The following operation types related to messages are defined for these semantic | Operation type | Description | | -------------- | ----------- | -| `create` | A message is created or passed to a client library for publishing. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch publishing scenarios. | -| `publish` | One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created. | +| `create` | A message is created or passed to a client library for sending. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch sending scenarios. | +| `send` | One or more messages are provided for sending to an intermediary. If a single message is sent, the context of the "Send" span can be used as the creation context and no "Create" span needs to be created. | | `receive` | One or more messages are requested by a consumer. This operation refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive messages. | | `process` | One or more messages are processed by a consumer. | | `settle` | One or more messages are settled. | @@ -210,7 +213,7 @@ Span kind SHOULD be set according to the following table, based on the operation | Operation type | Span kind| |----------------|-------------| | `create` | `PRODUCER` | -| `publish` | `PRODUCER` if the context of the "Publish" span is used as creation context, otherwise `CLIENT`. | +| `send` | `PRODUCER` if the context of the "Send" span is used as creation context, otherwise `CLIENT`. | | `receive` | `CLIENT` | | `process` | `CONSUMER` | @@ -222,22 +225,30 @@ and relationships between them without the need for additional semantic hints. #### Producer spans "Create" spans MAY be created when a message is created or passed to the client -library or other component responsible for publishing. A single "Create" span -SHOULD account only for a single message. "Publish" spans SHOULD be created +library or other component responsible for sending. A single "Create" span +SHOULD account only for a single message. "Send" spans SHOULD be created for operations of sending or publishing a message to an intermediary. A single -"Publish" span can account for a single message, or for multiple messages (in +"Send" span can account for a single message, or for multiple messages (in the case of sending messages in batches). If a user provides a custom creation context in a message, this context SHOULD NOT be modified and a "Create" span SHOULD NOT be created. Otherwise, if a "Create" span exists for a message, its context SHOULD be injected into the message. If no "Create" span exists and no custom creation context is injected -into the message, the context of the related "Publish" span SHOULD be injected +into the message, the context of the related "Send" span SHOULD be injected into the message. -The "Publish" span SHOULD always link to the creation context that was injected +The "Send" span SHOULD always link to the creation context that was injected into a message either from a "Create" span or as a custom creation context. +When instrumenting a library API that always sends a single message, it is +RECOMMENDED to create "Publish" span without "Create" span. + +When instrumenting a library API that usually operate with batches, it is +RECOMMENDED to create a "Create" span for each message along with the "Publish" span. +It is also RECOMMENDED to provide a configuration option allowing to disable "Create" +span creation. + #### Consumer spans "Receive" spans SHOULD be created for operations of passing messages to the @@ -272,7 +283,7 @@ messages were received). For each message it accounts for, the "Process" or > - It is the only option to correlate producer and consumer(s) in batch scenarios > as a span can only have a single parent. > -> - It is the only option to correlate produce and consumer(s) when message +> - It is the only option to correlate producer and consumer(s) when message > consumption can happen in the scope of another ambient context such as a > HTTP server span. @@ -294,8 +305,8 @@ allowing users to control this behavior. It is NOT RECOMMENDED to use the message creation context as the parent of "Process" spans (by default) if processing happens in the scope of another span. -If instrumentation use the message creation context as the parent for "Process" -spans in the scope of another valid ambient context, they SHOULD add the +If instrumentation uses the message creation context as the parent for "Process" +spans in the scope of another valid ambient context, it SHOULD add the ambient context as a link on the "Process" span to preserve the correlation between message processing and that context. @@ -317,7 +328,7 @@ one of these possible approaches: Messaging attributes are organized into the following namespaces: - `messaging.message`: Contains attributes that describe individual messages. -- `messaging.destination`: Contains attributes that describe the logical entity messages are published to. See [Destinations](#destinations) for more details. +- `messaging.destination`: Contains attributes that describe the logical entity messages are sent to. See [Destinations](#destinations) for more details. - `messaging.batch`: Contains attributes that describe batch operations. - `messaging.consumer`: Contains attributes that describe the application instance that consumes a message. See [Consumer](#consumer) for more details. @@ -342,17 +353,17 @@ Messaging system-specific attributes MUST be defined in the corresponding `messa | [`messaging.destination.subscription.name`](/docs/attributes-registry/messaging.md) | string | The name of the destination subscription from which a message is consumed. [9] | `subscription-a` | `Conditionally Required` If applicable. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.destination.template`](/docs/attributes-registry/messaging.md) | string | Low cardinality representation of the messaging destination name [10] | `/customers/{customerId}` | `Conditionally Required` [11] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.destination.temporary`](/docs/attributes-registry/messaging.md) | boolean | A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. | | `Conditionally Required` [12] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`messaging.operation.type`](/docs/attributes-registry/messaging.md) | string | A string identifying the type of the messaging operation. [13] | `publish`; `create`; `receive` | `Conditionally Required` If applicable. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`messaging.operation.type`](/docs/attributes-registry/messaging.md) | string | A string identifying the type of the messaging operation. [13] | `create`; `send`; `receive` | `Conditionally Required` If applicable. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`server.address`](/docs/attributes-registry/server.md) | string | Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [14] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Conditionally Required` If available. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`messaging.client.id`](/docs/attributes-registry/messaging.md) | string | A unique identifier for the client that consumes or produces a message. | `client-5`; `myhost@8742@s8083jm` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.destination.partition.id`](/docs/attributes-registry/messaging.md) | string | The identifier of the partition messages are sent to or received from, unique within the `messaging.destination.name`. | `1` | `Recommended` When applicable. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`messaging.message.body.size`](/docs/attributes-registry/messaging.md) | int | The size of the message body in bytes. [15] | `1439` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.message.conversation_id`](/docs/attributes-registry/messaging.md) | string | The conversation ID identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". | `MyConversationId` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`messaging.message.envelope.size`](/docs/attributes-registry/messaging.md) | int | The size of the message body and metadata in bytes. [16] | `2738` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.message.id`](/docs/attributes-registry/messaging.md) | string | A value used by the messaging system as an identifier for the message, represented as a string. | `452a7c7c7c7048c2f887f61572b18fc2` | `Recommended` If span describes operation on a single message. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`network.peer.address`](/docs/attributes-registry/network.md) | string | Peer address of the messaging intermediary node where the operation was performed. [17] | `10.1.2.80`; `/tmp/my.sock` | `Recommended` If applicable for this messaging system. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`network.peer.address`](/docs/attributes-registry/network.md) | string | Peer address of the messaging intermediary node where the operation was performed. [15] | `10.1.2.80`; `/tmp/my.sock` | `Recommended` If applicable for this messaging system. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`network.peer.port`](/docs/attributes-registry/network.md) | int | Peer port of the messaging intermediary node where the operation was performed. | `65123` | `Recommended` if and only if `network.peer.address` is set. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [18] | `80`; `8080`; `443` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [16] | `80`; `8080`; `443` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`messaging.message.body.size`](/docs/attributes-registry/messaging.md) | int | The size of the message body in bytes. [17] | `1439` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`messaging.message.envelope.size`](/docs/attributes-registry/messaging.md) | int | The size of the message body and metadata in bytes. [18] | `2738` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** The actual messaging system may differ from the one known by the client. For example, when using Kafka client libraries to communicate with Azure Event Hubs, the `messaging.system` is set to `kafka` based on the instrumentation's best knowledge. @@ -401,19 +412,17 @@ the broker doesn't have such notion, the destination name SHOULD uniquely identi **[14]:** Server domain name of the broker if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. -**[15]:** This can refer to both the compressed or uncompressed body size. If both sizes are known, the uncompressed -body size should be used. - -**[16]:** This can refer to both the compressed or uncompressed size. If both sizes are known, the uncompressed -size should be used. - -**[17]:** Semantic conventions for individual messaging systems SHOULD document whether `network.peer.*` attributes are applicable. +**[15]:** Semantic conventions for individual messaging systems SHOULD document whether `network.peer.*` attributes are applicable. Network peer address and port are important when the application interacts with individual intermediary nodes directly, If a messaging operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. -**[18]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. +**[16]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. +**[17]:** This can refer to both the compressed or uncompressed body size. If both sizes are known, the uncompressed +body size should be used. +**[18]:** This can refer to both the compressed or uncompressed size. If both sizes are known, the uncompressed +size should be used. The following attributes can be important for making sampling decisions and SHOULD be provided **at span creation time** (if provided at all): @@ -435,18 +444,16 @@ and SHOULD be provided **at span creation time** (if provided at all): |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `messaging.operation.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| -| `create` | A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch publishing scenarios. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `create` | A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch sending scenarios. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process` | One or more messages are processed by a consumer. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `publish` | One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `receive` | One or more messages are requested by a consumer. This operation refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive messages. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `send` | One or more messages are provided for sending to an intermediary. If a single message is sent, the context of the "Send" span can be used as the creation context and no "Create" span needs to be created. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `settle` | One or more messages are settled. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - `messaging.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -463,8 +470,6 @@ and SHOULD be provided **at span creation time** (if provided at all): | `rocketmq` | Apache RocketMQ | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `servicebus` | Azure Service Bus | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -472,10 +477,10 @@ and SHOULD be provided **at span creation time** (if provided at all): ### Recording per-message attributes on batch operations -All messaging operations (`publish`, `receive`, `process`, or others not covered by this specification) can describe both single and/or batch of messages. +All messaging operations (`send`, `receive`, `process`, or others not covered by this specification) can describe both single and/or batch of messages. Attributes in the `messaging.message` or `messaging.{system}.message` namespace apply to individual messages and typically vary between messages within the same batch. -Some messaging systems such as Kafka or Azure Event Grid allow publishing a batch of messages to different topics in a single operation, resulting in +Some messaging systems such as Kafka or Azure Event Grid allow sending a batch of messages to different topics in a single operation, resulting in different `messaging.destination.name` or other destination attributes within a single messaging operation. If the attribute value is the same for all messages in the batch, the instrumentation SHOULD set such attribute on the span representing the batch operation. @@ -493,6 +498,11 @@ understanding how messaging spans can be integrated into an overall trace flow. Solid arrows denote parent/child relationships, dotted arrows denote link relationships. +> [!IMPORTANT] +> The text inside the "Span" box is only for reference and visualization purposes. +> Check the accompanying table to see the actual span name to be reported +> as well as other attributes. + ### Topic with multiple consumers Given is a publisher that publishes a message to a topic exchange "T" on RabbitMQ, and two consumers which both get the message delivered. @@ -501,7 +511,7 @@ Given is a publisher that publishes a message to a topic exchange "T" on RabbitM flowchart LR; subgraph PRODUCER direction TB - P[Span Publish A] + P[Span Send A] end subgraph CONSUMER1 direction TB @@ -521,7 +531,7 @@ flowchart LR; linkStyle 0,1,2,3 color:green,stroke:green ``` -| Field or Attribute | Span Publish A | Span Process A 1| Span Process A 2 | +| Field or Attribute | Producer | Consumer 1| Consumer 2 | |-|-|-|-| | Span name | `publish T` | `consume T` | `consume T` | | Parent (optional) | | `publish T` | `publish T` | @@ -532,21 +542,21 @@ flowchart LR; | `messaging.system` | `"rabbitmq"` | `"rabbitmq"` | `"rabbitmq"` | | `messaging.destination.name` | `"T"` | `"T"` | `"T"` | | `messaging.operation.name` | `"publish"` | `"consume"` | `"consume"` | -| `messaging.operation.type` | `"publish"` | `"process"` | `"process"` | +| `messaging.operation.type` | `"send"` | `"process"` | `"process"` | | `messaging.message.id` | `"a"` | `"a"`| `"a"` | ### Batch receiving -Given is a publisher that publishes two messages to a topic "Q" on Kafka, and a consumer which receives both messages in one batch. +Given is a producer that publishes two messages to a topic "Q" on Kafka, and a consumer which receives both messages in one batch. ```mermaid flowchart LR; subgraph PRODUCER direction TB - PA[Span Publish A] - PB[Span Publish B] + PA[Span Send A] + PB[Span Send B] end - subgraph CONSUMER1 + subgraph CONSUMER direction TB D1[Span Receive A B] end @@ -558,35 +568,38 @@ flowchart LR; linkStyle 0,1 color:green,stroke:green ``` -| Field or Attribute | Span Publish A | Span Publish B | Span Receive A B | +| Field or Attribute | Producer Span A | Producer Span B | Consumer | |-|-|-|-| | Span name | `send Q` | `send Q` | `poll Q` | | Parent | | | | -| Links | | | Span Publish A, Span Publish B | -| Link attributes | | | Span Publish A: `messaging.message.id`: `"a1"` | -| | | | Span Publish B: `messaging.message.id`: `"a2"` | +| Links | | | Span Send A, Span Send B | +| Link attributes | | | Span Send A: `messaging.message.id`: `"a1"` | +| | | | Span Send B: `messaging.message.id`: `"a2"` | | SpanKind | `PRODUCER` | `PRODUCER` | `CONSUMER` | | `server.address` | `"ms"` | `"ms"` | `"ms"` | | `server.port` | `1234` | `1234` | `1234` | | `messaging.system` | `"kafka"` | `"kafka"` | `"kafka"` | | `messaging.destination.name` | `"Q"` | `"Q"` | `"Q"` | | `messaging.operation.name` | `"send"` | `"send"` | `"poll"` | -| `messaging.operation.type` | `"publish"` | `"publish"` | `"receive"` | +| `messaging.operation.type` | `"send"` | `"send"` | `"receive"` | | `messaging.message.id` | `"a1"` | `"a2"` | | | `messaging.batch.message_count` | | | 2 | -### Batch publishing +### Batch publishing with "Create" spans -Given is a publisher that publishes a batch with two messages to a topic "Q" on +Given is a producer that publishes a batch with two messages to a topic "Q" on Kafka, and two different consumers receiving one of the messages. +Instrumentation in this case reports "Create" span for each message and a "Publish" +span that's linked to a "Create" span. + ```mermaid flowchart LR; subgraph PRODUCER direction TB CA[Span Create A] CB[Span Create B] - P[Span Publish] + P[Span Send] end subgraph CONSUMER1 direction TB @@ -606,7 +619,7 @@ flowchart LR; linkStyle 0,1,2,3 color:green,stroke:green ``` -| Field or Attribute | Span Create A | Span Create B | Span Publish | Span Receive A | Span Receive B | +| Field or Attribute | Producer Span Create A | Producer Span Create B | Producer Span Send | Consumer 1 | Consumer 2 | |-|-|-|-|-|-| | Span name | `create Q` | `create Q` | `send Q` | `poll Q` | `poll Q` | | Parent | | | | | | @@ -617,8 +630,53 @@ flowchart LR; | `messaging.system` | `"kafka"` | `"kafka"` | `"kafka"` | `"kafka"` | `"kafka"` | | `messaging.destination.name` | `"Q"` | `"Q"` | `"Q"` | `"Q"` | `"Q"` | | `messaging.operation.name` | `"create"` | `"create"` | `"send"` | `"poll"` | `"poll"` | -| `messaging.operation.type` | `"create"` | `"create"` | `"publish"` | `"receive"` | `"receive"` | +| `messaging.operation.type` | `"create"` | `"create"` | `"send"` | `"receive"` | `"receive"` | | `messaging.message.id` | `"a1"` | `"a2"` | | `"a1"` | `"a2"` | | `messaging.batch.message_count` | | | 2 | | | +### Batch publishing without "Create" spans + +Given is a producer that publishes a batch with two messages to a topic "Q" on +Kafka, and two different consumers receiving one of the messages. + +Based on the configuration provided by user, instrumentation in this case reports +"Publish" span only. It injects "Publish" span context into both messages. + +```mermaid +flowchart LR; + subgraph PRODUCER + direction TB + P[Span Publish] + end + subgraph CONSUMER1 + direction TB + D1[Span Receive A] + end + subgraph CONSUMER2 + direction TB + D2[Span Receive B] + end + P-. link .-D1; + P-. link .-D2; + + classDef normal fill:green + class P,D1,D2 normal + linkStyle 0,1 color:green,stroke:green +``` + +| Field or Attribute | Producer | Consumer 1 | Consumer 2 | +|-|-|-|-| +| Span name | `send Q` | `poll Q` | `poll Q` | +| Parent | | | | +| Links | | Span Publish | Span Publish | +| SpanKind | `PRODUCER` | `CONSUMER` | `CONSUMER` | +| `server.address` | `"ms"` | `"ms"` | `"ms"` | +| `server.port` | `1234` | `1234` | `1234` | +| `messaging.system` | `"kafka"` | `"kafka"` | `"kafka"` | +| `messaging.destination.name` | `"Q"` | `"Q"` | `"Q"` | +| `messaging.operation.name` | `"send"` | `"poll"` | `"poll"` | +| `messaging.operation.type` | `"publish"` | `"receive"` | `"receive"` | +| `messaging.message.id` | | `"a1"` | `"a2"` | +| `messaging.batch.message_count`| 2 | | | + [DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status diff --git a/docs/messaging/rabbitmq.md b/docs/messaging/rabbitmq.md index 20ad57d91c..166bde5ce9 100644 --- a/docs/messaging/rabbitmq.md +++ b/docs/messaging/rabbitmq.md @@ -27,16 +27,16 @@ In RabbitMQ, the destination is defined by an *exchange* and a *routing key*. | [`messaging.operation.name`](/docs/attributes-registry/messaging.md) | string | The system-specific name of the messaging operation. | `ack`; `nack`; `send` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [1] | `amqp:decode-error`; `KAFKA_STORAGE_ERROR`; `channel-error` | `Conditionally Required` If and only if the messaging operation has failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`messaging.destination.name`](/docs/attributes-registry/messaging.md) | string | The message destination name [2] | `MyQueue`; `MyTopic` | `Conditionally Required` [3] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`messaging.operation.type`](/docs/attributes-registry/messaging.md) | string | A string identifying the type of the messaging operation. [4] | `publish`; `create`; `receive` | `Conditionally Required` If applicable. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`messaging.operation.type`](/docs/attributes-registry/messaging.md) | string | A string identifying the type of the messaging operation. [4] | `create`; `send`; `receive` | `Conditionally Required` If applicable. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.rabbitmq.destination.routing_key`](/docs/attributes-registry/messaging.md) | string | RabbitMQ message routing key. | `myKey` | `Conditionally Required` If not empty. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.rabbitmq.message.delivery_tag`](/docs/attributes-registry/messaging.md) | int | RabbitMQ message delivery tag | `123` | `Conditionally Required` When available. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`server.address`](/docs/attributes-registry/server.md) | string | Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [5] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Conditionally Required` If available. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`messaging.message.body.size`](/docs/attributes-registry/messaging.md) | int | The size of the message body in bytes. [6] | `1439` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.message.conversation_id`](/docs/attributes-registry/messaging.md) | string | Message [correlation Id](https://www.rabbitmq.com/tutorials/tutorial-six-java#correlation-id) property. | `MyConversationId` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.message.id`](/docs/attributes-registry/messaging.md) | string | A value used by the messaging system as an identifier for the message, represented as a string. | `452a7c7c7c7048c2f887f61572b18fc2` | `Recommended` If span describes operation on a single message. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`network.peer.address`](/docs/attributes-registry/network.md) | string | Peer address of the network connection - IP address or Unix domain socket name. [7] | `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`network.peer.address`](/docs/attributes-registry/network.md) | string | Peer address of the network connection - IP address or Unix domain socket name. [6] | `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`network.peer.port`](/docs/attributes-registry/network.md) | int | Peer port number of the network connection. | `65123` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [8] | `80`; `8080`; `443` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [7] | `80`; `8080`; `443` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`messaging.message.body.size`](/docs/attributes-registry/messaging.md) | int | The size of the message body in bytes. [8] | `1439` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** The `error.type` SHOULD be predictable, and SHOULD have low cardinality. @@ -67,14 +67,12 @@ the broker doesn't have such notion, the destination name SHOULD uniquely identi **[5]:** Server domain name of the broker if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. -**[6]:** This can refer to both the compressed or uncompressed body size. If both sizes are known, the uncompressed -body size should be used. - -**[7]:** If an operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. - -**[8]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. +**[6]:** If an operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. +**[7]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. +**[8]:** This can refer to both the compressed or uncompressed body size. If both sizes are known, the uncompressed +body size should be used. The following attributes can be important for making sampling decisions and SHOULD be provided **at span creation time** (if provided at all): @@ -91,19 +89,16 @@ and SHOULD be provided **at span creation time** (if provided at all): |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `messaging.operation.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| -| `create` | A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch publishing scenarios. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `create` | A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch sending scenarios. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process` | One or more messages are processed by a consumer. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `publish` | One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `receive` | One or more messages are requested by a consumer. This operation refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive messages. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `send` | One or more messages are provided for sending to an intermediary. If a single message is sent, the context of the "Send" span can be used as the creation context and no "Create" span needs to be created. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `settle` | One or more messages are settled. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - diff --git a/docs/messaging/rocketmq.md b/docs/messaging/rocketmq.md index 48741ebd08..7d2fb86b2f 100644 --- a/docs/messaging/rocketmq.md +++ b/docs/messaging/rocketmq.md @@ -29,19 +29,19 @@ Specific attributes for Apache RocketMQ are defined below. | [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [1] | `amqp:decode-error`; `KAFKA_STORAGE_ERROR`; `channel-error` | `Conditionally Required` If and only if the messaging operation has failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`messaging.batch.message_count`](/docs/attributes-registry/messaging.md) | int | The number of messages sent, received, or processed in the scope of the batching operation. [2] | `0`; `1`; `2` | `Conditionally Required` [3] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.destination.name`](/docs/attributes-registry/messaging.md) | string | The message destination name [4] | `MyQueue`; `MyTopic` | `Conditionally Required` [5] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`messaging.operation.type`](/docs/attributes-registry/messaging.md) | string | A string identifying the type of the messaging operation. [6] | `publish`; `create`; `receive` | `Conditionally Required` If applicable. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`messaging.operation.type`](/docs/attributes-registry/messaging.md) | string | A string identifying the type of the messaging operation. [6] | `create`; `send`; `receive` | `Conditionally Required` If applicable. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.rocketmq.message.delay_time_level`](/docs/attributes-registry/messaging.md) | int | The delay time level for delay message, which determines the message delay time. | `3` | `Conditionally Required` [7] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.rocketmq.message.delivery_timestamp`](/docs/attributes-registry/messaging.md) | int | The timestamp in milliseconds that the delay message is expected to be delivered to consumer. | `1665987217045` | `Conditionally Required` [8] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.rocketmq.message.group`](/docs/attributes-registry/messaging.md) | string | It is essential for FIFO message. Messages that belong to the same message group are always processed one by one within the same consumer group. | `myMessageGroup` | `Conditionally Required` If the message type is FIFO. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`server.address`](/docs/attributes-registry/server.md) | string | Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [9] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Conditionally Required` If available. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`messaging.client.id`](/docs/attributes-registry/messaging.md) | string | A unique identifier for the client that consumes or produces a message. | `client-5`; `myhost@8742@s8083jm` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`messaging.message.body.size`](/docs/attributes-registry/messaging.md) | int | The size of the message body in bytes. [10] | `1439` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.message.id`](/docs/attributes-registry/messaging.md) | string | A value used by the messaging system as an identifier for the message, represented as a string. | `452a7c7c7c7048c2f887f61572b18fc2` | `Recommended` If span describes operation on a single message. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.rocketmq.consumption_model`](/docs/attributes-registry/messaging.md) | string | Model of message consumption. This only applies to consumer spans. | `clustering`; `broadcasting` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.rocketmq.message.keys`](/docs/attributes-registry/messaging.md) | string[] | Key(s) of message, another way to mark message besides message id. | `["keyA", "keyB"]` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.rocketmq.message.tag`](/docs/attributes-registry/messaging.md) | string | The secondary classifier of message besides topic. | `tagA` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`messaging.rocketmq.message.type`](/docs/attributes-registry/messaging.md) | string | Type of message. | `normal`; `fifo`; `delay` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [11] | `80`; `8080`; `443` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [10] | `80`; `8080`; `443` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`messaging.message.body.size`](/docs/attributes-registry/messaging.md) | int | The size of the message body in bytes. [11] | `1439` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** The `error.type` SHOULD be predictable, and SHOULD have low cardinality. @@ -80,12 +80,10 @@ the broker doesn't have such notion, the destination name SHOULD uniquely identi **[9]:** Server domain name of the broker if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. -**[10]:** This can refer to both the compressed or uncompressed body size. If both sizes are known, the uncompressed -body size should be used. - -**[11]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - +**[10]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. +**[11]:** This can refer to both the compressed or uncompressed body size. If both sizes are known, the uncompressed +body size should be used. The following attributes can be important for making sampling decisions and SHOULD be provided **at span creation time** (if provided at all): @@ -103,18 +101,16 @@ and SHOULD be provided **at span creation time** (if provided at all): |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `messaging.operation.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| -| `create` | A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch publishing scenarios. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `create` | A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch sending scenarios. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process` | One or more messages are processed by a consumer. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `publish` | One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `receive` | One or more messages are requested by a consumer. This operation refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive messages. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `send` | One or more messages are provided for sending to an intermediary. If a single message is sent, the context of the "Send" span can be used as the creation context and no "Create" span needs to be created. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `settle` | One or more messages are settled. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - `messaging.rocketmq.consumption_model` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -122,7 +118,6 @@ and SHOULD be provided **at span creation time** (if provided at all): | `broadcasting` | Broadcasting consumption model | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `clustering` | Clustering consumption model | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - `messaging.rocketmq.message.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -132,8 +127,6 @@ and SHOULD be provided **at span creation time** (if provided at all): | `normal` | Normal message | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `transaction` | Transaction message | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - diff --git a/docs/mobile/events.md b/docs/mobile/events.md index 55fa24d735..c7d0ce4580 100644 --- a/docs/mobile/events.md +++ b/docs/mobile/events.md @@ -38,7 +38,6 @@ NOT be used together, each field MUST be used with its corresponding The event name MUST be `device.app.lifecycle`. - diff --git a/docs/non-normative/db-migration.md b/docs/non-normative/db-migration.md new file mode 100644 index 0000000000..eee1011900 --- /dev/null +++ b/docs/non-normative/db-migration.md @@ -0,0 +1,251 @@ +# Database semantic convention stability migration guide + +Due to the significant number of modifications and the extensive user base +affected by them, existing database instrumentations published by +OpenTelemetry are required to implement a migration plan that will assist users in +transitioning to the stable database semantic conventions. + +Specifically, when existing database instrumentations published by OpenTelemetry are +updated to the stable database semantic conventions, they: + +- SHOULD introduce an environment variable `OTEL_SEMCONV_STABILITY_OPT_IN` in + their existing major version, which accepts: + - `database` - emit the stable database conventions, and stop emitting + the old database conventions that the instrumentation emitted previously. + - `database/dup` - emit both the old and the stable database conventions, + allowing for a phased rollout of the stable semantic conventions. + - The default behavior (in the absence of one of these values) is to continue + emitting whatever version of the old database conventions the + instrumentation was emitting previously. +- Need to maintain (security patching at a minimum) their existing major version + for at least six months after it starts emitting both sets of conventions. +- May drop the environment variable in their next major version and emit only + the stable database conventions. + +## Summary of changes + +This section summarizes the changes made to the HTTP semantic conventions +from +[v1.24.0](https://github.com/open-telemetry/semantic-conventions/blob/v1.24.0/docs/database/README.md). +to +[v1.28.0 (RC)](https://github.com/open-telemetry/semantic-conventions/blob/v1.28.0/docs/database/README.md). + +### Database client span attributes + + +| Change | Comments | +|-----------------------------------------------------|-------------------------------------------------------------------------------------------------------------| +| `db.connection_string` | Removed | +| `db.user` | Removed | +| `network.transport` | Removed | +| `network.type` | Removed | +| `db.name` | Removed, integrated into the new `db.namespace` | +| `db.redis.database_index` | Removed, integrated into the new `db.namespace` | +| `db.mssql.instance_name` | Removed, integrated into the new `db.namespace` | +| `db.instance.id` | Removed, replaced by `server.address` or integrated into `db.namespace` as appropriate | +| `db.statement` → `db.query.text` | Clarified, SHOULD be collected by default only if there is sanitization that excludes sensitive information | +| `db.operation` → `db.operation.name` | | +| `db.sql.table` → `db.collection.name` | | +| `db.cassandra.table` → `db.collection.name` | | +| `db.mongodb.collection` → `db.collection.name` | | +| `db.cosmosdb.container` → `db.collection.name` | | +| New: `db.operation.batch.size` | | +| New: `db.response.status_code` | | +| New: `db.query.parameter.` | Opt-In | +| New: `error.type` | | + + +References: + +- [Database client span attributes v1.24.0](https://github.com/open-telemetry/semantic-conventions/blob/v1.24.0/docs/database/database-spans.md) +- [Database client span attributes v1.28.0 (RC)](https://github.com/open-telemetry/semantic-conventions/blob/v1.28.0/docs/database/database-spans.md) + +### Database client span names + +The recommended span name has changed to `{db.operation.name} {target}`, where the `{target}` SHOULD describe the entity +that the operation is performed against and SHOULD adhere to one of the following values, provided they are accessible: + +- `db.collection.name` SHOULD be used for data manipulation operations or operations on database collections +- `db.namespace` SHOULD be used for operations on a specific database namespace +- `server.address:server.port` SHOULD be used for other operations not targeting any specific database(s) or collection(s) + +References: + +- [Database client span names v1.24.0](https://github.com/open-telemetry/semantic-conventions/blob/v1.24.0/docs/database/database-spans.md) +- [Database client span names v1.28.0 (RC)](https://github.com/open-telemetry/semantic-conventions/blob/v1.28.0/docs/database/database-spans.md#name) + +### Database client operation duration metric + +This is a required metric. There was no similar metric previously. + +See [Metric `db.client.operation.duration` v1.28.0 (RC)](https://github.com/open-telemetry/semantic-conventions/blob/v1.28.0/docs/database/database-metrics.md#metric-dbclientoperationduration). + +### Experimental connection metrics + +Database connection metrics are still experimental, but there have been several changes in the latest release. + +#### Database client connection count + +Metric changes: + +- **Name**: `db.client.connections.usage` → `db.client.connection.count` +- **Attributes**: see table below + + +| Attribute change | Comments | +|-----------------------------------------------------|----------| +| `pool.name` → `db.client.connection.pool.name` | | +| `state` → `db.client.connection.state` | | + + +References: + +- [Metric `db.client.connections.usage` v1.24.0](https://github.com/open-telemetry/semantic-conventions/blob/v1.24.0/docs/database/database-metrics.md#metric-dbclientconnectionsusage) +- [Metric `db.client.connection.count` v1.28.0 (RC)](https://github.com/open-telemetry/semantic-conventions/blob/v1.28.0/docs/database/database-metrics.md#metric-dbclientconnectioncount) + +#### Database client connection idle max + +Metric changes: + +- **Name**: `db.client.connections.idle.max` → `db.client.connection.idle.max` +- **Attributes**: see table below + + +| Attribute change | Comments | +|-----------------------------------------------------|----------| +| `pool.name` → `db.client.connection.pool.name` | | + + +References: + +- [Metric `db.client.connections.idle.max` v1.24.0](https://github.com/open-telemetry/semantic-conventions/blob/v1.24.0/docs/database/database-metrics.md#metric-dbclientconnectionsidlemax) +- [Metric `db.client.connection.idle.max` v1.28.0 (RC)](https://github.com/open-telemetry/semantic-conventions/blob/v1.28.0/docs/database/database-metrics.md#metric-dbclientconnectionidlemax) + +#### Database client connection idle min + +Metric changes: + +- **Name**: `db.client.connections.idle.min` → `db.client.connection.idle.min` +- **Attributes**: see table below + + +| Attribute change | Comments | +|-----------------------------------------------------|----------| +| `pool.name` → `db.client.connection.pool.name` | | + + +References: + +- [Metric `db.client.connections.idle.min` v1.24.0](https://github.com/open-telemetry/semantic-conventions/blob/v1.24.0/docs/database/database-metrics.md#metric-dbclientconnectionsidlemin) +- [Metric `db.client.connection.idle.min` v1.28.0 (RC)](https://github.com/open-telemetry/semantic-conventions/blob/v1.28.0/docs/database/database-metrics.md#metric-dbclientconnectionidlemin) + +#### Database client connection max + +Metric changes: + +- **Name**: `db.client.connections.max` → `db.client.connection.max` +- **Attributes**: see table below + + +| Attribute change | Comments | +|-----------------------------------------------------|----------| +| `pool.name` → `db.client.connection.pool.name` | | + + +References: + +- [Metric `db.client.connections.max` v1.24.0](https://github.com/open-telemetry/semantic-conventions/blob/v1.24.0/docs/database/database-metrics.md#metric-dbclientconnectionsmax) +- [Metric `db.client.connection.max` v1.28.0 (RC)](https://github.com/open-telemetry/semantic-conventions/blob/v1.28.0/docs/database/database-metrics.md#metric-dbclientconnectionmax) + +#### Database client connection pending requests + +Metric changes: + +- **Name**: `db.client.connections.pending_requests` → `db.client.connection.pending_requests` +- **Attributes**: see table below + + +| Attribute change | Comments | +|-----------------------------------------------------|----------| +| `pool.name` → `db.client.connection.pool.name` | | + + +References: + +- [Metric `db.client.connections.pending_requests` v1.24.0](https://github.com/open-telemetry/semantic-conventions/blob/v1.24.0/docs/database/database-metrics.md#metric-dbclientconnectionspending_requests) +- [Metric `db.client.connection.pending_requests` v1.28.0 (RC)](https://github.com/open-telemetry/semantic-conventions/blob/v1.28.0/docs/database/database-metrics.md#metric-dbclientconnectionpending_requests) + +#### Database client connection timeouts + +Metric changes: + +- **Name**: `db.client.connections.timeouts` → `db.client.connection.timeouts` +- **Attributes**: see table below + + +| Attribute change | Comments | +|-----------------------------------------------------|----------| +| `pool.name` → `db.client.connection.pool.name` | | + + +References: + +- [Metric `db.client.connections.timeouts` v1.24.0](https://github.com/open-telemetry/semantic-conventions/blob/v1.24.0/docs/database/database-metrics.md#metric-dbclientconnectionstimeouts) +- [Metric `db.client.connection.timeouts` v1.28.0 (RC)](https://github.com/open-telemetry/semantic-conventions/blob/v1.28.0/docs/database/database-metrics.md#metric-dbclientconnectiontimeouts) + +#### Database client connection create time + +Metric changes: + +- **Name**: `db.client.connections.create_time` → `db.client.connection.create_time` +- **Unit**: `ms` → `s` +- **Attributes**: see table below + + +| Attribute change | Comments | +|-----------------------------------------------------|----------| +| `pool.name` → `db.client.connection.pool.name` | | + + +References: + +- [Metric `db.client.connections.create_time` v1.24.0](https://github.com/open-telemetry/semantic-conventions/blob/v1.24.0/docs/database/database-metrics.md#metric-dbclientconnectionscreate_time) +- [Metric `db.client.connection.create_time` v1.28.0 (RC)](https://github.com/open-telemetry/semantic-conventions/blob/v1.28.0/docs/database/database-metrics.md#metric-dbclientconnectioncreate_time) + +#### Database client connection wait time + +Metric changes: + +- **Name**: `db.client.connections.wait_time` → `db.client.connection.wait_time` +- **Unit**: `ms` → `s` +- **Attributes**: see table below + + +| Attribute change | Comments | +|-----------------------------------------------------|----------| +| `pool.name` → `db.client.connection.pool.name` | | + + +References: + +- [Metric `db.client.connections.wait_time` v1.24.0](https://github.com/open-telemetry/semantic-conventions/blob/v1.24.0/docs/database/database-metrics.md#metric-dbclientconnectionswait_time) +- [Metric `db.client.connection.wait_time` v1.28.0 (RC)](https://github.com/open-telemetry/semantic-conventions/blob/v1.28.0/docs/database/database-metrics.md#metric-dbclientconnectionwait_time) + +#### Database client connection use time + +Metric changes: + +- **Name**: `db.client.connections.use_time` → `db.client.connection.use_time` +- **Unit**: `ms` → `s` +- **Attributes**: see table below + + +| Attribute change | Comments | +|-----------------------------------------------------|----------| +| `pool.name` → `db.client.connection.pool.name` | | + + +References: + +- [Metric `db.client.connections.use_time` v1.24.0](https://github.com/open-telemetry/semantic-conventions/blob/v1.24.0/docs/database/database-metrics.md#metric-dbclientconnectionsuse_time) +- [Metric `db.client.connection.use_time` v1.28.0 (RC)](https://github.com/open-telemetry/semantic-conventions/blob/v1.28.0/docs/database/database-metrics.md#metric-dbclientconnectionuse_time) diff --git a/docs/object-stores/s3.md b/docs/object-stores/s3.md index c00b72ea89..f5a6bc714f 100644 --- a/docs/object-stores/s3.md +++ b/docs/object-stores/s3.md @@ -81,8 +81,6 @@ This applies in particular to the following operations: **[8]:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). - - `rpc.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -93,8 +91,6 @@ This applies in particular to the following operations: | `grpc` | gRPC | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `java_rmi` | Java RMI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - diff --git a/docs/resource/README.md b/docs/resource/README.md index ca2387cb52..3ea6a9c66d 100644 --- a/docs/resource/README.md +++ b/docs/resource/README.md @@ -9,7 +9,7 @@ path_base_for_github_subdir: **Status**: [Mixed][DocumentStatus] -This document defines standard attributes for resources. These attributes are typically used in the [Resource](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/resource/sdk.md) and are also recommended to be used anywhere else where there is a need to describe a resource in a consistent manner. The majority of these attributes are inherited from +This document defines standard attributes for resources. These attributes are typically used in the [Resource](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/resource/sdk.md) and are also recommended to be used anywhere else where there is a need to describe a resource in a consistent manner. The majority of these attributes are inherited from [OpenCensus Resource standard](https://github.com/census-instrumentation/opencensus-specs/blob/master/resource/StandardResources.md). @@ -59,14 +59,14 @@ Given their significance some resource attributes are treated specifically as de ### Semantic Attributes with Dedicated Environment Variable These are the attributes which MAY be configurable via a dedicated environment variable -as specified in [OpenTelemetry Environment Variable Specification](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/configuration/sdk-environment-variables.md): +as specified in [OpenTelemetry Environment Variable Specification](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/configuration/sdk-environment-variables.md): - [`service.name`](#service) ### Semantic Attributes with SDK-provided Default Value These are the attributes which MUST be provided by the SDK -as specified in the [Resource SDK specification](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/resource/sdk.md#sdk-provided-resource-attributes): +as specified in the [Resource SDK specification](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/resource/sdk.md#sdk-provided-resource-attributes): - [`service.name`](#service) - [`telemetry.sdk` group](#telemetry-sdk) @@ -94,9 +94,6 @@ as specified in the [Resource SDK specification](https://github.com/open-telemet **[1]:** MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`. - - - @@ -152,9 +149,6 @@ port. **[2]:** A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace. - - - @@ -203,8 +197,6 @@ or another suitable identifier depending on the language. The identifier `opentelemetry` is reserved and MUST NOT be used in this case. All custom identifiers SHOULD be stable across different versions of an implementation. - - `telemetry.sdk.language` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -222,8 +214,6 @@ All custom identifiers SHOULD be stable across different versions of an implemen | `swift` | swift | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `webjs` | webjs | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - @@ -253,9 +243,6 @@ All custom identifiers SHOULD be stable across different versions of an implemen **[1]:** Official auto instrumentation agents and distributions SHOULD set the `telemetry.distro.name` attribute to a string starting with `opentelemetry-`, e.g. `opentelemetry-java-instrumentation`. - - - @@ -292,6 +279,7 @@ Attributes defining a running environment (e.g. Operating System, Cloud, Data Ce - Deployment: - [Deployment Environment](./deployment-environment.md) - [Kubernetes](./k8s.md) + - [CloudFoundry](./cloudfoundry.md) - [Browser](./browser.md) ## Version attributes diff --git a/docs/resource/android.md b/docs/resource/android.md index 674aea1b89..9cd4eb0be7 100644 --- a/docs/resource/android.md +++ b/docs/resource/android.md @@ -18,7 +18,6 @@ |---|---|---|---|---|---| | [`android.os.api_level`](/docs/attributes-registry/android.md) | string | Uniquely identifies the framework API revision offered by a version (`os.version`) of the android operating system. More information can be found [here](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels). | `33`; `32` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - diff --git a/docs/resource/browser.md b/docs/resource/browser.md index 333583a3d1..718e49b7b3 100644 --- a/docs/resource/browser.md +++ b/docs/resource/browser.md @@ -33,9 +33,6 @@ The list of possible values is defined in the [W3C User-Agent Client Hints speci **[5]:** The user-agent value SHOULD be provided only from browsers that do not have a mechanism to retrieve brands and platform individually from the User-Agent Client Hints API. To retrieve the value, the legacy `navigator.userAgent` API can be used. - - - diff --git a/docs/resource/cloud-provider/aws/ecs.md b/docs/resource/cloud-provider/aws/ecs.md index 596d44ad5a..a926f64352 100644 --- a/docs/resource/cloud-provider/aws/ecs.md +++ b/docs/resource/cloud-provider/aws/ecs.md @@ -31,8 +31,6 @@ | `ec2` | ec2 | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `fargate` | fargate | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - diff --git a/docs/resource/cloud-provider/aws/eks.md b/docs/resource/cloud-provider/aws/eks.md index e0dae028ba..6813471103 100644 --- a/docs/resource/cloud-provider/aws/eks.md +++ b/docs/resource/cloud-provider/aws/eks.md @@ -18,7 +18,6 @@ |---|---|---|---|---|---| | [`aws.eks.cluster.arn`](/docs/attributes-registry/aws.md) | string | The ARN of an EKS cluster. | `arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - diff --git a/docs/resource/cloud-provider/aws/logs.md b/docs/resource/cloud-provider/aws/logs.md index e0713e55d1..a3322e49b4 100644 --- a/docs/resource/cloud-provider/aws/logs.md +++ b/docs/resource/cloud-provider/aws/logs.md @@ -27,9 +27,6 @@ **[3]:** See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream. - - - diff --git a/docs/resource/cloud-provider/gcp/cloud-run.md b/docs/resource/cloud-provider/gcp/cloud-run.md index 01a29f3573..fd3529490e 100644 --- a/docs/resource/cloud-provider/gcp/cloud-run.md +++ b/docs/resource/cloud-provider/gcp/cloud-run.md @@ -23,7 +23,6 @@ These conventions are recommended for resources running on Cloud Run. | [`gcp.cloud_run.job.execution`](/docs/attributes-registry/gcp.md) | string | The name of the Cloud Run [execution](https://cloud.google.com/run/docs/managing/job-executions) being run for the Job, as set by the [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. | `job-name-xxxx`; `sample-job-mdw84` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`gcp.cloud_run.job.task_index`](/docs/attributes-registry/gcp.md) | int | The index for a task within an execution as provided by the [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. | `0`; `1` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - diff --git a/docs/resource/cloud-provider/gcp/gce.md b/docs/resource/cloud-provider/gcp/gce.md index ccebba761d..e54735f40a 100644 --- a/docs/resource/cloud-provider/gcp/gce.md +++ b/docs/resource/cloud-provider/gcp/gce.md @@ -19,7 +19,6 @@ | [`gcp.gce.instance.hostname`](/docs/attributes-registry/gcp.md) | string | The hostname of a GCE instance. This is the full value of the default or [custom hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). | `my-host1234.example.com`; `sample-vm.us-west1-b.c.my-project.internal` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`gcp.gce.instance.name`](/docs/attributes-registry/gcp.md) | string | The instance name of a GCE instance. This is the value provided by `host.name`, the visible name of the instance in the Cloud Console UI, and the prefix for the default hostname of the instance as defined by the [default internal DNS name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). | `instance-1`; `my-vm-name` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - diff --git a/docs/resource/cloud-provider/heroku.md b/docs/resource/cloud-provider/heroku.md index 55a7923051..f72c344133 100644 --- a/docs/resource/cloud-provider/heroku.md +++ b/docs/resource/cloud-provider/heroku.md @@ -26,7 +26,6 @@ | [`heroku.release.commit`](/docs/attributes-registry/heroku.md) | string | Commit hash for the current release | `e6134959463efd8966b20e75b913cafe3f5ec` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`heroku.release.creation_timestamp`](/docs/attributes-registry/heroku.md) | string | Time and date the release was created | `2022-10-23T18:00:42Z` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - diff --git a/docs/resource/cloud.md b/docs/resource/cloud.md index 8664fe52f5..78e7556471 100644 --- a/docs/resource/cloud.md +++ b/docs/resource/cloud.md @@ -47,8 +47,6 @@ The following well-known definitions MUST be used if you set this attribute and This means that a span attribute MUST be used, as an Azure function app can host multiple functions that would usually share a TracerProvider. - - `cloud.platform` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -82,7 +80,6 @@ The following well-known definitions MUST be used if you set this attribute and | `tencent_cloud_eks` | Tencent Cloud Elastic Kubernetes Service (EKS) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `tencent_cloud_scf` | Tencent Cloud Serverless Cloud Function (SCF) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - `cloud.provider` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -95,8 +92,6 @@ The following well-known definitions MUST be used if you set this attribute and | `ibm_cloud` | IBM Cloud | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `tencent_cloud` | Tencent Cloud | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - diff --git a/docs/resource/cloudfoundry.md b/docs/resource/cloudfoundry.md new file mode 100644 index 0000000000..c13ec457aa --- /dev/null +++ b/docs/resource/cloudfoundry.md @@ -0,0 +1,204 @@ +# CloudFoundry + +**Status**: [Experimental][DocumentStatus] + +Useful resources to understand CloudFoundry metadata: + +* +* +* +* + +CloudFoundry organizes application deployments (apps) by spaces contained in +organizations (orgs). Names are unique only in their respective enclosing +entity. Ids are unique in the entire CloudFoundry installation. Different +instances of the same application are separated by an integer index. Apps can +consist of a main job and multiple tasks and side-cars, which can be +distinguished by different process attributes. + +CloudFoundry can also emit signals from system components. They use a different +approach as applications, since they are not organized into orgs and spaces. +They align with the Bosh deployment tool of CloudFoundry. + +## Organization + + + + + + + + + +**Status:** ![Experimental](https://img.shields.io/badge/-experimental-blue) + +**type:** `cloudfoundry.org` + +**Description:** The organization of the application which is monitored. + +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | +|---|---|---|---|---|---| +| [`cloudfoundry.org.id`](/docs/attributes-registry/cloudfoundry.md) | string | The guid of the CloudFoundry org the application is running in. [1] | `218fc5a9-a5f1-4b54-aa05-46717d0ab26d` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`cloudfoundry.org.name`](/docs/attributes-registry/cloudfoundry.md) | string | The name of the CloudFoundry organization the app is running in. [2] | `my-org-name` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[1]:** Application instrumentation should use the value from environment +variable `VCAP_APPLICATION.org_id`. This is the same value as +reported by `cf org --guid`. + +**[2]:** Application instrumentation should use the value from environment +variable `VCAP_APPLICATION.org_name`. This is the same value as +reported by `cf orgs`. + + + + + + +## Space + + + + + + + + + +**Status:** ![Experimental](https://img.shields.io/badge/-experimental-blue) + +**type:** `cloudfoundry.space` + +**Description:** The space of the application which is monitored. + +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | +|---|---|---|---|---|---| +| [`cloudfoundry.space.id`](/docs/attributes-registry/cloudfoundry.md) | string | The guid of the CloudFoundry space the application is running in. [1] | `218fc5a9-a5f1-4b54-aa05-46717d0ab26d` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`cloudfoundry.space.name`](/docs/attributes-registry/cloudfoundry.md) | string | The name of the CloudFoundry space the application is running in. [2] | `my-space-name` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[1]:** Application instrumentation should use the value from environment +variable `VCAP_APPLICATION.space_id`. This is the same value as +reported by `cf space --guid`. + +**[2]:** Application instrumentation should use the value from environment +variable `VCAP_APPLICATION.space_name`. This is the same value as +reported by `cf spaces`. + + + + + + +## Application + + + + + + + + + +**Status:** ![Experimental](https://img.shields.io/badge/-experimental-blue) + +**type:** `cloudfoundry.app` + +**Description:** The application which is monitored. + +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | +|---|---|---|---|---|---| +| [`cloudfoundry.app.id`](/docs/attributes-registry/cloudfoundry.md) | string | The guid of the application. [1] | `218fc5a9-a5f1-4b54-aa05-46717d0ab26d` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`cloudfoundry.app.name`](/docs/attributes-registry/cloudfoundry.md) | string | The name of the application. [2] | `my-app-name` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[1]:** Application instrumentation should use the value from environment +variable `VCAP_APPLICATION.application_id`. This is the same value as +reported by `cf app --guid`. + +**[2]:** Application instrumentation should use the value from environment +variable `VCAP_APPLICATION.application_name`. This is the same value +as reported by `cf apps`. + + + + + + +## Process + + + + + + + + + +**Status:** ![Experimental](https://img.shields.io/badge/-experimental-blue) + +**type:** `cloudfoundry.process` + +**Description:** The process of the application which is monitored. + +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | +|---|---|---|---|---|---| +| [`cloudfoundry.process.id`](/docs/attributes-registry/cloudfoundry.md) | string | The UID identifying the process. [1] | `218fc5a9-a5f1-4b54-aa05-46717d0ab26d` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`cloudfoundry.process.type`](/docs/attributes-registry/cloudfoundry.md) | string | The type of process. [2] | `web` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[1]:** Application instrumentation should use the value from environment +variable `VCAP_APPLICATION.process_id`. It is supposed to be equal to +`VCAP_APPLICATION.app_id` for applications deployed to the runtime. +For system components, this could be the actual PID. + +**[2]:** CloudFoundry applications can consist of multiple jobs. Usually the +main process will be of type `web`. There can be additional background +tasks or side-cars with different process types. + + + + + + +## Cloud Foundry System Component + + + + + + + + + +**Status:** ![Experimental](https://img.shields.io/badge/-experimental-blue) + +**type:** `cloudfoundry.system` + +**Description:** The system component which is monitored. + +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | +|---|---|---|---|---|---| +| [`cloudfoundry.system.id`](/docs/attributes-registry/cloudfoundry.md) | string | A guid or another name describing the event source. [1] | `cf/gorouter` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`cloudfoundry.system.instance.id`](/docs/attributes-registry/cloudfoundry.md) | string | A guid describing the concrete instance of the event source. [2] | `218fc5a9-a5f1-4b54-aa05-46717d0ab26d` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[1]:** CloudFoundry defines the `source_id` in the [Loggregator v2 envelope](https://github.com/cloudfoundry/loggregator-api#v2-envelope). +It is used for logs and metrics emitted by CloudFoundry. It is +supposed to contain the component name, e.g. "gorouter", for +CloudFoundry components. + +When system components are instrumented, values from the +[Bosh spec](https://bosh.io/docs/jobs/#properties-spec) +should be used. The `system.id` should be set to +`spec.deployment/spec.name`. + +**[2]:** CloudFoundry defines the `instance_id` in the [Loggregator v2 envelope](https://github.com/cloudfoundry/loggregator-api#v2-envelope). +It is used for logs and metrics emitted by CloudFoundry. It is +supposed to contain the vm id for CloudFoundry components. + +When system components are instrumented, values from the +[Bosh spec](https://bosh.io/docs/jobs/#properties-spec) +should be used. The `system.instance.id` should be set to `spec.id`. + + + + + + +[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/document-status.md diff --git a/docs/resource/container.md b/docs/resource/container.md index b57f2b0f36..db7158f608 100644 --- a/docs/resource/container.md +++ b/docs/resource/container.md @@ -40,9 +40,6 @@ An example can be found in [Example Image Manifest](https://docs.docker.com/regi **[4]:** If using embedded credentials or sensitive data, it is recommended to remove them to prevent potential leakage. - - - diff --git a/docs/resource/deployment-environment.md b/docs/resource/deployment-environment.md index 44ef6af793..2ec939a2bd 100644 --- a/docs/resource/deployment-environment.md +++ b/docs/resource/deployment-environment.md @@ -26,9 +26,6 @@ considered to be identifying the same service: * `service.name=frontend`, `deployment.environment.name=production` * `service.name=frontend`, `deployment.environment.name=staging`. - - - diff --git a/docs/resource/device.md b/docs/resource/device.md index d4d1dfca69..b8e4f6cb6c 100644 --- a/docs/resource/device.md +++ b/docs/resource/device.md @@ -29,9 +29,6 @@ **[4]:** It's recommended this value represents a human-readable version of the device model rather than a machine-readable alternative. - - - diff --git a/docs/resource/faas.md b/docs/resource/faas.md index 2593d9a19f..06a9cc2310 100644 --- a/docs/resource/faas.md +++ b/docs/resource/faas.md @@ -78,9 +78,6 @@ The following well-known definitions MUST be used if you set this attribute and [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically). * **Azure Functions:** Not applicable. Do not set this attribute. - - - diff --git a/docs/resource/host.md b/docs/resource/host.md index 6a9d0004e4..073a167198 100644 --- a/docs/resource/host.md +++ b/docs/resource/host.md @@ -59,8 +59,6 @@ privileged lookup of `host.id` is required, the value should be injected via the **[3]:** MAC Addresses MUST be represented in [IEEE RA hexadecimal form](https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf): as hyphen-separated octets in uppercase hexadecimal form from most to least significant. - - `host.arch` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -74,8 +72,6 @@ privileged lookup of `host.id` is required, the value should be injected via the | `s390x` | IBM z/Architecture | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `x86` | 32-bit x86 | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -108,9 +104,6 @@ privileged lookup of `host.id` is required, the value should be injected via the **[1]:** [CPUID](https://wiki.osdev.org/CPUID) command returns the vendor ID string in EBX, EDX and ECX registers. Writing these to memory in this order results in a 12-character string. - - - diff --git a/docs/resource/k8s.md b/docs/resource/k8s.md index 39ab4709a3..df261fb05c 100644 --- a/docs/resource/k8s.md +++ b/docs/resource/k8s.md @@ -59,9 +59,6 @@ Which states: Therefore, UIDs between clusters should be extremely unlikely to conflict. - - - @@ -88,7 +85,6 @@ conflict. | [`k8s.node.name`](/docs/attributes-registry/k8s.md) | string | The name of the Node. | `node-1` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`k8s.node.uid`](/docs/attributes-registry/k8s.md) | string | The UID of the Node. | `1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - @@ -117,7 +113,6 @@ a namespace, but not across namespaces. |---|---|---|---|---|---| | [`k8s.namespace.name`](/docs/attributes-registry/k8s.md) | string | The name of the namespace that the pod is running in. | `default` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - @@ -149,7 +144,6 @@ containers on your cluster. | [`k8s.pod.uid`](/docs/attributes-registry/k8s.md) | string | The UID of the Pod. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`k8s.pod.annotation.`](/docs/attributes-registry/k8s.md) | string | The annotation key-value pairs placed on the Pod, the `` being the annotation name, the value being the annotation value. | `k8s.pod.annotation.kubernetes.io/enforce-mountable-secrets=true`; `k8s.pod.annotation.mycompany.io/arch=x64`; `k8s.pod.annotation.data=` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - @@ -184,7 +178,6 @@ to a running container. | [`k8s.container.restart_count`](/docs/attributes-registry/k8s.md) | int | Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. | | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`k8s.container.status.last_terminated_reason`](/docs/attributes-registry/k8s.md) | string | Last terminated reason of the Container. | `Evicted`; `Error` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - @@ -211,7 +204,6 @@ to a running container. | [`k8s.replicaset.name`](/docs/attributes-registry/k8s.md) | string | The name of the ReplicaSet. | `opentelemetry` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`k8s.replicaset.uid`](/docs/attributes-registry/k8s.md) | string | The UID of the ReplicaSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - @@ -242,7 +234,6 @@ distributed among the nodes of a cluster. | [`k8s.deployment.name`](/docs/attributes-registry/k8s.md) | string | The name of the Deployment. | `opentelemetry` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`k8s.deployment.uid`](/docs/attributes-registry/k8s.md) | string | The UID of the Deployment. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - @@ -272,7 +263,6 @@ about the ordering and uniqueness of these Pods. | [`k8s.statefulset.name`](/docs/attributes-registry/k8s.md) | string | The name of the StatefulSet. | `opentelemetry` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`k8s.statefulset.uid`](/docs/attributes-registry/k8s.md) | string | The UID of the StatefulSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - @@ -301,7 +291,6 @@ A DaemonSet ensures that all (or some) Nodes run a copy of a Pod. | [`k8s.daemonset.name`](/docs/attributes-registry/k8s.md) | string | The name of the DaemonSet. | `opentelemetry` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`k8s.daemonset.uid`](/docs/attributes-registry/k8s.md) | string | The UID of the DaemonSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - @@ -331,7 +320,6 @@ successfully terminate. | [`k8s.job.name`](/docs/attributes-registry/k8s.md) | string | The name of the Job. | `opentelemetry` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`k8s.job.uid`](/docs/attributes-registry/k8s.md) | string | The UID of the Job. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - @@ -360,7 +348,6 @@ A CronJob creates Jobs on a repeating schedule. | [`k8s.cronjob.name`](/docs/attributes-registry/k8s.md) | string | The name of the CronJob. | `opentelemetry` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`k8s.cronjob.uid`](/docs/attributes-registry/k8s.md) | string | The UID of the CronJob. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - diff --git a/docs/resource/os.md b/docs/resource/os.md index fb83034abf..4ea20d3051 100644 --- a/docs/resource/os.md +++ b/docs/resource/os.md @@ -32,8 +32,6 @@ In case of virtualized environments, this is the operating system as it is obser | MacOS | `ProductBuildVersion` from `/System/Library/CoreServices/SystemVersion.plist` | `ProductBuildVersion` from `/System/Library/CoreServices/ServerVersion.plist` | | Linux | `BUILD_ID` from `/etc/os-release` | `BUILD_ID` from `/usr/lib/os-release`;
contents of `/proc/sys/kernel/osrelease`| - - `os.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -50,8 +48,6 @@ In case of virtualized environments, this is the operating system as it is obser | `windows` | Microsoft Windows | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `z_os` | IBM z/OS | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - diff --git a/docs/resource/process.md b/docs/resource/process.md index 8345d957b7..8e48ae165c 100644 --- a/docs/resource/process.md +++ b/docs/resource/process.md @@ -56,9 +56,6 @@ **[5]:** See [Selecting process attributes](#selecting-process-attributes) for details. - - - @@ -100,7 +97,6 @@ On Windows and other systems where the native format of process commands is a si | [`process.runtime.name`](/docs/attributes-registry/process.md) | string | The name of the runtime of this process. | `OpenJDK Runtime Environment` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`process.runtime.version`](/docs/attributes-registry/process.md) | string | The version of the runtime of this process, as returned by the runtime without modification. | `14.0.2` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - diff --git a/docs/resource/webengine.md b/docs/resource/webengine.md index 4a4dbdfcae..7c8e7d4ed3 100644 --- a/docs/resource/webengine.md +++ b/docs/resource/webengine.md @@ -20,7 +20,6 @@ | [`webengine.description`](/docs/attributes-registry/webengine.md) | string | Additional description of the web engine (e.g. detailed version and edition information). | `WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - 2.2.2.Final` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`webengine.version`](/docs/attributes-registry/webengine.md) | string | The version of the web engine. | `21.0.0` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - diff --git a/docs/rpc/connect-rpc.md b/docs/rpc/connect-rpc.md index 9cef88eba1..5d85046ab7 100644 --- a/docs/rpc/connect-rpc.md +++ b/docs/rpc/connect-rpc.md @@ -35,8 +35,6 @@ Below is a table of attributes that SHOULD be included on client and server Conn **[3]:** Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. - - `rpc.connect_rpc.error_code` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -58,8 +56,6 @@ Below is a table of attributes that SHOULD be included on client and server Conn | `unimplemented` | unimplemented | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `unknown` | unknown | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -67,6 +63,6 @@ Below is a table of attributes that SHOULD be included on client and server Conn ## Connect RPC Status -If `rpc.connect_rpc.error_code` is set, [Span Status](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/trace/api.md#set-status) MUST be set to `Error` and left unset in all other cases. +If `rpc.connect_rpc.error_code` is set, [Span Status](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/trace/api.md#set-status) MUST be set to `Error` and left unset in all other cases. [DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status diff --git a/docs/rpc/grpc.md b/docs/rpc/grpc.md index 258f19ddea..a21cfdb832 100644 --- a/docs/rpc/grpc.md +++ b/docs/rpc/grpc.md @@ -33,8 +33,6 @@ Below is a table of attributes that SHOULD be included on client and server gRPC **[2]:** Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. - - `rpc.grpc.status_code` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -57,8 +55,6 @@ Below is a table of attributes that SHOULD be included on client and server gRPC | `15` | DATA_LOSS | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `16` | UNAUTHENTICATED | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -67,10 +63,10 @@ Below is a table of attributes that SHOULD be included on client and server gRPC ## gRPC Status The table below describes when -the [Span Status](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/trace/api.md#set-status) MUST be set +the [Span Status](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/trace/api.md#set-status) MUST be set to `Error` or remain unset depending on the [gRPC status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) -and [Span Kind](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/trace/api.md#spankind). +and [Span Kind](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/trace/api.md#spankind). | gRPC Status Code | `SpanKind.SERVER` Span Status | `SpanKind.CLIENT` Span Status | |---|---|---| diff --git a/docs/rpc/json-rpc.md b/docs/rpc/json-rpc.md index 152c87bdba..d242d9b8ec 100644 --- a/docs/rpc/json-rpc.md +++ b/docs/rpc/json-rpc.md @@ -31,9 +31,6 @@ described on this page. **[1]:** This is always required for jsonrpc. See the note in the general RPC conventions for more information. - - - diff --git a/docs/rpc/rpc-metrics.md b/docs/rpc/rpc-metrics.md index e38f6e8e11..c1f2b11af5 100644 --- a/docs/rpc/rpc-metrics.md +++ b/docs/rpc/rpc-metrics.md @@ -87,14 +87,11 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `rpc.server.duration` | Histogram | `ms` | Measures the duration of inbound RPC. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** While streaming RPCs may record this metric as start-of-batch to end-of-batch, it's hard to interpret in practice. **Streaming**: N/A. - - @@ -115,11 +112,8 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `rpc.server.request.size` | Histogram | `By` | Measures the size of RPC request messages (uncompressed). [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** **Streaming**: Recorded per message in a streaming batch - - @@ -140,11 +134,8 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `rpc.server.response.size` | Histogram | `By` | Measures the size of RPC response messages (uncompressed). [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** **Streaming**: Recorded per response in a streaming batch - - @@ -165,13 +156,10 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `rpc.server.requests_per_rpc` | Histogram | `{count}` | Measures the number of messages received per RPC. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Should be 1 for all non-streaming RPCs. **Streaming** : This metric is required for server and client streaming RPCs - - @@ -192,13 +180,10 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `rpc.server.responses_per_rpc` | Histogram | `{count}` | Measures the number of messages sent per RPC. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Should be 1 for all non-streaming RPCs. **Streaming**: This metric is required for server and client streaming RPCs - - @@ -224,14 +209,11 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `rpc.client.duration` | Histogram | `ms` | Measures the duration of outbound RPC. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** While streaming RPCs may record this metric as start-of-batch to end-of-batch, it's hard to interpret in practice. **Streaming**: N/A. - - @@ -252,11 +234,8 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `rpc.client.request.size` | Histogram | `By` | Measures the size of RPC request messages (uncompressed). [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** **Streaming**: Recorded per message in a streaming batch - - @@ -277,11 +256,8 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `rpc.client.response.size` | Histogram | `By` | Measures the size of RPC response messages (uncompressed). [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** **Streaming**: Recorded per response in a streaming batch - - @@ -302,13 +278,10 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `rpc.client.requests_per_rpc` | Histogram | `{count}` | Measures the number of messages received per RPC. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Should be 1 for all non-streaming RPCs. **Streaming**: This metric is required for server and client streaming RPCs - - @@ -329,13 +302,10 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `rpc.client.responses_per_rpc` | Histogram | `{count}` | Measures the number of messages sent per RPC. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Should be 1 for all non-streaming RPCs. **Streaming**: This metric is required for server and client streaming RPCs - - @@ -379,8 +349,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. **[6]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - - `network.transport` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -391,7 +359,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | `udp` | UDP | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `unix` | Unix domain socket | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `network.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -399,7 +366,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | `ipv4` | IPv4 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `ipv6` | IPv6 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `rpc.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -410,8 +376,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | `grpc` | gRPC | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `java_rmi` | Java RMI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - diff --git a/docs/rpc/rpc-spans.md b/docs/rpc/rpc-spans.md index c6ea777e00..c4fab776f0 100644 --- a/docs/rpc/rpc-spans.md +++ b/docs/rpc/rpc-spans.md @@ -131,8 +131,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. **[7]:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). - - `network.transport` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -143,7 +141,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | `udp` | UDP | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `unix` | Unix domain socket | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `network.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -151,7 +148,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | `ipv4` | IPv4 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `ipv6` | IPv6 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `rpc.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -162,8 +158,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | `grpc` | gRPC | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `java_rmi` | Java RMI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -214,8 +208,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. **[9]:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). - - `network.transport` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -226,7 +218,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | `udp` | UDP | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `unix` | Unix domain socket | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `network.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -234,7 +225,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | `ipv4` | IPv4 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `ipv6` | IPv6 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `rpc.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -245,8 +235,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | `grpc` | gRPC | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `java_rmi` | Java RMI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -276,8 +264,6 @@ The event name MUST be `rpc.message`. **[1]:** This way we guarantee that the values will be consistent between different implementations. - - `rpc.message.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -285,8 +271,6 @@ The event name MUST be `rpc.message`. | `RECEIVED` | received | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `SENT` | sent | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - diff --git a/docs/runtime/dotnet-metrics.md b/docs/runtime/dotnet-metrics.md index acc8cb9322..a8bc36f8d8 100644 --- a/docs/runtime/dotnet-metrics.md +++ b/docs/runtime/dotnet-metrics.md @@ -62,12 +62,9 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `dotnet.process.cpu.count` | UpDownCounter | `{cpu}` | The number of processors available to the process. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Meter name: `System.Runtime`; Added in: .NET 9.0. This metric reports the same values as accessing [`Environment.ProcessorCount`](https://learn.microsoft.com/dotnet/api/system.environment.processorcount). - - @@ -88,11 +85,9 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `dotnet.process.cpu.time` | Counter | `s` | CPU time used by the process. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Meter name: `System.Runtime`; Added in: .NET 9.0. This metric reports the same values as accessing the corresponding processor time properties on [`System.Diagnostics.Process`](https://learn.microsoft.com/dotnet/api/system.diagnostics.process). - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`cpu.mode`](/docs/attributes-registry/cpu.md) | string | The mode of the CPU | `user`; `system` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -110,8 +105,6 @@ This metric reports the same values as accessing the corresponding processor tim | `system` | system | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `user` | user | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -132,12 +125,9 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `dotnet.process.memory.working_set` | UpDownCounter | `By` | The number of bytes of physical memory mapped to the process context. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Meter name: `System.Runtime`; Added in: .NET 9.0. This metric reports the same values as calling [`Environment.WorkingSet`](https://learn.microsoft.com/dotnet/api/system.environment.workingset). - - @@ -164,11 +154,9 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `dotnet.gc.collections` | Counter | `{collection}` | The number of garbage collections that have occurred since the process has started. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Meter name: `System.Runtime`; Added in: .NET 9.0. This metric uses the [`GC.CollectionCount(int generation)`](https://learn.microsoft.com/dotnet/api/system.gc.collectioncount) API to calculate exclusive collections per generation. - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`dotnet.gc.heap.generation`](/docs/attributes-registry/dotnet.md) | string | Name of the garbage collector managed heap generation. | `gen0`; `gen1`; `gen2` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -183,8 +171,6 @@ This metric uses the [`GC.CollectionCount(int generation)`](https://learn.micros | `loh` | Large Object Heap | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `poh` | Pinned Object Heap | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -205,12 +191,9 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `dotnet.gc.heap.total_allocated` | Counter | `By` | The *approximate* number of bytes allocated on the managed GC heap since the process has started. The returned value does not include any native allocations. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Meter name: `System.Runtime`; Added in: .NET 9.0. This metric reports the same values as calling [`GC.GetTotalAllocatedBytes()`](https://learn.microsoft.com/dotnet/api/system.gc.gettotalallocatedbytes). - - @@ -231,12 +214,9 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `dotnet.gc.last_collection.memory.committed_size` | UpDownCounter | `By` | The amount of committed virtual memory in use by the .NET GC, as observed during the latest garbage collection. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Meter name: `System.Runtime`; Added in: .NET 9.0. This metric reports the same values as calling [`GC.GetGCMemoryInfo().TotalCommittedBytes`](https://learn.microsoft.com/dotnet/api/system.gcmemoryinfo.totalcommittedbytes). Committed virtual memory may be larger than the heap size because it includes both memory for storing existing objects (the heap size) and some extra memory that is ready to handle newly allocated objects in the future. - - @@ -257,11 +237,9 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `dotnet.gc.last_collection.heap.size` | UpDownCounter | `By` | The managed GC heap size (including fragmentation), as observed during the latest garbage collection. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Meter name: `System.Runtime`; Added in: .NET 9.0. This metric reports the same values as calling [`GC.GetGCMemoryInfo().GenerationInfo.SizeAfterBytes`](https://learn.microsoft.com/dotnet/api/system.gcgenerationinfo.sizeafterbytes). - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`dotnet.gc.heap.generation`](/docs/attributes-registry/dotnet.md) | string | Name of the garbage collector managed heap generation. | `gen0`; `gen1`; `gen2` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -276,8 +254,6 @@ This metric reports the same values as calling [`GC.GetGCMemoryInfo().Generation | `loh` | Large Object Heap | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `poh` | Pinned Object Heap | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -298,11 +274,9 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `dotnet.gc.last_collection.heap.fragmentation.size` | UpDownCounter | `By` | The heap fragmentation, as observed during the latest garbage collection. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Meter name: `System.Runtime`; Added in: .NET 9.0. This metric reports the same values as calling [`GC.GetGCMemoryInfo().GenerationInfo.FragmentationAfterBytes`](https://learn.microsoft.com/dotnet/api/system.gcgenerationinfo.fragmentationafterbytes). - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`dotnet.gc.heap.generation`](/docs/attributes-registry/dotnet.md) | string | Name of the garbage collector managed heap generation. | `gen0`; `gen1`; `gen2` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -317,8 +291,6 @@ This metric reports the same values as calling [`GC.GetGCMemoryInfo().Generation | `loh` | Large Object Heap | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `poh` | Pinned Object Heap | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -339,12 +311,9 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `dotnet.gc.pause.time` | Counter | `s` | The total amount of time paused in GC since the process has started. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Meter name: `System.Runtime`; Added in: .NET 9.0. This metric reports the same values as calling [`GC.GetTotalPauseDuration()`](https://learn.microsoft.com/dotnet/api/system.gc.gettotalpauseduration). - - @@ -371,12 +340,9 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `dotnet.jit.compiled_il.size` | Counter | `By` | Count of bytes of intermediate language that have been compiled since the process has started. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Meter name: `System.Runtime`; Added in: .NET 9.0. This metric reports the same values as calling [`JitInfo.GetCompiledILBytes()`](https://learn.microsoft.com/dotnet/api/system.runtime.jitinfo.getcompiledilbytes). - - @@ -397,12 +363,9 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `dotnet.jit.compiled_methods` | Counter | `{method}` | The number of times the JIT compiler (re)compiled methods since the process has started. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Meter name: `System.Runtime`; Added in: .NET 9.0. This metric reports the same values as calling [`JitInfo.GetCompiledMethodCount()`](https://learn.microsoft.com/dotnet/api/system.runtime.jitinfo.getcompiledmethodcount). - - @@ -423,12 +386,9 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `dotnet.jit.compilation.time` | Counter | `s` | The amount of time the JIT compiler has spent compiling methods since the process has started. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Meter name: `System.Runtime`; Added in: .NET 9.0. This metric reports the same values as calling [`JitInfo.GetCompilationTime()`](https://learn.microsoft.com/dotnet/api/system.runtime.jitinfo.getcompilationtime). - - @@ -455,12 +415,9 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `dotnet.thread_pool.thread.count` | UpDownCounter | `{thread}` | The number of thread pool threads that currently exist. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Meter name: `System.Runtime`; Added in: .NET 9.0. This metric reports the same values as calling [`ThreadPool.ThreadCount`](https://learn.microsoft.com/dotnet/api/system.threading.threadpool.threadcount). - - @@ -481,12 +438,9 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `dotnet.thread_pool.work_item.count` | Counter | `{work_item}` | The number of work items that the thread pool has completed since the process has started. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Meter name: `System.Runtime`; Added in: .NET 9.0. This metric reports the same values as calling [`ThreadPool.CompletedWorkItemCount`](https://learn.microsoft.com/dotnet/api/system.threading.threadpool.completedworkitemcount). - - @@ -507,12 +461,9 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `dotnet.thread_pool.queue.length` | UpDownCounter | `{work_item}` | The number of work items that are currently queued to be processed by the thread pool. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Meter name: `System.Runtime`; Added in: .NET 9.0. This metric reports the same values as calling [`ThreadPool.PendingWorkItemCount`](https://learn.microsoft.com/dotnet/api/system.threading.threadpool.pendingworkitemcount). - - @@ -539,12 +490,9 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `dotnet.monitor.lock_contentions` | Counter | `{contention}` | The number of times there was contention when trying to acquire a monitor lock since the process has started. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Meter name: `System.Runtime`; Added in: .NET 9.0. This metric reports the same values as calling [`Monitor.LockContentionCount`](https://learn.microsoft.com/dotnet/api/system.threading.monitor.lockcontentioncount). - - @@ -565,12 +513,9 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `dotnet.timer.count` | UpDownCounter | `{timer}` | The number of timer instances that are currently active. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Meter name: `System.Runtime`; Added in: .NET 9.0. This metric reports the same values as calling [`Timer.ActiveCount`](https://learn.microsoft.com/dotnet/api/system.threading.timer.activecount). - - @@ -591,12 +536,9 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `dotnet.assembly.count` | UpDownCounter | `{assembly}` | The number of .NET assemblies that are currently loaded. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Meter name: `System.Runtime`; Added in: .NET 9.0. This metric reports the same values as calling [`AppDomain.CurrentDomain.GetAssemblies().Length`](https://learn.microsoft.com/dotnet/api/system.appdomain.getassemblies). - - @@ -617,11 +559,9 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `dotnet.exceptions` | Counter | `{exception}` | The number of exceptions that have been thrown in managed code. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Meter name: `System.Runtime`; Added in: .NET 9.0. This metric reports the same values as counting calls to [`AppDomain.CurrentDomain.FirstChanceException`](https://learn.microsoft.com/dotnet/api/system.appdomain.firstchanceexception). - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. | `System.OperationCanceledException`; `Contoso.MyException` | `Required` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | @@ -632,8 +572,6 @@ This metric reports the same values as counting calls to [`AppDomain.CurrentDoma |---|---|---| | `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - diff --git a/docs/runtime/go-metrics.md b/docs/runtime/go-metrics.md index ac8e76b2f1..6391e16bc4 100644 --- a/docs/runtime/go-metrics.md +++ b/docs/runtime/go-metrics.md @@ -50,10 +50,8 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `go.memory.used` | UpDownCounter | `By` | Memory used by the Go runtime. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Computed from `(/memory/classes/total:bytes - /memory/classes/heap/released:bytes)`. - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`go.memory.type`](/docs/attributes-registry/go.md) | string | The type of memory. | `other`; `stack` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -67,10 +65,6 @@ This metric is [recommended][MetricRecommended]. **[1]:** Computed from `/memory/classes/heap/stacks:bytes`. - - - - @@ -91,11 +85,8 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `go.memory.limit` | UpDownCounter | `By` | Go runtime memory limit configured by the user, if a limit exists. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Computed from `/gc/gomemlimit:bytes`. This metric is excluded if the limit obtained from the Go runtime is math.MaxInt64. - - @@ -116,11 +107,8 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `go.memory.allocated` | Counter | `By` | Memory allocated to the heap by the application. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Computed from `/gc/heap/allocs:bytes`. - - @@ -141,11 +129,8 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `go.memory.allocations` | Counter | `{allocation}` | Count of allocations to the heap by the application. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Computed from `/gc/heap/allocs:objects`. - - @@ -170,11 +155,8 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `go.memory.gc.goal` | UpDownCounter | `By` | Heap size target for the end of the GC cycle. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Computed from `/gc/heap/goal:bytes`. - - @@ -199,11 +181,8 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `go.goroutine.count` | UpDownCounter | `{goroutine}` | Count of live goroutines. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Computed from `/sched/goroutines:goroutines`. - - @@ -228,11 +207,8 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `go.processor.limit` | UpDownCounter | `{thread}` | The number of OS threads that can execute user-level Go code simultaneously. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Computed from `/sched/gomaxprocs:threads`. - - @@ -257,11 +233,8 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `go.schedule.duration` | Histogram | `s` | The time goroutines have spent in the scheduler in a runnable state before actually running. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Computed from `/sched/latencies:seconds`. Bucket boundaries are provided by the runtime, and are subject to change. - - @@ -286,11 +259,8 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `go.config.gogc` | UpDownCounter | `%` | Heap size target percentage configured by the user, otherwise 100. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** The value range is [0.0,100.0]. Computed from `/gc/gogc:percent`. - - diff --git a/docs/runtime/jvm-metrics.md b/docs/runtime/jvm-metrics.md index 0eec60a973..0e5f6619a9 100644 --- a/docs/runtime/jvm-metrics.md +++ b/docs/runtime/jvm-metrics.md @@ -68,8 +68,6 @@ This metric is obtained from [`MemoryPoolMXBean#getUsage()`](https://docs.oracle **[1]:** Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). - - `jvm.memory.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -77,8 +75,6 @@ This metric is obtained from [`MemoryPoolMXBean#getUsage()`](https://docs.oracle | `heap` | Heap memory. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `non_heap` | Non-heap memory | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - @@ -107,8 +103,6 @@ This metric is obtained from [`MemoryPoolMXBean#getUsage()`](https://docs.oracle **[1]:** Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). - - `jvm.memory.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -116,8 +110,6 @@ This metric is obtained from [`MemoryPoolMXBean#getUsage()`](https://docs.oracle | `heap` | Heap memory. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `non_heap` | Non-heap memory | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - @@ -146,8 +138,6 @@ This metric is obtained from [`MemoryPoolMXBean#getUsage()`](https://docs.oracle **[1]:** Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). - - `jvm.memory.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -155,8 +145,6 @@ This metric is obtained from [`MemoryPoolMXBean#getUsage()`](https://docs.oracle | `heap` | Heap memory. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `non_heap` | Non-heap memory | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - @@ -185,8 +173,6 @@ This metric is obtained from [`MemoryPoolMXBean#getCollectionUsage()`](https://d **[1]:** Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). - - `jvm.memory.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -194,8 +180,6 @@ This metric is obtained from [`MemoryPoolMXBean#getCollectionUsage()`](https://d | `heap` | Heap memory. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `non_heap` | Non-heap memory | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - @@ -214,7 +198,7 @@ This metric is obtained by subscribing to [`GarbageCollectionNotificationInfo`](https://docs.oracle.com/javase/8/docs/jre/api/management/extension/com/sun/management/GarbageCollectionNotificationInfo.html) events provided by [`GarbageCollectorMXBean`](https://docs.oracle.com/javase/8/docs/api/java/lang/management/GarbageCollectorMXBean.html). The duration value is obtained from [`GcInfo`](https://docs.oracle.com/javase/8/docs/jre/api/management/extension/com/sun/management/GcInfo.html#getDuration--) This metric SHOULD be specified with -[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/metrics/api.md#instrument-advisory-parameters) +[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/metrics/api.md#instrument-advisory-parameters) of `[ 0.01, 0.1, 1, 10 ]`. @@ -237,9 +221,6 @@ of `[ 0.01, 0.1, 1, 10 ]`. **[2]:** Garbage collector name is generally obtained via [GarbageCollectionNotificationInfo#getGcName()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcName()). - - - @@ -290,8 +271,6 @@ Note that this is the number of platform threads (as opposed to virtual threads) | `timed_waiting` | A thread that is waiting for another thread to perform an action for up to a specified waiting time is in this state. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `waiting` | A thread that is waiting indefinitely for another thread to perform a particular action is in this state. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - @@ -319,7 +298,6 @@ This metric is obtained from [`ClassLoadingMXBean#getTotalLoadedClassCount()`](h | -------- | --------------- | ----------- | -------------- | --------- | | `jvm.class.loaded` | Counter | `{class}` | Number of classes loaded since JVM start. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - @@ -341,7 +319,6 @@ This metric is obtained from [`ClassLoadingMXBean#getUnloadedClassCount()`](http | -------- | --------------- | ----------- | -------------- | --------- | | `jvm.class.unloaded` | Counter | `{class}` | Number of classes unloaded since JVM start. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - @@ -363,7 +340,6 @@ This metric is obtained from [`ClassLoadingMXBean#getLoadedClassCount()`](https: | -------- | --------------- | ----------- | -------------- | --------- | | `jvm.class.count` | UpDownCounter | `{class}` | Number of classes currently loaded. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - @@ -393,7 +369,6 @@ and [`com.ibm.lang.management.OperatingSystemMXBean#getProcessCpuTime()`](https: | -------- | --------------- | ----------- | -------------- | --------- | | `jvm.cpu.time` | Counter | `s` | CPU time used by the process as reported by the JVM. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - @@ -416,7 +391,6 @@ Note that this is always an integer value (i.e. fractional or millicores are not | -------- | --------------- | ----------- | -------------- | --------- | | `jvm.cpu.count` | UpDownCounter | `{cpu}` | Number of processors available to the Java virtual machine. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - @@ -440,11 +414,8 @@ Note that the JVM does not provide a definition of what "recent" means. | -------- | --------------- | ----------- | -------------- | --------- | | `jvm.cpu.recent_utilization` | Gauge | `1` | Recent CPU utilization for the process as reported by the JVM. [1] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - **[1]:** The value range is [0.0,1.0]. This utilization is not defined as being for the specific interval since last measurement (unlike `system.cpu.utilization`). [Reference](https://docs.oracle.com/en/java/javase/17/docs/api/jdk.management/com/sun/management/OperatingSystemMXBean.html#getProcessCpuLoad()). - - @@ -479,8 +450,6 @@ This metric is obtained from [`MemoryPoolMXBean#getUsage()`](https://docs.oracle **[1]:** Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). - - `jvm.memory.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -488,8 +457,6 @@ This metric is obtained from [`MemoryPoolMXBean#getUsage()`](https://docs.oracle | `heap` | Heap memory. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `non_heap` | Non-heap memory | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - - @@ -512,11 +479,8 @@ and [`com.ibm.lang.management.OperatingSystemMXBean#getSystemCpuLoad()`](https:/ | -------- | --------------- | ----------- | -------------- | --------- | | `jvm.system.cpu.utilization` | Gauge | `1` | Recent CPU utilization for the whole system as reported by the JVM. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** The value range is [0.0,1.0]. This utilization is not defined as being for the specific interval since last measurement (unlike `system.cpu.utilization`). [Reference](https://docs.oracle.com/en/java/javase/17/docs/api/jdk.management/com/sun/management/OperatingSystemMXBean.html#getCpuLoad()). - - @@ -538,11 +502,8 @@ This metric is obtained from [`OperatingSystemMXBean#getSystemLoadAverage()`](ht | -------- | --------------- | ----------- | -------------- | --------- | | `jvm.system.cpu.load_1m` | Gauge | `{run_queue_item}` | Average CPU load of the whole system for the last minute as reported by the JVM. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** The value range is [0,n], where n is the number of CPU cores - or a negative number if the value is not available. This utilization is not defined as being for the specific interval since last measurement (unlike `system.cpu.utilization`). [Reference](https://docs.oracle.com/en/java/javase/17/docs/api/java.management/java/lang/management/OperatingSystemMXBean.html#getSystemLoadAverage()). - - @@ -570,9 +531,6 @@ This metric is obtained from [`BufferPoolMXBean#getMemoryUsed()`](https://docs.o **[1]:** Pool names are generally obtained via [BufferPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/BufferPoolMXBean.html#getName()). - - - @@ -600,9 +558,6 @@ This metric is obtained from [`BufferPoolMXBean#getTotalCapacity()`](https://doc **[1]:** Pool names are generally obtained via [BufferPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/BufferPoolMXBean.html#getName()). - - - @@ -630,9 +585,6 @@ This metric is obtained from [`BufferPoolMXBean#getCount()`](https://docs.oracle **[1]:** Pool names are generally obtained via [BufferPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/BufferPoolMXBean.html#getName()). - - - diff --git a/docs/runtime/nodejs-metrics.md b/docs/runtime/nodejs-metrics.md index baa1d3e85a..d44fa3a1ea 100644 --- a/docs/runtime/nodejs-metrics.md +++ b/docs/runtime/nodejs-metrics.md @@ -50,11 +50,8 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `nodejs.eventloop.delay.min` | Gauge | `s` | Event loop minimum delay. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Value can be retrieved from value `histogram.min` of [`perf_hooks.monitorEventLoopDelay([options])`](https://nodejs.org/api/perf_hooks.html#perf_hooksmonitoreventloopdelayoptions) - - @@ -75,11 +72,8 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `nodejs.eventloop.delay.max` | Gauge | `s` | Event loop maximum delay. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Value can be retrieved from value `histogram.max` of [`perf_hooks.monitorEventLoopDelay([options])`](https://nodejs.org/api/perf_hooks.html#perf_hooksmonitoreventloopdelayoptions) - - @@ -100,11 +94,8 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `nodejs.eventloop.delay.mean` | Gauge | `s` | Event loop mean delay. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Value can be retrieved from value `histogram.mean` of [`perf_hooks.monitorEventLoopDelay([options])`](https://nodejs.org/api/perf_hooks.html#perf_hooksmonitoreventloopdelayoptions) - - @@ -125,11 +116,8 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `nodejs.eventloop.delay.stddev` | Gauge | `s` | Event loop standard deviation delay. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Value can be retrieved from value `histogram.stddev` of [`perf_hooks.monitorEventLoopDelay([options])`](https://nodejs.org/api/perf_hooks.html#perf_hooksmonitoreventloopdelayoptions) - - @@ -150,11 +138,8 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `nodejs.eventloop.delay.p50` | Gauge | `s` | Event loop 50 percentile delay. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Value can be retrieved from value `histogram.percentile(50)` of [`perf_hooks.monitorEventLoopDelay([options])`](https://nodejs.org/api/perf_hooks.html#perf_hooksmonitoreventloopdelayoptions) - - @@ -175,11 +160,8 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `nodejs.eventloop.delay.p90` | Gauge | `s` | Event loop 90 percentile delay. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Value can be retrieved from value `histogram.percentile(90)` of [`perf_hooks.monitorEventLoopDelay([options])`](https://nodejs.org/api/perf_hooks.html#perf_hooksmonitoreventloopdelayoptions) - - @@ -200,11 +182,8 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `nodejs.eventloop.delay.p99` | Gauge | `s` | Event loop 99 percentile delay. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Value can be retrieved from value `histogram.percentile(99)` of [`perf_hooks.monitorEventLoopDelay([options])`](https://nodejs.org/api/perf_hooks.html#perf_hooksmonitoreventloopdelayoptions) - - @@ -225,11 +204,8 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `nodejs.eventloop.utilization` | Gauge | `1` | Event loop utilization. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** The value range is [0.0, 1.0] and can be retrieved from [`performance.eventLoopUtilization([utilization1[, utilization2]])`](https://nodejs.org/api/perf_hooks.html#performanceeventlooputilizationutilization1-utilization2) - - @@ -250,10 +226,8 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `nodejs.eventloop.time` | Counter | `s` | Cumulative duration of time the event loop has been in each state. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Value can be retrieved from [`performance.eventLoopUtilization([utilization1[, utilization2]])`](https://nodejs.org/api/perf_hooks.html#performanceeventlooputilizationutilization1-utilization2) - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`nodejs.eventloop.state`](/docs/attributes-registry/nodejs.md) | string | The state of event loop time. | `active`; `idle` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -265,13 +239,11 @@ This metric is [recommended][MetricRecommended]. | `active` | Active time. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `idle` | Idle time. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - -[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.31.0/specification/document-status.md +[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/document-status.md [MetricRecommended]: /docs/general/metric-requirement-level.md#recommended [Eventloop]: https://nodejs.org/api/perf_hooks.html#perf_hooksmonitoreventloopdelayoptions diff --git a/docs/runtime/v8js-metrics.md b/docs/runtime/v8js-metrics.md index b3d0d0a6f2..07a5efc36c 100644 --- a/docs/runtime/v8js-metrics.md +++ b/docs/runtime/v8js-metrics.md @@ -32,7 +32,7 @@ This document describes semantic conventions for V8 JS Engine Runtime metrics in This metric is [recommended][MetricRecommended]. This metric SHOULD be specified with -[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.31.0/specification/metrics/api.md#instrument-advisory-parameters) +[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/metrics/api.md#instrument-advisory-parameters) of `[ 0.01, 0.1, 1, 10 ]`. @@ -46,10 +46,8 @@ of `[ 0.01, 0.1, 1, 10 ]`. | -------- | --------------- | ----------- | -------------- | --------- | | `v8js.gc.duration` | Histogram | `s` | Garbage collection duration. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** The values can be retrieve from [`perf_hooks.PerformanceObserver(...).observe({ entryTypes: ['gc'] })`](https://nodejs.org/api/perf_hooks.html#performanceobserverobserveoptions) - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`v8js.gc.type`](/docs/attributes-registry/v8js.md) | string | The type of garbage collection. | `major`; `minor`; `incremental` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -63,8 +61,6 @@ of `[ 0.01, 0.1, 1, 10 ]`. | `minor` | Minor (Scavenge). | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `weakcb` | Weak Callbacks (Process Weak Callbacks). | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -85,18 +81,14 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `v8js.memory.heap.limit` | UpDownCounter | `By` | Total heap memory size pre-allocated. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** The value can be retrieved from value `space_size` of [`v8.getHeapSpaceStatistics()`](https://nodejs.org/api/v8.html#v8getheapspacestatistics) - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`v8js.heap.space.name`](/docs/attributes-registry/v8js.md) | string | The name of the space type of heap memory. [1] | `new_space`; `old_space`; `code_space` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** Value can be retrieved from value `space_name` of [`v8.getHeapSpaceStatistics()`](https://nodejs.org/api/v8.html#v8getheapspacestatistics) - - `v8js.heap.space.name` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -107,8 +99,6 @@ This metric is [recommended][MetricRecommended]. | `new_space` | New memory space. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `old_space` | Old memory space. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -129,18 +119,14 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `v8js.memory.heap.used` | UpDownCounter | `By` | Heap Memory size allocated. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** The value can be retrieved from value `space_used_size` of [`v8.getHeapSpaceStatistics()`](https://nodejs.org/api/v8.html#v8getheapspacestatistics) - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`v8js.heap.space.name`](/docs/attributes-registry/v8js.md) | string | The name of the space type of heap memory. [1] | `new_space`; `old_space`; `code_space` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** Value can be retrieved from value `space_name` of [`v8.getHeapSpaceStatistics()`](https://nodejs.org/api/v8.html#v8getheapspacestatistics) - - `v8js.heap.space.name` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -151,8 +137,6 @@ This metric is [recommended][MetricRecommended]. | `new_space` | New memory space. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `old_space` | Old memory space. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -173,18 +157,14 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `v8js.heap.space.available_size` | UpDownCounter | `By` | Heap space available size. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Value can be retrieved from value `space_available_size` of [`v8.getHeapSpaceStatistics()`](https://nodejs.org/api/v8.html#v8getheapspacestatistics) - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`v8js.heap.space.name`](/docs/attributes-registry/v8js.md) | string | The name of the space type of heap memory. [1] | `new_space`; `old_space`; `code_space` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** Value can be retrieved from value `space_name` of [`v8.getHeapSpaceStatistics()`](https://nodejs.org/api/v8.html#v8getheapspacestatistics) - - `v8js.heap.space.name` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -195,8 +175,6 @@ This metric is [recommended][MetricRecommended]. | `new_space` | New memory space. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `old_space` | Old memory space. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -217,18 +195,14 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `v8js.heap.space.physical_size` | UpDownCounter | `By` | Committed size of a heap space. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Value can be retrieved from value `physical_space_size` of [`v8.getHeapSpaceStatistics()`](https://nodejs.org/api/v8.html#v8getheapspacestatistics) - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`v8js.heap.space.name`](/docs/attributes-registry/v8js.md) | string | The name of the space type of heap memory. [1] | `new_space`; `old_space`; `code_space` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** Value can be retrieved from value `space_name` of [`v8.getHeapSpaceStatistics()`](https://nodejs.org/api/v8.html#v8getheapspacestatistics) - - `v8js.heap.space.name` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -239,12 +213,10 @@ This metric is [recommended][MetricRecommended]. | `new_space` | New memory space. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `old_space` | Old memory space. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - -[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.31.0/specification/document-status.md +[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.37.0/specification/document-status.md [MetricRecommended]: /docs/general/metric-requirement-level.md#recommended diff --git a/docs/system/container-metrics.md b/docs/system/container-metrics.md index 87624eeb64..a0c7c8599a 100644 --- a/docs/system/container-metrics.md +++ b/docs/system/container-metrics.md @@ -27,10 +27,8 @@ This metric is [opt-in][MetricOptIn]. | -------- | --------------- | ----------- | -------------- | --------- | | `container.cpu.time` | Counter | `s` | Total CPU time consumed [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Total CPU time consumed by the specific container on all available CPU cores - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`cpu.mode`](/docs/attributes-registry/cpu.md) | string | The CPU mode for this data point. A container's CPU metric SHOULD be characterized _either_ by data points with no `mode` labels, _or only_ data points with `mode` labels. [1] | `user`; `system` | `Conditionally Required` [2] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -39,8 +37,6 @@ This metric is [opt-in][MetricOptIn]. **[2]:** Required if mode is available, i.e. metrics coming from the Docker Stats API. - - `cpu.mode` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -54,8 +50,6 @@ This metric is [opt-in][MetricOptIn]. | `system` | system | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `user` | user | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -76,10 +70,8 @@ This metric is [opt-in][MetricOptIn]. | -------- | --------------- | ----------- | -------------- | --------- | | `container.cpu.usage` | Gauge | `{cpu}` | Container's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** CPU usage of the specific container on all available CPU cores, averaged over the sample window - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`cpu.mode`](/docs/attributes-registry/cpu.md) | string | The CPU mode for this data point. A container's CPU metric SHOULD be characterized _either_ by data points with no `mode` labels, _or only_ data points with `mode` labels. [1] | `user`; `system` | `Conditionally Required` [2] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -88,8 +80,6 @@ This metric is [opt-in][MetricOptIn]. **[2]:** Required if mode is available, i.e. metrics coming from the Docker Stats API. - - `cpu.mode` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -103,8 +93,6 @@ This metric is [opt-in][MetricOptIn]. | `system` | system | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `user` | user | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -125,11 +113,8 @@ This metric is [opt-in][MetricOptIn]. | -------- | --------------- | ----------- | -------------- | --------- | | `container.memory.usage` | Counter | `By` | Memory usage of the container. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Memory usage of the container. - - @@ -150,10 +135,8 @@ This metric is [opt-in][MetricOptIn]. | -------- | --------------- | ----------- | -------------- | --------- | | `container.disk.io` | Counter | `By` | Disk bytes for the container. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** The total number of bytes read/written successfully (aggregated from all disks). - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`disk.io.direction`](/docs/attributes-registry/disk.md) | string | The disk IO operation direction. | `read` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -166,8 +149,6 @@ This metric is [opt-in][MetricOptIn]. | `read` | read | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `write` | write | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -188,10 +169,8 @@ This metric is [opt-in][MetricOptIn]. | -------- | --------------- | ----------- | -------------- | --------- | | `container.network.io` | Counter | `By` | Network bytes for the container. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** The number of bytes sent/received on all network interfaces by the container. - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`network.io.direction`](/docs/attributes-registry/network.md) | string | The network IO operation direction. | `transmit` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -204,8 +183,6 @@ This metric is [opt-in][MetricOptIn]. | `receive` | receive | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `transmit` | transmit | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - diff --git a/docs/system/k8s-metrics.md b/docs/system/k8s-metrics.md index 42d152c65e..bbadff485d 100644 --- a/docs/system/k8s-metrics.md +++ b/docs/system/k8s-metrics.md @@ -30,11 +30,8 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `k8s.pod.cpu.time` | Counter | `s` | Total CPU time consumed [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Total CPU time consumed by the specific Pod on all available CPU cores - - @@ -55,11 +52,8 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `k8s.pod.cpu.usage` | Gauge | `{cpu}` | Pod's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** CPU usage of the specific Pod on all available CPU cores, averaged over the sample window - - @@ -80,11 +74,8 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `k8s.pod.memory.usage` | Gauge | `By` | Memory usage of the Pod [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Total memory usage of the Pod - - @@ -105,11 +96,8 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `k8s.node.cpu.time` | Counter | `s` | Total CPU time consumed [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Total CPU time consumed by the specific Node on all available CPU cores - - @@ -130,11 +118,8 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `k8s.node.cpu.usage` | Gauge | `{cpu}` | Node's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** CPU usage of the specific Node on all available CPU cores, averaged over the sample window - - @@ -155,11 +140,8 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `k8s.node.memory.usage` | Gauge | `By` | Memory usage of the Node [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Total memory usage of the Node - - diff --git a/docs/system/process-metrics.md b/docs/system/process-metrics.md index 7e7f7041c6..c08e068e41 100644 --- a/docs/system/process-metrics.md +++ b/docs/system/process-metrics.md @@ -67,8 +67,6 @@ This metric is [recommended][MetricRecommended]. **[1]:** Following states SHOULD be used: `user`, `system`, `wait` - - `cpu.mode` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -82,8 +80,6 @@ This metric is [recommended][MetricRecommended]. | `system` | system | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `user` | user | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -110,8 +106,6 @@ This metric is [opt-in][MetricOptIn]. **[1]:** Following states SHOULD be used: `user`, `system`, `wait` - - `cpu.mode` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -125,8 +119,6 @@ This metric is [opt-in][MetricOptIn]. | `system` | system | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `user` | user | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -147,7 +139,6 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `process.memory.usage` | UpDownCounter | `By` | The amount of physical memory in use. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - @@ -168,7 +159,6 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `process.memory.virtual` | UpDownCounter | `By` | The amount of committed virtual memory. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - @@ -200,8 +190,6 @@ This metric is [recommended][MetricRecommended]. | `read` | read | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `write` | write | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -233,8 +221,6 @@ This metric is [recommended][MetricRecommended]. | `receive` | receive | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `transmit` | transmit | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -255,7 +241,6 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `process.thread.count` | UpDownCounter | `{thread}` | Process threads count. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - @@ -276,7 +261,6 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `process.open_file_descriptor.count` | UpDownCounter | `{count}` | Number of file descriptors in use by the process. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - @@ -308,8 +292,6 @@ This metric is [recommended][MetricRecommended]. | `involuntary` | involuntary | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `voluntary` | voluntary | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -341,8 +323,6 @@ This metric is [recommended][MetricRecommended]. | `major` | major | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `minor` | minor | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -363,11 +343,8 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `process.uptime` | Counter | `s` | The time the process has been running. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Instrumentations SHOULD use counter with type `double` and measure uptime with at least millisecond precision - - diff --git a/docs/system/system-metrics.md b/docs/system/system-metrics.md index 368b922d02..962087e83b 100644 --- a/docs/system/system-metrics.md +++ b/docs/system/system-metrics.md @@ -99,8 +99,6 @@ This metric is [recommended][MetricRecommended]. **[1]:** Following states SHOULD be used: `user`, `system`, `nice`, `idle`, `iowait`, `interrupt`, `steal` - - `cpu.mode` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -114,8 +112,6 @@ This metric is [recommended][MetricRecommended]. | `system` | system | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `user` | user | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -143,8 +139,6 @@ This metric is [opt-in][MetricOptIn]. **[1]:** Following modes SHOULD be used: `user`, `system`, `nice`, `idle`, `iowait`, `interrupt`, `steal` - - `cpu.mode` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -158,8 +152,6 @@ This metric is [opt-in][MetricOptIn]. | `system` | system | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `user` | user | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -180,7 +172,6 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `system.cpu.physical.count` | UpDownCounter | `{cpu}` | Reports the number of actual physical processor cores on the hardware | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - @@ -201,7 +192,6 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `system.cpu.logical.count` | UpDownCounter | `{cpu}` | Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - @@ -226,7 +216,6 @@ This metric is [recommended][MetricRecommended]. |---|---|---|---|---|---| | [`system.cpu.logical_number`](/docs/attributes-registry/system.md) | int | The logical CPU number [0..n-1] | `1` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - @@ -252,11 +241,9 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `system.memory.usage` | UpDownCounter | `By` | Reports memory in use by state. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** The sum over all `system.memory.state` values SHOULD equal the total memory available on the system, that is `system.memory.limit`. - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`system.memory.state`](/docs/attributes-registry/system.md) | string | The memory state | `free`; `cached` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -270,8 +257,6 @@ available on the system, that is `system.memory.limit`. | `free` | free | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `used` | used | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -292,11 +277,8 @@ This metric is [opt-in][MetricOptIn]. | -------- | --------------- | ----------- | -------------- | --------- | | `system.memory.limit` | UpDownCounter | `By` | Total memory available in the system. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Its value SHOULD equal the sum of `system.memory.state` over all states. - - @@ -317,12 +299,9 @@ This metric is [opt-in][MetricOptIn]. | -------- | --------------- | ----------- | -------------- | --------- | | `system.memory.shared` | UpDownCounter | `By` | Shared memory used (mostly by tmpfs). [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Equivalent of `shared` from [`free` command](https://man7.org/linux/man-pages/man1/free.1.html) or `Shmem` from [`/proc/meminfo`](https://man7.org/linux/man-pages/man5/proc.5.html)" - - @@ -356,8 +335,6 @@ This metric is [recommended][MetricRecommended]. | `free` | free | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `used` | used | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -384,6 +361,7 @@ This metric is [recommended][MetricRecommended]. | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| +| [`system.device`](/docs/attributes-registry/system.md) | string | Unique identifier for the device responsible for managing paging operations. | `/dev/dm-0` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`system.paging.state`](/docs/attributes-registry/system.md) | string | The memory paging state | `free` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | `system.paging.state` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. @@ -393,8 +371,6 @@ This metric is [recommended][MetricRecommended]. | `free` | free | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `used` | used | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -417,6 +393,7 @@ This metric is [recommended][MetricRecommended]. | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| +| [`system.device`](/docs/attributes-registry/system.md) | string | Unique identifier for the device responsible for managing paging operations. | `/dev/dm-0` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`system.paging.state`](/docs/attributes-registry/system.md) | string | The memory paging state | `free` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | `system.paging.state` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. @@ -426,8 +403,6 @@ This metric is [recommended][MetricRecommended]. | `free` | free | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `used` | used | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -459,8 +434,6 @@ This metric is [recommended][MetricRecommended]. | `major` | major | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `minor` | minor | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -493,7 +466,6 @@ This metric is [recommended][MetricRecommended]. | `in` | in | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `out` | out | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - `system.paging.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -501,8 +473,6 @@ This metric is [recommended][MetricRecommended]. | `major` | major | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `minor` | minor | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -539,8 +509,6 @@ This metric is [recommended][MetricRecommended]. | `read` | read | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `write` | write | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -573,8 +541,6 @@ This metric is [recommended][MetricRecommended]. | `read` | read | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `write` | write | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -595,7 +561,6 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `system.disk.io_time` | Counter | `s` | Time disk spent activated [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** The real elapsed time ("wall clock") used in the I/O path (time from operations running in parallel are not counted). Measured as: - Linux: Field 13 from [procfs-diskstats](https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats) @@ -603,12 +568,10 @@ This metric is [recommended][MetricRecommended]. ["Disk\% Idle Time"](https://learn.microsoft.com/archive/blogs/askcore/windows-performance-monitor-disk-counters-explained#windows-performance-monitor-disk-counters-explained) performance counter: `uptime * (100 - "Disk\% Idle Time") / 100` - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`system.device`](/docs/attributes-registry/system.md) | string | The device identifier | `(identifier)` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - @@ -629,13 +592,11 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `system.disk.operation_time` | Counter | `s` | Sum of the time each operation took to complete [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Because it is the sum of time each request took, parallel-issued requests each contribute to make the count grow. Measured as: - Linux: Fields 7 & 11 from [procfs-diskstats](https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats) - Windows: "Avg. Disk sec/Read" perf counter multiplied by "Disk Reads/sec" perf counter (similar for Writes) - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`disk.io.direction`](/docs/attributes-registry/disk.md) | string | The disk IO operation direction. | `read` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -648,8 +609,6 @@ This metric is [recommended][MetricRecommended]. | `read` | read | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `write` | write | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -682,8 +641,6 @@ This metric is [recommended][MetricRecommended]. | `read` | read | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `write` | write | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -708,7 +665,6 @@ This metric is [opt-in][MetricOptIn]. |---|---|---|---|---|---| | [`system.device`](/docs/attributes-registry/system.md) | string | The device identifier | `(identifier)` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - @@ -733,11 +689,9 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `system.filesystem.usage` | UpDownCounter | `By` | Reports a filesystem's space usage across different states. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** The sum of all `system.filesystem.usage` values over the different `system.filesystem.state` attributes SHOULD equal the total storage capacity of the filesystem, that is `system.filesystem.limit`. - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`system.device`](/docs/attributes-registry/system.md) | string | Identifier for the device where the filesystem resides. | `/dev/sda`; `\network-drive` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -754,7 +708,6 @@ SHOULD equal the total storage capacity of the filesystem, that is `system.files | `reserved` | reserved | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `used` | used | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - `system.filesystem.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -766,8 +719,6 @@ SHOULD equal the total storage capacity of the filesystem, that is `system.files | `ntfs` | ntfs | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `refs` | refs | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -804,7 +755,6 @@ This metric is [recommended][MetricRecommended]. | `reserved` | reserved | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `used` | used | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - `system.filesystem.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -816,8 +766,6 @@ This metric is [recommended][MetricRecommended]. | `ntfs` | ntfs | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `refs` | refs | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -856,8 +804,6 @@ This metric is [opt-in][MetricOptIn]. | `ntfs` | ntfs | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `refs` | refs | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -882,14 +828,12 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `system.network.dropped` | Counter | `{packet}` | Count of packets that are dropped or discarded even though there was no error [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Measured as: - Linux: the `drop` column in `/proc/dev/net` ([source](https://web.archive.org/web/20180321091318/http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html)) - Windows: [`InDiscards`/`OutDiscards`](https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2) from [`GetIfEntry2`](https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2) - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`network.io.direction`](/docs/attributes-registry/network.md) | string | The network IO operation direction. | `transmit` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -902,8 +846,6 @@ This metric is [recommended][MetricRecommended]. | `receive` | receive | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `transmit` | transmit | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -936,8 +878,6 @@ This metric is [recommended][MetricRecommended]. | `receive` | receive | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `transmit` | transmit | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -958,14 +898,12 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `system.network.errors` | Counter | `{error}` | Count of network errors detected [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** Measured as: - Linux: the `errs` column in `/proc/dev/net` ([source](https://web.archive.org/web/20180321091318/http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html)). - Windows: [`InErrors`/`OutErrors`](https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2) from [`GetIfEntry2`](https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2). - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`network.io.direction`](/docs/attributes-registry/network.md) | string | The network IO operation direction. | `transmit` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -978,8 +916,6 @@ This metric is [recommended][MetricRecommended]. | `receive` | receive | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `transmit` | transmit | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -1012,8 +948,6 @@ This metric is [recommended][MetricRecommended]. | `receive` | receive | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `transmit` | transmit | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -1046,8 +980,6 @@ Consider always setting the transport when setting a port number, since a port number is ambiguous without knowing the transport. For example different processes could be listening on TCP port 12345 and UDP port 12345. - - `network.transport` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -1058,7 +990,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | `udp` | UDP | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `unix` | Unix domain socket | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - `system.network.state` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -1076,8 +1007,6 @@ different processes could be listening on TCP port 12345 and UDP port 12345. | `syn_sent` | syn_sent | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `time_wait` | time_wait | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -1115,8 +1044,6 @@ This metric is [recommended][MetricRecommended]. | `sleeping` | sleeping | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `stopped` | stopped | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - @@ -1137,7 +1064,6 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `system.process.created` | Counter | `{process}` | Total number of processes created over uptime of the host | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - @@ -1188,15 +1114,12 @@ an `{os}` prefix to split this metric across OSes. | -------- | --------------- | ----------- | -------------- | --------- | | `system.linux.memory.available` | UpDownCounter | `By` | An estimate of how much memory is available for starting new applications, without causing swapping [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** This is an alternative to `system.memory.usage` metric with `state=free`. Linux starting from 3.14 exports "available" memory. It takes "free" memory as a baseline, and then factors in kernel-specific values. This is supposed to be more accurate than just "free" memory. For reference, see the calculations [here](https://superuser.com/a/980821). See also `MemAvailable` in [/proc/meminfo](https://man7.org/linux/man-pages/man5/proc.5.html). - - @@ -1217,12 +1140,10 @@ This metric is [recommended][MetricRecommended]. | -------- | --------------- | ----------- | -------------- | --------- | | `system.linux.memory.slab.usage` | UpDownCounter | `By` | Reports the memory used by the Linux kernel for managing caches of frequently used objects. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - **[1]:** The sum over the `reclaimable` and `unreclaimable` state values in `linux.memory.slab.usage` SHOULD be equal to the total slab memory available on the system. Note that the total slab memory is not constant and may vary over time. See also the [Slab allocator](https://blogs.oracle.com/linux/post/understanding-linux-kernel-memory-statistics) and `Slab` in [/proc/meminfo](https://man7.org/linux/man-pages/man5/proc.5.html). - | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`linux.memory.slab.state`](/docs/attributes-registry/linux.md) | string | The Linux Slab memory state | `reclaimable`; `unreclaimable` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -1234,8 +1155,6 @@ See also the [Slab allocator](https://blogs.oracle.com/linux/post/understanding- | `reclaimable` | reclaimable | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `unreclaimable` | unreclaimable | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - diff --git a/docs/url/url.md b/docs/url/url.md index f4eb63a3c0..2128ddc0f4 100644 --- a/docs/url/url.md +++ b/docs/url/url.md @@ -45,9 +45,6 @@ This document defines semantic conventions that describe URL and its components. **[3]:** Sensitive content provided in `url.query` SHOULD be scrubbed when instrumentations can identify it. - - - diff --git a/.github/workflows/scripts/generate-registry-area-labels.sh b/internal/tools/scripts/generate-registry-area-labels.sh old mode 100644 new mode 100755 similarity index 100% rename from .github/workflows/scripts/generate-registry-area-labels.sh rename to internal/tools/scripts/generate-registry-area-labels.sh diff --git a/internal/tools/update_specification_version.sh b/internal/tools/update_specification_version.sh index f62cb6587d..490d64ba64 100755 --- a/internal/tools/update_specification_version.sh +++ b/internal/tools/update_specification_version.sh @@ -6,9 +6,9 @@ # Set this to the version number you want to CHANGE in URLs in the repository. -PREVIOUS_SPECIFICATION_VERSION="v1.33.0" +PREVIOUS_SPECIFICATION_VERSION="v1.35.0" # Set this to the version number you want to KEEP in URLs in the repository. -LATEST_SPECIFICATION_VERSION="v1.35.0" +LATEST_SPECIFICATION_VERSION="v1.37.0" # The specific pattern we look for when replacing URLs SPECIFICATION_URL_PREFIX="https://github.com/open-telemetry/opentelemetry-specification/tree/" SPECIFICATION_BLOB_URL_PREFIX="https://github.com/open-telemetry/opentelemetry-specification/blob/" diff --git a/model/cloudfoundry/registry.yaml b/model/cloudfoundry/registry.yaml new file mode 100644 index 0000000000..cf1a2f65b6 --- /dev/null +++ b/model/cloudfoundry/registry.yaml @@ -0,0 +1,135 @@ +groups: + - id: registry.cloudfoundry + type: attribute_group + brief: > + CloudFoundry resource attributes. + attributes: + - id: cloudfoundry.system.id + type: string + stability: experimental + brief: > + A guid or another name describing the event source. + note: | + CloudFoundry defines the `source_id` in the [Loggregator v2 envelope](https://github.com/cloudfoundry/loggregator-api#v2-envelope). + It is used for logs and metrics emitted by CloudFoundry. It is + supposed to contain the component name, e.g. "gorouter", for + CloudFoundry components. + + When system components are instrumented, values from the + [Bosh spec](https://bosh.io/docs/jobs/#properties-spec) + should be used. The `system.id` should be set to + `spec.deployment/spec.name`. + examples: + - 'cf/gorouter' + - id: cloudfoundry.system.instance.id + type: string + stability: experimental + brief: > + A guid describing the concrete instance of the event source. + note: | + CloudFoundry defines the `instance_id` in the [Loggregator v2 envelope](https://github.com/cloudfoundry/loggregator-api#v2-envelope). + It is used for logs and metrics emitted by CloudFoundry. It is + supposed to contain the vm id for CloudFoundry components. + + When system components are instrumented, values from the + [Bosh spec](https://bosh.io/docs/jobs/#properties-spec) + should be used. The `system.instance.id` should be set to `spec.id`. + examples: + - '218fc5a9-a5f1-4b54-aa05-46717d0ab26d' + - id: cloudfoundry.app.name + type: string + stability: experimental + brief: > + The name of the application. + note: | + Application instrumentation should use the value from environment + variable `VCAP_APPLICATION.application_name`. This is the same value + as reported by `cf apps`. + examples: ['my-app-name'] + - id: cloudfoundry.app.id + type: string + stability: experimental + brief: > + The guid of the application. + note: | + Application instrumentation should use the value from environment + variable `VCAP_APPLICATION.application_id`. This is the same value as + reported by `cf app --guid`. + examples: ['218fc5a9-a5f1-4b54-aa05-46717d0ab26d'] + - id: cloudfoundry.app.instance.id + type: string + stability: experimental + brief: > + The index of the application instance. 0 when just one instance is active. + note: | + CloudFoundry defines the `instance_id` in the [Loggregator v2 envelope](https://github.com/cloudfoundry/loggregator-api#v2-envelope). + It is used for logs and metrics emitted by CloudFoundry. It is + supposed to contain the application instance index for applications + deployed on the runtime. + + Application instrumentation should use the value from environment + variable `CF_INSTANCE_INDEX`. + examples: + - '0' + - '1' + - id: cloudfoundry.space.name + type: string + stability: experimental + brief: > + The name of the CloudFoundry space the application is running in. + note: | + Application instrumentation should use the value from environment + variable `VCAP_APPLICATION.space_name`. This is the same value as + reported by `cf spaces`. + examples: ['my-space-name'] + - id: cloudfoundry.space.id + type: string + stability: experimental + brief: > + The guid of the CloudFoundry space the application is running in. + note: | + Application instrumentation should use the value from environment + variable `VCAP_APPLICATION.space_id`. This is the same value as + reported by `cf space --guid`. + examples: ['218fc5a9-a5f1-4b54-aa05-46717d0ab26d'] + - id: cloudfoundry.org.name + type: string + stability: experimental + brief: > + The name of the CloudFoundry organization the app is running in. + note: | + Application instrumentation should use the value from environment + variable `VCAP_APPLICATION.org_name`. This is the same value as + reported by `cf orgs`. + examples: ['my-org-name'] + - id: cloudfoundry.org.id + type: string + stability: experimental + brief: > + The guid of the CloudFoundry org the application is running in. + note: | + Application instrumentation should use the value from environment + variable `VCAP_APPLICATION.org_id`. This is the same value as + reported by `cf org --guid`. + examples: ['218fc5a9-a5f1-4b54-aa05-46717d0ab26d'] + - id: cloudfoundry.process.id + type: string + stability: experimental + brief: > + The UID identifying the process. + note: | + Application instrumentation should use the value from environment + variable `VCAP_APPLICATION.process_id`. It is supposed to be equal to + `VCAP_APPLICATION.app_id` for applications deployed to the runtime. + For system components, this could be the actual PID. + examples: ['218fc5a9-a5f1-4b54-aa05-46717d0ab26d'] + - id: cloudfoundry.process.type + type: string + stability: experimental + brief: > + The type of process. + note: | + CloudFoundry applications can consist of multiple jobs. Usually the + main process will be of type `web`. There can be additional background + tasks or side-cars with different process types. + examples: ['web'] diff --git a/model/cloudfoundry/resources.yaml b/model/cloudfoundry/resources.yaml new file mode 100644 index 0000000000..95d60abe35 --- /dev/null +++ b/model/cloudfoundry/resources.yaml @@ -0,0 +1,41 @@ +groups: + - id: cloudfoundry.system + type: resource + name: cloudfoundry.system + brief: > + The system component which is monitored. + attributes: + - ref: cloudfoundry.system.id + - ref: cloudfoundry.system.instance.id + - id: cloudfoundry.app + type: resource + name: cloudfoundry.app + brief: > + The application which is monitored. + attributes: + - ref: cloudfoundry.app.id + - ref: cloudfoundry.app.name + - id: cloudfoundry.space + type: resource + name: cloudfoundry.space + brief: > + The space of the application which is monitored. + attributes: + - ref: cloudfoundry.space.id + - ref: cloudfoundry.space.name + - id: cloudfoundry.org + type: resource + name: cloudfoundry.org + brief: > + The organization of the application which is monitored. + attributes: + - ref: cloudfoundry.org.id + - ref: cloudfoundry.org.name + - id: cloudfoundry.process + type: resource + name: cloudfoundry.process + brief: > + The process of the application which is monitored. + attributes: + - ref: cloudfoundry.process.id + - ref: cloudfoundry.process.type diff --git a/model/database/common.yaml b/model/database/common.yaml index 3dfc31af14..72a6cdac89 100644 --- a/model/database/common.yaml +++ b/model/database/common.yaml @@ -2,6 +2,7 @@ groups: - id: attributes.db.client.minimal type: attribute_group brief: 'Database Client attributes' + stability: experimental attributes: - ref: db.operation.name requirement_level: @@ -14,10 +15,18 @@ groups: - ref: server.port requirement_level: conditionally_required: If using a port other than the default port for this DBMS and if `server.address` is set. + - ref: db.response.status_code + requirement_level: + conditionally_required: If the operation failed and status code is available. - ref: error.type requirement_level: conditionally_required: If and only if the operation failed. note: > - The `error.type` SHOULD match the error code returned by the database or the client library, - the canonical name of exception that occurred, or another low-cardinality error identifier. - Instrumentations SHOULD document the list of errors they report. + The `error.type` SHOULD match the `db.response.status_code` returned by the database or the client library, + or the canonical name of exception that occurred. + + When using canonical exception type name, instrumentation SHOULD do the best effort to + report the most relevant type. For example, if the original exception is wrapped into a + generic one, the original exception SHOULD be preferred. + + Instrumentations SHOULD document how `error.type` is populated. diff --git a/model/database/deprecated/registry-deprecated.yaml b/model/database/deprecated/registry-deprecated.yaml index e8fdf5d667..610aadf0ca 100644 --- a/model/database/deprecated/registry-deprecated.yaml +++ b/model/database/deprecated/registry-deprecated.yaml @@ -4,6 +4,7 @@ groups: display_name: Deprecated Database Attributes brief: > "Describes deprecated db attributes." + stability: experimental attributes: - id: db.connection_string type: string @@ -90,12 +91,19 @@ groups: brief: > Deprecated, use `db.namespace` instead. examples: ["e9106fc68e3044f0b1475b04bf4ffd5f"] + - id: db.cosmosdb.status_code + type: int + stability: experimental + deprecated: 'Replaced by `db.response.status_code`.' + brief: 'Deprecated, use `db.response.status_code` instead.' + examples: [200, 201] - id: registry.db.metrics.deprecated type: attribute_group display_name: Deprecated Database Metrics brief: > "Describes deprecated db metrics attributes." + stability: experimental attributes: - id: state stability: experimental diff --git a/model/database/metrics.yaml b/model/database/metrics.yaml index 716776b3cf..bc4985e323 100644 --- a/model/database/metrics.yaml +++ b/model/database/metrics.yaml @@ -7,7 +7,7 @@ groups: Batch operations SHOULD be recorded as a single operation. instrument: histogram unit: "s" - stability: experimental + stability: experimental # RELEASE CANDIDATE extends: attributes.db.client.minimal attributes: - ref: db.collection.name diff --git a/model/database/registry.yaml b/model/database/registry.yaml index 51d1f49868..200805088b 100644 --- a/model/database/registry.yaml +++ b/model/database/registry.yaml @@ -7,7 +7,7 @@ groups: attributes: - id: db.collection.name type: string - stability: experimental + stability: experimental # RELEASE CANDIDATE brief: The name of a collection (table, container) within the database. note: > It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. @@ -17,19 +17,12 @@ groups: For batch operations, if the individual operations are known to have the same collection name then that collection name SHOULD be used, otherwise `db.collection.name` SHOULD NOT be captured. - examples: ['public.users', 'customers'] - - id: db.record.id - type: string - stability: experimental - brief: The record identifier if present. - note: > - It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. - If the record id is parsed from the query text, it SHOULD be the first id found in the query. - examples: ['1', 'W0tpsmIBdwcYyG50zbta'] + This attribute has stability level RELEASE CANDIDATE. + examples: ["public.users", "customers"] - id: db.namespace type: string - stability: experimental + stability: experimental # RELEASE CANDIDATE brief: > The name of the database, fully qualified within the server address and port. note: > @@ -42,10 +35,12 @@ groups: means in the context of that system. It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. + + This attribute has stability level RELEASE CANDIDATE. examples: ["customers", "test.users"] - id: db.operation.name type: string - stability: experimental + stability: experimental # RELEASE CANDIDATE brief: > The name of the operation or command being executed. note: > @@ -56,10 +51,12 @@ groups: For batch operations, if the individual operations are known to have the same operation name then that operation name SHOULD be used prepended by `BATCH `, otherwise `db.operation.name` SHOULD be `BATCH` or some other database system specific term if more applicable. + + This attribute has stability level RELEASE CANDIDATE. examples: ["findAndModify", "HMSET", "SELECT"] - id: db.query.text type: string - stability: experimental + stability: experimental # RELEASE CANDIDATE brief: > The database query being executed. note: > @@ -72,6 +69,8 @@ groups: Even though parameterized query text can potentially have sensitive data, by using a parameterized query the user is giving a strong signal that any sensitive data will be passed as parameter values, and the benefit to observability of capturing the static part of the query text by default outweighs the risk. + + This attribute has stability level RELEASE CANDIDATE. examples: [ "SELECT * FROM wuser_table where username = ?", @@ -79,7 +78,7 @@ groups: ] - id: db.query.parameter type: template[string] - stability: experimental + stability: experimental # RELEASE CANDIDATE brief: > A query parameter used in `db.query.text`, with `` being the parameter name, and the attribute value being a string representation of the parameter value. @@ -88,21 +87,42 @@ groups: If a parameter has no name and instead is referenced only by index, then `` SHOULD be the 0-based index. + + This attribute has stability level RELEASE CANDIDATE. examples: ["someval", "55"] - id: db.operation.batch.size type: int - stability: experimental + stability: experimental # RELEASE CANDIDATE brief: The number of queries included in a batch operation. note: > Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` SHOULD never be `1`. + + This attribute has stability level RELEASE CANDIDATE. examples: [2, 3, 4] + - id: db.response.status_code + type: string + stability: experimental # RELEASE CANDIDATE + brief: Database response status code. + note: > + The status code returned by the database. Usually it represents an error code, + but may also represent partial success, warning, or differentiate + between various types of successful outcomes. + + Semantic conventions for individual database systems SHOULD document what + `db.response.status_code` means in the context of that system. + + This attribute has stability level RELEASE CANDIDATE. + examples: ["102", "ORA-17002", "08P01", "404"] + - id: db.system brief: The database management system (DBMS) product as identified by the client instrumentation. note: > The actual DBMS may differ from the one identified by the client. For example, when using PostgreSQL client libraries to connect to a CockroachDB, the `db.system` is set to `postgresql` based on the instrumentation's best knowledge. + + This attribute has stability level RELEASE CANDIDATE. type: members: - id: other_sql @@ -235,8 +255,8 @@ groups: stability: experimental - id: mariadb value: "mariadb" - brief: "MariaDB" - stability: experimental + brief: "MariaDB (This value has stability level RELEASE CANDIDATE)" + stability: experimental # RELEASE CANDIDATE - id: maxdb value: "maxdb" brief: "SAP MaxDB" @@ -251,8 +271,8 @@ groups: stability: experimental - id: mssql value: "mssql" - brief: "Microsoft SQL Server" - stability: experimental + brief: "Microsoft SQL Server (This value has stability level RELEASE CANDIDATE)" + stability: experimental # RELEASE CANDIDATE - id: mssqlcompact value: "mssqlcompact" deprecated: "Removed, use `other_sql` instead." @@ -260,8 +280,8 @@ groups: stability: experimental - id: mysql value: "mysql" - brief: "MySQL" - stability: experimental + brief: "MySQL (This value has stability level RELEASE CANDIDATE)" + stability: experimental # RELEASE CANDIDATE - id: neo4j value: "neo4j" brief: "Neo4j" @@ -288,8 +308,8 @@ groups: stability: experimental - id: postgresql value: "postgresql" - brief: "PostgreSQL" - stability: experimental + brief: "PostgreSQL (This value has stability level RELEASE CANDIDATE)" + stability: experimental # RELEASE CANDIDATE - id: progress value: "progress" brief: "Progress Database" @@ -326,7 +346,7 @@ groups: value: "vertica" brief: "Vertica" stability: experimental - stability: experimental + stability: experimental # RELEASE CANDIDATE - id: db.client.connection.state stability: experimental type: @@ -428,6 +448,7 @@ groups: - id: registry.db.cosmosdb type: attribute_group display_name: Azure Cosmos DB Attributes + stability: experimental brief: > This group defines attributes for Azure Cosmos DB. attributes: @@ -508,11 +529,6 @@ groups: type: int stability: experimental brief: Request payload size in bytes - - id: db.cosmosdb.status_code - type: int - stability: experimental - brief: Cosmos DB status code. - examples: [200, 201] - id: db.cosmosdb.sub_status_code type: int stability: experimental diff --git a/model/database/spans.yaml b/model/database/spans.yaml index 6e507c7fb6..cdac8e1059 100644 --- a/model/database/spans.yaml +++ b/model/database/spans.yaml @@ -2,6 +2,7 @@ groups: - id: trace.db.common.minimal extends: attributes.db.client.minimal type: attribute_group + stability: experimental brief: This group defines the attributes used to perform database client calls. attributes: # TODO: add db.system once https://github.com/open-telemetry/build-tools/issues/192 is possible @@ -9,6 +10,7 @@ groups: # sampling_relevant: true - ref: db.operation.name sampling_relevant: true + - ref: db.operation.batch.size - ref: server.address sampling_relevant: true - ref: server.port @@ -17,6 +19,7 @@ groups: - id: trace.db.common.query extends: trace.db.common.minimal type: attribute_group + stability: experimental brief: This group defines the attributes used to perform database client calls. attributes: - ref: db.query.text @@ -35,6 +38,7 @@ groups: - id: trace.db.common.query_and_collection extends: trace.db.common.minimal type: attribute_group + stability: experimental brief: This group defines the attributes used to perform database client calls. attributes: - ref: db.query.text @@ -54,6 +58,7 @@ groups: - id: trace.db.common.full type: attribute_group + stability: experimental brief: This group documents attributes that describe database call along with network information. extends: trace.db.common.query_and_collection attributes: @@ -78,40 +83,141 @@ groups: requirement_level: conditionally_required: If available. - - id: db type: span + stability: experimental brief: This span defines the attributes used to perform database client calls. span_kind: client extends: trace.db.common.full - id: db.mssql type: span + stability: experimental extends: db.sql brief: > Attributes for Microsoft SQL Server attributes: - ref: db.namespace sampling_relevant: true - brief: The name of the database, fully qualified within the server address and port. - note: - When connecting to a default instance, `db.namespace` SHOULD be set to the name of - the database. When connecting to a [named instance](https://learn.microsoft.com/sql/connect/jdbc/building-the-connection-url#named-and-multiple-sql-server-instances), + brief: > + The database associated with the connection, qualified by the instance name. + note: | + When connected to a default instance, `db.namespace` SHOULD be set to the name of + the database. When connected to a [named instance](https://learn.microsoft.com/sql/connect/jdbc/building-the-connection-url#named-and-multiple-sql-server-instances), `db.namespace` SHOULD be set to the combination of instance and database name following the `{instance_name}.{database_name}` pattern. - For commands that switch the database, this SHOULD be set to the target database (even if the command fails). + A connection's currently associated database may change during its lifetime, e.g. from executing `USE `. + + If instrumentation is unable to capture the connection's currently associated database on each query + without triggering an additional query to be executed (e.g. `SELECT DB_NAME()`), + then it is RECOMMENDED to fallback and use the database provided when the connection was established. + + Instrumentation SHOULD document if `db.namespace` reflects the database provided when the connection was established. + + It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. examples: ["instance1.products", "customers"] + - ref: db.response.status_code + brief: > + [Microsoft SQL Server error](https://learn.microsoft.com/sql/relational-databases/errors-events/database-engine-events-and-errors) number + represented as a string. + note: > + Microsoft SQL Server does not report SQLSTATE. + examples: ["102", "40020"] + + - id: db.postgresql + type: span + extends: db.sql + brief: > + Attributes for PostgreSQL + attributes: + - ref: db.namespace + sampling_relevant: true + brief: > + The schema associated with the connection, qualified by the database name. + note: | + `db.namespace` SHOULD be set to the combination of database and schema name following the `{database}.{schema}` pattern. + + A connection's currently associated database may change during its lifetime, e.g. from executing `SET search_path TO `. + If the search path has multiple schemas, the first schema in the search path SHOULD be used. + + If instrumentation is unable to capture the connection's currently associated schema on each query + without triggering an additional query to be executed (e.g. `SELECT current_schema()`), + then it is RECOMMENDED to fallback and use the schema provided when the connection was established. + + Instrumentation SHOULD document if `db.namespace` reflects the schema provided when the connection was established. + + Instrumentation MAY use the user name when the connection was established as a stand-in for the schema name. + + Instrumentation SHOULD document if `db.namespace` reflects the user provided when the connection was established. + + It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. + examples: ["mydatabase.products", "mydatabase.customers"] + - ref: db.response.status_code + brief: > + [PostgreSQL error code](https://www.postgresql.org/docs/current/errcodes-appendix.html). + examples: ["08000", "08P01"] + + - id: db.mysql + type: span + extends: db.sql + brief: > + Attributes for MySQL + attributes: + - ref: db.namespace + sampling_relevant: true + brief: The database associated with the connection. + note: | + A connection's currently associated database may change during its lifetime, e.g. from executing `USE `. + + If instrumentation is unable to capture the connection's currently associated database on each query + without triggering an additional query to be executed (e.g. `SELECT DATABASE()`), + then it is RECOMMENDED to fallback and use the database provided when the connection was established. + + Instrumentation SHOULD document if `db.namespace` reflects the database provided when the connection was established. + + It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. + examples: ["products", "customers"] + - ref: db.response.status_code + brief: > + [MySQL error number](https://dev.mysql.com/doc/mysql-errors/9.0/en/error-reference-introduction.html). + examples: ["1005", "MY-010016"] + + - id: db.mariadb + type: span + extends: db.sql + brief: > + Attributes for MariaDB + attributes: + - ref: db.namespace + sampling_relevant: true + brief: The database associated with the connection. + note: | + A connection's currently associated database may change during its lifetime, e.g. from executing `USE `. + + If instrumentation is unable to capture the connection's currently associated database on each query + without triggering an additional query to be executed (e.g. `SELECT DATABASE()`), + then it is RECOMMENDED to fallback and use the database provided when the connection was established. + + Instrumentation SHOULD document if `db.namespace` reflects the database provided when the connection was established. + + It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. + examples: ["products", "customers"] + - ref: db.response.status_code + brief: > + [Maria DB error code](https://mariadb.com/kb/en/mariadb-error-code-reference/) + represented as a string. + examples: ["1008", "3058"] - id: db.cassandra type: span + stability: experimental extends: trace.db.common.query_and_collection brief: > Attributes for Cassandra attributes: - ref: db.namespace sampling_relevant: true - brief: The Cassandra keyspace name. - note: For commands that switch the keyspace, this SHOULD be set to the target keyspace (even if the command fails). + brief: The keyspace associated with the session. examples: ["mykeyspace"] requirement_level: conditionally_required: If available. @@ -132,8 +238,13 @@ groups: - ref: network.peer.port requirement_level: recommended: if and only if `network.peer.address` is set. + - ref: db.response.status_code + brief: > + [Cassandra protocol error code](https://github.com/apache/cassandra/blob/cassandra-5.0/doc/native_protocol_v5.spec) represented as a string. + examples: ["102", "40020"] - id: db.hbase type: span + stability: experimental extends: trace.db.common.minimal brief: > Attributes for HBase @@ -143,10 +254,6 @@ groups: brief: The HBase namespace. requirement_level: conditionally_required: If applicable. - note: > - When performing table-related operations, the instrumentations SHOULD extract the namespace from the table name according to - the [HBase table naming conventions](https://hbase.apache.org/book.html#namespace_creation). If namespace is not provided, - instrumentation SHOULD set `db.namespace` value to `default`. examples: ['mynamespace'] - ref: db.collection.name sampling_relevant: true @@ -156,9 +263,15 @@ groups: note: > If table name includes the namespace, the `db.collection.name` SHOULD be set to the full table name. examples: ['mytable', 'ns:table'] - + - ref: db.response.status_code + brief: > + Protocol-specific response code recorded as string. + examples: ["200", "409", "14"] + requirement_level: + conditionally_required: If response was received. - id: db.couchdb type: span + stability: experimental extends: trace.db.common.minimal brief: > Attributes for CouchDB @@ -179,9 +292,16 @@ groups: requirement_level: conditionally_required: If available. note: "" # overriding the base note + - ref: db.response.status_code + brief: > + The HTTP response code returned by the Couch DB. + examples: ["200", "201", "429"] + requirement_level: + conditionally_required: If response was received and the HTTP response code is available. - id: db.redis type: span + stability: experimental extends: trace.db.common.query brief: > Attributes for Redis @@ -189,18 +309,17 @@ groups: - ref: db.namespace sampling_relevant: true brief: > - The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select) - (captured as a string). + The [database index] associated with the connection, represented as a string. requirement_level: conditionally_required: If and only if it can be captured reliably. - note: > - The database index for current connection can be changed by the application dynamically. Instrumentations MAY use - the initial database index provided in the connection string and keep track of the currently selected - database to capture the `db.namespace`. + note: | + A connection's currently associated database index may change during its lifetime, e.g. from executing `SELECT `. - Instrumentations SHOULD NOT set this attribute if capturing it would require additional network calls to Redis. + If instrumentation is unable to capture the connection's currently associated database index on each query + without triggering an additional query to be executed, + then it is RECOMMENDED to fallback and use the database index provided when the connection was established. - For commands that switch the database, this SHOULD be set to the target database (even if the command fails). + Instrumentation SHOULD document if `db.namespace` reflects the database index provided when the connection was established. examples: ["0", "1", "15"] - ref: db.query.text sampling_relevant: true @@ -219,9 +338,14 @@ groups: - ref: network.peer.port requirement_level: recommended: if and only if `network.peer.address` is set. + - ref: db.response.status_code + brief: > + The Redis [simple error](https://redis.io/docs/latest/develop/reference/protocol-spec/#simple-errors) prefix. + examples: ["ERR", "WRONGTYPE", "CLUSTERDOWN"] - id: db.mongodb type: span + stability: experimental extends: trace.db.common.minimal brief: > Attributes for MongoDB @@ -244,9 +368,16 @@ groups: requirement_level: conditionally_required: If available. note: "" # overriding the base note + - ref: db.response.status_code + brief: > + [MongoDB error code](https://www.mongodb.com/docs/manual/reference/error-codes/) represented as a string. + requirement_level: + conditionally_required: If the operation failed and error code is available. + examples: ["36", "11602"] - id: db.elasticsearch type: span + stability: experimental extends: trace.db.common.minimal brief: > Attributes for Elasticsearch @@ -293,9 +424,15 @@ groups: - ref: db.elasticsearch.path_parts requirement_level: conditionally_required: when the url has dynamic values - + - ref: db.response.status_code + brief: > + The HTTP response code returned by the Elasticsearch cluster. + examples: ["200", "201", "429"] + requirement_level: + conditionally_required: If response was received. - id: db.sql type: span + stability: experimental extends: trace.db.common.query_and_collection brief: > Attributes for SQL databases @@ -310,10 +447,13 @@ groups: brief: The name of the SQL table that the operation is acting upon. examples: ['users', 'dbo.products'] - ref: db.namespace + brief: > + The database associated with the connection, + fully qualified within the server address and port. requirement_level: - conditionally_required: If available. + conditionally_required: If available without an additional network call. note: | - If a database system has multiple namespace components, they SHOULD be concatenated + If a database system has multiple namespace components (e.g. schema name and database name), they SHOULD be concatenated (potentially using database system specific conventions) from most general to most specific namespace component, and more specific namespaces SHOULD NOT be captured without the more general namespaces, to ensure that "startswith" queries for the more general namespaces will be valid. @@ -321,19 +461,61 @@ groups: Unless specified by the system-specific semantic convention, the `db.namespace` attribute matches the name of the database being accessed. - The database name can usually be obtained with database driver API such as - [JDBC `Connection.getCatalog()`](https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html#getCatalog--) - or [.NET `SqlConnection.Database`](https://learn.microsoft.com/dotnet/api/system.data.sqlclient.sqlconnection.database). + A connection's currently associated database may change during its lifetime, e.g. from executing `USE `. - Some database drivers don't detect when the current database is changed (for example, with SQL `USE database` statement). - Instrumentations that parse SQL statements MAY use the database name provided - in the connection string and keep track of the currently selected database name. + If instrumentation is unable to capture the connection's currently associated database on each query + without triggering an additional query to be executed (e.g. `SELECT DATABASE()`), + then it is RECOMMENDED to fallback and use the database provided when the connection was established. - For commands that switch the database, this SHOULD be set to the target database (even if the command fails). + Instrumentation SHOULD document if `db.namespace` reflects the database provided when the connection was established. - If instrumentation cannot reliably determine the current database name, it SHOULD NOT set `db.namespace`. + It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. + - ref: db.response.status_code + brief: > + Database response code recorded as string. + note: | + SQL defines [SQLSTATE](https://wikipedia.org/wiki/SQLSTATE) as a database + return code which is adopted by some database systems like PostgreSQL. + See [PostgreSQL error codes](https://www.postgresql.org/docs/current/errcodes-appendix.html) + for the details. + + Other systems like MySQL, Oracle, or MS SQL Server define vendor-specific + error codes. Database SQL drivers usually provide access to both properties. + For example, in Java, the [`SQLException`](https://docs.oracle.com/javase/8/docs/api/java/sql/SQLException.html) + class reports them with `getSQLState()` and `getErrorCode()` methods. + + Instrumentations SHOULD populate the `db.response.status_code` with the + the most specific code available to them. + + Here's a non-exhaustive list of databases that report vendor-specific + codes with granularity higher than SQLSTATE (or don't report SQLSTATE + at all): + + - [DB2 SQL codes](https://www.ibm.com/docs/db2-for-zos/12?topic=codes-sql). + - [Maria DB error codes](https://mariadb.com/kb/en/mariadb-error-code-reference/) + - [Microsoft SQL Server errors](https://docs.microsoft.com/sql/relational-databases/errors-events/database-engine-events-and-errors) + - [MySQL error codes](https://dev.mysql.com/doc/mysql-errors/9.0/en/error-reference-introduction.html) + - [Oracle error codes](https://docs.oracle.com/cd/B28359_01/server.111/b28278/toc.htm) + - [SQLite result codes](https://www.sqlite.org/rescode.html) + + These systems SHOULD set the `db.response.status_code` to a + known vendor-specific error code. If only SQLSTATE is available, + it SHOULD be used. + + When multiple error codes are available and specificity is unclear, + instrumentation SHOULD set the `db.response.status_code` to the + concatenated string of all codes with '/' used as a separator. + + For example, generic DB instrumentation that detected an error and has + SQLSTATE `"42000"` and vendor-specific `1071` should set + `db.response.status_code` to `"42000/1071"`." + + examples: ["ORA-17027", "1052", "2201B"] + requirement_level: + conditionally_required: If response has ended with warning or an error. - id: db.cosmosdb type: span + stability: experimental extends: trace.db.common.query_and_collection brief: > Attributes for Cosmos DB. @@ -367,7 +549,10 @@ groups: requirement_level: conditionally_required: if available - ref: db.cosmosdb.request_content_length - - ref: db.cosmosdb.status_code + - ref: db.response.status_code + brief: > + Cosmos DB status code. + examples: ["200", "201"] requirement_level: conditionally_required: if response was received - ref: db.cosmosdb.sub_status_code diff --git a/model/device/events.yaml b/model/device/events.yaml index dbf3abceeb..6b980e0334 100644 --- a/model/device/events.yaml +++ b/model/device/events.yaml @@ -9,66 +9,69 @@ groups: This event identifies the fields that are common to all lifecycle events for android and iOS using the `android.state` and `ios.state` fields. The `android.state` and `ios.state` attributes are mutually exclusive. - # Future Note: When the build tools support this definition please uncomment and validate the details - # included here and what has been added to the manual markdown table - # body: - # fields: - # - id: ios.state - # stability: experimental - # requirement_level: - # conditional_required: if and only if `os.name` is `ios` - # note: > - # The iOS lifecycle states are defined in the [UIApplicationDelegate documentation](https://developer.apple.com/documentation/uikit/uiapplicationdelegate#1656902), - # and from which the `OS terminology` column values are derived. - # brief: > - # This attribute represents the state the application has transitioned into at the occurrence of the event. - # type: - # members: - # - id: active - # value: 'active' - # brief: > - # The app has become `active`. Associated with UIKit notification `applicationDidBecomeActive`. - # - id: inactive - # value: 'inactive' - # brief: > - # The app is now `inactive`. Associated with UIKit notification `applicationWillResignActive`. - # - id: background - # value: 'background' - # brief: > - # The app is now in the background. - # This value is associated with UIKit notification `applicationDidEnterBackground`. - # - id: foreground - # value: 'foreground' - # brief: > - # The app is now in the foreground. - # This value is associated with UIKit notification `applicationWillEnterForeground`. - # - id: terminate - # value: 'terminate' - # brief: > - # The app is about to terminate. Associated with UIKit notification `applicationWillTerminate`. - # - id: android.state - # stability: experimental - # requirement_level: - # conditional_required: if and only if `os.name` is `android` - # brief: > - # This attribute represents the state the application has transitioned into at the occurrence of the event. - # note: > - # The Android lifecycle states are defined in [Activity lifecycle callbacks](https://developer.android.com/guide/components/activities/activity-lifecycle#lc), - # and from which the `OS identifiers` are derived. - # type: - # members: - # - id: created - # value: 'created' - # brief: > - # Any time before Activity.onResume() or, if the app has no Activity, Context.startService() - # has been called in the app for the first time. - # - id: background - # value: 'background' - # brief: > - # Any time after Activity.onPause() or, if the app has no Activity, - # Context.stopService() has been called when the app was in the foreground state. - # - id: foreground - # value: 'foreground' - # brief: > - # Any time after Activity.onResume() or, if the app has no Activity, - # Context.startService() has been called when the app was in either the created or background states. + body: + id: device_lifecycle_state + type: map + requirement_level: required + fields: + - id: ios.state + stability: experimental + requirement_level: + conditionally_required: if and only if `os.name` is `ios` + note: > + The iOS lifecycle states are defined in the [UIApplicationDelegate documentation](https://developer.apple.com/documentation/uikit/uiapplicationdelegate#1656902), + and from which the `OS terminology` column values are derived. + brief: > + This attribute represents the state the application has transitioned into at the occurrence of the event. + examples: ["active"] + type: enum + members: + - id: active + value: 'active' + brief: > + The app has become `active`. Associated with UIKit notification `applicationDidBecomeActive`. + - id: inactive + value: 'inactive' + brief: > + The app is now `inactive`. Associated with UIKit notification `applicationWillResignActive`. + - id: background + value: 'background' + brief: > + The app is now in the background. + This value is associated with UIKit notification `applicationDidEnterBackground`. + - id: foreground + value: 'foreground' + brief: > + The app is now in the foreground. + This value is associated with UIKit notification `applicationWillEnterForeground`. + - id: terminate + value: 'terminate' + brief: > + The app is about to terminate. Associated with UIKit notification `applicationWillTerminate`. + - id: android.state + stability: experimental + requirement_level: + conditionally_required: if and only if `os.name` is `android` + brief: > + This attribute represents the state the application has transitioned into at the occurrence of the event. + note: > + The Android lifecycle states are defined in [Activity lifecycle callbacks](https://developer.android.com/guide/components/activities/activity-lifecycle#lc), + and from which the `OS identifiers` are derived. + examples: ["created"] + type: enum + members: + - id: created + value: 'created' + brief: > + Any time before Activity.onResume() or, if the app has no Activity, Context.startService() + has been called in the app for the first time. + - id: background + value: 'background' + brief: > + Any time after Activity.onPause() or, if the app has no Activity, + Context.stopService() has been called when the app was in the foreground state. + - id: foreground + value: 'foreground' + brief: > + Any time after Activity.onResume() or, if the app has no Activity, + Context.startService() has been called when the app was in either the created or background states. diff --git a/model/file/registry.yaml b/model/file/registry.yaml index 49049cdd6c..cf138ba9a3 100644 --- a/model/file/registry.yaml +++ b/model/file/registry.yaml @@ -20,7 +20,8 @@ groups: Attributes names depend on the OS or file system. Here’s a non-exhaustive list of values expected for this attribute: `archive`, `compressed`, `directory`, `encrypted`, `execute`, `hidden`, `immutable`, `journaled`, `read`, `readonly`, `symbolic link`, `system`, `temporary`, `write`. stability: experimental - examples: ['readonly', 'hidden'] + examples: + - ['readonly', 'hidden'] - id: file.created type: string brief: > diff --git a/model/gen-ai/deprecated/registry-deprecated.yaml b/model/gen-ai/deprecated/registry-deprecated.yaml index 04a2968a74..2115482f36 100644 --- a/model/gen-ai/deprecated/registry-deprecated.yaml +++ b/model/gen-ai/deprecated/registry-deprecated.yaml @@ -16,3 +16,15 @@ groups: deprecated: Replaced by `gen_ai.usage.output_tokens` attribute. brief: "Deprecated, use `gen_ai.usage.output_tokens` instead." examples: [42] + - id: gen_ai.prompt + type: string + stability: experimental + deprecated: "Removed, no replacement at this time." + brief: "Deprecated, use Event API to report prompt contents." + examples: ["[{'role': 'user', 'content': 'What is the capital of France?'}]"] + - id: gen_ai.completion + type: string + stability: experimental + deprecated: "Removed, no replacement at this time." + brief: "Deprecated, use Event API to report completions contents." + examples: ["[{'role': 'assistant', 'content': 'The capital of France is Paris.'}]"] diff --git a/model/gen-ai/events.yaml b/model/gen-ai/events.yaml new file mode 100644 index 0000000000..72a4e692f0 --- /dev/null +++ b/model/gen-ai/events.yaml @@ -0,0 +1,48 @@ +groups: + - id: gen_ai.common.event.attributes + type: attribute_group + stability: experimental + brief: > + Describes common Gen AI event attributes. + attributes: + - ref: gen_ai.system + + - id: gen_ai.system.message + name: gen_ai.system.message + type: event + stability: experimental + brief: > + This event describes the instructions passed to the GenAI system inside the prompt. + extends: gen_ai.common.event.attributes + + - id: gen_ai.user.message + name: gen_ai.user.message + type: event + stability: experimental + brief: > + This event describes the prompt message specified by the user. + extends: gen_ai.common.event.attributes + + - id: gen_ai.assistant.message + name: gen_ai.assistant.message + type: event + stability: experimental + brief: > + This event describes the assistant message passed to GenAI system or received from it. + extends: gen_ai.common.event.attributes + + - id: gen_ai.tool.message + name: gen_ai.tool.message + type: event + stability: experimental + brief: > + This event describes the tool or function response message. + extends: gen_ai.common.event.attributes + + - id: gen_ai.choice + name: gen_ai.choice + type: event + stability: experimental + brief: > + This event describes the Gen AI response message. + extends: gen_ai.common.event.attributes diff --git a/model/gen-ai/metrics.yaml b/model/gen-ai/metrics.yaml index 2c7035876c..35b5c979bc 100644 --- a/model/gen-ai/metrics.yaml +++ b/model/gen-ai/metrics.yaml @@ -13,7 +13,8 @@ groups: - ref: gen_ai.response.model requirement_level: recommended - ref: gen_ai.request.model - requirement_level: required + requirement_level: + conditionally_required: If available. - ref: gen_ai.system requirement_level: required - ref: gen_ai.operation.name @@ -30,6 +31,12 @@ groups: The `error.type` SHOULD match the error code returned by the Generative AI service, the canonical name of exception that occurred, or another low-cardinality error identifier. Instrumentations SHOULD document the list of errors they report. + - id: metric_attributes.gen_ai.openai + type: attribute_group + brief: 'This group describes GenAI server metrics attributes' + attributes: + - ref: gen_ai.openai.response.service_tier + requirement_level: recommended - id: metric.gen_ai.client.token.usage type: metric metric_name: gen_ai.client.token.usage diff --git a/model/gen-ai/registry.yaml b/model/gen-ai/registry.yaml index 1470ca1cb3..a1e86b75fc 100644 --- a/model/gen-ai/registry.yaml +++ b/model/gen-ai/registry.yaml @@ -25,6 +25,10 @@ groups: stability: experimental value: "cohere" brief: 'Cohere' + - id: az.ai.inference + stability: experimental + value: "az.ai.inference" + brief: 'Azure AI Inference' brief: The Generative AI product as identified by the client or server instrumentation. note: | The `gen_ai.system` describes a family of GenAI models with specific model identified @@ -119,18 +123,6 @@ groups: brief: 'Output tokens (completion, response, etc.)' brief: The type of token being counted. examples: ['input', 'output'] - - id: gen_ai.prompt - stability: experimental - type: string - brief: The full prompt sent to the GenAI model. - note: It's RECOMMENDED to format prompts as JSON string matching [OpenAI messages format](https://platform.openai.com/docs/guides/text-generation) - examples: ["[{'role': 'user', 'content': 'What is the capital of France?'}]"] - - id: gen_ai.completion - stability: experimental - type: string - brief: The full response received from the GenAI model. - note: It's RECOMMENDED to format completions as JSON string matching [OpenAI messages format](https://platform.openai.com/docs/guides/text-generation) - examples: ["[{'role': 'assistant', 'content': 'The capital of France is Paris.'}]"] - id: gen_ai.operation.name stability: experimental type: @@ -148,3 +140,51 @@ groups: If one of the predefined values applies, but specific system uses a different name it's RECOMMENDED to document it in the semantic conventions for specific GenAI system and use system-specific name in the instrumentation. If a different name is not documented, instrumentation libraries SHOULD use applicable predefined value. + - id: registry.gen_ai.openai + type: attribute_group + display_name: OpenAI Attributes + brief: > + Thie group defines attributes for OpenAI. + attributes: + - id: gen_ai.openai.request.seed + stability: experimental + type: int + brief: Requests with same seed value more likely to return same result. + examples: [100] + - id: gen_ai.openai.request.response_format + stability: experimental + type: + members: + - id: text + value: "text" + brief: 'Text response format' + stability: experimental + - id: json_object + value: "json_object" + brief: 'JSON object response format' + stability: experimental + - id: json_schema + value: "json_schema" + brief: 'JSON schema response format' + stability: experimental + brief: The response format that is requested. + examples: ['json'] + - id: gen_ai.openai.request.service_tier + stability: experimental + type: + members: + - id: auto + value: "auto" + brief: The system will utilize scale tier credits until they are exhausted. + stability: experimental + - id: default + value: "default" + brief: The system will utilize the default scale tier. + stability: experimental + brief: The service tier requested. May be a specific tier, detault, or auto. + examples: ['auto', 'default'] + - id: gen_ai.openai.response.service_tier + stability: experimental + type: string + brief: The service tier used for the response. + examples: ['scale', 'detault'] diff --git a/model/gen-ai/spans.yaml b/model/gen-ai/spans.yaml index 9345f4f249..79909f0f3c 100644 --- a/model/gen-ai/spans.yaml +++ b/model/gen-ai/spans.yaml @@ -1,13 +1,13 @@ groups: - - id: trace.gen_ai.client - type: span + - id: trace.gen_ai.client.common_attributes + type: attribute_group + stability: experimental brief: > Describes GenAI operation span. attributes: - - ref: gen_ai.system - requirement_level: required - ref: gen_ai.request.model - requirement_level: required + requirement_level: + conditionally_required: If available. note: > The name of the GenAI model a request is being made to. If the model is supplied by a vendor, then the value must be the exact name of the model requested. If the model is a fine-tuned @@ -20,8 +20,6 @@ groups: requirement_level: recommended - ref: gen_ai.request.top_p requirement_level: recommended - - ref: gen_ai.request.top_k - requirement_level: recommended - ref: gen_ai.request.stop_sequences requirement_level: recommended - ref: gen_ai.request.frequency_penalty @@ -56,32 +54,65 @@ groups: The `error.type` SHOULD match the error code returned by the Generative AI provider or the client library, the canonical name of exception that occurred, or another low-cardinality error identifier. Instrumentations SHOULD document the list of errors they report. + - id: trace.gen_ai.client.span + type: span + stability: experimental + brief: > + Describes GenAI operation span. + extends: trace.gen_ai.client.common_attributes + attributes: + - ref: gen_ai.system + # TODO: Not adding to trace.gen_ai.client.common_attributes because of https://github.com/open-telemetry/build-tools/issues/192 + requirement_level: required + - ref: gen_ai.request.top_k + requirement_level: recommended events: - gen_ai.content.prompt - gen_ai.content.completion - - id: gen_ai.content.prompt - name: gen_ai.content.prompt - type: event + - id: trace.gen_ai.openai.client + extends: trace.gen_ai.client.common_attributes + stability: experimental brief: > - In the lifetime of an GenAI span, events for prompts sent and completions received - may be created, depending on the configuration of the instrumentation. + Describes an OpenAI operation span. attributes: - - ref: gen_ai.prompt + - ref: gen_ai.request.model + requirement_level: required + - ref: gen_ai.openai.request.seed requirement_level: - conditionally_required: if and only if corresponding event is enabled - note: > - It's RECOMMENDED to format prompts as JSON string matching [OpenAI messages format](https://platform.openai.com/docs/guides/text-generation) + conditionally_required: if the request includes a seed + - ref: gen_ai.openai.request.response_format + requirement_level: + conditionally_required: if the request includes a response_format + - ref: gen_ai.openai.request.service_tier + requirement_level: + conditionally_required: if the request includes a service_tier and the value is not 'auto' + - ref: gen_ai.openai.response.service_tier + requirement_level: + conditionally_required: if the response was received and includes a service_tier + - ref: gen_ai.usage.input_tokens + brief: The number of tokens used in the prompt sent to OpenAI. + - ref: gen_ai.usage.output_tokens + brief: The number of tokens used in the completions from OpenAI. - - id: gen_ai.content.completion - name: gen_ai.content.completion - type: event + - id: trace.gen_ai.az.ai.inference.client + extends: trace.gen_ai.client.common_attributes + stability: experimental + type: attribute_group brief: > - In the lifetime of an GenAI span, events for prompts sent and completions received - may be created, depending on the configuration of the instrumentation. + Describes Azure AI Inference span attributes. attributes: - - ref: gen_ai.completion - requirement_level: - conditionally_required: if and only if corresponding event is enabled + - ref: az.namespace note: > - It's RECOMMENDED to format completions as JSON string matching [OpenAI messages format](https://platform.openai.com/docs/guides/text-generation) + When `az.namespace` attribute is populated, it MUST be set to `Microsoft.CognitiveServices` for all + operations performed by Azure AI Inference clients. + examples: ["Microsoft.CognitiveServices"] + - ref: gen_ai.usage.input_tokens + brief: > + The number of prompt tokens as reported in the usage prompt_tokens property of the response. + - ref: gen_ai.usage.output_tokens + brief: > + The number of completion tokens as reported in the usage completion_tokens property of the response. + - ref: server.port + requirement_level: + conditionally_required: If not default (443). diff --git a/model/hardware/common-metrics.yaml b/model/hardware/common-metrics.yaml index b975f53e18..9ae9de1cd8 100644 --- a/model/hardware/common-metrics.yaml +++ b/model/hardware/common-metrics.yaml @@ -1,6 +1,6 @@ groups: # COMMON METRICS - - id: metric.hardware.attributes + - id: metric.hw.attributes type: attribute_group brief: "Attributes for hardware metrics" extends: hardware.attributes.common @@ -8,23 +8,23 @@ groups: - ref: hw.type requirement_level: required - - id: metric.hardware.energy + - id: metric.hw.energy type: metric metric_name: hw.energy stability: experimental brief: "Energy consumed by the component" instrument: counter unit: "J" - extends: metric.hardware.attributes + extends: metric.hw.attributes - - id: metric.hardware.errors + - id: metric.hw.errors type: metric metric_name: hw.errors stability: experimental brief: "Number of errors encountered by the component" instrument: counter unit: "{error}" - extends: metric.hardware.attributes + extends: metric.hw.attributes attributes: - ref: error.type brief: "The type of error encountered by the component" @@ -35,7 +35,7 @@ groups: The `error.type` SHOULD match the error code reported by the component, the canonical name of the error, or another low-cardinality error identifier. Instrumentations SHOULD document the list of errors they report. - - id: metric.hardware.power + - id: metric.hw.power type: metric metric_name: hw.power stability: experimental @@ -44,16 +44,16 @@ groups: It is recommended to report `hw.energy` instead of `hw.power` when possible. instrument: gauge unit: "W" - extends: metric.hardware.attributes + extends: metric.hw.attributes - - id: metric.hardware.status + - id: metric.hw.status type: metric metric_name: hw.status stability: experimental brief: "Operational status: `1` (true) or `0` (false) for each of the possible states" instrument: updowncounter unit: "1" - extends: metric.hardware.attributes + extends: metric.hw.attributes note: > `hw.status` is currently specified as an *UpDownCounter* but would ideally be represented using a [*StateSet* as defined in OpenMetrics](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#stateset). diff --git a/model/http/deprecated/registry-deprecated.yaml b/model/http/deprecated/registry-deprecated.yaml index 1a1a0f3bbe..c39ae55d02 100644 --- a/model/http/deprecated/registry-deprecated.yaml +++ b/model/http/deprecated/registry-deprecated.yaml @@ -36,15 +36,15 @@ groups: examples: ['/search?q=OpenTelemetry#SemConv'] - id: http.request_content_length type: int - brief: 'Deprecated, use `http.request.header.content-length` instead.' + brief: 'Deprecated, use `http.request.header.` instead.' stability: experimental - deprecated: "Replaced by `http.request.header.content-length`." + deprecated: "Replaced by `http.request.header.`." examples: 3495 - id: http.response_content_length type: int - brief: 'Deprecated, use `http.response.header.content-length` instead.' + brief: 'Deprecated, use `http.response.header.` instead.' stability: experimental - deprecated: "Replaced by `http.response.header.content-length`." + deprecated: "Replaced by `http.response.header.`." examples: 3495 - id: http.client_ip type: string diff --git a/model/messaging/deprecated/metrics-deprecated.yaml b/model/messaging/deprecated/metrics-deprecated.yaml index c0746d70ab..e158a49ebc 100644 --- a/model/messaging/deprecated/metrics-deprecated.yaml +++ b/model/messaging/deprecated/metrics-deprecated.yaml @@ -48,3 +48,13 @@ groups: instrument: counter unit: "{message}" extends: attributes.messaging.common.minimal + + - id: metric.messaging.client.published.messages + type: metric + metric_name: messaging.client.published.messages + brief: "Deprecated. Use `messaging.client.sent.messages` instead." + deprecated: "Replaced by `messaging.client.sent.messages`." + stability: experimental + instrument: counter + unit: "{message}" + extends: metric.messaging.attributes diff --git a/model/messaging/deprecated/registry-deprecated.yaml b/model/messaging/deprecated/registry-deprecated.yaml index d5d7305429..a10affcf41 100644 --- a/model/messaging/deprecated/registry-deprecated.yaml +++ b/model/messaging/deprecated/registry-deprecated.yaml @@ -1,6 +1,7 @@ groups: - id: registry.messaging.deprecated type: attribute_group + stability: experimental display_name: Deprecated Messaging Attributes brief: "Describes deprecated messaging attributes." attributes: diff --git a/model/messaging/metrics.yaml b/model/messaging/metrics.yaml index 5dd4891fb9..c08868ef7b 100644 --- a/model/messaging/metrics.yaml +++ b/model/messaging/metrics.yaml @@ -61,12 +61,12 @@ groups: examples: ["process", "consume", "handle"] # counters - - id: metric.messaging.client.published.messages + - id: metric.messaging.client.sent.messages type: metric - metric_name: messaging.client.published.messages - brief: "Number of messages producer attempted to publish to the broker." + metric_name: messaging.client.sent.messages + brief: "Number of messages producer attempted to send to the broker." note: > - This metric MUST NOT count messages that were created haven't yet been attempted to be published. + This metric MUST NOT count messages that were created but haven't yet been sent. stability: experimental instrument: counter unit: "{message}" diff --git a/model/messaging/registry.yaml b/model/messaging/registry.yaml index 7adbba2bc9..74f0471838 100644 --- a/model/messaging/registry.yaml +++ b/model/messaging/registry.yaml @@ -1,6 +1,7 @@ groups: - id: registry.messaging type: attribute_group + stability: experimental display_name: General Messaging Attributes brief: 'Attributes describing telemetry around messaging systems and messaging activities.' attributes: @@ -102,17 +103,17 @@ groups: - id: messaging.operation.type type: members: - - id: publish - value: "publish" - brief: > - One or more messages are provided for publishing to an intermediary. - If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created. - stability: experimental - id: create value: "create" brief: > A message is created. - "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch publishing scenarios. + "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch sending scenarios. + stability: experimental + - id: send + value: "send" + brief: > + One or more messages are provided for sending to an intermediary. + If a single message is sent, the context of the "Send" span can be used as the creation context and no "Create" span needs to be created. stability: experimental - id: receive value: "receive" @@ -135,6 +136,11 @@ groups: brief: "Deprecated. Use `process` instead." deprecated: "Replaced by `process`." stability: experimental + - id: publish + value: "publish" + brief: "Deprecated. Use `send` instead." + deprecated: "Replaced by `send`." + stability: experimental stability: experimental brief: > diff --git a/model/messaging/spans.yaml b/model/messaging/spans.yaml index cc10819f8a..0ad91f4721 100644 --- a/model/messaging/spans.yaml +++ b/model/messaging/spans.yaml @@ -1,6 +1,7 @@ groups: - id: attributes.messaging.trace.minimal type: attribute_group + stability: experimental brief: > Defines minimal set of attributes used by all messaging systems. extends: attributes.messaging.common.minimal @@ -29,6 +30,7 @@ groups: - id: messaging type: span + stability: experimental brief: > Defines a full set of attributes used in messaging systems. extends: attributes.messaging.trace.minimal @@ -64,7 +66,9 @@ groups: sampling_relevant: true - ref: messaging.message.conversation_id - ref: messaging.message.envelope.size + requirement_level: opt_in - ref: messaging.message.body.size + requirement_level: opt_in - ref: messaging.batch.message_count requirement_level: conditionally_required: If the span describes an operation on a batch of messages. @@ -85,6 +89,7 @@ groups: - id: messaging.network.attributes type: attribute_group + stability: experimental brief: Attributes that describe messaging operation along with network information. extends: attributes.messaging.trace.minimal attributes: @@ -97,6 +102,7 @@ groups: - id: messaging.rabbitmq type: attribute_group + stability: experimental extends: messaging.network.attributes brief: > Attributes for RabbitMQ @@ -111,9 +117,11 @@ groups: brief: > Message [correlation Id](https://www.rabbitmq.com/tutorials/tutorial-six-java#correlation-id) property. - ref: messaging.message.body.size + requirement_level: opt_in - id: messaging.kafka type: attribute_group + stability: experimental extends: attributes.messaging.trace.minimal brief: > Attributes for Apache Kafka @@ -141,11 +149,12 @@ groups: conditionally_required: If the span describes an operation on a batch of messages. - ref: messaging.client.id - ref: messaging.message.body.size - requirement_level: - recommended: If span describes operation on a single message. + requirement_level: opt_in + brief: The size of the message body in bytes. Only applicable for spans describing single message operations. - id: messaging.rocketmq type: attribute_group + stability: experimental extends: attributes.messaging.trace.minimal brief: > Attributes for Apache RocketMQ @@ -172,6 +181,7 @@ groups: - ref: messaging.rocketmq.consumption_model - ref: messaging.client.id - ref: messaging.message.body.size + requirement_level: opt_in - ref: messaging.batch.message_count requirement_level: conditionally_required: If the span describes an operation on a batch of messages. @@ -208,6 +218,7 @@ groups: - `create` and `receive` for [common messaging operations](/docs/messaging/messaging-spans.md#operation-types) - id: messaging.servicebus type: attribute_group + stability: experimental extends: attributes.messaging.trace.minimal brief: > Attributes for Azure Service Bus @@ -248,6 +259,7 @@ groups: - id: messaging.eventhubs type: attribute_group + stability: experimental extends: attributes.messaging.trace.minimal brief: > Attributes for Azure Event Hubs diff --git a/model/system/metrics.yaml b/model/system/metrics.yaml index 583e421def..b2b79bf3b7 100644 --- a/model/system/metrics.yaml +++ b/model/system/metrics.yaml @@ -110,6 +110,9 @@ groups: unit: "By" attributes: - ref: system.paging.state + - ref: system.device + brief: Unique identifier for the device responsible for managing paging operations. + examples: ["/dev/dm-0"] - id: metric.system.paging.utilization type: metric @@ -120,6 +123,9 @@ groups: unit: "1" attributes: - ref: system.paging.state + - ref: system.device + brief: Unique identifier for the device responsible for managing paging operations. + examples: ["/dev/dm-0"] - id: metric.system.paging.faults type: metric diff --git a/package.json b/package.json index dc7296fb15..e62765487f 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "markdown-link-check": "3.11.2", "markdown-toc": "^1.2.0", "markdownlint": "0.35.0", - "markdownlint-cli": "0.41.0", + "markdownlint-cli": "0.42.0", "prettier": "^3.0.0", "through2": "^4.0.2" }, diff --git a/policies/compatibility.rego b/policies/compatibility.rego index 1b376a169e..5d3a1c6665 100644 --- a/policies/compatibility.rego +++ b/policies/compatibility.rego @@ -160,7 +160,7 @@ deny contains back_comp_violation(description, group_id, attr.name) if { some nmember in nattr.type.members member.id == nmember.id - # Enforce the policy + # Enforce the policy member.stability == "stable" nmember.stability != "stable" @@ -184,7 +184,7 @@ deny contains back_comp_violation(description, group_id, attr.name) if { some nmember in nattr.type.members member.id == nmember.id - # Enforce the policy + # Enforce the policy member.value != nmember.value # Generate human readable error. @@ -294,7 +294,7 @@ deny contains back_comp_violation(description, group_id, "") if { metric.stability == "stable" some nmetric in registry_metrics metric.metric_name = nmetric.metric_name - + baseline_attributes := { attr.name | some attr in metric.attributes not is_opt_in(attr) @@ -321,7 +321,7 @@ deny contains back_comp_violation(description, group_id, "") if { metric.stability == "stable" some nmetric in registry_metrics metric.metric_name = nmetric.metric_name - + baseline_attributes := { attr.name | some attr in metric.attributes not is_opt_in(attr) @@ -385,8 +385,9 @@ deny contains back_comp_violation(description, group_id, "") if { some resource in baseline_resources resource.stability == "stable" some nresource in registry_resources - resource.name = nresource.name - + resource.name == nresource.name + nresource.stability == "stable" # remove after https://github.com/open-telemetry/semantic-conventions/pull/1423 is merged + baseline_attributes := { attr.name | some attr in resource.attributes not is_opt_in(attr) diff --git a/schema-next.yaml b/schema-next.yaml index f16863d7df..400ff09ac0 100644 --- a/schema-next.yaml +++ b/schema-next.yaml @@ -2,6 +2,12 @@ file_format: 1.1.0 schema_url: https://opentelemetry.io/schemas/next versions: next: + 1.28.0: + metrics: + changes: + # https://github.com/open-telemetry/semantic-conventions/pull/1422 + - rename_metrics: + messaging.client.published.messages: messaging.client.sent.messages 1.27.0: all: changes: diff --git a/schemas/1.28.0 b/schemas/1.28.0 new file mode 100644 index 0000000000..2b1311aaf4 --- /dev/null +++ b/schemas/1.28.0 @@ -0,0 +1,511 @@ +file_format: 1.1.0 +schema_url: https://opentelemetry.io/schemas/1.28.0 +versions: + 1.28.0: + metrics: + changes: + # https://github.com/open-telemetry/semantic-conventions/pull/1422 + - rename_metrics: + messaging.client.published.messages: messaging.client.sent.messages + 1.27.0: + all: + changes: + # https://github.com/open-telemetry/semantic-conventions/pull/1216 + - rename_attributes: + attribute_map: + tls.client.server_name: server.address + # https://github.com/open-telemetry/semantic-conventions/pull/1075 + - rename_attributes: + attribute_map: + deployment.environment: deployment.environment.name + # https://github.com/open-telemetry/semantic-conventions/pull/1245 + - rename_attributes: + attribute_map: + messaging.kafka.message.offset: messaging.kafka.offset + # https://github.com/open-telemetry/semantic-conventions/pull/815 + - rename_attributes: + attribute_map: + messaging.kafka.consumer.group: messaging.consumer.group.name + messaging.rocketmq.client_group: messaging.consumer.group.name + messaging.evenhubs.consumer.group: messaging.consumer.group.name + message.servicebus.destination.subscription_name: messaging.destination.subscription.name + # https://github.com/open-telemetry/semantic-conventions/pull/1200 + - rename_attributes: + attribute_map: + gen_ai.usage.completion_tokens: gen_ai.usage.output_tokens + gen_ai.usage.prompt_tokens: gen_ai.usage.input_tokens + spans: + changes: + # https://github.com/open-telemetry/semantic-conventions/pull/1002 + - rename_attributes: + attribute_map: + db.elasticsearch.cluster.name: db.namespace + metrics: + changes: + # https://github.com/open-telemetry/semantic-conventions/pull/1125 + - rename_attributes: + attribute_map: + db.client.connections.state: db.client.connection.state + apply_to_metrics: + - db.client.connection.count + - rename_attributes: + attribute_map: + db.client.connections.pool.name: db.client.connection.pool.name + apply_to_metrics: + - db.client.connection.count + - db.client.connection.idle.max + - db.client.connection.idle.min + - db.client.connection.max + - db.client.connection.pending_requests + - db.client.connection.timeouts + - db.client.connection.create_time + - db.client.connection.wait_time + - db.client.connection.use_time + # https://github.com/open-telemetry/semantic-conventions/pull/1006 + - rename_metrics: + messaging.publish.messages: messaging.client.published.messages + # https://github.com/open-telemetry/semantic-conventions/pull/1026 + - rename_attributes: + attribute_map: + system.cpu.state: cpu.mode + process.cpu.state: cpu.mode + container.cpu.state: cpu.mode + apply_to_metrics: + - system.cpu.time + - system.cpu.utilization + - process.cpu.time + - process.cpu.utilization + - container.cpu.time + # https://github.com/open-telemetry/semantic-conventions/pull/1265 + - rename_metrics: + jvm.buffer.memory.usage: jvm.buffer.memory.used + 1.26.0: + metrics: + changes: + # https://github.com/open-telemetry/semantic-conventions/pull/966 + - rename_metrics: + db.client.connections.usage: db.client.connection.count + db.client.connections.idle.max: db.client.connection.idle.max + db.client.connections.idle.min: db.client.connection.idle.min + db.client.connections.max: db.client.connection.max + db.client.connections.pending_requests: db.client.connection.pending_requests + db.client.connections.timeouts: db.client.connection.timeouts + # https://github.com/open-telemetry/semantic-conventions/pull/948 + - rename_attributes: + attribute_map: + messaging.client_id: messaging.client.id + # https://github.com/open-telemetry/semantic-conventions/pull/909 + - rename_attributes: + attribute_map: + state: db.client.connections.state + apply_to_metrics: + - db.client.connections.usage + - rename_attributes: + attribute_map: + pool.name: db.client.connections.pool.name + apply_to_metrics: + - db.client.connections.usage + - db.client.connections.idle.max + - db.client.connections.idle.min + - db.client.connections.max + - db.client.connections.pending_requests + - db.client.connections.timeouts + - db.client.connections.create_time + - db.client.connections.wait_time + - db.client.connections.use_time + all: + changes: + # https://github:com/open-telemetry/semantic-conventions/pull/731/ + - rename_attributes: + attribute_map: + enduser.id: user.id + + 1.25.0: + spans: + changes: + # https://github.com/open-telemetry/semantic-conventions/pull/911 + - rename_attributes: + attribute_map: + db.name: db.namespace + # https://github.com/open-telemetry/semantic-conventions/pull/870 + - rename_attributes: + attribute_map: + db.sql.table: db.collection.name + db.mongodb.collection: db.collection.name + db.cosmosdb.container: db.collection.name + db.cassandra.table: db.collection.name + # https://github.com/open-telemetry/semantic-conventions/pull/798 + - rename_attributes: + attribute_map: + messaging.kafka.destination.partition: messaging.destination.partition.id + # https://github.com/open-telemetry/semantic-conventions/pull/875 + - rename_attributes: + attribute_map: + db.operation: db.operation.name + # https://github.com/open-telemetry/semantic-conventions/pull/913 + - rename_attributes: + attribute_map: + messaging.operation: messaging.operation.type + # https://github.com/open-telemetry/semantic-conventions/pull/866 + - rename_attributes: + attribute_map: + db.statement: db.query.text + metrics: + changes: + # https://github.com/open-telemetry/semantic-conventions/pull/484 + - rename_attributes: + attribute_map: + system.processes.status: system.process.status + apply_to_metrics: + - system.processes.count + - rename_metrics: + system.processes.count: system.process.count + system.processes.created: system.process.created + # https://github.com/open-telemetry/semantic-conventions/pull/625 + - rename_attributes: + attribute_map: + container.labels: container.label + k8s.pod.labels: k8s.pod.label + # https://github.com/open-telemetry/semantic-conventions/pull/330 + - rename_metrics: + process.threads: process.thread.count + process.open_file_descriptors: process.open_file_descriptor.count + - rename_attributes: + attribute_map: + state: process.cpu.state + apply_to_metrics: + - process.cpu.time + - process.cpu.utilization + - rename_attributes: + attribute_map: + direction: disk.io.direction + apply_to_metrics: + - process.disk.io + - rename_attributes: + attribute_map: + type: process.context_switch_type + apply_to_metrics: + - process.context_switches + - rename_attributes: + attribute_map: + direction: network.io.direction + apply_to_metrics: + - process.network.io + - rename_attributes: + attribute_map: + type: process.paging.fault_type + apply_to_metrics: + - process.paging.faults + all: + changes: + # https://github.com/open-telemetry/semantic-conventions/pull/854 + - rename_attributes: + attribute_map: + message.type: rpc.message.type + message.id: rpc.message.id + message.compressed_size: rpc.message.compressed_size + message.uncompressed_size: rpc.message.uncompressed_size + + 1.24.0: + metrics: + changes: + # https://github.com/open-telemetry/semantic-conventions/pull/536 + - rename_metrics: + jvm.memory.usage: jvm.memory.used + jvm.memory.usage_after_last_gc: jvm.memory.used_after_last_gc + # https://github.com/open-telemetry/semantic-conventions/pull/530 + - rename_attributes: + attribute_map: + system.network.io.direction: network.io.direction + system.disk.io.direction: disk.io.direction + 1.23.1: + 1.23.0: + metrics: + changes: + # https://github.com/open-telemetry/semantic-conventions/pull/20 + - rename_attributes: + attribute_map: + thread.daemon: jvm.thread.daemon + apply_to_metrics: + - jvm.thread.count + 1.22.0: + spans: + changes: + # https://github.com/open-telemetry/semantic-conventions/pull/229 + - rename_attributes: + attribute_map: + messaging.message.payload_size_bytes: messaging.message.body.size + # https://github.com/open-telemetry/opentelemetry-specification/pull/374 + - rename_attributes: + attribute_map: + http.resend_count: http.request.resend_count + metrics: + changes: + # https://github.com/open-telemetry/semantic-conventions/pull/224 + - rename_metrics: + http.client.duration: http.client.request.duration + http.server.duration: http.server.request.duration + # https://github.com/open-telemetry/semantic-conventions/pull/241 + - rename_metrics: + process.runtime.jvm.memory.usage: jvm.memory.usage + process.runtime.jvm.memory.committed: jvm.memory.committed + process.runtime.jvm.memory.limit: jvm.memory.limit + process.runtime.jvm.memory.usage_after_last_gc: jvm.memory.usage_after_last_gc + process.runtime.jvm.gc.duration: jvm.gc.duration + # also https://github.com/open-telemetry/semantic-conventions/pull/252 + process.runtime.jvm.threads.count: jvm.thread.count + # also https://github.com/open-telemetry/semantic-conventions/pull/252 + process.runtime.jvm.classes.loaded: jvm.class.loaded + # also https://github.com/open-telemetry/semantic-conventions/pull/252 + process.runtime.jvm.classes.unloaded: jvm.class.unloaded + # also https://github.com/open-telemetry/semantic-conventions/pull/252 + # and https://github.com/open-telemetry/semantic-conventions/pull/60 + process.runtime.jvm.classes.current_loaded: jvm.class.count + process.runtime.jvm.cpu.time: jvm.cpu.time + process.runtime.jvm.cpu.recent_utilization: jvm.cpu.recent_utilization + process.runtime.jvm.memory.init: jvm.memory.init + process.runtime.jvm.system.cpu.utilization: jvm.system.cpu.utilization + process.runtime.jvm.system.cpu.load_1m: jvm.system.cpu.load_1m + # https://github.com/open-telemetry/semantic-conventions/pull/253 + process.runtime.jvm.buffer.usage: jvm.buffer.memory.usage + # https://github.com/open-telemetry/semantic-conventions/pull/253 + process.runtime.jvm.buffer.limit: jvm.buffer.memory.limit + process.runtime.jvm.buffer.count: jvm.buffer.count + # https://github.com/open-telemetry/semantic-conventions/pull/20 + - rename_attributes: + attribute_map: + type: jvm.memory.type + pool: jvm.memory.pool.name + apply_to_metrics: + - jvm.memory.usage + - jvm.memory.committed + - jvm.memory.limit + - jvm.memory.usage_after_last_gc + - jvm.memory.init + - rename_attributes: + attribute_map: + name: jvm.gc.name + action: jvm.gc.action + apply_to_metrics: + - jvm.gc.duration + - rename_attributes: + attribute_map: + daemon: thread.daemon + apply_to_metrics: + - jvm.threads.count + - rename_attributes: + attribute_map: + pool: jvm.buffer.pool.name + apply_to_metrics: + - jvm.buffer.memory.usage + - jvm.buffer.memory.limit + - jvm.buffer.count + # https://github.com/open-telemetry/semantic-conventions/pull/89 + - rename_attributes: + attribute_map: + state: system.cpu.state + cpu: system.cpu.logical_number + apply_to_metrics: + - system.cpu.time + - system.cpu.utilization + - rename_attributes: + attribute_map: + state: system.memory.state + apply_to_metrics: + - system.memory.usage + - system.memory.utilization + - rename_attributes: + attribute_map: + state: system.paging.state + apply_to_metrics: + - system.paging.usage + - system.paging.utilization + - rename_attributes: + attribute_map: + type: system.paging.type + direction: system.paging.direction + apply_to_metrics: + - system.paging.faults + - system.paging.operations + - rename_attributes: + attribute_map: + device: system.device + direction: system.disk.direction + apply_to_metrics: + - system.disk.io + - system.disk.operations + - system.disk.io_time + - system.disk.operation_time + - system.disk.merged + - rename_attributes: + attribute_map: + device: system.device + state: system.filesystem.state + type: system.filesystem.type + mode: system.filesystem.mode + mountpoint: system.filesystem.mountpoint + apply_to_metrics: + - system.filesystem.usage + - system.filesystem.utilization + - rename_attributes: + attribute_map: + device: system.device + direction: system.network.direction + protocol: network.protocol + state: system.network.state + apply_to_metrics: + - system.network.dropped + - system.network.packets + - system.network.errors + - system.network.io + - system.network.connections + - rename_attributes: + attribute_map: + status: system.processes.status + apply_to_metrics: + - system.processes.count + # https://github.com/open-telemetry/semantic-conventions/pull/247 + - rename_metrics: + http.server.request.size: http.server.request.body.size + http.server.response.size: http.server.response.body.size + resources: + changes: + # https://github.com/open-telemetry/semantic-conventions/pull/178 + - rename_attributes: + attribute_map: + telemetry.auto.version: telemetry.distro.version + 1.21.0: + spans: + changes: + # https://github.com/open-telemetry/opentelemetry-specification/pull/3336 + - rename_attributes: + attribute_map: + messaging.kafka.client_id: messaging.client_id + messaging.rocketmq.client_id: messaging.client_id + # https://github.com/open-telemetry/opentelemetry-specification/pull/3402 + - rename_attributes: + attribute_map: + # net.peer.(name|port) attributes were usually populated on client side + # so they should be usually translated to server.(address|port) + # net.host.* attributes were only populated on server side + net.host.name: server.address + net.host.port: server.port + # was only populated on client side + net.sock.peer.name: server.socket.domain + # net.sock.peer.(addr|port) mapping is not possible + # since they applied to both client and server side + # were only populated on server side + net.sock.host.addr: server.socket.address + net.sock.host.port: server.socket.port + http.client_ip: client.address + # https://github.com/open-telemetry/opentelemetry-specification/pull/3426 + - rename_attributes: + attribute_map: + net.protocol.name: network.protocol.name + net.protocol.version: network.protocol.version + net.host.connection.type: network.connection.type + net.host.connection.subtype: network.connection.subtype + net.host.carrier.name: network.carrier.name + net.host.carrier.mcc: network.carrier.mcc + net.host.carrier.mnc: network.carrier.mnc + net.host.carrier.icc: network.carrier.icc + # https://github.com/open-telemetry/opentelemetry-specification/pull/3355 + - rename_attributes: + attribute_map: + http.method: http.request.method + http.status_code: http.response.status_code + http.scheme: url.scheme + http.url: url.full + http.request_content_length: http.request.body.size + http.response_content_length: http.response.body.size + metrics: + changes: + # https://github.com/open-telemetry/semantic-conventions/pull/53 + - rename_metrics: + process.runtime.jvm.cpu.utilization: process.runtime.jvm.cpu.recent_utilization + 1.20.0: + spans: + changes: + # https://github.com/open-telemetry/opentelemetry-specification/pull/3272 + - rename_attributes: + attribute_map: + net.app.protocol.name: net.protocol.name + net.app.protocol.version: net.protocol.version + 1.19.0: + spans: + changes: + # https://github.com/open-telemetry/opentelemetry-specification/pull/3209 + - rename_attributes: + attribute_map: + faas.execution: faas.invocation_id + # https://github.com/open-telemetry/opentelemetry-specification/pull/3188 + - rename_attributes: + attribute_map: + faas.id: cloud.resource_id + # https://github.com/open-telemetry/opentelemetry-specification/pull/3190 + - rename_attributes: + attribute_map: + http.user_agent: user_agent.original + resources: + changes: + # https://github.com/open-telemetry/opentelemetry-specification/pull/3190 + - rename_attributes: + attribute_map: + browser.user_agent: user_agent.original + 1.18.0: + 1.17.0: + spans: + changes: + # https://github.com/open-telemetry/opentelemetry-specification/pull/2957 + - rename_attributes: + attribute_map: + messaging.consumer_id: messaging.consumer.id + messaging.protocol: net.app.protocol.name + messaging.protocol_version: net.app.protocol.version + messaging.destination: messaging.destination.name + messaging.temp_destination: messaging.destination.temporary + messaging.destination_kind: messaging.destination.kind + messaging.message_id: messaging.message.id + messaging.conversation_id: messaging.message.conversation_id + messaging.message_payload_size_bytes: messaging.message.payload_size_bytes + messaging.message_payload_compressed_size_bytes: messaging.message.payload_compressed_size_bytes + messaging.rabbitmq.routing_key: messaging.rabbitmq.destination.routing_key + messaging.kafka.message_key: messaging.kafka.message.key + messaging.kafka.partition: messaging.kafka.destination.partition + messaging.kafka.tombstone: messaging.kafka.message.tombstone + messaging.rocketmq.message_type: messaging.rocketmq.message.type + messaging.rocketmq.message_tag: messaging.rocketmq.message.tag + messaging.rocketmq.message_keys: messaging.rocketmq.message.keys + messaging.kafka.consumer_group: messaging.kafka.consumer.group + 1.16.0: + 1.15.0: + spans: + changes: + # https://github.com/open-telemetry/opentelemetry-specification/pull/2743 + - rename_attributes: + attribute_map: + http.retry_count: http.resend_count + 1.14.0: + 1.13.0: + spans: + changes: + # https://github.com/open-telemetry/opentelemetry-specification/pull/2614 + - rename_attributes: + attribute_map: + net.peer.ip: net.sock.peer.addr + net.host.ip: net.sock.host.addr + 1.12.0: + 1.11.0: + 1.10.0: + 1.9.0: + 1.8.0: + spans: + changes: + - rename_attributes: + attribute_map: + db.cassandra.keyspace: db.name + db.hbase.namespace: db.name + 1.7.0: + 1.6.1: + 1.5.0: + 1.4.0: diff --git a/templates/registry/markdown/enum_macros.j2 b/templates/registry/markdown/enum_macros.j2 index b9e6c13bcf..4ffc10cbf0 100644 --- a/templates/registry/markdown/enum_macros.j2 +++ b/templates/registry/markdown/enum_macros.j2 @@ -5,7 +5,11 @@ | Value | Description | Stability | |---|---|---| -{% for espec in enum.type.members | sort(attribute='value') %}{% if filter(espec) == "True" %}| `{{ espec.value }}` | {{ (espec.brief or espec.id) | trim }}{{ notes.add(espec.note) }} | {{ stability.badge(espec.stability, espec.deprecated) }} | +{% for espec in enum.type.members | sort(attribute='value') %} +{%- if filter(espec) == "True" -%} +| `{{ espec.value }}` | {{ (espec.brief or espec.id) | trim }}{{ notes.add(espec.note) }} | {{ stability.badge(espec.stability, espec.deprecated) }} | {% endif %}{% endfor %}{{ notes.render() }}{% endmacro %} -{% macro tables(enums, notes) %}{% for enum in enums | sort(attribute="name") %}{{ table(enum, notes) }} +{% macro tables(enums, notes) -%} +{% for enum in enums | sort(attribute="name") -%} +{{ table(enum, notes) -}} {% endfor %}{% endmacro %} diff --git a/templates/registry/markdown/metric_table.j2 b/templates/registry/markdown/metric_table.j2 index 344804af1d..0d5e7a5714 100644 --- a/templates/registry/markdown/metric_table.j2 +++ b/templates/registry/markdown/metric_table.j2 @@ -4,5 +4,4 @@ {% macro generate(group) %}| Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | | `{{ group.metric_name }}` | {{ metrics.instrument(group.instrument) | trim }} | `{{ group.unit }}` | {{ group.brief | trim }}{{ notes.add(group.note) }} | {{ stability.badge(group.stability, group.deprecated) | trim }} | - {{ notes.render() }}{% endmacro %} diff --git a/templates/registry/markdown/notes.j2 b/templates/registry/markdown/notes.j2 index 11521536f4..e8946078ed 100644 --- a/templates/registry/markdown/notes.j2 +++ b/templates/registry/markdown/notes.j2 @@ -2,7 +2,8 @@ {%- macro add(note) %}{% if note %}{% set ns.notes = [ns.notes, [note]] | flatten %} [{{ ns.notes | length + ns.index }}]{% endif %}{% endmacro %} {%- macro add_with_limit(note) %}{% if note | length > 50 %}{% set ns.notes = [ns.notes, [note]] | flatten %} [{{ ns.notes | length + ns.index }}]{% elif note %} {{ note | trim }}{% endif %}{% endmacro %} {% macro render() %}{% if ns.notes | length > 0 %} -{% for note in ns.notes %}**[{{ns.index+loop.index}}]:** {{ note | trim }} - +{%- for note in ns.notes %} +**[{{ns.index+loop.index}}]:** {{ note | trim }} +{%- if not loop.last -%}{{"\n"}}{%- endif -%} {% endfor %}{% set ns.index = ns.notes | length + ns.index %}{% set ns.notes = [] %} {% endif %}{% endmacro %} diff --git a/templates/registry/markdown/snippet.md.j2 b/templates/registry/markdown/snippet.md.j2 index 3bf85fc194..4751cc65bf 100644 --- a/templates/registry/markdown/snippet.md.j2 +++ b/templates/registry/markdown/snippet.md.j2 @@ -3,8 +3,19 @@ -{% import 'attribute_table.j2' as at %}{% import 'metric_table.j2' as mt %}{% import 'event_macros.j2' as event %}{% import 'resource_macros.j2' as resource %} -{% if group.type == "event" %}{{ event.header(group) }}{% elif group.type == "resource" %}{{ resource.header(group) }}{% elif group.type=="metric" %}{{ mt.generate(group) }}{% endif %}{{ at.generate(group.attributes, tag_filter, attribute_registry_base_url, group.lineage.attributes) }} +{%- import 'attribute_table.j2' as at -%} +{%- import 'metric_table.j2' as mt -%} +{%- import 'event_macros.j2' as event -%} +{%- import 'resource_macros.j2' as resource %} + +{% if group.type == "event" -%} +{{ event.header(group) }} +{%- elif group.type == "resource" -%} +{{ resource.header(group) }} +{%- elif group.type=="metric" -%} +{{ mt.generate(group) }} +{% endif -%} +{{ at.generate(group.attributes, tag_filter, attribute_registry_base_url, group.lineage.attributes) -}} - \ No newline at end of file + diff --git a/templates/registry/markdown/weaver.yaml b/templates/registry/markdown/weaver.yaml index ef9bc5c120..104823f184 100644 --- a/templates/registry/markdown/weaver.yaml +++ b/templates/registry/markdown/weaver.yaml @@ -10,6 +10,7 @@ acronyms: - AWS - CICD - CloudEvents + - CloudFoundry - CLR - CPU - CSI