Skip to content

Commit

Permalink
update semconv to 1.26.0 (open-telemetry#1316)
Browse files Browse the repository at this point in the history
note that `messaging.client_id` was renamed to `messaging.client.id`, which causes a conflict in const name.
The recommendation from semconv maintainers is to replace the old value, `messaging.client_id`.
  • Loading branch information
brettmc authored Jun 28, 2024
1 parent 36f29a3 commit a822c45
Show file tree
Hide file tree
Showing 10 changed files with 833 additions and 151 deletions.
7 changes: 7 additions & 0 deletions script/semantic-conventions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ diff <(grep "public const" src/SemConv/TraceAttributes.php | sort -u) \

Use this output as a basis for updating the relevant deprecations file and generate a second time to include them in the final output.

Note that some previously-removed semconv entries have been added back in recent versions, so may need to be removed from the
deprecations partials.

## Add to SemConv/Version

Add an entry to `src/SemConv/Version.php` for the new version.

## Update tests

Update `tests/Integration/Config/configurations/kitchen-sink.yaml`'s `resource.schema_url` value to the latest, as merging resources
Expand Down
2 changes: 1 addition & 1 deletion script/semantic-conventions/semconv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ SPEC_DIR="${ROOT_DIR}/var/semantic-conventions"
CODE_DIR="${ROOT_DIR}/src/SemConv"

# freeze the spec & generator tools versions to make SemanticAttributes generation reproducible
SEMCONV_VERSION=${SEMCONV_VERSION:=1.25.0}
SEMCONV_VERSION=${SEMCONV_VERSION:=1.26.0}
SPEC_VERSION=v$SEMCONV_VERSION
SCHEMA_URL=https://opentelemetry.io/schemas/$SEMCONV_VERSION
GENERATOR_VERSION=0.24.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,13 @@
* @deprecated Use CONTAINER_IMAGE_TAGS
*/
public const CONTAINER_IMAGE_TAG = 'container.image.tag';

/**
* @deprecated Use `otel.scope.name`
*/
public const OTEL_LIBRARY_NAME = 'otel.library.name';

/**
* @deprecated Use `otel.scope.version`
*/
public const OTEL_LIBRARY_VERSION = 'otel.library.version';
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,11 @@
*/
public const FAAS_EXECUTION = 'faas.execution';

/**
* @deprecated
*/
public const HTTP_HOST = 'http.host';

/**
* @deprecated
*/
public const HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED = 'http.request_content_length_uncompressed';

/**
* @deprecated
*/
public const HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = 'http.response_content_length_uncompressed';

/**
* @deprecated
*/
public const HTTP_RETRY_COUNT = 'http.retry_count';

/**
* @deprecated
*/
public const HTTP_SERVER_NAME = 'http.server_name';

/**
* @deprecated
*/
Expand Down Expand Up @@ -73,21 +53,6 @@
*/
public const MESSAGING_URL = 'messaging.url';

/**
* @deprecated
*/
public const NET_HOST_IP = 'net.host.ip';

/**
* @deprecated
*/
public const NET_PEER_IP = 'net.peer.ip';

/**
* @deprecated
*/
public const HTTP_CLIENT_IP = 'http.client_ip';

/**
* @deprecated
*/
Expand Down
2 changes: 1 addition & 1 deletion src/SemConv/ResourceAttributeValues.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface ResourceAttributeValues
/**
* The URL of the OpenTelemetry schema for these keys and values.
*/
public const SCHEMA_URL = 'https://opentelemetry.io/schemas/1.25.0';
public const SCHEMA_URL = 'https://opentelemetry.io/schemas/1.26.0';
/**
* @see ResourceAttributes::AWS_ECS_LAUNCHTYPE ec2
*/
Expand Down
42 changes: 20 additions & 22 deletions src/SemConv/ResourceAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface ResourceAttributes
/**
* The URL of the OpenTelemetry schema for these keys and values.
*/
public const SCHEMA_URL = 'https://opentelemetry.io/schemas/1.25.0';
public const SCHEMA_URL = 'https://opentelemetry.io/schemas/1.26.0';

/**
* Uniquely identifies the framework API revision offered by a version (`os.version`) of the android operating system. More information can be found here.
Expand Down Expand Up @@ -254,7 +254,7 @@ interface ResourceAttributes
*
* Docker defines a sha256 of the image id; `container.image.id` corresponds to the `Image` field from the Docker container inspect API endpoint.
* K8s defines a link to the container registry repository with digest `"imageID": "registry.azurecr.io /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`.
* The ID is assinged by the container runtime and can vary in different environments. Consider using `oci.manifest.digest` if it is important to identify the same image in different environments/runtimes.
* The ID is assigned by the container runtime and can vary in different environments. Consider using `oci.manifest.digest` if it is important to identify the same image in different environments/runtimes.
*
* @example sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f
*/
Expand Down Expand Up @@ -625,11 +625,17 @@ interface ResourceAttributes

/**
* Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec.
*
* @example 2
*/
public const K8S_CONTAINER_RESTART_COUNT = 'k8s.container.restart_count';

/**
* Last terminated reason of the Container.
*
* @example Evicted
* @example Error
*/
public const K8S_CONTAINER_STATUS_LAST_TERMINATED_REASON = 'k8s.container.status.last_terminated_reason';

/**
* The name of the CronJob.
*
Expand Down Expand Up @@ -798,24 +804,6 @@ interface ResourceAttributes
*/
public const OS_VERSION = 'os.version';

/**
* None.
*
* @deprecated use the `otel.scope.name` attribute.
*
* @example io.opentelemetry.contrib.mongodb
*/
public const OTEL_LIBRARY_NAME = 'otel.library.name';

/**
* None.
*
* @deprecated use the `otel.scope.version` attribute.
*
* @example 1.0.0
*/
public const OTEL_LIBRARY_VERSION = 'otel.library.version';

/**
* The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP).
*
Expand Down Expand Up @@ -1052,4 +1040,14 @@ interface ResourceAttributes
* @deprecated Use CONTAINER_IMAGE_TAGS
*/
public const CONTAINER_IMAGE_TAG = 'container.image.tag';

/**
* @deprecated Use `otel.scope.name`
*/
public const OTEL_LIBRARY_NAME = 'otel.library.name';

/**
* @deprecated Use `otel.scope.version`
*/
public const OTEL_LIBRARY_VERSION = 'otel.library.version';
}
137 changes: 126 additions & 11 deletions src/SemConv/TraceAttributeValues.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface TraceAttributeValues
/**
* The URL of the OpenTelemetry schema for these keys and values.
*/
public const SCHEMA_URL = 'https://opentelemetry.io/schemas/1.25.0';
public const SCHEMA_URL = 'https://opentelemetry.io/schemas/1.26.0';
/**
* @see TraceAttributes::ANDROID_STATE Any time before Activity.onResume() or, if the app has no Activity, Context.startService() has been called in the app for the first time
*/
Expand All @@ -27,6 +27,26 @@ interface TraceAttributeValues
*/
public const ANDROID_STATE_FOREGROUND = 'foreground';

