receivers:
  prometheus:
    config:
      scrape_configs:
        - job_name: checkout
          scrape_interval: 30s
          static_configs:
            - targets: [checkout.example.internal:9464]

processors:
  memory_limiter:
    check_interval: 1s
    limit_percentage: 80
    spike_limit_percentage: 25
  # Prometheus counters are cumulative; Dynatrace's OTLP metrics ingest
  # accepts delta only.
  cumulativetodelta:
    include:
      match_type: regexp
      metrics: [".*_total$"]
  batch:
    timeout: 5s

exporters:
  otlphttp/dynatrace:
    endpoint: https://abc12345.live.dynatrace.com/api/v2/otlp
    headers:
      Authorization: Api-Token ${env:DT_API_TOKEN}
    sending_queue:
      enabled: true

service:
  pipelines:
    metrics:
      receivers: [prometheus]
      processors: [memory_limiter, cumulativetodelta, batch]
      exporters: [otlphttp/dynatrace]
