Skip to content

Commit

Permalink
Fixes #3226
Browse files Browse the repository at this point in the history
  • Loading branch information
marcalff committed Jan 6, 2025
1 parent bb68f49 commit 23c7a98
Show file tree
Hide file tree
Showing 15 changed files with 144 additions and 171 deletions.
6 changes: 2 additions & 4 deletions api/include/opentelemetry/semconv/http_metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ namespace http
* <p>
* histogram
*/
static constexpr const char *kMetricHttpClientRequestDuration =
"metric.http.client.request.duration";
static constexpr const char *kMetricHttpClientRequestDuration = "http.client.request.duration";
static constexpr const char *descrMetricHttpClientRequestDuration =
"Duration of HTTP client requests.";
static constexpr const char *unitMetricHttpClientRequestDuration = "s";
Expand All @@ -52,8 +51,7 @@ CreateSyncDoubleMetricHttpClientRequestDuration(metrics::Meter *meter)
* <p>
* histogram
*/
static constexpr const char *kMetricHttpServerRequestDuration =
"metric.http.server.request.duration";
static constexpr const char *kMetricHttpServerRequestDuration = "http.server.request.duration";
static constexpr const char *descrMetricHttpServerRequestDuration =
"Duration of HTTP server requests.";
static constexpr const char *unitMetricHttpServerRequestDuration = "s";
Expand Down
12 changes: 6 additions & 6 deletions api/include/opentelemetry/semconv/incubating/container_metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace container
* <p>
* counter
*/
static constexpr const char *kMetricContainerCpuTime = "metric.container.cpu.time";
static constexpr const char *kMetricContainerCpuTime = "container.cpu.time";
static constexpr const char *descrMetricContainerCpuTime = "Total CPU time consumed";
static constexpr const char *unitMetricContainerCpuTime = "s";

Expand Down Expand Up @@ -66,7 +66,7 @@ CreateAsyncDoubleMetricContainerCpuTime(metrics::Meter *meter)
* <p>
* gauge
*/
static constexpr const char *kMetricContainerCpuUsage = "metric.container.cpu.usage";
static constexpr const char *kMetricContainerCpuUsage = "container.cpu.usage";
static constexpr const char *descrMetricContainerCpuUsage =
"Container's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs";
static constexpr const char *unitMetricContainerCpuUsage = "{cpu}";
Expand Down Expand Up @@ -109,7 +109,7 @@ CreateAsyncDoubleMetricContainerCpuUsage(metrics::Meter *meter)
* <p>
* counter
*/
static constexpr const char *kMetricContainerDiskIo = "metric.container.disk.io";
static constexpr const char *kMetricContainerDiskIo = "container.disk.io";
static constexpr const char *descrMetricContainerDiskIo = "Disk bytes for the container.";
static constexpr const char *unitMetricContainerDiskIo = "By";

Expand Down Expand Up @@ -148,7 +148,7 @@ CreateAsyncDoubleMetricContainerDiskIo(metrics::Meter *meter)
* <p>
* counter
*/
static constexpr const char *kMetricContainerMemoryUsage = "metric.container.memory.usage";
static constexpr const char *kMetricContainerMemoryUsage = "container.memory.usage";
static constexpr const char *descrMetricContainerMemoryUsage = "Memory usage of the container.";
static constexpr const char *unitMetricContainerMemoryUsage = "By";

Expand Down Expand Up @@ -187,7 +187,7 @@ CreateAsyncDoubleMetricContainerMemoryUsage(metrics::Meter *meter)
* <p>
* counter
*/
static constexpr const char *kMetricContainerNetworkIo = "metric.container.network.io";
static constexpr const char *kMetricContainerNetworkIo = "container.network.io";
static constexpr const char *descrMetricContainerNetworkIo = "Network bytes for the container.";
static constexpr const char *unitMetricContainerNetworkIo = "By";

Expand Down Expand Up @@ -226,7 +226,7 @@ CreateAsyncDoubleMetricContainerNetworkIo(metrics::Meter *meter)
* as a floating point number with the highest precision available. The actual accuracy would depend
* on the instrumentation and operating system. <p> gauge
*/
static constexpr const char *kMetricContainerUptime = "metric.container.uptime";
static constexpr const char *kMetricContainerUptime = "container.uptime";
static constexpr const char *descrMetricContainerUptime = "The time the container has been running";
static constexpr const char *unitMetricContainerUptime = "s";

