Add FaaS attributes. (#1634)

* Add FaaS attributes.

* Move to javadoc
This commit is contained in:
Anuraag Agrawal 2020-09-12 02:55:07 +09:00 committed by GitHub
parent cb73ccc4e7
commit 751177f6f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 57 additions and 0 deletions

View File

@ -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() {}
}

View File

@ -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() {}
}