Skip to content

Commit

Permalink
Merge branch 'main' of github.com:open-telemetry/semantic-conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
sudarshan12s committed Mar 5, 2025
2 parents 70e327c + 78c42c5 commit e6a0f52
Show file tree
Hide file tree
Showing 112 changed files with 1,123 additions and 557 deletions.
5 changes: 5 additions & 0 deletions .chloggen/1646.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
change_type: breaking
component: code
note: "`code.function.name` value should contain the fully qualified function name, `code.namespace` is now deprecated"
issues: [1677]
subtext:
6 changes: 6 additions & 0 deletions .chloggen/1863.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
change_type: enhancement
component: db
note: Add database-specific notes on db.operation.name and db.collection.name for
Cassandra, Cosmos DB, HBase, MongoDB, and Redis, covering their batch/bulk
terms and lack of cross-table queries.
issues: [1863, 1573]
8 changes: 8 additions & 0 deletions .chloggen/1880.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
change_type: breaking
component: mobile
note: Rework `device.app.lifecycle` mobile event.
issues: [1880]
subtext: |
The `device.app.lifecycle` event has been reworked to use attributes instead
of event body fields. The `ios.app.state` and `android.app.state` attributes
have been reintroduced to the attribute registry.
5 changes: 5 additions & 0 deletions .chloggen/1888.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
change_type: enhancement
component: gen-ai
note: Adds `gen_ai.request.choice.count` span attribute
issues: [1888]
subtext: Enables recording target number of completions to generate
22 changes: 22 additions & 0 deletions .chloggen/cpu_namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Use this changelog template to create an entry for release notes.
#
# If your change doesn't affect end users you should instead start
# your pull request title with [chore] or use the "Skip Changelog" label.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: '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: Move CPU-related system.cpu.* metrics to CPU 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: [1873]

# (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:
7 changes: 7 additions & 0 deletions .chloggen/k8s-label-recommendations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
change_type: enhancement

component: k8s

note: How to populate resource attributes based on attributes, labels and transformation

issues: [236]
22 changes: 22 additions & 0 deletions .chloggen/process_executable_name.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Use this changelog template to create an entry for release notes.
#
# If your change doesn't affect end users you should instead start
# your pull request title with [chore] or use the "Skip Changelog" label.

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

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

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Adjust the semantic expectations for `process.executable.name`

# 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: [1736]

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

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

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

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Rename `db.system` to `db.system.name` in database metrics, and update the values to be consistent with database spans.

# 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: [1581]

# (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:
7 changes: 4 additions & 3 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@
/model/device/ @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-mobile-approvers

# K8s semantic conventions
/docs/resource/k8s.md @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-k8s-approvers
/model/k8s/ @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-k8s-approvers
/docs/non-normative/k8s-migration.md @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-k8s-approvers
/docs/resource/k8s.md @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-k8s-approvers
/model/k8s/ @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-k8s-approvers
/docs/non-normative/k8s-attributes.md @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-k8s-approvers
/docs/non-normative/k8s-migration.md @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-k8s-approvers

# Container semantic conventions
/docs/resource/container.md @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-container-approvers
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ body:
- area:heroku
- area:host
- area:http
- area:ios
- area:jvm
- area:k8s
- area:linux
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/change_proposal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ body:
- area:heroku
- area:host
- area:http
- area:ios
- area:jvm
- area:k8s
- area:linux
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/update-spec-repo-links.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# ./internal/tools/update-spec-repo-links.sh v1.41.0

# this version should be kept up-to-date with the spec version that links use
PREVIOUS_SPECIFICATION_VERSION=v1.41.0
PREVIOUS_SPECIFICATION_VERSION=v1.42.0

# Set this to the version number you want to KEEP in URLs in the repository.
LATEST_SPECIFICATION_VERSION=$1
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/fossa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: FOSSA scanning

on:
push:
branches:
- main

permissions:
contents: read

jobs:
fossa:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- uses: fossas/fossa-action@93a52ecf7c3ac7eb40f5de77fd69b1a19524de94 # v1.5.0
with:
api-key: ${{secrets.FOSSA_API_KEY}}
team: OpenTelemetry
65 changes: 48 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,50 @@ CONTAINER_REPOSITORY=docker.io
# Per container overrides for the repository resolution.
WEAVER_CONTAINER_REPOSITORY=$(CONTAINER_REPOSITORY)
SEMCONVGEN_CONTAINER_REPOSITORY=$(CONTAINER_REPOSITORY)
OPA_CONTAINER_REPOSITORY=$(CONTAINER_REPOSITORY)

