Skip to content

Commit a6b83b8

Browse files
feat!: update all bundled metrics configs to export Prometheus metrics (#151) (#157)
OB-40055 Update all bundled metrics configs to export Prometheus metrics.
1 parent 6e4e8dc commit a6b83b8

File tree

24 files changed

+97
-57
lines changed

24 files changed

+97
-57
lines changed

packaging/docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ COPY observe-agent /
44
# This shouldn't be necessary but sometimes we end up with execution bit not set.
55
# ref: https://github.com/open-telemetry/opentelemetry-collector/issues/1317
66
RUN chmod 755 /observe-agent
7-
# The base executable includes symlinks to libraries. In order to break those,
8-
# we tar with the h flag to dereference symlinks.
7+
# The base executable includes symlinks to libraries. In order to break those,
8+
# we tar with the h flag to dereference symlinks.
99
RUN tar czhf observe-agent.tar.gz /observe-agent $(ldd /observe-agent | grep -oP "\/.*? ")
1010
# extract package to /output so it can be taken as base for scratch image
1111
# we do not copy archive into scratch image, as it doesn't have tar executable

packaging/docker/compose-linux-host.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ services:
2525
source: /var/log
2626
target: /hostfs/var/log
2727
read_only: true
28-
# Symlinks dont work by default on docker containers so we need to add each of the
28+
# Symlinks dont work by default on docker containers so we need to add each of the
2929
# directories containing symlink targets individually for docker to be able to follow them
3030
- type: bind
3131
source: /var/log/pods

packaging/docker/observe-agent/connections/host_monitoring/host.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ service:
99
metrics/agent-filestats:
1010
receivers: [filestats/agent]
1111
processors: [resourcedetection, resourcedetection/cloud]
12-
exporters: [otlphttp/observe]
12+
exporters: [prometheusremotewrite/observe]

packaging/docker/observe-agent/connections/host_monitoring/host_metrics.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ service:
3737
metrics/host_monitoring_host:
3838
receivers: [hostmetrics/host-monitoring-host]
3939
processors: [memory_limiter, resourcedetection, resourcedetection/cloud, batch]
40-
exporters: [otlphttp/observe]
40+
exporters: [prometheusremotewrite/observe]

packaging/docker/observe-agent/connections/host_monitoring/process_metrics.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ receivers:
1010
process.cpu.utilization:
1111
enabled: true
1212
process.disk.operations:
13-
enabled: true
13+
enabled: true
1414
process.memory.utilization:
15-
enabled: true
15+
enabled: true
1616
process.open_file_descriptors:
17-
enabled: true
17+
enabled: true
1818
process.paging.faults:
19-
enabled: true
19+
enabled: true
2020
process.signals_pending:
21-
enabled: true
21+
enabled: true
2222
process.threads:
2323
enabled: true
2424
mute_process_name_error: true
@@ -31,4 +31,4 @@ service:
3131
metrics/host_monitoring_process:
3232
receivers: [hostmetrics/host-monitoring-process]
3333
processors: [memory_limiter, resourcedetection, resourcedetection/cloud, batch]
34-
exporters: [otlphttp/observe]
34+
exporters: [prometheusremotewrite/observe]

packaging/docker/observe-agent/connections/self_monitoring/logs_and_metrics.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ service:
2828
pipelines:
2929
metrics/agent-internal:
3030
receivers: [prometheus/agent, count]
31-
processors: [memory_limiter, transform/truncate, resourcedetection, resourcedetection/cloud, batch]
32-
exporters: [otlphttp/observe]
31+
processors: [memory_limiter, transform/truncate, resourcedetection, resourcedetection/cloud, deltatocumulative, batch]
32+
exporters: [prometheusremotewrite/observe]
3333

3434
logs/agent-journald:
3535
receivers: [journald/agent]

packaging/docker/observe-agent/otel-collector.yaml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ processors:
2222
transform/truncate:
2323
log_statements:
2424
- context: log
25-
statements:
25+
statements:
2626
- truncate_all(attributes, 4095)
2727
- truncate_all(resource.attributes, 4095)
2828
trace_statements:
@@ -35,9 +35,11 @@ processors:
3535
check_interval: 1s
3636
limit_percentage: 20
3737
spike_limit_percentage: 5
38-
38+
3939
batch:
40-
40+
41+
deltatocumulative:
42+
4143
resourcedetection:
4244
detectors: [env, system]
4345
system:
@@ -65,7 +67,7 @@ processors:
6567
enabled: true
6668
os.description:
6769
enabled: true
68-
70+
6971
resourcedetection/cloud:
7072
detectors:
7173
{{- if .CloudResourceDetectors }}
@@ -74,7 +76,7 @@ processors:
7476
{{- end }}
7577
timeout: 2s
7678
override: false
77-
79+
7880
filter/count:
7981
error_mode: ignore
8082
metrics:
@@ -93,16 +95,24 @@ exporters:
9395
enabled: true
9496
compression: zstd
9597

98+
prometheusremotewrite/observe:
99+
endpoint: ${env:OBSERVE_PROMETHEUS_ENDPOINT}
100+
headers:
101+
authorization: ${env:OBSERVE_AUTHORIZATION_HEADER}
102+
resource_to_telemetry_conversion:
103+
enabled: true # Convert resource attributes to metric labels
104+
send_metadata: true
105+
96106
debug:
97107

98108
service:
99109
pipelines:
100110
metrics/forward:
101111
receivers: [otlp]
102-
processors: [resourcedetection, resourcedetection/cloud]
103-
exporters: [otlphttp/observe]
112+
processors: [resourcedetection, resourcedetection/cloud, deltatocumulative, batch]
113+
exporters: [prometheusremotewrite/observe]
104114

105-
logs/forward:
115+
logs/forward:
106116
receivers: [otlp]
107117
processors: [resourcedetection, resourcedetection/cloud]
108118
exporters: [otlphttp/observe, count]

packaging/linux/etc/observe-agent/connections/host_monitoring/host.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ service:
99
metrics/agent-filestats:
1010
receivers: [filestats/agent]
1111
processors: [resourcedetection, resourcedetection/cloud]
12-
exporters: [otlphttp/observe]
12+
exporters: [prometheusremotewrite/observe]

packaging/linux/etc/observe-agent/connections/host_monitoring/host_metrics.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ service:
3636
metrics/host_monitoring_host:
3737
receivers: [hostmetrics/host-monitoring-host]
3838
processors: [memory_limiter, resourcedetection, resourcedetection/cloud, batch]
39-
exporters: [otlphttp/observe]
39+
exporters: [prometheusremotewrite/observe]

packaging/linux/etc/observe-agent/connections/host_monitoring/process_metrics.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ service:
3030
metrics/host_monitoring_process:
3131
receivers: [hostmetrics/host-monitoring-process]
3232
processors: [memory_limiter, resourcedetection, resourcedetection/cloud, batch]
33-
exporters: [otlphttp/observe]
33+
exporters: [prometheusremotewrite/observe]

0 commit comments

Comments
 (0)