/**
* @see TraceAttributes::ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT Exception was handled by the exception handling middleware
*/
public const ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_HANDLED = 'handled';

/**
* @see TraceAttributes::ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT Exception was not handled by the exception handling middleware
*/
public const ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_UNHANDLED = 'unhandled';

/**
* @see TraceAttributes::ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT Exception handling was skipped because the response had started
*/
public const ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_SKIPPED = 'skipped';

/**
* @see TraceAttributes::ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT Exception handling didn&#39;t run because the request was aborted
*/
public const ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_ABORTED = 'aborted';

/**
* @see TraceAttributes::ASPNETCORE_RATE_LIMITING_RESULT Lease was acquired
*/
Expand All @@ -47,6 +67,26 @@ interface TraceAttributeValues
*/
public const ASPNETCORE_RATE_LIMITING_RESULT_REQUEST_CANCELED = 'request_canceled';

/**
* @see TraceAttributes::ASPNETCORE_ROUTING_MATCH_STATUS Match succeeded
*/
public const ASPNETCORE_ROUTING_MATCH_STATUS_SUCCESS = 'success';

/**
* @see TraceAttributes::ASPNETCORE_ROUTING_MATCH_STATUS Match failed
*/
public const ASPNETCORE_ROUTING_MATCH_STATUS_FAILURE = 'failure';

