You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Export self-telemetry over OTLP with the same metric set as /metrics by
bridging the default Prometheus registry (SD internals, Go/process collectors)
into the OTLP reader via the Prometheus bridge; SDK metrics use a dedicated
registry to avoid double counting, and /metrics serves the union.
- Attach a resource with a default service.name (overridable via OTEL_* env).
- Shut down the meter provider on exit to flush the final export.
- Expand ${env:VAR} in OTLP header/endpoint values so secrets (API tokens) can be
sourced from a Secret via pod env instead of being written into the ConfigMap.
- Accept both a full URL and host:port endpoint for gRPC (consistent with HTTP).
- Validate telemetry config in the TA binary for standalone use.
- Unit + end-to-end export tests, config-file README docs, changelog entry.
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
2
+
change_type: enhancement
3
+
4
+
# The name of the component, or a single word describing the area of concern, (e.g. collector, target allocator, auto-instrumentation, opamp, github action)
5
+
component: target allocator
6
+
7
+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8
+
note: "Support exporting the TargetAllocator's self-telemetry metrics via OTLP, in addition to the Prometheus /metrics endpoint."
9
+
10
+
# One or more tracking issues related to the change
11
+
issues: [5047]
12
+
13
+
# (Optional) One or more lines of additional information to render under the primary note.
14
+
# These lines will be padded with 2 spaces and then inserted directly into the document.
15
+
# Use pipe (|) for multiline entries.
16
+
subtext: |
17
+
Configure it under `spec.targetAllocator.telemetry.metrics.otlp` (OpenTelemetryCollector CR) or
18
+
`spec.telemetry.metrics.otlp` (TargetAllocator CR), with endpoint, protocol (grpc/http), temporality,
19
+
headers, TLS and export interval/timeout. Metrics registered directly on the Prometheus registry
20
+
(Prometheus service discovery, Go runtime and process collectors) are bridged into the OTLP export
21
+
so the Prometheus endpoint and OTLP expose the same metric set.
Copy file name to clipboardExpand all lines: cmd/otel-allocator/README.md
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,9 +29,40 @@ The Target Allocator uses a configuration file (by default under `/conf/targetal
29
29
|`https`| Whether to expose the target allocator endpoint over https |||
30
30
|`allow_insecure_auth_secrets`| Serve auth secret values over plain HTTP without mTLS |`false`|`ALLOW_INSECURE_AUTH_SECRETS`|
31
31
|`collector_not_ready_grace_period`| Wait time before assigning jobs to a new collector. | 30s ||
32
+
|`telemetry`| Self-telemetry configuration, including optional OTLP metric export (see below)|||
32
33
33
34
Additional configuration options are present under [./internal/config/config.go](./internal/config/config.go).
34
35
36
+
### Self-telemetry
37
+
38
+
The Target Allocator always exposes its own metrics on the Prometheus `/metrics` endpoint. It can
39
+
additionally push them over OTLP by configuring `telemetry.metrics.otlp`. When set, an OTLP exporter
40
+
is added alongside the Prometheus endpoint; the metrics registered directly on the Prometheus registry
41
+
(Prometheus service discovery internals, Go runtime and process collectors) are bridged into the OTLP
42
+
export so both surfaces expose the same metric set. The `service.name` resource attribute defaults to
43
+
`target-allocator` and can be overridden with the standard `OTEL_SERVICE_NAME` /
44
+
`OTEL_RESOURCE_ATTRIBUTES` environment variables.
45
+
46
+
```yaml
47
+
telemetry:
48
+
metrics:
49
+
otlp:
50
+
endpoint: https://example.com:4318 # base URL (HTTP, /v1/metrics appended) or host:port (gRPC)
51
+
protocol: http # "grpc" (default) or "http"
52
+
temporality: delta # "cumulative" (default), "delta", or "lowmemory"
53
+
export_interval: 30s# default 60s
54
+
timeout: 15s# default 10s
55
+
insecure: false # disable TLS (local dev)
56
+
headers:
57
+
Authorization: "Api-Token ${env:DT_API_TOKEN}"
58
+
```
59
+
60
+
Header values support `${env:VAR}` references, which are expanded from the Target Allocator's
61
+
process environment at runtime. Use this to keep secrets (such as an API token) out of the
62
+
ConfigMap: reference an environment variable here and source that variable from a Secret on the
63
+
Target Allocator pod. The `endpoint` field supports the same expansion. Both the `grpc` and `http`
64
+
protocols accept either a full URL (with scheme) or a bare `host:port` endpoint.
65
+
35
66
## Even Distribution of Prometheus Targets
36
67
37
68
The Target Allocator’s first job is to discover targets to scrape and OTel Collectors to allocate targets to. Then it can distribute the targets it discovers among the Collectors. The Collectors in turn query the Target Allocator for Metrics endpoints to scrape, and then the Collectors’ [Prometheus Receivers](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/prometheusreceiver/README.md) scrape the Metrics targets.
0 commit comments