collector-topologylisted
Install: claude install-skill radra23/otel-as-code-plugin
# OpenTelemetry Collector Topology
## Two modes: agent and gateway
### Agent mode
Runs on every host/pod alongside the application. Receives OTLP from the app,
applies basic processing, forwards to a gateway or directly to a backend.
```yaml
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317 # app sends here
http:
endpoint: 0.0.0.0:4318
processors:
batch:
timeout: 1s
send_batch_size: 1024
memory_limiter:
check_interval: 1s
limit_mib: 256
exporters:
otlp:
endpoint: gateway.internal:4317 # or backend endpoint
tls:
insecure: false
service:
pipelines:
traces:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [otlp]
metrics:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [otlp]
logs:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [otlp]
```
### Gateway mode
Centralized aggregation tier. Receives from agents, applies tail sampling, exports to backend(s).
Adds `tail_sampling` processor between `memory_limiter` and `batch`:
```yaml
processors:
tail_sampling:
decision_wait: 10s
num_traces: 100000
expected_new_traces_per_sec: 10000
policies:
- name: errors-policy
type: status_code
status_code: {status_codes: [ERROR]}
- name: slow-traces-policy
type: latency
latency: {threshold_ms: 1000}
- name: debug-policy