From 6603c3a0f10ed907b33979443d0423306fa208e6 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Tue, 28 Jan 2025 22:55:47 +0100 Subject: [PATCH] Upgrade semantic conventions to 1.30 (#3258) --- .../semconv/exception_attributes.h | 20 +- .../semconv/incubating/artifact_attributes.h | 6 +- .../semconv/incubating/aws_attributes.h | 9 +- .../semconv/incubating/azure_attributes.h | 110 ++ .../semconv/incubating/azure_metrics.h | 97 ++ .../semconv/incubating/cassandra_attributes.h | 116 ++ .../semconv/incubating/cicd_attributes.h | 96 ++ .../semconv/incubating/cicd_metrics.h | 213 ++++ .../semconv/incubating/cloud_attributes.h | 15 + .../semconv/incubating/code_attributes.h | 48 +- .../semconv/incubating/db_attributes.h | 347 ++++- .../semconv/incubating/db_metrics.h | 30 +- .../incubating/elasticsearch_attributes.h | 29 + .../semconv/incubating/event_attributes.h | 7 +- .../semconv/incubating/exception_attributes.h | 20 +- .../semconv/incubating/faas_attributes.h | 6 +- .../semconv/incubating/gen_ai_attributes.h | 54 +- .../semconv/incubating/k8s_attributes.h | 49 +- .../semconv/incubating/k8s_metrics.h | 1118 +++++++++++++++++ .../semconv/incubating/network_attributes.h | 67 + .../semconv/incubating/process_attributes.h | 2 +- .../semconv/incubating/profile_attributes.h | 5 + .../semconv/incubating/rpc_attributes.h | 6 +- .../incubating/security_rule_attributes.h | 69 + .../semconv/incubating/system_attributes.h | 6 +- .../semconv/incubating/system_metrics.h | 9 +- .../semconv/incubating/url_attributes.h | 2 + .../semconv/incubating/vcs_attributes.h | 66 +- .../semconv/incubating/vcs_metrics.h | 57 +- .../semconv/network_attributes.h | 5 - .../opentelemetry/semconv/schema_url.h | 2 +- .../opentelemetry/semconv/url_attributes.h | 2 + buildscripts/semantic-convention/generate.sh | 4 +- 33 files changed, 2534 insertions(+), 158 deletions(-) create mode 100644 api/include/opentelemetry/semconv/incubating/azure_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/azure_metrics.h create mode 100644 api/include/opentelemetry/semconv/incubating/cassandra_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/cicd_metrics.h create mode 100644 api/include/opentelemetry/semconv/incubating/elasticsearch_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/security_rule_attributes.h diff --git a/api/include/opentelemetry/semconv/exception_attributes.h b/api/include/opentelemetry/semconv/exception_attributes.h index fdc19ac6d0..1ad6988833 100644 --- a/api/include/opentelemetry/semconv/exception_attributes.h +++ b/api/include/opentelemetry/semconv/exception_attributes.h @@ -20,21 +20,13 @@ namespace exception { /** - * SHOULD be set to true if the exception event is recorded at a point where it is known that the - * exception is escaping the scope of the span.

An exception is considered to have escaped (or - * left) the scope of a span, if that span is ended while the exception is still logically "in - * flight". This may be actually "in flight" in some languages (e.g. if the exception is passed to a - * Context manager's @code __exit__ @endcode method in Python) but will usually be caught at the - * point of recording the exception in most languages.

It is usually not possible to determine - * at the point where an exception is thrown whether it will escape the scope of a span. However, it - * is trivial to know that an exception will escape, if one checks for an active exception just - * before ending the span, as done in the example - * for recording span exceptions.

It follows that an exception may still escape the scope of - * the span even if the @code exception.escaped @endcode attribute was not set or set to false, - * since the event might have been recorded at a time where it was not - * clear whether the exception will escape. + * Indicates that the exception is escaping the scope of the span. + *

+ * @deprecated + * It's no longer recommended to record exceptions that are handled and do not escape the scope of a + * span. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kExceptionEscaped = "exception.escaped"; /** diff --git a/api/include/opentelemetry/semconv/incubating/artifact_attributes.h b/api/include/opentelemetry/semconv/incubating/artifact_attributes.h index d3bb99f6e5..9d52c9bb38 100644 --- a/api/include/opentelemetry/semconv/incubating/artifact_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/artifact_attributes.h @@ -29,9 +29,9 @@ static constexpr const char *kArtifactAttestationFilename = "artifact.attestatio /** * The full hash value (see - * glossary), of the built attestation. Some envelopes in the software attestation space also - * refer to this as the digest. + * glossary), of the built attestation. Some envelopes in the software attestation space also + * refer to this as the digest. */ static constexpr const char *kArtifactAttestationHash = "artifact.attestation.hash"; diff --git a/api/include/opentelemetry/semconv/incubating/aws_attributes.h b/api/include/opentelemetry/semconv/incubating/aws_attributes.h index b17493879f..9544844e9c 100644 --- a/api/include/opentelemetry/semconv/incubating/aws_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/aws_attributes.h @@ -186,6 +186,11 @@ static constexpr const char *kAwsEcsTaskRevision = "aws.ecs.task.revision"; */ static constexpr const char *kAwsEksClusterArn = "aws.eks.cluster.arn"; +/** + * The AWS extended request ID as returned in the response header @code x-amz-id-2 @endcode. + */ +static constexpr const char *kAwsExtendedRequestId = "aws.extended_request_id"; + /** * The full invoked ARN as provided on the @code Context @endcode passed to the function (@code * Lambda-Runtime-Invoked-Function-Arn @endcode header on the @code /runtime/invocation/next @@ -227,8 +232,8 @@ static constexpr const char *kAwsLogStreamArns = "aws.log.stream.arns"; static constexpr const char *kAwsLogStreamNames = "aws.log.stream.names"; /** - * The AWS request ID as returned in the response headers @code x-amz-request-id @endcode or @code - * x-amz-requestid @endcode. + * The AWS request ID as returned in the response headers @code x-amzn-requestid @endcode, @code + * x-amzn-request-id @endcode or @code x-amz-request-id @endcode. */ static constexpr const char *kAwsRequestId = "aws.request_id"; diff --git a/api/include/opentelemetry/semconv/incubating/azure_attributes.h b/api/include/opentelemetry/semconv/incubating/azure_attributes.h new file mode 100644 index 0000000000..529265efe1 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/azure_attributes.h @@ -0,0 +1,110 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace azure +{ + +/** + * The unique identifier of the client instance. + */ +static constexpr const char *kAzureClientId = "azure.client.id"; + +/** + * Cosmos client connection mode. + */ +static constexpr const char *kAzureCosmosdbConnectionMode = "azure.cosmosdb.connection.mode"; + +/** + * Account or request consistency level. + */ +static constexpr const char *kAzureCosmosdbConsistencyLevel = "azure.cosmosdb.consistency.level"; + +/** + * List of regions contacted during operation in the order that they were contacted. If there is + * more than one region listed, it indicates that the operation was performed on multiple regions + * i.e. cross-regional call.

Region name matches the format of @code displayName @endcode in Azure + * Location API + */ +static constexpr const char *kAzureCosmosdbOperationContactedRegions = + "azure.cosmosdb.operation.contacted_regions"; + +/** + * The number of request units consumed by the operation. + */ +static constexpr const char *kAzureCosmosdbOperationRequestCharge = + "azure.cosmosdb.operation.request_charge"; + +/** + * Request payload size in bytes. + */ +static constexpr const char *kAzureCosmosdbRequestBodySize = "azure.cosmosdb.request.body.size"; + +/** + * Cosmos DB sub status code. + */ +static constexpr const char *kAzureCosmosdbResponseSubStatusCode = + "azure.cosmosdb.response.sub_status_code"; + +namespace AzureCosmosdbConnectionModeValues +{ +/** + * Gateway (HTTP) connection. + */ +static constexpr const char *kGateway = "gateway"; + +/** + * Direct connection. + */ +static constexpr const char *kDirect = "direct"; + +} // namespace AzureCosmosdbConnectionModeValues + +namespace AzureCosmosdbConsistencyLevelValues +{ +/** + * none + */ +static constexpr const char *kStrong = "Strong"; + +/** + * none + */ +static constexpr const char *kBoundedStaleness = "BoundedStaleness"; + +/** + * none + */ +static constexpr const char *kSession = "Session"; + +/** + * none + */ +static constexpr const char *kEventual = "Eventual"; + +/** + * none + */ +static constexpr const char *kConsistentPrefix = "ConsistentPrefix"; + +} // namespace AzureCosmosdbConsistencyLevelValues + +} // namespace azure +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/azure_metrics.h b/api/include/opentelemetry/semconv/incubating/azure_metrics.h new file mode 100644 index 0000000000..63f4556b0b --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/azure_metrics.h @@ -0,0 +1,97 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/metrics/meter.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace azure +{ + +/** + * Number of active client instances + *

+ * updowncounter + */ +static constexpr const char *kMetricAzureCosmosdbClientActiveInstanceCount = + "azure.cosmosdb.client.active_instance.count"; +static constexpr const char *descrMetricAzureCosmosdbClientActiveInstanceCount = + "Number of active client instances"; +static constexpr const char *unitMetricAzureCosmosdbClientActiveInstanceCount = "{instance}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricAzureCosmosdbClientActiveInstanceCount(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricAzureCosmosdbClientActiveInstanceCount, + descrMetricAzureCosmosdbClientActiveInstanceCount, + unitMetricAzureCosmosdbClientActiveInstanceCount); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricAzureCosmosdbClientActiveInstanceCount(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricAzureCosmosdbClientActiveInstanceCount, + descrMetricAzureCosmosdbClientActiveInstanceCount, + unitMetricAzureCosmosdbClientActiveInstanceCount); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricAzureCosmosdbClientActiveInstanceCount(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter( + kMetricAzureCosmosdbClientActiveInstanceCount, + descrMetricAzureCosmosdbClientActiveInstanceCount, + unitMetricAzureCosmosdbClientActiveInstanceCount); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricAzureCosmosdbClientActiveInstanceCount(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter( + kMetricAzureCosmosdbClientActiveInstanceCount, + descrMetricAzureCosmosdbClientActiveInstanceCount, + unitMetricAzureCosmosdbClientActiveInstanceCount); +} + +/** + * Request units consumed by + * the operation

histogram + */ +static constexpr const char *kMetricAzureCosmosdbClientOperationRequestCharge = + "azure.cosmosdb.client.operation.request_charge"; +static constexpr const char *descrMetricAzureCosmosdbClientOperationRequestCharge = + "[Request units](https://learn.microsoft.com/azure/cosmos-db/request-units) consumed by the " + "operation"; +static constexpr const char *unitMetricAzureCosmosdbClientOperationRequestCharge = "{request_unit}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricAzureCosmosdbClientOperationRequestCharge(metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricAzureCosmosdbClientOperationRequestCharge, + descrMetricAzureCosmosdbClientOperationRequestCharge, + unitMetricAzureCosmosdbClientOperationRequestCharge); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricAzureCosmosdbClientOperationRequestCharge(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricAzureCosmosdbClientOperationRequestCharge, + descrMetricAzureCosmosdbClientOperationRequestCharge, + unitMetricAzureCosmosdbClientOperationRequestCharge); +} + +} // namespace azure +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/cassandra_attributes.h b/api/include/opentelemetry/semconv/incubating/cassandra_attributes.h new file mode 100644 index 0000000000..8e3d38c8db --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/cassandra_attributes.h @@ -0,0 +1,116 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace cassandra +{ + +/** + * The consistency level of the query. Based on consistency values from CQL. + */ +static constexpr const char *kCassandraConsistencyLevel = "cassandra.consistency.level"; + +/** + * The data center of the coordinating node for a query. + */ +static constexpr const char *kCassandraCoordinatorDc = "cassandra.coordinator.dc"; + +/** + * The ID of the coordinating node for a query. + */ +static constexpr const char *kCassandraCoordinatorId = "cassandra.coordinator.id"; + +/** + * The fetch size used for paging, i.e. how many rows will be returned at once. + */ +static constexpr const char *kCassandraPageSize = "cassandra.page.size"; + +/** + * Whether or not the query is idempotent. + */ +static constexpr const char *kCassandraQueryIdempotent = "cassandra.query.idempotent"; + +/** + * The number of times a query was speculatively executed. Not set or @code 0 @endcode if the query + * was not executed speculatively. + */ +static constexpr const char *kCassandraSpeculativeExecutionCount = + "cassandra.speculative_execution.count"; + +namespace CassandraConsistencyLevelValues +{ +/** + * none + */ +static constexpr const char *kAll = "all"; + +/** + * none + */ +static constexpr const char *kEachQuorum = "each_quorum"; + +/** + * none + */ +static constexpr const char *kQuorum = "quorum"; + +/** + * none + */ +static constexpr const char *kLocalQuorum = "local_quorum"; + +/** + * none + */ +static constexpr const char *kOne = "one"; + +/** + * none + */ +static constexpr const char *kTwo = "two"; + +/** + * none + */ +static constexpr const char *kThree = "three"; + +/** + * none + */ +static constexpr const char *kLocalOne = "local_one"; + +/** + * none + */ +static constexpr const char *kAny = "any"; + +/** + * none + */ +static constexpr const char *kSerial = "serial"; + +/** + * none + */ +static constexpr const char *kLocalSerial = "local_serial"; + +} // namespace CassandraConsistencyLevelValues + +} // namespace cassandra +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/cicd_attributes.h b/api/include/opentelemetry/semconv/incubating/cicd_attributes.h index 622de977ce..d6c3ee6aba 100644 --- a/api/include/opentelemetry/semconv/incubating/cicd_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/cicd_attributes.h @@ -24,11 +24,21 @@ namespace cicd */ static constexpr const char *kCicdPipelineName = "cicd.pipeline.name"; +/** + * The result of a pipeline run. + */ +static constexpr const char *kCicdPipelineResult = "cicd.pipeline.result"; + /** * The unique identifier of a pipeline run within a CI/CD system. */ static constexpr const char *kCicdPipelineRunId = "cicd.pipeline.run.id"; +/** + * The pipeline run goes through these states during its lifecycle. + */ +static constexpr const char *kCicdPipelineRunState = "cicd.pipeline.run.state"; + /** * The human readable name of a task within a pipeline. Task here most closely aligns with a computing process in a pipeline. Other @@ -52,6 +62,72 @@ static constexpr const char *kCicdPipelineTaskRunUrlFull = "cicd.pipeline.task.r */ static constexpr const char *kCicdPipelineTaskType = "cicd.pipeline.task.type"; +/** + * The name of a component of the CICD system. + */ +static constexpr const char *kCicdSystemComponent = "cicd.system.component"; + +/** + * The state of a CICD worker / agent. + */ +static constexpr const char *kCicdWorkerState = "cicd.worker.state"; + +namespace CicdPipelineResultValues +{ +/** + * The pipeline run finished successfully. + */ +static constexpr const char *kSuccess = "success"; + +/** + * The pipeline run did not finish successfully, eg. due to a compile error or a failing test. Such + * failures are usually detected by non-zero exit codes of the tools executed in the pipeline run. + */ +static constexpr const char *kFailure = "failure"; + +/** + * The pipeline run failed due to an error in the CICD system, eg. due to the worker being killed. + */ +static constexpr const char *kError = "error"; + +/** + * A timeout caused the pipeline run to be interrupted. + */ +static constexpr const char *kTimeout = "timeout"; + +/** + * The pipeline run was cancelled, eg. by a user manually cancelling the pipeline run. + */ +static constexpr const char *kCancellation = "cancellation"; + +/** + * The pipeline run was skipped, eg. due to a precondition not being met. + */ +static constexpr const char *kSkip = "skip"; + +} // namespace CicdPipelineResultValues + +namespace CicdPipelineRunStateValues +{ +/** + * The run pending state spans from the event triggering the pipeline run until the execution of the + * run starts (eg. time spent in a queue, provisioning agents, creating run resources). + */ +static constexpr const char *kPending = "pending"; + +/** + * The executing state spans the execution of any run tasks (eg. build, test). + */ +static constexpr const char *kExecuting = "executing"; + +/** + * The finalizing state spans from when the run has finished executing (eg. cleanup of run + * resources). + */ +static constexpr const char *kFinalizing = "finalizing"; + +} // namespace CicdPipelineRunStateValues + namespace CicdPipelineTaskTypeValues { /** @@ -71,6 +147,26 @@ static constexpr const char *kDeploy = "deploy"; } // namespace CicdPipelineTaskTypeValues +namespace CicdWorkerStateValues +{ +/** + * The worker is not performing work for the CICD system. It is available to the CICD system to + * perform work on (online / idle). + */ +static constexpr const char *kAvailable = "available"; + +/** + * The worker is performing work for the CICD system. + */ +static constexpr const char *kBusy = "busy"; + +/** + * The worker is not available to the CICD system (disconnected / down). + */ +static constexpr const char *kOffline = "offline"; + +} // namespace CicdWorkerStateValues + } // namespace cicd } // namespace semconv OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/cicd_metrics.h b/api/include/opentelemetry/semconv/incubating/cicd_metrics.h new file mode 100644 index 0000000000..993c2636f4 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/cicd_metrics.h @@ -0,0 +1,213 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/metrics/meter.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace cicd +{ + +/** + * The number of pipeline runs currently active in the system by state. + *

+ * updowncounter + */ +static constexpr const char *kMetricCicdPipelineRunActive = "cicd.pipeline.run.active"; +static constexpr const char *descrMetricCicdPipelineRunActive = + "The number of pipeline runs currently active in the system by state."; +static constexpr const char *unitMetricCicdPipelineRunActive = "{run}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricCicdPipelineRunActive(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricCicdPipelineRunActive, + descrMetricCicdPipelineRunActive, + unitMetricCicdPipelineRunActive); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricCicdPipelineRunActive(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricCicdPipelineRunActive, + descrMetricCicdPipelineRunActive, + unitMetricCicdPipelineRunActive); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricCicdPipelineRunActive(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricCicdPipelineRunActive, + descrMetricCicdPipelineRunActive, + unitMetricCicdPipelineRunActive); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricCicdPipelineRunActive(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricCicdPipelineRunActive, + descrMetricCicdPipelineRunActive, + unitMetricCicdPipelineRunActive); +} + +/** + * Duration of a pipeline run grouped by pipeline, state and result. + *

+ * histogram + */ +static constexpr const char *kMetricCicdPipelineRunDuration = "cicd.pipeline.run.duration"; +static constexpr const char *descrMetricCicdPipelineRunDuration = + "Duration of a pipeline run grouped by pipeline, state and result."; +static constexpr const char *unitMetricCicdPipelineRunDuration = "s"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricCicdPipelineRunDuration(metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricCicdPipelineRunDuration, + descrMetricCicdPipelineRunDuration, + unitMetricCicdPipelineRunDuration); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricCicdPipelineRunDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricCicdPipelineRunDuration, + descrMetricCicdPipelineRunDuration, + unitMetricCicdPipelineRunDuration); +} + +/** + * The number of errors encountered in pipeline runs (eg. compile, test failures). + *

+ * There might be errors in a pipeline run that are non fatal (eg. they are suppressed) or in a + * parallel stage multiple stages could have a fatal error. This means that this error count might + * not be the same as the count of metric @code cicd.pipeline.run.duration @endcode with run result + * @code failure @endcode.

counter + */ +static constexpr const char *kMetricCicdPipelineRunErrors = "cicd.pipeline.run.errors"; +static constexpr const char *descrMetricCicdPipelineRunErrors = + "The number of errors encountered in pipeline runs (eg. compile, test failures)."; +static constexpr const char *unitMetricCicdPipelineRunErrors = "{error}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricCicdPipelineRunErrors(metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricCicdPipelineRunErrors, descrMetricCicdPipelineRunErrors, + unitMetricCicdPipelineRunErrors); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricCicdPipelineRunErrors(metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricCicdPipelineRunErrors, descrMetricCicdPipelineRunErrors, + unitMetricCicdPipelineRunErrors); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricCicdPipelineRunErrors(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricCicdPipelineRunErrors, + descrMetricCicdPipelineRunErrors, + unitMetricCicdPipelineRunErrors); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricCicdPipelineRunErrors(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricCicdPipelineRunErrors, + descrMetricCicdPipelineRunErrors, + unitMetricCicdPipelineRunErrors); +} + +/** + * The number of errors in a component of the CICD system (eg. controller, scheduler, agent). + *

