-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathotel-collector-config.yml
76 lines (68 loc) · 1.89 KB
/
otel-collector-config.yml
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
# Configure receivers
# We only need otlp protocol on grpc, but you can use http, zipkin, jaeger, aws, etc.
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver
receivers:
otlp:
protocols:
grpc:
postgresql:
endpoint: db:5432
transport: tcp
username: user
password: password
databases:
- database
collection_interval: 10s
tls:
insecure: true
# Configure exporters
exporters:
# Export prometheus endpoint
prometheus:
endpoint: "0.0.0.0:8889"
# log to the console
logging:
# Export to zipkin
zipkin:
endpoint: "http://zipkin-all-in-one:9411/api/v2/spans"
format: proto
jaeger:
endpoint: jaeger:14250
tls:
insecure: true
loki:
endpoint: "http://loki:3100/loki/api/v1/push"
# Export to a file
file:
path: /etc/output/logs.json
# Configure processors (batch, sampling, filtering, hashing sensitive data, etc.)
# https://opentelemetry.io/docs/collector/configuration/#processors
processors:
batch:
attributes:
actions:
- action: insert
key: log_file_name
from_attribute: log.file.name
- action: insert
key: loki.attribute.labels
value: log_file_name
# Configure pipelines. Pipeline defines a path the data follows in the Collector
# starting from reception, then further processing or modification and finally
# exiting the Collector via exporters.
# https://opentelemetry.io/docs/collector/configuration/#service
# https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/design.md#pipelines
service:
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [logging, zipkin, jaeger]
metrics:
receivers: [otlp, postgresql]
processors: [batch]
exporters: [logging, prometheus]
logs:
receivers: [otlp]
processors: [attributes]
exporters: [logging, loki]