apiVersion: v1
kind: ConfigMap
metadata:
  name: nsq-traefik-consumer
  labels:
    team: platform
  namespace: prod
data:
  config.yaml: |
    LogLevel: warning
    Nsq:
      Addresses:
          - http://prod.nsqlookupd.service.consul:4161
      Topic: logstash-k8s
      Channel: logstash-k8s-influx-consumers
      MaxInFlight: 200
    Kubernetes:
      AnnotationKey: wikia_com/keys
    InfluxDB:
      Address: http://prod.app-metrics-db.service.sjc.consul:8086
      Database: ingress
      SendInterval: 5s
      Measurement: access_logs
      RetentionPolicy: default
      BatchSize: 100
    Fields:
      - duration
      - backend_url.Host
      - backend_url.Path
      - backend_address
      - client_address
      - client_host
      - client_port
      - client_username
      - request_address
      - request_host
      - request_port
      - request_method
      - request_path
      - request_protocol
    #  - request_line
      - request_content_size
      - origin_duration
      - origin_content_size
      - origin_status
    #  - origin_status_line
      - downstream_status
    #  - downstream_status_line
      - downstream_content_size
      - request_count
      - gzip_ratio
      - overhead
      - retry_attempts
      - original_timestamp
      - request__referer
      - request__user-agent
    Rules:
      - Id: helios
        FrontendRegexp: ^prod\.res\.k8s\.wikia\.net/helios
        Sampling: 0.1
      - Id: helios
        FrontendRegexp: ^services\.wikia\.com/auth
        Sampling: 0.1
      - Id: services-all
        FrontendRegexp: ^services\.wikia\.com
        Sampling: 0.2
      - Id: services-all-internal
        FrontendRegexp: ^res\.k8s\.wikia\.net
        Sampling: 0.1
      - Id: services-all-internal
        FrontendRegexp: ^prod\.res\.k8s\.wikia\.net
        Sampling: 0.1
      - Id: liftigniter-metadata
        FrontendRegexp: ^liftigniter-metadata\.prod\.res\.k8s\.wikia\.net
        Sampling: 0.05
      - Id: discussions-front-end
        FrontendRegexp: ^discussions-front-end-prod\.prod\.res\.k8s\.wikia\.net
        Sampling: 0.5
