# OpenTelemetry Collector configuration file
# https://cratedb.com/docs/guide/integrate/opentelemetry/
#
# https://github.com/open-telemetry/opentelemetry-collector-releases/blob/main/distributions/otelcol-contrib/config.yaml
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/prometheusremotewriteexporter
#
# To limit exposure to denial-of-service attacks, change the host in endpoints below from 0.0.0.0 to a specific network interface.
# See https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/security-best-practices.md#safeguards-against-denial-of-service-attacks

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317
      http:
        endpoint: 0.0.0.0:4318
  carbon:
    endpoint: 0.0.0.0:2003
    transport: tcp
    parser:
      type: plaintext
      config:

processors:
  batch:

exporters:
  prometheusremotewrite:
    endpoint: "http://cratedb-prometheus-adapter:9268/write"
    remote_write_queue:
      enabled: false
    external_labels:
      subsystem: "otel-testdrive"
  debug:
    verbosity: detailed

service:

  pipelines:

    metrics:
      receivers: [otlp, carbon]
      processors: [batch]
      exporters: [debug, prometheusremotewrite]

    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [debug]

    logs:
      receivers: [otlp]
      processors: [batch]
      exporters: [debug]