/**
* @see TraceAttributes::AWS_ECS_LAUNCHTYPE ec2
*/
public const AWS_ECS_LAUNCHTYPE_EC2 = 'ec2';

/**
* @see TraceAttributes::AWS_ECS_LAUNCHTYPE fargate
*/
public const AWS_ECS_LAUNCHTYPE_FARGATE = 'fargate';

/**
* @see TraceAttributes::CLOUD_PLATFORM Alibaba Cloud Elastic Compute Service
*/
Expand Down Expand Up @@ -292,6 +332,16 @@ interface TraceAttributeValues
*/
public const DB_CASSANDRA_CONSISTENCY_LEVEL_LOCAL_SERIAL = 'local_serial';

/**
* @see TraceAttributes::DB_CLIENT_CONNECTIONS_STATE idle
*/
public const DB_CLIENT_CONNECTIONS_STATE_IDLE = 'idle';

/**
* @see TraceAttributes::DB_CLIENT_CONNECTIONS_STATE used
*/
public const DB_CLIENT_CONNECTIONS_STATE_USED = 'used';

/**
* @see TraceAttributes::DB_COSMOSDB_CONNECTION_MODE Gateway (HTTP) connections mode
*/
Expand Down Expand Up @@ -717,6 +767,11 @@ interface TraceAttributeValues
*/
public const FAAS_TRIGGER_OTHER = 'other';

/**
* @see TraceAttributes::GEN_AI_SYSTEM OpenAI
*/
public const GEN_AI_SYSTEM_OPENAI = 'openai';

/**
* @see TraceAttributes::GRAPHQL_OPERATION_TYPE GraphQL query
*/
Expand Down Expand Up @@ -897,6 +952,36 @@ interface TraceAttributeValues
*/
public const JVM_MEMORY_TYPE_NON_HEAP = 'non_heap';

/**
* @see TraceAttributes::JVM_THREAD_STATE A thread that has not yet started is in this state
*/
public const JVM_THREAD_STATE_NEW = 'new';

/**
* @see TraceAttributes::JVM_THREAD_STATE A thread executing in the Java virtual machine is in this state
*/
public const JVM_THREAD_STATE_RUNNABLE = 'runnable';

/**
* @see TraceAttributes::JVM_THREAD_STATE A thread that is blocked waiting for a monitor lock is in this state
*/
public const JVM_THREAD_STATE_BLOCKED = 'blocked';

/**
* @see TraceAttributes::JVM_THREAD_STATE A thread that is waiting indefinitely for another thread to perform a particular action is in this state
*/
public const JVM_THREAD_STATE_WAITING = 'waiting';

/**
* @see TraceAttributes::JVM_THREAD_STATE A thread that is waiting for another thread to perform an action for up to a specified waiting time is in this state
*/
public const JVM_THREAD_STATE_TIMED_WAITING = 'timed_waiting';

/**
* @see TraceAttributes::JVM_THREAD_STATE A thread that has exited is in this state
*/
public const JVM_THREAD_STATE_TERMINATED = 'terminated';

/**
* @see TraceAttributes::LOG_IOSTREAM Logs from stdout stream
*/
Expand All @@ -918,29 +1003,29 @@ interface TraceAttributeValues
public const MESSAGE_TYPE_RECEIVED = 'RECEIVED';

