-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathotel-collector-config.yaml
More file actions
67 lines (62 loc) · 1.85 KB
/
Copy pathotel-collector-config.yaml
File metadata and controls
67 lines (62 loc) · 1.85 KB
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
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
filelog:
include:
- /var/lib/docker/containers/*/*.log
exclude:
- /var/lib/docker/containers/*${env:HOSTNAME}*/*.log
start_at: "end"
storage: file_storage
operators:
- type: regex_parser
parse_from: attributes["log.file.path"]
regex: "^/var/lib/docker/containers/(?P<container_id>[a-f0-9]{12})[a-f0-9]+/.*"
- type: json_parser
timestamp:
parse_from: attributes.time
layout: "%Y-%m-%dT%H:%M:%S.%fZ"
- type: move
from: attributes.log
to: body
extensions:
file_storage:
directory: /var/lib/otelcol/file_storage
create_directory: true
timeout: 1s
processors:
batch:
filter:
error_mode: ignore
logs:
log_record:
- attributes["attrs"] == nil
- attributes["attrs"]["com.docker.compose.service"] == nil
transform:
error_mode: ignore
log_statements:
- context: log
statements:
- set(resource.attributes["service.name"], attributes["attrs"]["com.docker.compose.service"]) where attributes["attrs"] != nil and attributes["attrs"]["com.docker.compose.service"] != nil
- set(resource.attributes["service.name"], attributes["container_id"]) where
resource.attributes["service.name"] == nil and attributes["container_id"] != nil
exporters:
otlphttp/grafana_cloud:
endpoint: ${env:GRAFANA_CLOUD_OTLP_ENDPOINT}
headers:
authorization: ${env:GRAFANA_CLOUD_BASIC_AUTH_HEADER}
service:
extensions: [file_storage]
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [otlphttp/grafana_cloud]
logs:
receivers: [filelog]
processors: [filter, transform, batch]
exporters: [otlphttp/grafana_cloud]