-
Notifications
You must be signed in to change notification settings - Fork 2.4k
/
signalfx-k8s.yaml
187 lines (187 loc) · 5.95 KB
/
signalfx-k8s.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
---
apiVersion: v1
kind: ConfigMap
metadata:
name: otel-collector-conf
labels:
app: opentelemetry
component: otel-collector-conf
data:
otel-collector-config: |
extensions:
health_check:
http_forwarder:
egress:
endpoint: "https://api.${SFX_REALM}.signalfx.com"
zpages:
receivers:
sapm:
signalfx:
# This section is used to collect OpenTelemetry metrics
# Even if just a SignalFx µAPM customer, these metrics are included
prometheus:
config:
scrape_configs:
- job_name: 'otel-collector'
scrape_interval: 10s
static_configs:
- targets: ['localhost:8888']
# If you want to use the environment filter
# In the SignalFx dashboard
#labels:
#environment: demo
metric_relabel_configs:
- source_labels: [ __name__ ]
regex: '.*grpc_io.*'
action: drop
# Enable Zipkin to support Istio Mixer Adapter
# https://github.com/signalfx/signalfx-istio-adapter
zipkin:
processors:
batch:
# Optional: If you have a different environment tag name
# If this option is enabled it must be added to the pipeline section below
#attributes/copyfromexistingkey:
#actions:
#- key: environment
#from_attribute: YOUR_EXISTING_TAG_NAMEE
#action: upsert
# Optional: If you want to add an environment tag
# If this option is enabled it must be added to the pipeline section below
#attributes/newenvironment:
#actions:
#- key: environment
#value: "YOUR_ENVIRONMENT_NAME"
#action: insert
# Enabling the memory_limiter is strongly recommended for every pipeline.
# Configuration is based on the amount of memory allocated to the collector.
# The configuration below assumes 2GB of memory. In general, the limit should be 90% of
# the collector's memory up to 2GB, and the spike should be 25% of the
# collector's memory up to 2GB.
# For more information, see
# https://github.com/open-telemetry/opentelemetry-collector/blob/main/processor/memorylimiterprocessor/README.md
memory_limiter:
check_interval: 2s
limit_mib: 1800
spike_limit_mib: 500
exporters:
# Traces
sapm:
access_token: "${SFX_TOKEN}"
endpoint: "https://ingest.${SFX_REALM}.signalfx.com/v2/trace"
# Metrics
signalfx:
access_token: "${SFX_TOKEN}"
realm: "${SFX_REALM}"
service:
extensions: [health_check, http_forwarder, zpages]
pipelines:
traces:
receivers: [sapm, zipkin]
processors: [memory_limiter, batch]
exporters: [sapm]
metrics:
receivers: [signalfx, prometheus]
processors: [memory_limiter, batch]
exporters: [signalfx]
logs:
receivers: [signalfx]
processors: [memory_limiter, batch]
exporters: [signalfx]
---
apiVersion: v1
kind: Service
metadata:
name: otel-collector
labels:
app: opentelemetry
component: otel-collector
spec:
ports:
- name: sapm # Default endpoint for SignalFx APM receiver.
port: 7276
- name: zipkin # Default endpoint for Zipkin trace receiver.
port: 9411
- name: signalfx # Default endpoint for SignalFx metrics receiver.
port: 9943
- name: metrics # Default endpoint for the Collector metrics.
port: 8888
selector:
component: otel-collector
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: otel-collector
labels:
app: opentelemetry
component: otel-collector
spec:
selector:
matchLabels:
app: opentelemetry
component: otel-collector
minReadySeconds: 5
progressDeadlineSeconds: 120
replicas: 1 #TODO - adjust this to your own requirements
template:
metadata:
labels:
app: opentelemetry
component: otel-collector
spec:
containers:
- command:
- "/otelcontribcol"
- "--config=/conf/otel-collector-config.yaml"
# Memory Ballast size should be max 1/3 to 1/2 of memory.
- "--mem-ballast-size-mib=683"
image: otel/opentelemetry-collector-contrib:0.12.0
name: otel-collector
resources:
limits:
cpu: 1
memory: 2Gi
requests:
cpu: 200m
memory: 400Mi
env:
- name: SFX_REALM
value: # set your realm here
- name: SFX_TOKEN
value: # set your token here
ports:
- containerPort: 55679 # Default endpoint for ZPages.
- containerPort: 4317 # Default endpoint for OpenTelemetry receiver.
- containerPort: 6060 # Default endpoint for HTTP Forwarder extension.
- containerPort: 7276 # Default endpoint for SignalFx APM receiver.
- containerPort: 8888 # Default endpoint for querying metrics.
- containerPort: 9411 # Default endpoint for Zipkin trace receiver.
- containerPort: 9943 # Default endpoint for SignalFx metrics receiver.
volumeMounts:
- name: otel-collector-config-vol
mountPath: /conf
# - name: otel-collector-secrets
# mountPath: /secrets
livenessProbe:
httpGet:
path: /
port: 13133 # Health Check extension default port.
readinessProbe:
httpGet:
path: /
port: 13133 # Health Check extension default port.
volumes:
- configMap:
name: otel-collector-conf
items:
- key: otel-collector-config
path: otel-collector-config.yaml
name: otel-collector-config-vol
# - secret:
# name: otel-collector-secrets
# items:
# - key: cert.pem
# path: cert.pem
# - key: key.pem
# path: key.pem