/**
* @see TraceAttributes::MESSAGING_OPERATION One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the &#34;Publish&#34; span can be used as the creation context and no &#34;Create&#34; span needs to be created
* @see TraceAttributes::MESSAGING_OPERATION_TYPE One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the &#34;Publish&#34; span can be used as the creation context and no &#34;Create&#34; span needs to be created
*/
public const MESSAGING_OPERATION_PUBLISH = 'publish';
public const MESSAGING_OPERATION_TYPE_PUBLISH = 'publish';

/**
* @see TraceAttributes::MESSAGING_OPERATION A message is created. &#34;Create&#34; spans always refer to a single message and are used to provide a unique creation context for messages in batch publishing scenarios
* @see TraceAttributes::MESSAGING_OPERATION_TYPE A message is created. &#34;Create&#34; spans always refer to a single message and are used to provide a unique creation context for messages in batch publishing scenarios
*/
public const MESSAGING_OPERATION_CREATE = 'create';
public const MESSAGING_OPERATION_TYPE_CREATE = 'create';

/**
* @see TraceAttributes::MESSAGING_OPERATION 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
* @see TraceAttributes::MESSAGING_OPERATION_TYPE 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
*/
public const MESSAGING_OPERATION_RECEIVE = 'receive';
public const MESSAGING_OPERATION_TYPE_RECEIVE = 'receive';

/**
* @see TraceAttributes::MESSAGING_OPERATION One or more messages are delivered to or processed by a consumer
* @see TraceAttributes::MESSAGING_OPERATION_TYPE One or more messages are delivered to or processed by a consumer
*/
public const MESSAGING_OPERATION_DELIVER = 'process';
public const MESSAGING_OPERATION_TYPE_DELIVER = 'process';

/**
* @see TraceAttributes::MESSAGING_OPERATION One or more messages are settled
* @see TraceAttributes::MESSAGING_OPERATION_TYPE One or more messages are settled
*/
public const MESSAGING_OPERATION_SETTLE = 'settle';
public const MESSAGING_OPERATION_TYPE_SETTLE = 'settle';

/**
* @see TraceAttributes::MESSAGING_ROCKETMQ_CONSUMPTION_MODEL Clustering consumption model
Expand Down Expand Up @@ -1329,6 +1414,16 @@ interface TraceAttributeValues
*/
public const OTEL_STATUS_CODE_ERROR = 'ERROR';

/**
* @see TraceAttributes::PROCESS_CONTEXT_SWITCH_TYPE voluntary
*/
public const PROCESS_CONTEXT_SWITCH_TYPE_VOLUNTARY = 'voluntary';

/**
* @see TraceAttributes::PROCESS_CONTEXT_SWITCH_TYPE involuntary
*/
public const PROCESS_CONTEXT_SWITCH_TYPE_INVOLUNTARY = 'involuntary';

/**
* @see TraceAttributes::PROCESS_CPU_STATE system
*/
Expand All @@ -1344,6 +1439,16 @@ interface TraceAttributeValues
*/
public const PROCESS_CPU_STATE_WAIT = 'wait';

/**
* @see TraceAttributes::PROCESS_PAGING_FAULT_TYPE major
*/
public const PROCESS_PAGING_FAULT_TYPE_MAJOR = 'major';

/**
* @see TraceAttributes::PROCESS_PAGING_FAULT_TYPE minor
*/
public const PROCESS_PAGING_FAULT_TYPE_MINOR = 'minor';

/**
* @see TraceAttributes::RPC_CONNECT_RPC_ERROR_CODE cancelled
*/
Expand Down Expand Up @@ -1509,6 +1614,16 @@ interface TraceAttributeValues
*/
public const RPC_GRPC_STATUS_CODE_UNAUTHENTICATED = '16';

/**
* @see TraceAttributes::RPC_MESSAGE_TYPE sent
*/
public const RPC_MESSAGE_TYPE_SENT = 'SENT';

/**
* @see TraceAttributes::RPC_MESSAGE_TYPE received
*/
public const RPC_MESSAGE_TYPE_RECEIVED = 'RECEIVED';

/**
* @see TraceAttributes::RPC_SYSTEM gRPC
*/
Expand Down
Loading

0 comments on commit a822c45

Please sign in to comment.