diff --git a/buildscripts/checkstyle-suppressions.xml b/buildscripts/checkstyle-suppressions.xml index 1d7dcbe314e..a579d8189e0 100644 --- a/buildscripts/checkstyle-suppressions.xml +++ b/buildscripts/checkstyle-suppressions.xml @@ -6,10 +6,4 @@ - - diff --git a/buildscripts/checkstyle.xml b/buildscripts/checkstyle.xml index b7f26f15876..753e17ff952 100644 --- a/buildscripts/checkstyle.xml +++ b/buildscripts/checkstyle.xml @@ -41,10 +41,6 @@ - - - - diff --git a/buildscripts/semantic-convention/generate.sh b/buildscripts/semantic-convention/generate.sh index 17703174670..2e05772f750 100755 --- a/buildscripts/semantic-convention/generate.sh +++ b/buildscripts/semantic-convention/generate.sh @@ -4,7 +4,7 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" ROOT_DIR="${SCRIPT_DIR}/../../" # freeze the spec & generator tools versions to make SemanticAttributes generation reproducible -SEMCONV_VERSION=1.4.0 +SEMCONV_VERSION=1.5.0 SPEC_VERSION=v$SEMCONV_VERSION SCHEMA_URL=https://opentelemetry.io/schemas/$SEMCONV_VERSION GENERATOR_VERSION=0.3.1 diff --git a/semconv/src/main/java/io/opentelemetry/semconv/resource/attributes/ResourceAttributes.java b/semconv/src/main/java/io/opentelemetry/semconv/resource/attributes/ResourceAttributes.java index 74133d002f2..8400342996e 100644 --- a/semconv/src/main/java/io/opentelemetry/semconv/resource/attributes/ResourceAttributes.java +++ b/semconv/src/main/java/io/opentelemetry/semconv/resource/attributes/ResourceAttributes.java @@ -16,7 +16,7 @@ // buildscripts/semantic-convention/templates/SemanticAttributes.java.j2 public final class ResourceAttributes { /** The URL of the OpenTelemetry schema for these keys and values. */ - public static final String SCHEMA_URL = "https://opentelemetry.io/schemas/1.4.0"; + public static final String SCHEMA_URL = "https://opentelemetry.io/schemas/1.5.0"; /** Name of the cloud provider. */ public static final AttributeKey CLOUD_PROVIDER = stringKey("cloud.provider"); @@ -177,27 +177,59 @@ public final class ResourceAttributes { */ public static final AttributeKey DEVICE_MODEL_NAME = stringKey("device.model.name"); - /** The name of the function being executed. */ + /** + * The name of the single function that this runtime instance executes. + * + *