+ * Errors in pipeline run execution are explicitly excluded. Ie a test failure is not counted in + * this metric.

counter + */ +static constexpr const char *kMetricCicdSystemErrors = "cicd.system.errors"; +static constexpr const char *descrMetricCicdSystemErrors = + "The number of errors in a component of the CICD system (eg. controller, scheduler, agent)."; +static constexpr const char *unitMetricCicdSystemErrors = "{error}"; + +static inline nostd::unique_ptr> CreateSyncInt64MetricCicdSystemErrors( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricCicdSystemErrors, descrMetricCicdSystemErrors, + unitMetricCicdSystemErrors); +} + +static inline nostd::unique_ptr> CreateSyncDoubleMetricCicdSystemErrors( + metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricCicdSystemErrors, descrMetricCicdSystemErrors, + unitMetricCicdSystemErrors); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricCicdSystemErrors(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricCicdSystemErrors, descrMetricCicdSystemErrors, + unitMetricCicdSystemErrors); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricCicdSystemErrors(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricCicdSystemErrors, descrMetricCicdSystemErrors, + unitMetricCicdSystemErrors); +} + +/** + * The number of workers on the CICD system by state. + *

+ * updowncounter + */ +static constexpr const char *kMetricCicdWorkerCount = "cicd.worker.count"; +static constexpr const char *descrMetricCicdWorkerCount = + "The number of workers on the CICD system by state."; +static constexpr const char *unitMetricCicdWorkerCount = "{count}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricCicdWorkerCount(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricCicdWorkerCount, descrMetricCicdWorkerCount, + unitMetricCicdWorkerCount); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricCicdWorkerCount(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricCicdWorkerCount, descrMetricCicdWorkerCount, + unitMetricCicdWorkerCount); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricCicdWorkerCount(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter( + kMetricCicdWorkerCount, descrMetricCicdWorkerCount, unitMetricCicdWorkerCount); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricCicdWorkerCount(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter( + kMetricCicdWorkerCount, descrMetricCicdWorkerCount, unitMetricCicdWorkerCount); +} + +} // namespace cicd +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/cloud_attributes.h b/api/include/opentelemetry/semconv/incubating/cloud_attributes.h index d7a1fe14d0..00f58969d6 100644 --- a/api/include/opentelemetry/semconv/incubating/cloud_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/cloud_attributes.h @@ -211,6 +211,16 @@ static constexpr const char *kGcpOpenshift = "gcp_openshift"; */ static constexpr const char *kIbmCloudOpenshift = "ibm_cloud_openshift"; +/** + * Compute on Oracle Cloud Infrastructure (OCI) + */ +static constexpr const char *kOracleCloudCompute = "oracle_cloud_compute"; + +/** + * Kubernetes Engine (OKE) on Oracle Cloud Infrastructure (OCI) + */ +static constexpr const char *kOracleCloudOke = "oracle_cloud_oke"; + /** * Tencent Cloud Cloud Virtual Machine (CVM) */ @@ -260,6 +270,11 @@ static constexpr const char *kHeroku = "heroku"; */ static constexpr const char *kIbmCloud = "ibm_cloud"; +/** + * Oracle Cloud Infrastructure (OCI) + */ +static constexpr const char *kOracleCloud = "oracle_cloud"; + /** * Tencent Cloud */ diff --git a/api/include/opentelemetry/semconv/incubating/code_attributes.h b/api/include/opentelemetry/semconv/incubating/code_attributes.h index f2715e87b6..de30e49dfc 100644 --- a/api/include/opentelemetry/semconv/incubating/code_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/code_attributes.h @@ -20,32 +20,64 @@ namespace code { /** - * The column number in @code code.filepath @endcode best representing the operation. It SHOULD - * point within the code unit named in @code code.function @endcode. + * Deprecated, use @code code.column.number @endcode + *

