From 30fb9fdd3b373d50777678ce58dbd0e7e9ef8214 Mon Sep 17 00:00:00 2001 From: Maksym Ochenashko Date: Wed, 16 Oct 2024 09:08:13 +0300 Subject: [PATCH] Generate semantic conventions --- .../registry/otel4s/attributes/weaver.yaml | 2 +- .../registry/otel4s/metrics-tests/weaver.yaml | 2 +- .../registry/otel4s/metrics/weaver.yaml | 2 +- .../AndroidExperimentalAttributes.scala | 3 + .../attributes/AzExperimentalAttributes.scala | 7 + .../CloudExperimentalAttributes.scala | 2 +- .../CloudfoundryExperimentalAttributes.scala | 124 ++++++ .../ContainerExperimentalAttributes.scala | 24 +- .../attributes/DbExperimentalAttributes.scala | 104 +++-- .../FileExperimentalAttributes.scala | 86 ++++ .../GenAiExperimentalAttributes.scala | 64 ++- .../HttpExperimentalAttributes.scala | 8 +- .../attributes/HwExperimentalAttributes.scala | 133 ++++++ .../K8sExperimentalAttributes.scala | 42 ++ .../LogExperimentalAttributes.scala | 2 +- .../MessagingExperimentalAttributes.scala | 20 +- .../NodejsExperimentalAttributes.scala | 43 ++ .../OtelExperimentalAttributes.scala | 10 +- .../ProcessExperimentalAttributes.scala | 36 ++ .../ProfileExperimentalAttributes.scala | 74 ++++ .../TlsExperimentalAttributes.scala | 2 +- .../ContainerExperimentalMetrics.scala | 52 ++- .../metrics/DbExperimentalMetrics.scala | 43 +- .../metrics/HwExperimentalMetrics.scala | 404 ++++++++++++++++++ .../metrics/K8sExperimentalMetrics.scala | 162 +++++++ .../MessagingExperimentalMetrics.scala | 180 +++++++- .../metrics/NodejsExperimentalMetrics.scala | 46 +- .../metrics/ProcessExperimentalMetrics.scala | 23 + .../metrics/SystemExperimentalMetrics.scala | 138 +++++- .../metrics/V8jsExperimentalMetrics.scala | 255 +++++++++++ .../typelevel/otel4s/semconv/SchemaUrls.scala | 3 +- 31 files changed, 1996 insertions(+), 100 deletions(-) create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/CloudfoundryExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/HwExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/NodejsExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/ProfileExperimentalAttributes.scala create mode 100644 semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/HwExperimentalMetrics.scala create mode 100644 semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/K8sExperimentalMetrics.scala create mode 100644 semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/V8jsExperimentalMetrics.scala diff --git a/buildscripts/semantic-convention/templates/registry/otel4s/attributes/weaver.yaml b/buildscripts/semantic-convention/templates/registry/otel4s/attributes/weaver.yaml index 7df2178b9..71282b632 100644 --- a/buildscripts/semantic-convention/templates/registry/otel4s/attributes/weaver.yaml +++ b/buildscripts/semantic-convention/templates/registry/otel4s/attributes/weaver.yaml @@ -1,5 +1,5 @@ params: - excluded_namespaces: ["ios", "aspnetcore", "signalr"] + excluded_namespaces: ["ios", "aspnetcore", "signalr", "dotnet"] excluded_stability: ["experimental", "deprecated"] # stable - ["experimental", "deprecated"]; experimental - [] excluded_attributes: ["messaging.client_id"] object_prefix: "" # stable - "", experimental - "Experimental" diff --git a/buildscripts/semantic-convention/templates/registry/otel4s/metrics-tests/weaver.yaml b/buildscripts/semantic-convention/templates/registry/otel4s/metrics-tests/weaver.yaml index fce538042..1e90ff52c 100644 --- a/buildscripts/semantic-convention/templates/registry/otel4s/metrics-tests/weaver.yaml +++ b/buildscripts/semantic-convention/templates/registry/otel4s/metrics-tests/weaver.yaml @@ -1,5 +1,5 @@ params: - excluded_namespaces: ["ios", "aspnetcore", "signalr", "kestrel", "veightjs", "go"] + excluded_namespaces: ["ios", "aspnetcore", "signalr", "kestrel", "veightjs", "go", "dotnet"] excluded_attributes: ["messaging.client_id"] excluded_stability: ["experimental", "deprecated"] # stable - ["experimental", "deprecated"]; experimental - [] object_prefix: "" # stable - "", experimental - "Experimental" diff --git a/buildscripts/semantic-convention/templates/registry/otel4s/metrics/weaver.yaml b/buildscripts/semantic-convention/templates/registry/otel4s/metrics/weaver.yaml index 7e6cbfbbf..4854e0138 100644 --- a/buildscripts/semantic-convention/templates/registry/otel4s/metrics/weaver.yaml +++ b/buildscripts/semantic-convention/templates/registry/otel4s/metrics/weaver.yaml @@ -1,5 +1,5 @@ params: - excluded_namespaces: ["ios", "aspnetcore", "signalr", "kestrel", "veightjs", "go"] + excluded_namespaces: ["ios", "aspnetcore", "signalr", "kestrel", "veightjs", "go", "dotnet"] excluded_attributes: ["messaging.client_id"] excluded_stability: ["experimental", "deprecated"] # stable - ["experimental", "deprecated"]; experimental - [] object_prefix: "" # stable - "", experimental - "Experimental" diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/AndroidExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/AndroidExperimentalAttributes.scala index 060017f2f..17b172a2d 100644 --- a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/AndroidExperimentalAttributes.scala +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/AndroidExperimentalAttributes.scala @@ -35,12 +35,15 @@ object AndroidExperimentalAttributes { * href="https://developer.android.com/guide/components/activities/activity-lifecycle#lc">Activity lifecycle * callbacks, and from which the `OS identifiers` are derived. */ + @deprecated("Replaced by `device.app.lifecycle`.", "") val AndroidState: AttributeKey[String] = AttributeKey("android.state") /** Values for [[AndroidState]]. */ + @deprecated("Replaced by `device.app.lifecycle`.", "") abstract class AndroidStateValue(val value: String) + @annotation.nowarn("cat=deprecation") object AndroidStateValue { /** Any time before Activity.onResume() or, if the app has no Activity, Context.startService() has been called in diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/AzExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/AzExperimentalAttributes.scala index 94d1773d3..bc4855db4 100644 --- a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/AzExperimentalAttributes.scala +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/AzExperimentalAttributes.scala @@ -21,6 +21,13 @@ package experimental.attributes // DO NOT EDIT, this is an Auto-generated file from buildscripts/templates/registry/otel4s/attributes/SemanticAttributes.scala.j2 object AzExperimentalAttributes { + /** Azure + * Resource Provider Namespace as recognized by the client. + */ + val AzNamespace: AttributeKey[String] = + AttributeKey("az.namespace") + /** The unique identifier of the service request. It's generated by the Azure service and returned with the response. */ val AzServiceRequestId: AttributeKey[String] = diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/CloudExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/CloudExperimentalAttributes.scala index 1edbd26b1..58c0c37a8 100644 --- a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/CloudExperimentalAttributes.scala +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/CloudExperimentalAttributes.scala @@ -76,7 +76,7 @@ object CloudExperimentalAttributes { * resource
  • Azure: The Fully Qualified Resource ID of the * invoked function, not the function app, having the form - * `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/`. + * `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/`. * This means that a span attribute MUST be used, as an Azure function app can host multiple functions that would * usually share a TracerProvider. */ diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/CloudfoundryExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/CloudfoundryExperimentalAttributes.scala new file mode 100644 index 000000000..eb7649c79 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/CloudfoundryExperimentalAttributes.scala @@ -0,0 +1,124 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s +package semconv +package experimental.attributes + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/templates/registry/otel4s/attributes/SemanticAttributes.scala.j2 +object CloudfoundryExperimentalAttributes { + + /** The guid of the application.

    + * @note + *

    Application instrumentation should use the value from environment variable + * `VCAP_APPLICATION.application_id`. This is the same value as reported by `cf app --guid`. + */ + val CloudfoundryAppId: AttributeKey[String] = + AttributeKey("cloudfoundry.app.id") + + /** The index of the application instance. 0 when just one instance is active.

    + * @note + *

    CloudFoundry defines the `instance_id` in the Loggegator v2 envelope. It is used for + * logs and metrics emitted by CloudFoundry. It is supposed to contain the application instance index for + * applications deployed on the runtime.

    Application instrumentation should use the value from environment + * variable `CF_INSTANCE_INDEX`. + */ + val CloudfoundryAppInstanceId: AttributeKey[String] = + AttributeKey("cloudfoundry.app.instance.id") + + /** The name of the application.

    + * @note + *

    Application instrumentation should use the value from environment variable + * `VCAP_APPLICATION.application_name`. This is the same value as reported by `cf apps`. + */ + val CloudfoundryAppName: AttributeKey[String] = + AttributeKey("cloudfoundry.app.name") + + /** The guid of the CloudFoundry org the application is running in.

    + * @note + *

    Application instrumentation should use the value from environment variable `VCAP_APPLICATION.org_id`. This + * is the same value as reported by `cf org --guid`. + */ + val CloudfoundryOrgId: AttributeKey[String] = + AttributeKey("cloudfoundry.org.id") + + /** The name of the CloudFoundry organization the app is running in.

    + * @note + *

    Application instrumentation should use the value from environment variable `VCAP_APPLICATION.org_name`. This + * is the same value as reported by `cf orgs`. + */ + val CloudfoundryOrgName: AttributeKey[String] = + AttributeKey("cloudfoundry.org.name") + + /** The UID identifying the process.

    + * @note + *

    Application instrumentation should use the value from environment variable `VCAP_APPLICATION.process_id`. It + * is supposed to be equal to `VCAP_APPLICATION.app_id` for applications deployed to the runtime. For system + * components, this could be the actual PID. + */ + val CloudfoundryProcessId: AttributeKey[String] = + AttributeKey("cloudfoundry.process.id") + + /** The type of process.

    + * @note + *

    CloudFoundry applications can consist of multiple jobs. Usually the main process will be of type `web`. + * There can be additional background tasks or side-cars with different process types. + */ + val CloudfoundryProcessType: AttributeKey[String] = + AttributeKey("cloudfoundry.process.type") + + /** The guid of the CloudFoundry space the application is running in.

    + * @note + *

    Application instrumentation should use the value from environment variable `VCAP_APPLICATION.space_id`. This + * is the same value as reported by `cf space --guid`. + */ + val CloudfoundrySpaceId: AttributeKey[String] = + AttributeKey("cloudfoundry.space.id") + + /** The name of the CloudFoundry space the application is running in.

    + * @note + *

    Application instrumentation should use the value from environment variable `VCAP_APPLICATION.space_name`. + * This is the same value as reported by `cf spaces`. + */ + val CloudfoundrySpaceName: AttributeKey[String] = + AttributeKey("cloudfoundry.space.name") + + /** A guid or another name describing the event source.

    + * @note + *

    CloudFoundry defines the `source_id` in the Loggregator v2 envelope. It is used for + * logs and metrics emitted by CloudFoundry. It is supposed to contain the component name, e.g. "gorouter", for + * CloudFoundry components.

    When system components are instrumented, values from the Bosh spec should be used. The `system.id` should be set to + * `spec.deployment/spec.name`. + */ + val CloudfoundrySystemId: AttributeKey[String] = + AttributeKey("cloudfoundry.system.id") + + /** A guid describing the concrete instance of the event source.

    + * @note + *

    CloudFoundry defines the `instance_id` in the Loggregator v2 envelope. It is used for + * logs and metrics emitted by CloudFoundry. It is supposed to contain the vm id for CloudFoundry components.

    + * When system components are instrumented, values from the Bosh spec should be used. The `system.instance.id` should + * be set to `spec.id`. + */ + val CloudfoundrySystemInstanceId: AttributeKey[String] = + AttributeKey("cloudfoundry.system.instance.id") + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/ContainerExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/ContainerExperimentalAttributes.scala index f9d65f586..72ea9ef52 100644 --- a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/ContainerExperimentalAttributes.scala +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/ContainerExperimentalAttributes.scala @@ -29,12 +29,12 @@ object ContainerExperimentalAttributes { val ContainerCommand: AttributeKey[String] = AttributeKey("container.command") - /** All the command arguments (including the command/executable itself) run by the container. [2] + /** All the command arguments (including the command/executable itself) run by the container. */ val ContainerCommandArgs: AttributeKey[Seq[String]] = AttributeKey("container.command_args") - /** The full command run by the container as a single string representing the full command. [2] + /** The full command run by the container as a single string representing the full command. */ val ContainerCommandLine: AttributeKey[String] = AttributeKey("container.command_line") @@ -45,8 +45,26 @@ object ContainerExperimentalAttributes { val ContainerCpuState: AttributeKey[String] = AttributeKey("container.cpu.state") + /** The name of the CSI (Container Storage + * Interface) plugin used by the volume.

    + * @note + *

    This can sometimes be referred to as a "driver" in CSI implementations. This should represent the `name` + * field of the GetPluginInfo RPC. + */ + val ContainerCsiPluginName: AttributeKey[String] = + AttributeKey("container.csi.plugin.name") + + /** The unique volume ID returned by the CSI (Container + * Storage Interface) plugin.

    + * @note + *

    This can sometimes be referred to as a "volume handle" in CSI implementations. This should represent the + * `Volume.volume_id` field in CSI spec. + */ + val ContainerCsiVolumeId: AttributeKey[String] = + AttributeKey("container.csi.volume.id") + /** Container ID. Usually a UUID, as for example used to identify Docker containers. The + * href="https://docs.docker.com/engine/containers/run/#container-identification">identify Docker containers. The * UUID might be abbreviated. */ val ContainerId: AttributeKey[String] = diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/DbExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/DbExperimentalAttributes.scala index 5e569bbad..b509b0671 100644 --- a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/DbExperimentalAttributes.scala +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/DbExperimentalAttributes.scala @@ -91,14 +91,15 @@ object DbExperimentalAttributes { * normalization. If the collection name is parsed from the query text, it SHOULD be the first collection name * found in the query and it SHOULD match the value provided in the query text including any schema and database * name prefix. For batch operations, if the individual operations are known to have the same collection name then - * that collection name SHOULD be used, otherwise `db.collection.name` SHOULD NOT be captured. + * that collection name SHOULD be used, otherwise `db.collection.name` SHOULD NOT be captured. This attribute has + * stability level RELEASE CANDIDATE. */ val DbCollectionName: AttributeKey[String] = AttributeKey("db.collection.name") /** Deprecated, use `server.address`, `server.port` attributes instead. */ - @deprecated("'Replaced by `server.address` and `server.port`.'", "") + @deprecated("Replaced by `server.address` and `server.port`.", "") val DbConnectionString: AttributeKey[String] = AttributeKey("db.connection_string") @@ -118,7 +119,7 @@ object DbExperimentalAttributes { val DbCosmosdbContainer: AttributeKey[String] = AttributeKey("db.cosmosdb.container") - /** CosmosDB Operation Type. + /** Cosmos DB Operation Type. */ val DbCosmosdbOperationType: AttributeKey[String] = AttributeKey("db.cosmosdb.operation_type") @@ -133,8 +134,9 @@ object DbExperimentalAttributes { val DbCosmosdbRequestContentLength: AttributeKey[Long] = AttributeKey("db.cosmosdb.request_content_length") - /** Cosmos DB status code. + /** Deprecated, use `db.response.status_code` instead. */ + @deprecated("Replaced by `db.response.status_code`.", "") val DbCosmosdbStatusCode: AttributeKey[Long] = AttributeKey("db.cosmosdb.status_code") @@ -205,7 +207,8 @@ object DbExperimentalAttributes { * namespaces SHOULD NOT be captured without the more general namespaces, to ensure that "startswith" queries for * the more general namespaces will be valid. Semantic conventions for individual database systems SHOULD document * what `db.namespace` means in the context of that system. It is RECOMMENDED to capture the value as provided by - * the application without attempting to do any case normalization. + * the application without attempting to do any case normalization. This attribute has stability level RELEASE + * CANDIDATE. */ val DbNamespace: AttributeKey[String] = AttributeKey("db.namespace") @@ -216,11 +219,10 @@ object DbExperimentalAttributes { val DbOperation: AttributeKey[String] = AttributeKey("db.operation") - /** The number of queries included in a batch - * operation.

    + /** The number of queries included in a batch operation.

    * @note *

    Operations are only considered batches when they contain two or more operations, and so - * `db.operation.batch.size` SHOULD never be `1`. + * `db.operation.batch.size` SHOULD never be `1`. This attribute has stability level RELEASE CANDIDATE. */ val DbOperationBatchSize: AttributeKey[Long] = AttributeKey("db.operation.batch.size") @@ -231,7 +233,8 @@ object DbExperimentalAttributes { * normalization. If the operation name is parsed from the query text, it SHOULD be the first operation name found * in the query. For batch operations, if the individual operations are known to have the same operation name then * that operation name SHOULD be used prepended by `BATCH `, otherwise `db.operation.name` SHOULD be `BATCH` or - * some other database system specific term if more applicable. + * some other database system specific term if more applicable. This attribute has stability level RELEASE + * CANDIDATE. */ val DbOperationName: AttributeKey[String] = AttributeKey("db.operation.name") @@ -240,7 +243,8 @@ object DbExperimentalAttributes { * string representation of the parameter value.

    * @note *

    Query parameters should only be captured when `db.query.text` is parameterized with placeholders. If a - * parameter has no name and instead is referenced only by index, then `` SHOULD be the 0-based index. + * parameter has no name and instead is referenced only by index, then `` SHOULD be the 0-based index. This + * attribute has stability level RELEASE CANDIDATE. */ val DbQueryParameter: AttributeKey[String] = AttributeKey("db.query.parameter") @@ -254,7 +258,7 @@ object DbExperimentalAttributes { * other database system specific separator if more applicable. Even though parameterized query text can * potentially have sensitive data, by using a parameterized query the user is giving a strong signal that any * sensitive data will be passed as parameter values, and the benefit to observability of capturing the static part - * of the query text by default outweighs the risk. + * of the query text by default outweighs the risk. This attribute has stability level RELEASE CANDIDATE. */ val DbQueryText: AttributeKey[String] = AttributeKey("db.query.text") @@ -265,6 +269,16 @@ object DbExperimentalAttributes { val DbRedisDatabaseIndex: AttributeKey[Long] = AttributeKey("db.redis.database_index") + /** Database response status code.

    + * @note + *

    The status code returned by the database. Usually it represents an error code, but may also represent + * partial success, warning, or differentiate between various types of successful outcomes. Semantic conventions + * for individual database systems SHOULD document what `db.response.status_code` means in the context of that + * system. This attribute has stability level RELEASE CANDIDATE. + */ + val DbResponseStatusCode: AttributeKey[String] = + AttributeKey("db.response.status_code") + /** Deprecated, use `db.collection.name` instead. */ @deprecated("Replaced by `db.collection.name`.", "") @@ -281,7 +295,7 @@ object DbExperimentalAttributes { * @note *

    The actual DBMS may differ from the one identified by the client. For example, when using PostgreSQL client * libraries to connect to a CockroachDB, the `db.system` is set to `postgresql` based on the instrumentation's - * best knowledge. + * best knowledge. This attribute has stability level RELEASE CANDIDATE. */ val DbSystem: AttributeKey[String] = AttributeKey("db.system") @@ -391,65 +405,65 @@ object DbExperimentalAttributes { abstract class DbCosmosdbOperationTypeValue(val value: String) object DbCosmosdbOperationTypeValue { - /** invalid. + /** batch. */ - case object Invalid extends DbCosmosdbOperationTypeValue("Invalid") + case object Batch extends DbCosmosdbOperationTypeValue("batch") /** create. */ - case object Create extends DbCosmosdbOperationTypeValue("Create") + case object Create extends DbCosmosdbOperationTypeValue("create") - /** patch. + /** delete. */ - case object Patch extends DbCosmosdbOperationTypeValue("Patch") + case object Delete extends DbCosmosdbOperationTypeValue("delete") - /** read. + /** execute. */ - case object Read extends DbCosmosdbOperationTypeValue("Read") + case object Execute extends DbCosmosdbOperationTypeValue("execute") - /** read_feed. + /** execute_javascript. */ - case object ReadFeed extends DbCosmosdbOperationTypeValue("ReadFeed") + case object ExecuteJavascript extends DbCosmosdbOperationTypeValue("execute_javascript") - /** delete. + /** invalid. */ - case object Delete extends DbCosmosdbOperationTypeValue("Delete") + case object Invalid extends DbCosmosdbOperationTypeValue("invalid") - /** replace. + /** head. */ - case object Replace extends DbCosmosdbOperationTypeValue("Replace") + case object Head extends DbCosmosdbOperationTypeValue("head") - /** execute. + /** head_feed. */ - case object Execute extends DbCosmosdbOperationTypeValue("Execute") + case object HeadFeed extends DbCosmosdbOperationTypeValue("head_feed") - /** query. + /** patch. */ - case object Query extends DbCosmosdbOperationTypeValue("Query") + case object Patch extends DbCosmosdbOperationTypeValue("patch") - /** head. + /** query. */ - case object Head extends DbCosmosdbOperationTypeValue("Head") + case object Query extends DbCosmosdbOperationTypeValue("query") - /** head_feed. + /** query_plan. */ - case object HeadFeed extends DbCosmosdbOperationTypeValue("HeadFeed") + case object QueryPlan extends DbCosmosdbOperationTypeValue("query_plan") - /** upsert. + /** read. */ - case object Upsert extends DbCosmosdbOperationTypeValue("Upsert") + case object Read extends DbCosmosdbOperationTypeValue("read") - /** batch. + /** read_feed. */ - case object Batch extends DbCosmosdbOperationTypeValue("Batch") + case object ReadFeed extends DbCosmosdbOperationTypeValue("read_feed") - /** query_plan. + /** replace. */ - case object QueryPlan extends DbCosmosdbOperationTypeValue("QueryPlan") + case object Replace extends DbCosmosdbOperationTypeValue("replace") - /** execute_javascript. + /** upsert. */ - case object ExecuteJavascript extends DbCosmosdbOperationTypeValue("ExecuteJavaScript") + case object Upsert extends DbCosmosdbOperationTypeValue("upsert") } /** Values for [[DbSystem]]. @@ -581,7 +595,7 @@ object DbExperimentalAttributes { */ case object Interbase extends DbSystemValue("interbase") - /** MariaDB + /** MariaDB (This value has stability level RELEASE CANDIDATE) */ case object Mariadb extends DbSystemValue("mariadb") @@ -597,7 +611,7 @@ object DbExperimentalAttributes { */ case object Mongodb extends DbSystemValue("mongodb") - /** Microsoft SQL Server + /** Microsoft SQL Server (This value has stability level RELEASE CANDIDATE) */ case object Mssql extends DbSystemValue("mssql") @@ -605,7 +619,7 @@ object DbExperimentalAttributes { */ case object Mssqlcompact extends DbSystemValue("mssqlcompact") - /** MySQL + /** MySQL (This value has stability level RELEASE CANDIDATE) */ case object Mysql extends DbSystemValue("mysql") @@ -633,7 +647,7 @@ object DbExperimentalAttributes { */ case object Pointbase extends DbSystemValue("pointbase") - /** PostgreSQL + /** PostgreSQL (This value has stability level RELEASE CANDIDATE) */ case object Postgresql extends DbSystemValue("postgresql") diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/FileExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/FileExperimentalAttributes.scala index fe68ff3a2..1d3cc4f5b 100644 --- a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/FileExperimentalAttributes.scala +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/FileExperimentalAttributes.scala @@ -21,6 +21,37 @@ package experimental.attributes // DO NOT EDIT, this is an Auto-generated file from buildscripts/templates/registry/otel4s/attributes/SemanticAttributes.scala.j2 object FileExperimentalAttributes { + /** Time when the file was last accessed, in ISO 8601 format.

    + * @note + *

    This attribute might not be supported by some file systems — NFS, FAT32, in embedded OS, etc. + */ + val FileAccessed: AttributeKey[String] = + AttributeKey("file.accessed") + + /** Array of file attributes.

    + * @note + *

    Attributes names depend on the OS or file system. Here’s a non-exhaustive list of values expected for this + * attribute: `archive`, `compressed`, `directory`, `encrypted`, `execute`, `hidden`, `immutable`, `journaled`, + * `read`, `readonly`, `symbolic link`, `system`, `temporary`, `write`. + */ + val FileAttributes: AttributeKey[Seq[String]] = + AttributeKey("file.attributes") + + /** Time when the file attributes or metadata was last changed, in ISO 8601 format.

    + * @note + *

    `file.changed` captures the time when any of the file's properties or attributes (including the content) are + * changed, while `file.modified` captures the timestamp when the file content is modified. + */ + val FileChanged: AttributeKey[String] = + AttributeKey("file.changed") + + /** Time when the file was created, in ISO 8601 format.

    + * @note + *

    This attribute might not be supported by some file systems — NFS, FAT32, in embedded OS, etc. + */ + val FileCreated: AttributeKey[String] = + AttributeKey("file.created") + /** Directory where the file is located. It should include the drive letter, when appropriate. */ val FileDirectory: AttributeKey[String] = @@ -34,11 +65,59 @@ object FileExperimentalAttributes { val FileExtension: AttributeKey[String] = AttributeKey("file.extension") + /** Name of the fork. A fork is additional data associated with a filesystem object.

    + * @note + *

    On Linux, a resource fork is used to store additional data with a filesystem object. A file always has at + * least one fork for the data portion, and additional forks may exist. On NTFS, this is analogous to an Alternate + * Data Stream (ADS), and the default data stream for a file is just called $DATA. Zone.Identifier is commonly used + * by Windows to track contents downloaded from the Internet. An ADS is typically of the form: + * C:\path\to\filename.extension:some_fork_name, and some_fork_name is the value that should populate `fork_name`. + * `filename.extension` should populate `file.name`, and `extension` should populate `file.extension`. The full + * path, `file.path`, will include the fork name. + */ + val FileForkName: AttributeKey[String] = + AttributeKey("file.fork_name") + + /** Primary Group ID (GID) of the file. + */ + val FileGroupId: AttributeKey[String] = + AttributeKey("file.group.id") + + /** Primary group name of the file. + */ + val FileGroupName: AttributeKey[String] = + AttributeKey("file.group.name") + + /** Inode representing the file in the filesystem. + */ + val FileInode: AttributeKey[String] = + AttributeKey("file.inode") + + /** Mode of the file in octal representation. + */ + val FileMode: AttributeKey[String] = + AttributeKey("file.mode") + + /** Time when the file content was last modified, in ISO 8601 format. + */ + val FileModified: AttributeKey[String] = + AttributeKey("file.modified") + /** Name of the file including the extension, without the directory. */ val FileName: AttributeKey[String] = AttributeKey("file.name") + /** The user ID (UID) or security identifier (SID) of the file owner. + */ + val FileOwnerId: AttributeKey[String] = + AttributeKey("file.owner.id") + + /** Username of the file owner. + */ + val FileOwnerName: AttributeKey[String] = + AttributeKey("file.owner.name") + /** Full path to the file, including the file name. It should include the drive letter, when appropriate. */ val FilePath: AttributeKey[String] = @@ -49,4 +128,11 @@ object FileExperimentalAttributes { val FileSize: AttributeKey[Long] = AttributeKey("file.size") + /** Path to the target of a symbolic link.

    + * @note + *

    This attribute is only applicable to symbolic links. + */ + val FileSymbolicLinkTargetPath: AttributeKey[String] = + AttributeKey("file.symbolic_link.target_path") + } diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/GenAiExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/GenAiExperimentalAttributes.scala index 7752635a2..01311f1f0 100644 --- a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/GenAiExperimentalAttributes.scala +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/GenAiExperimentalAttributes.scala @@ -21,14 +21,32 @@ package experimental.attributes // DO NOT EDIT, this is an Auto-generated file from buildscripts/templates/registry/otel4s/attributes/SemanticAttributes.scala.j2 object GenAiExperimentalAttributes { - /** The full response received from the GenAI model.

    - * @note - *

    It's RECOMMENDED to format completions as JSON string matching OpenAI messages format + /** Deprecated, use Event API to report completions contents. */ + @deprecated("Removed, no replacement at this time.", "") val GenAiCompletion: AttributeKey[String] = AttributeKey("gen_ai.completion") + /** The response format that is requested. + */ + val GenAiOpenaiRequestResponseFormat: AttributeKey[String] = + AttributeKey("gen_ai.openai.request.response_format") + + /** Requests with same seed value more likely to return same result. + */ + val GenAiOpenaiRequestSeed: AttributeKey[Long] = + AttributeKey("gen_ai.openai.request.seed") + + /** The service tier requested. May be a specific tier, detault, or auto. + */ + val GenAiOpenaiRequestServiceTier: AttributeKey[String] = + AttributeKey("gen_ai.openai.request.service_tier") + + /** The service tier used for the response. + */ + val GenAiOpenaiResponseServiceTier: AttributeKey[String] = + AttributeKey("gen_ai.openai.response.service_tier") + /** The name of the operation being performed.

    * @note *

    If one of the predefined values applies, but specific system uses a different name it's RECOMMENDED to @@ -39,11 +57,9 @@ object GenAiExperimentalAttributes { val GenAiOperationName: AttributeKey[String] = AttributeKey("gen_ai.operation.name") - /** The full prompt sent to the GenAI model.

    - * @note - *

    It's RECOMMENDED to format prompts as JSON string matching OpenAI messages format + /** Deprecated, use Event API to report prompt contents. */ + @deprecated("Removed, no replacement at this time.", "") val GenAiPrompt: AttributeKey[String] = AttributeKey("gen_ai.prompt") @@ -140,6 +156,38 @@ object GenAiExperimentalAttributes { val GenAiUsagePromptTokens: AttributeKey[Long] = AttributeKey("gen_ai.usage.prompt_tokens") + /** Values for [[GenAiOpenaiRequestResponseFormat]]. + */ + abstract class GenAiOpenaiRequestResponseFormatValue(val value: String) + object GenAiOpenaiRequestResponseFormatValue { + + /** Text response format + */ + case object Text extends GenAiOpenaiRequestResponseFormatValue("text") + + /** JSON object response format + */ + case object JsonObject extends GenAiOpenaiRequestResponseFormatValue("json_object") + + /** JSON schema response format + */ + case object JsonSchema extends GenAiOpenaiRequestResponseFormatValue("json_schema") + } + + /** Values for [[GenAiOpenaiRequestServiceTier]]. + */ + abstract class GenAiOpenaiRequestServiceTierValue(val value: String) + object GenAiOpenaiRequestServiceTierValue { + + /** The system will utilize scale tier credits until they are exhausted. + */ + case object Auto extends GenAiOpenaiRequestServiceTierValue("auto") + + /** The system will utilize the default scale tier. + */ + case object Default extends GenAiOpenaiRequestServiceTierValue("default") + } + /** Values for [[GenAiOperationName]]. */ abstract class GenAiOperationNameValue(val value: String) diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/HttpExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/HttpExperimentalAttributes.scala index 50da8d3f7..098af360c 100644 --- a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/HttpExperimentalAttributes.scala +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/HttpExperimentalAttributes.scala @@ -130,9 +130,9 @@ object HttpExperimentalAttributes { val HttpRequestSize: AttributeKey[Long] = AttributeKey("http.request.size") - /** Deprecated, use `http.request.header.content-length` instead. + /** Deprecated, use `http.request.header.` instead. */ - @deprecated("Replaced by `http.request.header.content-length`.", "") + @deprecated("Replaced by `http.request.header.`.", "") val HttpRequestContentLength: AttributeKey[Long] = AttributeKey("http.request_content_length") @@ -181,9 +181,9 @@ object HttpExperimentalAttributes { val HttpResponseStatusCode: AttributeKey[Long] = AttributeKey("http.response.status_code") - /** Deprecated, use `http.response.header.content-length` instead. + /** Deprecated, use `http.response.header.` instead. */ - @deprecated("Replaced by `http.response.header.content-length`.", "") + @deprecated("Replaced by `http.response.header.`.", "") val HttpResponseContentLength: AttributeKey[Long] = AttributeKey("http.response_content_length") diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/HwExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/HwExperimentalAttributes.scala new file mode 100644 index 000000000..e108e9644 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/HwExperimentalAttributes.scala @@ -0,0 +1,133 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s +package semconv +package experimental.attributes + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/templates/registry/otel4s/attributes/SemanticAttributes.scala.j2 +object HwExperimentalAttributes { + + /** An identifier for the hardware component, unique within the monitored host + */ + val HwId: AttributeKey[String] = + AttributeKey("hw.id") + + /** An easily-recognizable name for the hardware component + */ + val HwName: AttributeKey[String] = + AttributeKey("hw.name") + + /** Unique identifier of the parent component (typically the `hw.id` attribute of the enclosure, or disk controller) + */ + val HwParent: AttributeKey[String] = + AttributeKey("hw.parent") + + /** The current state of the component + */ + val HwState: AttributeKey[String] = + AttributeKey("hw.state") + + /** Type of the component

    + * @note + *

    Describes the category of the hardware component for which `hw.state` is being reported. For example, + * `hw.type=temperature` along with `hw.state=degraded` would indicate that the temperature of the hardware + * component has been reported as `degraded`. + */ + val HwType: AttributeKey[String] = + AttributeKey("hw.type") + + /** Values for [[HwState]]. + */ + abstract class HwStateValue(val value: String) + object HwStateValue { + + /** Ok + */ + case object Ok extends HwStateValue("ok") + + /** Degraded + */ + case object Degraded extends HwStateValue("degraded") + + /** Failed + */ + case object Failed extends HwStateValue("failed") + } + + /** Values for [[HwType]]. + */ + abstract class HwTypeValue(val value: String) + object HwTypeValue { + + /** Battery + */ + case object Battery extends HwTypeValue("battery") + + /** CPU + */ + case object Cpu extends HwTypeValue("cpu") + + /** Disk controller + */ + case object DiskController extends HwTypeValue("disk_controller") + + /** Enclosure + */ + case object Enclosure extends HwTypeValue("enclosure") + + /** Fan + */ + case object Fan extends HwTypeValue("fan") + + /** GPU + */ + case object Gpu extends HwTypeValue("gpu") + + /** Logical disk + */ + case object LogicalDisk extends HwTypeValue("logical_disk") + + /** Memory + */ + case object Memory extends HwTypeValue("memory") + + /** Network + */ + case object Network extends HwTypeValue("network") + + /** Physical disk + */ + case object PhysicalDisk extends HwTypeValue("physical_disk") + + /** Power supply + */ + case object PowerSupply extends HwTypeValue("power_supply") + + /** Tape drive + */ + case object TapeDrive extends HwTypeValue("tape_drive") + + /** Temperature + */ + case object Temperature extends HwTypeValue("temperature") + + /** Voltage + */ + case object Voltage extends HwTypeValue("voltage") + } + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/K8sExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/K8sExperimentalAttributes.scala index 4b3c385af..9464e945f 100644 --- a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/K8sExperimentalAttributes.scala +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/K8sExperimentalAttributes.scala @@ -163,4 +163,46 @@ object K8sExperimentalAttributes { val K8sStatefulsetUid: AttributeKey[String] = AttributeKey("k8s.statefulset.uid") + /** The name of the K8s volume. + */ + val K8sVolumeName: AttributeKey[String] = + AttributeKey("k8s.volume.name") + + /** The type of the K8s volume. + */ + val K8sVolumeType: AttributeKey[String] = + AttributeKey("k8s.volume.type") + + /** Values for [[K8sVolumeType]]. + */ + abstract class K8sVolumeTypeValue(val value: String) + object K8sVolumeTypeValue { + + /** A persistentVolumeClaim + * volume + */ + case object PersistentVolumeClaim extends K8sVolumeTypeValue("persistentVolumeClaim") + + /** A configMap volume + */ + case object ConfigMap extends K8sVolumeTypeValue("configMap") + + /** A downwardAPI volume + */ + case object DownwardApi extends K8sVolumeTypeValue("downwardAPI") + + /** An emptyDir volume + */ + case object EmptyDir extends K8sVolumeTypeValue("emptyDir") + + /** A secret volume + */ + case object Secret extends K8sVolumeTypeValue("secret") + + /** A local volume + */ + case object Local extends K8sVolumeTypeValue("local") + } + } diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/LogExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/LogExperimentalAttributes.scala index fae9a0b6f..f0380c910 100644 --- a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/LogExperimentalAttributes.scala +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/LogExperimentalAttributes.scala @@ -46,7 +46,7 @@ object LogExperimentalAttributes { val LogIostream: AttributeKey[String] = AttributeKey("log.iostream") - /** The complete orignal Log Record.

    + /** The complete original Log Record.

    * @note *

    This value MAY be added when processing a Log Record which was originally transmitted as a string or * equivalent data type AND the Body field of the Log Record does not contain the same value. (e.g. a syslog or a diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/MessagingExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/MessagingExperimentalAttributes.scala index 21174e973..66101fd2b 100644 --- a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/MessagingExperimentalAttributes.scala +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/MessagingExperimentalAttributes.scala @@ -272,9 +272,9 @@ object MessagingExperimentalAttributes { val MessagingRocketmqNamespace: AttributeKey[String] = AttributeKey("messaging.rocketmq.namespace") - /** Deprecated, use `messaging.servicebus.destination.subscription_name` instead. + /** Deprecated, use `messaging.destination.subscription.name` instead. */ - @deprecated("Replaced by `messaging.servicebus.destination.subscription_name`.", "") + @deprecated("Replaced by `messaging.destination.subscription.name`.", "") val MessagingServicebusDestinationSubscriptionName: AttributeKey[String] = AttributeKey("messaging.servicebus.destination.subscription_name") @@ -309,16 +309,16 @@ object MessagingExperimentalAttributes { abstract class MessagingOperationTypeValue(val value: String) object MessagingOperationTypeValue { - /** One or more messages are provided for publishing to an intermediary. If a single message is published, the - * context of the "Publish" span can be used as the creation context and no "Create" span needs to be created. - */ - case object Publish extends MessagingOperationTypeValue("publish") - /** A message is created. "Create" spans always refer to a single message and are used to provide a unique creation - * context for messages in batch publishing scenarios. + * context for messages in batch sending scenarios. */ case object Create extends MessagingOperationTypeValue("create") + /** One or more messages are provided for sending to an intermediary. If a single message is sent, the context of + * the "Send" span can be used as the creation context and no "Create" span needs to be created. + */ + case object Send extends MessagingOperationTypeValue("send") + /** One or more messages are requested by a consumer. This operation refers to pull-based scenarios, where consumers * explicitly call methods of messaging SDKs to receive messages. */ @@ -335,6 +335,10 @@ object MessagingExperimentalAttributes { /** Deprecated. Use `process` instead. */ case object Deliver extends MessagingOperationTypeValue("deliver") + + /** Deprecated. Use `send` instead. + */ + case object Publish extends MessagingOperationTypeValue("publish") } /** Values for [[MessagingRocketmqConsumptionModel]]. diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/NodejsExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/NodejsExperimentalAttributes.scala new file mode 100644 index 000000000..d684bea40 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/NodejsExperimentalAttributes.scala @@ -0,0 +1,43 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s +package semconv +package experimental.attributes + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/templates/registry/otel4s/attributes/SemanticAttributes.scala.j2 +object NodejsExperimentalAttributes { + + /** The state of event loop time. + */ + val NodejsEventloopState: AttributeKey[String] = + AttributeKey("nodejs.eventloop.state") + + /** Values for [[NodejsEventloopState]]. + */ + abstract class NodejsEventloopStateValue(val value: String) + object NodejsEventloopStateValue { + + /** Active time. + */ + case object Active extends NodejsEventloopStateValue("active") + + /** Idle time. + */ + case object Idle extends NodejsEventloopStateValue("idle") + } + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/OtelExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/OtelExperimentalAttributes.scala index f81cdb658..484928f52 100644 --- a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/OtelExperimentalAttributes.scala +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/OtelExperimentalAttributes.scala @@ -21,13 +21,15 @@ package experimental.attributes // DO NOT EDIT, this is an Auto-generated file from buildscripts/templates/registry/otel4s/attributes/SemanticAttributes.scala.j2 object OtelExperimentalAttributes { - /** */ - @deprecated("use the `otel.scope.name` attribute.", "") + /** Deprecated. Use the `otel.scope.name` attribute + */ + @deprecated("Use the `otel.scope.name` attribute.", "") val OtelLibraryName: AttributeKey[String] = AttributeKey("otel.library.name") - /** */ - @deprecated("use the `otel.scope.version` attribute.", "") + /** Deprecated. Use the `otel.scope.version` attribute. + */ + @deprecated("Use the `otel.scope.version` attribute.", "") val OtelLibraryVersion: AttributeKey[String] = AttributeKey("otel.library.version") diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/ProcessExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/ProcessExperimentalAttributes.scala index 0809cd17b..1a8029fa5 100644 --- a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/ProcessExperimentalAttributes.scala +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/ProcessExperimentalAttributes.scala @@ -21,6 +21,14 @@ package experimental.attributes // DO NOT EDIT, this is an Auto-generated file from buildscripts/templates/registry/otel4s/attributes/SemanticAttributes.scala.j2 object ProcessExperimentalAttributes { + /** Length of the process.command_args array

    + * @note + *

    This field can be useful for querying or performing bucket analysis on how many arguments were provided to + * start a process. More arguments may be an indication of suspicious activity. + */ + val ProcessArgsCount: AttributeKey[Long] = + AttributeKey("process.args_count") + /** The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth * string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. */ @@ -58,6 +66,21 @@ object ProcessExperimentalAttributes { val ProcessCreationTime: AttributeKey[String] = AttributeKey("process.creation.time") + /** The GNU build ID as found in the `.note.gnu.build-id` ELF section (hex string). + */ + val ProcessExecutableBuildIdGnu: AttributeKey[String] = + AttributeKey("process.executable.build_id.gnu") + + /** The Go build ID as retrieved by `go tool buildid `. + */ + val ProcessExecutableBuildIdGo: AttributeKey[String] = + AttributeKey("process.executable.build_id.go") + + /** Profiling specific build ID for executables. See the OTel specification for Profiles for more information. + */ + val ProcessExecutableBuildIdProfiling: AttributeKey[String] = + AttributeKey("process.executable.build_id.profiling") + /** The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On * Windows, can be set to the base name of `GetProcessImageFileNameW`. */ @@ -152,6 +175,14 @@ object ProcessExperimentalAttributes { val ProcessSessionLeaderPid: AttributeKey[Long] = AttributeKey("process.session_leader.pid") + /** Process title (proctitle)

    + * @note + *

    In many Unix-like systems, process title (proctitle), is the string that represents the name or command line + * of a running process, displayed by system monitoring tools like ps, top, and htop. + */ + val ProcessTitle: AttributeKey[String] = + AttributeKey("process.title") + /** The effective user ID (EUID) of the process. */ val ProcessUserId: AttributeKey[Long] = @@ -170,6 +201,11 @@ object ProcessExperimentalAttributes { val ProcessVpid: AttributeKey[Long] = AttributeKey("process.vpid") + /** The working directory of the process. + */ + val ProcessWorkingDirectory: AttributeKey[String] = + AttributeKey("process.working_directory") + /** Values for [[ProcessContextSwitchType]]. */ abstract class ProcessContextSwitchTypeValue(val value: String) diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/ProfileExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/ProfileExperimentalAttributes.scala new file mode 100644 index 000000000..8a37f9eb1 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/ProfileExperimentalAttributes.scala @@ -0,0 +1,74 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s +package semconv +package experimental.attributes + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/templates/registry/otel4s/attributes/SemanticAttributes.scala.j2 +object ProfileExperimentalAttributes { + + /** Describes the interpreter or compiler of a single frame. + */ + val ProfileFrameType: AttributeKey[String] = + AttributeKey("profile.frame.type") + + /** Values for [[ProfileFrameType]]. + */ + abstract class ProfileFrameTypeValue(val value: String) + object ProfileFrameTypeValue { + + /** .NET + */ + case object Dotnet extends ProfileFrameTypeValue("dotnet") + + /** JVM + */ + case object Jvm extends ProfileFrameTypeValue("jvm") + + /** Kernel + */ + case object Kernel extends ProfileFrameTypeValue("kernel") + + /** C, C++, Go, Rust + */ + case object Native extends ProfileFrameTypeValue("native") + + /** Perl + */ + case object Perl extends ProfileFrameTypeValue("perl") + + /** PHP + */ + case object Php extends ProfileFrameTypeValue("php") + + /** Python + */ + case object Cpython extends ProfileFrameTypeValue("cpython") + + /** Ruby + */ + case object Ruby extends ProfileFrameTypeValue("ruby") + + /** V8JS + */ + case object V8js extends ProfileFrameTypeValue("v8js") + } + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/TlsExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/TlsExperimentalAttributes.scala index d9a9b4fb2..61005aed1 100644 --- a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/TlsExperimentalAttributes.scala +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/attributes/TlsExperimentalAttributes.scala @@ -84,7 +84,7 @@ object TlsExperimentalAttributes { /** Deprecated, use `server.address` instead. */ - @deprecated("Replaced by `server.address.", "") + @deprecated("Replaced by `server.address`.", "") val TlsClientServerName: AttributeKey[String] = AttributeKey("tls.client.server_name") diff --git a/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/ContainerExperimentalMetrics.scala b/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/ContainerExperimentalMetrics.scala index b4313fb76..78d595200 100644 --- a/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/ContainerExperimentalMetrics.scala +++ b/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/ContainerExperimentalMetrics.scala @@ -27,6 +27,7 @@ object ContainerExperimentalMetrics { val specs: List[MetricSpec] = List( CpuTime, + CpuUsage, DiskIo, MemoryUsage, NetworkIo, @@ -58,7 +59,9 @@ object ContainerExperimentalMetrics { "user", "system", ), - Requirement.optIn, + Requirement.conditionallyRequired( + "Required if mode is available, i.e. metrics coming from the Docker Stats API." + ), Stability.experimental ) @@ -77,6 +80,53 @@ object ContainerExperimentalMetrics { } + /** Container's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs

    + * @note + *

    CPU usage of the specific container on all available CPU cores, averaged over the sample window + */ + object CpuUsage extends MetricSpec { + + val name: String = "container.cpu.usage" + val description: String = "Container's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs" + val unit: String = "{cpu}" + val stability: Stability = Stability.experimental + val attributeSpecs: List[AttributeSpec[_]] = AttributeSpecs.specs + + object AttributeSpecs { + + /** The CPU mode for this data point. A container's CPU metric SHOULD be characterized either by data + * points with no `mode` labels, or only data points with `mode` labels.

    + * @note + *

    Following states SHOULD be used: `user`, `system`, `kernel` + */ + val cpuMode: AttributeSpec[String] = + AttributeSpec( + CpuExperimentalAttributes.CpuMode, + List( + "user", + "system", + ), + Requirement.conditionallyRequired( + "Required if mode is available, i.e. metrics coming from the Docker Stats API." + ), + Stability.experimental + ) + + val specs: List[AttributeSpec[_]] = + List( + cpuMode, + ) + } + + def create[F[_]: Meter]: F[Gauge[F, Long]] = + Meter[F] + .gauge[Long](name) + .withDescription(description) + .withUnit(unit) + .create + + } + /** Disk bytes for the container.

    * @note *

    The total number of bytes read/written successfully (aggregated from all disks). diff --git a/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/DbExperimentalMetrics.scala b/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/DbExperimentalMetrics.scala index 4d4c1939c..9be0b2b54 100644 --- a/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/DbExperimentalMetrics.scala +++ b/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/DbExperimentalMetrics.scala @@ -278,12 +278,12 @@ object DbExperimentalMetrics { } - /** The number of pending requests for an open connection, cumulative for the entire pool + /** The number of current pending requests for an open connection */ object ClientConnectionPendingRequests extends MetricSpec { val name: String = "db.client.connection.pending_requests" - val description: String = "The number of pending requests for an open connection, cumulative for the entire pool" + val description: String = "The number of current pending requests for an open connection" val unit: String = "{request}" val stability: Stability = Stability.experimental val attributeSpecs: List[AttributeSpec[_]] = AttributeSpecs.specs @@ -863,7 +863,7 @@ object DbExperimentalMetrics { * found in the query and it SHOULD match the value provided in the query text including any schema and * database name prefix. For batch operations, if the individual operations are known to have the same * collection name then that collection name SHOULD be used, otherwise `db.collection.name` SHOULD NOT be - * captured. + * captured. This attribute has stability level RELEASE CANDIDATE. */ val dbCollectionName: AttributeSpec[String] = AttributeSpec( @@ -885,7 +885,8 @@ object DbExperimentalMetrics { * specific namespaces SHOULD NOT be captured without the more general namespaces, to ensure that "startswith" * queries for the more general namespaces will be valid. Semantic conventions for individual database systems * SHOULD document what `db.namespace` means in the context of that system. It is RECOMMENDED to capture the - * value as provided by the application without attempting to do any case normalization. + * value as provided by the application without attempting to do any case normalization. This attribute has + * stability level RELEASE CANDIDATE. */ val dbNamespace: AttributeSpec[String] = AttributeSpec( @@ -904,7 +905,8 @@ object DbExperimentalMetrics { * normalization. If the operation name is parsed from the query text, it SHOULD be the first operation name * found in the query. For batch operations, if the individual operations are known to have the same operation * name then that operation name SHOULD be used prepended by `BATCH `, otherwise `db.operation.name` SHOULD be - * `BATCH` or some other database system specific term if more applicable. + * `BATCH` or some other database system specific term if more applicable. This attribute has stability level + * RELEASE CANDIDATE. */ val dbOperationName: AttributeSpec[String] = AttributeSpec( @@ -920,11 +922,31 @@ object DbExperimentalMetrics { Stability.experimental ) + /** Database response status code.

    + * @note + *

    The status code returned by the database. Usually it represents an error code, but may also represent + * partial success, warning, or differentiate between various types of successful outcomes. Semantic + * conventions for individual database systems SHOULD document what `db.response.status_code` means in the + * context of that system. This attribute has stability level RELEASE CANDIDATE. + */ + val dbResponseStatusCode: AttributeSpec[String] = + AttributeSpec( + DbExperimentalAttributes.DbResponseStatusCode, + List( + "102", + "ORA-17002", + "08P01", + "404", + ), + Requirement.conditionallyRequired("If the operation failed and status code is available."), + Stability.experimental + ) + /** The database management system (DBMS) product as identified by the client instrumentation.

    * @note *

    The actual DBMS may differ from the one identified by the client. For example, when using PostgreSQL * client libraries to connect to a CockroachDB, the `db.system` is set to `postgresql` based on the - * instrumentation's best knowledge. + * instrumentation's best knowledge. This attribute has stability level RELEASE CANDIDATE. */ val dbSystem: AttributeSpec[String] = AttributeSpec( @@ -937,9 +959,11 @@ object DbExperimentalMetrics { /** Describes a class of error the operation ended with.

    * @note - *

    The `error.type` SHOULD match the error code returned by the database or the client library, the - * canonical name of exception that occurred, or another low-cardinality error identifier. Instrumentations - * SHOULD document the list of errors they report. + *

    The `error.type` SHOULD match the `db.response.status_code` returned by the database or the client + * library, or the canonical name of exception that occurred. When using canonical exception type name, + * instrumentation SHOULD do the best effort to report the most relevant type. For example, if the original + * exception is wrapped into a generic one, the original exception SHOULD be preferred. Instrumentations SHOULD + * document how `error.type` is populated. */ val errorType: AttributeSpec[String] = AttributeSpec( @@ -1025,6 +1049,7 @@ object DbExperimentalMetrics { dbCollectionName, dbNamespace, dbOperationName, + dbResponseStatusCode, dbSystem, errorType, networkPeerAddress, diff --git a/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/HwExperimentalMetrics.scala b/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/HwExperimentalMetrics.scala new file mode 100644 index 000000000..cec839ce0 --- /dev/null +++ b/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/HwExperimentalMetrics.scala @@ -0,0 +1,404 @@ +/* + * Copyright 2024 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s +package semconv +package experimental +package metrics + +import org.typelevel.otel4s.metrics._ +import org.typelevel.otel4s.semconv.attributes._ +import org.typelevel.otel4s.semconv.experimental.attributes._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/templates/registry/otel4s/metrics/SemanticMetrics.scala.j2 +object HwExperimentalMetrics { + + val specs: List[MetricSpec] = List( + Energy, + Errors, + Power, + Status, + ) + + /** Energy consumed by the component + */ + object Energy extends MetricSpec { + + val name: String = "hw.energy" + val description: String = "Energy consumed by the component" + val unit: String = "J" + val stability: Stability = Stability.experimental + val attributeSpecs: List[AttributeSpec[_]] = AttributeSpecs.specs + + object AttributeSpecs { + + /** An identifier for the hardware component, unique within the monitored host + */ + val hwId: AttributeSpec[String] = + AttributeSpec( + HwExperimentalAttributes.HwId, + List( + "win32battery_battery_testsysa33_1", + ), + Requirement.required, + Stability.experimental + ) + + /** An easily-recognizable name for the hardware component + */ + val hwName: AttributeSpec[String] = + AttributeSpec( + HwExperimentalAttributes.HwName, + List( + "eth0", + ), + Requirement.recommended, + Stability.experimental + ) + + /** Unique identifier of the parent component (typically the `hw.id` attribute of the enclosure, or disk + * controller) + */ + val hwParent: AttributeSpec[String] = + AttributeSpec( + HwExperimentalAttributes.HwParent, + List( + "dellStorage_perc_0", + ), + Requirement.recommended, + Stability.experimental + ) + + /** Type of the component

    + * @note + *

    Describes the category of the hardware component for which `hw.state` is being reported. For example, + * `hw.type=temperature` along with `hw.state=degraded` would indicate that the temperature of the hardware + * component has been reported as `degraded`. + */ + val hwType: AttributeSpec[String] = + AttributeSpec( + HwExperimentalAttributes.HwType, + List( + ), + Requirement.required, + Stability.experimental + ) + + val specs: List[AttributeSpec[_]] = + List( + hwId, + hwName, + hwParent, + hwType, + ) + } + + def create[F[_]: Meter]: F[Counter[F, Long]] = + Meter[F] + .counter[Long](name) + .withDescription(description) + .withUnit(unit) + .create + + } + + /** Number of errors encountered by the component + */ + object Errors extends MetricSpec { + + val name: String = "hw.errors" + val description: String = "Number of errors encountered by the component" + val unit: String = "{error}" + val stability: Stability = Stability.experimental + val attributeSpecs: List[AttributeSpec[_]] = AttributeSpecs.specs + + object AttributeSpecs { + + /** The type of error encountered by the component

    + * @note + *

    The `error.type` SHOULD match the error code reported by the component, the canonical name of the error, + * or another low-cardinality error identifier. Instrumentations SHOULD document the list of errors they + * report. + */ + val errorType: AttributeSpec[String] = + AttributeSpec( + ErrorAttributes.ErrorType, + List( + "uncorrected", + "zero_buffer_credit", + "crc", + "bad_sector", + ), + Requirement.conditionallyRequired("if and only if an error has occurred"), + Stability.stable + ) + + /** An identifier for the hardware component, unique within the monitored host + */ + val hwId: AttributeSpec[String] = + AttributeSpec( + HwExperimentalAttributes.HwId, + List( + "win32battery_battery_testsysa33_1", + ), + Requirement.required, + Stability.experimental + ) + + /** An easily-recognizable name for the hardware component + */ + val hwName: AttributeSpec[String] = + AttributeSpec( + HwExperimentalAttributes.HwName, + List( + "eth0", + ), + Requirement.recommended, + Stability.experimental + ) + + /** Unique identifier of the parent component (typically the `hw.id` attribute of the enclosure, or disk + * controller) + */ + val hwParent: AttributeSpec[String] = + AttributeSpec( + HwExperimentalAttributes.HwParent, + List( + "dellStorage_perc_0", + ), + Requirement.recommended, + Stability.experimental + ) + + /** Type of the component

    + * @note + *

    Describes the category of the hardware component for which `hw.state` is being reported. For example, + * `hw.type=temperature` along with `hw.state=degraded` would indicate that the temperature of the hardware + * component has been reported as `degraded`. + */ + val hwType: AttributeSpec[String] = + AttributeSpec( + HwExperimentalAttributes.HwType, + List( + ), + Requirement.required, + Stability.experimental + ) + + val specs: List[AttributeSpec[_]] = + List( + errorType, + hwId, + hwName, + hwParent, + hwType, + ) + } + + def create[F[_]: Meter]: F[Counter[F, Long]] = + Meter[F] + .counter[Long](name) + .withDescription(description) + .withUnit(unit) + .create + + } + + /** Instantaneous power consumed by the component

    + * @note + *

    It is recommended to report `hw.energy` instead of `hw.power` when possible. + */ + object Power extends MetricSpec { + + val name: String = "hw.power" + val description: String = "Instantaneous power consumed by the component" + val unit: String = "W" + val stability: Stability = Stability.experimental + val attributeSpecs: List[AttributeSpec[_]] = AttributeSpecs.specs + + object AttributeSpecs { + + /** An identifier for the hardware component, unique within the monitored host + */ + val hwId: AttributeSpec[String] = + AttributeSpec( + HwExperimentalAttributes.HwId, + List( + "win32battery_battery_testsysa33_1", + ), + Requirement.required, + Stability.experimental + ) + + /** An easily-recognizable name for the hardware component + */ + val hwName: AttributeSpec[String] = + AttributeSpec( + HwExperimentalAttributes.HwName, + List( + "eth0", + ), + Requirement.recommended, + Stability.experimental + ) + + /** Unique identifier of the parent component (typically the `hw.id` attribute of the enclosure, or disk + * controller) + */ + val hwParent: AttributeSpec[String] = + AttributeSpec( + HwExperimentalAttributes.HwParent, + List( + "dellStorage_perc_0", + ), + Requirement.recommended, + Stability.experimental + ) + + /** Type of the component

    + * @note + *

    Describes the category of the hardware component for which `hw.state` is being reported. For example, + * `hw.type=temperature` along with `hw.state=degraded` would indicate that the temperature of the hardware + * component has been reported as `degraded`. + */ + val hwType: AttributeSpec[String] = + AttributeSpec( + HwExperimentalAttributes.HwType, + List( + ), + Requirement.required, + Stability.experimental + ) + + val specs: List[AttributeSpec[_]] = + List( + hwId, + hwName, + hwParent, + hwType, + ) + } + + def create[F[_]: Meter]: F[Gauge[F, Long]] = + Meter[F] + .gauge[Long](name) + .withDescription(description) + .withUnit(unit) + .create + + } + + /** Operational status: `1` (true) or `0` (false) for each of the possible states

    + * @note + *

    `hw.status` is currently specified as an UpDownCounter but would ideally be represented using a StateSet + * as defined in OpenMetrics. This semantic convention will be updated once StateSet is specified in + * OpenTelemetry. This planned change is not expected to have any consequence on the way users query their + * timeseries backend to retrieve the values of `hw.status` over time. + */ + object Status extends MetricSpec { + + val name: String = "hw.status" + val description: String = "Operational status: `1` (true) or `0` (false) for each of the possible states" + val unit: String = "1" + val stability: Stability = Stability.experimental + val attributeSpecs: List[AttributeSpec[_]] = AttributeSpecs.specs + + object AttributeSpecs { + + /** An identifier for the hardware component, unique within the monitored host + */ + val hwId: AttributeSpec[String] = + AttributeSpec( + HwExperimentalAttributes.HwId, + List( + "win32battery_battery_testsysa33_1", + ), + Requirement.required, + Stability.experimental + ) + + /** An easily-recognizable name for the hardware component + */ + val hwName: AttributeSpec[String] = + AttributeSpec( + HwExperimentalAttributes.HwName, + List( + "eth0", + ), + Requirement.recommended, + Stability.experimental + ) + + /** Unique identifier of the parent component (typically the `hw.id` attribute of the enclosure, or disk + * controller) + */ + val hwParent: AttributeSpec[String] = + AttributeSpec( + HwExperimentalAttributes.HwParent, + List( + "dellStorage_perc_0", + ), + Requirement.recommended, + Stability.experimental + ) + + /** The current state of the component + */ + val hwState: AttributeSpec[String] = + AttributeSpec( + HwExperimentalAttributes.HwState, + List( + ), + Requirement.required, + Stability.experimental + ) + + /** Type of the component

    + * @note + *

    Describes the category of the hardware component for which `hw.state` is being reported. For example, + * `hw.type=temperature` along with `hw.state=degraded` would indicate that the temperature of the hardware + * component has been reported as `degraded`. + */ + val hwType: AttributeSpec[String] = + AttributeSpec( + HwExperimentalAttributes.HwType, + List( + ), + Requirement.required, + Stability.experimental + ) + + val specs: List[AttributeSpec[_]] = + List( + hwId, + hwName, + hwParent, + hwState, + hwType, + ) + } + + def create[F[_]: Meter]: F[UpDownCounter[F, Long]] = + Meter[F] + .upDownCounter[Long](name) + .withDescription(description) + .withUnit(unit) + .create + + } + +} diff --git a/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/K8sExperimentalMetrics.scala b/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/K8sExperimentalMetrics.scala new file mode 100644 index 000000000..ed59ffadf --- /dev/null +++ b/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/K8sExperimentalMetrics.scala @@ -0,0 +1,162 @@ +/* + * Copyright 2024 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s +package semconv +package experimental +package metrics + +import org.typelevel.otel4s.metrics._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/templates/registry/otel4s/metrics/SemanticMetrics.scala.j2 +object K8sExperimentalMetrics { + + val specs: List[MetricSpec] = List( + NodeCpuTime, + NodeCpuUsage, + NodeMemoryUsage, + PodCpuTime, + PodCpuUsage, + PodMemoryUsage, + ) + + /** Total CPU time consumed

    + * @note + *

    Total CPU time consumed by the specific Node on all available CPU cores + */ + object NodeCpuTime extends MetricSpec { + + val name: String = "k8s.node.cpu.time" + val description: String = "Total CPU time consumed" + val unit: String = "s" + val stability: Stability = Stability.experimental + val attributeSpecs: List[AttributeSpec[_]] = Nil + + def create[F[_]: Meter]: F[Counter[F, Long]] = + Meter[F] + .counter[Long](name) + .withDescription(description) + .withUnit(unit) + .create + + } + + /** Node's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs

    + * @note + *

    CPU usage of the specific Node on all available CPU cores, averaged over the sample window + */ + object NodeCpuUsage extends MetricSpec { + + val name: String = "k8s.node.cpu.usage" + val description: String = "Node's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs" + val unit: String = "{cpu}" + val stability: Stability = Stability.experimental + val attributeSpecs: List[AttributeSpec[_]] = Nil + + def create[F[_]: Meter]: F[Gauge[F, Long]] = + Meter[F] + .gauge[Long](name) + .withDescription(description) + .withUnit(unit) + .create + + } + + /** Memory usage of the Node

    + * @note + *

    Total memory usage of the Node + */ + object NodeMemoryUsage extends MetricSpec { + + val name: String = "k8s.node.memory.usage" + val description: String = "Memory usage of the Node" + val unit: String = "By" + val stability: Stability = Stability.experimental + val attributeSpecs: List[AttributeSpec[_]] = Nil + + def create[F[_]: Meter]: F[Gauge[F, Long]] = + Meter[F] + .gauge[Long](name) + .withDescription(description) + .withUnit(unit) + .create + + } + + /** Total CPU time consumed

    + * @note + *

    Total CPU time consumed by the specific Pod on all available CPU cores + */ + object PodCpuTime extends MetricSpec { + + val name: String = "k8s.pod.cpu.time" + val description: String = "Total CPU time consumed" + val unit: String = "s" + val stability: Stability = Stability.experimental + val attributeSpecs: List[AttributeSpec[_]] = Nil + + def create[F[_]: Meter]: F[Counter[F, Long]] = + Meter[F] + .counter[Long](name) + .withDescription(description) + .withUnit(unit) + .create + + } + + /** Pod's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs

    + * @note + *

    CPU usage of the specific Pod on all available CPU cores, averaged over the sample window + */ + object PodCpuUsage extends MetricSpec { + + val name: String = "k8s.pod.cpu.usage" + val description: String = "Pod's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs" + val unit: String = "{cpu}" + val stability: Stability = Stability.experimental + val attributeSpecs: List[AttributeSpec[_]] = Nil + + def create[F[_]: Meter]: F[Gauge[F, Long]] = + Meter[F] + .gauge[Long](name) + .withDescription(description) + .withUnit(unit) + .create + + } + + /** Memory usage of the Pod

    + * @note + *

    Total memory usage of the Pod + */ + object PodMemoryUsage extends MetricSpec { + + val name: String = "k8s.pod.memory.usage" + val description: String = "Memory usage of the Pod" + val unit: String = "By" + val stability: Stability = Stability.experimental + val attributeSpecs: List[AttributeSpec[_]] = Nil + + def create[F[_]: Meter]: F[Gauge[F, Long]] = + Meter[F] + .gauge[Long](name) + .withDescription(description) + .withUnit(unit) + .create + + } + +} diff --git a/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/MessagingExperimentalMetrics.scala b/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/MessagingExperimentalMetrics.scala index 4ca87000d..bc9022294 100644 --- a/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/MessagingExperimentalMetrics.scala +++ b/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/MessagingExperimentalMetrics.scala @@ -31,6 +31,7 @@ object MessagingExperimentalMetrics { ClientConsumedMessages, ClientOperationDuration, ClientPublishedMessages, + ClientSentMessages, ProcessDuration, ProcessMessages, PublishDuration, @@ -469,14 +470,185 @@ object MessagingExperimentalMetrics { } - /** Number of messages producer attempted to publish to the broker.

    - * @note - *

    This metric MUST NOT count messages that were created haven't yet been attempted to be published. + /** Deprecated. Use `messaging.client.sent.messages` instead. */ + @deprecated("Replaced by `messaging.client.sent.messages`.", "") object ClientPublishedMessages extends MetricSpec { val name: String = "messaging.client.published.messages" - val description: String = "Number of messages producer attempted to publish to the broker." + val description: String = "Deprecated. Use `messaging.client.sent.messages` instead." + val unit: String = "{message}" + val stability: Stability = Stability.experimental + val attributeSpecs: List[AttributeSpec[_]] = AttributeSpecs.specs + + object AttributeSpecs { + + /** Describes a class of error the operation ended with.

    + * @note + *

    The `error.type` SHOULD be predictable, and SHOULD have low cardinality.

    When `error.type` is set to + * a type (e.g., an exception type), its canonical class name identifying the type within the artifact SHOULD + * be used.

    Instrumentations SHOULD document the list of errors they report.

    The cardinality of + * `error.type` within one instrumentation library SHOULD be low. Telemetry consumers that aggregate data from + * multiple instrumentation libraries and applications should be prepared for `error.type` to have high + * cardinality at query time when no additional filters are applied.

    If the operation has completed + * successfully, instrumentations SHOULD NOT set `error.type`.

    If a specific domain defines its own set of + * error identifiers (such as HTTP or gRPC status codes), it's RECOMMENDED to:

    • Use a + * domain-specific attribute
    • Set `error.type` to capture all errors, regardless of whether they are defined + * within the domain-specific set or not.
    + */ + val errorType: AttributeSpec[String] = + AttributeSpec( + ErrorAttributes.ErrorType, + List( + "amqp:decode-error", + "KAFKA_STORAGE_ERROR", + "channel-error", + ), + Requirement.conditionallyRequired("If and only if the messaging operation has failed."), + Stability.stable + ) + + /** The message destination name

    + * @note + *

    Destination name SHOULD uniquely identify a specific queue, topic or other entity within the broker. If + * the broker doesn't have such notion, the destination name SHOULD uniquely identify the broker. + */ + val messagingDestinationName: AttributeSpec[String] = + AttributeSpec( + MessagingExperimentalAttributes.MessagingDestinationName, + List( + "MyQueue", + "MyTopic", + ), + Requirement.conditionallyRequired( + "if and only if `messaging.destination.name` is known to have low cardinality. Otherwise, `messaging.destination.template` MAY be populated." + ), + Stability.experimental + ) + + /** The identifier of the partition messages are sent to or received from, unique within the + * `messaging.destination.name`. + */ + val messagingDestinationPartitionId: AttributeSpec[String] = + AttributeSpec( + MessagingExperimentalAttributes.MessagingDestinationPartitionId, + List( + "1", + ), + Requirement.recommended, + Stability.experimental + ) + + /** Low cardinality representation of the messaging destination name

    + * @note + *

    Destination names could be constructed from templates. An example would be a destination name involving + * a user name or product id. Although the destination name in this case is of high cardinality, the underlying + * template is of low cardinality and can be effectively used for grouping and aggregation. + */ + val messagingDestinationTemplate: AttributeSpec[String] = + AttributeSpec( + MessagingExperimentalAttributes.MessagingDestinationTemplate, + List( + "/customers/{customerId}", + ), + Requirement.conditionallyRequired("if available."), + Stability.experimental + ) + + /** The system-specific name of the messaging operation. + */ + val messagingOperationName: AttributeSpec[String] = + AttributeSpec( + MessagingExperimentalAttributes.MessagingOperationName, + List( + "ack", + "nack", + "send", + ), + Requirement.required, + Stability.experimental + ) + + /** The messaging system as identified by the client instrumentation.

    + * @note + *

    The actual messaging system may differ from the one known by the client. For example, when using Kafka + * client libraries to communicate with Azure Event Hubs, the `messaging.system` is set to `kafka` based on the + * instrumentation's best knowledge. + */ + val messagingSystem: AttributeSpec[String] = + AttributeSpec( + MessagingExperimentalAttributes.MessagingSystem, + List( + ), + Requirement.required, + Stability.experimental + ) + + /** Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. + *

    + * @note + *

    Server domain name of the broker if available without reverse DNS lookup; otherwise, IP address or Unix + * domain socket name. + */ + val serverAddress: AttributeSpec[String] = + AttributeSpec( + ServerAttributes.ServerAddress, + List( + "example.com", + "10.1.2.80", + "/tmp/my.sock", + ), + Requirement.conditionallyRequired("If available."), + Stability.stable + ) + + /** Server port number.

    + * @note + *

    When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD + * represent the server port behind any intermediaries, for example proxies, if it's available. + */ + val serverPort: AttributeSpec[Long] = + AttributeSpec( + ServerAttributes.ServerPort, + List( + 80, + 8080, + 443, + ), + Requirement.recommended, + Stability.stable + ) + + val specs: List[AttributeSpec[_]] = + List( + errorType, + messagingDestinationName, + messagingDestinationPartitionId, + messagingDestinationTemplate, + messagingOperationName, + messagingSystem, + serverAddress, + serverPort, + ) + } + + def create[F[_]: Meter]: F[Counter[F, Long]] = + Meter[F] + .counter[Long](name) + .withDescription(description) + .withUnit(unit) + .create + + } + + /** Number of messages producer attempted to send to the broker.

    + * @note + *

    This metric MUST NOT count messages that were created but haven't yet been sent. + */ + object ClientSentMessages extends MetricSpec { + + val name: String = "messaging.client.sent.messages" + val description: String = "Number of messages producer attempted to send to the broker." val unit: String = "{message}" val stability: Stability = Stability.experimental val attributeSpecs: List[AttributeSpec[_]] = AttributeSpecs.specs diff --git a/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/NodejsExperimentalMetrics.scala b/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/NodejsExperimentalMetrics.scala index af00f585a..a5f309b3f 100644 --- a/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/NodejsExperimentalMetrics.scala +++ b/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/NodejsExperimentalMetrics.scala @@ -20,6 +20,7 @@ package experimental package metrics import org.typelevel.otel4s.metrics._ +import org.typelevel.otel4s.semconv.experimental.attributes._ // DO NOT EDIT, this is an Auto-generated file from buildscripts/templates/registry/otel4s/metrics/SemanticMetrics.scala.j2 object NodejsExperimentalMetrics { @@ -32,6 +33,7 @@ object NodejsExperimentalMetrics { EventloopDelayP90, EventloopDelayP99, EventloopDelayStddev, + EventloopTime, EventloopUtilization, ) @@ -189,9 +191,51 @@ object NodejsExperimentalMetrics { } + /** Cumulative duration of time the event loop has been in each state.

    + * @note + *

    Value can be retrieved from `performance.eventLoopUtilization([utilization1[, + * utilization2]])` + */ + object EventloopTime extends MetricSpec { + + val name: String = "nodejs.eventloop.time" + val description: String = "Cumulative duration of time the event loop has been in each state." + val unit: String = "s" + val stability: Stability = Stability.experimental + val attributeSpecs: List[AttributeSpec[_]] = AttributeSpecs.specs + + object AttributeSpecs { + + /** The state of event loop time. + */ + val nodejsEventloopState: AttributeSpec[String] = + AttributeSpec( + NodejsExperimentalAttributes.NodejsEventloopState, + List( + ), + Requirement.required, + Stability.experimental + ) + + val specs: List[AttributeSpec[_]] = + List( + nodejsEventloopState, + ) + } + + def create[F[_]: Meter]: F[Counter[F, Long]] = + Meter[F] + .counter[Long](name) + .withDescription(description) + .withUnit(unit) + .create + + } + /** Event loop utilization.

    * @note - *

    The value range is [0.0,1.0] and can be retrieved from value The value range is [0.0, 1.0] and can be retrieved from `performance.eventLoopUtilization([utilization1[, * utilization2]])` */ diff --git a/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/ProcessExperimentalMetrics.scala b/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/ProcessExperimentalMetrics.scala index 6933355a1..9e194db01 100644 --- a/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/ProcessExperimentalMetrics.scala +++ b/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/ProcessExperimentalMetrics.scala @@ -36,6 +36,7 @@ object ProcessExperimentalMetrics { OpenFileDescriptorCount, PagingFaults, ThreadCount, + Uptime, ) /** Number of times the process has been context switched. @@ -357,4 +358,26 @@ object ProcessExperimentalMetrics { } + /** The time the process has been running.

    + * @note + *

    Instrumentations SHOULD use counter with type `double` and measure uptime with at least millisecond + * precision + */ + object Uptime extends MetricSpec { + + val name: String = "process.uptime" + val description: String = "The time the process has been running." + val unit: String = "s" + val stability: Stability = Stability.experimental + val attributeSpecs: List[AttributeSpec[_]] = Nil + + def create[F[_]: Meter]: F[Counter[F, Long]] = + Meter[F] + .counter[Long](name) + .withDescription(description) + .withUnit(unit) + .create + + } + } diff --git a/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/SystemExperimentalMetrics.scala b/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/SystemExperimentalMetrics.scala index e4dac7ce8..b24091cd0 100644 --- a/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/SystemExperimentalMetrics.scala +++ b/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/SystemExperimentalMetrics.scala @@ -34,9 +34,11 @@ object SystemExperimentalMetrics { CpuUtilization, DiskIo, DiskIoTime, + DiskLimit, DiskMerged, DiskOperationTime, DiskOperations, + FilesystemLimit, FilesystemUsage, FilesystemUtilization, LinuxMemoryAvailable, @@ -346,6 +348,45 @@ object SystemExperimentalMetrics { } + /** The total storage capacity of the disk + */ + object DiskLimit extends MetricSpec { + + val name: String = "system.disk.limit" + val description: String = "The total storage capacity of the disk" + val unit: String = "By" + val stability: Stability = Stability.experimental + val attributeSpecs: List[AttributeSpec[_]] = AttributeSpecs.specs + + object AttributeSpecs { + + /** The device identifier + */ + val systemDevice: AttributeSpec[String] = + AttributeSpec( + SystemExperimentalAttributes.SystemDevice, + List( + "(identifier)", + ), + Requirement.recommended, + Stability.experimental + ) + + val specs: List[AttributeSpec[_]] = + List( + systemDevice, + ) + } + + def create[F[_]: Meter]: F[UpDownCounter[F, Long]] = + Meter[F] + .upDownCounter[Long](name) + .withDescription(description) + .withUnit(unit) + .create + + } + /** */ object DiskMerged extends MetricSpec { @@ -505,24 +546,108 @@ object SystemExperimentalMetrics { } - /** */ + /** The total storage capacity of the filesystem + */ + object FilesystemLimit extends MetricSpec { + + val name: String = "system.filesystem.limit" + val description: String = "The total storage capacity of the filesystem" + val unit: String = "By" + val stability: Stability = Stability.experimental + val attributeSpecs: List[AttributeSpec[_]] = AttributeSpecs.specs + + object AttributeSpecs { + + /** Identifier for the device where the filesystem resides. + */ + val systemDevice: AttributeSpec[String] = + AttributeSpec( + SystemExperimentalAttributes.SystemDevice, + List( + "/dev/sda", + "\network-drive", + ), + Requirement.recommended, + Stability.experimental + ) + + /** The filesystem mode + */ + val systemFilesystemMode: AttributeSpec[String] = + AttributeSpec( + SystemExperimentalAttributes.SystemFilesystemMode, + List( + "rw, ro", + ), + Requirement.recommended, + Stability.experimental + ) + + /** The filesystem mount path + */ + val systemFilesystemMountpoint: AttributeSpec[String] = + AttributeSpec( + SystemExperimentalAttributes.SystemFilesystemMountpoint, + List( + "/mnt/data", + ), + Requirement.recommended, + Stability.experimental + ) + + /** The filesystem type + */ + val systemFilesystemType: AttributeSpec[String] = + AttributeSpec( + SystemExperimentalAttributes.SystemFilesystemType, + List( + "ext4", + ), + Requirement.recommended, + Stability.experimental + ) + + val specs: List[AttributeSpec[_]] = + List( + systemDevice, + systemFilesystemMode, + systemFilesystemMountpoint, + systemFilesystemType, + ) + } + + def create[F[_]: Meter]: F[UpDownCounter[F, Long]] = + Meter[F] + .upDownCounter[Long](name) + .withDescription(description) + .withUnit(unit) + .create + + } + + /** Reports a filesystem's space usage across different states.

    + * @note + *

    The sum of all `system.filesystem.usage` values over the different `system.filesystem.state` attributes + * SHOULD equal the total storage capacity of the filesystem, that is `system.filesystem.limit`. + */ object FilesystemUsage extends MetricSpec { val name: String = "system.filesystem.usage" - val description: String = "" + val description: String = "Reports a filesystem's space usage across different states." val unit: String = "By" val stability: Stability = Stability.experimental val attributeSpecs: List[AttributeSpec[_]] = AttributeSpecs.specs object AttributeSpecs { - /** The device identifier + /** Identifier for the device where the filesystem resides. */ val systemDevice: AttributeSpec[String] = AttributeSpec( SystemExperimentalAttributes.SystemDevice, List( - "(identifier)", + "/dev/sda", + "\network-drive", ), Requirement.recommended, Stability.experimental @@ -606,13 +731,14 @@ object SystemExperimentalMetrics { object AttributeSpecs { - /** The device identifier + /** Identifier for the device where the filesystem resides. */ val systemDevice: AttributeSpec[String] = AttributeSpec( SystemExperimentalAttributes.SystemDevice, List( - "(identifier)", + "/dev/sda", + "\network-drive", ), Requirement.recommended, Stability.experimental diff --git a/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/V8jsExperimentalMetrics.scala b/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/V8jsExperimentalMetrics.scala new file mode 100644 index 000000000..1188c1da3 --- /dev/null +++ b/semconv/metrics/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/metrics/V8jsExperimentalMetrics.scala @@ -0,0 +1,255 @@ +/* + * Copyright 2024 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s +package semconv +package experimental +package metrics + +import org.typelevel.otel4s.metrics._ +import org.typelevel.otel4s.semconv.experimental.attributes._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/templates/registry/otel4s/metrics/SemanticMetrics.scala.j2 +object V8jsExperimentalMetrics { + + val specs: List[MetricSpec] = List( + GcDuration, + HeapSpaceAvailableSize, + HeapSpacePhysicalSize, + MemoryHeapLimit, + MemoryHeapUsed, + ) + + /** Garbage collection duration.

    + * @note + *

    The values can be retrieve from `perf_hooks.PerformanceObserver(...).observe({ + * entryTypes: ['gc'] })` + */ + object GcDuration extends MetricSpec { + + val name: String = "v8js.gc.duration" + val description: String = "Garbage collection duration." + val unit: String = "s" + val stability: Stability = Stability.experimental + val attributeSpecs: List[AttributeSpec[_]] = AttributeSpecs.specs + + object AttributeSpecs { + + /** The type of garbage collection. + */ + val v8jsGcType: AttributeSpec[String] = + AttributeSpec( + V8jsExperimentalAttributes.V8jsGcType, + List( + ), + Requirement.required, + Stability.experimental + ) + + val specs: List[AttributeSpec[_]] = + List( + v8jsGcType, + ) + } + + def create[F[_]: Meter](boundaries: BucketBoundaries): F[Histogram[F, Double]] = + Meter[F] + .histogram[Double](name) + .withDescription(description) + .withUnit(unit) + .withExplicitBucketBoundaries(boundaries) + .create + + } + + /** Heap space available size.

    + * @note + *

    Value can be retrieved from value `space_available_size` of `v8.getHeapSpaceStatistics()` + */ + object HeapSpaceAvailableSize extends MetricSpec { + + val name: String = "v8js.heap.space.available_size" + val description: String = "Heap space available size." + val unit: String = "By" + val stability: Stability = Stability.experimental + val attributeSpecs: List[AttributeSpec[_]] = AttributeSpecs.specs + + object AttributeSpecs { + + /** The name of the space type of heap memory.

    + * @note + *

    Value can be retrieved from value `space_name` of `v8.getHeapSpaceStatistics()` + */ + val v8jsHeapSpaceName: AttributeSpec[String] = + AttributeSpec( + V8jsExperimentalAttributes.V8jsHeapSpaceName, + List( + ), + Requirement.required, + Stability.experimental + ) + + val specs: List[AttributeSpec[_]] = + List( + v8jsHeapSpaceName, + ) + } + + def create[F[_]: Meter]: F[UpDownCounter[F, Long]] = + Meter[F] + .upDownCounter[Long](name) + .withDescription(description) + .withUnit(unit) + .create + + } + + /** Committed size of a heap space.

    + * @note + *

    Value can be retrieved from value `physical_space_size` of `v8.getHeapSpaceStatistics()` + */ + object HeapSpacePhysicalSize extends MetricSpec { + + val name: String = "v8js.heap.space.physical_size" + val description: String = "Committed size of a heap space." + val unit: String = "By" + val stability: Stability = Stability.experimental + val attributeSpecs: List[AttributeSpec[_]] = AttributeSpecs.specs + + object AttributeSpecs { + + /** The name of the space type of heap memory.

    + * @note + *

    Value can be retrieved from value `space_name` of `v8.getHeapSpaceStatistics()` + */ + val v8jsHeapSpaceName: AttributeSpec[String] = + AttributeSpec( + V8jsExperimentalAttributes.V8jsHeapSpaceName, + List( + ), + Requirement.required, + Stability.experimental + ) + + val specs: List[AttributeSpec[_]] = + List( + v8jsHeapSpaceName, + ) + } + + def create[F[_]: Meter]: F[UpDownCounter[F, Long]] = + Meter[F] + .upDownCounter[Long](name) + .withDescription(description) + .withUnit(unit) + .create + + } + + /** Total heap memory size pre-allocated.

    + * @note + *

    The value can be retrieved from value `space_size` of `v8.getHeapSpaceStatistics()` + */ + object MemoryHeapLimit extends MetricSpec { + + val name: String = "v8js.memory.heap.limit" + val description: String = "Total heap memory size pre-allocated." + val unit: String = "By" + val stability: Stability = Stability.experimental + val attributeSpecs: List[AttributeSpec[_]] = AttributeSpecs.specs + + object AttributeSpecs { + + /** The name of the space type of heap memory.

    + * @note + *

    Value can be retrieved from value `space_name` of `v8.getHeapSpaceStatistics()` + */ + val v8jsHeapSpaceName: AttributeSpec[String] = + AttributeSpec( + V8jsExperimentalAttributes.V8jsHeapSpaceName, + List( + ), + Requirement.required, + Stability.experimental + ) + + val specs: List[AttributeSpec[_]] = + List( + v8jsHeapSpaceName, + ) + } + + def create[F[_]: Meter]: F[UpDownCounter[F, Long]] = + Meter[F] + .upDownCounter[Long](name) + .withDescription(description) + .withUnit(unit) + .create + + } + + /** Heap Memory size allocated.

    + * @note + *

    The value can be retrieved from value `space_used_size` of `v8.getHeapSpaceStatistics()` + */ + object MemoryHeapUsed extends MetricSpec { + + val name: String = "v8js.memory.heap.used" + val description: String = "Heap Memory size allocated." + val unit: String = "By" + val stability: Stability = Stability.experimental + val attributeSpecs: List[AttributeSpec[_]] = AttributeSpecs.specs + + object AttributeSpecs { + + /** The name of the space type of heap memory.

    + * @note + *

    Value can be retrieved from value `space_name` of `v8.getHeapSpaceStatistics()` + */ + val v8jsHeapSpaceName: AttributeSpec[String] = + AttributeSpec( + V8jsExperimentalAttributes.V8jsHeapSpaceName, + List( + ), + Requirement.required, + Stability.experimental + ) + + val specs: List[AttributeSpec[_]] = + List( + v8jsHeapSpaceName, + ) + } + + def create[F[_]: Meter]: F[UpDownCounter[F, Long]] = + Meter[F] + .upDownCounter[Long](name) + .withDescription(description) + .withUnit(unit) + .create + + } + +} diff --git a/semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/SchemaUrls.scala b/semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/SchemaUrls.scala index b828b039e..302fca1b3 100644 --- a/semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/SchemaUrls.scala +++ b/semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/SchemaUrls.scala @@ -18,9 +18,10 @@ package org.typelevel.otel4s.semconv object SchemaUrls { + val V1_28_0: String = "https://opentelemetry.io/schemas/1.28.0" val V1_27_0: String = "https://opentelemetry.io/schemas/1.27.0" val V1_26_0: String = "https://opentelemetry.io/schemas/1.26.0" - private[otel4s] val Current: String = V1_27_0 + private[otel4s] val Current: String = V1_28_0 }