1# OpenTelemetry Collector for 012, all into ClickHouse. Two ways in:2# - OTLP/HTTP on 4318 (published on 127.0.0.1 only): 012 --otlp3# http://localhost:4318, or OTEL_EXPORTER_OTLP_ENDPOINT, sends its4# logs, traces and metrics (JSON encoding); gRPC on 4317 for others.5# - The filelog receiver, the alternative for logs only: 012 --log6# .deps/obs/logs/012.jsonl. Use one or the other for a session, or its7# logs arrive twice.8extensions:9 health_check:10 endpoint: 0.0.0.0:1313311 file_storage:12 directory: /var/lib/otelcol # remembers how far each log was read1314receivers:15 otlp:16 protocols:17 grpc:18 endpoint: 0.0.0.0:431719 http:20 endpoint: 0.0.0.0:431821 file_log/012:22 include: [/var/log/012/*.jsonl]23 start_at: beginning24 storage: file_storage25 operators:26 # One slog JSON object per line: time, level, msg, service, event,27 # dur_ms and the event's counts become the record's attributes.28 - type: json_parser29 timestamp:30 parse_from: attributes.time31 layout_type: gotime32 layout: "2006-01-02T15:04:05.999999999Z07:00"33 severity:34 parse_from: attributes.level35 - type: move36 from: attributes.msg37 to: body38 - type: move39 from: attributes.service40 to: resource["service.name"]41 - type: remove42 field: attributes.time43 - type: remove44 field: attributes.level4546processors:47 memory_limiter:48 check_interval: 1s49 limit_mib: 40050 spike_limit_mib: 10051 batch:52 timeout: 2s5354exporters:55 clickhouse:56 endpoint: tcp://clickhouse:9000?dial_timeout=10s57 database: otel58 username: o1259 password: o1260 ttl: 720h61 create_schema: true6263service:64 extensions: [health_check, file_storage]65 pipelines:66 logs:67 receivers: [otlp, file_log/012]68 processors: [memory_limiter, batch]69 exporters: [clickhouse]70 traces:71 receivers: [otlp]72 processors: [memory_limiter, batch]73 exporters: [clickhouse]74 metrics:75 receivers: [otlp]76 processors: [memory_limiter, batch]77 exporters: [clickhouse]