feat(otel): export traces to Tempo, add memory_limiter
This commit is contained in:
@@ -643,7 +643,7 @@ services:
|
||||
volumes:
|
||||
- ./infra/otel/otel-collector.yml:/etc/otelcol-contrib/config.yaml:ro
|
||||
depends_on:
|
||||
- jaeger
|
||||
- tempo
|
||||
- loki
|
||||
healthcheck:
|
||||
test:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# OpenTelemetry Collector configuration
|
||||
# Fan-out: traces → Jaeger, metrics → Prometheus scrape, logs → Loki
|
||||
# Fan-out: traces → Tempo, metrics → Prometheus scrape, logs → Loki
|
||||
|
||||
receivers:
|
||||
otlp:
|
||||
@@ -14,6 +14,11 @@ processors:
|
||||
timeout: 5s
|
||||
send_batch_size: 1024
|
||||
|
||||
memory_limiter:
|
||||
check_interval: 5s
|
||||
limit_mib: 256
|
||||
spike_limit_mib: 64
|
||||
|
||||
resource:
|
||||
attributes:
|
||||
- key: deployment.environment
|
||||
@@ -21,8 +26,8 @@ processors:
|
||||
action: upsert
|
||||
|
||||
exporters:
|
||||
otlp_grpc/jaeger:
|
||||
endpoint: jaeger:4317
|
||||
otlp_http/tempo:
|
||||
endpoint: http://tempo:4318
|
||||
tls:
|
||||
insecure: true
|
||||
|
||||
@@ -44,13 +49,13 @@ service:
|
||||
pipelines:
|
||||
traces:
|
||||
receivers: [otlp]
|
||||
processors: [batch, resource]
|
||||
exporters: [otlp_grpc/jaeger]
|
||||
processors: [memory_limiter, batch, resource]
|
||||
exporters: [otlp_http/tempo]
|
||||
metrics:
|
||||
receivers: [otlp]
|
||||
processors: [batch]
|
||||
processors: [memory_limiter, batch]
|
||||
exporters: [prometheus]
|
||||
logs:
|
||||
receivers: [otlp]
|
||||
processors: [batch, resource]
|
||||
processors: [memory_limiter, batch, resource]
|
||||
exporters: [otlp_http/loki]
|
||||
|
||||
@@ -127,3 +127,15 @@ class TestPerServiceStages:
|
||||
for container, label in self.EXPECTED.items():
|
||||
assert f'container="{container}"' in text, f"no match stage for {container}"
|
||||
assert label in text, f"no {label} extraction for {container}"
|
||||
|
||||
|
||||
class TestOtelTempo:
|
||||
def test_otel_exports_traces_to_tempo(self):
|
||||
cfg = yaml.safe_load((ROOT / "infra/otel/otel-collector.yml").read_text())
|
||||
exporters = cfg["exporters"]
|
||||
assert "otlp_http/tempo" in exporters
|
||||
assert exporters["otlp_http/tempo"]["endpoint"] == "http://tempo:4318"
|
||||
assert "otlp_grpc/jaeger" not in exporters
|
||||
traces = cfg["service"]["pipelines"]["traces"]
|
||||
assert "otlp_http/tempo" in traces["exporters"]
|
||||
assert "memory_limiter" in traces["processors"]
|
||||
|
||||
Reference in New Issue
Block a user