Skip to content

Commit 18f4ce5

Browse files
[chore] update collector (open-telemetry#3870)
1 parent 4f228a3 commit 18f4ce5

2 files changed

Lines changed: 26 additions & 64 deletions

File tree

.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ OPENTELEMETRY_CPP_VERSION=1.27.0
99
OPAMP_GO_REF=fc016b0599ee6cb5ba479452055a3370e7238aaa
1010

1111
# Dependent images
12-
COLLECTOR_CONTRIB_IMAGE=ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.157.0
13-
COLLECTOR_EBPF_PROFILER_IMAGE=ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-ebpf-profiler:0.157.0
12+
COLLECTOR_CONTRIB_IMAGE=ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.159.0
13+
COLLECTOR_EBPF_PROFILER_IMAGE=ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-ebpf-profiler:0.159.0
1414
FIREPIT_IMAGE=ghcr.io/florianl/firepit:v0.1.0
1515
FLAGD_IMAGE=ghcr.io/open-feature/flagd:v0.16.0
1616
GRAFANA_IMAGE=grafana/grafana:13.1.0

src/otel-collector/otelcol-config.yml

Lines changed: 24 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,21 @@ receivers:
3131
collection_interval: 10s
3232
docker_stats:
3333
endpoint: unix:///var/run/docker.sock
34-
# https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/44511
35-
api_version: "1.44"
34+
metrics:
35+
container.blockio.io_serviced_recursive:
36+
enabled: true
37+
container.cpu.usage.system:
38+
enabled: true
39+
container.memory.hierarchical_memory_limit:
40+
enabled: true
41+
container.memory.rss:
42+
enabled: true
43+
container.network.io.usage.rx_packets:
44+
enabled: true
45+
container.network.io.usage.tx_packets:
46+
enabled: true
47+
container.uptime:
48+
enabled: true
3649
redis:
3750
endpoint: "valkey-cart:6379"
3851
username: "valkey"
@@ -60,11 +73,8 @@ receivers:
6073
enabled: true
6174
tls:
6275
insecure: true
63-
# Demo: scrape a Prometheus `/metrics` endpoint exposed by the ad service
64-
# using the Prometheus Java client library. This illustrates a common
65-
# OTel-adoption pattern -- bridging existing Prometheus-client
66-
# instrumentation into an OTel pipeline. For new custom metrics, prefer
67-
# the OpenTelemetry SDK directly. See `src/ad/README.md` for details.
76+
# Scrape a Prometheus `/metrics` endpoint exposed by the ad service.
77+
# See: https://opentelemetry.io/docs/demo/services/ad/#bridging-non-otel-custom-metrics-prometheus-client-library
6878
prometheus/ad:
6979
config:
7080
scrape_configs:
@@ -80,8 +90,6 @@ receivers:
8090
metrics:
8191
system.cpu.utilization:
8292
enabled: true
83-
system.cpu.logical.count:
84-
enabled: true
8593
disk:
8694
load:
8795
filesystem:
@@ -130,17 +138,14 @@ receivers:
130138
network:
131139
paging:
132140
metrics:
133-
system.paging.usage:
141+
system.paging.utilization:
134142
enabled: true
135143
processes:
136144
process:
137145
mute_process_exe_error: true
138146
mute_process_io_error: true
139147
mute_process_user_error: true
140148
system:
141-
metrics:
142-
system.uptime:
143-
enabled: true
144149

145150
exporters:
146151
debug:
@@ -150,13 +155,11 @@ processors:
150155
check_interval: 5s
151156
limit_percentage: 80
152157
spike_limit_percentage: 25
153-
resourcedetection:
158+
resource_detection:
154159
detectors: [env, docker, system]
155160
system:
156161
hostname_sources: ["os"]
157162
resource_attributes:
158-
host.name:
159-
enabled: true
160163
host.arch:
161164
enabled: true
162165
host.cpu.vendor.id:
@@ -173,8 +176,6 @@ processors:
173176
enabled: true
174177
os.description:
175178
enabled: true
176-
os.type:
177-
enabled: true
178179
filter/sanitize_profiles:
179180
error_mode: ignore
180181
profiles:
@@ -200,46 +201,7 @@ processors:
200201
trace_statements:
201202
- context: span
202203
statements:
203-
# Sanitize spans to prevent span metrics cardinality explosion
204-
# caused by non-compliant high cardinality span names:
205-
# 1. Define missing http.route on key HTTP operations for meaningful operation names
206-
# 2. Then normalize span names; http server spans lacking http.route default to operations "GET", "POST", etc.
207-
208-
# FRONTEND SERVICE
209-
210-
# Workaround for Next.js high cardinality span name issue: https://github.com/vercel/next.js/issues/54694
211-
- set(span.attributes["http.route"], "/api/cart") where
212-
span.kind == SPAN_KIND_SERVER and
213-
resource.attributes["service.name"] == "frontend" and
214-
span.attributes["http.route"] == nil and
215-
IsMatch(span.attributes["http.target"], "\\/api\\/cart") # e.g. # /api/cart
216-
217-
- set(span.attributes["http.route"], "/api/checkout") where
218-
span.kind == SPAN_KIND_SERVER and
219-
resource.attributes["service.name"] == "frontend" and
220-
span.attributes["http.route"] == nil and
221-
IsMatch(span.attributes["http.target"], "\\/api\\/checkout") # e.g. # /api/checkout
222-
223-
- set(span.attributes["http.route"], "/api/products/{productId}") where
224-
span.kind == SPAN_KIND_SERVER and
225-
resource.attributes["service.name"] == "frontend" and
226-
span.attributes["http.route"] == nil and
227-
IsMatch(span.attributes["http.target"], "\\/api\\/products\\/.*") # e.g. /api/products/1YMWWN1N4O
228-
229-
- set(span.attributes["http.route"], "/api/recommendations") where
230-
span.kind == SPAN_KIND_SERVER and
231-
resource.attributes["service.name"] == "frontend" and
232-
span.attributes["http.route"] == nil and
233-
IsMatch(span.attributes["http.target"], "\\/api\\/recommendations") # e.g. # /api/recommendations?productIds=...
234-
235-
- set(span.attributes["http.route"], "/api/data") where
236-
span.kind == SPAN_KIND_SERVER and
237-
resource.attributes["service.name"] == "frontend" and
238-
span.attributes["http.route"] == nil and
239-
IsMatch(span.attributes["http.target"], "\\/api\\/data.*") # e.g. # " /api/data?contextKeys=telescopes" or /api/data/?contextKeys=cameras
240-
241-
# SANITIZE ALL SPAN NAMES TO PREVENT CARDINALITY EXPLOSION
242-
- set_semconv_span_name("1.37.0", "original_span_name")
204+
- set_semconv_span_name("1.43.0", "original_span_name")
243205

244206
# Demo: redact sensitive attributes before export. Collector-side redaction is
245207
# a fallback -- prefer not collecting sensitive data in the first place.
@@ -276,19 +238,19 @@ service:
276238
pipelines:
277239
traces:
278240
receivers: [otlp]
279-
processors: [resourcedetection, memory_limiter, transform/sanitize_spans, gen_ai_normalizer, transform/redact_sensitive_data]
241+
processors: [resource_detection, memory_limiter, transform/sanitize_spans, gen_ai_normalizer, transform/redact_sensitive_data]
280242
exporters: [debug, span_metrics]
281243
metrics:
282244
receivers: [docker_stats, http_check/frontend-proxy, host_metrics, nginx, otlp, redis, postgresql, prometheus/ad, span_metrics]
283-
processors: [resourcedetection, memory_limiter]
245+
processors: [resource_detection, memory_limiter]
284246
exporters: [debug]
285247
logs:
286248
receivers: [otlp]
287-
processors: [resourcedetection, memory_limiter, transform/sanitize_logs]
249+
processors: [resource_detection, memory_limiter, transform/sanitize_logs]
288250
exporters: [debug]
289251
profiles:
290252
receivers: [otlp]
291-
processors: [resourcedetection, filter/sanitize_profiles, memory_limiter]
253+
processors: [resource_detection, filter/sanitize_profiles, memory_limiter]
292254
exporters: [debug]
293255
telemetry:
294256
metrics:

0 commit comments

Comments
 (0)