+ * @deprecated + * Replaced by @code code.column.number @endcode */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kCodeColumn = "code.column"; +/** + * The column number in @code code.file.path @endcode best representing the operation. It SHOULD + * point within the code unit named in @code code.function.name @endcode. + */ +static constexpr const char *kCodeColumnNumber = "code.column.number"; + /** * The source code file name that identifies the code unit as uniquely as possible (preferably an * absolute file path). */ +static constexpr const char *kCodeFilePath = "code.file.path"; + +/** + * Deprecated, use @code code.file.path @endcode instead + */ static constexpr const char *kCodeFilepath = "code.filepath"; /** - * The method or function name, or equivalent (usually rightmost part of the code unit's name). + * Deprecated, use @code code.function.name @endcode instead + *

+ * @deprecated + * Replaced by @code code.function.name @endcode */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kCodeFunction = "code.function"; /** - * The line number in @code code.filepath @endcode best representing the operation. It SHOULD point - * within the code unit named in @code code.function @endcode. + * The method or function name, or equivalent (usually rightmost part of the code unit's name). + */ +static constexpr const char *kCodeFunctionName = "code.function.name"; + +/** + * The line number in @code code.file.path @endcode best representing the operation. It SHOULD point + * within the code unit named in @code code.function.name @endcode. + */ +static constexpr const char *kCodeLineNumber = "code.line.number"; + +/** + * Deprecated, use @code code.line.number @endcode instead + *

+ * @deprecated + * Replaced by @code code.line.number @endcode */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kCodeLineno = "code.lineno"; /** - * The "namespace" within which @code code.function @endcode is defined. Usually the qualified class - * or module name, such that @code code.namespace @endcode + some separator + @code code.function - * @endcode form a unique identifier for the code unit. + * The "namespace" within which @code code.function.name @endcode is defined. Usually the qualified + * class or module name, such that @code code.namespace @endcode + some separator + @code + * code.function.name @endcode form a unique identifier for the code unit. */ static constexpr const char *kCodeNamespace = "code.namespace"; diff --git a/api/include/opentelemetry/semconv/incubating/db_attributes.h b/api/include/opentelemetry/semconv/incubating/db_attributes.h index 22148fed13..b85e508940 100644 --- a/api/include/opentelemetry/semconv/incubating/db_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/db_attributes.h @@ -20,35 +20,57 @@ namespace db { /** - * The consistency level of the query. Based on consistency values from CQL. + * Deprecated, use @code cassandra.consistency.level @endcode instead. + *

+ * @deprecated + * Replaced by @code cassandra.consistency.level @endcode. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kDbCassandraConsistencyLevel = "db.cassandra.consistency_level"; /** - * The data center of the coordinating node for a query. + * Deprecated, use @code cassandra.coordinator.dc @endcode instead. + *

+ * @deprecated + * Replaced by @code cassandra.coordinator.dc @endcode. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kDbCassandraCoordinatorDc = "db.cassandra.coordinator.dc"; /** - * The ID of the coordinating node for a query. + * Deprecated, use @code cassandra.coordinator.id @endcode instead. + *

+ * @deprecated + * Replaced by @code cassandra.coordinator.id @endcode. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kDbCassandraCoordinatorId = "db.cassandra.coordinator.id"; /** - * Whether or not the query is idempotent. + * Deprecated, use @code cassandra.query.idempotent @endcode instead. + *

+ * @deprecated + * Replaced by @code cassandra.query.idempotent @endcode. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kDbCassandraIdempotence = "db.cassandra.idempotence"; /** - * The fetch size used for paging, i.e. how many rows will be returned at once. + * Deprecated, use @code cassandra.page.size @endcode instead. + *

+ * @deprecated + * Replaced by @code cassandra.page.size @endcode. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kDbCassandraPageSize = "db.cassandra.page_size"; /** - * The number of times a query was speculatively executed. Not set or @code 0 @endcode if the query - * was not executed speculatively. + * Deprecated, use @code cassandra.speculative_execution.count @endcode instead. + *

+ * @deprecated + * Replaced by @code cassandra.speculative_execution.count @endcode. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kDbCassandraSpeculativeExecutionCount = "db.cassandra.speculative_execution_count"; @@ -103,8 +125,6 @@ static constexpr const char *kDbClientConnectionsState = "db.client.connections. *

* For batch operations, if the individual operations are known to have the same collection name * then that collection name SHOULD be used. - *

- * This attribute has stability level RELEASE CANDIDATE. */ static constexpr const char *kDbCollectionName = "db.collection.name"; @@ -118,19 +138,30 @@ OPENTELEMETRY_DEPRECATED static constexpr const char *kDbConnectionString = "db.connection_string"; /** - * Unique Cosmos client instance id. + * Deprecated, use @code azure.client.id @endcode instead. + *

+ * @deprecated + * Replaced by @code azure.client.id @endcode. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kDbCosmosdbClientId = "db.cosmosdb.client_id"; /** - * Cosmos client connection mode. + * Deprecated, use @code azure.cosmosdb.connection.mode @endcode instead. + *

+ * @deprecated + * Replaced by @code azure.cosmosdb.connection.mode @endcode. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kDbCosmosdbConnectionMode = "db.cosmosdb.connection_mode"; /** - * Account or request consistency level. + * Deprecated, use @code cosmosdb.consistency.level @endcode instead. + *

+ * @deprecated + * Replaced by @code azure.cosmosdb.consistency.level @endcode. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kDbCosmosdbConsistencyLevel = "db.cosmosdb.consistency_level"; /** @@ -152,22 +183,30 @@ OPENTELEMETRY_DEPRECATED static constexpr const char *kDbCosmosdbOperationType = "db.cosmosdb.operation_type"; /** - * List of regions contacted during operation in the order that they were contacted. If there is - * more than one region listed, it indicates that the operation was performed on multiple regions - * i.e. cross-regional call.

Region name matches the format of @code displayName @endcode in Azure - * Location API + * Deprecated, use @code azure.cosmosdb.operation.contacted_regions @endcode instead. + *

+ * @deprecated + * Replaced by @code azure.cosmosdb.operation.contacted_regions @endcode. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kDbCosmosdbRegionsContacted = "db.cosmosdb.regions_contacted"; /** - * Request units consumed for the operation. + * Deprecated, use @code azure.cosmosdb.operation.request_charge @endcode instead. + *

+ * @deprecated + * Replaced by @code azure.cosmosdb.operation.request_charge @endcode. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kDbCosmosdbRequestCharge = "db.cosmosdb.request_charge"; /** - * Request payload size in bytes. + * Deprecated, use @code azure.cosmosdb.request.body.size @endcode instead. + *

+ * @deprecated + * Replaced by @code azure.cosmosdb.request.body.size @endcode. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kDbCosmosdbRequestContentLength = "db.cosmosdb.request_content_length"; /** @@ -180,8 +219,12 @@ OPENTELEMETRY_DEPRECATED static constexpr const char *kDbCosmosdbStatusCode = "db.cosmosdb.status_code"; /** - * Cosmos DB sub status code. + * Deprecated, use @code azure.cosmosdb.response.sub_status_code @endcode instead. + *

+ * @deprecated + * Replaced by @code azure.cosmosdb.response.sub_status_code @endcode. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kDbCosmosdbSubStatusCode = "db.cosmosdb.sub_status_code"; /** @@ -194,19 +237,21 @@ OPENTELEMETRY_DEPRECATED static constexpr const char *kDbElasticsearchClusterName = "db.elasticsearch.cluster.name"; /** - * Represents the human-readable identifier of the node/instance to which a request was routed. + * Deprecated, use @code elasticsearch.node.name @endcode instead. + *

+ * @deprecated + * Replaced by @code elasticsearch.node.name @endcode. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kDbElasticsearchNodeName = "db.elasticsearch.node.name"; /** - * A dynamic value in the url path. + * Deprecated, use @code db.operation.parameter @endcode instead. *

- * Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in - * the format @code db.elasticsearch.path_parts. @endcode, where @code @endcode is the - * url path part name. The implementation SHOULD reference the elasticsearch - * schema in order to map the path part values to their names. + * @deprecated + * Replaced by @code db.operation.parameter @endcode. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kDbElasticsearchPathParts = "db.elasticsearch.path_parts"; /** @@ -264,8 +309,7 @@ static constexpr const char *kDbName = "db.name"; * namespaces, to ensure that "startswith" queries for the more general namespaces will be valid. * Semantic conventions for individual database systems SHOULD document what @code db.namespace * @endcode 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. This attribute has stability - * level RELEASE CANDIDATE. + * by the application without attempting to do any case normalization. */ static constexpr const char *kDbNamespace = "db.namespace"; @@ -282,8 +326,7 @@ static constexpr const char *kDbOperation = "db.operation"; * The number of queries included in a batch operation. *

* Operations are only considered batches when they contain two or more operations, and so @code - * db.operation.batch.size @endcode SHOULD never be @code 1 @endcode. This attribute has stability - * level RELEASE CANDIDATE. + * db.operation.batch.size @endcode SHOULD never be @code 1 @endcode. */ static constexpr const char *kDbOperationBatchSize = "db.operation.batch.size"; @@ -300,8 +343,6 @@ static constexpr const char *kDbOperationBatchSize = "db.operation.batch.size"; * then that operation name SHOULD be used prepended by @code BATCH @endcode, * otherwise @code db.operation.name @endcode SHOULD be @code BATCH @endcode or some other database * system specific term if more applicable. - *

- * This attribute has stability level RELEASE CANDIDATE. */ static constexpr const char *kDbOperationName = "db.operation.name"; @@ -311,7 +352,7 @@ static constexpr const char *kDbOperationName = "db.operation.name"; * name and instead is referenced only by index, then @code @endcode SHOULD be the 0-based * index. If @code db.query.text @endcode is also captured, then @code db.operation.parameter. * @endcode SHOULD match up with the parameterized placeholders present in @code db.query.text - * @endcode. This attribute has stability level RELEASE CANDIDATE. + * @endcode. */ static constexpr const char *kDbOperationParameter = "db.operation.parameter"; @@ -333,7 +374,7 @@ static constexpr const char *kDbQueryParameter = "db.query.parameter"; * instrumentation hooks or other means. If it is not available, instrumentations that support query * parsing SHOULD generate a summary following Generating - * query summary section. This attribute has stability level RELEASE CANDIDATE. + * query summary section. */ static constexpr const char *kDbQuerySummary = "db.query.summary"; @@ -348,8 +389,7 @@ static constexpr const char *kDbQuerySummary = "db.query.summary"; * 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. This attribute has stability - * level RELEASE CANDIDATE. + * the static part of the query text by default outweighs the risk. */ static constexpr const char *kDbQueryText = "db.query.text"; @@ -373,8 +413,7 @@ static constexpr const char *kDbResponseReturnedRows = "db.response.returned_row * 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 @code - * db.response.status_code @endcode means in the context of that system. This attribute has - * stability level RELEASE CANDIDATE. + * db.response.status_code @endcode means in the context of that system. */ static constexpr const char *kDbResponseStatusCode = "db.response.status_code"; @@ -396,15 +435,23 @@ static constexpr const char *kDbSqlTable = "db.sql.table"; OPENTELEMETRY_DEPRECATED static constexpr const char *kDbStatement = "db.statement"; +/** + * Deprecated, use @code db.system.name @endcode instead. + *

+ * @deprecated + * Replaced by @code db.system.name @endcode. + */ +OPENTELEMETRY_DEPRECATED +static constexpr const char *kDbSystem = "db.system"; + /** * The database management system (DBMS) product as identified by the client instrumentation. *

* 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 @code db.system @endcode is set to - * @code postgresql @endcode based on the instrumentation's best knowledge. This attribute has - * stability level RELEASE CANDIDATE. + * PostgreSQL client libraries to connect to a CockroachDB, the @code db.system.name @endcode is set + * to @code postgresql @endcode based on the instrumentation's best knowledge. */ -static constexpr const char *kDbSystem = "db.system"; +static constexpr const char *kDbSystemName = "db.system.name"; /** * Deprecated, no replacement at this time. @@ -918,6 +965,216 @@ static constexpr const char *kVertica = "vertica"; } // namespace DbSystemValues +namespace DbSystemNameValues +{ +/** + * Some other SQL database. Fallback only. + */ +static constexpr const char *kOtherSql = "other_sql"; + +/** + * Adabas (Adaptable Database System) + */ +static constexpr const char *kSoftwareagAdabas = "softwareag.adabas"; + +/** + * Actian Ingres + */ +static constexpr const char *kActianIngres = "actian.ingres"; + +/** + * Amazon DynamoDB + */ +static constexpr const char *kAwsDynamodb = "aws.dynamodb"; + +/** + * Amazon Redshift + */ +static constexpr const char *kAwsRedshift = "aws.redshift"; + +/** + * Azure Cosmos DB + */ +static constexpr const char *kAzureCosmosdb = "azure.cosmosdb"; + +/** + * InterSystems Caché + */ +static constexpr const char *kIntersystemsCache = "intersystems.cache"; + +/** + * Apache Cassandra + */ +static constexpr const char *kCassandra = "cassandra"; + +/** + * ClickHouse + */ +static constexpr const char *kClickhouse = "clickhouse"; + +/** + * CockroachDB + */ +static constexpr const char *kCockroachdb = "cockroachdb"; + +/** + * Couchbase + */ +static constexpr const char *kCouchbase = "couchbase"; + +/** + * Apache CouchDB + */ +static constexpr const char *kCouchdb = "couchdb"; + +/** + * Apache Derby + */ +static constexpr const char *kDerby = "derby"; + +/** + * Elasticsearch + */ +static constexpr const char *kElasticsearch = "elasticsearch"; + +/** + * Firebird + */ +static constexpr const char *kFirebirdsql = "firebirdsql"; + +/** + * Google Cloud Spanner + */ +static constexpr const char *kGcpSpanner = "gcp.spanner"; + +/** + * Apache Geode + */ +static constexpr const char *kGeode = "geode"; + +/** + * H2 Database + */ +static constexpr const char *kH2database = "h2database"; + +/** + * Apache HBase + */ +static constexpr const char *kHbase = "hbase"; + +/** + * Apache Hive + */ +static constexpr const char *kHive = "hive"; + +/** + * HyperSQL Database + */ +static constexpr const char *kHsqldb = "hsqldb"; + +/** + * IBM Db2 + */ +static constexpr const char *kIbmDb2 = "ibm.db2"; + +/** + * IBM Informix + */ +static constexpr const char *kIbmInformix = "ibm.informix"; + +/** + * IBM Netezza + */ +static constexpr const char *kIbmNetezza = "ibm.netezza"; + +/** + * InfluxDB + */ +static constexpr const char *kInfluxdb = "influxdb"; + +/** + * Instant + */ +static constexpr const char *kInstantdb = "instantdb"; + +/** + * MariaDB + */ +static constexpr const char *kMariadb = "mariadb"; + +/** + * Memcached + */ +static constexpr const char *kMemcached = "memcached"; + +/** + * MongoDB + */ +static constexpr const char *kMongodb = "mongodb"; + +/** + * Microsoft SQL Server + */ +static constexpr const char *kMicrosoftSqlServer = "microsoft.sql_server"; + +/** + * MySQL + */ +static constexpr const char *kMysql = "mysql"; + +/** + * Neo4j + */ +static constexpr const char *kNeo4j = "neo4j"; + +/** + * OpenSearch + */ +static constexpr const char *kOpensearch = "opensearch"; + +/** + * Oracle Database + */ +static constexpr const char *kOracleDb = "oracle.db"; + +/** + * PostgreSQL + */ +static constexpr const char *kPostgresql = "postgresql"; + +/** + * Redis + */ +static constexpr const char *kRedis = "redis"; + +/** + * SAP + * HANA + */ +static constexpr const char *kSapHana = "sap.hana"; + +/** + * SAP MaxDB + */ +static constexpr const char *kSapMaxdb = "sap.maxdb"; + +/** + * SQLite + */ +static constexpr const char *kSqlite = "sqlite"; + +/** + * Teradata + */ +static constexpr const char *kTeradata = "teradata"; + +/** + * Trino + */ +static constexpr const char *kTrino = "trino"; + +} // namespace DbSystemNameValues + } // namespace db } // namespace semconv OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/db_metrics.h b/api/include/opentelemetry/semconv/incubating/db_metrics.h index 991a7cfd88..643b5cf403 100644 --- a/api/include/opentelemetry/semconv/incubating/db_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/db_metrics.h @@ -769,16 +769,23 @@ CreateSyncDoubleMetricDbClientConnectionsWaitTime(metrics::Meter *meter) } /** - * Number of active client instances + * Deprecated, use @code azure.cosmosdb.client.active_instance.count @endcode instead. + *