# Fully qualified references to containers used in this Makefile.
# Versioned, non-qualified references to containers used in this Makefile.
# These are parsed from dependencies.Dockerfile so dependabot will autoupdate
# the versions of docker files we use.
WEAVER_CONTAINER=$(shell cat dependencies.Dockerfile | awk '$$4=="weaver" {print $$2}')
SEMCONVGEN_CONTAINER=$(shell cat dependencies.Dockerfile | awk '$$4=="semconvgen" {print $$2}')
OPA_CONTAINER=$(shell cat dependencies.Dockerfile | awk '$$4=="opa" {print $$2}')
VERSIONED_WEAVER_CONTAINER_NO_REPO=$(shell cat dependencies.Dockerfile | awk '$$4=="weaver" {print $$2}')
VERSIONED_SEMCONVGEN_CONTAINER_NO_REPO=$(shell cat dependencies.Dockerfile | awk '$$4=="semconvgen" {print $$2}')
VERSIONED_OPA_CONTAINER_NO_REPO=$(shell cat dependencies.Dockerfile | awk '$$4=="opa" {print $$2}')

# Fully qualified references to containers used in this Makefile. These
# include the container repository, so that the build will work with tools
# like "podman" with a default "/etc/containers/registries.conf", where
# a default respository of "docker.io" is not assumed. This is intended to
# eliminate errors from podman such as:
#
# Error: short-name "otel/weaver:v1.2.3" did not resolve to an alias
# and no unqualified-search registries are defined in "/etc/containers/registries.conf"
WEAVER_CONTAINER=$(WEAVER_CONTAINER_REPOSITORY)/$(VERSIONED_WEAVER_CONTAINER_NO_REPO)
SEMCONVGEN_CONTAINER=$(SEMCONVGEN_CONTAINER_REPOSITORY)/$(VERSIONED_SEMCONVGEN_CONTAINER_NO_REPO)
OPA_CONTAINER=$(OPA_CONTAINER_REPOSITORY)/$(VERSIONED_OPA_CONTAINER_NO_REPO)

DOCKER_USER=$(shell id -u):$(shell id -g)

CHECK_TARGETS=install-tools markdownlint misspell table-check compatibility-check \
schema-check check-file-and-folder-names-in-docs

# Determine if "docker" is actually podman
DOCKER_IS_PODMAN=$(docker --version | grep podman | wc -l)
ifeq ($(DOCKER_IS_PODMAN),0)
DOCKER_COMMAND=docker
else
DOCKER_COMMAND=podman
endif

DOCKER_RUN=$(DOCKER_COMMAND) run
DOCKER_USER=$(shell id -u):$(shell id -g)
DOCKER_USER_IS_HOST_USER_ARG=-u $(DOCKER_USER)
ifeq ($(DOCKER_COMMAND),podman)
# On podman, additional arguments are needed to make "-u" work
# correctly with the host user ID and host group ID.
#
# Error: OCI runtime error: crun: setgroups: Invalid argument
DOCKER_USER_IS_HOST_USER_ARG=--userns=keep-id -u $(DOCKER_USER)
endif


# TODO: add `yamllint` step to `all` after making sure it works on Mac.
.PHONY: all
Expand Down Expand Up @@ -81,7 +112,7 @@ normalized-link-check:

.PHONY: markdown-link-check
markdown-link-check: normalized-link-check
docker run --rm \
$(DOCKER_RUN) --rm \
--mount 'type=bind,source=$(PWD),target=/home/repo' \
lycheeverse/lychee \
--config home/repo/.lychee.toml \
Expand All @@ -92,7 +123,7 @@ markdown-link-check: normalized-link-check

