Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
config:
  http:
    metrics:
      # The tags to include/exclude when emitting logs
      # Exact field names can be specified.
      # Regex pattern can be specified.
      # If both includes and excludes are given, then a field is only included
      # if it matches an includes rule and does not match an exclude rule..
      # If a field is json formatted, then subfields can be extracted using
      # the following format: field_name$JSON$<json pointer>
      tags_include:
        - request_type
        - response_code
        - request_headers$JSON$/Accept
        - request_headers$JSON$/Host
      tags_exclude:

Scraping of Metrics

Since Knight exposes a prometheus endpoint , autodiscovery of prometheus endpoint using Datadog or Prometheus should work.If using kfuse or datadog agent, then for its collected metrics. However, it is recommended to use Datadog agent to scrape the metrics, in order to automatically enrich the collected metrics with cloud and Kubernetes labels. In addition to the the configurations specified in Collecting Data Using Datadog Agent already enables collection of Knight metrics. At the minimum, the following config is needed:, add the following configuration in the Datadog agent yaml file.

Code Block
datadog:
  kubeStateMetricsEnabled: true
  kubeStateMetricsCore:
    enabled: true
    ignoreLegacyKSMCheck: false
  prometheusScrape:
    enabled: true
    version: 1
    additionalConfigs:
      - configurations:
        - send_monotonic_counter: false
          send_distribution_counts_as_monotonic: false
          send_distribution_sums_as_monotonic: false
          send_histograms_buckets: true
          max_returned_metrics: 999999
          min_collection_interval: 15
        autodiscovery:
          kubernetes_annotations:
            exclude:
              app: knight
              prometheus.io/scrape: "false"
      - configurations:
        - send_monotonic_counter: false
          send_distribution_counts_as_monotonic: false
          send_distribution_sums_as_monotonic: false
          send_histograms_buckets: true
          max_returned_metrics: 999999
          min_collection_interval: 60
        autodiscovery:
          kubernetes_container_names:
            - knight