Skip to content

Commit c81a3d4

Browse files
authored
[SEMANTIC CONVENTIONS] Upgrade to semantic conventions 1.28.0 (open-telemetry#3139)
1 parent f7a9aea commit c81a3d4

25 files changed

+1398
-69
lines changed

api/include/opentelemetry/semconv/incubating/az_attributes.h

+7
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ namespace semconv
1919
namespace az
2020
{
2121

22+
/**
23+
* <a
24+
* href="https://learn.microsoft.com/azure/azure-resource-manager/management/azure-services-resource-providers">Azure
25+
* Resource Provider Namespace</a> as recognized by the client.
26+
*/
27+
static constexpr const char *kAzNamespace = "az.namespace";
28+
2229
/**
2330
* The unique identifier of the service request. It's generated by the Azure service and returned
2431
* with the response.

api/include/opentelemetry/semconv/incubating/cloud_attributes.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static constexpr const char *kCloudRegion = "cloud.region";
7777
* href="https://docs.microsoft.com/rest/api/resources/resources/get-by-id">Fully Qualified Resource
7878
* ID</a> of the invoked function, <em>not</em> the function app, having the form
7979
* @code
80-
* /subscriptions/<SUBSCIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC>
80+
* /subscriptions/<SUBSCRIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC>
8181
* @endcode. This means that a span attribute MUST be used, as an Azure function app can host
8282
* multiple functions that would usually share a TracerProvider.</li>
8383
* </ul>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
/*
7+
* DO NOT EDIT, this is an Auto-generated file from:
8+
* buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2
9+
*/
10+
11+
#pragma once
12+
13+
#include "opentelemetry/common/macros.h"
14+
#include "opentelemetry/version.h"
15+
16+
OPENTELEMETRY_BEGIN_NAMESPACE
17+
namespace semconv
18+
{
19+
namespace cloudfoundry
20+
{
21+
22+
/**
23+
* The guid of the application.
24+
* <p>
25+
* Application instrumentation should use the value from environment
26+
* variable @code VCAP_APPLICATION.application_id @endcode. This is the same value as
27+
* reported by @code cf app <app-name> --guid @endcode.
28+
*/
29+
static constexpr const char *kCloudfoundryAppId = "cloudfoundry.app.id";
30+
31+
/**
32+
* The index of the application instance. 0 when just one instance is active.
33+
* <p>
34+
* CloudFoundry defines the @code instance_id @endcode in the <a
35+
* href="https://github.com/cloudfoundry/loggregator-api#v2-envelope">Loggegator v2 envelope</a>. It
36+
* is used for logs and metrics emitted by CloudFoundry. It is supposed to contain the application
37+
* instance index for applications deployed on the runtime. <p> Application instrumentation should
38+
* use the value from environment variable @code CF_INSTANCE_INDEX @endcode.
39+
*/
40+
static constexpr const char *kCloudfoundryAppInstanceId = "cloudfoundry.app.instance.id";
41+
42+
/**
43+
* The name of the application.
44+
* <p>
45+
* Application instrumentation should use the value from environment
46+
* variable @code VCAP_APPLICATION.application_name @endcode. This is the same value
47+
* as reported by @code cf apps @endcode.
48+
*/
49+
static constexpr const char *kCloudfoundryAppName = "cloudfoundry.app.name";
50+
51+
/**
52+
* The guid of the CloudFoundry org the application is running in.
53+
* <p>
54+
* Application instrumentation should use the value from environment
55+
* variable @code VCAP_APPLICATION.org_id @endcode. This is the same value as
56+
* reported by @code cf org <org-name> --guid @endcode.
57+
*/
58+
static constexpr const char *kCloudfoundryOrgId = "cloudfoundry.org.id";
59+
60+
/**
61+
* The name of the CloudFoundry organization the app is running in.
62+
* <p>
63+
* Application instrumentation should use the value from environment
64+
* variable @code VCAP_APPLICATION.org_name @endcode. This is the same value as
65+
* reported by @code cf orgs @endcode.
66+
*/
67+
static constexpr const char *kCloudfoundryOrgName = "cloudfoundry.org.name";
68+
69+
/**
70+
* The UID identifying the process.
71+
* <p>
72+
* Application instrumentation should use the value from environment
73+
* variable @code VCAP_APPLICATION.process_id @endcode. It is supposed to be equal to
74+
* @code VCAP_APPLICATION.app_id @endcode for applications deployed to the runtime.
75+
* For system components, this could be the actual PID.
76+
*/
77+
static constexpr const char *kCloudfoundryProcessId = "cloudfoundry.process.id";
78+
79+
/**
80+
* The type of process.
81+
* <p>
82+
* CloudFoundry applications can consist of multiple jobs. Usually the
83+
* main process will be of type @code web @endcode. There can be additional background
84+
* tasks or side-cars with different process types.
85+
*/
86+
static constexpr const char *kCloudfoundryProcessType = "cloudfoundry.process.type";
87+
88+
/**
89+
* The guid of the CloudFoundry space the application is running in.
90+
* <p>
91+
* Application instrumentation should use the value from environment
92+
* variable @code VCAP_APPLICATION.space_id @endcode. This is the same value as
93+
* reported by @code cf space <space-name> --guid @endcode.
94+
*/
95+
static constexpr const char *kCloudfoundrySpaceId = "cloudfoundry.space.id";
96+
97+
/**
98+
* The name of the CloudFoundry space the application is running in.
99+
* <p>
100+
* Application instrumentation should use the value from environment
101+
* variable @code VCAP_APPLICATION.space_name @endcode. This is the same value as
102+
* reported by @code cf spaces @endcode.
103+
*/
104+
static constexpr const char *kCloudfoundrySpaceName = "cloudfoundry.space.name";
105+
106+
/**
107+
* A guid or another name describing the event source.
108+
* <p>
109+
* CloudFoundry defines the @code source_id @endcode in the <a
110+
* href="https://github.com/cloudfoundry/loggregator-api#v2-envelope">Loggregator v2 envelope</a>.
111+
* It is used for logs and metrics emitted by CloudFoundry. It is
112+
* supposed to contain the component name, e.g. "gorouter", for
113+
* CloudFoundry components.
114+
* <p>
115+
* When system components are instrumented, values from the
116+
* <a href="https://bosh.io/docs/jobs/#properties-spec">Bosh spec</a>
117+
* should be used. The @code system.id @endcode should be set to
118+
* @code spec.deployment/spec.name @endcode.
119+
*/
120+
static constexpr const char *kCloudfoundrySystemId = "cloudfoundry.system.id";
121+
122+
/**
123+
* A guid describing the concrete instance of the event source.
124+
* <p>
125+
* CloudFoundry defines the @code instance_id @endcode in the <a
126+
* href="https://github.com/cloudfoundry/loggregator-api#v2-envelope">Loggregator v2 envelope</a>.
127+
* It is used for logs and metrics emitted by CloudFoundry. It is
128+
* supposed to contain the vm id for CloudFoundry components.
129+
* <p>
130+
* When system components are instrumented, values from the
131+
* <a href="https://bosh.io/docs/jobs/#properties-spec">Bosh spec</a>
132+
* should be used. The @code system.instance.id @endcode should be set to @code spec.id @endcode.
133+
*/
134+
static constexpr const char *kCloudfoundrySystemInstanceId = "cloudfoundry.system.instance.id";
135+
136+
} // namespace cloudfoundry
137+
} // namespace semconv
138+
OPENTELEMETRY_END_NAMESPACE

api/include/opentelemetry/semconv/incubating/container_attributes.h

+19-3
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ namespace container
2828
static constexpr const char *kContainerCommand = "container.command";
2929

3030
/**
31-
* All the command arguments (including the command/executable itself) run by the container. [2]
31+
* All the command arguments (including the command/executable itself) run by the container.
3232
*/
3333
static constexpr const char *kContainerCommandArgs = "container.command_args";
3434

3535
/**
36-
* The full command run by the container as a single string representing the full command. [2]
36+
* The full command run by the container as a single string representing the full command.
3737
*/
3838
static constexpr const char *kContainerCommandLine = "container.command_line";
3939

@@ -46,9 +46,25 @@ static constexpr const char *kContainerCommandLine = "container.command_line";
4646
OPENTELEMETRY_DEPRECATED
4747
static constexpr const char *kContainerCpuState = "container.cpu.state";
4848

49+
/**
50+
* The name of the CSI (<a href="https://github.com/container-storage-interface/spec">Container
51+
* Storage Interface</a>) plugin used by the volume. <p> This can sometimes be referred to as a
52+
* "driver" in CSI implementations. This should represent the @code name @endcode field of the
53+
* GetPluginInfo RPC.
54+
*/
55+
static constexpr const char *kContainerCsiPluginName = "container.csi.plugin.name";
56+
57+
/**
58+
* The unique volume ID returned by the CSI (<a
59+
* href="https://github.com/container-storage-interface/spec">Container Storage Interface</a>)
60+
* plugin. <p> This can sometimes be referred to as a "volume handle" in CSI implementations. This
61+
* should represent the @code Volume.volume_id @endcode field in CSI spec.
62+
*/
63+
static constexpr const char *kContainerCsiVolumeId = "container.csi.volume.id";
64+
4965
/**
5066
* Container ID. Usually a UUID, as for example used to <a
51-
* href="https://docs.docker.com/engine/reference/run/#container-identification">identify Docker
67+
* href="https://docs.docker.com/engine/containers/run/#container-identification">identify Docker
5268
* containers</a>. The UUID might be abbreviated.
5369
*/
5470
static constexpr const char *kContainerId = "container.id";

api/include/opentelemetry/semconv/incubating/container_metrics.h

+43
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,49 @@ CreateAsyncDoubleMetricContainerCpuTime(metrics::Meter *meter)
5959
unitMetricContainerCpuTime);
6060
}
6161

