From 8ddc72f11bd8d46576fa49c1e08dc2dd2119bd14 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Thu, 28 Aug 2025 20:22:20 -0700 Subject: [PATCH 1/9] Update internal semconv classes --- .../checkstyle-suppressions.xml | 20 + .../AzureMonitorLogRecordExporter.java | 4 +- .../implementation/LogDataMapper.java | 14 +- .../implementation/MetricDataMapper.java | 11 +- .../implementation/RequestChecker.java | 3 +- .../implementation/SemanticAttributes.java | 3696 ----------------- .../implementation/SpanDataMapper.java | 154 +- .../semconv/AttributeKeyTemplate.java | 125 + .../semconv/ClientAttributes.java | 47 + .../semconv/CodeAttributes.java | 88 + .../implementation/semconv/DbAttributes.java | 174 + .../semconv/ExceptionAttributes.java | 38 + .../semconv/HttpAttributes.java | 182 + .../semconv/NetworkAttributes.java | 117 + .../semconv/ServerAttributes.java | 47 + .../implementation/semconv/UrlAttributes.java | 118 + .../semconv/UserAgentAttributes.java | 29 + .../incubating/CodeIncubatingAttributes.java | 59 + .../incubating/DbIncubatingAttributes.java | 907 ++++ .../EnduserIncubatingAttributes.java | 73 + .../incubating/HttpIncubatingAttributes.java | 410 ++ .../MessagingIncubatingAttributes.java | 485 +++ .../incubating/NetIncubatingAttributes.java | 194 + .../incubating/PeerIncubatingAttributes.java | 34 + .../incubating/RpcIncubatingAttributes.java | 320 ++ .../ThreadIncubatingAttributes.java | 32 + .../incubating/UrlIncubatingAttributes.java | 170 + .../AzureMonitorMetricExporterTest.java | 4 +- 28 files changed, 3775 insertions(+), 3780 deletions(-) delete mode 100644 sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/SemanticAttributes.java create mode 100644 sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/AttributeKeyTemplate.java create mode 100644 sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/ClientAttributes.java create mode 100644 sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/CodeAttributes.java create mode 100644 sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/DbAttributes.java create mode 100644 sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/ExceptionAttributes.java create mode 100644 sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/HttpAttributes.java create mode 100644 sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/NetworkAttributes.java create mode 100644 sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/ServerAttributes.java create mode 100644 sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/UrlAttributes.java create mode 100644 sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/UserAgentAttributes.java create mode 100644 sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/CodeIncubatingAttributes.java create mode 100644 sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/DbIncubatingAttributes.java create mode 100644 sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/EnduserIncubatingAttributes.java create mode 100644 sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/HttpIncubatingAttributes.java create mode 100644 sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/MessagingIncubatingAttributes.java create mode 100644 sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/NetIncubatingAttributes.java create mode 100644 sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/PeerIncubatingAttributes.java create mode 100644 sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/RpcIncubatingAttributes.java create mode 100644 sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/ThreadIncubatingAttributes.java create mode 100644 sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/UrlIncubatingAttributes.java diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/checkstyle-suppressions.xml b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/checkstyle-suppressions.xml index 03532d38aee5..d93343c325dd 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/checkstyle-suppressions.xml +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/checkstyle-suppressions.xml @@ -95,6 +95,26 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/AzureMonitorLogRecordExporter.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/AzureMonitorLogRecordExporter.java index 64f2efb376b0..ee1dd532a76a 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/AzureMonitorLogRecordExporter.java +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/AzureMonitorLogRecordExporter.java @@ -5,7 +5,7 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.monitor.opentelemetry.autoconfigure.implementation.LogDataMapper; -import com.azure.monitor.opentelemetry.autoconfigure.implementation.SemanticAttributes; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.ExceptionAttributes; import com.azure.monitor.opentelemetry.autoconfigure.implementation.logging.OperationLogger; import com.azure.monitor.opentelemetry.autoconfigure.implementation.models.TelemetryItem; import com.azure.monitor.opentelemetry.autoconfigure.implementation.pipeline.TelemetryItemExporter; @@ -64,7 +64,7 @@ public CompletableResultCode export(Collection logs) { } LOGGER.verbose("exporting log: {}", log); try { - String stack = log.getAttributes().get(SemanticAttributes.EXCEPTION_STACKTRACE); + String stack = log.getAttributes().get(ExceptionAttributes.EXCEPTION_STACKTRACE); TelemetryItem telemetryItem = mapper.map(log, stack, null); telemetryItems.add(telemetryItem); if (quickPulse != null && quickPulse.isEnabled()) { diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/LogDataMapper.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/LogDataMapper.java index 49749ab49ec8..7a1f7a3521e6 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/LogDataMapper.java +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/LogDataMapper.java @@ -11,6 +11,8 @@ import com.azure.monitor.opentelemetry.autoconfigure.implementation.models.ContextTagKeys; import com.azure.monitor.opentelemetry.autoconfigure.implementation.models.SeverityLevel; import com.azure.monitor.opentelemetry.autoconfigure.implementation.models.TelemetryItem; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating.CodeIncubatingAttributes; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating.ThreadIncubatingAttributes; import com.azure.monitor.opentelemetry.autoconfigure.implementation.utils.FormattedTime; import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.common.Attributes; @@ -61,10 +63,10 @@ public class LogDataMapper { .prefix(LOG4J_MAP_MESSAGE_PREFIX, (telemetryBuilder, key, value) -> { telemetryBuilder.addProperty(key.substring(LOG4J_MAP_MESSAGE_PREFIX.length()), String.valueOf(value)); }) - .exactString(SemanticAttributes.CODE_FILEPATH, "FileName") - .exactString(SemanticAttributes.CODE_NAMESPACE, "ClassName") - .exactString(SemanticAttributes.CODE_FUNCTION, "MethodName") - .exactLong(SemanticAttributes.CODE_LINENO, "LineNumber") + .exactString(CodeIncubatingAttributes.CODE_FILEPATH, "FileName") + .exactString(CodeIncubatingAttributes.CODE_NAMESPACE, "ClassName") + .exactString(CodeIncubatingAttributes.CODE_FUNCTION, "MethodName") + .exactLong(CodeIncubatingAttributes.CODE_LINENO, "LineNumber") .exactString(LOG4J_MARKER, "Marker") .exactStringArray(LOGBACK_MARKER, "Marker"); @@ -146,7 +148,7 @@ private TelemetryItem createMessageTelemetryItem(LogRecordData log, Attributes a // set message-specific properties setLoggerProperties(telemetryBuilder, log.getInstrumentationScopeInfo().getName(), - attributes.get(SemanticAttributes.THREAD_NAME), log.getSeverity()); + attributes.get(ThreadIncubatingAttributes.THREAD_NAME), log.getSeverity()); return telemetryBuilder.build(); } @@ -169,7 +171,7 @@ private TelemetryItem createExceptionTelemetryItem(LogRecordData log, String sta // set exception-specific properties setLoggerProperties(telemetryBuilder, log.getInstrumentationScopeInfo().getName(), - attributes.get(SemanticAttributes.THREAD_NAME), log.getSeverity()); + attributes.get(ThreadIncubatingAttributes.THREAD_NAME), log.getSeverity()); if (log.getBody() != null) { telemetryBuilder.addProperty("Logger Message", log.getBody().asString()); diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/MetricDataMapper.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/MetricDataMapper.java index f54f84c8e128..e02b69374e1d 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/MetricDataMapper.java +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/MetricDataMapper.java @@ -12,6 +12,11 @@ import com.azure.monitor.opentelemetry.autoconfigure.implementation.models.TelemetryItem; import com.azure.monitor.opentelemetry.autoconfigure.implementation.preaggregatedmetrics.DependencyExtractor; import com.azure.monitor.opentelemetry.autoconfigure.implementation.preaggregatedmetrics.RequestExtractor; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.HttpAttributes; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating.RpcIncubatingAttributes; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.UrlAttributes; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating.HttpIncubatingAttributes; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating.UrlIncubatingAttributes; import com.azure.monitor.opentelemetry.autoconfigure.implementation.utils.FormattedTime; import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.common.Attributes; @@ -176,7 +181,7 @@ public static void updateMetricPointBuilder(MetricTelemetryBuilder metricTelemet Attributes attributes = pointData.getAttributes(); if (isPreAggregatedStandardMetric) { Long statusCode = SpanDataMapper.getStableOrOldAttribute(attributes, - SemanticAttributes.HTTP_RESPONSE_STATUS_CODE, SemanticAttributes.HTTP_STATUS_CODE); + HttpAttributes.HTTP_RESPONSE_STATUS_CODE, HttpIncubatingAttributes.HTTP_STATUS_CODE); boolean success = isSuccess(metricData.getName(), statusCode, captureHttpServer4xxAsError); Boolean isSynthetic = attributes.get(AiSemanticAttributes.IS_SYNTHETIC); @@ -191,9 +196,9 @@ public static void updateMetricPointBuilder(MetricTelemetryBuilder metricTelemet if (metricData.getName().startsWith("http")) { dependencyType = "Http"; defaultPort = getDefaultPortForHttpScheme(SpanDataMapper.getStableOrOldAttribute(attributes, - SemanticAttributes.URL_SCHEME, SemanticAttributes.HTTP_SCHEME)); + UrlAttributes.URL_SCHEME, UrlIncubatingAttributes.URL_SCHEME)); } else { - dependencyType = attributes.get(SemanticAttributes.RPC_SYSTEM); + dependencyType = attributes.get(RpcIncubatingAttributes.RPC_SYSTEM); if (dependencyType == null) { // rpc.system is required by the semantic conventions dependencyType = "Unknown"; diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/RequestChecker.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/RequestChecker.java index f348c91a043d..e9777069e7e2 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/RequestChecker.java +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/RequestChecker.java @@ -12,6 +12,7 @@ import java.util.function.Function; import static com.azure.monitor.opentelemetry.autoconfigure.implementation.AiSemanticAttributes.JOB_SYSTEM; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating.MessagingIncubatingAttributes; public final class RequestChecker { @@ -34,7 +35,7 @@ public static boolean isRequest(SpanKind kind, SpanContext parentSpanContext, } else if (kind == SpanKind.CLIENT || kind == SpanKind.PRODUCER) { return false; } else if (kind == SpanKind.CONSUMER - && "receive".equals(attrFn.apply(SemanticAttributes.MESSAGING_OPERATION))) { + && "receive".equals(attrFn.apply(MessagingIncubatingAttributes.MESSAGING_OPERATION))) { return false; } else if (kind == SpanKind.SERVER || kind == SpanKind.CONSUMER) { return true; diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/SemanticAttributes.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/SemanticAttributes.java deleted file mode 100644 index 4d859ffc63e2..000000000000 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/SemanticAttributes.java +++ /dev/null @@ -1,3696 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -/* - * Copyright The OpenTelemetry Authors - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.azure.monitor.opentelemetry.autoconfigure.implementation; - -import io.opentelemetry.api.common.AttributeKey; - -import java.util.List; - -import static com.azure.monitor.opentelemetry.autoconfigure.implementation.AttributeKeyTemplate.stringArrayKeyTemplate; -import static com.azure.monitor.opentelemetry.autoconfigure.implementation.AttributeKeyTemplate.stringKeyTemplate; -import static io.opentelemetry.api.common.AttributeKey.booleanKey; -import static io.opentelemetry.api.common.AttributeKey.doubleKey; -import static io.opentelemetry.api.common.AttributeKey.longKey; -import static io.opentelemetry.api.common.AttributeKey.stringArrayKey; -import static io.opentelemetry.api.common.AttributeKey.stringKey; - -// this is a copy of io.opentelemetry.semconv.SemanticAttributes (1.23.1-alpha) -// because the module that contains that class is not stable, -// so don't want to take a dependency on it - -// DO NOT EDIT, this is an Auto-generated file from -// buildscripts/templates/SemanticAttributes.java.j2 - -@SuppressWarnings("unused") -public final class SemanticAttributes { - /** The URL of the OpenTelemetry schema for these keys and values. */ - public static final String SCHEMA_URL = "https://opentelemetry.io/schemas/1.23.1"; - - /** - * Client address - domain name if available without reverse DNS lookup; otherwise, IP address or - * Unix domain socket name. - * - *

Notes: - * - *

    - *
  • When observed from the server side, and when communicating through an intermediary, - * {@code client.address} SHOULD represent the client address behind any intermediaries, for - * example proxies, if it's available. - *
- */ - public static final AttributeKey CLIENT_ADDRESS = stringKey("client.address"); - - /** - * Client port number. - * - *

Notes: - * - *

    - *
  • When observed from the server side, and when communicating through an intermediary, - * {@code client.port} SHOULD represent the client port behind any intermediaries, for - * example proxies, if it's available. - *
- */ - public static final AttributeKey CLIENT_PORT = longKey("client.port"); - - /** - * Destination address - domain name if available without reverse DNS lookup; otherwise, IP - * address or Unix domain socket name. - * - *

Notes: - * - *

    - *
  • When observed from the source side, and when communicating through an intermediary, - * {@code destination.address} SHOULD represent the destination address behind any - * intermediaries, for example proxies, if it's available. - *
- */ - public static final AttributeKey DESTINATION_ADDRESS = stringKey("destination.address"); - - /** Destination port number */ - public static final AttributeKey DESTINATION_PORT = longKey("destination.port"); - - /** - * Describes a class of error the operation ended with. - * - *

Notes: - * - *

    - *
  • The {@code error.type} SHOULD be predictable and SHOULD have low cardinality. - * Instrumentations SHOULD document the list of errors they report. - *
  • The cardinality of {@code error.type} within one instrumentation library SHOULD be low. - * Telemetry consumers that aggregate data from multiple instrumentation libraries and - * applications should be prepared for {@code error.type} to have high cardinality at query - * time when no additional filters are applied. - *
  • If the operation has completed successfully, instrumentations SHOULD NOT set {@code - * error.type}. - *
  • If a specific domain defines its own set of error identifiers (such as HTTP or gRPC - * status codes), it's RECOMMENDED to: - *
  • Use a domain-specific attribute - *
  • Set {@code error.type} to capture all errors, regardless of whether they are defined - * within the domain-specific set or not. - *
- */ - public static final AttributeKey ERROR_TYPE = stringKey("error.type"); - - /** The exception message. */ - public static final AttributeKey EXCEPTION_MESSAGE = stringKey("exception.message"); - - /** - * 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. - */ - public static final AttributeKey EXCEPTION_STACKTRACE = stringKey("exception.stacktrace"); - - /** - * The type of the exception (its fully-qualified class name, if applicable). The dynamic type of - * the exception should be preferred over the static type in languages that support it. - */ - public static final AttributeKey EXCEPTION_TYPE = stringKey("exception.type"); - - /** - * The name of the invoked function. - * - *

Notes: - * - *

    - *
  • SHOULD be equal to the {@code faas.name} resource attribute of the invoked function. - *
- */ - public static final AttributeKey FAAS_INVOKED_NAME = stringKey("faas.invoked_name"); - - /** - * The cloud provider of the invoked function. - * - *

Notes: - * - *

    - *
  • SHOULD be equal to the {@code cloud.provider} resource attribute of the invoked function. - *
- */ - public static final AttributeKey FAAS_INVOKED_PROVIDER = stringKey("faas.invoked_provider"); - - /** - * The cloud region of the invoked function. - * - *

Notes: - * - *

    - *
  • SHOULD be equal to the {@code cloud.region} resource attribute of the invoked function. - *
- */ - public static final AttributeKey FAAS_INVOKED_REGION = stringKey("faas.invoked_region"); - - /** Type of the trigger which caused this function invocation. */ - public static final AttributeKey FAAS_TRIGGER = stringKey("faas.trigger"); - - /** - * The {@code service.name} of the remote service. - * SHOULD be equal to the actual {@code service.name} resource attribute of the remote service if - * any. - */ - public static final AttributeKey PEER_SERVICE = stringKey("peer.service"); - - /** - * Username or client_id extracted from the access token or Authorization header in the inbound - * request from outside the system. - */ - public static final AttributeKey ENDUSER_ID = stringKey("enduser.id"); - - public static final AttributeKey ENDUSER_PSEUDO_ID = stringKey("enduser.pseudo.id"); - - /** - * Actual/assumed role the client is making the request under extracted from token or application - * security context. - */ - public static final AttributeKey ENDUSER_ROLE = stringKey("enduser.role"); - - /** - * Scopes or granted authorities the client currently possesses extracted from token or - * application security context. The value would come from the scope associated with an OAuth 2.0 Access Token or an - * attribute value in a SAML - * 2.0 Assertion. - */ - public static final AttributeKey ENDUSER_SCOPE = stringKey("enduser.scope"); - - /** - * The domain identifies the business context for the events. - * - *

Notes: - * - *

    - *
  • Events across different domains may have same {@code event.name}, yet be unrelated - * events. - *
- */ - public static final AttributeKey EVENT_DOMAIN = stringKey("event.domain"); - - /** The name identifies the event. */ - public static final AttributeKey EVENT_NAME = stringKey("event.name"); - - /** - * A unique identifier for the Log Record. - * - *

Notes: - * - *

    - *
  • 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), but other identifiers (e.g. - * UUID) may be used as needed. - *
- */ - public static final AttributeKey LOG_RECORD_UID = stringKey("log.record.uid"); - - /** The stream associated with the log. See below for a list of well-known values. */ - public static final AttributeKey LOG_IOSTREAM = stringKey("log.iostream"); - - /** The basename of the file. */ - public static final AttributeKey LOG_FILE_NAME = stringKey("log.file.name"); - - /** The basename of the file, with symlinks resolved. */ - public static final AttributeKey LOG_FILE_NAME_RESOLVED = stringKey("log.file.name_resolved"); - - /** The full path to the file. */ - public static final AttributeKey LOG_FILE_PATH = stringKey("log.file.path"); - - /** The full path to the file, with symlinks resolved. */ - public static final AttributeKey LOG_FILE_PATH_RESOLVED = stringKey("log.file.path_resolved"); - - /** - * This attribute represents the state the application has transitioned into at the occurrence of - * the event. - * - *

Notes: - * - *

- */ - public static final AttributeKey IOS_STATE = stringKey("ios.state"); - - /** - * This attribute represents the state the application has transitioned into at the occurrence of - * the event. - * - *

Notes: - * - *

- */ - public static final AttributeKey ANDROID_STATE = stringKey("android.state"); - - /** - * The name of the connection pool; unique within the instrumented application. In case the - * connection pool implementation doesn't provide a name, then the db.connection_string - * should be used - */ - public static final AttributeKey POOL_NAME = stringKey("pool.name"); - - /** The state of a connection in the pool */ - public static final AttributeKey STATE = stringKey("state"); - - /** - * Name of the buffer pool. - * - *

Notes: - * - *

- */ - public static final AttributeKey JVM_BUFFER_POOL_NAME = stringKey("jvm.buffer.pool.name"); - - /** - * Name of the memory pool. - * - *

Notes: - * - *

- */ - public static final AttributeKey JVM_MEMORY_POOL_NAME = stringKey("jvm.memory.pool.name"); - - /** The type of memory. */ - public static final AttributeKey JVM_MEMORY_TYPE = stringKey("jvm.memory.type"); - - /** - * Name of the garbage collector action. - * - *

Notes: - * - *

- */ - public static final AttributeKey JVM_GC_ACTION = stringKey("jvm.gc.action"); - - /** - * Name of the garbage collector. - * - *

Notes: - * - *

- */ - public static final AttributeKey JVM_GC_NAME = stringKey("jvm.gc.name"); - - /** Whether the thread is daemon or not. */ - public static final AttributeKey JVM_THREAD_DAEMON = booleanKey("jvm.thread.daemon"); - - /** State of the thread. */ - public static final AttributeKey JVM_THREAD_STATE = stringKey("jvm.thread.state"); - - /** The device identifier */ - public static final AttributeKey SYSTEM_DEVICE = stringKey("system.device"); - - /** The logical CPU number [0..n-1] */ - public static final AttributeKey SYSTEM_CPU_LOGICAL_NUMBER = longKey("system.cpu.logical_number"); - - /** The state of the CPU */ - public static final AttributeKey SYSTEM_CPU_STATE = stringKey("system.cpu.state"); - - /** The memory state */ - public static final AttributeKey SYSTEM_MEMORY_STATE = stringKey("system.memory.state"); - - /** The paging access direction */ - public static final AttributeKey SYSTEM_PAGING_DIRECTION = stringKey("system.paging.direction"); - - /** The memory paging state */ - public static final AttributeKey SYSTEM_PAGING_STATE = stringKey("system.paging.state"); - - /** The memory paging type */ - public static final AttributeKey SYSTEM_PAGING_TYPE = stringKey("system.paging.type"); - - /** The disk operation direction */ - public static final AttributeKey SYSTEM_DISK_DIRECTION = stringKey("system.disk.direction"); - - /** The filesystem mode */ - public static final AttributeKey SYSTEM_FILESYSTEM_MODE = stringKey("system.filesystem.mode"); - - /** The filesystem mount path */ - public static final AttributeKey SYSTEM_FILESYSTEM_MOUNTPOINT = stringKey("system.filesystem.mountpoint"); - - /** The filesystem state */ - public static final AttributeKey SYSTEM_FILESYSTEM_STATE = stringKey("system.filesystem.state"); - - /** The filesystem type */ - public static final AttributeKey SYSTEM_FILESYSTEM_TYPE = stringKey("system.filesystem.type"); - - /** */ - public static final AttributeKey SYSTEM_NETWORK_DIRECTION = stringKey("system.network.direction"); - - /** A stateless protocol MUST NOT set this attribute */ - public static final AttributeKey SYSTEM_NETWORK_STATE = stringKey("system.network.state"); - - /** - * The process state, e.g., Linux Process State - * Codes - */ - public static final AttributeKey SYSTEM_PROCESSES_STATUS = stringKey("system.processes.status"); - - /** - * The column number in {@code code.filepath} best representing the operation. It SHOULD point - * within the code unit named in {@code code.function}. - */ - public static final AttributeKey CODE_COLUMN = longKey("code.column"); - - /** - * The source code file name that identifies the code unit as uniquely as possible (preferably an - * absolute file path). - */ - public static final AttributeKey CODE_FILEPATH = stringKey("code.filepath"); - - /** - * The method or function name, or equivalent (usually rightmost part of the code unit's name). - */ - public static final AttributeKey CODE_FUNCTION = stringKey("code.function"); - - /** - * The line number in {@code code.filepath} best representing the operation. It SHOULD point - * within the code unit named in {@code code.function}. - */ - public static final AttributeKey CODE_LINENO = longKey("code.lineno"); - - /** - * The "namespace" within which {@code code.function} is defined. Usually the qualified - * class or module name, such that {@code code.namespace} + some separator + {@code code.function} - * form a unique identifier for the code unit. - */ - public static final AttributeKey CODE_NAMESPACE = stringKey("code.namespace"); - - /** - * Deprecated, use {@code http.request.method} instead. - * - * @deprecated Deprecated, use `http.request.method` instead. - */ - @Deprecated - public static final AttributeKey HTTP_METHOD = stringKey("http.method"); - - /** - * Deprecated, use {@code http.request.header.content-length} instead. - * - * @deprecated Deprecated, use `http.request.header.content-length` instead. - */ - @Deprecated - public static final AttributeKey HTTP_REQUEST_CONTENT_LENGTH = longKey("http.request_content_length"); - - /** - * Deprecated, use {@code http.response.header.content-length} instead. - * - * @deprecated Deprecated, use `http.response.header.content-length` instead. - */ - @Deprecated - public static final AttributeKey HTTP_RESPONSE_CONTENT_LENGTH = longKey("http.response_content_length"); - - /** - * Deprecated, use {@code url.scheme} instead. - * - * @deprecated Deprecated, use `url.scheme` instead. - */ - @Deprecated - public static final AttributeKey HTTP_SCHEME = stringKey("http.scheme"); - - /** - * Deprecated, use {@code http.response.status_code} instead. - * - * @deprecated Deprecated, use `http.response.status_code` instead. - */ - @Deprecated - public static final AttributeKey HTTP_STATUS_CODE = longKey("http.status_code"); - - /** - * Deprecated, use {@code url.path} and {@code url.query} instead. - * - * @deprecated Deprecated, use `url.path` and `url.query` instead. - */ - @Deprecated - public static final AttributeKey HTTP_TARGET = stringKey("http.target"); - - /** - * Deprecated, use {@code url.full} instead. - * - * @deprecated Deprecated, use `url.full` instead. - */ - @Deprecated - public static final AttributeKey HTTP_URL = stringKey("http.url"); - - /** - * Deprecated, use {@code server.address}. - * - * @deprecated Deprecated, use `server.address`. - */ - @Deprecated - public static final AttributeKey NET_HOST_NAME = stringKey("net.host.name"); - - /** - * Deprecated, use {@code server.port}. - * - * @deprecated Deprecated, use `server.port`. - */ - @Deprecated - public static final AttributeKey NET_HOST_PORT = longKey("net.host.port"); - - /** - * Deprecated, use {@code server.address} on client spans and {@code client.address} on server - * spans. - * - * @deprecated Deprecated, use `server.address` on client spans and `client.address` on server - * spans. - */ - @Deprecated - public static final AttributeKey NET_PEER_NAME = stringKey("net.peer.name"); - - /** - * Deprecated, use {@code server.port} on client spans and {@code client.port} on server spans. - * - * @deprecated Deprecated, use `server.port` on client spans and `client.port` on server spans. - */ - @Deprecated - public static final AttributeKey NET_PEER_PORT = longKey("net.peer.port"); - - /** - * Deprecated, use {@code network.protocol.name}. - * - * @deprecated Deprecated, use `network.protocol.name`. - */ - @Deprecated - public static final AttributeKey NET_PROTOCOL_NAME = stringKey("net.protocol.name"); - - /** - * Deprecated, use {@code network.protocol.version}. - * - * @deprecated Deprecated, use `network.protocol.version`. - */ - @Deprecated - public static final AttributeKey NET_PROTOCOL_VERSION = stringKey("net.protocol.version"); - - /** - * Deprecated, use {@code network.transport} and {@code network.type}. - * - * @deprecated Deprecated, use `network.transport` and `network.type`. - */ - @Deprecated - public static final AttributeKey NET_SOCK_FAMILY = stringKey("net.sock.family"); - - /** - * Deprecated, use {@code network.local.address}. - * - * @deprecated Deprecated, use `network.local.address`. - */ - @Deprecated - public static final AttributeKey NET_SOCK_HOST_ADDR = stringKey("net.sock.host.addr"); - - /** - * Deprecated, use {@code network.local.port}. - * - * @deprecated Deprecated, use `network.local.port`. - */ - @Deprecated - public static final AttributeKey NET_SOCK_HOST_PORT = longKey("net.sock.host.port"); - - /** - * Deprecated, use {@code network.peer.address}. - * - * @deprecated Deprecated, use `network.peer.address`. - */ - @Deprecated - public static final AttributeKey NET_SOCK_PEER_ADDR = stringKey("net.sock.peer.addr"); - - /** - * Deprecated, no replacement at this time. - * - * @deprecated Deprecated, no replacement at this time. - */ - @Deprecated - public static final AttributeKey NET_SOCK_PEER_NAME = stringKey("net.sock.peer.name"); - - /** - * Deprecated, use {@code network.peer.port}. - * - * @deprecated Deprecated, use `network.peer.port`. - */ - @Deprecated - public static final AttributeKey NET_SOCK_PEER_PORT = longKey("net.sock.peer.port"); - - /** - * Deprecated, use {@code network.transport}. - * - * @deprecated Deprecated, use `network.transport`. - */ - @Deprecated - public static final AttributeKey NET_TRANSPORT = stringKey("net.transport"); - - /** - * 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 - * header. For requests using transport encoding, this should be the compressed size. - */ - public static final AttributeKey HTTP_REQUEST_BODY_SIZE = longKey("http.request.body.size"); - - /** - * HTTP request method. - * - *

Notes: - * - *

    - *
  • HTTP request method value SHOULD be "known" to the instrumentation. By default, - * this convention defines "known" methods as the ones listed in RFC9110 and the PATCH - * method defined in RFC5789. - *
  • If the HTTP request method is not known to instrumentation, it MUST set the {@code - * http.request.method} attribute to {@code _OTHER}. - *
  • If the HTTP instrumentation could end up converting valid HTTP request methods to {@code - * _OTHER}, then it MUST provide a way to override the list of known HTTP methods. If this - * override is done via environment variable, then the environment variable MUST be named - * OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of - * case-sensitive known HTTP methods (this list MUST be a full override of the default known - * method, it is not a list of known methods in addition to the defaults). - *
  • HTTP method names are case-sensitive and {@code http.request.method} attribute value MUST - * match a known HTTP method name exactly. 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 {@code http.request.method_original} - * to the original value. - *
- */ - public static final AttributeKey HTTP_REQUEST_METHOD = stringKey("http.request.method"); - - /** Original HTTP method sent by the client in the request line. */ - public static final AttributeKey HTTP_REQUEST_METHOD_ORIGINAL = stringKey("http.request.method_original"); - - /** - * The ordinal number of request resending attempt (for any reason, including redirects). - * - *

Notes: - * - *

    - *
  • The resend count SHOULD be updated each time an HTTP request gets resent by the client, - * regardless of what was the cause of the resending (e.g. redirection, authorization - * failure, 503 Server Unavailable, network issues, or any other). - *
- */ - public static final AttributeKey HTTP_REQUEST_RESEND_COUNT = longKey("http.request.resend_count"); - - /** - * 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 - * header. For requests using transport encoding, this should be the compressed size. - */ - public static final AttributeKey HTTP_RESPONSE_BODY_SIZE = longKey("http.response.body.size"); - - /** HTTP response status code. */ - public static final AttributeKey HTTP_RESPONSE_STATUS_CODE = longKey("http.response.status_code"); - - /** - * The matched route, that is, the path template in the format used by the respective server - * framework. - * - *

Notes: - * - *

    - *
  • 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 if there is one. - *
- */ - public static final AttributeKey HTTP_ROUTE = stringKey("http.route"); - - /** - * The number of messages sent, received, or processed in the scope of the batching operation. - * - *

Notes: - * - *

    - *
  • Instrumentations SHOULD NOT set {@code 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 {@code - * messaging.batch.message_count} for batching APIs and SHOULD NOT use it for single-message - * APIs. - *
- */ - public static final AttributeKey MESSAGING_BATCH_MESSAGE_COUNT = longKey("messaging.batch.message_count"); - - /** A unique identifier for the client that consumes or produces a message. */ - public static final AttributeKey MESSAGING_CLIENT_ID = stringKey("messaging.client_id"); - - /** - * A boolean that is true if the message destination is anonymous (could be unnamed or have - * auto-generated name). - */ - public static final AttributeKey MESSAGING_DESTINATION_ANONYMOUS - = booleanKey("messaging.destination.anonymous"); - - /** - * The message destination name - * - *

Notes: - * - *

    - *
  • Destination name SHOULD uniquely identify a specific queue, topic or other entity within - * the broker. If the broker doesn't have such notion, the destination name SHOULD uniquely - * identify the broker. - *
- */ - public static final AttributeKey MESSAGING_DESTINATION_NAME = stringKey("messaging.destination.name"); - - /** - * Low cardinality representation of the messaging destination name - * - *

Notes: - * - *

    - *
  • Destination names could be constructed from templates. An example would be a destination - * name involving a user name or product id. Although the destination name in this case is - * of high cardinality, the underlying template is of low cardinality and can be effectively - * used for grouping and aggregation. - *
- */ - public static final AttributeKey MESSAGING_DESTINATION_TEMPLATE - = stringKey("messaging.destination.template"); - - /** - * A boolean that is true if the message destination is temporary and might not exist anymore - * after messages are processed. - */ - public static final AttributeKey MESSAGING_DESTINATION_TEMPORARY - = booleanKey("messaging.destination.temporary"); - - /** - * A boolean that is true if the publish message destination is anonymous (could be unnamed or - * have auto-generated name). - */ - public static final AttributeKey MESSAGING_DESTINATION_PUBLISH_ANONYMOUS - = booleanKey("messaging.destination_publish.anonymous"); - - /** - * The name of the original destination the message was published to - * - *

Notes: - * - *

    - *
  • The name SHOULD uniquely identify a specific queue, topic, or other entity within the - * broker. If the broker doesn't have such notion, the original destination name SHOULD - * uniquely identify the broker. - *
- */ - public static final AttributeKey MESSAGING_DESTINATION_PUBLISH_NAME - = stringKey("messaging.destination_publish.name"); - - /** - * Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not - * producers. - */ - public static final AttributeKey MESSAGING_KAFKA_CONSUMER_GROUP - = stringKey("messaging.kafka.consumer.group"); - - /** Partition the message is sent to. */ - public static final AttributeKey MESSAGING_KAFKA_DESTINATION_PARTITION - = longKey("messaging.kafka.destination.partition"); - - /** - * Message keys in Kafka are used for grouping alike messages to ensure they're processed on the - * same partition. They differ from {@code messaging.message.id} in that they're not unique. If - * the key is {@code null}, the attribute MUST NOT be set. - * - *

Notes: - * - *

    - *
  • 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. - *
- */ - public static final AttributeKey MESSAGING_KAFKA_MESSAGE_KEY = stringKey("messaging.kafka.message.key"); - - /** The offset of a record in the corresponding Kafka partition. */ - public static final AttributeKey MESSAGING_KAFKA_MESSAGE_OFFSET = longKey("messaging.kafka.message.offset"); - - /** A boolean that is true if the message is a tombstone. */ - public static final AttributeKey MESSAGING_KAFKA_MESSAGE_TOMBSTONE - = booleanKey("messaging.kafka.message.tombstone"); - - /** - * The size of the message body in bytes. - * - *

Notes: - * - *

    - *
  • This can refer to both the compressed or uncompressed body size. If both sizes are known, - * the uncompressed body size should be used. - *
- */ - public static final AttributeKey MESSAGING_MESSAGE_BODY_SIZE = longKey("messaging.message.body.size"); - - /** - * The conversation ID identifying the conversation to which the message belongs, represented as a - * string. Sometimes called "Correlation ID". - */ - public static final AttributeKey MESSAGING_MESSAGE_CONVERSATION_ID - = stringKey("messaging.message.conversation_id"); - - /** - * The size of the message body and metadata in bytes. - * - *

Notes: - * - *

    - *
  • This can refer to both the compressed or uncompressed size. If both sizes are known, the - * uncompressed size should be used. - *
- */ - public static final AttributeKey MESSAGING_MESSAGE_ENVELOPE_SIZE = longKey("messaging.message.envelope.size"); - - /** - * A value used by the messaging system as an identifier for the message, represented as a string. - */ - public static final AttributeKey MESSAGING_MESSAGE_ID = stringKey("messaging.message.id"); - - /** - * A string identifying the kind of messaging operation. - * - *

Notes: - * - *

    - *
  • If a custom value is used, it MUST be of low cardinality. - *
- */ - public static final AttributeKey MESSAGING_OPERATION = stringKey("messaging.operation"); - - /** RabbitMQ message routing key. */ - public static final AttributeKey MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY - = stringKey("messaging.rabbitmq.destination.routing_key"); - - /** - * Name of the RocketMQ producer/consumer group that is handling the message. The client type is - * identified by the SpanKind. - */ - public static final AttributeKey MESSAGING_ROCKETMQ_CLIENT_GROUP - = stringKey("messaging.rocketmq.client_group"); - - /** Model of message consumption. This only applies to consumer spans. */ - public static final AttributeKey MESSAGING_ROCKETMQ_CONSUMPTION_MODEL - = stringKey("messaging.rocketmq.consumption_model"); - - /** The delay time level for delay message, which determines the message delay time. */ - public static final AttributeKey MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL - = longKey("messaging.rocketmq.message.delay_time_level"); - - /** - * The timestamp in milliseconds that the delay message is expected to be delivered to consumer. - */ - public static final AttributeKey MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP - = longKey("messaging.rocketmq.message.delivery_timestamp"); - - /** - * 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. - */ - public static final AttributeKey MESSAGING_ROCKETMQ_MESSAGE_GROUP - = stringKey("messaging.rocketmq.message.group"); - - /** Key(s) of message, another way to mark message besides message id. */ - public static final AttributeKey> MESSAGING_ROCKETMQ_MESSAGE_KEYS - = stringArrayKey("messaging.rocketmq.message.keys"); - - /** The secondary classifier of message besides topic. */ - public static final AttributeKey MESSAGING_ROCKETMQ_MESSAGE_TAG - = stringKey("messaging.rocketmq.message.tag"); - - /** Type of message. */ - public static final AttributeKey MESSAGING_ROCKETMQ_MESSAGE_TYPE - = stringKey("messaging.rocketmq.message.type"); - - /** Namespace of RocketMQ resources, resources in different namespaces are individual. */ - public static final AttributeKey MESSAGING_ROCKETMQ_NAMESPACE = stringKey("messaging.rocketmq.namespace"); - - /** A string identifying the messaging system. */ - public static final AttributeKey MESSAGING_SYSTEM = stringKey("messaging.system"); - - /** The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. */ - public static final AttributeKey NETWORK_CARRIER_ICC = stringKey("network.carrier.icc"); - - /** The mobile carrier country code. */ - public static final AttributeKey NETWORK_CARRIER_MCC = stringKey("network.carrier.mcc"); - - /** The mobile carrier network code. */ - public static final AttributeKey NETWORK_CARRIER_MNC = stringKey("network.carrier.mnc"); - - /** The name of the mobile carrier. */ - public static final AttributeKey NETWORK_CARRIER_NAME = stringKey("network.carrier.name"); - - /** - * This describes more details regarding the connection.type. It may be the type of cell - * technology connection, but it could be used for describing details about a wifi connection. - */ - public static final AttributeKey NETWORK_CONNECTION_SUBTYPE = stringKey("network.connection.subtype"); - - /** The internet connection type. */ - public static final AttributeKey NETWORK_CONNECTION_TYPE = stringKey("network.connection.type"); - - /** Local address of the network connection - IP address or Unix domain socket name. */ - public static final AttributeKey NETWORK_LOCAL_ADDRESS = stringKey("network.local.address"); - - /** Local port number of the network connection. */ - public static final AttributeKey NETWORK_LOCAL_PORT = longKey("network.local.port"); - - /** Peer address of the network connection - IP address or Unix domain socket name. */ - public static final AttributeKey NETWORK_PEER_ADDRESS = stringKey("network.peer.address"); - - /** Peer port number of the network connection. */ - public static final AttributeKey NETWORK_PEER_PORT = longKey("network.peer.port"); - - /** - * OSI application layer or non-OSI - * equivalent. - * - *

Notes: - * - *

    - *
  • The value SHOULD be normalized to lowercase. - *
- */ - public static final AttributeKey NETWORK_PROTOCOL_NAME = stringKey("network.protocol.name"); - - /** - * Version of the protocol specified in {@code network.protocol.name}. - * - *

Notes: - * - *

    - *
  • {@code network.protocol.version} refers to the version of the protocol used and might be - * different from the protocol client's version. If the HTTP client has a version of {@code - * 0.27.2}, but sends HTTP version {@code 1.1}, this attribute should be set to {@code 1.1}. - *
- */ - public static final AttributeKey NETWORK_PROTOCOL_VERSION = stringKey("network.protocol.version"); - - /** - * OSI transport layer or inter-process communication - * method. - * - *

Notes: - * - *

    - *
  • The value SHOULD be normalized to lowercase. - *
  • 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. - *
- */ - public static final AttributeKey NETWORK_TRANSPORT = stringKey("network.transport"); - - /** - * OSI network layer or non-OSI equivalent. - * - *

Notes: - * - *

    - *
  • The value SHOULD be normalized to lowercase. - *
- */ - public static final AttributeKey NETWORK_TYPE = stringKey("network.type"); - - /** - * The error codes of the Connect - * request. Error codes are always string values. - */ - public static final AttributeKey RPC_CONNECT_RPC_ERROR_CODE = stringKey("rpc.connect_rpc.error_code"); - - /** - * The numeric status - * code of the gRPC request. - */ - public static final AttributeKey RPC_GRPC_STATUS_CODE = longKey("rpc.grpc.status_code"); - - /** {@code error.code} property of response if it is an error response. */ - public static final AttributeKey RPC_JSONRPC_ERROR_CODE = longKey("rpc.jsonrpc.error_code"); - - /** {@code error.message} property of response if it is an error response. */ - public static final AttributeKey RPC_JSONRPC_ERROR_MESSAGE = stringKey("rpc.jsonrpc.error_message"); - - /** - * {@code id} property of request or response. Since protocol allows id to be int, string, {@code - * null} or missing (for notifications), value is expected to be cast to string for simplicity. - * Use empty string in case of {@code null} value. Omit entirely if this is a notification. - */ - public static final AttributeKey RPC_JSONRPC_REQUEST_ID = stringKey("rpc.jsonrpc.request_id"); - - /** - * Protocol version as in {@code jsonrpc} property of request/response. Since JSON-RPC 1.0 doesn't - * specify this, the value can be omitted. - */ - public static final AttributeKey RPC_JSONRPC_VERSION = stringKey("rpc.jsonrpc.version"); - - /** - * The name of the (logical) method being called, must be equal to the $method part in the span - * name. - * - *

Notes: - * - *

    - *
  • This is the logical name of the method from the RPC interface perspective, which can be - * different from the name of any implementing method/function. The {@code code.function} - * attribute may be used to store the latter (e.g., method actually executing the call on - * the server side, RPC client stub method on the client side). - *
- */ - public static final AttributeKey RPC_METHOD = stringKey("rpc.method"); - - /** - * The full (logical) name of the service being called, including its package name, if applicable. - * - *

Notes: - * - *

    - *
  • 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 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). - *
- */ - public static final AttributeKey RPC_SERVICE = stringKey("rpc.service"); - - /** A string identifying the remoting system. See below for a list of well-known identifiers. */ - public static final AttributeKey RPC_SYSTEM = stringKey("rpc.system"); - - /** Current "managed" thread ID (as opposed to OS thread ID). */ - public static final AttributeKey THREAD_ID = longKey("thread.id"); - - /** Current thread name. */ - public static final AttributeKey THREAD_NAME = stringKey("thread.name"); - - /** The URI fragment component */ - public static final AttributeKey URL_FRAGMENT = stringKey("url.fragment"); - - /** - * Absolute URL describing a network resource according to RFC3986 - * - *

Notes: - * - *

    - *
  • For network calls, URL usually has {@code scheme://host[:port][path][?query][#fragment]} - * format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be - * included nevertheless. {@code url.full} MUST NOT contain credentials passed via URL in - * form of {@code https://username:password@www.example.com/}. In such case username and - * password SHOULD be redacted and attribute's value SHOULD be {@code - * https://REDACTED:REDACTED@www.example.com/}. {@code url.full} SHOULD capture the absolute - * URL when it is available (or can be reconstructed) and SHOULD NOT be validated or - * modified except for sanitizing purposes. - *
- */ - public static final AttributeKey URL_FULL = stringKey("url.full"); - - /** The URI path component */ - public static final AttributeKey URL_PATH = stringKey("url.path"); - - /** - * The URI query component - * - *

Notes: - * - *

    - *
  • Sensitive content provided in query string SHOULD be scrubbed when instrumentations can - * identify it. - *
- */ - public static final AttributeKey URL_QUERY = stringKey("url.query"); - - /** - * The URI scheme component - * identifying the used protocol. - */ - public static final AttributeKey URL_SCHEME = stringKey("url.scheme"); - - /** - * Value of the HTTP - * User-Agent header sent by the client. - */ - public static final AttributeKey USER_AGENT_ORIGINAL = stringKey("user_agent.original"); - - /** - * Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix - * domain socket name. - * - *

Notes: - * - *

    - *
  • When observed from the client side, and when communicating through an intermediary, - * {@code server.address} SHOULD represent the server address behind any intermediaries, for - * example proxies, if it's available. - *
- */ - public static final AttributeKey SERVER_ADDRESS = stringKey("server.address"); - - /** - * Server port number. - * - *

Notes: - * - *

    - *
  • When observed from the client side, and when communicating through an intermediary, - * {@code server.port} SHOULD represent the server port behind any intermediaries, for - * example proxies, if it's available. - *
- */ - public static final AttributeKey SERVER_PORT = longKey("server.port"); - - /** A unique id to identify a session. */ - public static final AttributeKey SESSION_ID = stringKey("session.id"); - - /** The previous {@code session.id} for this user, when known. */ - public static final AttributeKey SESSION_PREVIOUS_ID = stringKey("session.previous_id"); - - /** - * Source address - domain name if available without reverse DNS lookup; otherwise, IP address or - * Unix domain socket name. - * - *

Notes: - * - *

    - *
  • When observed from the destination side, and when communicating through an intermediary, - * {@code source.address} SHOULD represent the source address behind any intermediaries, for - * example proxies, if it's available. - *
- */ - public static final AttributeKey SOURCE_ADDRESS = stringKey("source.address"); - - /** Source port number */ - public static final AttributeKey SOURCE_PORT = longKey("source.port"); - - /** - * The full invoked ARN as provided on the {@code Context} passed to the function ({@code - * Lambda-Runtime-Invoked-Function-Arn} header on the {@code /runtime/invocation/next} - * applicable). - * - *

Notes: - * - *

    - *
  • This may be different from {@code cloud.resource_id} if an alias is involved. - *
- */ - public static final AttributeKey AWS_LAMBDA_INVOKED_ARN = stringKey("aws.lambda.invoked_arn"); - - /** - * The event_id - * uniquely identifies the event. - */ - public static final AttributeKey CLOUDEVENTS_EVENT_ID = stringKey("cloudevents.event_id"); - - /** - * The source - * identifies the context in which an event happened. - */ - public static final AttributeKey CLOUDEVENTS_EVENT_SOURCE = stringKey("cloudevents.event_source"); - - /** - * The version - * of the CloudEvents specification which the event uses. - */ - public static final AttributeKey CLOUDEVENTS_EVENT_SPEC_VERSION - = stringKey("cloudevents.event_spec_version"); - - /** - * The subject - * of the event in the context of the event producer (identified by source). - */ - public static final AttributeKey CLOUDEVENTS_EVENT_SUBJECT = stringKey("cloudevents.event_subject"); - - /** - * The event_type - * contains a value describing the type of event related to the originating occurrence. - */ - public static final AttributeKey CLOUDEVENTS_EVENT_TYPE = stringKey("cloudevents.event_type"); - - /** - * Parent-child Reference type - * - *

Notes: - * - *

    - *
  • The causal relationship between a child Span and a parent Span. - *
- */ - public static final AttributeKey OPENTRACING_REF_TYPE = stringKey("opentracing.ref_type"); - - /** - * The connection string used to connect to the database. It is recommended to remove embedded - * credentials. - */ - public static final AttributeKey DB_CONNECTION_STRING = stringKey("db.connection_string"); - - /** - * The fully-qualified class name of the Java Database Connectivity - * (JDBC) driver used to connect. - */ - public static final AttributeKey DB_JDBC_DRIVER_CLASSNAME = stringKey("db.jdbc.driver_classname"); - - /** - * This attribute is used to report the name of the database being accessed. For commands that - * switch the database, this should be set to the target database (even if the command fails). - * - *

Notes: - * - *

    - *
  • In some SQL databases, the database name to be used is called "schema name". In - * case there are multiple layers that could be considered for database name (e.g. Oracle - * instance name and schema name), the database name to be used is the more specific layer - * (e.g. Oracle schema name). - *
- */ - public static final AttributeKey DB_NAME = stringKey("db.name"); - - /** - * The name of the operation being executed, e.g. the MongoDB command - * name such as {@code findAndModify}, or the SQL keyword. - * - *

Notes: - * - *

    - *
  • When setting this to an SQL keyword, it is not recommended to attempt any client-side - * parsing of {@code db.statement} just to get this property, but it should be set if the - * operation name is provided by the library being instrumented. If the SQL statement has an - * ambiguous operation, or performs more than one operation, this value may be omitted. - *
- */ - public static final AttributeKey DB_OPERATION = stringKey("db.operation"); - - /** The database statement being executed. */ - public static final AttributeKey DB_STATEMENT = stringKey("db.statement"); - - /** - * An identifier for the database management system (DBMS) product being used. See below for a - * list of well-known identifiers. - */ - public static final AttributeKey DB_SYSTEM = stringKey("db.system"); - - /** Username for accessing the database. */ - public static final AttributeKey DB_USER = stringKey("db.user"); - - /** - * The Microsoft SQL Server instance - * name connecting to. This name is used to determine the port of a named instance. - * - *

Notes: - * - *

    - *
  • If setting a {@code db.mssql.instance_name}, {@code server.port} is no longer required - * (but still recommended if non-standard). - *
- */ - public static final AttributeKey DB_MSSQL_INSTANCE_NAME = stringKey("db.mssql.instance_name"); - - /** - * The consistency level of the query. Based on consistency values from CQL. - */ - public static final AttributeKey DB_CASSANDRA_CONSISTENCY_LEVEL - = stringKey("db.cassandra.consistency_level"); - - /** The data center of the coordinating node for a query. */ - public static final AttributeKey DB_CASSANDRA_COORDINATOR_DC = stringKey("db.cassandra.coordinator.dc"); - - /** The ID of the coordinating node for a query. */ - public static final AttributeKey DB_CASSANDRA_COORDINATOR_ID = stringKey("db.cassandra.coordinator.id"); - - /** Whether or not the query is idempotent. */ - public static final AttributeKey DB_CASSANDRA_IDEMPOTENCE = booleanKey("db.cassandra.idempotence"); - - /** The fetch size used for paging, i.e. how many rows will be returned at once. */ - public static final AttributeKey DB_CASSANDRA_PAGE_SIZE = longKey("db.cassandra.page_size"); - - /** - * The number of times a query was speculatively executed. Not set or {@code 0} if the query was - * not executed speculatively. - */ - public static final AttributeKey DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT - = longKey("db.cassandra.speculative_execution_count"); - - /** - * The name of the primary table that the operation is acting upon, including the keyspace name - * (if applicable). - * - *

Notes: - * - *

    - *
  • This mirrors the db.sql.table attribute but references cassandra rather than sql. It is - * not recommended to attempt any client-side parsing of {@code db.statement} just to get - * this property, but it should be set if it is provided by the library being instrumented. - * If the operation is acting upon an anonymous table, or more than one table, this value - * MUST NOT be set. - *
- */ - public static final AttributeKey DB_CASSANDRA_TABLE = stringKey("db.cassandra.table"); - - /** - * The index of the database being accessed as used in the {@code SELECT} command, provided as an integer. To - * be used instead of the generic {@code db.name} attribute. - */ - public static final AttributeKey DB_REDIS_DATABASE_INDEX = longKey("db.redis.database_index"); - - /** The collection being accessed within the database stated in {@code db.name}. */ - public static final AttributeKey DB_MONGODB_COLLECTION = stringKey("db.mongodb.collection"); - - /** Represents the identifier of an Elasticsearch cluster. */ - public static final AttributeKey DB_ELASTICSEARCH_CLUSTER_NAME = stringKey("db.elasticsearch.cluster.name"); - - /** - * Represents the human-readable identifier of the node/instance to which a request was routed. - */ - public static final AttributeKey DB_ELASTICSEARCH_NODE_NAME = stringKey("db.elasticsearch.node.name"); - - /** - * The name of the primary table that the operation is acting upon, including the database name - * (if applicable). - * - *

Notes: - * - *

    - *
  • It is not recommended to attempt any client-side parsing of {@code db.statement} just to - * get this property, but it should be set if it is provided by the library being - * instrumented. If the operation is acting upon an anonymous table, or more than one table, - * this value MUST NOT be set. - *
- */ - public static final AttributeKey DB_SQL_TABLE = stringKey("db.sql.table"); - - /** Unique Cosmos client instance id. */ - public static final AttributeKey DB_COSMOSDB_CLIENT_ID = stringKey("db.cosmosdb.client_id"); - - /** Cosmos client connection mode. */ - public static final AttributeKey DB_COSMOSDB_CONNECTION_MODE = stringKey("db.cosmosdb.connection_mode"); - - /** Cosmos DB container name. */ - public static final AttributeKey DB_COSMOSDB_CONTAINER = stringKey("db.cosmosdb.container"); - - /** CosmosDB Operation Type. */ - public static final AttributeKey DB_COSMOSDB_OPERATION_TYPE = stringKey("db.cosmosdb.operation_type"); - - /** RU consumed for that operation */ - public static final AttributeKey DB_COSMOSDB_REQUEST_CHARGE = doubleKey("db.cosmosdb.request_charge"); - - /** Request payload size in bytes */ - public static final AttributeKey DB_COSMOSDB_REQUEST_CONTENT_LENGTH - = longKey("db.cosmosdb.request_content_length"); - - /** Cosmos DB status code. */ - public static final AttributeKey DB_COSMOSDB_STATUS_CODE = longKey("db.cosmosdb.status_code"); - - /** Cosmos DB sub status code. */ - public static final AttributeKey DB_COSMOSDB_SUB_STATUS_CODE = longKey("db.cosmosdb.sub_status_code"); - - /** - * Name of the code, either "OK" or "ERROR". MUST NOT be set if the status - * code is UNSET. - */ - public static final AttributeKey OTEL_STATUS_CODE = stringKey("otel.status_code"); - - /** Description of the Status if it has a value, otherwise not set. */ - public static final AttributeKey OTEL_STATUS_DESCRIPTION = stringKey("otel.status_description"); - - /** The invocation ID of the current function invocation. */ - public static final AttributeKey FAAS_INVOCATION_ID = stringKey("faas.invocation_id"); - - /** - * The name of the source on which the triggering operation was performed. For example, in Cloud - * Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. - */ - public static final AttributeKey FAAS_DOCUMENT_COLLECTION = stringKey("faas.document.collection"); - - /** - * The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the - * name of the file, and in Cosmos DB the table name. - */ - public static final AttributeKey FAAS_DOCUMENT_NAME = stringKey("faas.document.name"); - - /** Describes the type of the operation that was performed on the data. */ - public static final AttributeKey FAAS_DOCUMENT_OPERATION = stringKey("faas.document.operation"); - - /** - * A string containing the time when the data was accessed in the ISO 8601 format expressed in - * UTC. - */ - public static final AttributeKey FAAS_DOCUMENT_TIME = stringKey("faas.document.time"); - - /** - * A string containing the schedule period as Cron - * Expression. - */ - public static final AttributeKey FAAS_CRON = stringKey("faas.cron"); - - /** - * A string containing the function invocation time in the ISO 8601 format expressed in - * UTC. - */ - public static final AttributeKey FAAS_TIME = stringKey("faas.time"); - - /** - * A boolean that is true if the serverless function is executed for the first time (aka - * cold-start). - */ - public static final AttributeKey FAAS_COLDSTART = booleanKey("faas.coldstart"); - - /** The unique identifier of the feature flag. */ - public static final AttributeKey FEATURE_FLAG_KEY = stringKey("feature_flag.key"); - - /** The name of the service provider that performs the flag evaluation. */ - public static final AttributeKey FEATURE_FLAG_PROVIDER_NAME = stringKey("feature_flag.provider_name"); - - /** - * SHOULD be a semantic identifier for a value. If one is unavailable, a stringified version of - * the value can be used. - * - *

Notes: - * - *

    - *
  • A semantic identifier, commonly referred to as a variant, provides a means for referring - * to a value without including the value itself. This can provide additional context for - * understanding the meaning behind a value. For example, the variant {@code red} maybe be - * used for the value {@code #c05543}. - *
  • 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. - *
- */ - public static final AttributeKey FEATURE_FLAG_VARIANT = stringKey("feature_flag.variant"); - - /** - * The AWS request ID as returned in the response headers {@code x-amz-request-id} or {@code - * x-amz-requestid}. - */ - public static final AttributeKey AWS_REQUEST_ID = stringKey("aws.request_id"); - - /** The value of the {@code AttributesToGet} request parameter. */ - public static final AttributeKey> AWS_DYNAMODB_ATTRIBUTES_TO_GET - = stringArrayKey("aws.dynamodb.attributes_to_get"); - - /** The value of the {@code ConsistentRead} request parameter. */ - public static final AttributeKey AWS_DYNAMODB_CONSISTENT_READ = booleanKey("aws.dynamodb.consistent_read"); - - /** The JSON-serialized value of each item in the {@code ConsumedCapacity} response field. */ - public static final AttributeKey> AWS_DYNAMODB_CONSUMED_CAPACITY - = stringArrayKey("aws.dynamodb.consumed_capacity"); - - /** The value of the {@code IndexName} request parameter. */ - public static final AttributeKey AWS_DYNAMODB_INDEX_NAME = stringKey("aws.dynamodb.index_name"); - - /** The JSON-serialized value of the {@code ItemCollectionMetrics} response field. */ - public static final AttributeKey AWS_DYNAMODB_ITEM_COLLECTION_METRICS - = stringKey("aws.dynamodb.item_collection_metrics"); - - /** The value of the {@code Limit} request parameter. */ - public static final AttributeKey AWS_DYNAMODB_LIMIT = longKey("aws.dynamodb.limit"); - - /** The value of the {@code ProjectionExpression} request parameter. */ - public static final AttributeKey AWS_DYNAMODB_PROJECTION = stringKey("aws.dynamodb.projection"); - - /** The value of the {@code ProvisionedThroughput.ReadCapacityUnits} request parameter. */ - public static final AttributeKey AWS_DYNAMODB_PROVISIONED_READ_CAPACITY - = doubleKey("aws.dynamodb.provisioned_read_capacity"); - - /** The value of the {@code ProvisionedThroughput.WriteCapacityUnits} request parameter. */ - public static final AttributeKey AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY - = doubleKey("aws.dynamodb.provisioned_write_capacity"); - - /** The value of the {@code Select} request parameter. */ - public static final AttributeKey AWS_DYNAMODB_SELECT = stringKey("aws.dynamodb.select"); - - /** The keys in the {@code RequestItems} object field. */ - public static final AttributeKey> AWS_DYNAMODB_TABLE_NAMES - = stringArrayKey("aws.dynamodb.table_names"); - - /** The JSON-serialized value of each item of the {@code GlobalSecondaryIndexes} request field */ - public static final AttributeKey> AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES - = stringArrayKey("aws.dynamodb.global_secondary_indexes"); - - /** The JSON-serialized value of each item of the {@code LocalSecondaryIndexes} request field. */ - public static final AttributeKey> AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES - = stringArrayKey("aws.dynamodb.local_secondary_indexes"); - - /** The value of the {@code ExclusiveStartTableName} request parameter. */ - public static final AttributeKey AWS_DYNAMODB_EXCLUSIVE_START_TABLE - = stringKey("aws.dynamodb.exclusive_start_table"); - - /** The the number of items in the {@code TableNames} response parameter. */ - public static final AttributeKey AWS_DYNAMODB_TABLE_COUNT = longKey("aws.dynamodb.table_count"); - - /** The value of the {@code ScanIndexForward} request parameter. */ - public static final AttributeKey AWS_DYNAMODB_SCAN_FORWARD = booleanKey("aws.dynamodb.scan_forward"); - - /** The value of the {@code Count} response parameter. */ - public static final AttributeKey AWS_DYNAMODB_COUNT = longKey("aws.dynamodb.count"); - - /** The value of the {@code ScannedCount} response parameter. */ - public static final AttributeKey AWS_DYNAMODB_SCANNED_COUNT = longKey("aws.dynamodb.scanned_count"); - - /** The value of the {@code Segment} request parameter. */ - public static final AttributeKey AWS_DYNAMODB_SEGMENT = longKey("aws.dynamodb.segment"); - - /** The value of the {@code TotalSegments} request parameter. */ - public static final AttributeKey AWS_DYNAMODB_TOTAL_SEGMENTS = longKey("aws.dynamodb.total_segments"); - - /** The JSON-serialized value of each item in the {@code AttributeDefinitions} request field. */ - public static final AttributeKey> AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS - = stringArrayKey("aws.dynamodb.attribute_definitions"); - - /** - * The JSON-serialized value of each item in the the {@code GlobalSecondaryIndexUpdates} request - * field. - */ - public static final AttributeKey> AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES - = stringArrayKey("aws.dynamodb.global_secondary_index_updates"); - - /** - * The S3 bucket name the request refers to. Corresponds to the {@code --bucket} parameter of the - * S3 API - * operations. - * - *

Notes: - * - *

    - *
  • The {@code bucket} attribute is applicable to all S3 operations that reference a bucket, - * i.e. that require the bucket name as a mandatory parameter. This applies to almost all S3 - * operations except {@code list-buckets}. - *
- */ - public static final AttributeKey AWS_S3_BUCKET = stringKey("aws.s3.bucket"); - - /** - * The source object (in the form {@code bucket}/{@code key}) for the copy operation. - * - *

Notes: - * - *

- */ - public static final AttributeKey AWS_S3_COPY_SOURCE = stringKey("aws.s3.copy_source"); - - /** - * The delete request container that specifies the objects to be deleted. - * - *

Notes: - * - *

- */ - public static final AttributeKey AWS_S3_DELETE = stringKey("aws.s3.delete"); - - /** - * The S3 object key the request refers to. Corresponds to the {@code --key} parameter of the S3 API operations. - * - *

Notes: - * - *

- */ - public static final AttributeKey AWS_S3_KEY = stringKey("aws.s3.key"); - - /** - * The part number of the part being uploaded in a multipart-upload operation. This is a positive - * integer between 1 and 10,000. - * - *

Notes: - * - *

- */ - public static final AttributeKey AWS_S3_PART_NUMBER = longKey("aws.s3.part_number"); - - /** - * Upload ID that identifies the multipart upload. - * - *

Notes: - * - *

- */ - public static final AttributeKey AWS_S3_UPLOAD_ID = stringKey("aws.s3.upload_id"); - - /** - * The GraphQL document being executed. - * - *

Notes: - * - *

    - *
  • The value may be sanitized to exclude sensitive information. - *
- */ - public static final AttributeKey GRAPHQL_DOCUMENT = stringKey("graphql.document"); - - /** The name of the operation being executed. */ - public static final AttributeKey GRAPHQL_OPERATION_NAME = stringKey("graphql.operation.name"); - - /** The type of the operation being executed. */ - public static final AttributeKey GRAPHQL_OPERATION_TYPE = stringKey("graphql.operation.type"); - - /** Compressed size of the message in bytes. */ - public static final AttributeKey MESSAGE_COMPRESSED_SIZE = longKey("message.compressed_size"); - - /** - * MUST be calculated as two different counters starting from {@code 1} one for sent messages and - * one for received message. - * - *

Notes: - * - *

    - *
  • This way we guarantee that the values will be consistent between different - * implementations. - *
- */ - public static final AttributeKey MESSAGE_ID = longKey("message.id"); - - /** Whether this is a received or sent message. */ - public static final AttributeKey MESSAGE_TYPE = stringKey("message.type"); - - /** Uncompressed size of the message in bytes. */ - public static final AttributeKey MESSAGE_UNCOMPRESSED_SIZE = longKey("message.uncompressed_size"); - - /** - * SHOULD be set to true if the exception event is recorded at a point where it is known that the - * exception is escaping the scope of the span. - * - *

Notes: - * - *

    - *
  • An exception is considered to have escaped (or left) the scope of a span, if that span is - * ended while the exception is still logically "in flight". This may be actually - * "in flight" in some languages (e.g. if the exception is passed to a Context - * manager's {@code __exit__} method in Python) but will usually be caught at the point of - * recording the exception in most languages. - *
  • It is usually not possible to determine at the point where an exception is thrown whether - * it will escape the scope of a span. However, it is trivial to know that an exception will - * escape, if one checks for an active exception just before ending the span, as done in the - * example above. - *
  • It follows that an exception may still escape the scope of the span even if the {@code - * 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. - *
- */ - public static final AttributeKey EXCEPTION_ESCAPED = booleanKey("exception.escaped"); - - /** - * HTTP request headers, {@code } being the normalized HTTP Header name (lowercase), the - * value being the header values. - * - *

Notes: - * - *

    - *
  • Instrumentations SHOULD require an explicit configuration of which headers are to be - * captured. Including all request headers can be a security risk - explicit configuration - * helps avoid leaking sensitive information. The {@code User-Agent} header is already - * captured in the {@code user_agent.original} attribute. Users MAY explicitly configure - * instrumentations to capture them even though it is not recommended. The attribute value - * MUST consist of either multiple header values as an array of strings or a single-item - * array containing a possibly comma-concatenated string, depending on the way the HTTP - * library provides access to headers. - *
- */ - public static final AttributeKeyTemplate> HTTP_REQUEST_HEADER - = stringArrayKeyTemplate("http.request.header"); - - /** - * HTTP response headers, {@code } being the normalized HTTP Header name (lowercase), the - * value being the header values. - * - *

Notes: - * - *

    - *
  • Instrumentations SHOULD require an explicit configuration of which headers are to be - * captured. Including all response headers can be a security risk - explicit configuration - * helps avoid leaking sensitive information. Users MAY explicitly configure - * instrumentations to capture them even though it is not recommended. The attribute value - * MUST consist of either multiple header values as an array of strings or a single-item - * array containing a possibly comma-concatenated string, depending on the way the HTTP - * library provides access to headers. - *
- */ - public static final AttributeKeyTemplate> HTTP_RESPONSE_HEADER - = stringArrayKeyTemplate("http.response.header"); - - /** - * Connect request metadata, {@code } being the normalized Connect Metadata key (lowercase), - * the value being the metadata values. - * - *

Notes: - * - *

    - *
  • Instrumentations SHOULD require an explicit configuration of which metadata values are to - * be captured. Including all request metadata values can be a security risk - explicit - * configuration helps avoid leaking sensitive information. - *
- */ - public static final AttributeKeyTemplate> RPC_CONNECT_RPC_REQUEST_METADATA - = stringArrayKeyTemplate("rpc.connect_rpc.request.metadata"); - - /** - * Connect response metadata, {@code } being the normalized Connect Metadata key (lowercase), - * the value being the metadata values. - * - *

Notes: - * - *

    - *
  • 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. - *
- */ - public static final AttributeKeyTemplate> RPC_CONNECT_RPC_RESPONSE_METADATA - = stringArrayKeyTemplate("rpc.connect_rpc.response.metadata"); - - /** - * gRPC request metadata, {@code } being the normalized gRPC Metadata key (lowercase), the - * value being the metadata values. - * - *

Notes: - * - *

    - *
  • Instrumentations SHOULD require an explicit configuration of which metadata values are to - * be captured. Including all request metadata values can be a security risk - explicit - * configuration helps avoid leaking sensitive information. - *
- */ - public static final AttributeKeyTemplate> RPC_GRPC_REQUEST_METADATA - = stringArrayKeyTemplate("rpc.grpc.request.metadata"); - - /** - * gRPC response metadata, {@code } being the normalized gRPC Metadata key (lowercase), the - * value being the metadata values. - * - *

Notes: - * - *

    - *
  • 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. - *
- */ - public static final AttributeKeyTemplate> RPC_GRPC_RESPONSE_METADATA - = stringArrayKeyTemplate("rpc.grpc.response.metadata"); - - /** - * A dynamic value in the url path. - * - *

Notes: - * - *

    - *
  • Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span - * attributes in the format {@code db.elasticsearch.path_parts.}, where {@code } - * is the url path part name. The implementation SHOULD reference the elasticsearch - * schema in order to map the path part values to their names. - *
- */ - public static final AttributeKeyTemplate DB_ELASTICSEARCH_PATH_PARTS - = stringKeyTemplate("db.elasticsearch.path_parts"); - - // Enum definitions - public static final class ErrorTypeValues { - /** - * A fallback error value to be used when the instrumentation doesn't define a custom value. - */ - public static final String OTHER = "_OTHER"; - - private ErrorTypeValues() { - } - } - - public static final class FaasInvokedProviderValues { - /** Alibaba Cloud. */ - public static final String ALIBABA_CLOUD = "alibaba_cloud"; - - /** Amazon Web Services. */ - public static final String AWS = "aws"; - - /** Microsoft Azure. */ - public static final String AZURE = "azure"; - - /** Google Cloud Platform. */ - public static final String GCP = "gcp"; - - /** Tencent Cloud. */ - public static final String TENCENT_CLOUD = "tencent_cloud"; - - private FaasInvokedProviderValues() { - } - } - - public static final class FaasTriggerValues { - /** A response to some data source operation such as a database or filesystem read/write. */ - public static final String DATASOURCE = "datasource"; - - /** To provide an answer to an inbound HTTP request. */ - public static final String HTTP = "http"; - - /** A function is set to be executed when messages are sent to a messaging system. */ - public static final String PUBSUB = "pubsub"; - - /** A function is scheduled to be executed regularly. */ - public static final String TIMER = "timer"; - - /** If none of the others apply. */ - public static final String OTHER = "other"; - - private FaasTriggerValues() { - } - } - - public static final class EventDomainValues { - /** Events from browser apps. */ - public static final String BROWSER = "browser"; - - /** Events from mobile apps. */ - public static final String DEVICE = "device"; - - /** Events from Kubernetes. */ - public static final String K8S = "k8s"; - - private EventDomainValues() { - } - } - - public static final class LogIostreamValues { - /** Logs from stdout stream. */ - public static final String STDOUT = "stdout"; - - /** Events from stderr stream. */ - public static final String STDERR = "stderr"; - - private LogIostreamValues() { - } - } - - public static final class IosStateValues { - /** - * The app has become `active`. Associated with UIKit notification `applicationDidBecomeActive`. - */ - public static final String ACTIVE = "active"; - - /** - * The app is now `inactive`. Associated with UIKit notification `applicationWillResignActive`. - */ - public static final String INACTIVE = "inactive"; - - /** - * The app is now in the background. This value is associated with UIKit notification - * `applicationDidEnterBackground`. - */ - public static final String BACKGROUND = "background"; - - /** - * The app is now in the foreground. This value is associated with UIKit notification - * `applicationWillEnterForeground`. - */ - public static final String FOREGROUND = "foreground"; - - /** - * The app is about to terminate. Associated with UIKit notification `applicationWillTerminate`. - */ - public static final String TERMINATE = "terminate"; - - private IosStateValues() { - } - } - - public static final class AndroidStateValues { - /** - * Any time before Activity.onResume() or, if the app has no Activity, Context.startService() - * has been called in the app for the first time. - */ - public static final String CREATED = "created"; - - /** - * 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. - */ - public static final String BACKGROUND = "background"; - - /** - * 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. - */ - public static final String FOREGROUND = "foreground"; - - private AndroidStateValues() { - } - } - - public static final class StateValues { - /** idle. */ - public static final String IDLE = "idle"; - - /** used. */ - public static final String USED = "used"; - - private StateValues() { - } - } - - public static final class JvmMemoryTypeValues { - /** Heap memory. */ - public static final String HEAP = "heap"; - - /** Non-heap memory. */ - public static final String NON_HEAP = "non_heap"; - - private JvmMemoryTypeValues() { - } - } - - public static final class JvmThreadStateValues { - /** A thread that has not yet started is in this state. */ - public static final String NEW = "new"; - - /** A thread executing in the Java virtual machine is in this state. */ - public static final String RUNNABLE = "runnable"; - - /** A thread that is blocked waiting for a monitor lock is in this state. */ - public static final String BLOCKED = "blocked"; - - /** - * A thread that is waiting indefinitely for another thread to perform a particular action is in - * this state. - */ - public static final String WAITING = "waiting"; - - /** - * A thread that is waiting for another thread to perform an action for up to a specified - * waiting time is in this state. - */ - public static final String TIMED_WAITING = "timed_waiting"; - - /** A thread that has exited is in this state. */ - public static final String TERMINATED = "terminated"; - - private JvmThreadStateValues() { - } - } - - public static final class SystemCpuStateValues { - /** user. */ - public static final String USER = "user"; - - /** system. */ - public static final String SYSTEM = "system"; - - /** nice. */ - public static final String NICE = "nice"; - - /** idle. */ - public static final String IDLE = "idle"; - - /** iowait. */ - public static final String IOWAIT = "iowait"; - - /** interrupt. */ - public static final String INTERRUPT = "interrupt"; - - /** steal. */ - public static final String STEAL = "steal"; - - private SystemCpuStateValues() { - } - } - - public static final class SystemMemoryStateValues { - /** used. */ - public static final String USED = "used"; - - /** free. */ - public static final String FREE = "free"; - - /** shared. */ - public static final String SHARED = "shared"; - - /** buffers. */ - public static final String BUFFERS = "buffers"; - - /** cached. */ - public static final String CACHED = "cached"; - - /** - * total. - * - * @deprecated this value has been removed as of 1.23.1 of the semantic conventions. - */ - @Deprecated - public static final String TOTAL = "total"; - - private SystemMemoryStateValues() { - } - } - - public static final class SystemPagingDirectionValues { - /** in. */ - public static final String IN = "in"; - - /** out. */ - public static final String OUT = "out"; - - private SystemPagingDirectionValues() { - } - } - - public static final class SystemPagingStateValues { - /** used. */ - public static final String USED = "used"; - - /** free. */ - public static final String FREE = "free"; - - private SystemPagingStateValues() { - } - } - - public static final class SystemPagingTypeValues { - /** major. */ - public static final String MAJOR = "major"; - - /** minor. */ - public static final String MINOR = "minor"; - - private SystemPagingTypeValues() { - } - } - - public static final class SystemDiskDirectionValues { - /** read. */ - public static final String READ = "read"; - - /** write. */ - public static final String WRITE = "write"; - - private SystemDiskDirectionValues() { - } - } - - public static final class SystemFilesystemStateValues { - /** used. */ - public static final String USED = "used"; - - /** free. */ - public static final String FREE = "free"; - - /** reserved. */ - public static final String RESERVED = "reserved"; - - private SystemFilesystemStateValues() { - } - } - - public static final class SystemFilesystemTypeValues { - /** fat32. */ - public static final String FAT32 = "fat32"; - - /** exfat. */ - public static final String EXFAT = "exfat"; - - /** ntfs. */ - public static final String NTFS = "ntfs"; - - /** refs. */ - public static final String REFS = "refs"; - - /** hfsplus. */ - public static final String HFSPLUS = "hfsplus"; - - /** ext4. */ - public static final String EXT4 = "ext4"; - - private SystemFilesystemTypeValues() { - } - } - - public static final class SystemNetworkDirectionValues { - /** transmit. */ - public static final String TRANSMIT = "transmit"; - - /** receive. */ - public static final String RECEIVE = "receive"; - - private SystemNetworkDirectionValues() { - } - } - - public static final class SystemNetworkStateValues { - /** close. */ - public static final String CLOSE = "close"; - - /** close_wait. */ - public static final String CLOSE_WAIT = "close_wait"; - - /** closing. */ - public static final String CLOSING = "closing"; - - /** delete. */ - public static final String DELETE = "delete"; - - /** established. */ - public static final String ESTABLISHED = "established"; - - /** fin_wait_1. */ - public static final String FIN_WAIT_1 = "fin_wait_1"; - - /** fin_wait_2. */ - public static final String FIN_WAIT_2 = "fin_wait_2"; - - /** last_ack. */ - public static final String LAST_ACK = "last_ack"; - - /** listen. */ - public static final String LISTEN = "listen"; - - /** syn_recv. */ - public static final String SYN_RECV = "syn_recv"; - - /** syn_sent. */ - public static final String SYN_SENT = "syn_sent"; - - /** time_wait. */ - public static final String TIME_WAIT = "time_wait"; - - private SystemNetworkStateValues() { - } - } - - public static final class SystemProcessesStatusValues { - /** running. */ - public static final String RUNNING = "running"; - - /** sleeping. */ - public static final String SLEEPING = "sleeping"; - - /** stopped. */ - public static final String STOPPED = "stopped"; - - /** defunct. */ - public static final String DEFUNCT = "defunct"; - - private SystemProcessesStatusValues() { - } - } - - public static final class NetSockFamilyValues { - /** IPv4 address. */ - public static final String INET = "inet"; - - /** IPv6 address. */ - public static final String INET6 = "inet6"; - - /** Unix domain socket path. */ - public static final String UNIX = "unix"; - - private NetSockFamilyValues() { - } - } - - public static final class NetTransportValues { - /** ip_tcp. */ - public static final String IP_TCP = "ip_tcp"; - - /** ip_udp. */ - public static final String IP_UDP = "ip_udp"; - - /** Named or anonymous pipe. */ - public static final String PIPE = "pipe"; - - /** In-process communication. */ - public static final String INPROC = "inproc"; - - /** Something else (non IP-based). */ - public static final String OTHER = "other"; - - private NetTransportValues() { - } - } - - public static final class HttpRequestMethodValues { - /** CONNECT method. */ - public static final String CONNECT = "CONNECT"; - - /** DELETE method. */ - public static final String DELETE = "DELETE"; - - /** GET method. */ - public static final String GET = "GET"; - - /** HEAD method. */ - public static final String HEAD = "HEAD"; - - /** OPTIONS method. */ - public static final String OPTIONS = "OPTIONS"; - - /** PATCH method. */ - public static final String PATCH = "PATCH"; - - /** POST method. */ - public static final String POST = "POST"; - - /** PUT method. */ - public static final String PUT = "PUT"; - - /** TRACE method. */ - public static final String TRACE = "TRACE"; - - /** Any HTTP method that the instrumentation has no prior knowledge of. */ - public static final String OTHER = "_OTHER"; - - private HttpRequestMethodValues() { - } - } - - public static final class MessagingOperationValues { - /** - * 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. - */ - public static final String PUBLISH = "publish"; - - /** - * 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. - */ - public static final String CREATE = "create"; - - /** - * 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 static final String RECEIVE = "receive"; - - /** - * One or more messages are passed to a consumer. This operation refers to push-based scenarios, - * where consumer register callbacks which get called by messaging SDKs. - */ - public static final String DELIVER = "deliver"; - - /** - * process. - * - * @deprecated this value has been removed as of 1.23.1 of the semantic conventions. - */ - @Deprecated - public static final String PROCESS = "process"; - - private MessagingOperationValues() { - } - } - - public static final class MessagingRocketmqConsumptionModelValues { - /** Clustering consumption model. */ - public static final String CLUSTERING = "clustering"; - - /** Broadcasting consumption model. */ - public static final String BROADCASTING = "broadcasting"; - - private MessagingRocketmqConsumptionModelValues() { - } - } - - public static final class MessagingRocketmqMessageTypeValues { - /** Normal message. */ - public static final String NORMAL = "normal"; - - /** FIFO message. */ - public static final String FIFO = "fifo"; - - /** Delay message. */ - public static final String DELAY = "delay"; - - /** Transaction message. */ - public static final String TRANSACTION = "transaction"; - - private MessagingRocketmqMessageTypeValues() { - } - } - - public static final class NetworkConnectionSubtypeValues { - /** GPRS. */ - public static final String GPRS = "gprs"; - - /** EDGE. */ - public static final String EDGE = "edge"; - - /** UMTS. */ - public static final String UMTS = "umts"; - - /** CDMA. */ - public static final String CDMA = "cdma"; - - /** EVDO Rel. 0. */ - public static final String EVDO_0 = "evdo_0"; - - /** EVDO Rev. A. */ - public static final String EVDO_A = "evdo_a"; - - /** CDMA2000 1XRTT. */ - public static final String CDMA2000_1XRTT = "cdma2000_1xrtt"; - - /** HSDPA. */ - public static final String HSDPA = "hsdpa"; - - /** HSUPA. */ - public static final String HSUPA = "hsupa"; - - /** HSPA. */ - public static final String HSPA = "hspa"; - - /** IDEN. */ - public static final String IDEN = "iden"; - - /** EVDO Rev. B. */ - public static final String EVDO_B = "evdo_b"; - - /** LTE. */ - public static final String LTE = "lte"; - - /** EHRPD. */ - public static final String EHRPD = "ehrpd"; - - /** HSPAP. */ - public static final String HSPAP = "hspap"; - - /** GSM. */ - public static final String GSM = "gsm"; - - /** TD-SCDMA. */ - public static final String TD_SCDMA = "td_scdma"; - - /** IWLAN. */ - public static final String IWLAN = "iwlan"; - - /** 5G NR (New Radio). */ - public static final String NR = "nr"; - - /** 5G NRNSA (New Radio Non-Standalone). */ - public static final String NRNSA = "nrnsa"; - - /** LTE CA. */ - public static final String LTE_CA = "lte_ca"; - - private NetworkConnectionSubtypeValues() { - } - } - - public static final class NetworkConnectionTypeValues { - /** wifi. */ - public static final String WIFI = "wifi"; - - /** wired. */ - public static final String WIRED = "wired"; - - /** cell. */ - public static final String CELL = "cell"; - - /** unavailable. */ - public static final String UNAVAILABLE = "unavailable"; - - /** unknown. */ - public static final String UNKNOWN = "unknown"; - - private NetworkConnectionTypeValues() { - } - } - - public static final class NetworkTransportValues { - /** TCP. */ - public static final String TCP = "tcp"; - - /** UDP. */ - public static final String UDP = "udp"; - - /** Named or anonymous pipe. */ - public static final String PIPE = "pipe"; - - /** Unix domain socket. */ - public static final String UNIX = "unix"; - - private NetworkTransportValues() { - } - } - - public static final class NetworkTypeValues { - /** IPv4. */ - public static final String IPV4 = "ipv4"; - - /** IPv6. */ - public static final String IPV6 = "ipv6"; - - private NetworkTypeValues() { - } - } - - public static final class RpcConnectRpcErrorCodeValues { - /** cancelled. */ - public static final String CANCELLED = "cancelled"; - - /** unknown. */ - public static final String UNKNOWN = "unknown"; - - /** invalid_argument. */ - public static final String INVALID_ARGUMENT = "invalid_argument"; - - /** deadline_exceeded. */ - public static final String DEADLINE_EXCEEDED = "deadline_exceeded"; - - /** not_found. */ - public static final String NOT_FOUND = "not_found"; - - /** already_exists. */ - public static final String ALREADY_EXISTS = "already_exists"; - - /** permission_denied. */ - public static final String PERMISSION_DENIED = "permission_denied"; - - /** resource_exhausted. */ - public static final String RESOURCE_EXHAUSTED = "resource_exhausted"; - - /** failed_precondition. */ - public static final String FAILED_PRECONDITION = "failed_precondition"; - - /** aborted. */ - public static final String ABORTED = "aborted"; - - /** out_of_range. */ - public static final String OUT_OF_RANGE = "out_of_range"; - - /** unimplemented. */ - public static final String UNIMPLEMENTED = "unimplemented"; - - /** internal. */ - public static final String INTERNAL = "internal"; - - /** unavailable. */ - public static final String UNAVAILABLE = "unavailable"; - - /** data_loss. */ - public static final String DATA_LOSS = "data_loss"; - - /** unauthenticated. */ - public static final String UNAUTHENTICATED = "unauthenticated"; - - private RpcConnectRpcErrorCodeValues() { - } - } - - public static final class RpcGrpcStatusCodeValues { - /** OK. */ - public static final long OK = 0; - - /** CANCELLED. */ - public static final long CANCELLED = 1; - - /** UNKNOWN. */ - public static final long UNKNOWN = 2; - - /** INVALID_ARGUMENT. */ - public static final long INVALID_ARGUMENT = 3; - - /** DEADLINE_EXCEEDED. */ - public static final long DEADLINE_EXCEEDED = 4; - - /** NOT_FOUND. */ - public static final long NOT_FOUND = 5; - - /** ALREADY_EXISTS. */ - public static final long ALREADY_EXISTS = 6; - - /** PERMISSION_DENIED. */ - public static final long PERMISSION_DENIED = 7; - - /** RESOURCE_EXHAUSTED. */ - public static final long RESOURCE_EXHAUSTED = 8; - - /** FAILED_PRECONDITION. */ - public static final long FAILED_PRECONDITION = 9; - - /** ABORTED. */ - public static final long ABORTED = 10; - - /** OUT_OF_RANGE. */ - public static final long OUT_OF_RANGE = 11; - - /** UNIMPLEMENTED. */ - public static final long UNIMPLEMENTED = 12; - - /** INTERNAL. */ - public static final long INTERNAL = 13; - - /** UNAVAILABLE. */ - public static final long UNAVAILABLE = 14; - - /** DATA_LOSS. */ - public static final long DATA_LOSS = 15; - - /** UNAUTHENTICATED. */ - public static final long UNAUTHENTICATED = 16; - - private RpcGrpcStatusCodeValues() { - } - } - - public static final class RpcSystemValues { - /** gRPC. */ - public static final String GRPC = "grpc"; - - /** Java RMI. */ - public static final String JAVA_RMI = "java_rmi"; - - /** .NET WCF. */ - public static final String DOTNET_WCF = "dotnet_wcf"; - - /** Apache Dubbo. */ - public static final String APACHE_DUBBO = "apache_dubbo"; - - /** Connect RPC. */ - public static final String CONNECT_RPC = "connect_rpc"; - - private RpcSystemValues() { - } - } - - public static final class OpentracingRefTypeValues { - /** The parent Span depends on the child Span in some capacity. */ - public static final String CHILD_OF = "child_of"; - - /** The parent Span doesn't depend in any way on the result of the child Span. */ - public static final String FOLLOWS_FROM = "follows_from"; - - private OpentracingRefTypeValues() { - } - } - - public static final class DbSystemValues { - /** Some other SQL database. Fallback only. See notes. */ - public static final String OTHER_SQL = "other_sql"; - - /** Microsoft SQL Server. */ - public static final String MSSQL = "mssql"; - - /** Microsoft SQL Server Compact. */ - public static final String MSSQLCOMPACT = "mssqlcompact"; - - /** MySQL. */ - public static final String MYSQL = "mysql"; - - /** Oracle Database. */ - public static final String ORACLE = "oracle"; - - /** IBM Db2. */ - public static final String DB2 = "db2"; - - /** PostgreSQL. */ - public static final String POSTGRESQL = "postgresql"; - - /** Amazon Redshift. */ - public static final String REDSHIFT = "redshift"; - - /** Apache Hive. */ - public static final String HIVE = "hive"; - - /** Cloudscape. */ - public static final String CLOUDSCAPE = "cloudscape"; - - /** HyperSQL DataBase. */ - public static final String HSQLDB = "hsqldb"; - - /** Progress Database. */ - public static final String PROGRESS = "progress"; - - /** SAP MaxDB. */ - public static final String MAXDB = "maxdb"; - - /** SAP HANA. */ - public static final String HANADB = "hanadb"; - - /** Ingres. */ - public static final String INGRES = "ingres"; - - /** FirstSQL. */ - public static final String FIRSTSQL = "firstsql"; - - /** EnterpriseDB. */ - public static final String EDB = "edb"; - - /** InterSystems Caché. */ - public static final String CACHE = "cache"; - - /** Adabas (Adaptable Database System). */ - public static final String ADABAS = "adabas"; - - /** Firebird. */ - public static final String FIREBIRD = "firebird"; - - /** Apache Derby. */ - public static final String DERBY = "derby"; - - /** FileMaker. */ - public static final String FILEMAKER = "filemaker"; - - /** Informix. */ - public static final String INFORMIX = "informix"; - - /** InstantDB. */ - public static final String INSTANTDB = "instantdb"; - - /** InterBase. */ - public static final String INTERBASE = "interbase"; - - /** MariaDB. */ - public static final String MARIADB = "mariadb"; - - /** Netezza. */ - public static final String NETEZZA = "netezza"; - - /** Pervasive PSQL. */ - public static final String PERVASIVE = "pervasive"; - - /** PointBase. */ - public static final String POINTBASE = "pointbase"; - - /** SQLite. */ - public static final String SQLITE = "sqlite"; - - /** Sybase. */ - public static final String SYBASE = "sybase"; - - /** Teradata. */ - public static final String TERADATA = "teradata"; - - /** Vertica. */ - public static final String VERTICA = "vertica"; - - /** H2. */ - public static final String H2 = "h2"; - - /** ColdFusion IMQ. */ - public static final String COLDFUSION = "coldfusion"; - - /** Apache Cassandra. */ - public static final String CASSANDRA = "cassandra"; - - /** Apache HBase. */ - public static final String HBASE = "hbase"; - - /** MongoDB. */ - public static final String MONGODB = "mongodb"; - - /** Redis. */ - public static final String REDIS = "redis"; - - /** Couchbase. */ - public static final String COUCHBASE = "couchbase"; - - /** CouchDB. */ - public static final String COUCHDB = "couchdb"; - - /** Microsoft Azure Cosmos DB. */ - public static final String COSMOSDB = "cosmosdb"; - - /** Amazon DynamoDB. */ - public static final String DYNAMODB = "dynamodb"; - - /** Neo4j. */ - public static final String NEO4J = "neo4j"; - - /** Apache Geode. */ - public static final String GEODE = "geode"; - - /** Elasticsearch. */ - public static final String ELASTICSEARCH = "elasticsearch"; - - /** Memcached. */ - public static final String MEMCACHED = "memcached"; - - /** CockroachDB. */ - public static final String COCKROACHDB = "cockroachdb"; - - /** OpenSearch. */ - public static final String OPENSEARCH = "opensearch"; - - /** ClickHouse. */ - public static final String CLICKHOUSE = "clickhouse"; - - /** Cloud Spanner. */ - public static final String SPANNER = "spanner"; - - /** Trino. */ - public static final String TRINO = "trino"; - - private DbSystemValues() { - } - } - - public static final class DbCassandraConsistencyLevelValues { - /** all. */ - public static final String ALL = "all"; - - /** each_quorum. */ - public static final String EACH_QUORUM = "each_quorum"; - - /** quorum. */ - public static final String QUORUM = "quorum"; - - /** local_quorum. */ - public static final String LOCAL_QUORUM = "local_quorum"; - - /** one. */ - public static final String ONE = "one"; - - /** two. */ - public static final String TWO = "two"; - - /** three. */ - public static final String THREE = "three"; - - /** local_one. */ - public static final String LOCAL_ONE = "local_one"; - - /** any. */ - public static final String ANY = "any"; - - /** serial. */ - public static final String SERIAL = "serial"; - - /** local_serial. */ - public static final String LOCAL_SERIAL = "local_serial"; - - private DbCassandraConsistencyLevelValues() { - } - } - - public static final class DbCosmosdbConnectionModeValues { - /** Gateway (HTTP) connections mode. */ - public static final String GATEWAY = "gateway"; - - /** Direct connection. */ - public static final String DIRECT = "direct"; - - private DbCosmosdbConnectionModeValues() { - } - } - - public static final class DbCosmosdbOperationTypeValues { - /** invalid. */ - public static final String INVALID = "Invalid"; - - /** create. */ - public static final String CREATE = "Create"; - - /** patch. */ - public static final String PATCH = "Patch"; - - /** read. */ - public static final String READ = "Read"; - - /** read_feed. */ - public static final String READ_FEED = "ReadFeed"; - - /** delete. */ - public static final String DELETE = "Delete"; - - /** replace. */ - public static final String REPLACE = "Replace"; - - /** execute. */ - public static final String EXECUTE = "Execute"; - - /** query. */ - public static final String QUERY = "Query"; - - /** head. */ - public static final String HEAD = "Head"; - - /** head_feed. */ - public static final String HEAD_FEED = "HeadFeed"; - - /** upsert. */ - public static final String UPSERT = "Upsert"; - - /** batch. */ - public static final String BATCH = "Batch"; - - /** query_plan. */ - public static final String QUERY_PLAN = "QueryPlan"; - - /** execute_javascript. */ - public static final String EXECUTE_JAVASCRIPT = "ExecuteJavaScript"; - - private DbCosmosdbOperationTypeValues() { - } - } - - public static final class OtelStatusCodeValues { - /** - * The operation has been validated by an Application developer or Operator to have completed - * successfully. - */ - public static final String OK = "OK"; - - /** The operation contains an error. */ - public static final String ERROR = "ERROR"; - - private OtelStatusCodeValues() { - } - } - - public static final class FaasDocumentOperationValues { - /** When a new object is created. */ - public static final String INSERT = "insert"; - - /** When an object is modified. */ - public static final String EDIT = "edit"; - - /** When an object is deleted. */ - public static final String DELETE = "delete"; - - private FaasDocumentOperationValues() { - } - } - - public static final class GraphqlOperationTypeValues { - /** GraphQL query. */ - public static final String QUERY = "query"; - - /** GraphQL mutation. */ - public static final String MUTATION = "mutation"; - - /** GraphQL subscription. */ - public static final String SUBSCRIPTION = "subscription"; - - private GraphqlOperationTypeValues() { - } - } - - public static final class MessageTypeValues { - /** sent. */ - public static final String SENT = "SENT"; - - /** received. */ - public static final String RECEIVED = "RECEIVED"; - - private MessageTypeValues() { - } - } - - // Manually defined and not YET in the YAML - /** - * The name of an event describing an exception. - * - *

Typically an event with that name should not be manually created. Instead {@link - * io.opentelemetry.api.trace.Span#recordException(Throwable)} should be used. - */ - public static final String EXCEPTION_EVENT_NAME = "exception"; - - /** - * The name of the keyspace being accessed. - * - * @deprecated this item has been removed as of 1.8.0 of the semantic conventions. Please use - * {@link SemanticAttributes#DB_NAME} instead. - */ - @Deprecated - public static final AttributeKey DB_CASSANDRA_KEYSPACE = stringKey("db.cassandra.keyspace"); - - /** - * The HBase namespace being accessed. - * - * @deprecated this item has been removed as of 1.8.0 of the semantic conventions. Please use - * {@link SemanticAttributes#DB_NAME} instead. - */ - @Deprecated - public static final AttributeKey DB_HBASE_NAMESPACE = stringKey("db.hbase.namespace"); - - /** - * The size of the uncompressed request payload body after transport decoding. Not set if - * transport encoding not used. - * - * @deprecated this item has been removed as of 1.13.0 of the semantic conventions. Please use - * {@link SemanticAttributes#HTTP_REQUEST_CONTENT_LENGTH} instead. - */ - @Deprecated - public static final AttributeKey HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED - = longKey("http.request_content_length_uncompressed"); - - /** - * @deprecated This item has been removed as of 1.13.0 of the semantic conventions. Please use - * {@link SemanticAttributes#HTTP_RESPONSE_CONTENT_LENGTH} instead. - */ - @Deprecated - public static final AttributeKey HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED - = longKey("http.response_content_length_uncompressed"); - - /** - * @deprecated This item has been removed as of 1.13.0 of the semantic conventions. Please use - * {@link SemanticAttributes#NET_HOST_NAME} instead. - */ - @Deprecated - public static final AttributeKey HTTP_SERVER_NAME = stringKey("http.server_name"); - - /** - * @deprecated This item has been removed as of 1.13.0 of the semantic conventions. Please use - * {@link SemanticAttributes#NET_HOST_NAME} instead. - */ - @Deprecated - public static final AttributeKey HTTP_HOST = stringKey("http.host"); - - /** - * @deprecated This item has been removed as of 1.13.0 of the semantic conventions. Please use - * {@link SemanticAttributes#NET_SOCK_PEER_ADDR} instead. - */ - @Deprecated - public static final AttributeKey NET_PEER_IP = stringKey("net.peer.ip"); - - /** - * @deprecated This item has been removed as of 1.13.0 of the semantic conventions. Please use - * {@link SemanticAttributes#NET_SOCK_HOST_ADDR} instead. - */ - @Deprecated - public static final AttributeKey NET_HOST_IP = stringKey("net.host.ip"); - - /** - * The ordinal number of request re-sending attempt. - * - * @deprecated This item has been removed as of 1.15.0 of the semantic conventions. Use {@link - * SemanticAttributes#HTTP_RESEND_COUNT} instead. - */ - @Deprecated - public static final AttributeKey HTTP_RETRY_COUNT = longKey("http.retry_count"); - - /** - * A string identifying the messaging system. - * - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use {@link - * SemanticAttributes#MESSAGING_DESTINATION_NAME} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_DESTINATION = stringKey("messaging.destination"); - - /** - * A boolean that is true if the message destination is temporary. - * - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use {@link - * SemanticAttributes#MESSAGING_DESTINATION_TEMPORARY} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_TEMP_DESTINATION = booleanKey("messaging.temp_destination"); - - /** - * The name of the transport protocol. - * - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use {@link - * SemanticAttributes#NET_PROTOCOL_NAME} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_PROTOCOL = stringKey("messaging.protocol"); - - /** - * The version of the transport protocol. - * - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use {@link - * SemanticAttributes#NET_PROTOCOL_VERSION} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_PROTOCOL_VERSION = stringKey("messaging.protocol_version"); - - /** - * Connection string. - * - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. There is no - * replacement. - */ - @Deprecated - public static final AttributeKey MESSAGING_URL = stringKey("messaging.url"); - - /** - * The conversation ID identifying the conversation to which the - * message belongs, represented as a string. Sometimes called "Correlation ID". - * - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use {@link - * SemanticAttributes#MESSAGING_MESSAGE_CONVERSATION_ID} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_CONVERSATION_ID = stringKey("messaging.conversation_id"); - - /** - * RabbitMQ message routing key. - * - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use {@link - * SemanticAttributes#MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_RABBITMQ_ROUTING_KEY - = stringKey("messaging.rabbitmq.routing_key"); - - /** - * Partition the message is received from. - * - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use {@link - * SemanticAttributes#MESSAGING_KAFKA_SOURCE_PARTITION} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_KAFKA_PARTITION = longKey("messaging.kafka.partition"); - - /** - * A boolean that is true if the message is a tombstone. - * - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use {@link - * SemanticAttributes#MESSAGING_KAFKA_MESSAGE_TOMBSTONE} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_KAFKA_TOMBSTONE = booleanKey("messaging.kafka.tombstone"); - - /** - * The timestamp in milliseconds that the delay message is expected to be delivered to consumer. - * - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use {@link - * SemanticAttributes#MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_ROCKETMQ_DELIVERY_TIMESTAMP - = longKey("messaging.rocketmq.delivery_timestamp"); - - /** - * The delay time level for delay message, which determines the message delay time. - * - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use {@link - * SemanticAttributes#MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_ROCKETMQ_DELAY_TIME_LEVEL - = longKey("messaging.rocketmq.delay_time_level"); - - /** - * The name of the instrumentation scope - ({@code InstrumentationScope.Name} in OTLP). - * - * @deprecated This item has been moved, use - * io.opentelemetry.semconv.ResourceAttributes#OTEL_SCOPE_NAME instead. - */ - @Deprecated - public static final AttributeKey OTEL_SCOPE_NAME = stringKey("otel.scope.name"); - - /** - * The version of the instrumentation scope - ({@code InstrumentationScope.Version} in OTLP). - * - * @deprecated This item has been moved, use - * io.opentelemetry.semconv.ResourceAttributes#OTEL_SCOPE_VERSION instead. - */ - @Deprecated - public static final AttributeKey OTEL_SCOPE_VERSION = stringKey("otel.scope.version"); - - /** - * The execution ID of the current function execution. - * - * @deprecated This item has been renamed in 1.19.0 version of the semantic conventions. Use - * {@link SemanticAttributes#FAAS_INVOCATION_ID} instead. - */ - @Deprecated - public static final AttributeKey FAAS_EXECUTION = stringKey("faas.execution"); - - /** - * Value of the HTTP - * User-Agent header sent by the client. - * - * @deprecated This item has been renamed in 1.19.0 version of the semantic conventions. Use - * {@link SemanticAttributes#USER_AGENT_ORIGINAL} instead. - */ - @Deprecated - public static final AttributeKey HTTP_USER_AGENT = stringKey("http.user_agent"); - - /** - * Deprecated. - * - * @deprecated Deprecated, use - * io.opentelemetry.semconv.ResourceAttributes#OTEL_SCOPE_NAME attribute. - */ - @Deprecated - public static final AttributeKey OTEL_LIBRARY_NAME = stringKey("otel.library.name"); - - /** - * Deprecated. - * - * @deprecated Deprecated, use - * io.opentelemetry.semconv.ResourceAttributes#OTEL_SCOPE_VERSION attribute. - */ - @Deprecated - public static final AttributeKey OTEL_LIBRARY_VERSION = stringKey("otel.library.version"); - - /** - * Kind of HTTP protocol used. - * - * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. - */ - @Deprecated - public static final AttributeKey HTTP_FLAVOR = stringKey("http.flavor"); - - /** - * Enum definitions for {@link #HTTP_FLAVOR}. - * - * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. - */ - @Deprecated - public static final class HttpFlavorValues { - /** HTTP/1.0. */ - public static final String HTTP_1_0 = "1.0"; - - /** HTTP/1.1. */ - public static final String HTTP_1_1 = "1.1"; - - /** HTTP/2. */ - public static final String HTTP_2_0 = "2.0"; - - /** HTTP/3. */ - public static final String HTTP_3_0 = "3.0"; - - /** SPDY protocol. */ - public static final String SPDY = "SPDY"; - - /** QUIC protocol. */ - public static final String QUIC = "QUIC"; - - private HttpFlavorValues() { - } - } - - /** - * Application layer protocol used. The value SHOULD be normalized to lowercase. - * - * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. Use {@link - * SemanticAttributes#NET_PROTOCOL_NAME} instead. - */ - @Deprecated - public static final AttributeKey NET_APP_PROTOCOL_NAME = stringKey("net.app.protocol.name"); - - /** - * Version of the application layer protocol used. See note below. - * - *

Notes: - * - *

    - *
  • {@code net.app.protocol.version} refers to the version of the protocol used and might be - * different from the protocol client's version. If the HTTP client used has a version of - * {@code 0.27.2}, but sends HTTP version {@code 1.1}, this attribute should be set to - * {@code 1.1}. - *
- * - * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. Use {@link - * SemanticAttributes#NET_PROTOCOL_VERSION} instead. - */ - @Deprecated - public static final AttributeKey NET_APP_PROTOCOL_VERSION = stringKey("net.app.protocol.version"); - - /** - * The kind of message destination. - * - * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. - */ - @Deprecated - public static final AttributeKey MESSAGING_DESTINATION_KIND = stringKey("messaging.destination.kind"); - - /** - * Enum values for {@link #MESSAGING_DESTINATION_KIND}. - * - * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. - */ - @Deprecated - public static final class MessagingDestinationKindValues { - /** A message sent to a queue. */ - public static final String QUEUE = "queue"; - - /** A message sent to a topic. */ - public static final String TOPIC = "topic"; - - private MessagingDestinationKindValues() { - } - } - - /** - * The kind of message source. - * - * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. - */ - @Deprecated - public static final AttributeKey MESSAGING_SOURCE_KIND = stringKey("messaging.source.kind"); - - /** - * Enum values for {@link #MESSAGING_SOURCE_KIND}. - * - * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. - */ - @Deprecated - public static final class MessagingSourceKindValues { - /** A message received from a queue. */ - public static final String QUEUE = "queue"; - - /** A message received from a topic. */ - public static final String TOPIC = "topic"; - - private MessagingSourceKindValues() { - } - } - - /** - * The internet connection type currently being used by the host. - * - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. Use - * {@link SemanticAttributes#NETWORK_CONNECTION_TYPE} instead. - */ - @Deprecated - public static final AttributeKey NET_HOST_CONNECTION_TYPE = stringKey("net.host.connection.type"); - - /** - * This describes more details regarding the connection.type. It may be the type of cell - * technology connection, but it could be used for describing details about a wifi connection. - * - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. Use - * {@link SemanticAttributes#NETWORK_CONNECTION_SUBTYPE} instead. - */ - @Deprecated - public static final AttributeKey NET_HOST_CONNECTION_SUBTYPE = stringKey("net.host.connection.subtype"); - - /** - * The name of the mobile carrier. - * - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. Use - * {@link SemanticAttributes#NETWORK_CARRIER_NAME} instead. - */ - @Deprecated - public static final AttributeKey NET_HOST_CARRIER_NAME = stringKey("net.host.carrier.name"); - - /** - * The mobile carrier country code. - * - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. Use - * {@link SemanticAttributes#NETWORK_CARRIER_MCC} instead. - */ - @Deprecated - public static final AttributeKey NET_HOST_CARRIER_MCC = stringKey("net.host.carrier.mcc"); - - /** - * The mobile carrier network code. - * - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. Use - * {@link SemanticAttributes#NETWORK_CARRIER_MNC} instead. - */ - @Deprecated - public static final AttributeKey NET_HOST_CARRIER_MNC = stringKey("net.host.carrier.mnc"); - - /** - * The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. - * - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. Use - * {@link SemanticAttributes#NETWORK_CARRIER_ICC} instead. - */ - @Deprecated - public static final AttributeKey NET_HOST_CARRIER_ICC = stringKey("net.host.carrier.icc"); - - /** - * The IP address of the original client behind all proxies, if known (e.g. from X-Forwarded-For). - * - *

Notes: - * - *

    - *
  • This is not necessarily the same as {@code net.sock.peer.addr}, which would identify the - * network-level peer, which may be a proxy. - *
  • This attribute should be set when a source of information different from the one used for - * {@code net.sock.peer.addr}, is available even if that other source just confirms the same - * value as {@code net.sock.peer.addr}. Rationale: For {@code net.sock.peer.addr}, one - * typically does not know if it comes from a proxy, reverse proxy, or the actual client. - * Setting {@code http.client_ip} when it's the same as {@code net.sock.peer.addr} means - * that one is at least somewhat confident that the address is not that of the closest - * proxy. - *
- * - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. Use - * {@link SemanticAttributes#CLIENT_ADDRESS} instead. - */ - @Deprecated - public static final AttributeKey HTTP_CLIENT_IP = stringKey("http.client_ip"); - - /** - * The message source name. - * - *

Notes: - * - *

    - *
  • Source name SHOULD uniquely identify a specific queue, topic, or other entity within the - * broker. If the broker does not have such notion, the source name SHOULD uniquely identify - * the broker. - *
- * - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. - */ - @Deprecated - public static final AttributeKey MESSAGING_SOURCE_NAME = stringKey("messaging.source.name"); - - /** - * Low cardinality representation of the messaging source name. - * - *

Notes: - * - *

    - *
  • Source names could be constructed from templates. An example would be a source name - * involving a user name or product id. Although the source name in this case is of high - * cardinality, the underlying template is of low cardinality and can be effectively used - * for grouping and aggregation. - *
- * - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. - */ - @Deprecated - public static final AttributeKey MESSAGING_SOURCE_TEMPLATE = stringKey("messaging.source.template"); - - /** - * A boolean that is true if the message source is temporary and might not exist anymore after - * messages are processed. - * - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. - */ - @Deprecated - public static final AttributeKey MESSAGING_SOURCE_TEMPORARY = booleanKey("messaging.source.temporary"); - - /** - * A boolean that is true if the message source is anonymous (could be unnamed or have - * auto-generated name). - * - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. - */ - @Deprecated - public static final AttributeKey MESSAGING_SOURCE_ANONYMOUS = booleanKey("messaging.source.anonymous"); - - /** - * The identifier for the consumer receiving a message. For Kafka, set it to {@code - * {messaging.kafka.consumer.group} - {messaging.kafka.client_id}}, if both are present, or only - * {@code messaging.kafka.consumer.group}. For brokers, such as RabbitMQ and Artemis, set it to - * the {@code client_id} of the client consuming the message. - * - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. See - * {@link SemanticAttributes#MESSAGING_CLIENT_ID}. - */ - @Deprecated - public static final AttributeKey MESSAGING_CONSUMER_ID = stringKey("messaging.consumer.id"); - - /** - * Client Id for the Consumer or Producer that is handling the message. - * - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. See - * {@link SemanticAttributes#MESSAGING_CLIENT_ID}. - */ - @Deprecated - public static final AttributeKey MESSAGING_KAFKA_CLIENT_ID = stringKey("messaging.kafka.client_id"); - - /** - * Partition the message is received from. - * - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. - */ - @Deprecated - public static final AttributeKey MESSAGING_KAFKA_SOURCE_PARTITION - = longKey("messaging.kafka.source.partition"); - - /** - * The unique identifier for each client. - * - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. See - * {@link SemanticAttributes#MESSAGING_CLIENT_ID}. - */ - @Deprecated - public static final AttributeKey MESSAGING_ROCKETMQ_CLIENT_ID = stringKey("messaging.rocketmq.client_id"); - - /** - * Enum values for {@link #NET_HOST_CONNECTION_TYPE}. - * - * @deprecated This item has been removed as of 1.21.0 of the semantic conventions. Use {@link - * NetworkConnectionTypeValues} instead. - */ - @Deprecated - public static final class NetHostConnectionTypeValues { - /** wifi. */ - public static final String WIFI = "wifi"; - - /** wired. */ - public static final String WIRED = "wired"; - - /** cell. */ - public static final String CELL = "cell"; - - /** unavailable. */ - public static final String UNAVAILABLE = "unavailable"; - - /** unknown. */ - public static final String UNKNOWN = "unknown"; - - private NetHostConnectionTypeValues() { - } - } - - /** - * Enum values for {@link #NET_HOST_CONNECTION_SUBTYPE}. - * - * @deprecated This item has been removed as of 1.21.0 of the semantic conventions. Use {@link - * NetworkConnectionSubtypeValues} instead. - */ - @Deprecated - public static final class NetHostConnectionSubtypeValues { - /** GPRS. */ - public static final String GPRS = "gprs"; - - /** EDGE. */ - public static final String EDGE = "edge"; - - /** UMTS. */ - public static final String UMTS = "umts"; - - /** CDMA. */ - public static final String CDMA = "cdma"; - - /** EVDO Rel. 0. */ - public static final String EVDO_0 = "evdo_0"; - - /** EVDO Rev. A. */ - public static final String EVDO_A = "evdo_a"; - - /** CDMA2000 1XRTT. */ - public static final String CDMA2000_1XRTT = "cdma2000_1xrtt"; - - /** HSDPA. */ - public static final String HSDPA = "hsdpa"; - - /** HSUPA. */ - public static final String HSUPA = "hsupa"; - - /** HSPA. */ - public static final String HSPA = "hspa"; - - /** IDEN. */ - public static final String IDEN = "iden"; - - /** EVDO Rev. B. */ - public static final String EVDO_B = "evdo_b"; - - /** LTE. */ - public static final String LTE = "lte"; - - /** EHRPD. */ - public static final String EHRPD = "ehrpd"; - - /** HSPAP. */ - public static final String HSPAP = "hspap"; - - /** GSM. */ - public static final String GSM = "gsm"; - - /** TD-SCDMA. */ - public static final String TD_SCDMA = "td_scdma"; - - /** IWLAN. */ - public static final String IWLAN = "iwlan"; - - /** 5G NR (New Radio). */ - public static final String NR = "nr"; - - /** 5G NRNSA (New Radio Non-Standalone). */ - public static final String NRNSA = "nrnsa"; - - /** LTE CA. */ - public static final String LTE_CA = "lte_ca"; - - private NetHostConnectionSubtypeValues() { - } - } - - /** - * Immediate client peer port number. - * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use {@link - * SemanticAttributes#NETWORK_PEER_PORT} on server telemetry and {@link - * SemanticAttributes#NETWORK_LOCAL_PORT} on client telemetry instead. - */ - @Deprecated - public static final AttributeKey CLIENT_SOCKET_PORT = longKey("client.socket.port"); - - /** - * Name of the memory pool. - * - *

Notes: - * - *

- * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use {@link - * SemanticAttributes#JVM_MEMORY_POOL_NAME} instead. - */ - @Deprecated - public static final AttributeKey POOL = stringKey("pool"); - - /** - * The domain name of the source system. - * - *

Notes: - * - *

    - *
  • This value may be a host name, a fully qualified domain name, or another host naming - * format. - *
- * - * @deprecated This item has been removed in 1.22.0 of the semantic conventions. - */ - @Deprecated - public static final AttributeKey SOURCE_DOMAIN = stringKey("source.domain"); - - /** - * Physical server IP address or Unix socket address. If set from the client, should simply use - * the socket's peer address, and not attempt to find any actual server IP (i.e., if set from - * client, this may represent some proxy server instead of the logical server). - * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use {@link - * SemanticAttributes#NETWORK_LOCAL_ADDRESS} on server telemetry and {@link - * SemanticAttributes#NETWORK_PEER_ADDRESS} on client telemetry instead. - */ - @Deprecated - public static final AttributeKey SERVER_SOCKET_ADDRESS = stringKey("server.socket.address"); - - /** - * The (uncompressed) size of the message payload in bytes. Also use this attribute if it is - * unknown whether the compressed or uncompressed payload size is reported. - * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use {@link - * SemanticAttributes#MESSAGING_MESSAGE_BODY_SIZE} instead. - */ - @Deprecated - public static final AttributeKey MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES - = longKey("messaging.message.payload_size_bytes"); - - /** - * The domain name of the destination system. - * - * @deprecated This item has been removed in 1.22.0 of the semantic conventions. - */ - @Deprecated - public static final AttributeKey DESTINATION_DOMAIN = stringKey("destination.domain"); - - /** - * The compressed size of the message payload in bytes. - * - * @deprecated This item has been removed in 1.22.0 of the semantic conventions. - */ - @Deprecated - public static final AttributeKey MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES - = longKey("messaging.message.payload_compressed_size_bytes"); - - /** - * The domain name of an immediate peer. - * - *

Notes: - * - *

    - *
  • Typically observed from the client side, and represents a proxy or other intermediary - * domain name. - *
- * - * @deprecated This item has been removed in 1.22.0 of the semantic conventions. - */ - @Deprecated - public static final AttributeKey SERVER_SOCKET_DOMAIN = stringKey("server.socket.domain"); - - /** - * The type of memory. - * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use {@link - * SemanticAttributes#JVM_MEMORY_TYPE} instead. - */ - @Deprecated - public static final AttributeKey TYPE = stringKey("type"); - - /** - * Physical server port. - * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use {@link - * SemanticAttributes#NETWORK_LOCAL_PORT} on server telemetry and {@link - * SemanticAttributes#NETWORK_PEER_PORT} on client telemetry instead. - */ - @Deprecated - public static final AttributeKey SERVER_SOCKET_PORT = longKey("server.socket.port"); - - /** - * Immediate client peer address - unix domain socket name, IPv4 or IPv6 address. - * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use {@link - * SemanticAttributes#NETWORK_PEER_ADDRESS} on server telemetry and {@link - * SemanticAttributes#NETWORK_LOCAL_ADDRESS} on client telemetry instead. - */ - @Deprecated - public static final AttributeKey CLIENT_SOCKET_ADDRESS = stringKey("client.socket.address"); - - /** - * @deprecated This item has been renamed as of 1.21.0 of the semantic conventions. Use {@link - * JvmMemoryTypeValues} instead. - */ - @Deprecated - public static final class TypeValues { - /** Heap memory. */ - public static final String HEAP = "heap"; - - /** Non-heap memory. */ - public static final String NON_HEAP = "non_heap"; - - private TypeValues() { - } - } - - /** - * Whether the thread is daemon or not. - * - * @deprecated This item has been renamed in 1.23.1 of the semantic conventions. Use {@link - * SemanticAttributes#JVM_THREAD_DAEMON} instead. - */ - @Deprecated - public static final AttributeKey THREAD_DAEMON = booleanKey("thread.daemon"); - - /** - * The ordinal number of request resending attempt (for any reason, including redirects). - * - *

Notes: - * - *

    - *
  • The resend count SHOULD be updated each time an HTTP request gets resent by the client, - * regardless of what was the cause of the resending (e.g. redirection, authorization - * failure, 503 Server Unavailable, network issues, or any other). - *
- * - * @deprecated This item has been renamed in 1.23.1 of the semantic conventions. Use {@link - * SemanticAttributes#HTTP_REQUEST_RESEND_COUNT} instead. - */ - @Deprecated - public static final AttributeKey HTTP_RESEND_COUNT = longKey("http.resend_count"); - - private SemanticAttributes() { - } -} diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/SpanDataMapper.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/SpanDataMapper.java index 3d1768cb68b6..98973dcfe7bf 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/SpanDataMapper.java +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/SpanDataMapper.java @@ -13,6 +13,20 @@ import com.azure.monitor.opentelemetry.autoconfigure.implementation.logging.WarningLogger; import com.azure.monitor.opentelemetry.autoconfigure.implementation.models.ContextTagKeys; import com.azure.monitor.opentelemetry.autoconfigure.implementation.models.TelemetryItem; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.ClientAttributes; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating.EnduserIncubatingAttributes; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.ExceptionAttributes; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.HttpAttributes; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating.MessagingIncubatingAttributes; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating.RpcIncubatingAttributes; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.ServerAttributes; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.UserAgentAttributes; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.UrlAttributes; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating.DbIncubatingAttributes; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating.HttpIncubatingAttributes; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating.NetIncubatingAttributes; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating.PeerIncubatingAttributes; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating.UrlIncubatingAttributes; import com.azure.monitor.opentelemetry.autoconfigure.implementation.utils.FormattedDuration; import com.azure.monitor.opentelemetry.autoconfigure.implementation.utils.FormattedTime; import com.azure.monitor.opentelemetry.autoconfigure.implementation.utils.UrlParser; @@ -47,12 +61,12 @@ public final class SpanDataMapper { // visible for testing public static final String MS_PROCESSED_BY_METRIC_EXTRACTORS = "_MS.ProcessedByMetricExtractors"; - private static final Set SQL_DB_SYSTEMS = new HashSet<>(asList(SemanticAttributes.DbSystemValues.DB2, - SemanticAttributes.DbSystemValues.DERBY, SemanticAttributes.DbSystemValues.MARIADB, - SemanticAttributes.DbSystemValues.MSSQL, SemanticAttributes.DbSystemValues.MYSQL, - SemanticAttributes.DbSystemValues.ORACLE, SemanticAttributes.DbSystemValues.POSTGRESQL, - SemanticAttributes.DbSystemValues.SQLITE, SemanticAttributes.DbSystemValues.OTHER_SQL, - SemanticAttributes.DbSystemValues.HSQLDB, SemanticAttributes.DbSystemValues.H2)); + private static final Set SQL_DB_SYSTEMS = new HashSet<>(asList(DbIncubatingAttributes.DbSystemValues.DB2, + DbIncubatingAttributes.DbSystemValues.DERBY, DbIncubatingAttributes.DbSystemValues.MARIADB, + DbIncubatingAttributes.DbSystemValues.MSSQL, DbIncubatingAttributes.DbSystemValues.MYSQL, + DbIncubatingAttributes.DbSystemValues.ORACLE, DbIncubatingAttributes.DbSystemValues.POSTGRESQL, + DbIncubatingAttributes.DbSystemValues.SQLITE, DbIncubatingAttributes.DbSystemValues.OTHER_SQL, + DbIncubatingAttributes.DbSystemValues.HSQLDB, DbIncubatingAttributes.DbSystemValues.H2)); // this is needed until Azure SDK moves to latest OTel semantic conventions private static final String COSMOS = "Cosmos"; @@ -71,7 +85,7 @@ public final class SpanDataMapper { .ignoreExact(AiSemanticAttributes.AZURE_SDK_ENQUEUED_TIME.getKey()) .ignoreExact(AiSemanticAttributes.KAFKA_RECORD_QUEUE_TIME_MS.getKey()) .ignoreExact(AiSemanticAttributes.KAFKA_OFFSET.getKey()) - .exact(SemanticAttributes.USER_AGENT_ORIGINAL.getKey(), (builder, value) -> { + .exact(UserAgentAttributes.USER_AGENT_ORIGINAL.getKey(), (builder, value) -> { if (value instanceof String) { builder.addTag("ai.user.userAgent", (String) value); } @@ -177,8 +191,8 @@ private TelemetryItem exportRemoteDependency(SpanData span, boolean inProc, @Nul private static String getDependencyName(SpanData span) { String name = span.getName(); - String method = getStableOrOldAttribute(span.getAttributes(), SemanticAttributes.HTTP_REQUEST_METHOD, - SemanticAttributes.HTTP_METHOD); + String method = getStableOrOldAttribute(span.getAttributes(), HttpAttributes.HTTP_REQUEST_METHOD, + HttpIncubatingAttributes.HTTP_METHOD); if (method == null) { return name; } @@ -188,7 +202,7 @@ private static String getDependencyName(SpanData span) { } String url - = getStableOrOldAttribute(span.getAttributes(), SemanticAttributes.URL_FULL, SemanticAttributes.HTTP_URL); + = getStableOrOldAttribute(span.getAttributes(), UrlAttributes.URL_FULL, UrlIncubatingAttributes.URL_FULL); if (url == null) { return name; } @@ -202,18 +216,18 @@ private static String getDependencyName(SpanData span) { private static void applySemanticConventions(RemoteDependencyTelemetryBuilder telemetryBuilder, SpanData span) { Attributes attributes = span.getAttributes(); - String httpMethod = getStableOrOldAttribute(attributes, SemanticAttributes.HTTP_REQUEST_METHOD, - SemanticAttributes.HTTP_METHOD); + String httpMethod = getStableOrOldAttribute(attributes, HttpAttributes.HTTP_REQUEST_METHOD, + HttpIncubatingAttributes.HTTP_METHOD); if (httpMethod != null) { applyHttpClientSpan(telemetryBuilder, attributes); return; } - String rpcSystem = attributes.get(SemanticAttributes.RPC_SYSTEM); + String rpcSystem = attributes.get(RpcIncubatingAttributes.RPC_SYSTEM); if (rpcSystem != null) { applyRpcClientSpan(telemetryBuilder, rpcSystem, attributes); return; } - String dbSystem = attributes.get(SemanticAttributes.DB_SYSTEM); + String dbSystem = attributes.get(DbIncubatingAttributes.DB_SYSTEM); if (dbSystem == null) { // special case needed until Azure SDK moves to latest OTel semantic conventions dbSystem = attributes.get(AiSemanticAttributes.AZURE_SDK_DB_TYPE); @@ -252,7 +266,7 @@ private static String getMessagingSystem(Attributes attributes) { // special case needed until Azure SDK moves to OTel semantic conventions return azureNamespace; } - return attributes.get(SemanticAttributes.MESSAGING_SYSTEM); + return attributes.get(MessagingIncubatingAttributes.MESSAGING_SYSTEM); } private static void setOperationTags(AbstractTelemetryBuilder telemetryBuilder, SpanData span) { @@ -284,15 +298,15 @@ private static void setOperationName(AbstractTelemetryBuilder telemetryBuilder, private static void applyHttpClientSpan(RemoteDependencyTelemetryBuilder telemetryBuilder, Attributes attributes) { - String httpUrl = getStableOrOldAttribute(attributes, SemanticAttributes.URL_FULL, SemanticAttributes.HTTP_URL); + String httpUrl = getStableOrOldAttribute(attributes, UrlAttributes.URL_FULL, HttpIncubatingAttributes.HTTP_URL); int defaultPort = getDefaultPortForHttpUrl(httpUrl); String target = getTargetOrDefault(attributes, defaultPort, "Http"); telemetryBuilder.setType("Http"); telemetryBuilder.setTarget(target); - Long httpStatusCode = getStableOrOldAttribute(attributes, SemanticAttributes.HTTP_RESPONSE_STATUS_CODE, - SemanticAttributes.HTTP_STATUS_CODE); + Long httpStatusCode = getStableOrOldAttribute(attributes, HttpAttributes.HTTP_RESPONSE_STATUS_CODE, + HttpIncubatingAttributes.HTTP_STATUS_CODE); if (httpStatusCode != null) { telemetryBuilder.setResultCode(Long.toString(httpStatusCode)); } else { @@ -338,13 +352,13 @@ public static String getTargetOrDefault(Attributes attributes, int defaultPort, @Nullable private static String getTargetOrNullStableSemconv(Attributes attributes, int defaultPort) { - String peerService = attributes.get(SemanticAttributes.PEER_SERVICE); // this isn't part of stable semconv, but still has priority for now + String peerService = attributes.get(PeerIncubatingAttributes.PEER_SERVICE); // this isn't part of stable semconv, but still has priority for now if (peerService != null) { return peerService; } - String host = attributes.get(SemanticAttributes.SERVER_ADDRESS); + String host = attributes.get(ServerAttributes.SERVER_ADDRESS); if (host != null) { - Long port = attributes.get(SemanticAttributes.SERVER_PORT); + Long port = attributes.get(ServerAttributes.SERVER_PORT); return getTarget(host, port, defaultPort); } return null; @@ -352,24 +366,24 @@ private static String getTargetOrNullStableSemconv(Attributes attributes, int de @Nullable private static String getTargetOrNullOldSemconv(Attributes attributes, int defaultPort) { - String peerService = attributes.get(SemanticAttributes.PEER_SERVICE); + String peerService = attributes.get(PeerIncubatingAttributes.PEER_SERVICE); if (peerService != null) { return peerService; } - String host = attributes.get(SemanticAttributes.NET_PEER_NAME); + String host = attributes.get(NetIncubatingAttributes.NET_PEER_NAME); if (host != null) { - Long port = attributes.get(SemanticAttributes.NET_PEER_PORT); + Long port = attributes.get(NetIncubatingAttributes.NET_PEER_PORT); return getTarget(host, port, defaultPort); } - host = attributes.get(SemanticAttributes.NET_SOCK_PEER_NAME); + host = attributes.get(NetIncubatingAttributes.NET_SOCK_PEER_NAME); if (host == null) { - host = attributes.get(SemanticAttributes.NET_SOCK_PEER_ADDR); + host = attributes.get(NetIncubatingAttributes.NET_SOCK_PEER_ADDR); } if (host != null) { - Long port = attributes.get(SemanticAttributes.NET_SOCK_PEER_PORT); + Long port = attributes.get(NetIncubatingAttributes.NET_SOCK_PEER_PORT); return getTarget(host, port, defaultPort); } - String httpUrl = attributes.get(SemanticAttributes.HTTP_URL); + String httpUrl = attributes.get(HttpIncubatingAttributes.HTTP_URL); if (httpUrl != null) { // this is needed for instrumentations which don't yet follow the latest OpenTelemetry // semantic attributes (in particular Azure SDK instrumentation) @@ -388,15 +402,15 @@ private static String getTarget(String host, @Nullable Long port, int defaultPor private static void applyDatabaseClientSpan(RemoteDependencyTelemetryBuilder telemetryBuilder, String dbSystem, Attributes attributes) { - String dbStatement = attributes.get(SemanticAttributes.DB_STATEMENT); + String dbStatement = attributes.get(DbIncubatingAttributes.DB_STATEMENT); if (dbStatement == null) { - dbStatement = attributes.get(SemanticAttributes.DB_OPERATION); + dbStatement = attributes.get(DbIncubatingAttributes.DB_OPERATION); } String type; if (SQL_DB_SYSTEMS.contains(dbSystem)) { - if (dbSystem.equals(SemanticAttributes.DbSystemValues.MYSQL)) { + if (dbSystem.equals(DbIncubatingAttributes.DbSystemValues.MYSQL)) { type = "mysql"; // this has special icon in portal - } else if (dbSystem.equals(SemanticAttributes.DbSystemValues.POSTGRESQL)) { + } else if (dbSystem.equals(DbIncubatingAttributes.DbSystemValues.POSTGRESQL)) { type = "postgresql"; // this has special icon in portal } else { type = "SQL"; @@ -423,7 +437,7 @@ private static void applyDatabaseClientSpan(RemoteDependencyTelemetryBuilder tel dbName = attributes.get(AiSemanticAttributes.AZURE_SDK_DB_INSTANCE); } else { target = getTargetOrDefault(attributes, getDefaultPortForDbSystem(dbSystem), dbSystem); - dbName = attributes.get(SemanticAttributes.DB_NAME); + dbName = attributes.get(DbIncubatingAttributes.DB_NAME); } target = nullAwareConcat(target, dbName, " | "); if (target == null) { @@ -449,35 +463,35 @@ private static int getDefaultPortForDbSystem(String dbSystem) { // TODO (trask) make the ports constants (at least in JdbcConnectionUrlParser) so they can be // used here switch (dbSystem) { - case SemanticAttributes.DbSystemValues.MONGODB: + case DbIncubatingAttributes.DbSystemValues.MONGODB: return 27017; - case SemanticAttributes.DbSystemValues.CASSANDRA: + case DbIncubatingAttributes.DbSystemValues.CASSANDRA: return 9042; - case SemanticAttributes.DbSystemValues.REDIS: + case DbIncubatingAttributes.DbSystemValues.REDIS: return 6379; - case SemanticAttributes.DbSystemValues.MARIADB: - case SemanticAttributes.DbSystemValues.MYSQL: + case DbIncubatingAttributes.DbSystemValues.MARIADB: + case DbIncubatingAttributes.DbSystemValues.MYSQL: return 3306; - case SemanticAttributes.DbSystemValues.MSSQL: + case DbIncubatingAttributes.DbSystemValues.MSSQL: return 1433; - case SemanticAttributes.DbSystemValues.DB2: + case DbIncubatingAttributes.DbSystemValues.DB2: return 50000; - case SemanticAttributes.DbSystemValues.ORACLE: + case DbIncubatingAttributes.DbSystemValues.ORACLE: return 1521; - case SemanticAttributes.DbSystemValues.H2: + case DbIncubatingAttributes.DbSystemValues.H2: return 8082; - case SemanticAttributes.DbSystemValues.DERBY: + case DbIncubatingAttributes.DbSystemValues.DERBY: return 1527; - case SemanticAttributes.DbSystemValues.POSTGRESQL: + case DbIncubatingAttributes.DbSystemValues.POSTGRESQL: return 5432; default: @@ -530,10 +544,10 @@ private TelemetryItem exportRequest(SpanData span, @Nullable Double sampleRate) telemetryBuilder.setUrl(httpUrl); } - Long httpStatusCode = getStableOrOldAttribute(attributes, SemanticAttributes.HTTP_RESPONSE_STATUS_CODE, - SemanticAttributes.HTTP_STATUS_CODE); + Long httpStatusCode = getStableOrOldAttribute(attributes, HttpAttributes.HTTP_RESPONSE_STATUS_CODE, + HttpIncubatingAttributes.HTTP_STATUS_CODE); if (httpStatusCode == null) { - httpStatusCode = attributes.get(SemanticAttributes.RPC_GRPC_STATUS_CODE); + httpStatusCode = attributes.get(RpcIncubatingAttributes.RPC_GRPC_STATUS_CODE); } if (httpStatusCode != null) { telemetryBuilder.setResponseCode(Long.toString(httpStatusCode)); @@ -541,11 +555,11 @@ private TelemetryItem exportRequest(SpanData span, @Nullable Double sampleRate) telemetryBuilder.setResponseCode("0"); } - String locationIp - = getStableOrOldAttribute(attributes, SemanticAttributes.CLIENT_ADDRESS, SemanticAttributes.HTTP_CLIENT_IP); + String locationIp = getStableOrOldAttribute(attributes, ClientAttributes.CLIENT_ADDRESS, + HttpIncubatingAttributes.HTTP_CLIENT_IP); if (locationIp == null) { // only use net.peer.ip if http.client_ip is not available - locationIp = attributes.get(SemanticAttributes.NET_SOCK_PEER_ADDR); + locationIp = attributes.get(NetIncubatingAttributes.NET_SOCK_PEER_ADDR); } if (locationIp != null) { telemetryBuilder.addTag(ContextTagKeys.AI_LOCATION_IP.toString(), locationIp); @@ -604,7 +618,7 @@ private boolean getSuccess(SpanData span) { case UNSET: if (captureHttpServer4xxAsError) { Long statusCode = getStableOrOldAttribute(span.getAttributes(), - SemanticAttributes.HTTP_RESPONSE_STATUS_CODE, SemanticAttributes.HTTP_STATUS_CODE); + HttpAttributes.HTTP_RESPONSE_STATUS_CODE, HttpIncubatingAttributes.HTTP_STATUS_CODE); return statusCode == null || statusCode < 400; } return true; @@ -623,20 +637,20 @@ public static String getHttpUrlFromServerSpan(Attributes attributes) { @Nullable private static String getHttpUrlFromServerSpanStableSemconv(Attributes attributes) { - String scheme = attributes.get(SemanticAttributes.URL_SCHEME); + String scheme = attributes.get(UrlAttributes.URL_SCHEME); if (scheme == null) { return null; } - String host = attributes.get(SemanticAttributes.SERVER_ADDRESS); + String host = attributes.get(ServerAttributes.SERVER_ADDRESS); if (host == null) { return null; } - Long port = attributes.get(SemanticAttributes.SERVER_PORT); - String path = attributes.get(SemanticAttributes.URL_PATH); + Long port = attributes.get(ServerAttributes.SERVER_PORT); + String path = attributes.get(UrlAttributes.URL_PATH); if (path == null) { return null; } - String query = attributes.get(SemanticAttributes.URL_QUERY); + String query = attributes.get(UrlAttributes.URL_QUERY); int len = scheme.length() + host.length() + path.length(); if (port != null) { @@ -668,20 +682,20 @@ private static boolean isDefaultPortForScheme(Long port, String scheme) { @Nullable private static String getHttpUrlFromServerSpanOldSemconv(Attributes attributes) { - String httpUrl = attributes.get(SemanticAttributes.HTTP_URL); + String httpUrl = attributes.get(HttpIncubatingAttributes.HTTP_URL); if (httpUrl != null) { return httpUrl; } - String scheme = attributes.get(SemanticAttributes.HTTP_SCHEME); + String scheme = attributes.get(HttpIncubatingAttributes.HTTP_SCHEME); if (scheme == null) { return null; } - String target = attributes.get(SemanticAttributes.HTTP_TARGET); + String target = attributes.get(HttpIncubatingAttributes.HTTP_TARGET); if (target == null) { return null; } - String host = attributes.get(SemanticAttributes.NET_HOST_NAME); - Long port = attributes.get(SemanticAttributes.NET_HOST_PORT); + String host = attributes.get(NetIncubatingAttributes.NET_HOST_NAME); + Long port = attributes.get(NetIncubatingAttributes.NET_HOST_PORT); if (port != null && port > 0) { return scheme + "://" + host + ":" + port + target; } @@ -719,7 +733,7 @@ private static String getMessagingTargetSource(Attributes attributes) { } // TODO (trask) AI mapping: should this pass default port for messaging.system? String source = nullAwareConcat(getTargetOrNullOldSemconv(attributes, Integer.MAX_VALUE), - attributes.get(SemanticAttributes.MESSAGING_DESTINATION_NAME), "/"); + attributes.get(MessagingIncubatingAttributes.MESSAGING_DESTINATION_NAME), "/"); if (source != null) { return source; } @@ -757,14 +771,14 @@ private void exportEvents(SpanData span, @Nullable String operationName, @Nullab continue; } - if (event.getAttributes().get(SemanticAttributes.EXCEPTION_TYPE) != null - || event.getAttributes().get(SemanticAttributes.EXCEPTION_MESSAGE) != null) { + if (event.getAttributes().get(ExceptionAttributes.EXCEPTION_TYPE) != null + || event.getAttributes().get(ExceptionAttributes.EXCEPTION_MESSAGE) != null) { SpanContext parentSpanContext = span.getParentSpanContext(); // Application Insights expects exception records to be "top-level" exceptions // not just any exception that bubbles up if (!parentSpanContext.isValid() || parentSpanContext.isRemote()) { // TODO (trask) map OpenTelemetry exception to Application Insights exception better - String stacktrace = event.getAttributes().get(SemanticAttributes.EXCEPTION_STACKTRACE); + String stacktrace = event.getAttributes().get(ExceptionAttributes.EXCEPTION_STACKTRACE); if (stacktrace != null && !shouldSuppress.test(span, event)) { String exceptionLogged = span.getAttributes().get(AiSemanticAttributes.LOGGED_EXCEPTION); if (!stacktrace.equals(exceptionLogged)) { @@ -820,7 +834,7 @@ private TelemetryItem createExceptionTelemetryItem(EventData event, SpanData spa MAPPINGS.map(span.getAttributes(), telemetryBuilder); // set exception-specific properties - String errorStack = event.getAttributes().get(SemanticAttributes.EXCEPTION_STACKTRACE); + String errorStack = event.getAttributes().get(ExceptionAttributes.EXCEPTION_STACKTRACE); setExceptions(errorStack, event.getAttributes(), telemetryBuilder); return telemetryBuilder.build(); @@ -828,11 +842,11 @@ private TelemetryItem createExceptionTelemetryItem(EventData event, SpanData spa static void setExceptions(String stack, Attributes attributes, ExceptionTelemetryBuilder telemetryBuilder) { ExceptionDetailBuilder builder = new ExceptionDetailBuilder(); - String type = attributes.get(SemanticAttributes.EXCEPTION_TYPE); + String type = attributes.get(ExceptionAttributes.EXCEPTION_TYPE); if (type != null && !type.isEmpty()) { builder.setTypeName(type); } - String message = attributes.get(SemanticAttributes.EXCEPTION_MESSAGE); + String message = attributes.get(ExceptionAttributes.EXCEPTION_MESSAGE); if (message != null && !message.isEmpty()) { builder.setMessage(message); } else { @@ -888,11 +902,11 @@ private static void addLinks(AbstractTelemetryBuilder telemetryBuilder, List { + mappingsBuilder.exact(EnduserIncubatingAttributes.ENDUSER_ID.getKey(), (telemetryBuilder, value) -> { if (value instanceof String) { telemetryBuilder.addTag(ContextTagKeys.AI_USER_AUTH_USER_ID.toString(), (String) value); } - }).exact(SemanticAttributes.ENDUSER_PSEUDO_ID.getKey(), (telemetryBuilder, value) -> { + }).exact(EnduserIncubatingAttributes.ENDUSER_PSEUDO_ID.getKey(), (telemetryBuilder, value) -> { if (value instanceof String) { telemetryBuilder.addTag(ContextTagKeys.AI_USER_ID.toString(), (String) value); } diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/AttributeKeyTemplate.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/AttributeKeyTemplate.java new file mode 100644 index 000000000000..8d43644c314f --- /dev/null +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/AttributeKeyTemplate.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv; + +import io.opentelemetry.api.common.AttributeKey; +import io.opentelemetry.api.common.AttributeType; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.function.Function; + +// this is a copy of io.opentelemetry.semconv.AttributeKeyTemplate (1.37.0) + +/** + * This class provides a handle for creating and caching dynamic / template-type attributes of the + * form <prefix>.<key>. The <prefix> is fixed for a template instance while + * {@link AttributeKey}s can be created and are cached for different values of the <key> part. + * + *

An example template-type attribute is the set of attributes for HTTP headers: + * http.request.header.<key> + * + * @param The type of the nested {@link AttributeKey}s. + */ +public final class AttributeKeyTemplate { + + private final String prefix; + private final Function> keyBuilder; + private final ConcurrentMap> keysCache = new ConcurrentHashMap<>(1); + + private AttributeKeyTemplate(String prefix, Function> keyBuilder) { + this.prefix = prefix; + this.keyBuilder = keyBuilder; + } + + /** + * Create an {@link AttributeKeyTemplate} with type {@link AttributeType#STRING} and the given + * {@code prefix}. + */ + public static AttributeKeyTemplate stringKeyTemplate(String prefix) { + return new AttributeKeyTemplate<>(prefix, AttributeKey::stringKey); + } + + /** + * Create an {@link AttributeKeyTemplate} with type {@link AttributeType#STRING_ARRAY} and the + * given {@code prefix}. + */ + public static AttributeKeyTemplate> stringArrayKeyTemplate(String prefix) { + return new AttributeKeyTemplate<>(prefix, AttributeKey::stringArrayKey); + } + + /** + * Create an {@link AttributeKeyTemplate} with type {@link AttributeType#BOOLEAN} and the given + * {@code prefix}. + */ + public static AttributeKeyTemplate booleanKeyTemplate(String prefix) { + return new AttributeKeyTemplate<>(prefix, AttributeKey::booleanKey); + } + + /** + * Create an {@link AttributeKeyTemplate} with type {@link AttributeType#BOOLEAN_ARRAY} and the + * given {@code prefix}. + */ + public static AttributeKeyTemplate> booleanArrayKeyTemplate(String prefix) { + return new AttributeKeyTemplate<>(prefix, AttributeKey::booleanArrayKey); + } + + /** + * Create an {@link AttributeKeyTemplate} with type {@link AttributeType#LONG} and the given + * {@code prefix}. + */ + public static AttributeKeyTemplate longKeyTemplate(String prefix) { + return new AttributeKeyTemplate<>(prefix, AttributeKey::longKey); + } + + /** + * Create an {@link AttributeKeyTemplate} with type {@link AttributeType#LONG_ARRAY} and the given + * {@code prefix}. + */ + public static AttributeKeyTemplate> longArrayKeyTemplate(String prefix) { + return new AttributeKeyTemplate<>(prefix, AttributeKey::longArrayKey); + } + + /** + * Create an {@link AttributeKeyTemplate} with type {@link AttributeType#DOUBLE} and the given + * {@code prefix}. + */ + public static AttributeKeyTemplate doubleKeyTemplate(String prefix) { + return new AttributeKeyTemplate<>(prefix, AttributeKey::doubleKey); + } + + /** + * Create an {@link AttributeKeyTemplate} with type {@link AttributeType#DOUBLE_ARRAY} and the + * given {@code prefix}. + */ + public static AttributeKeyTemplate> doubleArrayKeyTemplate(String prefix) { + return new AttributeKeyTemplate<>(prefix, AttributeKey::doubleArrayKey); + } + + private AttributeKey createAttributeKey(String keyName) { + String key = prefix + "." + keyName; + return keyBuilder.apply(key); + } + + /** + * Returns an {@link AttributeKey} object for the given attribute key whereby the key is the + * variable part of the full attribute name in a template-typed attribute, for example + * http.request.header.<key>. + * + *

{@link AttributeKey} objets are being created and cached on the first invocation of this + * method for a certain key. Subsequent invocations of this method with the same key return the + * cached object. + * + * @param key The variable part of the template-typed attribute name. + * @return An {@link AttributeKey} object for the given key. + */ + public AttributeKey getAttributeKey(String key) { + return keysCache.computeIfAbsent(key, this::createAttributeKey); + } +} diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/ClientAttributes.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/ClientAttributes.java new file mode 100644 index 000000000000..b06214cac2d0 --- /dev/null +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/ClientAttributes.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv; + +import static io.opentelemetry.api.common.AttributeKey.longKey; +import static io.opentelemetry.api.common.AttributeKey.stringKey; + +import io.opentelemetry.api.common.AttributeKey; + +// this is a copy of io.opentelemetry.semconv.ClientAttributes (1.37.0) + +// DO NOT EDIT, this is an Auto-generated file from +// buildscripts/templates/registry/java/SemanticAttributes.java.j2 +@SuppressWarnings("unused") +public final class ClientAttributes { + /** + * Client address - domain name if available without reverse DNS lookup; otherwise, IP address or + * Unix domain socket name. + * + *

Notes: + * + *

When observed from the server side, and when communicating through an intermediary, {@code + * client.address} SHOULD represent the client address behind any intermediaries, for example + * proxies, if it's available. + */ + public static final AttributeKey CLIENT_ADDRESS = stringKey("client.address"); + + /** + * Client port number. + * + *

Notes: + * + *

When observed from the server side, and when communicating through an intermediary, {@code + * client.port} SHOULD represent the client port behind any intermediaries, for example proxies, + * if it's available. + */ + public static final AttributeKey CLIENT_PORT = longKey("client.port"); + + private ClientAttributes() { + } +} diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/CodeAttributes.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/CodeAttributes.java new file mode 100644 index 000000000000..8dcec28e7d3e --- /dev/null +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/CodeAttributes.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv; + +import static io.opentelemetry.api.common.AttributeKey.longKey; +import static io.opentelemetry.api.common.AttributeKey.stringKey; + +import io.opentelemetry.api.common.AttributeKey; + +// this is a copy of io.opentelemetry.semconv.CodeAttributes (1.37.0) + +// DO NOT EDIT, this is an Auto-generated file from +// buildscripts/templates/registry/java/SemanticAttributes.java.j2 +@SuppressWarnings("unused") +public final class CodeAttributes { + /** + * The column number in {@code code.file.path} best representing the operation. It SHOULD point + * within the code unit named in {@code code.function.name}. This attribute MUST NOT be used on + * the Profile signal since the data is already captured in 'message Line'. This constraint is + * imposed to prevent redundancy and maintain data integrity. + */ + public static final AttributeKey CODE_COLUMN_NUMBER = longKey("code.column.number"); + + /** + * The source code file name that identifies the code unit as uniquely as possible (preferably an + * absolute file path). This attribute MUST NOT be used on the Profile signal since the data is + * already captured in 'message Function'. This constraint is imposed to prevent redundancy and + * maintain data integrity. + */ + public static final AttributeKey CODE_FILE_PATH = stringKey("code.file.path"); + + /** + * The method or function fully-qualified name without arguments. The value should fit the natural + * representation of the language runtime, which is also likely the same used within {@code + * code.stacktrace} attribute value. This attribute MUST NOT be used on the Profile signal since + * the data is already captured in 'message Function'. This constraint is imposed to prevent + * redundancy and maintain data integrity. + * + *

Notes: + * + *

Values and format depends on each language runtime, thus it is impossible to provide an + * exhaustive list of examples. The values are usually the same (or prefixes of) the ones found in + * native stack trace representation stored in {@code code.stacktrace} without information on + * arguments. + * + *

Examples: + * + *

    + *
  • Java method: {@code com.example.MyHttpService.serveRequest} + *
  • Java anonymous class method: {@code com.mycompany.Main$1.myMethod} + *
  • Java lambda method: {@code com.mycompany.Main$$Lambda/0x0000748ae4149c00.myMethod} + *
  • PHP function: {@code GuzzleHttp\Client::transfer} + *
  • Go function: {@code github.com/my/repo/pkg.foo.func5} + *
  • Elixir: {@code OpenTelemetry.Ctx.new} + *
  • Erlang: {@code opentelemetry_ctx:new} + *
  • Rust: {@code playground::my_module::my_cool_func} + *
  • C function: {@code fopen} + *
+ */ + public static final AttributeKey CODE_FUNCTION_NAME = stringKey("code.function.name"); + + /** + * The line number in {@code code.file.path} best representing the operation. It SHOULD point + * within the code unit named in {@code code.function.name}. This attribute MUST NOT be used on + * the Profile signal since the data is already captured in 'message Line'. This constraint is + * imposed to prevent redundancy and maintain data integrity. + */ + public static final AttributeKey CODE_LINE_NUMBER = longKey("code.line.number"); + + /** + * A stacktrace as a string in the natural representation for the language runtime. The + * representation is identical to {@code + * exception.stacktrace}. This attribute MUST NOT be used on the Profile signal since the data + * is already captured in 'message Location'. This constraint is imposed to prevent redundancy and + * maintain data integrity. + */ + public static final AttributeKey CODE_STACKTRACE = stringKey("code.stacktrace"); + + private CodeAttributes() { + } +} diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/DbAttributes.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/DbAttributes.java new file mode 100644 index 000000000000..abcac6e6a936 --- /dev/null +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/DbAttributes.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv; + +import static io.opentelemetry.api.common.AttributeKey.longKey; +import static io.opentelemetry.api.common.AttributeKey.stringKey; + +import io.opentelemetry.api.common.AttributeKey; + +// this is a copy of io.opentelemetry.semconv.DbAttributes (1.37.0) + +// DO NOT EDIT, this is an Auto-generated file from +// buildscripts/templates/registry/java/SemanticAttributes.java.j2 +@SuppressWarnings("unused") +public final class DbAttributes { + /** + * The name of a collection (table, container) within the database. + * + *

Notes: + * + *

It is RECOMMENDED to capture the value as provided by the application without attempting to + * do any case normalization. + * + *

The collection name SHOULD NOT be extracted from {@code db.query.text}, when the database + * system supports query text with multiple collections in non-batch operations. + * + *

For batch operations, if the individual operations are known to have the same collection + * name then that collection name SHOULD be used. + */ + public static final AttributeKey DB_COLLECTION_NAME = stringKey("db.collection.name"); + + /** + * The name of the database, fully qualified within the server address and port. + * + *

Notes: + * + *

If a database system has multiple namespace components, they SHOULD be concatenated from the + * most general to the most specific namespace component, using {@code |} as a separator between + * the components. Any missing components (and their associated separators) SHOULD be omitted. + * Semantic conventions for individual database systems SHOULD document what {@code 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. + */ + public static final AttributeKey DB_NAMESPACE = stringKey("db.namespace"); + + /** + * The number of queries included in a batch operation. + * + *

Notes: + * + *

Operations are only considered batches when they contain two or more operations, and so + * {@code db.operation.batch.size} SHOULD never be {@code 1}. + */ + public static final AttributeKey DB_OPERATION_BATCH_SIZE = longKey("db.operation.batch.size"); + + /** + * The name of the operation or command being executed. + * + *

Notes: + * + *

It is RECOMMENDED to capture the value as provided by the application without attempting to + * do any case normalization. + * + *

The operation name SHOULD NOT be extracted from {@code db.query.text}, when the database + * system supports query text with multiple operations in non-batch operations. + * + *

If spaces can occur in the operation name, multiple consecutive spaces SHOULD be normalized + * to a single space. + * + *

For batch operations, if the individual operations are known to have the same operation name + * then that operation name SHOULD be used prepended by {@code BATCH }, otherwise {@code + * db.operation.name} SHOULD be {@code BATCH} or some other database system specific term if more + * applicable. + */ + public static final AttributeKey DB_OPERATION_NAME = stringKey("db.operation.name"); + + /** + * Low cardinality summary of a database query. + * + *

Notes: + * + *

The query summary describes a class of database queries and is useful as a grouping key, + * especially when analyzing telemetry for database calls involving complex queries. + * + *

Summary may be available to the instrumentation through instrumentation hooks or other + * means. If it is not available, instrumentations that support query parsing SHOULD generate a + * summary following Generating query + * summary section. + */ + public static final AttributeKey DB_QUERY_SUMMARY = stringKey("db.query.summary"); + + /** + * The database query being executed. + * + *

Notes: + * + *

For sanitization see Sanitization of {@code + * db.query.text}. 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 {@code ; } or some other database system specific + * separator if more applicable. Parameterized query text SHOULD NOT be sanitized. 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. + */ + public static final AttributeKey DB_QUERY_TEXT = stringKey("db.query.text"); + + /** + * Database response status code. + * + *

Notes: + * + *

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 {@code + * db.response.status_code} means in the context of that system. + */ + public static final AttributeKey DB_RESPONSE_STATUS_CODE = stringKey("db.response.status_code"); + + /** + * The name of a stored procedure within the database. + * + *

Notes: + * + *

It is RECOMMENDED to capture the value as provided by the application without attempting to + * do any case normalization. + * + *

For batch operations, if the individual operations are known to have the same stored + * procedure name then that stored procedure name SHOULD be used. + */ + public static final AttributeKey DB_STORED_PROCEDURE_NAME = stringKey("db.stored_procedure.name"); + + /** + * The database management system (DBMS) product as identified by the client instrumentation. + * + *

Notes: + * + *

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 {@code db.system.name} is set to + * {@code postgresql} based on the instrumentation's best knowledge. + */ + public static final AttributeKey DB_SYSTEM_NAME = stringKey("db.system.name"); + + // Enum definition + /** Values for {@link #DB_SYSTEM_NAME}. */ + public static final class DbSystemNameValues { + /** MariaDB */ + public static final String MARIADB = "mariadb"; + + /** Microsoft SQL Server */ + public static final String MICROSOFT_SQL_SERVER = "microsoft.sql_server"; + + /** MySQL */ + public static final String MYSQL = "mysql"; + + /** PostgreSQL */ + public static final String POSTGRESQL = "postgresql"; + + private DbSystemNameValues() { + } + } + + private DbAttributes() { + } +} diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/ExceptionAttributes.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/ExceptionAttributes.java new file mode 100644 index 000000000000..b19dd9da18c1 --- /dev/null +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/ExceptionAttributes.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv; + +import static io.opentelemetry.api.common.AttributeKey.stringKey; + +import io.opentelemetry.api.common.AttributeKey; + +// this is a copy of io.opentelemetry.semconv.ExceptionAttributes (1.37.0) + +// DO NOT EDIT, this is an Auto-generated file from +// buildscripts/templates/registry/java/SemanticAttributes.java.j2 +@SuppressWarnings("unused") +public final class ExceptionAttributes { + /** The exception message. */ + public static final AttributeKey EXCEPTION_MESSAGE = stringKey("exception.message"); + + /** + * 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. + */ + public static final AttributeKey EXCEPTION_STACKTRACE = stringKey("exception.stacktrace"); + + /** + * The type of the exception (its fully-qualified class name, if applicable). The dynamic type of + * the exception should be preferred over the static type in languages that support it. + */ + public static final AttributeKey EXCEPTION_TYPE = stringKey("exception.type"); + + private ExceptionAttributes() { + } +} diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/HttpAttributes.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/HttpAttributes.java new file mode 100644 index 000000000000..655d62feb861 --- /dev/null +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/HttpAttributes.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv; + +import static io.opentelemetry.api.common.AttributeKey.longKey; +import static io.opentelemetry.api.common.AttributeKey.stringKey; +import static com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.AttributeKeyTemplate.stringArrayKeyTemplate; + +import io.opentelemetry.api.common.AttributeKey; +import java.util.List; + +// this is a copy of io.opentelemetry.semconv.HttpAttributes (1.37.0) + +// DO NOT EDIT, this is an Auto-generated file from +// buildscripts/templates/registry/java/SemanticAttributes.java.j2 +@SuppressWarnings("unused") +public final class HttpAttributes { + /** + * HTTP request headers, {@code } being the normalized HTTP Header name (lowercase), the + * value being the header values. + * + *

Notes: + * + *

Instrumentations SHOULD require an explicit configuration of which headers are to be + * captured. Including all request headers can be a security risk - explicit configuration helps + * avoid leaking sensitive information. + * + *

The {@code User-Agent} header is already captured in the {@code user_agent.original} + * attribute. Users MAY explicitly configure instrumentations to capture them even though it is + * not recommended. + * + *

The attribute value MUST consist of either multiple header values as an array of strings or + * a single-item array containing a possibly comma-concatenated string, depending on the way the + * HTTP library provides access to headers. + * + *

Examples: + * + *

    + *
  • A header {@code Content-Type: application/json} SHOULD be recorded as the {@code + * http.request.header.content-type} attribute with value {@code ["application/json"]}. + *
  • A header {@code X-Forwarded-For: 1.2.3.4, 1.2.3.5} SHOULD be recorded as the {@code + * http.request.header.x-forwarded-for} attribute with value {@code ["1.2.3.4", "1.2.3.5"]} + * or {@code ["1.2.3.4, 1.2.3.5"]} depending on the HTTP library. + *
+ */ + public static final AttributeKeyTemplate> HTTP_REQUEST_HEADER + = stringArrayKeyTemplate("http.request.header"); + + /** + * HTTP request method. + * + *

Notes: + * + *

HTTP request method value SHOULD be "known" to the instrumentation. By default, this + * convention defines "known" methods as the ones listed in RFC9110 and the PATCH + * method defined in RFC5789. + * + *

If the HTTP request method is not known to instrumentation, it MUST set the {@code + * http.request.method} attribute to {@code _OTHER}. + * + *

If the HTTP instrumentation could end up converting valid HTTP request methods to {@code + * _OTHER}, then it MUST provide a way to override the list of known HTTP methods. If this + * override is done via environment variable, then the environment variable MUST be named + * OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive + * known HTTP methods (this list MUST be a full override of the default known method, it is not a + * list of known methods in addition to the defaults). + * + *

HTTP method names are case-sensitive and {@code http.request.method} attribute value MUST + * match a known HTTP method name exactly. 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 {@code http.request.method_original} to the original + * value. + */ + public static final AttributeKey HTTP_REQUEST_METHOD = stringKey("http.request.method"); + + /** Original HTTP method sent by the client in the request line. */ + public static final AttributeKey HTTP_REQUEST_METHOD_ORIGINAL = stringKey("http.request.method_original"); + + /** + * The ordinal number of request resending attempt (for any reason, including redirects). + * + *

Notes: + * + *

The resend count SHOULD be updated each time an HTTP request gets resent by the client, + * regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 + * Server Unavailable, network issues, or any other). + */ + public static final AttributeKey HTTP_REQUEST_RESEND_COUNT = longKey("http.request.resend_count"); + + /** + * HTTP response headers, {@code } being the normalized HTTP Header name (lowercase), the + * value being the header values. + * + *

Notes: + * + *

Instrumentations SHOULD require an explicit configuration of which headers are to be + * captured. Including all response headers can be a security risk - explicit configuration helps + * avoid leaking sensitive information. + * + *

Users MAY explicitly configure instrumentations to capture them even though it is not + * recommended. + * + *

The attribute value MUST consist of either multiple header values as an array of strings or + * a single-item array containing a possibly comma-concatenated string, depending on the way the + * HTTP library provides access to headers. + * + *

Examples: + * + *

    + *
  • A header {@code Content-Type: application/json} header SHOULD be recorded as the {@code + * http.request.response.content-type} attribute with value {@code ["application/json"]}. + *
  • A header {@code My-custom-header: abc, def} header SHOULD be recorded as the {@code + * http.response.header.my-custom-header} attribute with value {@code ["abc", "def"]} or + * {@code ["abc, def"]} depending on the HTTP library. + *
+ */ + public static final AttributeKeyTemplate> HTTP_RESPONSE_HEADER + = stringArrayKeyTemplate("http.response.header"); + + /** HTTP response status code. */ + public static final AttributeKey HTTP_RESPONSE_STATUS_CODE = longKey("http.response.status_code"); + + /** + * The matched route, that is, the path template in the format used by the respective server + * framework. + * + *

Notes: + * + *

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 if there is + * one. + */ + public static final AttributeKey HTTP_ROUTE = stringKey("http.route"); + + // Enum definition + /** Values for {@link #HTTP_REQUEST_METHOD}. */ + public static final class HttpRequestMethodValues { + /** CONNECT method. */ + public static final String CONNECT = "CONNECT"; + + /** DELETE method. */ + public static final String DELETE = "DELETE"; + + /** GET method. */ + public static final String GET = "GET"; + + /** HEAD method. */ + public static final String HEAD = "HEAD"; + + /** OPTIONS method. */ + public static final String OPTIONS = "OPTIONS"; + + /** PATCH method. */ + public static final String PATCH = "PATCH"; + + /** POST method. */ + public static final String POST = "POST"; + + /** PUT method. */ + public static final String PUT = "PUT"; + + /** TRACE method. */ + public static final String TRACE = "TRACE"; + + /** Any HTTP method that the instrumentation has no prior knowledge of. */ + public static final String OTHER = "_OTHER"; + + private HttpRequestMethodValues() { + } + } + + private HttpAttributes() { + } +} diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/NetworkAttributes.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/NetworkAttributes.java new file mode 100644 index 000000000000..a960adb09d64 --- /dev/null +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/NetworkAttributes.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv; + +import static io.opentelemetry.api.common.AttributeKey.longKey; +import static io.opentelemetry.api.common.AttributeKey.stringKey; + +import io.opentelemetry.api.common.AttributeKey; + +// this is a copy of io.opentelemetry.semconv.NetworkAttributes (1.37.0) + +// DO NOT EDIT, this is an Auto-generated file from +// buildscripts/templates/registry/java/SemanticAttributes.java.j2 +@SuppressWarnings("unused") +public final class NetworkAttributes { + /** Local address of the network connection - IP address or Unix domain socket name. */ + public static final AttributeKey NETWORK_LOCAL_ADDRESS = stringKey("network.local.address"); + + /** Local port number of the network connection. */ + public static final AttributeKey NETWORK_LOCAL_PORT = longKey("network.local.port"); + + /** Peer address of the network connection - IP address or Unix domain socket name. */ + public static final AttributeKey NETWORK_PEER_ADDRESS = stringKey("network.peer.address"); + + /** Peer port number of the network connection. */ + public static final AttributeKey NETWORK_PEER_PORT = longKey("network.peer.port"); + + /** + * OSI application layer or non-OSI + * equivalent. + * + *

Notes: + * + *

The value SHOULD be normalized to lowercase. + */ + public static final AttributeKey NETWORK_PROTOCOL_NAME = stringKey("network.protocol.name"); + + /** + * The actual version of the protocol used for network communication. + * + *

Notes: + * + *

If protocol version is subject to negotiation (for example using ALPN), this attribute SHOULD be set to + * the negotiated version. If the actual protocol version is not known, this attribute SHOULD NOT + * be set. + */ + public static final AttributeKey NETWORK_PROTOCOL_VERSION = stringKey("network.protocol.version"); + + /** + * OSI transport layer or inter-process communication + * method. + * + *

Notes: + * + *

The value SHOULD be normalized to lowercase. + * + *

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. + */ + public static final AttributeKey NETWORK_TRANSPORT = stringKey("network.transport"); + + /** + * OSI network layer or non-OSI equivalent. + * + *

Notes: + * + *

The value SHOULD be normalized to lowercase. + */ + public static final AttributeKey NETWORK_TYPE = stringKey("network.type"); + + // Enum definition + /** Values for {@link #NETWORK_TRANSPORT}. */ + public static final class NetworkTransportValues { + /** TCP */ + public static final String TCP = "tcp"; + + /** UDP */ + public static final String UDP = "udp"; + + /** Named or anonymous pipe. */ + public static final String PIPE = "pipe"; + + /** Unix domain socket */ + public static final String UNIX = "unix"; + + /** QUIC */ + public static final String QUIC = "quic"; + + private NetworkTransportValues() { + } + } + + // Enum definition + /** Values for {@link #NETWORK_TYPE}. */ + public static final class NetworkTypeValues { + /** IPv4 */ + public static final String IPV4 = "ipv4"; + + /** IPv6 */ + public static final String IPV6 = "ipv6"; + + private NetworkTypeValues() { + } + } + + private NetworkAttributes() { + } +} diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/ServerAttributes.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/ServerAttributes.java new file mode 100644 index 000000000000..87b1c1442113 --- /dev/null +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/ServerAttributes.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv; + +import static io.opentelemetry.api.common.AttributeKey.longKey; +import static io.opentelemetry.api.common.AttributeKey.stringKey; + +import io.opentelemetry.api.common.AttributeKey; + +// this is a copy of io.opentelemetry.semconv.ServerAttributes (1.37.0) + +// DO NOT EDIT, this is an Auto-generated file from +// buildscripts/templates/registry/java/SemanticAttributes.java.j2 +@SuppressWarnings("unused") +public final class ServerAttributes { + /** + * Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix + * domain socket name. + * + *

Notes: + * + *

When observed from the client side, and when communicating through an intermediary, {@code + * server.address} SHOULD represent the server address behind any intermediaries, for example + * proxies, if it's available. + */ + public static final AttributeKey SERVER_ADDRESS = stringKey("server.address"); + + /** + * Server port number. + * + *

Notes: + * + *

When observed from the client side, and when communicating through an intermediary, {@code + * server.port} SHOULD represent the server port behind any intermediaries, for example proxies, + * if it's available. + */ + public static final AttributeKey SERVER_PORT = longKey("server.port"); + + private ServerAttributes() { + } +} diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/UrlAttributes.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/UrlAttributes.java new file mode 100644 index 000000000000..b8b4b978fb29 --- /dev/null +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/UrlAttributes.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv; + +import static io.opentelemetry.api.common.AttributeKey.stringKey; + +import io.opentelemetry.api.common.AttributeKey; + +// this is a copy of io.opentelemetry.semconv.UrlAttributes (1.37.0) + +// DO NOT EDIT, this is an Auto-generated file from +// buildscripts/templates/registry/java/SemanticAttributes.java.j2 +@SuppressWarnings("unused") +public final class UrlAttributes { + /** The URI fragment component */ + public static final AttributeKey URL_FRAGMENT = stringKey("url.fragment"); + + /** + * Absolute URL describing a network resource according to RFC3986 + * + *

Notes: + * + *

For network calls, URL usually has {@code scheme://host[:port][path][?query][#fragment]} + * format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be + * included nevertheless. + * + *

{@code url.full} MUST NOT contain credentials passed via URL in form of {@code + * https://username:password@www.example.com/}. In such case username and password SHOULD be + * redacted and attribute's value SHOULD be {@code https://REDACTED:REDACTED@www.example.com/}. + * + *

{@code url.full} SHOULD capture the absolute URL when it is available (or can be + * reconstructed). + * + *

Sensitive content provided in {@code url.full} SHOULD be scrubbed when instrumentations can + * identify it. + * + *

Query string values for the following keys SHOULD be redacted by default and replaced by the + * value {@code REDACTED}: + * + *

+ * + *

This list is subject to change over time. + * + *

When a query string value is redacted, the query string key SHOULD still be preserved, e.g. + * {@code https://www.example.com/path?color=blue&sig=REDACTED}. + */ + public static final AttributeKey URL_FULL = stringKey("url.full"); + + /** + * The URI path component + * + *

Notes: + * + *

Sensitive content provided in {@code url.path} SHOULD be scrubbed when instrumentations can + * identify it. + */ + public static final AttributeKey URL_PATH = stringKey("url.path"); + + /** + * The URI query component + * + *

Notes: + * + *

Sensitive content provided in {@code url.query} SHOULD be scrubbed when instrumentations can + * identify it. + * + *

Query string values for the following keys SHOULD be redacted by default and replaced by the + * value {@code REDACTED}: + * + *

+ * + *

This list is subject to change over time. + * + *

When a query string value is redacted, the query string key SHOULD still be preserved, e.g. + * {@code q=OpenTelemetry&sig=REDACTED}. + */ + public static final AttributeKey URL_QUERY = stringKey("url.query"); + + /** + * The URI scheme component + * identifying the used protocol. + */ + public static final AttributeKey URL_SCHEME = stringKey("url.scheme"); + + private UrlAttributes() { + } +} diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/UserAgentAttributes.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/UserAgentAttributes.java new file mode 100644 index 000000000000..201d2ac259ab --- /dev/null +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/UserAgentAttributes.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv; + +import static io.opentelemetry.api.common.AttributeKey.stringKey; + +import io.opentelemetry.api.common.AttributeKey; + +// this is a copy of io.opentelemetry.semconv.UserAgentAttributes (1.37.0) + +// DO NOT EDIT, this is an Auto-generated file from +// buildscripts/templates/registry/java/SemanticAttributes.java.j2 +@SuppressWarnings("unused") +public final class UserAgentAttributes { + /** + * Value of the HTTP + * User-Agent header sent by the client. + */ + public static final AttributeKey USER_AGENT_ORIGINAL = stringKey("user_agent.original"); + + private UserAgentAttributes() { + } +} diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/CodeIncubatingAttributes.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/CodeIncubatingAttributes.java new file mode 100644 index 000000000000..6269c4660c99 --- /dev/null +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/CodeIncubatingAttributes.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating; + +import static io.opentelemetry.api.common.AttributeKey.longKey; +import static io.opentelemetry.api.common.AttributeKey.stringKey; + +import io.opentelemetry.api.common.AttributeKey; + +// this is a copy of io.opentelemetry.semconv.incubating.CodeIncubatingAttributes (1.37.0) +// DO NOT EDIT, this is an Auto-generated file from +// buildscripts/templates/registry/incubating_java/IncubatingSemanticAttributes.java.j2 +@SuppressWarnings("unused") +public final class CodeIncubatingAttributes { + /** + * The column number in {@code code.filepath} best representing the operation. It SHOULD point + * within the code unit named in {@code code.function}. + */ + public static final AttributeKey CODE_COLUMN = longKey("code.column"); + + /** + * The source code file name that identifies the code unit as uniquely as possible (preferably an + * absolute file path). + */ + public static final AttributeKey CODE_FILEPATH = stringKey("code.filepath"); + + /** + * The method or function name, or equivalent (usually rightmost part of the code unit's name). + */ + public static final AttributeKey CODE_FUNCTION = stringKey("code.function"); + + /** + * The line number in {@code code.filepath} best representing the operation. It SHOULD point + * within the code unit named in {@code code.function}. + */ + public static final AttributeKey CODE_LINENO = longKey("code.lineno"); + + /** + * The "namespace" within which {@code code.function} is defined. Usually the qualified class or + * module name, such that {@code code.namespace} + some separator + {@code code.function} form a + * unique identifier for the code unit. + */ + public static final AttributeKey CODE_NAMESPACE = stringKey("code.namespace"); + + /** + * 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. + */ + public static final AttributeKey CODE_STACKTRACE = stringKey("code.stacktrace"); + + private CodeIncubatingAttributes() { + } +} diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/DbIncubatingAttributes.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/DbIncubatingAttributes.java new file mode 100644 index 000000000000..2fa2f59e20a1 --- /dev/null +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/DbIncubatingAttributes.java @@ -0,0 +1,907 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating; + +import static io.opentelemetry.api.common.AttributeKey.booleanKey; +import static io.opentelemetry.api.common.AttributeKey.doubleKey; +import static io.opentelemetry.api.common.AttributeKey.longKey; +import static io.opentelemetry.api.common.AttributeKey.stringArrayKey; +import static io.opentelemetry.api.common.AttributeKey.stringKey; + +import io.opentelemetry.api.common.AttributeKey; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.AttributeKeyTemplate; +import java.util.List; + +// this is a copy of io.opentelemetry.semconv.incubating.DbIncubatingAttributes (1.37.0) +// DO NOT EDIT, this is an Auto-generated file from +// buildscripts/templates/registry/incubating_java/IncubatingSemanticAttributes.java.j2 +@SuppressWarnings("unused") +public final class DbIncubatingAttributes { + /** + * Deprecated, use {@code cassandra.consistency.level} instead. + * + * @deprecated Replaced by {@code cassandra.consistency.level}. + */ + @Deprecated + public static final AttributeKey DB_CASSANDRA_CONSISTENCY_LEVEL + = stringKey("db.cassandra.consistency_level"); + + /** + * Deprecated, use {@code cassandra.coordinator.dc} instead. + * + * @deprecated Replaced by {@code cassandra.coordinator.dc}. + */ + @Deprecated + public static final AttributeKey DB_CASSANDRA_COORDINATOR_DC = stringKey("db.cassandra.coordinator.dc"); + + /** + * Deprecated, use {@code cassandra.coordinator.id} instead. + * + * @deprecated Replaced by {@code cassandra.coordinator.id}. + */ + @Deprecated + public static final AttributeKey DB_CASSANDRA_COORDINATOR_ID = stringKey("db.cassandra.coordinator.id"); + + /** + * Deprecated, use {@code cassandra.query.idempotent} instead. + * + * @deprecated Replaced by {@code cassandra.query.idempotent}. + */ + @Deprecated + public static final AttributeKey DB_CASSANDRA_IDEMPOTENCE = booleanKey("db.cassandra.idempotence"); + + /** + * Deprecated, use {@code cassandra.page.size} instead. + * + * @deprecated Replaced by {@code cassandra.page.size}. + */ + @Deprecated + public static final AttributeKey DB_CASSANDRA_PAGE_SIZE = longKey("db.cassandra.page_size"); + + /** + * Deprecated, use {@code cassandra.speculative_execution.count} instead. + * + * @deprecated Replaced by {@code cassandra.speculative_execution.count}. + */ + @Deprecated + public static final AttributeKey DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT + = longKey("db.cassandra.speculative_execution_count"); + + /** + * Deprecated, use {@code db.collection.name} instead. + * + * @deprecated Replaced by {@code db.collection.name}. + */ + @Deprecated + public static final AttributeKey DB_CASSANDRA_TABLE = stringKey("db.cassandra.table"); + + /** + * 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 {@code + * server.address}, {@code server.port}, and {@code db.namespace}, formatted as {@code + * server.address:server.port/db.namespace}. Instrumentations that generate connection pool name + * following different patterns SHOULD document it. + */ + public static final AttributeKey DB_CLIENT_CONNECTION_POOL_NAME + = stringKey("db.client.connection.pool.name"); + + /** The state of a connection in the pool */ + public static final AttributeKey DB_CLIENT_CONNECTION_STATE = stringKey("db.client.connection.state"); + + /** + * Deprecated, use {@code db.client.connection.pool.name} instead. + * + * @deprecated Replaced by {@code db.client.connection.pool.name}. + */ + @Deprecated + public static final AttributeKey DB_CLIENT_CONNECTIONS_POOL_NAME + = stringKey("db.client.connections.pool.name"); + + /** + * Deprecated, use {@code db.client.connection.state} instead. + * + * @deprecated Replaced by {@code db.client.connection.state}. + */ + @Deprecated + public static final AttributeKey DB_CLIENT_CONNECTIONS_STATE = stringKey("db.client.connections.state"); + + /** + * The name of a collection (table, container) within the database. + * + *

Notes: + * + *

It is RECOMMENDED to capture the value as provided by the application without attempting to + * do any case normalization. + * + *

The collection name SHOULD NOT be extracted from {@code db.query.text}, when the database + * system supports query text with multiple collections in non-batch operations. + * + *

For batch operations, if the individual operations are known to have the same collection + * name then that collection name SHOULD be used. + * + * @deprecated deprecated in favor of stable {@link + * io.opentelemetry.semconv.DbAttributes#DB_COLLECTION_NAME} attribute. + */ + @Deprecated + public static final AttributeKey DB_COLLECTION_NAME = stringKey("db.collection.name"); + + /** + * Deprecated, use {@code server.address}, {@code server.port} attributes instead. + * + * @deprecated Replaced by {@code server.address} and {@code server.port}. + */ + @Deprecated + public static final AttributeKey DB_CONNECTION_STRING = stringKey("db.connection_string"); + + /** + * Deprecated, use {@code azure.client.id} instead. + * + * @deprecated Replaced by {@code azure.client.id}. + */ + @Deprecated + public static final AttributeKey DB_COSMOSDB_CLIENT_ID = stringKey("db.cosmosdb.client_id"); + + /** + * Deprecated, use {@code azure.cosmosdb.connection.mode} instead. + * + * @deprecated Replaced by {@code azure.cosmosdb.connection.mode}. + */ + @Deprecated + public static final AttributeKey DB_COSMOSDB_CONNECTION_MODE = stringKey("db.cosmosdb.connection_mode"); + + /** + * Deprecated, use {@code cosmosdb.consistency.level} instead. + * + * @deprecated Replaced by {@code azure.cosmosdb.consistency.level}. + */ + @Deprecated + public static final AttributeKey DB_COSMOSDB_CONSISTENCY_LEVEL = stringKey("db.cosmosdb.consistency_level"); + + /** + * Deprecated, use {@code db.collection.name} instead. + * + * @deprecated Replaced by {@code db.collection.name}. + */ + @Deprecated + public static final AttributeKey DB_COSMOSDB_CONTAINER = stringKey("db.cosmosdb.container"); + + /** + * Deprecated, no replacement at this time. + * + * @deprecated Removed, no replacement at this time. + */ + @Deprecated + public static final AttributeKey DB_COSMOSDB_OPERATION_TYPE = stringKey("db.cosmosdb.operation_type"); + + /** + * Deprecated, use {@code azure.cosmosdb.operation.contacted_regions} instead. + * + * @deprecated Replaced by {@code azure.cosmosdb.operation.contacted_regions}. + */ + @Deprecated + public static final AttributeKey> DB_COSMOSDB_REGIONS_CONTACTED + = stringArrayKey("db.cosmosdb.regions_contacted"); + + /** + * Deprecated, use {@code azure.cosmosdb.operation.request_charge} instead. + * + * @deprecated Replaced by {@code azure.cosmosdb.operation.request_charge}. + */ + @Deprecated + public static final AttributeKey DB_COSMOSDB_REQUEST_CHARGE = doubleKey("db.cosmosdb.request_charge"); + + /** + * Deprecated, use {@code azure.cosmosdb.request.body.size} instead. + * + * @deprecated Replaced by {@code azure.cosmosdb.request.body.size}. + */ + @Deprecated + public static final AttributeKey DB_COSMOSDB_REQUEST_CONTENT_LENGTH + = longKey("db.cosmosdb.request_content_length"); + + /** + * Deprecated, use {@code db.response.status_code} instead. + * + * @deprecated Replaced by {@code db.response.status_code}. + */ + @Deprecated + public static final AttributeKey DB_COSMOSDB_STATUS_CODE = longKey("db.cosmosdb.status_code"); + + /** + * Deprecated, use {@code azure.cosmosdb.response.sub_status_code} instead. + * + * @deprecated Replaced by {@code azure.cosmosdb.response.sub_status_code}. + */ + @Deprecated + public static final AttributeKey DB_COSMOSDB_SUB_STATUS_CODE = longKey("db.cosmosdb.sub_status_code"); + + /** + * Deprecated, use {@code db.namespace} instead. + * + * @deprecated Replaced by {@code db.namespace}. + */ + @Deprecated + public static final AttributeKey DB_ELASTICSEARCH_CLUSTER_NAME = stringKey("db.elasticsearch.cluster.name"); + + /** + * Deprecated, use {@code elasticsearch.node.name} instead. + * + * @deprecated Replaced by {@code elasticsearch.node.name}. + */ + @Deprecated + public static final AttributeKey DB_ELASTICSEARCH_NODE_NAME = stringKey("db.elasticsearch.node.name"); + + /** + * Deprecated, use {@code db.operation.parameter} instead. + * + * @deprecated Replaced by {@code db.operation.parameter}. + */ + @Deprecated + public static final AttributeKeyTemplate DB_ELASTICSEARCH_PATH_PARTS + = AttributeKeyTemplate.stringKeyTemplate("db.elasticsearch.path_parts"); + + /** + * Deprecated, no general replacement at this time. For Elasticsearch, use {@code + * db.elasticsearch.node.name} instead. + * + * @deprecated Removed, no general replacement at this time. For Elasticsearch, use {@code + * db.elasticsearch.node.name} instead. + */ + @Deprecated + public static final AttributeKey DB_INSTANCE_ID = stringKey("db.instance.id"); + + /** + * Removed, no replacement at this time. + * + * @deprecated Removed, no replacement at this time. + */ + @Deprecated + public static final AttributeKey DB_JDBC_DRIVER_CLASSNAME = stringKey("db.jdbc.driver_classname"); + + /** + * Deprecated, use {@code db.collection.name} instead. + * + * @deprecated Replaced by {@code db.collection.name}. + */ + @Deprecated + public static final AttributeKey DB_MONGODB_COLLECTION = stringKey("db.mongodb.collection"); + + /** + * Deprecated, SQL Server instance is now populated as a part of {@code db.namespace} attribute. + * + * @deprecated Removed, no replacement at this time. + */ + @Deprecated + public static final AttributeKey DB_MSSQL_INSTANCE_NAME = stringKey("db.mssql.instance_name"); + + /** + * Deprecated, use {@code db.namespace} instead. + * + * @deprecated Replaced by {@code db.namespace}. + */ + @Deprecated + public static final AttributeKey DB_NAME = stringKey("db.name"); + + /** + * The name of the database, fully qualified within the server address and port. + * + *

Notes: + * + *

If a database system has multiple namespace components, they SHOULD be concatenated from the + * most general to the most specific namespace component, using {@code |} as a separator between + * the components. Any missing components (and their associated separators) SHOULD be omitted. + * Semantic conventions for individual database systems SHOULD document what {@code 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. + * + * @deprecated deprecated in favor of stable {@link + * io.opentelemetry.semconv.DbAttributes#DB_NAMESPACE} attribute. + */ + @Deprecated + public static final AttributeKey DB_NAMESPACE = stringKey("db.namespace"); + + /** + * Deprecated, use {@code db.operation.name} instead. + * + * @deprecated Replaced by {@code db.operation.name}. + */ + @Deprecated + public static final AttributeKey DB_OPERATION = stringKey("db.operation"); + + /** + * The number of queries included in a batch operation. + * + *

Notes: + * + *

Operations are only considered batches when they contain two or more operations, and so + * {@code db.operation.batch.size} SHOULD never be {@code 1}. + * + * @deprecated deprecated in favor of stable {@link + * io.opentelemetry.semconv.DbAttributes#DB_OPERATION_BATCH_SIZE} attribute. + */ + @Deprecated + public static final AttributeKey DB_OPERATION_BATCH_SIZE = longKey("db.operation.batch.size"); + + /** + * The name of the operation or command being executed. + * + *

Notes: + * + *

It is RECOMMENDED to capture the value as provided by the application without attempting to + * do any case normalization. + * + *

The operation name SHOULD NOT be extracted from {@code db.query.text}, when the database + * system supports query text with multiple operations in non-batch operations. + * + *

If spaces can occur in the operation name, multiple consecutive spaces SHOULD be normalized + * to a single space. + * + *

For batch operations, if the individual operations are known to have the same operation name + * then that operation name SHOULD be used prepended by {@code BATCH }, otherwise {@code + * db.operation.name} SHOULD be {@code BATCH} or some other database system specific term if more + * applicable. + * + * @deprecated deprecated in favor of stable {@link + * io.opentelemetry.semconv.DbAttributes#DB_OPERATION_NAME} attribute. + */ + @Deprecated + public static final AttributeKey DB_OPERATION_NAME = stringKey("db.operation.name"); + + /** + * A database operation parameter, with {@code } being the parameter name, and the attribute + * value being a string representation of the parameter value. + * + *

Notes: + * + *

For example, a client-side maximum number of rows to read from the database MAY be recorded + * as the {@code db.operation.parameter.max_rows} attribute. + * + *

{@code db.query.text} parameters SHOULD be captured using {@code db.query.parameter.} + * instead of {@code db.operation.parameter.}. + */ + public static final AttributeKeyTemplate DB_OPERATION_PARAMETER + = AttributeKeyTemplate.stringKeyTemplate("db.operation.parameter"); + + /** + * A database query parameter, with {@code } being the parameter name, and the attribute + * value being a string representation of the parameter value. + * + *

Notes: + * + *

If a query parameter has no name and instead is referenced only by index, then {@code } + * SHOULD be the 0-based index. + * + *

{@code db.query.parameter.} SHOULD match up with the parameterized placeholders present + * in {@code db.query.text}. + * + *

{@code db.query.parameter.} SHOULD NOT be captured on batch operations. + * + *

Examples: + * + *

    + *
  • For a query {@code SELECT * FROM users where username = %s} with the parameter {@code + * "jdoe"}, the attribute {@code db.query.parameter.0} SHOULD be set to {@code "jdoe"}. + *
  • For a query {@code "SELECT * FROM users WHERE username = %(username)s;} with parameter + * {@code username = "jdoe"}, the attribute {@code db.query.parameter.username} SHOULD be + * set to {@code "jdoe"}. + *
+ */ + public static final AttributeKeyTemplate DB_QUERY_PARAMETER + = AttributeKeyTemplate.stringKeyTemplate("db.query.parameter"); + + /** + * Low cardinality summary of a database query. + * + *

Notes: + * + *

The query summary describes a class of database queries and is useful as a grouping key, + * especially when analyzing telemetry for database calls involving complex queries. + * + *

Summary may be available to the instrumentation through instrumentation hooks or other + * means. If it is not available, instrumentations that support query parsing SHOULD generate a + * summary following Generating query + * summary section. + * + * @deprecated deprecated in favor of stable {@link + * io.opentelemetry.semconv.DbAttributes#DB_QUERY_SUMMARY} attribute. + */ + @Deprecated + public static final AttributeKey DB_QUERY_SUMMARY = stringKey("db.query.summary"); + + /** + * The database query being executed. + * + *

Notes: + * + *

For sanitization see Sanitization of {@code + * db.query.text}. 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 {@code ; } or some other database system specific + * separator if more applicable. Parameterized query text SHOULD NOT be sanitized. 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. + * + * @deprecated deprecated in favor of stable {@link + * io.opentelemetry.semconv.DbAttributes#DB_QUERY_TEXT} attribute. + */ + @Deprecated + public static final AttributeKey DB_QUERY_TEXT = stringKey("db.query.text"); + + /** + * Deprecated, use {@code db.namespace} instead. + * + * @deprecated Replaced by {@code db.namespace}. + */ + @Deprecated + public static final AttributeKey DB_REDIS_DATABASE_INDEX = longKey("db.redis.database_index"); + + /** Number of rows returned by the operation. */ + public static final AttributeKey DB_RESPONSE_RETURNED_ROWS = longKey("db.response.returned_rows"); + + /** + * Database response status code. + * + *

Notes: + * + *

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 {@code + * db.response.status_code} means in the context of that system. + * + * @deprecated deprecated in favor of stable {@link + * io.opentelemetry.semconv.DbAttributes#DB_RESPONSE_STATUS_CODE} attribute. + */ + @Deprecated + public static final AttributeKey DB_RESPONSE_STATUS_CODE = stringKey("db.response.status_code"); + + /** + * Deprecated, use {@code db.collection.name} instead. + * + * @deprecated Replaced by {@code db.collection.name}, but only if not extracting the value from + * {@code db.query.text}. + */ + @Deprecated + public static final AttributeKey DB_SQL_TABLE = stringKey("db.sql.table"); + + /** + * The database statement being executed. + * + * @deprecated Replaced by {@code db.query.text}. + */ + @Deprecated + public static final AttributeKey DB_STATEMENT = stringKey("db.statement"); + + /** + * The name of a stored procedure within the database. + * + *

Notes: + * + *

It is RECOMMENDED to capture the value as provided by the application without attempting to + * do any case normalization. + * + *

For batch operations, if the individual operations are known to have the same stored + * procedure name then that stored procedure name SHOULD be used. + * + * @deprecated deprecated in favor of stable {@link + * io.opentelemetry.semconv.DbAttributes#DB_STORED_PROCEDURE_NAME} attribute. + */ + @Deprecated + public static final AttributeKey DB_STORED_PROCEDURE_NAME = stringKey("db.stored_procedure.name"); + + /** + * Deprecated, use {@code db.system.name} instead. + * + * @deprecated Replaced by {@code db.system.name}. + */ + @Deprecated + public static final AttributeKey DB_SYSTEM = stringKey("db.system"); + + /** + * The database management system (DBMS) product as identified by the client instrumentation. + * + *

Notes: + * + *

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 {@code db.system.name} is set to + * {@code postgresql} based on the instrumentation's best knowledge. + * + * @deprecated deprecated in favor of stable {@link + * io.opentelemetry.semconv.DbAttributes#DB_SYSTEM_NAME} attribute. + */ + @Deprecated + public static final AttributeKey DB_SYSTEM_NAME = stringKey("db.system.name"); + + /** + * Deprecated, no replacement at this time. + * + * @deprecated Removed, no replacement at this time. + */ + @Deprecated + public static final AttributeKey DB_USER = stringKey("db.user"); + + // Enum definitions + + /** + * Values for {@link #DB_CASSANDRA_CONSISTENCY_LEVEL} + * + * @deprecated Replaced by {@code cassandra.consistency.level}. + */ + @Deprecated + public static final class DbCassandraConsistencyLevelIncubatingValues { + /** all. */ + public static final String ALL = "all"; + + /** each_quorum. */ + public static final String EACH_QUORUM = "each_quorum"; + + /** quorum. */ + public static final String QUORUM = "quorum"; + + /** local_quorum. */ + public static final String LOCAL_QUORUM = "local_quorum"; + + /** one. */ + public static final String ONE = "one"; + + /** two. */ + public static final String TWO = "two"; + + /** three. */ + public static final String THREE = "three"; + + /** local_one. */ + public static final String LOCAL_ONE = "local_one"; + + /** any. */ + public static final String ANY = "any"; + + /** serial. */ + public static final String SERIAL = "serial"; + + /** local_serial. */ + public static final String LOCAL_SERIAL = "local_serial"; + + private DbCassandraConsistencyLevelIncubatingValues() { + } + } + + /** Values for {@link #DB_CLIENT_CONNECTION_STATE}. */ + public static final class DbClientConnectionStateIncubatingValues { + /** idle. */ + public static final String IDLE = "idle"; + + /** used. */ + public static final String USED = "used"; + + private DbClientConnectionStateIncubatingValues() { + } + } + + /** + * Values for {@link #DB_CLIENT_CONNECTIONS_STATE} + * + * @deprecated Replaced by {@code db.client.connection.state}. + */ + @Deprecated + public static final class DbClientConnectionsStateIncubatingValues { + /** idle. */ + public static final String IDLE = "idle"; + + /** used. */ + public static final String USED = "used"; + + private DbClientConnectionsStateIncubatingValues() { + } + } + + /** + * Values for {@link #DB_COSMOSDB_CONNECTION_MODE} + * + * @deprecated Replaced by {@code azure.cosmosdb.connection.mode}. + */ + @Deprecated + public static final class DbCosmosdbConnectionModeIncubatingValues { + /** Gateway (HTTP) connection. */ + public static final String GATEWAY = "gateway"; + + /** Direct connection. */ + public static final String DIRECT = "direct"; + + private DbCosmosdbConnectionModeIncubatingValues() { + } + } + + /** + * Values for {@link #DB_COSMOSDB_CONSISTENCY_LEVEL} + * + * @deprecated Replaced by {@code azure.cosmosdb.consistency.level}. + */ + @Deprecated + public static final class DbCosmosdbConsistencyLevelIncubatingValues { + /** strong. */ + public static final String STRONG = "Strong"; + + /** bounded_staleness. */ + public static final String BOUNDED_STALENESS = "BoundedStaleness"; + + /** session. */ + public static final String SESSION = "Session"; + + /** eventual. */ + public static final String EVENTUAL = "Eventual"; + + /** consistent_prefix. */ + public static final String CONSISTENT_PREFIX = "ConsistentPrefix"; + + private DbCosmosdbConsistencyLevelIncubatingValues() { + } + } + + /** + * Values for {@link #DB_COSMOSDB_OPERATION_TYPE} + * + * @deprecated Removed, no replacement at this time. + */ + @Deprecated + public static final class DbCosmosdbOperationTypeIncubatingValues { + /** batch. */ + public static final String BATCH = "batch"; + + /** create. */ + public static final String CREATE = "create"; + + /** delete. */ + public static final String DELETE = "delete"; + + /** execute. */ + public static final String EXECUTE = "execute"; + + /** execute_javascript. */ + public static final String EXECUTE_JAVASCRIPT = "execute_javascript"; + + /** invalid. */ + public static final String INVALID = "invalid"; + + /** head. */ + public static final String HEAD = "head"; + + /** head_feed. */ + public static final String HEAD_FEED = "head_feed"; + + /** patch. */ + public static final String PATCH = "patch"; + + /** query. */ + public static final String QUERY = "query"; + + /** query_plan. */ + public static final String QUERY_PLAN = "query_plan"; + + /** read. */ + public static final String READ = "read"; + + /** read_feed. */ + public static final String READ_FEED = "read_feed"; + + /** replace. */ + public static final String REPLACE = "replace"; + + /** upsert. */ + public static final String UPSERT = "upsert"; + + private DbCosmosdbOperationTypeIncubatingValues() { + } + } + + /** + * Values for {@link #DB_SYSTEM} + * + * @deprecated Replaced by {@code db.system.name}. + */ + @Deprecated + public static final class DbSystemValues { + /** Some other SQL database. Fallback only. See notes. */ + public static final String OTHER_SQL = "other_sql"; + + /** Adabas (Adaptable Database System) */ + public static final String ADABAS = "adabas"; + + /** + * Deprecated, use {@code intersystems_cache} instead. + * + * @deprecated Replaced by {@code intersystems_cache}. + */ + @Deprecated + public static final String CACHE = "cache"; + + /** InterSystems Caché */ + public static final String INTERSYSTEMS_CACHE = "intersystems_cache"; + + /** Apache Cassandra */ + public static final String CASSANDRA = "cassandra"; + + /** ClickHouse */ + public static final String CLICKHOUSE = "clickhouse"; + + /** + * Deprecated, use {@code other_sql} instead. + * + * @deprecated Replaced by {@code other_sql}. + */ + @Deprecated + public static final String CLOUDSCAPE = "cloudscape"; + + /** CockroachDB */ + public static final String COCKROACHDB = "cockroachdb"; + + /** + * Deprecated, no replacement at this time. + * + * @deprecated Obsoleted. + */ + @Deprecated + public static final String COLDFUSION = "coldfusion"; + + /** Microsoft Azure Cosmos DB */ + public static final String COSMOSDB = "cosmosdb"; + + /** Couchbase */ + public static final String COUCHBASE = "couchbase"; + + /** CouchDB */ + public static final String COUCHDB = "couchdb"; + + /** IBM Db2 */ + public static final String DB2 = "db2"; + + /** Apache Derby */ + public static final String DERBY = "derby"; + + /** Amazon DynamoDB */ + public static final String DYNAMODB = "dynamodb"; + + /** EnterpriseDB */ + public static final String EDB = "edb"; + + /** Elasticsearch */ + public static final String ELASTICSEARCH = "elasticsearch"; + + /** FileMaker */ + public static final String FILEMAKER = "filemaker"; + + /** Firebird */ + public static final String FIREBIRD = "firebird"; + + /** + * Deprecated, use {@code other_sql} instead. + * + * @deprecated Replaced by {@code other_sql}. + */ + @Deprecated + public static final String FIRSTSQL = "firstsql"; + + /** Apache Geode */ + public static final String GEODE = "geode"; + + /** H2 */ + public static final String H2 = "h2"; + + /** SAP HANA */ + public static final String HANADB = "hanadb"; + + /** Apache HBase */ + public static final String HBASE = "hbase"; + + /** Apache Hive */ + public static final String HIVE = "hive"; + + /** HyperSQL DataBase */ + public static final String HSQLDB = "hsqldb"; + + /** InfluxDB */ + public static final String INFLUXDB = "influxdb"; + + /** Informix */ + public static final String INFORMIX = "informix"; + + /** Ingres */ + public static final String INGRES = "ingres"; + + /** InstantDB */ + public static final String INSTANTDB = "instantdb"; + + /** InterBase */ + public static final String INTERBASE = "interbase"; + + /** MariaDB */ + public static final String MARIADB = "mariadb"; + + /** SAP MaxDB */ + public static final String MAXDB = "maxdb"; + + /** Memcached */ + public static final String MEMCACHED = "memcached"; + + /** MongoDB */ + public static final String MONGODB = "mongodb"; + + /** Microsoft SQL Server */ + public static final String MSSQL = "mssql"; + + /** + * Deprecated, Microsoft SQL Server Compact is discontinued. + * + * @deprecated Replaced by {@code other_sql}. + */ + @Deprecated + public static final String MSSQLCOMPACT = "mssqlcompact"; + + /** MySQL */ + public static final String MYSQL = "mysql"; + + /** Neo4j */ + public static final String NEO4J = "neo4j"; + + /** Netezza */ + public static final String NETEZZA = "netezza"; + + /** OpenSearch */ + public static final String OPENSEARCH = "opensearch"; + + /** Oracle Database */ + public static final String ORACLE = "oracle"; + + /** Pervasive PSQL */ + public static final String PERVASIVE = "pervasive"; + + /** PointBase */ + public static final String POINTBASE = "pointbase"; + + /** PostgreSQL */ + public static final String POSTGRESQL = "postgresql"; + + /** Progress Database */ + public static final String PROGRESS = "progress"; + + /** Redis */ + public static final String REDIS = "redis"; + + /** Amazon Redshift */ + public static final String REDSHIFT = "redshift"; + + /** Cloud Spanner */ + public static final String SPANNER = "spanner"; + + /** SQLite */ + public static final String SQLITE = "sqlite"; + + /** Sybase */ + public static final String SYBASE = "sybase"; + + /** Teradata */ + public static final String TERADATA = "teradata"; + + /** Trino */ + public static final String TRINO = "trino"; + + /** Vertica */ + public static final String VERTICA = "vertica"; + + private DbSystemValues() { + } + } + + private DbIncubatingAttributes() { + } +} diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/EnduserIncubatingAttributes.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/EnduserIncubatingAttributes.java new file mode 100644 index 000000000000..651cb82fcc56 --- /dev/null +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/EnduserIncubatingAttributes.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating; + +import static io.opentelemetry.api.common.AttributeKey.stringKey; + +import io.opentelemetry.api.common.AttributeKey; + +// this is a copy of io.opentelemetry.semconv.incubating.EnduserIncubatingAttributes (1.37.0) + +// DO NOT EDIT, this is an Auto-generated file from +// buildscripts/templates/registry/incubating_java/IncubatingSemanticAttributes.java.j2 +@SuppressWarnings("unused") +public final class EnduserIncubatingAttributes { + /** + * Unique identifier of an end user in the system. It maybe a username, email address, or other + * identifier. + * + *

Notes: + * + *

Unique identifier of an end user in the system. + * + *

+ * + * [!Warning] This field contains sensitive (PII) information. + * + *
+ */ + public static final AttributeKey ENDUSER_ID = stringKey("enduser.id"); + + /** + * Pseudonymous identifier of an end user. This identifier should be a random value that is not + * directly linked or associated with the end user's actual identity. + * + *

Notes: + * + *

Pseudonymous identifier of an end user. + * + *

+ * + * [!Warning] This field contains sensitive (linkable PII) information. + * + *
+ */ + public static final AttributeKey ENDUSER_PSEUDO_ID = stringKey("enduser.pseudo.id"); + + /** + * Deprecated, use {@code user.roles} instead. + * + * @deprecated Replaced by {@code user.roles}. + */ + @Deprecated + public static final AttributeKey ENDUSER_ROLE = stringKey("enduser.role"); + + /** + * Deprecated, no replacement at this time. + * + * @deprecated Removed, no replacement at this time. + */ + @Deprecated + public static final AttributeKey ENDUSER_SCOPE = stringKey("enduser.scope"); + + // Enum definitions + + private EnduserIncubatingAttributes() { + } +} diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/HttpIncubatingAttributes.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/HttpIncubatingAttributes.java new file mode 100644 index 000000000000..1e5a302837be --- /dev/null +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/HttpIncubatingAttributes.java @@ -0,0 +1,410 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating; + +import static io.opentelemetry.api.common.AttributeKey.longKey; +import static io.opentelemetry.api.common.AttributeKey.stringKey; + +import io.opentelemetry.api.common.AttributeKey; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.AttributeKeyTemplate; +import java.util.List; + +// this is a copy of io.opentelemetry.semconv.incubating.HttpIncubatingAttributes (1.37.0) +// DO NOT EDIT, this is an Auto-generated file from +// buildscripts/templates/registry/incubating_java/IncubatingSemanticAttributes.java.j2 +@SuppressWarnings("unused") +public final class HttpIncubatingAttributes { + /** + * Deprecated, use {@code client.address} instead. + * + * @deprecated Replaced by {@code client.address}. + */ + @Deprecated + public static final AttributeKey HTTP_CLIENT_IP = stringKey("http.client_ip"); + + /** State of the HTTP connection in the HTTP connection pool. */ + public static final AttributeKey HTTP_CONNECTION_STATE = stringKey("http.connection.state"); + + /** + * Deprecated, use {@code network.protocol.name} instead. + * + * @deprecated Replaced by {@code network.protocol.name}. + */ + @Deprecated + public static final AttributeKey HTTP_FLAVOR = stringKey("http.flavor"); + + /** + * Deprecated, use one of {@code server.address}, {@code client.address} or {@code + * http.request.header.host} instead, depending on the usage. + * + * @deprecated Replaced by one of {@code server.address}, {@code client.address} or {@code + * http.request.header.host}, depending on the usage. + */ + @Deprecated + public static final AttributeKey HTTP_HOST = stringKey("http.host"); + + /** + * Deprecated, use {@code http.request.method} instead. + * + * @deprecated Replaced by {@code http.request.method}. + */ + @Deprecated + public static final AttributeKey HTTP_METHOD = stringKey("http.method"); + + /** + * 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 + * header. For requests using transport encoding, this should be the compressed size. + */ + public static final AttributeKey HTTP_REQUEST_BODY_SIZE = longKey("http.request.body.size"); + + /** + * HTTP request headers, {@code } being the normalized HTTP Header name (lowercase), the + * value being the header values. + * + *

Notes: + * + *

Instrumentations SHOULD require an explicit configuration of which headers are to be + * captured. Including all request headers can be a security risk - explicit configuration helps + * avoid leaking sensitive information. + * + *

The {@code User-Agent} header is already captured in the {@code user_agent.original} + * attribute. Users MAY explicitly configure instrumentations to capture them even though it is + * not recommended. + * + *

The attribute value MUST consist of either multiple header values as an array of strings or + * a single-item array containing a possibly comma-concatenated string, depending on the way the + * HTTP library provides access to headers. + * + *

Examples: + * + *

    + *
  • A header {@code Content-Type: application/json} SHOULD be recorded as the {@code + * http.request.header.content-type} attribute with value {@code ["application/json"]}. + *
  • A header {@code X-Forwarded-For: 1.2.3.4, 1.2.3.5} SHOULD be recorded as the {@code + * http.request.header.x-forwarded-for} attribute with value {@code ["1.2.3.4", "1.2.3.5"]} + * or {@code ["1.2.3.4, 1.2.3.5"]} depending on the HTTP library. + *
+ * + * @deprecated deprecated in favor of stable {@link + * io.opentelemetry.semconv.HttpAttributes#HTTP_REQUEST_HEADER} attribute. + */ + @Deprecated + public static final AttributeKeyTemplate> HTTP_REQUEST_HEADER + = AttributeKeyTemplate.stringArrayKeyTemplate("http.request.header"); + + /** + * HTTP request method. + * + *

Notes: + * + *

HTTP request method value SHOULD be "known" to the instrumentation. By default, this + * convention defines "known" methods as the ones listed in RFC9110 and the PATCH + * method defined in RFC5789. + * + *

If the HTTP request method is not known to instrumentation, it MUST set the {@code + * http.request.method} attribute to {@code _OTHER}. + * + *

If the HTTP instrumentation could end up converting valid HTTP request methods to {@code + * _OTHER}, then it MUST provide a way to override the list of known HTTP methods. If this + * override is done via environment variable, then the environment variable MUST be named + * OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive + * known HTTP methods (this list MUST be a full override of the default known method, it is not a + * list of known methods in addition to the defaults). + * + *

HTTP method names are case-sensitive and {@code http.request.method} attribute value MUST + * match a known HTTP method name exactly. 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 {@code http.request.method_original} to the original + * value. + * + * @deprecated deprecated in favor of stable {@link + * io.opentelemetry.semconv.HttpAttributes#HTTP_REQUEST_METHOD} attribute. + */ + @Deprecated + public static final AttributeKey HTTP_REQUEST_METHOD = stringKey("http.request.method"); + + /** + * Original HTTP method sent by the client in the request line. + * + * @deprecated deprecated in favor of stable {@link + * io.opentelemetry.semconv.HttpAttributes#HTTP_REQUEST_METHOD_ORIGINAL} attribute. + */ + @Deprecated + public static final AttributeKey HTTP_REQUEST_METHOD_ORIGINAL = stringKey("http.request.method_original"); + + /** + * The ordinal number of request resending attempt (for any reason, including redirects). + * + *

Notes: + * + *

The resend count SHOULD be updated each time an HTTP request gets resent by the client, + * regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 + * Server Unavailable, network issues, or any other). + * + * @deprecated deprecated in favor of stable {@link + * io.opentelemetry.semconv.HttpAttributes#HTTP_REQUEST_RESEND_COUNT} attribute. + */ + @Deprecated + public static final AttributeKey HTTP_REQUEST_RESEND_COUNT = longKey("http.request.resend_count"); + + /** + * The total size of the request in bytes. This should be the total number of bytes sent over the + * wire, including the request line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and request + * body if any. + */ + public static final AttributeKey HTTP_REQUEST_SIZE = longKey("http.request.size"); + + /** + * Deprecated, use {@code http.request.header.content-length} instead. + * + * @deprecated Replaced by {@code http.request.header.content-length}. + */ + @Deprecated + public static final AttributeKey HTTP_REQUEST_CONTENT_LENGTH = longKey("http.request_content_length"); + + /** + * Deprecated, use {@code http.request.body.size} instead. + * + * @deprecated Replaced by {@code http.request.body.size}. + */ + @Deprecated + public static final AttributeKey HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED + = longKey("http.request_content_length_uncompressed"); + + /** + * 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 + * header. For requests using transport encoding, this should be the compressed size. + */ + public static final AttributeKey HTTP_RESPONSE_BODY_SIZE = longKey("http.response.body.size"); + + /** + * HTTP response headers, {@code } being the normalized HTTP Header name (lowercase), the + * value being the header values. + * + *

Notes: + * + *

Instrumentations SHOULD require an explicit configuration of which headers are to be + * captured. Including all response headers can be a security risk - explicit configuration helps + * avoid leaking sensitive information. + * + *

Users MAY explicitly configure instrumentations to capture them even though it is not + * recommended. + * + *

The attribute value MUST consist of either multiple header values as an array of strings or + * a single-item array containing a possibly comma-concatenated string, depending on the way the + * HTTP library provides access to headers. + * + *

Examples: + * + *

    + *
  • A header {@code Content-Type: application/json} header SHOULD be recorded as the {@code + * http.request.response.content-type} attribute with value {@code ["application/json"]}. + *
  • A header {@code My-custom-header: abc, def} header SHOULD be recorded as the {@code + * http.response.header.my-custom-header} attribute with value {@code ["abc", "def"]} or + * {@code ["abc, def"]} depending on the HTTP library. + *
+ * + * @deprecated deprecated in favor of stable {@link + * io.opentelemetry.semconv.HttpAttributes#HTTP_RESPONSE_HEADER} attribute. + */ + @Deprecated + public static final AttributeKeyTemplate> HTTP_RESPONSE_HEADER + = AttributeKeyTemplate.stringArrayKeyTemplate("http.response.header"); + + /** + * 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. + */ + public static final AttributeKey HTTP_RESPONSE_SIZE = longKey("http.response.size"); + + /** + * HTTP response status code. + * + * @deprecated deprecated in favor of stable {@link + * io.opentelemetry.semconv.HttpAttributes#HTTP_RESPONSE_STATUS_CODE} attribute. + */ + @Deprecated + public static final AttributeKey HTTP_RESPONSE_STATUS_CODE = longKey("http.response.status_code"); + + /** + * Deprecated, use {@code http.response.header.content-length} instead. + * + * @deprecated Replaced by {@code http.response.header.content-length}. + */ + @Deprecated + public static final AttributeKey HTTP_RESPONSE_CONTENT_LENGTH = longKey("http.response_content_length"); + + /** + * Deprecated, use {@code http.response.body.size} instead. + * + * @deprecated Replaced by {@code http.response.body.size}. + */ + @Deprecated + public static final AttributeKey HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED + = longKey("http.response_content_length_uncompressed"); + + /** + * The matched route, that is, the path template in the format used by the respective server + * framework. + * + *

Notes: + * + *

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 if there is + * one. + * + * @deprecated deprecated in favor of stable {@link + * io.opentelemetry.semconv.HttpAttributes#HTTP_ROUTE} attribute. + */ + @Deprecated + public static final AttributeKey HTTP_ROUTE = stringKey("http.route"); + + /** + * Deprecated, use {@code url.scheme} instead. + * + * @deprecated Replaced by {@code url.scheme}. + */ + @Deprecated + public static final AttributeKey HTTP_SCHEME = stringKey("http.scheme"); + + /** + * Deprecated, use {@code server.address} instead. + * + * @deprecated Replaced by {@code server.address}. + */ + @Deprecated + public static final AttributeKey HTTP_SERVER_NAME = stringKey("http.server_name"); + + /** + * Deprecated, use {@code http.response.status_code} instead. + * + * @deprecated Replaced by {@code http.response.status_code}. + */ + @Deprecated + public static final AttributeKey HTTP_STATUS_CODE = longKey("http.status_code"); + + /** + * Deprecated, use {@code url.path} and {@code url.query} instead. + * + * @deprecated Split to {@code url.path} and {@code url.query}. + */ + @Deprecated + public static final AttributeKey HTTP_TARGET = stringKey("http.target"); + + /** + * Deprecated, use {@code url.full} instead. + * + * @deprecated Replaced by {@code url.full}. + */ + @Deprecated + public static final AttributeKey HTTP_URL = stringKey("http.url"); + + /** + * Deprecated, use {@code user_agent.original} instead. + * + * @deprecated Replaced by {@code user_agent.original}. + */ + @Deprecated + public static final AttributeKey HTTP_USER_AGENT = stringKey("http.user_agent"); + + // Enum definitions + + /** Values for {@link #HTTP_CONNECTION_STATE}. */ + public static final class HttpConnectionStateIncubatingValues { + /** active state. */ + public static final String ACTIVE = "active"; + + /** idle state. */ + public static final String IDLE = "idle"; + + private HttpConnectionStateIncubatingValues() { + } + } + + /** + * Values for {@link #HTTP_FLAVOR} + * + * @deprecated Replaced by {@code network.protocol.name}. + */ + @Deprecated + public static final class HttpFlavorIncubatingValues { + /** HTTP/1.0 */ + public static final String HTTP_1_0 = "1.0"; + + /** HTTP/1.1 */ + public static final String HTTP_1_1 = "1.1"; + + /** HTTP/2 */ + public static final String HTTP_2_0 = "2.0"; + + /** HTTP/3 */ + public static final String HTTP_3_0 = "3.0"; + + /** SPDY protocol. */ + public static final String SPDY = "SPDY"; + + /** QUIC protocol. */ + public static final String QUIC = "QUIC"; + + private HttpFlavorIncubatingValues() { + } + } + + /** + * Values for {@link #HTTP_REQUEST_METHOD}. + * + * @deprecated deprecated in favor of stable {@link + * io.opentelemetry.semconv.HttpAttributes.HttpRequestMethodValues}. + */ + @Deprecated + public static final class HttpRequestMethodIncubatingValues { + /** CONNECT method. */ + public static final String CONNECT = "CONNECT"; + + /** DELETE method. */ + public static final String DELETE = "DELETE"; + + /** GET method. */ + public static final String GET = "GET"; + + /** HEAD method. */ + public static final String HEAD = "HEAD"; + + /** OPTIONS method. */ + public static final String OPTIONS = "OPTIONS"; + + /** PATCH method. */ + public static final String PATCH = "PATCH"; + + /** POST method. */ + public static final String POST = "POST"; + + /** PUT method. */ + public static final String PUT = "PUT"; + + /** TRACE method. */ + public static final String TRACE = "TRACE"; + + /** Any HTTP method that the instrumentation has no prior knowledge of. */ + public static final String OTHER = "_OTHER"; + + private HttpRequestMethodIncubatingValues() { + } + } + + private HttpIncubatingAttributes() { + } +} diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/MessagingIncubatingAttributes.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/MessagingIncubatingAttributes.java new file mode 100644 index 000000000000..b69983bbb657 --- /dev/null +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/MessagingIncubatingAttributes.java @@ -0,0 +1,485 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating; + +import static io.opentelemetry.api.common.AttributeKey.booleanKey; +import static io.opentelemetry.api.common.AttributeKey.longKey; +import static io.opentelemetry.api.common.AttributeKey.stringArrayKey; +import static io.opentelemetry.api.common.AttributeKey.stringKey; + +import io.opentelemetry.api.common.AttributeKey; +import java.util.List; + +// this is a copy of io.opentelemetry.semconv.incubating.MessagingIncubatingAttributes (1.37.0) + +// DO NOT EDIT, this is an Auto-generated file from +// buildscripts/templates/registry/incubating_java/IncubatingSemanticAttributes.java.j2 +@SuppressWarnings("unused") +public final class MessagingIncubatingAttributes { + /** + * The number of messages sent, received, or processed in the scope of the batching operation. + * + *

Notes: + * + *

Instrumentations SHOULD NOT set {@code 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 {@code messaging.batch.message_count} + * for batching APIs and SHOULD NOT use it for single-message APIs. + */ + public static final AttributeKey MESSAGING_BATCH_MESSAGE_COUNT = longKey("messaging.batch.message_count"); + + /** A unique identifier for the client that consumes or produces a message. */ + public static final AttributeKey MESSAGING_CLIENT_ID = stringKey("messaging.client.id"); + + /** + * The name of the consumer group with which a consumer is associated. + * + *

Notes: + * + *

Semantic conventions for individual messaging systems SHOULD document whether {@code + * messaging.consumer.group.name} is applicable and what it means in the context of that system. + */ + public static final AttributeKey MESSAGING_CONSUMER_GROUP_NAME = stringKey("messaging.consumer.group.name"); + + /** + * A boolean that is true if the message destination is anonymous (could be unnamed or have + * auto-generated name). + */ + public static final AttributeKey MESSAGING_DESTINATION_ANONYMOUS + = booleanKey("messaging.destination.anonymous"); + + /** + * The message destination name + * + *

Notes: + * + *

Destination name SHOULD uniquely identify a specific queue, topic or other entity within the + * broker. If the broker doesn't have such notion, the destination name SHOULD uniquely identify + * the broker. + */ + public static final AttributeKey MESSAGING_DESTINATION_NAME = stringKey("messaging.destination.name"); + + /** + * The identifier of the partition messages are sent to or received from, unique within the {@code + * messaging.destination.name}. + */ + public static final AttributeKey MESSAGING_DESTINATION_PARTITION_ID + = stringKey("messaging.destination.partition.id"); + + /** + * The name of the destination subscription from which a message is consumed. + * + *

Notes: + * + *

Semantic conventions for individual messaging systems SHOULD document whether {@code + * messaging.destination.subscription.name} is applicable and what it means in the context of that + * system. + */ + public static final AttributeKey MESSAGING_DESTINATION_SUBSCRIPTION_NAME + = stringKey("messaging.destination.subscription.name"); + + /** + * Low cardinality representation of the messaging destination name + * + *

Notes: + * + *

Destination names could be constructed from templates. An example would be a destination + * name involving a user name or product id. Although the destination name in this case is of high + * cardinality, the underlying template is of low cardinality and can be effectively used for + * grouping and aggregation. + */ + public static final AttributeKey MESSAGING_DESTINATION_TEMPLATE + = stringKey("messaging.destination.template"); + + /** + * A boolean that is true if the message destination is temporary and might not exist anymore + * after messages are processed. + */ + public static final AttributeKey MESSAGING_DESTINATION_TEMPORARY + = booleanKey("messaging.destination.temporary"); + + /** + * Deprecated, no replacement at this time. + * + * @deprecated Removed. No replacement at this time. + */ + @Deprecated + public static final AttributeKey MESSAGING_DESTINATION_PUBLISH_ANONYMOUS + = booleanKey("messaging.destination_publish.anonymous"); + + /** + * Deprecated, no replacement at this time. + * + * @deprecated Removed. No replacement at this time. + */ + @Deprecated + public static final AttributeKey MESSAGING_DESTINATION_PUBLISH_NAME + = stringKey("messaging.destination_publish.name"); + + /** + * Deprecated, use {@code messaging.consumer.group.name} instead. + * + * @deprecated Replaced by {@code messaging.consumer.group.name}. + */ + @Deprecated + public static final AttributeKey MESSAGING_EVENTHUBS_CONSUMER_GROUP + = stringKey("messaging.eventhubs.consumer.group"); + + /** The UTC epoch seconds at which the message has been accepted and stored in the entity. */ + public static final AttributeKey MESSAGING_EVENTHUBS_MESSAGE_ENQUEUED_TIME + = longKey("messaging.eventhubs.message.enqueued_time"); + + /** The ack deadline in seconds set for the modify ack deadline request. */ + public static final AttributeKey MESSAGING_GCP_PUBSUB_MESSAGE_ACK_DEADLINE + = longKey("messaging.gcp_pubsub.message.ack_deadline"); + + /** The ack id for a given message. */ + public static final AttributeKey MESSAGING_GCP_PUBSUB_MESSAGE_ACK_ID + = stringKey("messaging.gcp_pubsub.message.ack_id"); + + /** The delivery attempt for a given message. */ + public static final AttributeKey MESSAGING_GCP_PUBSUB_MESSAGE_DELIVERY_ATTEMPT + = longKey("messaging.gcp_pubsub.message.delivery_attempt"); + + /** + * The ordering key for a given message. If the attribute is not present, the message does not + * have an ordering key. + */ + public static final AttributeKey MESSAGING_GCP_PUBSUB_MESSAGE_ORDERING_KEY + = stringKey("messaging.gcp_pubsub.message.ordering_key"); + + /** + * Deprecated, use {@code messaging.consumer.group.name} instead. + * + * @deprecated Replaced by {@code messaging.consumer.group.name}. + */ + @Deprecated + public static final AttributeKey MESSAGING_KAFKA_CONSUMER_GROUP + = stringKey("messaging.kafka.consumer.group"); + + /** + * Deprecated, use {@code messaging.destination.partition.id} instead. + * + * @deprecated Replaced by {@code messaging.destination.partition.id}. + */ + @Deprecated + public static final AttributeKey MESSAGING_KAFKA_DESTINATION_PARTITION + = longKey("messaging.kafka.destination.partition"); + + /** + * Message keys in Kafka are used for grouping alike messages to ensure they're processed on the + * same partition. They differ from {@code messaging.message.id} in that they're not unique. If + * the key is {@code null}, the attribute MUST NOT be set. + * + *

Notes: + * + *

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. + */ + public static final AttributeKey MESSAGING_KAFKA_MESSAGE_KEY = stringKey("messaging.kafka.message.key"); + + /** + * Deprecated, use {@code messaging.kafka.offset} instead. + * + * @deprecated Replaced by {@code messaging.kafka.offset}. + */ + @Deprecated + public static final AttributeKey MESSAGING_KAFKA_MESSAGE_OFFSET = longKey("messaging.kafka.message.offset"); + + /** A boolean that is true if the message is a tombstone. */ + public static final AttributeKey MESSAGING_KAFKA_MESSAGE_TOMBSTONE + = booleanKey("messaging.kafka.message.tombstone"); + + /** The offset of a record in the corresponding Kafka partition. */ + public static final AttributeKey MESSAGING_KAFKA_OFFSET = longKey("messaging.kafka.offset"); + + /** + * The size of the message body in bytes. + * + *

Notes: + * + *

This can refer to both the compressed or uncompressed body size. If both sizes are known, + * the uncompressed body size should be used. + */ + public static final AttributeKey MESSAGING_MESSAGE_BODY_SIZE = longKey("messaging.message.body.size"); + + /** + * The conversation ID identifying the conversation to which the message belongs, represented as a + * string. Sometimes called "Correlation ID". + */ + public static final AttributeKey MESSAGING_MESSAGE_CONVERSATION_ID + = stringKey("messaging.message.conversation_id"); + + /** + * The size of the message body and metadata in bytes. + * + *

Notes: + * + *

This can refer to both the compressed or uncompressed size. If both sizes are known, the + * uncompressed size should be used. + */ + public static final AttributeKey MESSAGING_MESSAGE_ENVELOPE_SIZE = longKey("messaging.message.envelope.size"); + + /** + * A value used by the messaging system as an identifier for the message, represented as a string. + */ + public static final AttributeKey MESSAGING_MESSAGE_ID = stringKey("messaging.message.id"); + + /** + * Deprecated, use {@code messaging.operation.type} instead. + * + * @deprecated Replaced by {@code messaging.operation.type}. + */ + @Deprecated + public static final AttributeKey MESSAGING_OPERATION = stringKey("messaging.operation"); + + /** The system-specific name of the messaging operation. */ + public static final AttributeKey MESSAGING_OPERATION_NAME = stringKey("messaging.operation.name"); + + /** + * A string identifying the type of the messaging operation. + * + *

Notes: + * + *

If a custom value is used, it MUST be of low cardinality. + */ + public static final AttributeKey MESSAGING_OPERATION_TYPE = stringKey("messaging.operation.type"); + + /** RabbitMQ message routing key. */ + public static final AttributeKey MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY + = stringKey("messaging.rabbitmq.destination.routing_key"); + + /** RabbitMQ message delivery tag */ + public static final AttributeKey MESSAGING_RABBITMQ_MESSAGE_DELIVERY_TAG + = longKey("messaging.rabbitmq.message.delivery_tag"); + + /** + * Deprecated, use {@code messaging.consumer.group.name} instead. + * + * @deprecated Replaced by {@code messaging.consumer.group.name} on the consumer spans. No + * replacement for producer spans. + */ + @Deprecated + public static final AttributeKey MESSAGING_ROCKETMQ_CLIENT_GROUP + = stringKey("messaging.rocketmq.client_group"); + + /** Model of message consumption. This only applies to consumer spans. */ + public static final AttributeKey MESSAGING_ROCKETMQ_CONSUMPTION_MODEL + = stringKey("messaging.rocketmq.consumption_model"); + + /** The delay time level for delay message, which determines the message delay time. */ + public static final AttributeKey MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL + = longKey("messaging.rocketmq.message.delay_time_level"); + + /** + * The timestamp in milliseconds that the delay message is expected to be delivered to consumer. + */ + public static final AttributeKey MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP + = longKey("messaging.rocketmq.message.delivery_timestamp"); + + /** + * 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. + */ + public static final AttributeKey MESSAGING_ROCKETMQ_MESSAGE_GROUP + = stringKey("messaging.rocketmq.message.group"); + + /** Key(s) of message, another way to mark message besides message id. */ + public static final AttributeKey> MESSAGING_ROCKETMQ_MESSAGE_KEYS + = stringArrayKey("messaging.rocketmq.message.keys"); + + /** The secondary classifier of message besides topic. */ + public static final AttributeKey MESSAGING_ROCKETMQ_MESSAGE_TAG + = stringKey("messaging.rocketmq.message.tag"); + + /** Type of message. */ + public static final AttributeKey MESSAGING_ROCKETMQ_MESSAGE_TYPE + = stringKey("messaging.rocketmq.message.type"); + + /** Namespace of RocketMQ resources, resources in different namespaces are individual. */ + public static final AttributeKey MESSAGING_ROCKETMQ_NAMESPACE = stringKey("messaging.rocketmq.namespace"); + + /** + * Deprecated, use {@code messaging.destination.subscription.name} instead. + * + * @deprecated Replaced by {@code messaging.destination.subscription.name}. + */ + @Deprecated + public static final AttributeKey MESSAGING_SERVICEBUS_DESTINATION_SUBSCRIPTION_NAME + = stringKey("messaging.servicebus.destination.subscription_name"); + + /** + * Describes the settlement + * type. + */ + public static final AttributeKey MESSAGING_SERVICEBUS_DISPOSITION_STATUS + = stringKey("messaging.servicebus.disposition_status"); + + /** Number of deliveries that have been attempted for this message. */ + public static final AttributeKey MESSAGING_SERVICEBUS_MESSAGE_DELIVERY_COUNT + = longKey("messaging.servicebus.message.delivery_count"); + + /** The UTC epoch seconds at which the message has been accepted and stored in the entity. */ + public static final AttributeKey MESSAGING_SERVICEBUS_MESSAGE_ENQUEUED_TIME + = longKey("messaging.servicebus.message.enqueued_time"); + + /** + * The messaging system as identified by the client instrumentation. + * + *

Notes: + * + *

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 {@code messaging.system} + * is set to {@code kafka} based on the instrumentation's best knowledge. + */ + public static final AttributeKey MESSAGING_SYSTEM = stringKey("messaging.system"); + + // Enum definitions + + /** Values for {@link #MESSAGING_OPERATION_TYPE}. */ + public static final class MessagingOperationTypeIncubatingValues { + /** + * 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. + */ + public static final String CREATE = "create"; + + /** + * 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. + */ + public static final String SEND = "send"; + + /** + * 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 static final String RECEIVE = "receive"; + + /** One or more messages are processed by a consumer. */ + public static final String PROCESS = "process"; + + /** One or more messages are settled. */ + public static final String SETTLE = "settle"; + + /** + * Deprecated. Use {@code process} instead. + * + * @deprecated Replaced by {@code process}. + */ + @Deprecated + public static final String DELIVER = "deliver"; + + /** + * Deprecated. Use {@code send} instead. + * + * @deprecated Replaced by {@code send}. + */ + @Deprecated + public static final String PUBLISH = "publish"; + + private MessagingOperationTypeIncubatingValues() { + } + } + + /** Values for {@link #MESSAGING_ROCKETMQ_CONSUMPTION_MODEL}. */ + public static final class MessagingRocketmqConsumptionModelIncubatingValues { + /** Clustering consumption model */ + public static final String CLUSTERING = "clustering"; + + /** Broadcasting consumption model */ + public static final String BROADCASTING = "broadcasting"; + + private MessagingRocketmqConsumptionModelIncubatingValues() { + } + } + + /** Values for {@link #MESSAGING_ROCKETMQ_MESSAGE_TYPE}. */ + public static final class MessagingRocketmqMessageTypeIncubatingValues { + /** Normal message */ + public static final String NORMAL = "normal"; + + /** FIFO message */ + public static final String FIFO = "fifo"; + + /** Delay message */ + public static final String DELAY = "delay"; + + /** Transaction message */ + public static final String TRANSACTION = "transaction"; + + private MessagingRocketmqMessageTypeIncubatingValues() { + } + } + + /** Values for {@link #MESSAGING_SERVICEBUS_DISPOSITION_STATUS}. */ + public static final class MessagingServicebusDispositionStatusIncubatingValues { + /** Message is completed */ + public static final String COMPLETE = "complete"; + + /** Message is abandoned */ + public static final String ABANDON = "abandon"; + + /** Message is sent to dead letter queue */ + public static final String DEAD_LETTER = "dead_letter"; + + /** Message is deferred */ + public static final String DEFER = "defer"; + + private MessagingServicebusDispositionStatusIncubatingValues() { + } + } + + /** Values for {@link #MESSAGING_SYSTEM}. */ + public static final class MessagingSystemIncubatingValues { + /** Apache ActiveMQ */ + public static final String ACTIVEMQ = "activemq"; + + /** Amazon Simple Notification Service (SNS) */ + public static final String AWS_SNS = "aws.sns"; + + /** Amazon Simple Queue Service (SQS) */ + public static final String AWS_SQS = "aws_sqs"; + + /** Azure Event Grid */ + public static final String EVENTGRID = "eventgrid"; + + /** Azure Event Hubs */ + public static final String EVENTHUBS = "eventhubs"; + + /** Azure Service Bus */ + public static final String SERVICEBUS = "servicebus"; + + /** Google Cloud Pub/Sub */ + public static final String GCP_PUBSUB = "gcp_pubsub"; + + /** Java Message Service */ + public static final String JMS = "jms"; + + /** Apache Kafka */ + public static final String KAFKA = "kafka"; + + /** RabbitMQ */ + public static final String RABBITMQ = "rabbitmq"; + + /** Apache RocketMQ */ + public static final String ROCKETMQ = "rocketmq"; + + /** Apache Pulsar */ + public static final String PULSAR = "pulsar"; + + private MessagingSystemIncubatingValues() { + } + } + + private MessagingIncubatingAttributes() { + } +} diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/NetIncubatingAttributes.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/NetIncubatingAttributes.java new file mode 100644 index 000000000000..d7cf9c46a11c --- /dev/null +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/NetIncubatingAttributes.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating; + +import static io.opentelemetry.api.common.AttributeKey.longKey; +import static io.opentelemetry.api.common.AttributeKey.stringKey; + +import io.opentelemetry.api.common.AttributeKey; + +// this is a copy of io.opentelemetry.semconv.incubating.NetIncubatingAttributes (1.37.0) +// DO NOT EDIT, this is an Auto-generated file from +// buildscripts/templates/registry/incubating_java/IncubatingSemanticAttributes.java.j2 +@SuppressWarnings("unused") +public final class NetIncubatingAttributes { + /** + * Deprecated, use {@code network.local.address}. + * + * @deprecated Replaced by {@code network.local.address}. + */ + @Deprecated + public static final AttributeKey NET_HOST_IP = stringKey("net.host.ip"); + + /** + * Deprecated, use {@code server.address}. + * + * @deprecated Replaced by {@code server.address}. + */ + @Deprecated + public static final AttributeKey NET_HOST_NAME = stringKey("net.host.name"); + + /** + * Deprecated, use {@code server.port}. + * + * @deprecated Replaced by {@code server.port}. + */ + @Deprecated + public static final AttributeKey NET_HOST_PORT = longKey("net.host.port"); + + /** + * Deprecated, use {@code network.peer.address}. + * + * @deprecated Replaced by {@code network.peer.address}. + */ + @Deprecated + public static final AttributeKey NET_PEER_IP = stringKey("net.peer.ip"); + + /** + * Deprecated, use {@code server.address} on client spans and {@code client.address} on server + * spans. + * + * @deprecated Replaced by {@code server.address} on client spans and {@code client.address} on + * server spans. + */ + @Deprecated + public static final AttributeKey NET_PEER_NAME = stringKey("net.peer.name"); + + /** + * Deprecated, use {@code server.port} on client spans and {@code client.port} on server spans. + * + * @deprecated Replaced by {@code server.port} on client spans and {@code client.port} on server + * spans. + */ + @Deprecated + public static final AttributeKey NET_PEER_PORT = longKey("net.peer.port"); + + /** + * Deprecated, use {@code network.protocol.name}. + * + * @deprecated Replaced by {@code network.protocol.name}. + */ + @Deprecated + public static final AttributeKey NET_PROTOCOL_NAME = stringKey("net.protocol.name"); + + /** + * Deprecated, use {@code network.protocol.version}. + * + * @deprecated Replaced by {@code network.protocol.version}. + */ + @Deprecated + public static final AttributeKey NET_PROTOCOL_VERSION = stringKey("net.protocol.version"); + + /** + * Deprecated, use {@code network.transport} and {@code network.type}. + * + * @deprecated Split to {@code network.transport} and {@code network.type}. + */ + @Deprecated + public static final AttributeKey NET_SOCK_FAMILY = stringKey("net.sock.family"); + + /** + * Deprecated, use {@code network.local.address}. + * + * @deprecated Replaced by {@code network.local.address}. + */ + @Deprecated + public static final AttributeKey NET_SOCK_HOST_ADDR = stringKey("net.sock.host.addr"); + + /** + * Deprecated, use {@code network.local.port}. + * + * @deprecated Replaced by {@code network.local.port}. + */ + @Deprecated + public static final AttributeKey NET_SOCK_HOST_PORT = longKey("net.sock.host.port"); + + /** + * Deprecated, use {@code network.peer.address}. + * + * @deprecated Replaced by {@code network.peer.address}. + */ + @Deprecated + public static final AttributeKey NET_SOCK_PEER_ADDR = stringKey("net.sock.peer.addr"); + + /** + * Deprecated, no replacement at this time. + * + * @deprecated Removed. No replacement at this time. + */ + @Deprecated + public static final AttributeKey NET_SOCK_PEER_NAME = stringKey("net.sock.peer.name"); + + /** + * Deprecated, use {@code network.peer.port}. + * + * @deprecated Replaced by {@code network.peer.port}. + */ + @Deprecated + public static final AttributeKey NET_SOCK_PEER_PORT = longKey("net.sock.peer.port"); + + /** + * Deprecated, use {@code network.transport}. + * + * @deprecated Replaced by {@code network.transport}. + */ + @Deprecated + public static final AttributeKey NET_TRANSPORT = stringKey("net.transport"); + + // Enum definitions + + /** + * Values for {@link #NET_SOCK_FAMILY} + * + * @deprecated Split to {@code network.transport} and {@code network.type}. + */ + @Deprecated + public static final class NetSockFamilyIncubatingValues { + /** IPv4 address */ + public static final String INET = "inet"; + + /** IPv6 address */ + public static final String INET6 = "inet6"; + + /** Unix domain socket path */ + public static final String UNIX = "unix"; + + private NetSockFamilyIncubatingValues() { + } + } + + /** + * Values for {@link #NET_TRANSPORT} + * + * @deprecated Replaced by {@code network.transport}. + */ + @Deprecated + public static final class NetTransportIncubatingValues { + /** ip_tcp. */ + public static final String IP_TCP = "ip_tcp"; + + /** ip_udp. */ + public static final String IP_UDP = "ip_udp"; + + /** Named or anonymous pipe. */ + public static final String PIPE = "pipe"; + + /** In-process communication. */ + public static final String INPROC = "inproc"; + + /** Something else (non IP-based). */ + public static final String OTHER = "other"; + + private NetTransportIncubatingValues() { + } + } + + private NetIncubatingAttributes() { + } +} diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/PeerIncubatingAttributes.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/PeerIncubatingAttributes.java new file mode 100644 index 000000000000..286770e5bac5 --- /dev/null +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/PeerIncubatingAttributes.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating; + +import static io.opentelemetry.api.common.AttributeKey.stringKey; + +import io.opentelemetry.api.common.AttributeKey; + +// this is a copy of io.opentelemetry.semconv.incubating.PeerIncubatingAttributes (1.37.0) +// DO NOT EDIT, this is an Auto-generated file from +// buildscripts/templates/registry/incubating_java/IncubatingSemanticAttributes.java.j2 +@SuppressWarnings("unused") +public final class PeerIncubatingAttributes { + /** + * The name of the remote service being connected to. + * + *

Notes: + * + *

    + *
  • May be a logical name or a domain name. Examples: "service-a", "10.0.0.1:5555", + * "httpbin.org". + *
+ */ + public static final AttributeKey PEER_SERVICE = stringKey("peer.service"); + + private PeerIncubatingAttributes() { + } +} diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/RpcIncubatingAttributes.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/RpcIncubatingAttributes.java new file mode 100644 index 000000000000..4bc62d40197d --- /dev/null +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/RpcIncubatingAttributes.java @@ -0,0 +1,320 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating; + +import static io.opentelemetry.api.common.AttributeKey.longKey; +import static io.opentelemetry.api.common.AttributeKey.stringKey; +import static com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.AttributeKeyTemplate.stringArrayKeyTemplate; + +import io.opentelemetry.api.common.AttributeKey; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.AttributeKeyTemplate; +import java.util.List; + +// this is a copy of io.opentelemetry.semconv.incubating.RpcIncubatingAttributes (1.37.0) + +// DO NOT EDIT, this is an Auto-generated file from +// buildscripts/templates/registry/incubating_java/IncubatingSemanticAttributes.java.j2 +@SuppressWarnings("unused") +public final class RpcIncubatingAttributes { + /** + * The error codes of the Connect + * request. Error codes are always string values. + */ + public static final AttributeKey RPC_CONNECT_RPC_ERROR_CODE = stringKey("rpc.connect_rpc.error_code"); + + /** + * Connect request metadata, {@code } being the normalized Connect Metadata key (lowercase), + * the value being the metadata values. + * + *

Notes: + * + *

Instrumentations SHOULD require an explicit configuration of which metadata values are to be + * captured. Including all request metadata values can be a security risk - explicit configuration + * helps avoid leaking sensitive information. + * + *

For example, a property {@code my-custom-key} with value {@code ["1.2.3.4", "1.2.3.5"]} + * SHOULD be recorded as the {@code rpc.connect_rpc.request.metadata.my-custom-key} attribute with + * value {@code ["1.2.3.4", "1.2.3.5"]} + */ + public static final AttributeKeyTemplate> RPC_CONNECT_RPC_REQUEST_METADATA + = stringArrayKeyTemplate("rpc.connect_rpc.request.metadata"); + + /** + * Connect response metadata, {@code } being the normalized Connect Metadata key (lowercase), + * the value being the metadata values. + * + *

Notes: + * + *

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. + * + *

For example, a property {@code my-custom-key} with value {@code "attribute_value"} SHOULD be + * recorded as the {@code rpc.connect_rpc.response.metadata.my-custom-key} attribute with value + * {@code ["attribute_value"]} + */ + public static final AttributeKeyTemplate> RPC_CONNECT_RPC_RESPONSE_METADATA + = stringArrayKeyTemplate("rpc.connect_rpc.response.metadata"); + + /** + * gRPC request metadata, {@code } being the normalized gRPC Metadata key (lowercase), the + * value being the metadata values. + * + *

Notes: + * + *

Instrumentations SHOULD require an explicit configuration of which metadata values are to be + * captured. Including all request metadata values can be a security risk - explicit configuration + * helps avoid leaking sensitive information. + * + *

For example, a property {@code my-custom-key} with value {@code ["1.2.3.4", "1.2.3.5"]} + * SHOULD be recorded as {@code rpc.grpc.request.metadata.my-custom-key} attribute with value + * {@code ["1.2.3.4", "1.2.3.5"]} + */ + public static final AttributeKeyTemplate> RPC_GRPC_REQUEST_METADATA + = stringArrayKeyTemplate("rpc.grpc.request.metadata"); + + /** + * gRPC response metadata, {@code } being the normalized gRPC Metadata key (lowercase), the + * value being the metadata values. + * + *

Notes: + * + *

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. + * + *

For example, a property {@code my-custom-key} with value {@code ["attribute_value"]} SHOULD + * be recorded as the {@code rpc.grpc.response.metadata.my-custom-key} attribute with value {@code + * ["attribute_value"]} + */ + public static final AttributeKeyTemplate> RPC_GRPC_RESPONSE_METADATA + = stringArrayKeyTemplate("rpc.grpc.response.metadata"); + + /** + * The numeric status + * code of the gRPC request. + */ + public static final AttributeKey RPC_GRPC_STATUS_CODE = longKey("rpc.grpc.status_code"); + + /** {@code error.code} property of response if it is an error response. */ + public static final AttributeKey RPC_JSONRPC_ERROR_CODE = longKey("rpc.jsonrpc.error_code"); + + /** {@code error.message} property of response if it is an error response. */ + public static final AttributeKey RPC_JSONRPC_ERROR_MESSAGE = stringKey("rpc.jsonrpc.error_message"); + + /** + * {@code id} property of request or response. Since protocol allows id to be int, string, {@code + * null} or missing (for notifications), value is expected to be cast to string for simplicity. + * Use empty string in case of {@code null} value. Omit entirely if this is a notification. + */ + public static final AttributeKey RPC_JSONRPC_REQUEST_ID = stringKey("rpc.jsonrpc.request_id"); + + /** + * Protocol version as in {@code jsonrpc} property of request/response. Since JSON-RPC 1.0 doesn't + * specify this, the value can be omitted. + */ + public static final AttributeKey RPC_JSONRPC_VERSION = stringKey("rpc.jsonrpc.version"); + + /** Compressed size of the message in bytes. */ + public static final AttributeKey RPC_MESSAGE_COMPRESSED_SIZE = longKey("rpc.message.compressed_size"); + + /** + * MUST be calculated as two different counters starting from {@code 1} one for sent messages and + * one for received message. + * + *

Notes: + * + *

This way we guarantee that the values will be consistent between different implementations. + */ + public static final AttributeKey RPC_MESSAGE_ID = longKey("rpc.message.id"); + + /** Whether this is a received or sent message. */ + public static final AttributeKey RPC_MESSAGE_TYPE = stringKey("rpc.message.type"); + + /** Uncompressed size of the message in bytes. */ + public static final AttributeKey RPC_MESSAGE_UNCOMPRESSED_SIZE = longKey("rpc.message.uncompressed_size"); + + /** + * The name of the (logical) method being called, must be equal to the $method part in the span + * name. + * + *

Notes: + * + *

This is the logical name of the method from the RPC interface perspective, which can be + * different from the name of any implementing method/function. The {@code code.function.name} + * attribute may be used to store the latter (e.g., method actually executing the call on the + * server side, RPC client stub method on the client side). + */ + public static final AttributeKey RPC_METHOD = stringKey("rpc.method"); + + /** + * The full (logical) name of the service being called, including its package name, if applicable. + * + *

Notes: + * + *

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 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). + */ + public static final AttributeKey RPC_SERVICE = stringKey("rpc.service"); + + /** A string identifying the remoting system. See below for a list of well-known identifiers. */ + public static final AttributeKey RPC_SYSTEM = stringKey("rpc.system"); + + // Enum definitions + + /** Values for {@link #RPC_CONNECT_RPC_ERROR_CODE}. */ + public static final class RpcConnectRpcErrorCodeIncubatingValues { + /** cancelled. */ + public static final String CANCELLED = "cancelled"; + + /** unknown. */ + public static final String UNKNOWN = "unknown"; + + /** invalid_argument. */ + public static final String INVALID_ARGUMENT = "invalid_argument"; + + /** deadline_exceeded. */ + public static final String DEADLINE_EXCEEDED = "deadline_exceeded"; + + /** not_found. */ + public static final String NOT_FOUND = "not_found"; + + /** already_exists. */ + public static final String ALREADY_EXISTS = "already_exists"; + + /** permission_denied. */ + public static final String PERMISSION_DENIED = "permission_denied"; + + /** resource_exhausted. */ + public static final String RESOURCE_EXHAUSTED = "resource_exhausted"; + + /** failed_precondition. */ + public static final String FAILED_PRECONDITION = "failed_precondition"; + + /** aborted. */ + public static final String ABORTED = "aborted"; + + /** out_of_range. */ + public static final String OUT_OF_RANGE = "out_of_range"; + + /** unimplemented. */ + public static final String UNIMPLEMENTED = "unimplemented"; + + /** internal. */ + public static final String INTERNAL = "internal"; + + /** unavailable. */ + public static final String UNAVAILABLE = "unavailable"; + + /** data_loss. */ + public static final String DATA_LOSS = "data_loss"; + + /** unauthenticated. */ + public static final String UNAUTHENTICATED = "unauthenticated"; + + private RpcConnectRpcErrorCodeIncubatingValues() { + } + } + + /** Values for {@link #RPC_GRPC_STATUS_CODE}. */ + public static final class RpcGrpcStatusCodeIncubatingValues { + /** OK */ + public static final long OK = 0; + + /** CANCELLED */ + public static final long CANCELLED = 1; + + /** UNKNOWN */ + public static final long UNKNOWN = 2; + + /** INVALID_ARGUMENT */ + public static final long INVALID_ARGUMENT = 3; + + /** DEADLINE_EXCEEDED */ + public static final long DEADLINE_EXCEEDED = 4; + + /** NOT_FOUND */ + public static final long NOT_FOUND = 5; + + /** ALREADY_EXISTS */ + public static final long ALREADY_EXISTS = 6; + + /** PERMISSION_DENIED */ + public static final long PERMISSION_DENIED = 7; + + /** RESOURCE_EXHAUSTED */ + public static final long RESOURCE_EXHAUSTED = 8; + + /** FAILED_PRECONDITION */ + public static final long FAILED_PRECONDITION = 9; + + /** ABORTED */ + public static final long ABORTED = 10; + + /** OUT_OF_RANGE */ + public static final long OUT_OF_RANGE = 11; + + /** UNIMPLEMENTED */ + public static final long UNIMPLEMENTED = 12; + + /** INTERNAL */ + public static final long INTERNAL = 13; + + /** UNAVAILABLE */ + public static final long UNAVAILABLE = 14; + + /** DATA_LOSS */ + public static final long DATA_LOSS = 15; + + /** UNAUTHENTICATED */ + public static final long UNAUTHENTICATED = 16; + + private RpcGrpcStatusCodeIncubatingValues() { + } + } + + /** Values for {@link #RPC_MESSAGE_TYPE}. */ + public static final class RpcMessageTypeIncubatingValues { + /** sent. */ + public static final String SENT = "SENT"; + + /** received. */ + public static final String RECEIVED = "RECEIVED"; + + private RpcMessageTypeIncubatingValues() { + } + } + + /** Values for {@link #RPC_SYSTEM}. */ + public static final class RpcSystemIncubatingValues { + /** gRPC */ + public static final String GRPC = "grpc"; + + /** Java RMI */ + public static final String JAVA_RMI = "java_rmi"; + + /** .NET WCF */ + public static final String DOTNET_WCF = "dotnet_wcf"; + + /** Apache Dubbo */ + public static final String APACHE_DUBBO = "apache_dubbo"; + + /** Connect RPC */ + public static final String CONNECT_RPC = "connect_rpc"; + + private RpcSystemIncubatingValues() { + } + } + + private RpcIncubatingAttributes() { + } +} diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/ThreadIncubatingAttributes.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/ThreadIncubatingAttributes.java new file mode 100644 index 000000000000..6ff5d1ecb6d2 --- /dev/null +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/ThreadIncubatingAttributes.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating; + +import static io.opentelemetry.api.common.AttributeKey.longKey; +import static io.opentelemetry.api.common.AttributeKey.stringKey; + +import io.opentelemetry.api.common.AttributeKey; + +// this is a copy of io.opentelemetry.semconv.incubating.ThreadIncubatingAttributes (1.37.0) + +// DO NOT EDIT, this is an Auto-generated file from +// buildscripts/templates/registry/incubating_java/IncubatingSemanticAttributes.java.j2 +@SuppressWarnings("unused") +public final class ThreadIncubatingAttributes { + /** Current "managed" thread ID (as opposed to OS thread ID). */ + public static final AttributeKey THREAD_ID = longKey("thread.id"); + + /** Current thread name. */ + public static final AttributeKey THREAD_NAME = stringKey("thread.name"); + + // Enum definitions + + private ThreadIncubatingAttributes() { + } +} diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/UrlIncubatingAttributes.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/UrlIncubatingAttributes.java new file mode 100644 index 000000000000..6a650b98a2b8 --- /dev/null +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/UrlIncubatingAttributes.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating; + +import static io.opentelemetry.api.common.AttributeKey.stringKey; + +import io.opentelemetry.api.common.AttributeKey; + +// this is a copy of io.opentelemetry.semconv.incubating.UrlIncubatingAttributes (1.37.0) +// DO NOT EDIT, this is an Auto-generated file from +// buildscripts/templates/registry/incubating_java/IncubatingSemanticAttributes.java.j2 +@SuppressWarnings("unused") +public final class UrlIncubatingAttributes { + /** + * Domain extracted from the {@code url.full}, such as "opentelemetry.io". + * + *

Notes: + * + *

    + *
  • In some cases a URL may refer to an IP and/or port directly, without a domain name. In + * this case, the IP address would go to the domain field. If the URL contains a literal IPv6 address + * enclosed by {@code [} and {@code ]}, the {@code [} and {@code ]} characters should also + * be captured in the domain field. + *
+ */ + public static final AttributeKey URL_DOMAIN = stringKey("url.domain"); + + /** + * The file extension extracted from the {@code url.full}, excluding the leading dot. + * + *

Notes: + * + *

    + *
  • The file extension is only set if it exists, as not every url has a file extension. When + * the file name has multiple extensions {@code example.tar.gz}, only the last one should + * be captured {@code gz}, not {@code tar.gz}. + *
+ */ + public static final AttributeKey URL_EXTENSION = stringKey("url.extension"); + + /** + * Absolute URL describing a network resource according to RFC3986 + * + *

Notes: + * + *

    + *
  • For network calls, URL usually has {@code scheme://host[:port][path][?query][#fragment]} + * format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be + * included nevertheless. {@code url.full} MUST NOT contain credentials passed via URL in + * form of {@code https://username:password@www.example.com/}. In such case username and + * password SHOULD be redacted and attribute's value SHOULD be {@code + * https://REDACTED:REDACTED@www.example.com/}. {@code url.full} SHOULD capture the absolute + * URL when it is available (or can be reconstructed). Sensitive content provided in {@code + * url.full} SHOULD be scrubbed when instrumentations can identify it. + *
+ */ + public static final AttributeKey URL_FULL = stringKey("url.full"); + + /** + * The URI path component + * + *

Notes: + * + *

    + *
  • Sensitive content provided in {@code url.path} SHOULD be scrubbed when instrumentations + * can identify it. + *
+ */ + public static final AttributeKey URL_PATH = stringKey("url.path"); + + /** + * Port extracted from the {@code url.full} + * + *

Notes: + * + *

    + *
  • When the port is not specified in the URL, or if it's the default port for the URL's + * scheme, the value should be omitted. + *
+ */ + public static final AttributeKey URL_PORT = io.opentelemetry.api.common.AttributeKey.longKey("url.port"); + + /** + * The URI query component + * + *

Notes: + * + *

    + *
  • Sensitive content provided in {@code url.query} SHOULD be scrubbed when instrumentations + * can identify it. + *
+ */ + public static final AttributeKey URL_QUERY = stringKey("url.query"); + + /** + * The highest registered url domain, stripped of the subdomain. + * + *

Notes: + * + *

    + *
  • This value can be determined precisely with the public suffix list. For example, the registered domain + * for {@code foo.example.com} is {@code example.com}. Trying to approximate this by simply + * taking the last two labels will not work well for TLDs such as {@code co.uk}. + *
+ */ + public static final AttributeKey URL_REGISTERED_DOMAIN = stringKey("url.registered_domain"); + + /** + * The URI scheme component + * identifying the used protocol. + */ + public static final AttributeKey URL_SCHEME = stringKey("url.scheme"); + + /** + * The subdomain portion of a fully qualified domain name includes all of the names except the + * host name under the registered_domain. In a partially qualified domain, or if the + * qualification level of the full name cannot be determined, subdomain contains all of the names + * below the registered domain. + * + *

Notes: + * + *

    + *
  • The subdomain portion of {@code www.east.mydomain.com} is {@code east}. If the domain + * has multiple levels of subdomain, such as {@code sub2.sub1.example.com}, the subdomain + * field should contain {@code sub2.sub1}, with no trailing period. + *
+ */ + public static final AttributeKey URL_SUBDOMAIN = stringKey("url.subdomain"); + + /** + * The low-cardinality template of an absolute path reference. + * + *

Notes: + * + *

    + *
  • The {@code 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 that can + * provide it. The {@code url.template} SHOULD be as specific as possible and SHOULD NOT + * contain any parameter values. When using {@code url.template}, {@code url.path} SHOULD + * also be provided, but {@code url.template} is prioritized for cardinality reduction over + * {@code url.path}. + *
+ */ + public static final AttributeKey URL_TEMPLATE = stringKey("url.template"); + + /** + * The effective top level domain (eTLD), also known as the domain suffix, is the last part of + * the domain name. For example, the top level domain for example.com is {@code com}. + * + *

Notes: + * + *

+ */ + public static final AttributeKey URL_TOP_LEVEL_DOMAIN = stringKey("url.top_level_domain"); + + private UrlIncubatingAttributes() { + } +} diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/test/java/com/azure/monitor/opentelemetry/autoconfigure/AzureMonitorMetricExporterTest.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/test/java/com/azure/monitor/opentelemetry/autoconfigure/AzureMonitorMetricExporterTest.java index c2c2bad13d38..1081cc7dd118 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/test/java/com/azure/monitor/opentelemetry/autoconfigure/AzureMonitorMetricExporterTest.java +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/test/java/com/azure/monitor/opentelemetry/autoconfigure/AzureMonitorMetricExporterTest.java @@ -28,8 +28,8 @@ import java.util.Map; import java.util.stream.Collectors; -import static com.azure.monitor.opentelemetry.autoconfigure.implementation.SemanticAttributes.HTTP_RESPONSE_STATUS_CODE; -import static com.azure.monitor.opentelemetry.autoconfigure.implementation.SemanticAttributes.SERVER_ADDRESS; +import static com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.HttpAttributes.HTTP_RESPONSE_STATUS_CODE; +import static com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.ServerAttributes.SERVER_ADDRESS; import static io.opentelemetry.sdk.metrics.data.MetricDataType.DOUBLE_GAUGE; import static io.opentelemetry.sdk.metrics.data.MetricDataType.DOUBLE_SUM; import static io.opentelemetry.sdk.metrics.data.MetricDataType.HISTOGRAM; From fd10df4f02cfb61d4e51b28a63c65ee14e149bee Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Fri, 29 Aug 2025 11:23:40 -0700 Subject: [PATCH 2/9] consistent --- .../semconv/incubating/CodeIncubatingAttributes.java | 1 + .../semconv/incubating/DbIncubatingAttributes.java | 1 + .../semconv/incubating/HttpIncubatingAttributes.java | 1 + .../semconv/incubating/NetIncubatingAttributes.java | 1 + .../semconv/incubating/PeerIncubatingAttributes.java | 1 + .../semconv/incubating/UrlIncubatingAttributes.java | 1 + 6 files changed, 6 insertions(+) diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/CodeIncubatingAttributes.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/CodeIncubatingAttributes.java index 6269c4660c99..32a9568a0e3c 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/CodeIncubatingAttributes.java +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/CodeIncubatingAttributes.java @@ -14,6 +14,7 @@ import io.opentelemetry.api.common.AttributeKey; // this is a copy of io.opentelemetry.semconv.incubating.CodeIncubatingAttributes (1.37.0) + // DO NOT EDIT, this is an Auto-generated file from // buildscripts/templates/registry/incubating_java/IncubatingSemanticAttributes.java.j2 @SuppressWarnings("unused") diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/DbIncubatingAttributes.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/DbIncubatingAttributes.java index 2fa2f59e20a1..17be0ad524e0 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/DbIncubatingAttributes.java +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/DbIncubatingAttributes.java @@ -19,6 +19,7 @@ import java.util.List; // this is a copy of io.opentelemetry.semconv.incubating.DbIncubatingAttributes (1.37.0) + // DO NOT EDIT, this is an Auto-generated file from // buildscripts/templates/registry/incubating_java/IncubatingSemanticAttributes.java.j2 @SuppressWarnings("unused") diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/HttpIncubatingAttributes.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/HttpIncubatingAttributes.java index 1e5a302837be..7e48adc3098f 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/HttpIncubatingAttributes.java +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/HttpIncubatingAttributes.java @@ -16,6 +16,7 @@ import java.util.List; // this is a copy of io.opentelemetry.semconv.incubating.HttpIncubatingAttributes (1.37.0) + // DO NOT EDIT, this is an Auto-generated file from // buildscripts/templates/registry/incubating_java/IncubatingSemanticAttributes.java.j2 @SuppressWarnings("unused") diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/NetIncubatingAttributes.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/NetIncubatingAttributes.java index d7cf9c46a11c..2c89125d1986 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/NetIncubatingAttributes.java +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/NetIncubatingAttributes.java @@ -14,6 +14,7 @@ import io.opentelemetry.api.common.AttributeKey; // this is a copy of io.opentelemetry.semconv.incubating.NetIncubatingAttributes (1.37.0) + // DO NOT EDIT, this is an Auto-generated file from // buildscripts/templates/registry/incubating_java/IncubatingSemanticAttributes.java.j2 @SuppressWarnings("unused") diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/PeerIncubatingAttributes.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/PeerIncubatingAttributes.java index 286770e5bac5..970fde70767e 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/PeerIncubatingAttributes.java +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/PeerIncubatingAttributes.java @@ -13,6 +13,7 @@ import io.opentelemetry.api.common.AttributeKey; // this is a copy of io.opentelemetry.semconv.incubating.PeerIncubatingAttributes (1.37.0) + // DO NOT EDIT, this is an Auto-generated file from // buildscripts/templates/registry/incubating_java/IncubatingSemanticAttributes.java.j2 @SuppressWarnings("unused") diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/UrlIncubatingAttributes.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/UrlIncubatingAttributes.java index 6a650b98a2b8..01cda27f2369 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/UrlIncubatingAttributes.java +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/UrlIncubatingAttributes.java @@ -13,6 +13,7 @@ import io.opentelemetry.api.common.AttributeKey; // this is a copy of io.opentelemetry.semconv.incubating.UrlIncubatingAttributes (1.37.0) + // DO NOT EDIT, this is an Auto-generated file from // buildscripts/templates/registry/incubating_java/IncubatingSemanticAttributes.java.j2 @SuppressWarnings("unused") From c78b7d7ec45b11b20dcf5371237e79ac79a377fd Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Fri, 29 Aug 2025 11:24:50 -0700 Subject: [PATCH 3/9] fix --- .../autoconfigure/implementation/MetricDataMapper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/MetricDataMapper.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/MetricDataMapper.java index e02b69374e1d..6787c866afa7 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/MetricDataMapper.java +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/MetricDataMapper.java @@ -196,7 +196,7 @@ public static void updateMetricPointBuilder(MetricTelemetryBuilder metricTelemet if (metricData.getName().startsWith("http")) { dependencyType = "Http"; defaultPort = getDefaultPortForHttpScheme(SpanDataMapper.getStableOrOldAttribute(attributes, - UrlAttributes.URL_SCHEME, UrlIncubatingAttributes.URL_SCHEME)); + UrlAttributes.URL_SCHEME, HttpIncubatingAttributes.HTTP_SCHEME)); } else { dependencyType = attributes.get(RpcIncubatingAttributes.RPC_SYSTEM); if (dependencyType == null) { From 05105d7bec8d3de0080b2b4aac91721149b6c455 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Fri, 29 Aug 2025 11:26:13 -0700 Subject: [PATCH 4/9] fix --- .../autoconfigure/implementation/SpanDataMapper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/SpanDataMapper.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/SpanDataMapper.java index 98973dcfe7bf..eb57414c183b 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/SpanDataMapper.java +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/SpanDataMapper.java @@ -202,7 +202,7 @@ private static String getDependencyName(SpanData span) { } String url - = getStableOrOldAttribute(span.getAttributes(), UrlAttributes.URL_FULL, UrlIncubatingAttributes.URL_FULL); + = getStableOrOldAttribute(span.getAttributes(), UrlAttributes.URL_FULL, HttpIncubatingAttributes.HTTP_URL); if (url == null) { return name; } From 8645ba5faee44d95d0d131ff7e7b9ed16cbc9f44 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Fri, 29 Aug 2025 13:04:09 -0700 Subject: [PATCH 5/9] fix --- .../autoconfigure/implementation/MetricDataMapper.java | 1 - .../autoconfigure/implementation/SpanDataMapper.java | 1 - 2 files changed, 2 deletions(-) diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/MetricDataMapper.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/MetricDataMapper.java index 6787c866afa7..3773e88b8bdf 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/MetricDataMapper.java +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/MetricDataMapper.java @@ -16,7 +16,6 @@ import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating.RpcIncubatingAttributes; import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.UrlAttributes; import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating.HttpIncubatingAttributes; -import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating.UrlIncubatingAttributes; import com.azure.monitor.opentelemetry.autoconfigure.implementation.utils.FormattedTime; import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.common.Attributes; diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/SpanDataMapper.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/SpanDataMapper.java index eb57414c183b..beebd90ddb10 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/SpanDataMapper.java +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/SpanDataMapper.java @@ -26,7 +26,6 @@ import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating.HttpIncubatingAttributes; import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating.NetIncubatingAttributes; import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating.PeerIncubatingAttributes; -import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating.UrlIncubatingAttributes; import com.azure.monitor.opentelemetry.autoconfigure.implementation.utils.FormattedDuration; import com.azure.monitor.opentelemetry.autoconfigure.implementation.utils.FormattedTime; import com.azure.monitor.opentelemetry.autoconfigure.implementation.utils.UrlParser; From a4cc019c6a239f6b01f8416ec51ea5f86c67ee71 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Fri, 29 Aug 2025 18:23:47 -0700 Subject: [PATCH 6/9] Fix merge conflict --- .../implementation/SpanDataMapper.java | 3 +- .../SessionIncubatingAttributes.java | 30 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/SessionIncubatingAttributes.java diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/SpanDataMapper.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/SpanDataMapper.java index beebd90ddb10..0d3def81aab9 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/SpanDataMapper.java +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/SpanDataMapper.java @@ -19,6 +19,7 @@ import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.HttpAttributes; import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating.MessagingIncubatingAttributes; import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating.RpcIncubatingAttributes; +import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating.SessionIncubatingAttributes; import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.ServerAttributes; import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.UserAgentAttributes; import com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.UrlAttributes; @@ -909,7 +910,7 @@ static void applyCommonTags(MappingsBuilder mappingsBuilder) { if (value instanceof String) { telemetryBuilder.addTag(ContextTagKeys.AI_USER_ID.toString(), (String) value); } - }).exact(SemanticAttributes.SESSION_ID.getKey(), (telemetryBuilder, value) -> { + }).exact(SessionIncubatingAttributes.SESSION_ID.getKey(), (telemetryBuilder, value) -> { if (value instanceof String) { telemetryBuilder.addTag(ContextTagKeys.AI_SESSION_ID.toString(), (String) value); } diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/SessionIncubatingAttributes.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/SessionIncubatingAttributes.java new file mode 100644 index 000000000000..9c3744eb41b7 --- /dev/null +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/SessionIncubatingAttributes.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.semconv.incubating; + +import static io.opentelemetry.api.common.AttributeKey.stringKey; + +import io.opentelemetry.api.common.AttributeKey; + +// this is a copy of io.opentelemetry.semconv.incubating.SessionIncubatingAttributes (1.37.0) + +// DO NOT EDIT, this is an Auto-generated file from +// buildscripts/templates/registry/incubating_java/IncubatingSemanticAttributes.java.j2 +@SuppressWarnings("unused") +public final class SessionIncubatingAttributes { + /** A unique id to identify a session. */ + public static final AttributeKey SESSION_ID = stringKey("session.id"); + + /** The previous {@code session.id} for this user, when known. */ + public static final AttributeKey SESSION_PREVIOUS_ID = stringKey("session.previous_id"); + + // Enum definitions + + private SessionIncubatingAttributes() {} +} From 6b25c145eb800843c3e436c79c5728fa5a5edce5 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Fri, 5 Sep 2025 15:50:08 -0700 Subject: [PATCH 7/9] fix --- .../incubating/SessionIncubatingAttributes.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/SessionIncubatingAttributes.java b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/SessionIncubatingAttributes.java index 9c3744eb41b7..19640e373190 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/SessionIncubatingAttributes.java +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/semconv/incubating/SessionIncubatingAttributes.java @@ -6,7 +6,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -package io.opentelemetry.semconv.incubating; +package com.azure.monitor.opentelemetry.autoconfigure.implementation.semconv.incubating; import static io.opentelemetry.api.common.AttributeKey.stringKey; @@ -18,13 +18,14 @@ // buildscripts/templates/registry/incubating_java/IncubatingSemanticAttributes.java.j2 @SuppressWarnings("unused") public final class SessionIncubatingAttributes { - /** A unique id to identify a session. */ - public static final AttributeKey SESSION_ID = stringKey("session.id"); + /** A unique id to identify a session. */ + public static final AttributeKey SESSION_ID = stringKey("session.id"); - /** The previous {@code session.id} for this user, when known. */ - public static final AttributeKey SESSION_PREVIOUS_ID = stringKey("session.previous_id"); + /** The previous {@code session.id} for this user, when known. */ + public static final AttributeKey SESSION_PREVIOUS_ID = stringKey("session.previous_id"); - // Enum definitions + // Enum definitions - private SessionIncubatingAttributes() {} + private SessionIncubatingAttributes() { + } } From 21596130e50836733a78afb436a71435635bfa94 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Sat, 6 Sep 2025 10:49:41 -0700 Subject: [PATCH 8/9] fix --- .../checkstyle-suppressions.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/checkstyle-suppressions.xml b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/checkstyle-suppressions.xml index d93343c325dd..d820bc1c4458 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/checkstyle-suppressions.xml +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/checkstyle-suppressions.xml @@ -113,6 +113,7 @@ + From 41f2ee0947c7d71ca2b1c53f5aed83813fb92dff Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Sat, 6 Sep 2025 10:52:22 -0700 Subject: [PATCH 9/9] regenerate --- .../checkstyle-suppressions.xml | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/checkstyle-suppressions.xml b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/checkstyle-suppressions.xml index d820bc1c4458..d54e74099812 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/checkstyle-suppressions.xml +++ b/sdk/monitor/azure-monitor-opentelemetry-autoconfigure/checkstyle-suppressions.xml @@ -93,8 +93,20 @@ - + + + + + + + + + + + + + @@ -116,19 +128,6 @@ - - - - - - - - - - - - -