Skip to content

Commit 39dda8b

Browse files
Add target allocator guidance (#642)
* initial ta doc structure * Add config example * Add TA to add-on index * fix prom casing * Update TA description * Update src/docs/getting-started/adot-eks-add-on/target-allocator.mdx
1 parent 87a4c8f commit 39dda8b

File tree

3 files changed

+104
-1
lines changed

3 files changed

+104
-1
lines changed

src/docs/getting-started/adot-eks-add-on.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import operatorImg2 from "assets/img/docs/gettingStarted/operator/img2.png"
2222
#### [Advanced Collector Configuration for Amazon Managed Prometheus](/docs/getting-started/adot-eks-add-on/config-advanced)
2323
### [Injecting Auto-instrumentation](/docs/getting-started/adot-eks-add-on/config-auto-instrumentation)
2424
### [Kubernetes Attributes Processor](/docs/getting-started/adot-eks-add-on/k8s-attr-processor)
25+
### [Target Allocator](/docs/getting-started/adot-eks-add-on/target-allocator)
2526
### [Update and Cleanup](/docs/getting-started/adot-eks-add-on/update-and-cleanup)
2627

2728

src/docs/getting-started/adot-eks-add-on/k8s-attr-processor.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,4 +246,4 @@ and alarms that can leverage Kubernetes resource attributes.
246246

247247
### [Advanced Collector Configuration for Amazon Managed Prometheus](/docs/getting-started/adot-eks-add-on/config-advanced)
248248

249-
## [Next Topic: Updating and Cleanup](/docs/getting-started/adot-eks-add-on/update-and-cleanup)
249+
## [Next Topic: Target Allocator](/docs/getting-started/adot-eks-add-on/target-allocator)
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
title: 'Target Allocator'
3+
description:
4+
This page provides an introduction to the Target Allocator
5+
path: '/docs/getting-started/adot-eks-add-on/target-allocator'
6+
---
7+
8+
Installing the EKS Add-on gives you access to the Target Allocator (TA). Enabling the Target Allocator for an
9+
OpenTelemetry Collector custom resource decouples Prometheus service discovery and metrics collection. When enabled,
10+
the Target Allocator manages the configuration of the Prometheus receiver. Specifically,
11+
the Target Allocator allows for distribution of Prometheus scrape targets across a pool of Collectors. This functionality can
12+
be used to avoid the manual sharding of Prometheus scrape targets that can be required when horizontally scaling
13+
a single Prometheus receiver configuration.
14+
Visit the [Target Allocator Readme](https://github.com/open-telemetry/opentelemetry-operator/blob/main/cmd/otel-allocator/README.md)
15+
for a deeper introduction.
16+
17+
## Out of Order Samples
18+
19+
In some cases the Target Allocator can be used to solve Prometheus remote write out of order sample errors. A common
20+
reason Collector users will see out of order sample erorrs is due to multiple collectors scraping the same metric
21+
endpoint. Collector users may experience this when horizontally scaling Collectors with Prometheus
22+
receivers or daemonset deployments without manually sharding scrape targets. Both of these scenarios can lead to
23+
out of order sample erorrs without sharding of Prometheus scrape targets.
24+
25+
## Getting Started
26+
27+
Enabling the target allocator requires setting `OpenTelemeteryCollector.spec.targetAllocator.enabled` to `true`.
28+
This will cause the Prometheus configuration within the Collector CRD to be rewritten to use an `http_sd_config`
29+
from the Target Allocator. The operator will also create a new deployment and service for this http_sd_config
30+
directive.
31+
32+
```
33+
apiVersion: opentelemetry.io/v1alpha1
34+
kind: OpenTelemetryCollector
35+
metadata:
36+
name: collector-with-ta
37+
spec:
38+
mode: statefulset
39+
servicAccount: adot-collector
40+
targetAllocator:
41+
enabled: true
42+
config: |
43+
receivers:
44+
prometheus:
45+
config:
46+
scrape_configs:
47+
- job_name: 'otel-collector'
48+
scrape_interval: 10s
49+
static_configs:
50+
- targets: [ '0.0.0.0:8888' ]
51+
metric_relabel_configs:
52+
- action: labeldrop
53+
regex: (id|name)
54+
replacement: $$1
55+
- action: labelmap
56+
regex: label_(.+)
57+
replacement: $$1
58+
59+
processors:
60+
batch:
61+
62+
exporters:
63+
prometheusremotewrite:
64+
endpoint: ${AMP_REMOTE_WRITE_URL}
65+
auth:
66+
authenticator: sigv4auth
67+
68+
extensions:
69+
sigv4auth:
70+
region: ${AWS_REGION}
71+
service: "aps"
72+
73+
74+
service:
75+
pipelines:
76+
metrics:
77+
receivers: [prometheus]
78+
processors: [batch]
79+
exporters: [prometheusremotewrite]
80+
```
81+
82+
Please reference the [OpenTelemetry Operator documentation](https://github.com/open-telemetry/opentelemetry-operator/tree/main#target-allocator)
83+
for more information on using the Target Allocator.
84+
85+
### Useful links
86+
87+
[Target Allocator API Spec](https://github.com/open-telemetry/opentelemetry-operator/blob/main/docs/api.md#opentelemetrycollectorspectargetallocator)
88+
89+
[Scaling OpenTelmetery Collectors](https://opentelemetry.io/docs/collector/scaling/)
90+
91+
---
92+
## [Previous Topic: Kubernetes Attributes Processor](/docs/getting-started/adot-eks-add-on/k8s-attr-processor)
93+
94+
## Related Topics:
95+
96+
### [Collector Configuration for Amazon Managed Prometheus](/docs/getting-started/adot-eks-add-on/config-amp)
97+
98+
### [Collector Configuration for AWS CloudWatch](/docs/getting-started/adot-eks-add-on/config-cloudwatch)
99+
100+
### [Advanced Collector Configuration for Amazon Managed Prometheus](/docs/getting-started/adot-eks-add-on/config-advanced)
101+
102+
## [Next Topic: Updating and Cleanup](/docs/getting-started/adot-eks-add-on/update-and-cleanup)

0 commit comments

Comments
 (0)