Skip to content

Commit 7af0a81

Browse files
committed
merged from upstream
2 parents e338673 + 930b694 commit 7af0a81

34 files changed

+5102
-584
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@ Increment the:
2929
* [CONFIGURATION] File configuration - prometheus translation
3030
[#3715](https://github.com/open-telemetry/opentelemetry-cpp/pull/3715)
3131

32+
* [BUILD] Upgrade to opentelemetry-proto 1.8.0
33+
[#3730](https://github.com/open-telemetry/opentelemetry-cpp/pull/3730)
34+
35+
New Features:
36+
37+
* [CONFIGURATION] Implement declarative configuration (config.yaml)
38+
[#2518](https://github.com/open-telemetry/opentelemetry-cpp/pull/2518)
39+
40+
* Configuration for opentelemetry-cpp can now be done using a config.yaml
41+
file, instead of using environment variables.
42+
* See [opentelemetry-configuration](https://github.com/open-telemetry/opentelemetry-configuration)
43+
3244
## [1.23 2025-09-25]
3345

3446
* [CodeHealth] Fix clang-tidy warnings part 6

api/include/opentelemetry/semconv/http_attributes.h

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,23 @@ static constexpr const char *kHttpRequestHeader = "http.request.header";
4343
<p>
4444
HTTP request method value SHOULD be "known" to the instrumentation.
4545
By default, this convention defines "known" methods as the ones listed in <a
46-
href="https://www.rfc-editor.org/rfc/rfc9110.html#name-methods">RFC9110</a> and the PATCH method
47-
defined in <a href="https://www.rfc-editor.org/rfc/rfc5789.html">RFC5789</a>. <p> If the HTTP
48-
request method is not known to instrumentation, it MUST set the @code http.request.method @endcode
49-
attribute to @code _OTHER @endcode. <p> If the HTTP instrumentation could end up converting valid
50-
HTTP request methods to @code _OTHER @endcode, then it MUST provide a way to override the list of
51-
known HTTP methods. If this override is done via environment variable, then the environment
52-
variable MUST be named OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list
53-
of case-sensitive known HTTP methods (this list MUST be a full override of the default known
54-
method, it is not a list of known methods in addition to the defaults). <p> HTTP method names are
55-
case-sensitive and @code http.request.method @endcode attribute value MUST match a known HTTP
56-
method name exactly. Instrumentations for specific web frameworks that consider HTTP methods to be
57-
case insensitive, SHOULD populate a canonical equivalent. Tracing instrumentations that do so,
58-
MUST also set @code http.request.method_original @endcode to the original value.
46+
href="https://www.rfc-editor.org/rfc/rfc9110.html#name-methods">RFC9110</a>, the PATCH method
47+
defined in <a href="https://www.rfc-editor.org/rfc/rfc5789.html">RFC5789</a> and the QUERY method
48+
defined in <a
49+
href="https://datatracker.ietf.org/doc/draft-ietf-httpbis-safe-method-w-body/?include_text=1">httpbis-safe-method-w-body</a>.
50+
<p>
51+
If the HTTP request method is not known to instrumentation, it MUST set the @code
52+
http.request.method @endcode attribute to @code _OTHER @endcode. <p> If the HTTP instrumentation
53+
could end up converting valid HTTP request methods to @code _OTHER @endcode, then it MUST provide
54+
a way to override the list of known HTTP methods. If this override is done via environment
55+
variable, then the environment variable MUST be named OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and
56+
support a comma-separated list of case-sensitive known HTTP methods (this list MUST be a full
57+
override of the default known method, it is not a list of known methods in addition to the
58+
defaults). <p> HTTP method names are case-sensitive and @code http.request.method @endcode
59+
attribute value MUST match a known HTTP method name exactly. Instrumentations for specific web
60+
frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical
61+
equivalent. Tracing instrumentations that do so, MUST also set @code http.request.method_original
62+
@endcode to the original value.
5963
*/
6064
static constexpr const char *kHttpRequestMethod = "http.request.method";
6165

@@ -97,11 +101,19 @@ static constexpr const char *kHttpResponseHeader = "http.response.header";
97101
static constexpr const char *kHttpResponseStatusCode = "http.response.status_code";
98102

99103
/**
100-
The matched route, that is, the path template in the format used by the respective server
101-
framework. <p> MUST NOT be populated when this is not supported by the HTTP server framework as
102-
the route attribute should have low-cardinality and the URI path can NOT substitute it. SHOULD
103-
include the <a href="/docs/http/http-spans.md#http-server-definitions">application root</a> if
104-
there is one.
104+
The matched route template for the request. This MUST be low-cardinality and include all static
105+
path segments, with dynamic path segments represented with placeholders. <p> MUST NOT be populated
106+
when this is not supported by the HTTP server framework as the route attribute should have
107+
low-cardinality and the URI path can NOT substitute it. SHOULD include the <a
108+
href="/docs/http/http-spans.md#http-server-definitions">application root</a> if there is one. <p>
109+
A static path segment is a part of the route template with a fixed, low-cardinality value. This
110+
includes literal strings like @code /users/ @endcode and placeholders that are constrained to a
111+
finite, predefined set of values, e.g. @code {controller} @endcode or @code {action} @endcode. <p>
112+
A dynamic path segment is a placeholder for a value that can have high cardinality and is not
113+
constrained to a predefined list like static path segments. <p> Instrumentations SHOULD use
114+
routing information provided by the corresponding web framework. They SHOULD pick the most precise
115+
source of routing information and MAY support custom route formatting. Instrumentations SHOULD
116+
document the format and the API used to obtain the route string.
105117
*/
106118
static constexpr const char *kHttpRoute = "http.route";
107119

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,24 @@ static constexpr const char *kAppScreenCoordinateX = "app.screen.coordinate.x";
8080
*/
8181
static constexpr const char *kAppScreenCoordinateY = "app.screen.coordinate.y";
8282

83+
/**
84+
An identifier that uniquely differentiates this screen from other screens in the same application.
85+
<p>
86+
A screen represents only the part of the device display drawn by the app. It typically contains
87+
multiple widgets or UI components and is larger in scope than individual widgets. Multiple screens
88+
can coexist on the same display simultaneously (e.g., split view on tablets).
89+
*/
90+
static constexpr const char *kAppScreenId = "app.screen.id";
91+
92+
/**
93+
The name of an application screen.
94+
<p>
95+
A screen represents only the part of the device display drawn by the app. It typically contains
96+
multiple widgets or UI components and is larger in scope than individual widgets. Multiple screens
97+
can coexist on the same display simultaneously (e.g., split view on tablets).
98+
*/
99+
static constexpr const char *kAppScreenName = "app.screen.name";
100+
83101
/**
84102
An identifier that uniquely differentiates this widget from other widgets in the same application.
85103
<p>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ static constexpr const char *kAzureCosmosdbConsistencyLevel = "azure.cosmosdb.co
3939
List of regions contacted during operation in the order that they were contacted. If there is more
4040
than one region listed, it indicates that the operation was performed on multiple regions i.e.
4141
cross-regional call. <p> Region name matches the format of @code displayName @endcode in <a
42-
href="https://learn.microsoft.com/rest/api/subscription/subscriptions/list-locations?view=rest-subscription-2021-10-01&tabs=HTTP#location">Azure
43-
Location API</a>
42+
href="https://learn.microsoft.com/rest/api/resources/subscriptions/list-locations">Azure Location
43+
API</a>
4444
*/
4545
static constexpr const char *kAzureCosmosdbOperationContactedRegions =
4646
"azure.cosmosdb.operation.contacted_regions";

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ static constexpr const char *kContainerId = "container.id";
7373
<p>
7474
Docker defines a sha256 of the image id; @code container.image.id @endcode corresponds to the
7575
@code Image @endcode field from the Docker container inspect <a
76-
href="https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect">API</a>
76+
href="https://docs.docker.com/reference/api/engine/version/v1.43/#tag/Container/operation/ContainerInspect">API</a>
7777
endpoint. K8s defines a link to the container registry repository with digest @code "imageID":
7878
"registry.azurecr.io
7979
/namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"
@@ -91,7 +91,8 @@ static constexpr const char *kContainerImageName = "container.image.name";
9191
/**
9292
Repo digests of the container image as provided by the container runtime.
9393
<p>
94-
<a href="https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect">Docker</a>
94+
<a
95+
href="https://docs.docker.com/reference/api/engine/version/v1.43/#tag/Image/operation/ImageInspect">Docker</a>
9596
and <a
9697
href="https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238">CRI</a>
9798
report those under the @code RepoDigests @endcode field.
@@ -100,9 +101,9 @@ static constexpr const char *kContainerImageRepoDigests = "container.image.repo_
100101

101102
/**
102103
Container image tags. An example can be found in <a
103-
href="https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect">Docker Image
104-
Inspect</a>. Should be only the @code <tag> @endcode section of the full name for example from
105-
@code registry.example.com/my-org/my-image:<tag> @endcode.
104+
href="https://docs.docker.com/reference/api/engine/version/v1.43/#tag/Image/operation/ImageInspect">Docker
105+
Image Inspect</a>. Should be only the @code <tag> @endcode section of the full name for example
106+
from @code registry.example.com/my-org/my-image:<tag> @endcode.
106107
*/
107108
static constexpr const char *kContainerImageTags = "container.image.tags";
108109

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

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,151 @@ CreateAsyncDoubleMetricContainerFilesystemUsage(metrics::Meter *meter)
289289
unitMetricContainerFilesystemUsage);
290290
}
291291

292+
/**
293+
Container memory available.
294+
<p>
295+
Available memory for use. This is defined as the memory limit - workingSetBytes. If memory limit
296+
is undefined, the available bytes is omitted. In general, this metric can be derived from <a
297+
href="https://github.com/google/cadvisor/blob/v0.53.0/docs/storage/prometheus.md#prometheus-container-metrics">cadvisor</a>
298+
and by subtracting the @code container_memory_working_set_bytes @endcode metric from the @code
299+
container_spec_memory_limit_bytes @endcode metric. In K8s, this metric is derived from the <a
300+
href="https://pkg.go.dev/k8s.io/[email protected]/pkg/apis/stats/v1alpha1#MemoryStats">MemoryStats.AvailableBytes</a>
301+
field of the <a
302+
href="https://pkg.go.dev/k8s.io/[email protected]/pkg/apis/stats/v1alpha1#PodStats">PodStats.Memory</a>
303+
of the Kubelet's stats API. <p> updowncounter
304+
*/
305+
static constexpr const char *kMetricContainerMemoryAvailable = "container.memory.available";
306+
static constexpr const char *descrMetricContainerMemoryAvailable = "Container memory available.";
307+
static constexpr const char *unitMetricContainerMemoryAvailable = "By";
308+
309+
static inline nostd::unique_ptr<metrics::UpDownCounter<int64_t>>
310+
CreateSyncInt64MetricContainerMemoryAvailable(metrics::Meter *meter)
311+
{
312+
return meter->CreateInt64UpDownCounter(kMetricContainerMemoryAvailable,
313+
descrMetricContainerMemoryAvailable,
314+
unitMetricContainerMemoryAvailable);
315+
}
316+
317+
static inline nostd::unique_ptr<metrics::UpDownCounter<double>>
318+
CreateSyncDoubleMetricContainerMemoryAvailable(metrics::Meter *meter)
319+
{
320+
return meter->CreateDoubleUpDownCounter(kMetricContainerMemoryAvailable,
321+
descrMetricContainerMemoryAvailable,
322+
unitMetricContainerMemoryAvailable);
323+
}
324+
325+
static inline nostd::shared_ptr<metrics::ObservableInstrument>
326+
CreateAsyncInt64MetricContainerMemoryAvailable(metrics::Meter *meter)
327+
{
328+
return meter->CreateInt64ObservableUpDownCounter(kMetricContainerMemoryAvailable,
329+
descrMetricContainerMemoryAvailable,
330+
unitMetricContainerMemoryAvailable);
331+
}
332+
333+
static inline nostd::shared_ptr<metrics::ObservableInstrument>
334+
CreateAsyncDoubleMetricContainerMemoryAvailable(metrics::Meter *meter)
335+
{
336+
return meter->CreateDoubleObservableUpDownCounter(kMetricContainerMemoryAvailable,
337+
descrMetricContainerMemoryAvailable,
338+
unitMetricContainerMemoryAvailable);
339+
}
340+
341+
/**
342+
Container memory paging faults.
343+
<p>
344+
In general, this metric can be derived from <a
345+
href="https://github.com/google/cadvisor/blob/v0.53.0/docs/storage/prometheus.md#prometheus-container-metrics">cadvisor</a>
346+
and specifically the @code container_memory_failures_total{failure_type=pgfault, scope=container}
347+
@endcode and @code container_memory_failures_total{failure_type=pgmajfault, scope=container}
348+
@endcodemetric. In K8s, this metric is derived from the <a
349+
href="https://pkg.go.dev/k8s.io/[email protected]/pkg/apis/stats/v1alpha1#MemoryStats">MemoryStats.PageFaults</a>
350+
and <a
351+
href="https://pkg.go.dev/k8s.io/[email protected]/pkg/apis/stats/v1alpha1#MemoryStats">MemoryStats.MajorPageFaults</a>
352+
field of the <a
353+
href="https://pkg.go.dev/k8s.io/[email protected]/pkg/apis/stats/v1alpha1#PodStats">PodStats.Memory</a>
354+
of the Kubelet's stats API. <p> counter
355+
*/
356+
static constexpr const char *kMetricContainerMemoryPagingFaults = "container.memory.paging.faults";
357+
static constexpr const char *descrMetricContainerMemoryPagingFaults =
358+
"Container memory paging faults.";
359+
static constexpr const char *unitMetricContainerMemoryPagingFaults = "{fault}";
360+
361+
static inline nostd::unique_ptr<metrics::Counter<uint64_t>>
362+
CreateSyncInt64MetricContainerMemoryPagingFaults(metrics::Meter *meter)
363+
{
364+
return meter->CreateUInt64Counter(kMetricContainerMemoryPagingFaults,
365+
descrMetricContainerMemoryPagingFaults,
366+
unitMetricContainerMemoryPagingFaults);
367+
}
368+
369+
static inline nostd::unique_ptr<metrics::Counter<double>>
370+
CreateSyncDoubleMetricContainerMemoryPagingFaults(metrics::Meter *meter)
371+
{
372+
return meter->CreateDoubleCounter(kMetricContainerMemoryPagingFaults,
373+
descrMetricContainerMemoryPagingFaults,
374+
unitMetricContainerMemoryPagingFaults);
375+
}
376+
377+
static inline nostd::shared_ptr<metrics::ObservableInstrument>
378+
CreateAsyncInt64MetricContainerMemoryPagingFaults(metrics::Meter *meter)
379+
{
380+
return meter->CreateInt64ObservableCounter(kMetricContainerMemoryPagingFaults,
381+
descrMetricContainerMemoryPagingFaults,
382+
unitMetricContainerMemoryPagingFaults);
383+
}
384+
385+
static inline nostd::shared_ptr<metrics::ObservableInstrument>
386+
CreateAsyncDoubleMetricContainerMemoryPagingFaults(metrics::Meter *meter)
387+
{
388+
return meter->CreateDoubleObservableCounter(kMetricContainerMemoryPagingFaults,
389+
descrMetricContainerMemoryPagingFaults,
390+
unitMetricContainerMemoryPagingFaults);
391+
}
392+
393+
/**
394+
Container memory RSS.
395+
<p>
396+
In general, this metric can be derived from <a
397+
href="https://github.com/google/cadvisor/blob/v0.53.0/docs/storage/prometheus.md#prometheus-container-metrics">cadvisor</a>
398+
and specifically the @code container_memory_rss @endcode metric. In K8s, this metric is derived
399+
from the <a
400+
href="https://pkg.go.dev/k8s.io/[email protected]/pkg/apis/stats/v1alpha1#MemoryStats">MemoryStats.RSSBytes</a>
401+
field of the <a
402+
href="https://pkg.go.dev/k8s.io/[email protected]/pkg/apis/stats/v1alpha1#PodStats">PodStats.Memory</a>
403+
of the Kubelet's stats API. <p> updowncounter
404+
*/
405+
static constexpr const char *kMetricContainerMemoryRss = "container.memory.rss";
406+
static constexpr const char *descrMetricContainerMemoryRss = "Container memory RSS.";
407+
static constexpr const char *unitMetricContainerMemoryRss = "By";
408+
409+
static inline nostd::unique_ptr<metrics::UpDownCounter<int64_t>>
410+
CreateSyncInt64MetricContainerMemoryRss(metrics::Meter *meter)
411+
{
412+
return meter->CreateInt64UpDownCounter(kMetricContainerMemoryRss, descrMetricContainerMemoryRss,
413+
unitMetricContainerMemoryRss);
414+
}
415+
416+
static inline nostd::unique_ptr<metrics::UpDownCounter<double>>
417+
CreateSyncDoubleMetricContainerMemoryRss(metrics::Meter *meter)
418+
{
419+
return meter->CreateDoubleUpDownCounter(kMetricContainerMemoryRss, descrMetricContainerMemoryRss,
420+
unitMetricContainerMemoryRss);
421+
}
422+
423+
static inline nostd::shared_ptr<metrics::ObservableInstrument>
424+
CreateAsyncInt64MetricContainerMemoryRss(metrics::Meter *meter)
425+
{
426+
return meter->CreateInt64ObservableUpDownCounter(
427+
kMetricContainerMemoryRss, descrMetricContainerMemoryRss, unitMetricContainerMemoryRss);
428+
}
429+
430+
static inline nostd::shared_ptr<metrics::ObservableInstrument>
431+
CreateAsyncDoubleMetricContainerMemoryRss(metrics::Meter *meter)
432+
{
433+
return meter->CreateDoubleObservableUpDownCounter(
434+
kMetricContainerMemoryRss, descrMetricContainerMemoryRss, unitMetricContainerMemoryRss);
435+
}
436+
292437
/**
293438
Memory usage of the container.
294439
<p>
@@ -328,6 +473,54 @@ CreateAsyncDoubleMetricContainerMemoryUsage(metrics::Meter *meter)
328473
kMetricContainerMemoryUsage, descrMetricContainerMemoryUsage, unitMetricContainerMemoryUsage);
329474
}
330475

476+
/**
477+
Container memory working set.
478+
<p>
479+
In general, this metric can be derived from <a
480+
href="https://github.com/google/cadvisor/blob/v0.53.0/docs/storage/prometheus.md#prometheus-container-metrics">cadvisor</a>
481+
and specifically the @code container_memory_working_set_bytes @endcode metric. In K8s, this metric
482+
is derived from the <a
483+
href="https://pkg.go.dev/k8s.io/[email protected]/pkg/apis/stats/v1alpha1#MemoryStats">MemoryStats.WorkingSetBytes</a>
484+
field of the <a
485+
href="https://pkg.go.dev/k8s.io/[email protected]/pkg/apis/stats/v1alpha1#PodStats">PodStats.Memory</a>
486+
of the Kubelet's stats API. <p> updowncounter
487+
*/
488+
static constexpr const char *kMetricContainerMemoryWorkingSet = "container.memory.working_set";
489+
static constexpr const char *descrMetricContainerMemoryWorkingSet = "Container memory working set.";
490+
static constexpr const char *unitMetricContainerMemoryWorkingSet = "By";
491+
492+
static inline nostd::unique_ptr<metrics::UpDownCounter<int64_t>>
493+
CreateSyncInt64MetricContainerMemoryWorkingSet(metrics::Meter *meter)
494+
{
495+
return meter->CreateInt64UpDownCounter(kMetricContainerMemoryWorkingSet,
496+
descrMetricContainerMemoryWorkingSet,
497+
unitMetricContainerMemoryWorkingSet);
498+
}
499+
500+
static inline nostd::unique_ptr<metrics::UpDownCounter<double>>
501+
CreateSyncDoubleMetricContainerMemoryWorkingSet(metrics::Meter *meter)
502+
{
503+
return meter->CreateDoubleUpDownCounter(kMetricContainerMemoryWorkingSet,
504+
descrMetricContainerMemoryWorkingSet,
505+
unitMetricContainerMemoryWorkingSet);
506+
}
507+
508+
static inline nostd::shared_ptr<metrics::ObservableInstrument>
509+
CreateAsyncInt64MetricContainerMemoryWorkingSet(metrics::Meter *meter)
510+
{
511+
return meter->CreateInt64ObservableUpDownCounter(kMetricContainerMemoryWorkingSet,
512+
descrMetricContainerMemoryWorkingSet,
513+
unitMetricContainerMemoryWorkingSet);
514+
}
515+
516+
static inline nostd::shared_ptr<metrics::ObservableInstrument>
517+
CreateAsyncDoubleMetricContainerMemoryWorkingSet(metrics::Meter *meter)
518+
{
519+
return meter->CreateDoubleObservableUpDownCounter(kMetricContainerMemoryWorkingSet,
520+
descrMetricContainerMemoryWorkingSet,
521+
unitMetricContainerMemoryWorkingSet);
522+
}
523+
331524
/**
332525
Network bytes for the container.
333526
<p>

0 commit comments

Comments
 (0)