Note: This is the name of the function as configured/deployed on the FaaS platform and is + * usually different from the name of the callback function (which may be stored in the + * [`code.namespace`/`code.function`](../../trace/semantic_conventions/span-general.md#source-code-attributes) + * span attributes). + */ public static final AttributeKey FAAS_NAME = stringKey("faas.name"); /** - * The unique ID of the function being executed. + * The unique ID of the single function that this runtime instance executes. * - *

Note: For example, in AWS Lambda this field corresponds to the - * [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) value, in GCP - * to the URI of the resource, and in Azure to the - * [FunctionDirectory](https://github.com/Azure/azure-functions-host/wiki/Retrieving-information-about-the-currently-running-function) - * field. + *

Note: Depending on the cloud provider, use: + * + *

**AWS Lambda:** The function + * [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). Take care + * not to use the "invoked ARN" directly but replace any [alias + * suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) with the + * resolved function version, as the same runtime instance may be invokable with multiple + * different aliases. **GCP:** The [URI of the + * resource](https://cloud.google.com/iam/docs/full-resource-names) **Azure:** The [Fully + * Qualified Resource + * ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id). + * + *

On some providers, it may not be possible to determine the full ID at startup, which is why + * this field cannot be made required. For example, on AWS the account ID part of the ARN is not + * available without calling another AWS API which may be deemed too slow for a short-running + * lambda function. As an alternative, consider setting `faas.id` as a span attribute instead. */ public static final AttributeKey FAAS_ID = stringKey("faas.id"); /** - * The version string of the function being executed as defined in [Version - * Attributes](../../resource/semantic_conventions/README.md#version-attributes). + * The immutable version of the function being executed. + * + *

Note: Depending on the cloud provider and platform, use: + * + *

**AWS Lambda:** The [function + * version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) (an integer + * represented as a decimal string). **Google Cloud Run:** The + * [revision](https://cloud.google.com/run/docs/managing/revisions) (i.e., the function name plus + * the revision suffix). **Google Cloud Functions:** The value of the [`K_REVISION` environment + * variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically). + * **Azure Functions:** Not applicable. Do not set this attribute. */ public static final AttributeKey FAAS_VERSION = stringKey("faas.version"); - /** The execution environment ID as a string. */ + /** + * The execution environment ID as a string, that will be potentially reused for other invocations + * to the same function/function version. + * + *

Note: * **AWS Lambda:** Use the (full) log stream name. + */ public static final AttributeKey FAAS_INSTANCE = stringKey("faas.instance"); /** diff --git a/semconv/src/main/java/io/opentelemetry/semconv/trace/attributes/SemanticAttributes.java b/semconv/src/main/java/io/opentelemetry/semconv/trace/attributes/SemanticAttributes.java index fef5cf5bb70..cb61ca55ea3 100644 --- a/semconv/src/main/java/io/opentelemetry/semconv/trace/attributes/SemanticAttributes.java +++ b/semconv/src/main/java/io/opentelemetry/semconv/trace/attributes/SemanticAttributes.java @@ -18,7 +18,16 @@ // buildscripts/semantic-convention/templates/SemanticAttributes.java.j2 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.4.0"; + public static final String SCHEMA_URL = "https://opentelemetry.io/schemas/1.5.0"; + + /** + * The full invoked ARN as provided on the `Context` passed to the function + * (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable). + * + *

Note: This may be different from `faas.id` if an alias is involved. + */ + public static final AttributeKey AWS_LAMBDA_INVOKED_ARN = + stringKey("aws.lambda.invoked_arn"); /** * An identifier for the database management system (DBMS) product being used. See below for a @@ -628,10 +637,26 @@ public final class SemanticAttributes { /** A string identifying the remoting system. */ public static final AttributeKey RPC_SYSTEM = stringKey("rpc.system"); - /** The full name of the service being called, including its package name, if applicable. */ + /** + * The full (logical) name of the service being called, including its package name, if applicable. + * + *

Note: This is the logical name of the service from the RPC interface perspective, which can + * be different from the name of any implementing class. The `code.namespace` attribute may be + * used to store the latter (despite the attribute name, it may include a class name; e.g., class + * with method actually executing the call on the server side, RPC client stub class on the client + * side). + */ public static final AttributeKey RPC_SERVICE = stringKey("rpc.service"); - /** The name of the method being called, must be equal to the $method part in the span name. */ + /** + * The name of the (logical) method being called, must be equal to the $method part in the span + * name. + * + *

Note: 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.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"); /** @@ -646,13 +671,6 @@ public final class SemanticAttributes { */ public static final AttributeKey RPC_JSONRPC_VERSION = stringKey("rpc.jsonrpc.version"); - /** - * `method` property from request. Unlike `rpc.method`, this may not relate to the actual method - * being called. Useful for client-side traces since client does not know what will be called on - * the server. - */ - public static final AttributeKey RPC_JSONRPC_METHOD = stringKey("rpc.jsonrpc.method"); - /** * `id` property of request or response. Since protocol allows id to be int, string, `null` or * missing (for notifications), value is expected to be cast to string for simplicity. Use empty