Skip to content

Commit f7cdc41

Browse files
ahayworthfbogsany
andauthored
feat!: Update opentelemetry-semantic_conventions to the 1.5.0 spec release (#873)
This is a small update. Other than updating the documentation, the spec release: - Adds the `aws.lambda.invoked_arn` attribute (`OpenTelemetry::SemanticConventions::Trace::AWS_LAMBDA_INVOKED_ARN`) - Removes the `rpc.jsonrpc.method` attribute (`OpenTelemetry::SemanticConventions::Trace::RPC_JSONRPC_METHOD`) These do not seem in-use in our repo. Co-authored-by: Francis Bogsanyi <[email protected]>
1 parent d08bd6f commit f7cdc41

File tree

4 files changed

+37
-10
lines changed

4 files changed

+37
-10
lines changed

semantic_conventions/Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require 'yard'
1010
require 'rubocop/rake_task'
1111
require 'tmpdir'
1212

13-
SPEC_VERSION = '1.4.0'
13+
SPEC_VERSION = '1.5.0'
1414

1515
RuboCop::RakeTask.new
1616

semantic_conventions/lib/opentelemetry/semantic_conventions/resource.rb

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,41 @@ module Resource
9090
# @note It's recommended this value represents a human readable version of the device model rather than a machine readable alternative
9191
DEVICE_MODEL_NAME = 'device.model.name'
9292

93-
# The name of the function being executed
93+
# The name of the single function that this runtime instance executes
94+
# @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)
9495
FAAS_NAME = 'faas.name'
9596

96-
# The unique ID of the function being executed
97-
# @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
97+
# The unique ID of the single function that this runtime instance executes
98+
# @note Depending on the cloud provider, use:
99+
#
100+
# * **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).
101+
# Take care not to use the "invoked ARN" directly but replace any
102+
# [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
103+
# different aliases.
104+
# * **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names)
105+
# * **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id).
106+
#
107+
# On some providers, it may not be possible to determine the full ID at startup,
108+
# which is why this field cannot be made required. For example, on AWS the account ID
109+
# part of the ARN is not available without calling another AWS API
110+
# which may be deemed too slow for a short-running lambda function.
111+
# As an alternative, consider setting `faas.id` as a span attribute instead
98112
FAAS_ID = 'faas.id'
99113

100-
# The version string of the function being executed as defined in [Version Attributes](../../resource/semantic_conventions/README.md#version-attributes)
114+
# The immutable version of the function being executed
115+
# @note Depending on the cloud provider and platform, use:
116+
#
117+
# * **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html)
118+
# (an integer represented as a decimal string).
119+
# * **Google Cloud Run:** The [revision](https://cloud.google.com/run/docs/managing/revisions)
120+
# (i.e., the function name plus the revision suffix).
121+
# * **Google Cloud Functions:** The value of the
122+
# [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically).
123+
# * **Azure Functions:** Not applicable. Do not set this attribute
101124
FAAS_VERSION = 'faas.version'
102125

103-
# The execution environment ID as a string
126+
# The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version
127+
# @note * **AWS Lambda:** Use the (full) log stream name
104128
FAAS_INSTANCE = 'faas.instance'
105129

106130
# The amount of memory available to the serverless function in MiB

semantic_conventions/lib/opentelemetry/semantic_conventions/trace.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
module OpenTelemetry
88
module SemanticConventions
99
module Trace
10+
# 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)
11+
# @note This may be different from `faas.id` if an alias is involved
12+
AWS_LAMBDA_INVOKED_ARN = 'aws.lambda.invoked_arn'
13+
1014
# An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers
1115
DB_SYSTEM = 'db.system'
1216

@@ -277,9 +281,11 @@ module Trace
277281
RPC_SYSTEM = 'rpc.system'
278282

279283
# The name of the service to which a request is made, as returned by the AWS SDK
284+
# @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)
280285
RPC_SERVICE = 'rpc.service'
281286

282287
# The name of the operation corresponding to the request, as returned by the AWS SDK
288+
# @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)
283289
RPC_METHOD = 'rpc.method'
284290

285291
# The keys in the `RequestItems` object field
@@ -376,9 +382,6 @@ module Trace
376382
# Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 does not specify this, the value can be omitted
377383
RPC_JSONRPC_VERSION = 'rpc.jsonrpc.version'
378384

379-
# `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
380-
RPC_JSONRPC_METHOD = 'rpc.jsonrpc.method'
381-
382385
# `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 string in case of `null` value. Omit entirely if this is a notification
383386
RPC_JSONRPC_REQUEST_ID = 'rpc.jsonrpc.request_id'
384387

semantic_conventions/lib/opentelemetry/semantic_conventions/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66

77
module OpenTelemetry
88
module SemanticConventions
9-
VERSION = '1.4.0'
9+
VERSION = '1.5.0'
1010
end
1111
end

0 commit comments

Comments
 (0)