Expand Down
55 changes: 22 additions & 33 deletions api/include/opentelemetry/semconv/incubating/db_metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace db
* The number of connections that are currently in state described by the @code state @endcode
* attribute <p> updowncounter
*/
static constexpr const char *kMetricDbClientConnectionCount = "metric.db.client.connection.count";
static constexpr const char *kMetricDbClientConnectionCount = "db.client.connection.count";
static constexpr const char *descrMetricDbClientConnectionCount =
"The number of connections that are currently in state described by the `state` attribute";
static constexpr const char *unitMetricDbClientConnectionCount = "{connection}";
Expand Down Expand Up @@ -67,7 +67,7 @@ CreateAsyncDoubleMetricDbClientConnectionCount(metrics::Meter *meter)
* histogram
*/
static constexpr const char *kMetricDbClientConnectionCreateTime =
"metric.db.client.connection.create_time";
"db.client.connection.create_time";
static constexpr const char *descrMetricDbClientConnectionCreateTime =
"The time it took to create a new connection";
static constexpr const char *unitMetricDbClientConnectionCreateTime = "s";
Expand All @@ -93,8 +93,7 @@ CreateSyncDoubleMetricDbClientConnectionCreateTime(metrics::Meter *meter)
* <p>
* updowncounter
*/
static constexpr const char *kMetricDbClientConnectionIdleMax =
"metric.db.client.connection.idle.max";
static constexpr const char *kMetricDbClientConnectionIdleMax = "db.client.connection.idle.max";
static constexpr const char *descrMetricDbClientConnectionIdleMax =
"The maximum number of idle open connections allowed";
static constexpr const char *unitMetricDbClientConnectionIdleMax = "{connection}";
Expand Down Expand Up @@ -136,8 +135,7 @@ CreateAsyncDoubleMetricDbClientConnectionIdleMax(metrics::Meter *meter)
* <p>
* updowncounter
*/
static constexpr const char *kMetricDbClientConnectionIdleMin =
"metric.db.client.connection.idle.min";
static constexpr const char *kMetricDbClientConnectionIdleMin = "db.client.connection.idle.min";
static constexpr const char *descrMetricDbClientConnectionIdleMin =
"The minimum number of idle open connections allowed";
static constexpr const char *unitMetricDbClientConnectionIdleMin = "{connection}";
Expand Down Expand Up @@ -179,7 +177,7 @@ CreateAsyncDoubleMetricDbClientConnectionIdleMin(metrics::Meter *meter)
* <p>
* updowncounter
*/
static constexpr const char *kMetricDbClientConnectionMax = "metric.db.client.connection.max";
static constexpr const char *kMetricDbClientConnectionMax = "db.client.connection.max";
static constexpr const char *descrMetricDbClientConnectionMax =
"The maximum number of open connections allowed";
static constexpr const char *unitMetricDbClientConnectionMax = "{connection}";
Expand Down Expand Up @@ -222,7 +220,7 @@ CreateAsyncDoubleMetricDbClientConnectionMax(metrics::Meter *meter)
* updowncounter
*/
static constexpr const char *kMetricDbClientConnectionPendingRequests =
"metric.db.client.connection.pending_requests";
"db.client.connection.pending_requests";
static constexpr const char *descrMetricDbClientConnectionPendingRequests =
"The number of current pending requests for an open connection";
static constexpr const char *unitMetricDbClientConnectionPendingRequests = "{request}";
Expand Down Expand Up @@ -264,8 +262,7 @@ CreateAsyncDoubleMetricDbClientConnectionPendingRequests(metrics::Meter *meter)
* <p>
* counter
*/
static constexpr const char *kMetricDbClientConnectionTimeouts =
"metric.db.client.connection.timeouts";
static constexpr const char *kMetricDbClientConnectionTimeouts = "db.client.connection.timeouts";
static constexpr const char *descrMetricDbClientConnectionTimeouts =
"The number of connection timeouts that have occurred trying to obtain a connection from the "
"pool";
Expand Down Expand Up @@ -308,8 +305,7 @@ CreateAsyncDoubleMetricDbClientConnectionTimeouts(metrics::Meter *meter)
* <p>
* histogram
*/
static constexpr const char *kMetricDbClientConnectionUseTime =
"metric.db.client.connection.use_time";
static constexpr const char *kMetricDbClientConnectionUseTime = "db.client.connection.use_time";
static constexpr const char *descrMetricDbClientConnectionUseTime =
"The time between borrowing a connection and returning it to the pool";
static constexpr const char *unitMetricDbClientConnectionUseTime = "s";
Expand All @@ -335,8 +331,7 @@ CreateSyncDoubleMetricDbClientConnectionUseTime(metrics::Meter *meter)
* <p>
* histogram
*/
static constexpr const char *kMetricDbClientConnectionWaitTime =
"metric.db.client.connection.wait_time";
static constexpr const char *kMetricDbClientConnectionWaitTime = "db.client.connection.wait_time";
static constexpr const char *descrMetricDbClientConnectionWaitTime =
"The time it took to obtain an open connection from the pool";
static constexpr const char *unitMetricDbClientConnectionWaitTime = "s";
Expand Down Expand Up @@ -366,7 +361,7 @@ CreateSyncDoubleMetricDbClientConnectionWaitTime(metrics::Meter *meter)
*/
OPENTELEMETRY_DEPRECATED
static constexpr const char *kMetricDbClientConnectionsCreateTime =
"metric.db.client.connections.create_time";
"db.client.connections.create_time";
OPENTELEMETRY_DEPRECATED
static constexpr const char *descrMetricDbClientConnectionsCreateTime =
"Deprecated, use `db.client.connection.create_time` instead. Note: the unit also changed from "
Expand Down Expand Up @@ -401,8 +396,7 @@ CreateSyncDoubleMetricDbClientConnectionsCreateTime(metrics::Meter *meter)
* updowncounter
*/
OPENTELEMETRY_DEPRECATED
static constexpr const char *kMetricDbClientConnectionsIdleMax =
"metric.db.client.connections.idle.max";
static constexpr const char *kMetricDbClientConnectionsIdleMax = "db.client.connections.idle.max";
OPENTELEMETRY_DEPRECATED
static constexpr const char *descrMetricDbClientConnectionsIdleMax =
"Deprecated, use `db.client.connection.idle.max` instead.";
Expand Down Expand Up @@ -454,8 +448,7 @@ CreateAsyncDoubleMetricDbClientConnectionsIdleMax(metrics::Meter *meter)
* updowncounter
*/
OPENTELEMETRY_DEPRECATED
static constexpr const char *kMetricDbClientConnectionsIdleMin =
"metric.db.client.connections.idle.min";
static constexpr const char *kMetricDbClientConnectionsIdleMin = "db.client.connections.idle.min";
OPENTELEMETRY_DEPRECATED
static constexpr const char *descrMetricDbClientConnectionsIdleMin =
"Deprecated, use `db.client.connection.idle.min` instead.";
Expand Down Expand Up @@ -507,7 +500,7 @@ CreateAsyncDoubleMetricDbClientConnectionsIdleMin(metrics::Meter *meter)
* updowncounter
*/
OPENTELEMETRY_DEPRECATED
static constexpr const char *kMetricDbClientConnectionsMax = "metric.db.client.connections.max";
static constexpr const char *kMetricDbClientConnectionsMax = "db.client.connections.max";
OPENTELEMETRY_DEPRECATED
static constexpr const char *descrMetricDbClientConnectionsMax =
"Deprecated, use `db.client.connection.max` instead.";
Expand Down Expand Up @@ -560,7 +553,7 @@ CreateAsyncDoubleMetricDbClientConnectionsMax(metrics::Meter *meter)
*/
OPENTELEMETRY_DEPRECATED
static constexpr const char *kMetricDbClientConnectionsPendingRequests =
"metric.db.client.connections.pending_requests";
"db.client.connections.pending_requests";
OPENTELEMETRY_DEPRECATED
static constexpr const char *descrMetricDbClientConnectionsPendingRequests =
"Deprecated, use `db.client.connection.pending_requests` instead.";
Expand Down Expand Up @@ -612,8 +605,7 @@ CreateAsyncDoubleMetricDbClientConnectionsPendingRequests(metrics::Meter *meter)
* counter
*/
OPENTELEMETRY_DEPRECATED
static constexpr const char *kMetricDbClientConnectionsTimeouts =
"metric.db.client.connections.timeouts";
static constexpr const char *kMetricDbClientConnectionsTimeouts = "db.client.connections.timeouts";
OPENTELEMETRY_DEPRECATED
static constexpr const char *descrMetricDbClientConnectionsTimeouts =
"Deprecated, use `db.client.connection.timeouts` instead.";
Expand Down Expand Up @@ -665,7 +657,7 @@ CreateAsyncDoubleMetricDbClientConnectionsTimeouts(metrics::Meter *meter)
* updowncounter
*/
OPENTELEMETRY_DEPRECATED
static constexpr const char *kMetricDbClientConnectionsUsage = "metric.db.client.connections.usage";
static constexpr const char *kMetricDbClientConnectionsUsage = "db.client.connections.usage";
OPENTELEMETRY_DEPRECATED
static constexpr const char *descrMetricDbClientConnectionsUsage =
"Deprecated, use `db.client.connection.count` instead.";
Expand Down Expand Up @@ -716,8 +708,7 @@ CreateAsyncDoubleMetricDbClientConnectionsUsage(metrics::Meter *meter)
* ms @endcode to @code s @endcode. <p> histogram
*/
OPENTELEMETRY_DEPRECATED
static constexpr const char *kMetricDbClientConnectionsUseTime =
"metric.db.client.connections.use_time";
static constexpr const char *kMetricDbClientConnectionsUseTime = "db.client.connections.use_time";
OPENTELEMETRY_DEPRECATED
static constexpr const char *descrMetricDbClientConnectionsUseTime =
"Deprecated, use `db.client.connection.use_time` instead. Note: the unit also changed from "
Expand Down Expand Up @@ -751,8 +742,7 @@ CreateSyncDoubleMetricDbClientConnectionsUseTime(metrics::Meter *meter)
* ms @endcode to @code s @endcode. <p> histogram
*/
OPENTELEMETRY_DEPRECATED
static constexpr const char *kMetricDbClientConnectionsWaitTime =
"metric.db.client.connections.wait_time";
static constexpr const char *kMetricDbClientConnectionsWaitTime = "db.client.connections.wait_time";
OPENTELEMETRY_DEPRECATED
static constexpr const char *descrMetricDbClientConnectionsWaitTime =
"Deprecated, use `db.client.connection.wait_time` instead. Note: the unit also changed from "
Expand Down Expand Up @@ -784,7 +774,7 @@ CreateSyncDoubleMetricDbClientConnectionsWaitTime(metrics::Meter *meter)
* updowncounter
*/
static constexpr const char *kMetricDbClientCosmosdbActiveInstanceCount =
"metric.db.client.cosmosdb.active_instance.count";
"db.client.cosmosdb.active_instance.count";
static constexpr const char *descrMetricDbClientCosmosdbActiveInstanceCount =
"Number of active client instances";
static constexpr const char *unitMetricDbClientCosmosdbActiveInstanceCount = "{instance}";
Expand Down Expand Up @@ -826,7 +816,7 @@ CreateAsyncDoubleMetricDbClientCosmosdbActiveInstanceCount(metrics::Meter *meter
* by the operation <p> histogram
*/
static constexpr const char *kMetricDbClientCosmosdbOperationRequestCharge =
"metric.db.client.cosmosdb.operation.request_charge";
"db.client.cosmosdb.operation.request_charge";
static constexpr const char *descrMetricDbClientCosmosdbOperationRequestCharge =
"[Request charge](https://learn.microsoft.com/azure/cosmos-db/request-units) consumed by the "
"operation";
Expand Down Expand Up @@ -855,8 +845,7 @@ CreateSyncDoubleMetricDbClientCosmosdbOperationRequestCharge(metrics::Meter *met
* <p>
* histogram
*/
static constexpr const char *kMetricDbClientOperationDuration =
"metric.db.client.operation.duration";
static constexpr const char *kMetricDbClientOperationDuration = "db.client.operation.duration";
static constexpr const char *descrMetricDbClientOperationDuration =
"Duration of database client operations.";
static constexpr const char *unitMetricDbClientOperationDuration = "s";
Expand All @@ -883,7 +872,7 @@ CreateSyncDoubleMetricDbClientOperationDuration(metrics::Meter *meter)
* histogram
*/
static constexpr const char *kMetricDbClientResponseReturnedRows =
"metric.db.client.response.returned_rows";
"db.client.response.returned_rows";
static constexpr const char *descrMetricDbClientResponseReturnedRows =
"The actual number of records returned by the database operation.";
static constexpr const char *unitMetricDbClientResponseReturnedRows = "{row}";
Expand Down
2 changes: 1 addition & 1 deletion api/include/opentelemetry/semconv/incubating/dns_metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace dns
* <p>
* histogram
*/
static constexpr const char *kMetricDnsLookupDuration = "metric.dns.lookup.duration";
static constexpr const char *kMetricDnsLookupDuration = "dns.lookup.duration";
static constexpr const char *descrMetricDnsLookupDuration =
"Measures the time taken to perform a DNS lookup.";
static constexpr const char *unitMetricDnsLookupDuration = "s";
Expand Down
18 changes: 9 additions & 9 deletions api/include/opentelemetry/semconv/incubating/faas_metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace faas
* <p>
* counter
*/
static constexpr const char *kMetricFaasColdstarts = "metric.faas.coldstarts";
static constexpr const char *kMetricFaasColdstarts = "faas.coldstarts";
static constexpr const char *descrMetricFaasColdstarts = "Number of invocation cold starts";
static constexpr const char *unitMetricFaasColdstarts = "{coldstart}";

Expand Down Expand Up @@ -62,7 +62,7 @@ CreateAsyncDoubleMetricFaasColdstarts(metrics::Meter *meter)
* <p>
* histogram
*/
static constexpr const char *kMetricFaasCpuUsage = "metric.faas.cpu_usage";
static constexpr const char *kMetricFaasCpuUsage = "faas.cpu_usage";
static constexpr const char *descrMetricFaasCpuUsage = "Distribution of CPU usage per invocation";
static constexpr const char *unitMetricFaasCpuUsage = "s";

Expand All @@ -85,7 +85,7 @@ static inline nostd::unique_ptr<metrics::Histogram<double>> CreateSyncDoubleMetr
* <p>
* counter
*/
static constexpr const char *kMetricFaasErrors = "metric.faas.errors";
static constexpr const char *kMetricFaasErrors = "faas.errors";
static constexpr const char *descrMetricFaasErrors = "Number of invocation errors";
static constexpr const char *unitMetricFaasErrors = "{error}";

Expand Down Expand Up @@ -120,7 +120,7 @@ static inline nostd::shared_ptr<metrics::ObservableInstrument> CreateAsyncDouble
* <p>
* histogram
*/
static constexpr const char *kMetricFaasInitDuration = "metric.faas.init_duration";
static constexpr const char *kMetricFaasInitDuration = "faas.init_duration";
static constexpr const char *descrMetricFaasInitDuration =
"Measures the duration of the function's initialization, such as a cold start";
static constexpr const char *unitMetricFaasInitDuration = "s";
Expand All @@ -144,7 +144,7 @@ static inline nostd::unique_ptr<metrics::Histogram<double>> CreateSyncDoubleMetr
* <p>
* counter
*/
static constexpr const char *kMetricFaasInvocations = "metric.faas.invocations";
static constexpr const char *kMetricFaasInvocations = "faas.invocations";
static constexpr const char *descrMetricFaasInvocations = "Number of successful invocations";
static constexpr const char *unitMetricFaasInvocations = "{invocation}";

Expand Down Expand Up @@ -181,7 +181,7 @@ CreateAsyncDoubleMetricFaasInvocations(metrics::Meter *meter)
* <p>
* histogram
*/
static constexpr const char *kMetricFaasInvokeDuration = "metric.faas.invoke_duration";
static constexpr const char *kMetricFaasInvokeDuration = "faas.invoke_duration";
static constexpr const char *descrMetricFaasInvokeDuration =
"Measures the duration of the function's logic execution";
static constexpr const char *unitMetricFaasInvokeDuration = "s";
Expand All @@ -205,7 +205,7 @@ CreateSyncDoubleMetricFaasInvokeDuration(metrics::Meter *meter)
* <p>
* histogram
*/
static constexpr const char *kMetricFaasMemUsage = "metric.faas.mem_usage";
static constexpr const char *kMetricFaasMemUsage = "faas.mem_usage";
static constexpr const char *descrMetricFaasMemUsage =
"Distribution of max memory usage per invocation";
static constexpr const char *unitMetricFaasMemUsage = "By";
Expand All @@ -229,7 +229,7 @@ static inline nostd::unique_ptr<metrics::Histogram<double>> CreateSyncDoubleMetr
* <p>
* histogram
*/
static constexpr const char *kMetricFaasNetIo = "metric.faas.net_io";
static constexpr const char *kMetricFaasNetIo = "faas.net_io";
static constexpr const char *descrMetricFaasNetIo = "Distribution of net I/O usage per invocation";
static constexpr const char *unitMetricFaasNetIo = "By";

Expand All @@ -250,7 +250,7 @@ static inline nostd::unique_ptr<metrics::Histogram<double>> CreateSyncDoubleMetr
* <p>
* counter
*/
static constexpr const char *kMetricFaasTimeouts = "metric.faas.timeouts";
static constexpr const char *kMetricFaasTimeouts = "faas.timeouts";
static constexpr const char *descrMetricFaasTimeouts = "Number of invocation timeouts";
static constexpr const char *unitMetricFaasTimeouts = "{timeout}";

Expand Down
Loading

0 comments on commit 23c7a98

Please sign in to comment.