diff --git a/api/src/main/java/io/opentelemetry/trace/attributes/SemanticAttributes.java b/api/src/main/java/io/opentelemetry/trace/attributes/SemanticAttributes.java index 78b54661e3..737e8c6c59 100644 --- a/api/src/main/java/io/opentelemetry/trace/attributes/SemanticAttributes.java +++ b/api/src/main/java/io/opentelemetry/trace/attributes/SemanticAttributes.java @@ -291,5 +291,51 @@ public final class SemanticAttributes { public static final StringAttributeSetter THREAD_NAME = StringAttributeSetter.create("thread.name"); + /** Type of the trigger on which the function is executed. */ + public static final StringAttributeSetter FAAS_TRIGGER = + StringAttributeSetter.create("faas.trigger"); + /** String containing the execution id of the function. */ + public static final StringAttributeSetter FAAS_EXECUTION = + StringAttributeSetter.create("faas.execution"); + /** Indicates that the serverless function is executed for the first time (aka cold start). */ + public static final BooleanAttributeSetter FAAS_COLDSTART = + BooleanAttributeSetter.create("faas.coldstart"); + /** The name of the invoked function. */ + public static final StringAttributeSetter FAAS_INVOKED_NAME = + StringAttributeSetter.create("faas.invoked_name"); + /** The cloud provider of the invoked function. */ + public static final StringAttributeSetter FAAS_INVOKED_PROVIDER = + StringAttributeSetter.create("faas.invoked_provider"); + /** The cloud region of the invoked function. */ + public static final StringAttributeSetter FAAS_INVOKED_REGION = + StringAttributeSetter.create("faas.invoked_region"); + + /** For faas.trigger == datasource, the name of the source on which the operation was perfomed. */ + public static final StringAttributeSetter FAAS_DOCUMENT_COLLECTION = + StringAttributeSetter.create("faas.document.collection"); + /** + * For faas.trigger == datasource, describes the type of the operation that was performed on the + * data. + */ + public static final StringAttributeSetter FAAS_DOCUMENT_OPERATION = + StringAttributeSetter.create("faas.document.operation"); + /** + * For faas.trigger == datasource, a string containing the time when the data was accessed in the + * ISO 8601 format expressed in UTC. + */ + public static final StringAttributeSetter FAAS_DOCUMENT_TIME = + StringAttributeSetter.create("faas.document.time"); + /** For faas.trigger == datasource, the document name/table subjected to the operation. */ + public static final StringAttributeSetter FAAS_DOCUMENT_NAME = + StringAttributeSetter.create("faas.document.name"); + + /** + * For faas.trigger == time, a string containing the function invocation time in the ISO 8601 + * format expressed in UTC. + */ + public static final StringAttributeSetter FAAS_TIME = StringAttributeSetter.create("faas.time"); + /** For faas.trigger == time, a string containing the schedule period as Cron Expression. */ + public static final StringAttributeSetter FAAS_CRON = StringAttributeSetter.create("faas.cron"); + private SemanticAttributes() {} } diff --git a/sdk/common/src/main/java/io/opentelemetry/sdk/resources/ResourceAttributes.java b/sdk/common/src/main/java/io/opentelemetry/sdk/resources/ResourceAttributes.java index 1a882d0ef0..88baef2eb5 100644 --- a/sdk/common/src/main/java/io/opentelemetry/sdk/resources/ResourceAttributes.java +++ b/sdk/common/src/main/java/io/opentelemetry/sdk/resources/ResourceAttributes.java @@ -150,5 +150,16 @@ public final class ResourceAttributes { /** Zones are a sub set of the region connected through low-latency links. */ public static final StringAttributeSetter CLOUD_ZONE = StringAttributeSetter.create("cloud.zone"); + /** The name of the function being executed. */ + public static final StringAttributeSetter FAAS_NAME = StringAttributeSetter.create("faas.name"); + /** The unique ID of the function being executed. */ + public static final StringAttributeSetter FAAS_ID = StringAttributeSetter.create("faas.id"); + /** The version string of the function being executed. */ + public static final StringAttributeSetter FAAS_VERSION = + StringAttributeSetter.create("faas.version"); + /** The execution environment ID as a string. */ + public static final StringAttributeSetter FAAS_INSTANCE = + StringAttributeSetter.create("faas.instance"); + private ResourceAttributes() {} }