Skip to content

Commit

Permalink
Update the semconv constants to v1.5.0 (#3381)
Browse files Browse the repository at this point in the history
* Update the semconv constants to v1.5.0
Also, tweak our checkstyle settings to allow long markdown-style links.

* remove linelength checkstyle checks, since spotless already formats for us
  • Loading branch information
jkwatson authored Jul 9, 2021
1 parent f83b780 commit 57bd952
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 32 deletions.
6 changes: 0 additions & 6 deletions buildscripts/checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,4 @@
<suppressions>
<!-- Suppress Javadoc-related checks in non-public code. -->
<suppress checks="JavadocParagraph|JavadocMethod" files="[\\/](jmh|test)[\\/]" />
<!--
package-info.java will generally have very long @link or <a> tags, encourage good documentation
by not being strict about this check. Spotless will still ensure it's as compact as possible in
most cases.
-->
<suppress checks="LineLength" files="package-info.java" />
</suppressions>
4 changes: 0 additions & 4 deletions buildscripts/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@
<property name="allowByTailComment" value="true"/>
<property name="allowNonPrintableEscapes" value="true"/>
</module>
<module name="LineLength">
<property name="max" value="100"/>
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
</module>
<module name="AvoidStarImport"/>
<module name="RedundantImport"/>
<module name="OneTopLevelClass"/>
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/semantic-convention/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> CLOUD_PROVIDER = stringKey("cloud.provider");
Expand Down Expand Up @@ -177,27 +177,59 @@ public final class ResourceAttributes {
*/
public static final AttributeKey<String> 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.
*
* <p>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<String> 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.
*
* <p>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.
* <p>Note: Depending on the cloud provider, use:
*
* <p>**AWS Lambda:** The function
* [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). Take care
* not to use the &#34;invoked ARN&#34; 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).
*
* <p>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<String> 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.
*
* <p>Note: Depending on the cloud provider and platform, use:
*
* <p>**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<String> 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.
*
* <p>Note: * **AWS Lambda:** Use the (full) log stream name.
*/
public static final AttributeKey<String> FAAS_INSTANCE = stringKey("faas.instance");

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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).
*
* <p>Note: This may be different from `faas.id` if an alias is involved.
*/
public static final AttributeKey<String> AWS_LAMBDA_INVOKED_ARN =
stringKey("aws.lambda.invoked_arn");

/**
* An identifier for the database management system (DBMS) product being used. See below for a
Expand Down Expand Up @@ -628,10 +637,26 @@ public final class SemanticAttributes {
/** A string identifying the remoting system. */
public static final AttributeKey<String> 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.
*
* <p>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<String> 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.
*
* <p>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<String> RPC_METHOD = stringKey("rpc.method");

/**
Expand All @@ -646,13 +671,6 @@ public final class SemanticAttributes {
*/
public static final AttributeKey<String> 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<String> 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
Expand Down

0 comments on commit 57bd952

Please sign in to comment.