-
Notifications
You must be signed in to change notification settings - Fork 67
/
collector.yaml
112 lines (109 loc) · 3.99 KB
/
collector.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
---
apiVersion: v1
kind: Namespace
metadata:
name: nr-confluent
---
apiVersion: v1
kind: ConfigMap
metadata:
name: collector-config
namespace: nr-confluent
labels:
app.kubernetes.io/name: collector-config
data:
collector-config: |
receivers:
prometheus:
config:
scrape_configs:
- job_name: "confluent"
scrape_interval: 60s # Do not go any lower than this or you'll hit rate limits
static_configs:
- targets: ["api.telemetry.confluent.cloud"]
scheme: https
basic_auth:
username: $CONFLUENT_API_KEY
password: $CONFLUENT_API_SECRET
metrics_path: /v2/metrics/cloud/export
params:
"resource.kafka.id":
- $CONFLUENT_CLUSTER_ID
# OPTIONAL - You can include monitoring for Confluent connectors or schema registry's by including the ID here.
#"resource.connector.id":
# - $CONFLUENT_CONNECTOR_ID
#"resource.schema_registry.id":
# - $CONFLUENT_SCHEMA_REGISTRY_ID
processors:
batch:
exporters:
otlphttp:
endpoint: ${NEW_RELIC_OTLP_ENDPOINT}
headers:
api-key: ${NEW_RELIC_API_KEY}
service:
pipelines:
metrics:
receivers: [prometheus]
processors: [batch]
exporters: [otlphttp]
---
apiVersion: v1
kind: Pod
metadata:
name: collector
namespace: nr-confluent
labels:
app.kubernetes.io/name: collector
spec:
containers:
- name: collector
image: otel/opentelemetry-collector-contrib:0.98.0
env:
# The default US endpoint is set here. You can change the endpoint and port based on your requirements if needed.
# docs: https://docs.newrelic.com/docs/more-integrations/open-source-telemetry-integrations/opentelemetry/best-practices/opentelemetry-otlp/#configure-endpoint-port-protocol
- name: NEW_RELIC_OTLP_ENDPOINT
value: https://otlp.nr-data.net/
# The New Relic API key used to authenticate export requests.
# Defined in secrets.yaml
- name: NEW_RELIC_API_KEY
valueFrom:
secretKeyRef:
name: nr-confluent-secret
key: NEW_RELIC_API_KEY
# The Confluent API key.
# Defined in secrets.yaml
- name: CONFLUENT_API_KEY
valueFrom:
secretKeyRef:
name: nr-confluent-secret
key: CONFLUENT_API_KEY
# The Confluent API secret.
# Defined in secrets.yaml
- name: CONFLUENT_API_SECRET
valueFrom:
secretKeyRef:
name: nr-confluent-secret
key: CONFLUENT_API_SECRET
# Set your Confluent Cluster ID here.
# docs: https://docs.confluent.io/confluent-cli/current/command-reference/kafka/cluster/confluent_kafka_cluster_list.html
- name: CONFLUENT_CLUSTER_ID
value: <INSERT_CONFLUENT_CLUSTER_ID>
# OPTIONAL: Set your Confluent Schema Registry ID here, and uncomment reference in .receivers.prometheus.config.scrape_configs[0].params
# docs: https://docs.confluent.io/confluent-cli/current/command-reference/kafka/cluster/confluent_kafka_cluster_list.html
#- name: CONFLUENT_SCHEMA_REGISTRY_ID
# value: <INSERT_CONFLUENT_SCHEMA_REGISTRY_ID>
# OPTIONAL: Set your Confluent Connector ID here, and uncomment reference in .receivers.prometheus.config.scrape_configs[0].params
# docs: https://docs.confluent.io/confluent-cli/current/command-reference/kafka/cluster/confluent_kafka_cluster_list.html
#- name: CONFLUENT_CONNECTOR_ID
# value: <INSERT_CONFLUENT_CONNECTOR_ID>
volumeMounts:
- name: collector-config-vol
mountPath: /etc/otelcol-contrib
volumes:
- name: collector-config-vol
configMap:
name: collector-config
items:
- key: collector-config
path: config.yaml