Skip to content

Commit 01cc951

Browse files
authored
Merge branch 'main' into add-vendor-pb
2 parents 89fdc3d + a061555 commit 01cc951

File tree

285 files changed

+1305
-570
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

285 files changed

+1305
-570
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
---
2+
title: OTTL contexts just got easier with context inference
3+
linkTitle: OTTL contexts just got easier
4+
date: 2025-02-20
5+
author: '[Edmo Vamerlatti Costa](https://github.com/edmocosta) (Elastic)'
6+
issue: 6289
7+
sig: Collector SIG
8+
cSpell:ignore: OTTL Vamerlatti
9+
---
10+
11+
Selecting the right OTTL context for running statements can be challenging, even
12+
for experienced users. Choosing the correct option impacts both accuracy and
13+
efficiency, as using higher-level OTTL contexts can avoid unnecessary iterations
14+
through nested lower-level contexts.
15+
16+
To simplify this process, the OpenTelemetry community is excited to announce
17+
OTTL
18+
[context inference](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/transformprocessor/README.md#context-inference)
19+
support for the
20+
[transform processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/transformprocessor).
21+
This feature removes the need for users to understand the underlying context
22+
concept of OTTL, allowing them to focus solely on their data. It also improves
23+
statement processing efficiency by automatically selecting the most appropriate
24+
OTTL context. This optimization ensures that data transformations are both
25+
accurate and performant.
26+
27+
## How does it work?
28+
29+
Starting with version `0.120.0`, the transform processor supports two new
30+
context-inferred configuration styles. The first one offers a simpler and
31+
flatter approach, while the second closely resembles the existing configuration
32+
format.
33+
34+
### Basic configuration
35+
36+
The
37+
[basic configuration](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/transformprocessor/README.md#basic-config)
38+
style simplifies configuration by allowing users to list all statements
39+
together, without worrying about OTTL contexts or extra configuration
40+
structures. This style support statements from multiple OTTL contexts and does
41+
not require grouping them separately.
42+
43+
To illustrate this, compare the following configuration:
44+
45+
```yaml
46+
metric_statements:
47+
- context: resource
48+
statements:
49+
- keep_keys(attributes, ["host.name"])
50+
- context: metric
51+
statements:
52+
- set(description, "Sum") where type == "Sum"
53+
- convert_sum_to_gauge() where name == "system.processes.count"
54+
- context: datapoint
55+
statements:
56+
- limit(attributes, 100, ["host.name"])
57+
```
58+
59+
With the new basic configuration style, the same logic is expressed more
60+
concisely by simply providing a list of statements:
61+
62+
```yaml
63+
metric_statements:
64+
- keep_keys(resource.attributes, ["host.name"])
65+
- set(metric.description, "Sum") where metric.type == "Sum"
66+
- convert_sum_to_gauge() where metric.name == "system.processes.count"
67+
- limit(datapoint.attributes, 100, ["host.name"])
68+
```
69+
70+
This streamlined approach enhances readability and makes configuration more
71+
intuitive. To use this configuration style, all paths in the statements must be
72+
prefixed with their respective OTTL contexts. These prefixes are required for
73+
all context-inferred configurations and serve as hints for selecting the best
74+
match. It also makes statements unambiguous and portable between components
75+
using OTTL.
76+
77+
### Advanced configuration
78+
79+
The context-inferred
80+
[advanced configuration](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/transformprocessor/README.md#advanced-config)
81+
style closely resembles the existing format and allows users to leverage the
82+
benefits of context inference while providing granular control over statement
83+
configurations, such as `error_mode` and `conditions`. For example, consider the
84+
following configuration:
85+
86+
```yaml
87+
metric_statements:
88+
- context: datapoint
89+
conditions:
90+
- resource.attributes["service.name"] == "my.service"
91+
statements:
92+
- set(metric.description, "counter") where attributes["my.attr"] == "some"
93+
```
94+
95+
The above can now be written as:
96+
97+
<!-- prettier-ignore -->
98+
```yaml
99+
metric_statements:
100+
- conditions:
101+
- resource.attributes["service.name"] == "my.service"
102+
statements:
103+
- set(metric.description, "counter") where datapoint.attributes["my.attr"] == "some"
104+
```
105+
106+
In this example, the `context` value is omitted and is automatically inferred to
107+
`datapoint`, as it is the only OTTL context present in the statements that
108+
supports parsing both `datapoint` and `metric` data.
109+
110+
If we update the above configuration removing the `datapoint` usage:
111+
112+
```yaml
113+
metric_statements:
114+
- conditions:
115+
- resource.attributes["service.name"] == "my.service"
116+
statements:
117+
- set(metric.description, "counter")
118+
```
119+
120+
The context inferrer would select the `metric` OTTL context instead, since no
121+
data points are accessed. Although it would be possible to run the statements
122+
using the `datapoint` OTTL context, `metric` is the most efficient option.
123+
124+
### Which configuration style should I choose?
125+
126+
The [basic configuration](#basic-configuration) style is best suited for
127+
scenarios where simplicity and ease of use are paramount. It is ideal for simple
128+
use cases where your configuration needs are straightforward and do not require
129+
the use of additional configurations keys, allowing you to quickly set up your
130+
statements with minimal effort and without needing to understand the underlying
131+
concept of OTTL contexts.
132+
133+
The [advanced configuration](#advanced-configuration) style is more detailed and
134+
allows the use of additional configuration keys such as `error_mode` and
135+
`conditions`. It supports statements from multiple OTTL contexts. However,
136+
unlike the basic configuration style, it may require splitting them into
137+
separate configuration groups (see
138+
[advanced config](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/transformprocessor#advanced-config)).
139+
In terms of performance, the advanced configuration is slightly faster than the
140+
basic configuration, making it a better choice for complex scenarios or
141+
configurations with a high number of statements.
142+
143+
## Try it out
144+
145+
As we wrap up, we encourage users to explore this new functionality and take
146+
advantage of its benefits in their telemetry pipelines!
147+
148+
If you have any questions or suggestions, we’d love to hear from you! Join the
149+
conversation in the `#otel-collector` channel on the
150+
[CNCF Slack workspace](https://slack.cncf.io/).

content/en/docs/collector/_index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Collector
33
description: Vendor-agnostic way to receive, process and export telemetry data.
44
aliases: [./about]
55
cascade:
6-
vers: 0.119.0
6+
vers: 0.120.0
77
weight: 270
88
---
99

content/en/docs/collector/building/receiver.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ touch tailtracer/factory.go
350350
```
351351

352352
Now let's follow the convention and add a function named `NewFactory()` that
353-
will be responsible to instantiate the `tailtracer` factory. Go ahead the add
353+
will be responsible to instantiate the `tailtracer` factory. Go ahead and add
354354
the following code to your `factory.go` file:
355355

356356
```go

content/en/docs/collector/internal-telemetry.md

+13-4
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ service:
4949
- periodic:
5050
exporter:
5151
otlp:
52-
protocol: grpc/protobuf
52+
protocol: grpc
5353
endpoint: http://localhost:14317
5454
```
5555
@@ -169,7 +169,7 @@ service:
169169
- batch:
170170
exporter:
171171
otlp:
172-
protocol: grpc/protobuf
172+
protocol: grpc
173173
endpoint: https://backend:4317
174174
```
175175

@@ -305,7 +305,9 @@ There are currently no metrics specific to `normal` verbosity.
305305
{{% alert title="Note" color="info" %}} The `http_` and `rpc_` metrics come from
306306
instrumentation libraries. Their original names use dots (`.`), but when
307307
exposing internal metrics with Prometheus, they are translated to use
308-
underscores (`_`) to match Prometheus' naming constraints.
308+
underscores (`_`) to match Prometheus' naming constraints. These metrics are not
309+
covered by the maturity levels below since they are not under the Collector SIG
310+
control.
309311

310312
The `otelcol_processor_batch_` metrics are unique to the `batchprocessor`.
311313

@@ -329,6 +331,10 @@ The Collector logs the following internal events:
329331

330332
## Telemetry maturity levels
331333

334+
The Collector telemetry levels apply to all first-party telemetry produced by
335+
the Collector. Third-party libraries, including those of OpenTelemetry Go, are
336+
not covered by these maturity levels.
337+
332338
### Traces
333339

334340
Tracing instrumentation is still under active development, and changes might be
@@ -338,10 +344,13 @@ guarantees of backwards compatibility for tracing instrumentation.
338344

339345
### Metrics
340346

341-
The Collector's metrics follow a four-stage lifecycle:
347+
The Collector's first-party metrics follow a four-stage lifecycle:
342348

343349
> Alpha metric → Stable metric → Deprecated metric → Deleted metric
344350

351+
Third-party metrics, including those generated by OpenTelemetry Go
352+
instrumentation libraries, are not covered by these maturity levels.
353+
345354
#### Alpha
346355

347356
Alpha metrics have no stability guarantees. These metrics can be modified or

content/en/docs/languages/java/configuration.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ exporters specified via `otel.traces.exporter`:
196196
| System property | Description | Default |
197197
| -------------------------------- | --------------------------------------------------------------- | ------- |
198198
| `otel.bsp.schedule.delay` | The interval, in milliseconds, between two consecutive exports. | `5000` |
199-
| `otel.bsp.max.queue.size` | The maximum queue size. | `2048` |
200-
| `otel.bsp.max.export.batch.size` | The maximum batch size. | `512` |
199+
| `otel.bsp.max.queue.size` | The maximum number of spans that can be queued before batching. | `2048` |
200+
| `otel.bsp.max.export.batch.size` | The maximum number of spans to export in a single batch. | `512` |
201201
| `otel.bsp.export.timeout` | The maximum allowed time, in milliseconds, to export data. | `30000` |
202202

203203
Properties for [sampler](../sdk/#sampler):
@@ -256,12 +256,12 @@ Properties for cardinality limits:
256256
Properties for [log record processor(s)](../sdk/#logrecordprocessor) pared with
257257
exporters via `otel.logs.exporter`:
258258

259-
| System property | Description | Default |
260-
| --------------------------------- | --------------------------------------------------------------- | ------- |
261-
| `otel.blrp.schedule.delay` | The interval, in milliseconds, between two consecutive exports. | `1000` |
262-
| `otel.blrp.max.queue.size` | The maximum queue size. | `2048` |
263-
| `otel.blrp.max.export.batch.size` | The maximum batch size. | `512` |
264-
| `otel.blrp.export.timeout` | The maximum allowed time, in milliseconds, to export data. | `30000` |
259+
| System property | Description | Default |
260+
| --------------------------------- | --------------------------------------------------------------------- | ------- |
261+
| `otel.blrp.schedule.delay` | The interval, in milliseconds, between two consecutive exports. | `1000` |
262+
| `otel.blrp.max.queue.size` | The maximum number of log records that can be queued before batching. | `2048` |
263+
| `otel.blrp.max.export.batch.size` | The maximum number of log records to export in a single batch. | `512` |
264+
| `otel.blrp.export.timeout` | The maximum allowed time, in milliseconds, to export data. | `30000` |
265265

266266
#### Properties: exporters
267267

content/en/docs/languages/js/_browser-instrumentation-warning.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: # Bogus entry for markdownlint
33
_build: { list: never, render: never }
44
---
55

6-
{{% alert-md title=Warning color=warning %}}
6+
{{% alert title=Warning color=warning %}}
77

88
Client instrumentation for the browser is **experimental** and mostly
99
**unspecified**. If you are interested in helping out, get in touch with the
@@ -12,4 +12,4 @@ Client instrumentation for the browser is **experimental** and mostly
1212
[sig]:
1313
https://docs.google.com/document/d/16Vsdh-DM72AfMg_FIt9yT9ExEWF4A_vRbQ3jRNBe09w
1414

15-
{{% /alert-md %}}
15+
{{% /alert %}}

content/en/docs/languages/php/instrumentation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ $resource = ResourceInfoFactory::emptyResource()->merge(ResourceInfo::create(Att
186186
ResourceAttributes::SERVICE_NAMESPACE => 'demo',
187187
ResourceAttributes::SERVICE_NAME => 'test-application',
188188
ResourceAttributes::SERVICE_VERSION => '0.1',
189-
ResourceAttributes::DEPLOYMENT_ENVIRONMENT => 'development',
189+
ResourceAttributes::DEPLOYMENT_ENVIRONMENT_NAME => 'development',
190190
])));
191191
$spanExporter = new SpanExporter(
192192
(new StreamTransportFactory())->create('php://stdout', 'application/json')

content/en/docs/languages/php/resources.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ $resource = ResourceInfoFactory::defaultResource()->merge(ResourceInfo::create(A
8080
ResourceAttributes::SERVICE_NAME => 'bar',
8181
ResourceAttributes::SERVICE_INSTANCE_ID => 1,
8282
ResourceAttributes::SERVICE_VERSION => '0.1',
83-
ResourceAttributes::DEPLOYMENT_ENVIRONMENT => 'development',
83+
ResourceAttributes::DEPLOYMENT_ENVIRONMENT_NAME => 'development',
8484
])));
8585

8686
$tracerProvider = new TracerProvider(

content/en/docs/security/_index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Security
33
cascade:
4-
collector_vers: 0.119.0
4+
collector_vers: 0.120.0
55
weight: 970
66
---
77

content/en/docs/zero-code/java/_index.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ cascade:
1010
otel: 1.47.0
1111
---
1212

13-
Zero-code instrumentation with Java uses a Java agent JAR or Spring Boot
14-
Starter. To learn how to manually instrument your service or app code, see
13+
Common options for zero-code instrumentation with Java are the Java agent JAR,
14+
Spring Boot Starter, and the Quarkus OpenTelemetry Extension. To learn how to
15+
manually instrument your service or app code, see
1516
[Manual instrumentation](/docs/languages/java/instrumentation/).
+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
title: Quarkus instrumentation
3+
linkTitle: Quarkus
4+
---
5+
6+
[Quarkus](https://quarkus.io/) is an open source framework designed to help
7+
software developers build efficient cloud native applications both with JVM and
8+
Quarkus native image applications.
9+
10+
Quarkus uses extensions to provide optimized support for a wide range of
11+
libraries. The
12+
[Quarkus OpenTelemetry extension](https://quarkus.io/guides/opentelemetry)
13+
provides:
14+
15+
- Out of the box instrumentation
16+
- OpenTelemetry SDK autoconfiguration, supporting almost all system properties
17+
defined for the [OpenTelemetry SDK](/docs/languages/java/configuration/)
18+
- [Vert.x](https://vertx.io/) based OTLP exporter
19+
- The same instrumentations can be used with native image applications, which
20+
are not supported by the OpenTelemetry Java agent.
21+
22+
{{% alert-md title="Note" color="secondary" %}}
23+
24+
Quarkus OpenTelemetry instrumentation is maintained and supported by Quarkus.
25+
For details, see [Quarkus community support](https://quarkus.io/support/).
26+
27+
{{% /alert-md %}}
28+
29+
Quarkus can also be instrumented with the [OpenTelemetry Java agent](../agent/)
30+
if you are not running a native image application.
31+
32+
## Getting started
33+
34+
To enable OpenTelemetry in your Quarkus application, add the
35+
`quarkus-opentelemetry` extension dependency to your project.
36+
37+
{{< tabpane text=true >}} {{% tab header="Maven (`pom.xml`)" lang=Maven %}}
38+
39+
```xml
40+
<dependency>
41+
<groupId>io.quarkus</groupId>
42+
<artifactId>quarkus-opentelemetry</artifactId>
43+
</dependency>
44+
```
45+
46+
{{% /tab %}} {{% tab header="Gradle (`build.gradle`)" lang=Gradle %}}
47+
48+
```kotlin
49+
implementation("io.quarkus:quarkus-opentelemetry")
50+
```
51+
52+
{{% /tab %}} {{< /tabpane>}}
53+
54+
Only the **tracing** signal is enabled by default. To enable **metrics** and
55+
**logs**, add the following configuration to your `application.properties` file:
56+
57+
```properties
58+
quarkus.otel.metrics.enabled=true
59+
quarkus.otel.logs.enabled=true
60+
```
61+
62+
OpenTelemetry logging is supported by Quarkus 3.16.0+.
63+
64+
For details concerning these and other configuration options, see
65+
[OpenTelemetry configuration reference](https://quarkus.io/guides/opentelemetry#configuration-reference).
66+
67+
## Learn more
68+
69+
- [Using OpenTelemetry](https://quarkus.io/guides/opentelemetry), a general
70+
reference covering all
71+
[configuration](https://quarkus.io/guides/opentelemetry#configuration-reference)
72+
options
73+
- Signal-specific guides for
74+
- [Tracing](https://quarkus.io/guides/opentelemetry-tracing)
75+
- [Metrics](https://quarkus.io/guides/opentelemetry-metrics)
76+
- [Logs](https://quarkus.io/guides/opentelemetry-logging)
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: # bogus for markdownlint
3+
cascade:
4+
build: { list: never, render: never }
5+
---

0 commit comments

Comments
 (0)