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
Copy file name to clipboardexpand all lines: cmd/otel-allocator/README.md
+46
Original file line number
Diff line number
Diff line change
@@ -86,6 +86,7 @@ The easiest way to do this is to grab a copy of the individual [`PodMonitor`](ht
86
86
> ✨ For more information on configuring the `PodMonitor` and `ServiceMonitor`, check out the [PodMonitor API](https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#monitoring.coreos.com/v1.PodMonitor) and the [ServiceMonitor API](https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#monitoring.coreos.com/v1.ServiceMonitor).
87
87
88
88
# Usage
89
+
89
90
The `spec.targetAllocator:` controls the TargetAllocator general properties. Full API spec can be found here: [api.md#opentelemetrycollectorspectargetallocator](../../docs/api.md#opentelemetrycollectorspectargetallocator)
90
91
91
92
A basic example that deploys.
@@ -122,6 +123,51 @@ In essence, Prometheus Receiver configs are overridden with a `http_sd_config` d
122
123
Allocator, these are then loadbalanced/sharded to the Collectors. The [Prometheus Receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/prometheusreceiver/README.md) configs that are overridden
123
124
are what will be distributed with the same name.
124
125
126
+
## TargetAllocator CRD
127
+
128
+
The `spec.targetAllocator` attribute allows very limited control over the target allocator resources. More customization is possible by using
129
+
the `TargetAllocator` CRD. We create the `TargetAllocator` CR, and then add its name in the `opentelemetry.io/target-allocator` label on the respective OpenTelemetryCollector CR.
130
+
131
+
The basic example from above looks as follows with this setup:
132
+
133
+
```yaml
134
+
apiVersion: opentelemetry.io/v1beta1
135
+
kind: OpenTelemetryCollector
136
+
metadata:
137
+
name: collector-with-ta
138
+
labels:
139
+
opentelemetry.io/target-allocator: ta
140
+
spec:
141
+
mode: statefulset
142
+
config:
143
+
receivers:
144
+
prometheus:
145
+
config:
146
+
scrape_configs:
147
+
- job_name: 'otel-collector'
148
+
scrape_interval: 10s
149
+
static_configs:
150
+
- targets: [ '0.0.0.0:8888' ]
151
+
152
+
exporters:
153
+
debug: {}
154
+
155
+
service:
156
+
pipelines:
157
+
metrics:
158
+
receivers: [prometheus]
159
+
exporters: [debug]
160
+
---
161
+
apiVersion: opentelemetry.io/v1alpha1
162
+
kind: TargetAllocator
163
+
metadata:
164
+
name: ta
165
+
spec:
166
+
```
167
+
168
+
Note that the scrape configs can be specified either in the prometheus receiver configuration, or directly in the TargetAllocator CRD. The resultant
169
+
target allocator will use both.
170
+
125
171
## PrometheusCR specifics
126
172
127
173
TargetAllocator discovery of PrometheusCRs can be turned on by setting
Copy file name to clipboardexpand all lines: docs/crd-changelog.md
+80
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,86 @@
3
3
This document explains major changes made in new CRD versions. It is intended to help users migrate and take
4
4
advantage of the new features.
5
5
6
+
## TargetAllocator.opentelemetry.io/v1alpha1
7
+
8
+
The target allocator is an application that can allocate Prometheus scrape targets to OpenTelemetry Collectors using the prometheus receiver,
9
+
allowing transparent horizontal scaling for Prometheus metrics collection. You can learn more in the target allocator's [README](../cmd/otel-allocator/README.md).
10
+
11
+
Until now, it could be enabled via the `targetAllocator` sub-resource in the OpenTelemetryCollector CR. This was, and continues to be fine for
12
+
simpler use cases. Some users needed to customize the target allocator further, and embedding all the required attributes in the
13
+
OpenTelemetryCollector CR would've made it unnecessarily large. Instead, we introduced a separate CRD for the target allocator.
14
+
15
+
The following OpenTelemetryCollector CR:
16
+
17
+
```yaml
18
+
apiVersion: opentelemetry.io/v1beta1
19
+
kind: OpenTelemetryCollector
20
+
metadata:
21
+
name: simplest
22
+
spec:
23
+
targetAllocator:
24
+
enabled: true
25
+
prometheusCR:
26
+
enabled: true
27
+
config:
28
+
receivers:
29
+
prometheus:
30
+
config:
31
+
scrape_configs: []
32
+
processors:
33
+
batch:
34
+
send_batch_size: 1000
35
+
timeout: 10s
36
+
exporters:
37
+
debug: {}
38
+
service:
39
+
pipelines:
40
+
traces:
41
+
receivers: [prometheus]
42
+
processors: [batch]
43
+
exporters: [debug]
44
+
```
45
+
46
+
is now equivalent to the pair:
47
+
48
+
```yaml
49
+
apiVersion: opentelemetry.io/v1beta1
50
+
kind: OpenTelemetryCollector
51
+
metadata:
52
+
name: simplest
53
+
labels:
54
+
opentelemetry.io/target-allocator: simplest-ta
55
+
spec:
56
+
config:
57
+
receivers:
58
+
prometheus:
59
+
config:
60
+
scrape_configs: []
61
+
processors:
62
+
batch:
63
+
send_batch_size: 1000
64
+
timeout: 10s
65
+
exporters:
66
+
debug: {}
67
+
service:
68
+
pipelines:
69
+
traces:
70
+
receivers: [prometheus]
71
+
processors: [batch]
72
+
exporters: [debug]
73
+
---
74
+
apiVersion: opentelemetry.io/v1alpha1
75
+
kind: TargetAllocator
76
+
metadata:
77
+
name: simplest-ta
78
+
spec:
79
+
prometheusCR:
80
+
enabled: true
81
+
```
82
+
83
+
> [!NOTE]
84
+
> The OpenTelemetryCollector is connected to the TargetAllocator by setting the `opentelemetry.io/target-allocator` label on the former.
0 commit comments