.PHONY: markdown-link-check-changelog-preview
markdown-link-check-changelog-preview:
docker run --rm \
$(DOCKER_RUN) --rm \
--mount 'type=bind,source=$(PWD),target=/home/repo' \
lycheeverse/lychee \
--config /home/repo/.lychee.toml \
Expand Down Expand Up @@ -139,8 +170,8 @@ yamllint:
# Generate markdown tables from YAML definitions
.PHONY: table-generation
table-generation:
docker run --rm \
-u $(DOCKER_USER) \
$(DOCKER_RUN) --rm \
$(DOCKER_USER_IS_HOST_USER_ARG) \
--mount 'type=bind,source=$(PWD)/templates,target=/home/weaver/templates,readonly' \
--mount 'type=bind,source=$(PWD)/model,target=/home/weaver/source,readonly' \
--mount 'type=bind,source=$(PWD)/docs,target=/home/weaver/target' \
Expand All @@ -155,8 +186,8 @@ table-generation:
# Generate attribute registry markdown.
.PHONY: attribute-registry-generation
attribute-registry-generation:
docker run --rm \
-u $(DOCKER_USER) \
$(DOCKER_RUN) --rm \
$(DOCKER_USER_IS_HOST_USER_ARG) \
--mount 'type=bind,source=$(PWD)/templates,target=/home/weaver/templates,readonly' \
--mount 'type=bind,source=$(PWD)/model,target=/home/weaver/source,readonly' \
--mount 'type=bind,source=$(PWD)/docs,target=/home/weaver/target' \
Expand All @@ -169,7 +200,7 @@ attribute-registry-generation:
# Check if current markdown tables differ from the ones that would be generated from YAML definitions (weaver).
.PHONY: table-check
table-check:
docker run --rm \
$(DOCKER_RUN) --rm \
--mount 'type=bind,source=$(PWD)/templates,target=/home/weaver/templates,readonly' \
--mount 'type=bind,source=$(PWD)/model,target=/home/weaver/source,readonly' \
--mount 'type=bind,source=$(PWD)/docs,target=/home/weaver/target,readonly' \
Expand Down Expand Up @@ -228,8 +259,8 @@ chlog-update: $(CHLOGGEN)
.PHONY: generate-gh-issue-templates
generate-gh-issue-templates:
mkdir -p $(TOOLS_DIR)/bin
docker run --rm \
-u $(id -u ${USER}):$(id -g ${USER}) \
$(DOCKER_RUN) --rm \
$(DOCKER_USER_IS_HOST_USER_ARG) \
--mount 'type=bind,source=$(PWD)/internal/tools/scripts,target=/home/weaver/templates,readonly' \
--mount 'type=bind,source=$(PWD)/model,target=/home/weaver/source,readonly' \
--mount 'type=bind,source=$(TOOLS_DIR)/bin,target=/home/weaver/target' \
Expand Down Expand Up @@ -257,7 +288,7 @@ generate-gh-issue-templates:
LATEST_RELEASED_SEMCONV_VERSION := $(shell git ls-remote --tags https://github.com/open-telemetry/semantic-conventions.git | cut -f 2 | sort --reverse | head -n 1 | tr '/' ' ' | cut -d ' ' -f 3 | $(SED) 's/v//g')
.PHONY: check-policies
check-policies:
docker run --rm \
$(DOCKER_RUN) --rm \
--mount 'type=bind,source=$(PWD)/policies,target=/home/weaver/policies,readonly' \
--mount 'type=bind,source=$(PWD)/model,target=/home/weaver/source,readonly' \
${WEAVER_CONTAINER} registry check \
Expand All @@ -268,7 +299,7 @@ check-policies:
# Test rego policies
.PHONY: test-policies
test-policies:
docker run --rm -v $(PWD)/policies:/policies -v $(PWD)/policies_test:/policies_test \
$(DOCKER_RUN) --rm -v $(PWD)/policies:/policies -v $(PWD)/policies_test:/policies_test \
${OPA_CONTAINER} test \
--var-values \
--explain fails \
Expand All @@ -279,5 +310,5 @@ test-policies:
# once github action requirements are updated.
.PHONY: compatibility-check
compatibility-check:
docker run --rm -v $(PWD)/model:/source -v $(PWD)/docs:/spec --pull=always \
$(DOCKER_RUN) --rm -v $(PWD)/model:/source -v $(PWD)/docs:/spec --pull=always \
$(SEMCONVGEN_CONTAINER) --continue-on-validation-errors -f /source compatibility --previous-version $(LATEST_RELEASED_SEMCONV_VERSION)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.41.0-blue?logo=opentelemetry&color=f5a800)](https://github.com/open-telemetry/opentelemetry-specification/releases/tag/v1.41.0)
[![Specification Version](https://img.shields.io/badge/OTel_specification_version-v1.42.0-blue?logo=opentelemetry&color=f5a800)](https://github.com/open-telemetry/opentelemetry-specification/releases/tag/v1.42.0)

Semantic Conventions define a common set of (semantic) attributes which
provide meaning to data when collecting, producing and consuming it.
Expand Down
2 changes: 1 addition & 1 deletion dependencies.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
FROM otel/weaver:v0.13.2 AS weaver

# OPA is used to test policies enforced by weaver.
FROM openpolicyagent/opa:1.1.0 AS opa
FROM openpolicyagent/opa:1.2.0 AS opa

# Semconv gen is used for backwards compatibility checks.
# TODO(jsuereth): Remove this when no longer used.
Expand Down
17 changes: 15 additions & 2 deletions docs/attributes-registry/android.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,30 @@ The Android platform on which the Android application is running.

| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
| <a id="android-app-state" href="#android-app-state">`android.app.state`</a> | string | This attribute represents the state of the application. [1] | `created` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="android-os-api-level" href="#android-os-api-level">`android.os.api_level`</a> | 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` | ![Development](https://img.shields.io/badge/-development-blue) |

**[1] `android.app.state`:** 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.

---

`android.app.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 |
|---|---|---|
| `background` | 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. | ![Development](https://img.shields.io/badge/-development-blue) |
| `created` | Any time before Activity.onResume() or, if the app has no Activity, Context.startService() has been called in the app for the first time. | ![Development](https://img.shields.io/badge/-development-blue) |
| `foreground` | 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. | ![Development](https://img.shields.io/badge/-development-blue) |

## Deprecated Android Attributes

This document defines attributes that represents an occurrence of a lifecycle transition on the Android platform.

| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
| <a id="android-state" href="#android-state">`android.state`</a> | string | Deprecated use the `device.app.lifecycle` event definition including `android.state` as a payload field instead. [1] | `created`; `background`; `foreground` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `device.app.lifecycle`. |
| <a id="android-state" href="#android-state">`android.state`</a> | string | Deprecated. Use `android.app.state` instead. [2] | `created`; `background`; `foreground` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Renamed to `android.app.state` |

**[1] `android.state`:** 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.
**[2] `android.state`:** 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.

---

Expand Down
Loading

0 comments on commit e6a0f52

Please sign in to comment.