Skip to content

Commit 653584f

Browse files
authored
Merge pull request #45792 from CasperLiu/otlp-env-var-for-trace
Configure Kubernetes components's OTEL traces configuration (emitting traces directly and tuning with environment)
2 parents 76b76d8 + 494e36e commit 653584f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

content/en/docs/concepts/cluster-administration/system-traces.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ with the gRPC exporter and can be collected and routed to tracing backends using
2222

2323
## Trace Collection
2424

25+
Kubernetes components have built-in gRPC exporters for OTLP to export traces, either with an OpenTelemetry Collector,
26+
or without an OpenTelemetry Collector.
27+
2528
For a complete guide to collecting traces and using the collector, see
2629
[Getting Started with the OpenTelemetry Collector](https://opentelemetry.io/docs/collector/getting-started/).
2730
However, there are a few things to note that are specific to Kubernetes components.
@@ -47,6 +50,16 @@ service:
4750
exporters: [logging]
4851
```
4952
53+
To directly emit traces to a backend without utilizing a collector,
54+
specify the endpoint field in the Kubernetes tracing configuration file with the desired trace backend address.
55+
This method negates the need for a collector and simplifies the overall structure.
56+
57+
For trace backend header configuration, including authentication details, environment variables can be used with `OTEL_EXPORTER_OTLP_HEADERS`,
58+
see [OTLP Exporter Configuration](https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/).
59+
60+
Additionally, for trace resource attribute configuration such as Kubernetes cluster name, namespace, Pod name, etc.,
61+
environment variables can also be used with `OTEL_RESOURCE_ATTRIBUTES`, see [OTLP Kubernetes Resource](https://opentelemetry.io/docs/specs/semconv/resource/k8s/).
62+
5063
## Component traces
5164

5265
### kube-apiserver traces
@@ -129,4 +142,6 @@ there are no guarantees of backwards compatibility for tracing instrumentation.
129142
## {{% heading "whatsnext" %}}
130143

131144
* Read about [Getting Started with the OpenTelemetry Collector](https://opentelemetry.io/docs/collector/getting-started/)
145+
* Read about [OTLP Exporter Configuration](https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/)
146+
132147

0 commit comments

Comments
 (0)