+ * @deprecated + * Replaced by @code azure.cosmosdb.client.active_instance.count @endcode. *

* updowncounter */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricDbClientCosmosdbActiveInstanceCount = "db.client.cosmosdb.active_instance.count"; +OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricDbClientCosmosdbActiveInstanceCount = - "Number of active client instances"; + "Deprecated, use `azure.cosmosdb.client.active_instance.count` instead."; +OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricDbClientCosmosdbActiveInstanceCount = "{instance}"; +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncInt64MetricDbClientCosmosdbActiveInstanceCount(metrics::Meter *meter) { @@ -787,6 +794,7 @@ CreateSyncInt64MetricDbClientCosmosdbActiveInstanceCount(metrics::Meter *meter) unitMetricDbClientCosmosdbActiveInstanceCount); } +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncDoubleMetricDbClientCosmosdbActiveInstanceCount(metrics::Meter *meter) { @@ -795,6 +803,7 @@ CreateSyncDoubleMetricDbClientCosmosdbActiveInstanceCount(metrics::Meter *meter) unitMetricDbClientCosmosdbActiveInstanceCount); } +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncInt64MetricDbClientCosmosdbActiveInstanceCount(metrics::Meter *meter) { @@ -803,6 +812,7 @@ CreateAsyncInt64MetricDbClientCosmosdbActiveInstanceCount(metrics::Meter *meter) unitMetricDbClientCosmosdbActiveInstanceCount); } +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncDoubleMetricDbClientCosmosdbActiveInstanceCount(metrics::Meter *meter) { @@ -812,16 +822,23 @@ CreateAsyncDoubleMetricDbClientCosmosdbActiveInstanceCount(metrics::Meter *meter } /** - * Request charge consumed - * by the operation

histogram + * Deprecated, use @code azure.cosmosdb.client.operation.request_charge @endcode instead. + *

+ * @deprecated + * Replaced by @code azure.cosmosdb.client.operation.request_charge @endcode. + *

+ * histogram */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricDbClientCosmosdbOperationRequestCharge = "db.client.cosmosdb.operation.request_charge"; +OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricDbClientCosmosdbOperationRequestCharge = - "[Request charge](https://learn.microsoft.com/azure/cosmos-db/request-units) consumed by the " - "operation"; + "Deprecated, use `azure.cosmosdb.client.operation.request_charge` instead."; +OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricDbClientCosmosdbOperationRequestCharge = "{request_unit}"; +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncInt64MetricDbClientCosmosdbOperationRequestCharge(metrics::Meter *meter) { @@ -830,6 +847,7 @@ CreateSyncInt64MetricDbClientCosmosdbOperationRequestCharge(metrics::Meter *mete unitMetricDbClientCosmosdbOperationRequestCharge); } +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncDoubleMetricDbClientCosmosdbOperationRequestCharge(metrics::Meter *meter) { diff --git a/api/include/opentelemetry/semconv/incubating/elasticsearch_attributes.h b/api/include/opentelemetry/semconv/incubating/elasticsearch_attributes.h new file mode 100644 index 0000000000..5696ebf627 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/elasticsearch_attributes.h @@ -0,0 +1,29 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace elasticsearch +{ + +/** + * Represents the human-readable identifier of the node/instance to which a request was routed. + */ +static constexpr const char *kElasticsearchNodeName = "elasticsearch.node.name"; + +} // namespace elasticsearch +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/event_attributes.h b/api/include/opentelemetry/semconv/incubating/event_attributes.h index c2faa437cf..c43df166d0 100644 --- a/api/include/opentelemetry/semconv/incubating/event_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/event_attributes.h @@ -22,11 +22,10 @@ namespace event /** * Identifies the class / type of event. *

- * Event names are subject to the same rules as attribute names. Notably, event names are namespaced - * to avoid collisions and provide a clean separation of semantics for events in separate domains - * like browser, mobile, and kubernetes. + * @deprecated + * Replaced by EventName top-level field on the LogRecord */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kEventName = "event.name"; } // namespace event diff --git a/api/include/opentelemetry/semconv/incubating/exception_attributes.h b/api/include/opentelemetry/semconv/incubating/exception_attributes.h index fdc19ac6d0..1ad6988833 100644 --- a/api/include/opentelemetry/semconv/incubating/exception_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/exception_attributes.h @@ -20,21 +20,13 @@ namespace exception { /** - * SHOULD be set to true if the exception event is recorded at a point where it is known that the - * exception is escaping the scope of the span.

An exception is considered to have escaped (or - * left) the scope of a span, if that span is ended while the exception is still logically "in - * flight". This may be actually "in flight" in some languages (e.g. if the exception is passed to a - * Context manager's @code __exit__ @endcode method in Python) but will usually be caught at the - * point of recording the exception in most languages.

It is usually not possible to determine - * at the point where an exception is thrown whether it will escape the scope of a span. However, it - * is trivial to know that an exception will escape, if one checks for an active exception just - * before ending the span, as done in the example - * for recording span exceptions.

It follows that an exception may still escape the scope of - * the span even if the @code exception.escaped @endcode attribute was not set or set to false, - * since the event might have been recorded at a time where it was not - * clear whether the exception will escape. + * Indicates that the exception is escaping the scope of the span. + *

+ * @deprecated + * It's no longer recommended to record exceptions that are handled and do not escape the scope of a + * span. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kExceptionEscaped = "exception.escaped"; /** diff --git a/api/include/opentelemetry/semconv/incubating/faas_attributes.h b/api/include/opentelemetry/semconv/incubating/faas_attributes.h index ade74d610a..7fb929800f 100644 --- a/api/include/opentelemetry/semconv/incubating/faas_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/faas_attributes.h @@ -107,9 +107,9 @@ static constexpr const char *kFaasMaxMemory = "faas.max_memory"; * platform and is usually different from the name of the callback * function (which may be stored in the * @code code.namespace @endcode/@code - * code.function @endcode span attributes).

For some cloud providers, the above definition - * is ambiguous. The following definition of function name MUST be used for this attribute (and - * consequently the span name) for the listed cloud providers/products:

+ *

* counter */ static constexpr const char *kMetricSystemDiskOperationTime = "system.disk.operation_time"; @@ -894,6 +899,7 @@ CreateAsyncDoubleMetricSystemNetworkConnections(metrics::Meter *meter) * href="https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2">@code * GetIfEntry2 @endcode * + *

* counter */ static constexpr const char *kMetricSystemNetworkDropped = "system.network.dropped"; @@ -942,6 +948,7 @@ CreateAsyncDoubleMetricSystemNetworkDropped(metrics::Meter *meter) * href="https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2">@code * GetIfEntry2 @endcode. * + *

* counter */ static constexpr const char *kMetricSystemNetworkErrors = "system.network.errors"; diff --git a/api/include/opentelemetry/semconv/incubating/url_attributes.h b/api/include/opentelemetry/semconv/incubating/url_attributes.h index 65b78911d7..96ea78cfe9 100644 --- a/api/include/opentelemetry/semconv/incubating/url_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/url_attributes.h @@ -70,6 +70,7 @@ static constexpr const char *kUrlFragment = "url.fragment"; * href="https://cloud.google.com/storage/docs/access-control/signed-urls">@code X-Goog-Signature * @endcode * + *

* This list is subject to change over time. *

* When a query string value is redacted, the query string key SHOULD still be preserved, e.g. @@ -119,6 +120,7 @@ static constexpr const char *kUrlPort = "url.port"; * href="https://cloud.google.com/storage/docs/access-control/signed-urls">@code X-Goog-Signature * @endcode * + *

* This list is subject to change over time. *

* When a query string value is redacted, the query string key SHOULD still be preserved, e.g. diff --git a/api/include/opentelemetry/semconv/incubating/vcs_attributes.h b/api/include/opentelemetry/semconv/incubating/vcs_attributes.h index b5f05d38da..5422a1af54 100644 --- a/api/include/opentelemetry/semconv/incubating/vcs_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/vcs_attributes.h @@ -43,57 +43,72 @@ static constexpr const char *kVcsLineChangeType = "vcs.line_change.type"; /** * The name of the reference such as - * branch or tag in the repository. + * branch or tag in the repository.

+ * @code base @endcode refers to the starting point of a change. For example, @code main @endcode + * would be the base reference of type branch if you've created a new + * reference of type branch from it and created new commits. */ static constexpr const char *kVcsRefBaseName = "vcs.ref.base.name"; /** * The revision, literally revised * version, The revision most often refers to a commit object in Git, or a revision number in - * SVN.

The revision can be a full hash value (see glossary), - * of the recorded change to a ref within a repository pointing to a + * SVN.

+ * @code base @endcode refers to the starting point of a change. For example, @code main @endcode + * would be the base reference of type branch if you've created a new + * reference of type branch from it and created new commits. The + * revision can be a full hash + * value (see glossary), of the recorded change to a ref within a repository pointing to a * commit commit object. It does - * not necessarily have to be a hash; it can simply define a - * revision number + * not necessarily have to be a hash; it can simply define a revision number * which is an integer that is monotonically increasing. In cases where - * it is identical to the @code ref.base.name @endcode, it SHOULD still be included. It is - * up to the implementer to decide which value to set as the revision - * based on the VCS system and situational context. + * it is identical to the @code ref.base.name @endcode, it SHOULD still be included. + * It is up to the implementer to decide which value to set as the + * revision based on the VCS system and situational context. */ static constexpr const char *kVcsRefBaseRevision = "vcs.ref.base.revision"; /** * The type of the reference in the - * repository. + * repository.

+ * @code base @endcode refers to the starting point of a change. For example, @code main @endcode + * would be the base reference of type branch if you've created a new + * reference of type branch from it and created new commits. */ static constexpr const char *kVcsRefBaseType = "vcs.ref.base.type"; /** * The name of the reference such as - * branch or tag in the repository. + * branch or tag in the repository.

+ * @code head @endcode refers to where you are right now; the current reference at a + * given time. */ static constexpr const char *kVcsRefHeadName = "vcs.ref.head.name"; /** * The revision, literally revised * version, The revision most often refers to a commit object in Git, or a revision number in - * SVN.

The revision can be a full + * @code head @endcode refers to where you are right now; the current reference at a + * given time.The revision can be a full hash value (see glossary), * of the recorded change to a ref within a repository pointing to a * commit commit object. It does - * not necessarily have to be a hash; it can simply define a - * revision number + * not necessarily have to be a hash; it can simply define a revision number * which is an integer that is monotonically increasing. In cases where - * it is identical to the @code ref.head.name @endcode, it SHOULD still be included. It is - * up to the implementer to decide which value to set as the revision - * based on the VCS system and situational context. + * it is identical to the @code ref.head.name @endcode, it SHOULD still be included. + * It is up to the implementer to decide which value to set as the + * revision based on the VCS system and situational context. */ static constexpr const char *kVcsRefHeadRevision = "vcs.ref.head.revision"; /** * The type of the reference in the - * repository. + * repository.

+ * @code head @endcode refers to where you are right now; the current reference at a + * given time. */ static constexpr const char *kVcsRefHeadType = "vcs.ref.head.type"; @@ -121,6 +136,14 @@ static constexpr const char *kVcsRepositoryChangeId = "vcs.repository.change.id" OPENTELEMETRY_DEPRECATED static constexpr const char *kVcsRepositoryChangeTitle = "vcs.repository.change.title"; +/** + * The human readable name of the repository. It SHOULD NOT include any additional identifier like + * Group/SubGroup in GitLab or organization in GitHub.

Due to it only being the name, it can + * clash with forks of the same repository if collecting telemetry across multiple orgs or groups in + * the same backends. + */ +static constexpr const char *kVcsRepositoryName = "vcs.repository.name"; + /** * Deprecated, use @code vcs.ref.head.name @endcode instead. *

@@ -149,8 +172,11 @@ OPENTELEMETRY_DEPRECATED static constexpr const char *kVcsRepositoryRefType = "vcs.repository.ref.type"; /** - * The URL of the repository providing the complete - * address in order to locate and identify the repository. + * The canonical + * URL of the repository providing the complete HTTP(S) address in order to locate and identify + * the repository through a browser.

In Git Version Control Systems, the canonical URL SHOULD + * NOT include the @code .git @endcode extension. */ static constexpr const char *kVcsRepositoryUrlFull = "vcs.repository.url.full"; diff --git a/api/include/opentelemetry/semconv/incubating/vcs_metrics.h b/api/include/opentelemetry/semconv/incubating/vcs_metrics.h index 769770b7bb..1f2885b8fe 100644 --- a/api/include/opentelemetry/semconv/incubating/vcs_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/vcs_metrics.h @@ -101,12 +101,12 @@ CreateAsyncDoubleMetricVcsChangeDuration(metrics::Meter *meter) /** * The amount of time since its creation it took a change (pull request/merge request/changelist) to - * get the first approval

gauge + * get the first approval.

gauge */ static constexpr const char *kMetricVcsChangeTimeToApproval = "vcs.change.time_to_approval"; static constexpr const char *descrMetricVcsChangeTimeToApproval = "The amount of time since its creation it took a change (pull request/merge " - "request/changelist) to get the first approval"; + "request/changelist) to get the first approval."; static constexpr const char *unitMetricVcsChangeTimeToApproval = "s"; #if OPENTELEMETRY_ABI_VERSION_NO >= 2 @@ -143,6 +143,47 @@ CreateAsyncDoubleMetricVcsChangeTimeToApproval(metrics::Meter *meter) unitMetricVcsChangeTimeToApproval); } +/** + * The amount of time since its creation it took a change (pull request/merge request/changelist) to + * get merged into the target(base) ref.

gauge + */ +static constexpr const char *kMetricVcsChangeTimeToMerge = "vcs.change.time_to_merge"; +static constexpr const char *descrMetricVcsChangeTimeToMerge = + "The amount of time since its creation it took a change (pull request/merge " + "request/changelist) to get merged into the target(base) ref."; +static constexpr const char *unitMetricVcsChangeTimeToMerge = "s"; + +#if OPENTELEMETRY_ABI_VERSION_NO >= 2 + +static inline nostd::unique_ptr> CreateSyncInt64MetricVcsChangeTimeToMerge( + metrics::Meter *meter) +{ + return meter->CreateInt64Gauge(kMetricVcsChangeTimeToMerge, descrMetricVcsChangeTimeToMerge, + unitMetricVcsChangeTimeToMerge); +} + +static inline nostd::unique_ptr> CreateSyncDoubleMetricVcsChangeTimeToMerge( + metrics::Meter *meter) +{ + return meter->CreateDoubleGauge(kMetricVcsChangeTimeToMerge, descrMetricVcsChangeTimeToMerge, + unitMetricVcsChangeTimeToMerge); +} +#endif /* OPENTELEMETRY_ABI_VERSION_NO */ + +static inline nostd::shared_ptr +CreateAsyncInt64MetricVcsChangeTimeToMerge(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableGauge( + kMetricVcsChangeTimeToMerge, descrMetricVcsChangeTimeToMerge, unitMetricVcsChangeTimeToMerge); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricVcsChangeTimeToMerge(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableGauge( + kMetricVcsChangeTimeToMerge, descrMetricVcsChangeTimeToMerge, unitMetricVcsChangeTimeToMerge); +} + /** * The number of unique contributors to a repository *

@@ -185,13 +226,13 @@ CreateAsyncDoubleMetricVcsContributorCount(metrics::Meter *meter) } /** - * The number of refs of type branch or tag in a repository + * The number of refs of type branch or tag in a repository. *

* updowncounter */ static constexpr const char *kMetricVcsRefCount = "vcs.ref.count"; static constexpr const char *descrMetricVcsRefCount = - "The number of refs of type branch or tag in a repository"; + "The number of refs of type branch or tag in a repository."; static constexpr const char *unitMetricVcsRefCount = "{ref}"; static inline nostd::unique_ptr> CreateSyncInt64MetricVcsRefCount( @@ -224,7 +265,7 @@ static inline nostd::shared_ptr CreateAsyncDouble /** * The number of lines added/removed in a ref (branch) relative to the ref from the @code - * vcs.ref.base.name @endcode attribute

This metric should be reported for each @code + * vcs.ref.base.name @endcode attribute.

This metric should be reported for each @code * vcs.line_change.type @endcode value. For example if a ref added 3 lines and removed 2 lines, * instrumentation SHOULD report two measurements: 3 and 2 (both positive numbers). * If number of lines added/removed should be calculated from the start of time, then @code @@ -233,7 +274,7 @@ static inline nostd::shared_ptr CreateAsyncDouble static constexpr const char *kMetricVcsRefLinesDelta = "vcs.ref.lines_delta"; static constexpr const char *descrMetricVcsRefLinesDelta = "The number of lines added/removed in a ref (branch) relative to the ref from the " - "`vcs.ref.base.name` attribute"; + "`vcs.ref.base.name` attribute."; static constexpr const char *unitMetricVcsRefLinesDelta = "{line}"; #if OPENTELEMETRY_ABI_VERSION_NO >= 2 @@ -352,13 +393,13 @@ static inline nostd::shared_ptr CreateAsyncDouble } /** - * The number of repositories in an organization + * The number of repositories in an organization. *

* updowncounter */ static constexpr const char *kMetricVcsRepositoryCount = "vcs.repository.count"; static constexpr const char *descrMetricVcsRepositoryCount = - "The number of repositories in an organization"; + "The number of repositories in an organization."; static constexpr const char *unitMetricVcsRepositoryCount = "{repository}"; static inline nostd::unique_ptr> diff --git a/api/include/opentelemetry/semconv/network_attributes.h b/api/include/opentelemetry/semconv/network_attributes.h index 832a343a66..f37d6d8617 100644 --- a/api/include/opentelemetry/semconv/network_attributes.h +++ b/api/include/opentelemetry/semconv/network_attributes.h @@ -19,11 +19,6 @@ namespace semconv namespace network { -/** - * The network interface name. - */ -static constexpr const char *kNetworkInterfaceName = "network.interface.name"; - /** * Local address of the network connection - IP address or Unix domain socket name. */ diff --git a/api/include/opentelemetry/semconv/schema_url.h b/api/include/opentelemetry/semconv/schema_url.h index ca35597ba4..79bd51c0dc 100644 --- a/api/include/opentelemetry/semconv/schema_url.h +++ b/api/include/opentelemetry/semconv/schema_url.h @@ -19,6 +19,6 @@ namespace semconv /** * The URL of the OpenTelemetry schema for these keys and values. */ -static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.29.0"; +static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.30.0"; } // namespace semconv OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/url_attributes.h b/api/include/opentelemetry/semconv/url_attributes.h index 17085c5916..8d7310d590 100644 --- a/api/include/opentelemetry/semconv/url_attributes.h +++ b/api/include/opentelemetry/semconv/url_attributes.h @@ -50,6 +50,7 @@ static constexpr const char *kUrlFragment = "url.fragment"; * href="https://cloud.google.com/storage/docs/access-control/signed-urls">@code X-Goog-Signature * @endcode * + *

* This list is subject to change over time. *

* When a query string value is redacted, the query string key SHOULD still be preserved, e.g. @@ -82,6 +83,7 @@ static constexpr const char *kUrlPath = "url.path"; * href="https://cloud.google.com/storage/docs/access-control/signed-urls">@code X-Goog-Signature * @endcode * + *

* This list is subject to change over time. *

* When a query string value is redacted, the query string key SHOULD still be preserved, e.g. diff --git a/buildscripts/semantic-convention/generate.sh b/buildscripts/semantic-convention/generate.sh index f20f5e5af7..aa09991454 100755 --- a/buildscripts/semantic-convention/generate.sh +++ b/buildscripts/semantic-convention/generate.sh @@ -16,10 +16,10 @@ ROOT_DIR="${SCRIPT_DIR}/../../" # freeze the spec & generator tools versions to make the generation reproducible # repository: https://github.com/open-telemetry/semantic-conventions -SEMCONV_VERSION=1.29.0 +SEMCONV_VERSION=1.30.0 # repository: https://github.com/open-telemetry/weaver -WEAVER_VERSION=0.11.0 +WEAVER_VERSION=0.12.0 SEMCONV_VERSION_TAG=v$SEMCONV_VERSION WEAVER_VERSION_TAG=v$WEAVER_VERSION