62+
/**
63+
* Container's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs
64+
* <p>
65+
* CPU usage of the specific container on all available CPU cores, averaged over the sample window
66+
* <p>
67+
* gauge
68+
*/
69+
static constexpr const char *kMetricContainerCpuUsage = "metric.container.cpu.usage";
70+
static constexpr const char *descrMetricContainerCpuUsage =
71+
"Container's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs";
72+
static constexpr const char *unitMetricContainerCpuUsage = "{cpu}";
73+
74+
#if OPENTELEMETRY_ABI_VERSION_NO >= 2
75+
76+
static inline nostd::unique_ptr<metrics::Gauge<int64_t>> CreateSyncInt64MetricContainerCpuUsage(
77+
metrics::Meter *meter)
78+
{
79+
return meter->CreateInt64Gauge(kMetricContainerCpuUsage, descrMetricContainerCpuUsage,
80+
unitMetricContainerCpuUsage);
81+
}
82+
83+
static inline nostd::unique_ptr<metrics::Gauge<double>> CreateSyncDoubleMetricContainerCpuUsage(
84+
metrics::Meter *meter)
85+
{
86+
return meter->CreateDoubleGauge(kMetricContainerCpuUsage, descrMetricContainerCpuUsage,
87+
unitMetricContainerCpuUsage);
88+
}
89+
#endif /* OPENTELEMETRY_ABI_VERSION_NO */
90+
91+
static inline nostd::shared_ptr<metrics::ObservableInstrument>
92+
CreateAsyncInt64MetricContainerCpuUsage(metrics::Meter *meter)
93+
{
94+
return meter->CreateInt64ObservableGauge(kMetricContainerCpuUsage, descrMetricContainerCpuUsage,
95+
unitMetricContainerCpuUsage);
96+
}
97+
98+
static inline nostd::shared_ptr<metrics::ObservableInstrument>
99+
CreateAsyncDoubleMetricContainerCpuUsage(metrics::Meter *meter)
100+
{
101+
return meter->CreateDoubleObservableGauge(kMetricContainerCpuUsage, descrMetricContainerCpuUsage,
102+
unitMetricContainerCpuUsage);
103+
}
104+
62105
/**
63106
* Disk bytes for the container.
64107
* <p>

0 commit comments

Comments
 (0)