Prometheus Integrations (Exporters) - Kav91/nri-flex-concept GitHub Wiki

Prometheus Support - Exporters

  • Supports all Prometheus exporters
  • Flex will attempt to flatten all Prometheus metrics for you to save on events being generated, however you may need to do some minor additional configuration (below) to get the best output
  • With the automatically flattened event, histogram & summary, count & sum values are retained
  • If you would like the full qauntiles and buckets, consider flagging on histogram, and/or summary to true
  • Target the /metrics endpoint and set your desired configuration, see further below for options
  • To quickly find out what metrics may need to be in their own samples or merged into the main sample, set -force_log and view the /metrics endpoint you are targetting
# Redis Example
---
name: prometheusRedisFlex
apis: 
  - name: prometheusRedis
    url: http://localhost:9121/metrics
    prometheus: 
      enable: true
      flattened_event: "prometheusRedisSample" # name of the event_type when metrics are flattened into a single sample
      # histogram: true # create separate histogram samples (default: false)
      # summary: true # create separate summary samples (default: false)
      # unflatten: true ### <- every prometheus metric will be unflattened into their own sample, other functions will not be available
      ############           use with caution as this can create a large amount samples
      ############           it is useful for testing to see the output of metrics you are getting as well
      key_merge: [cmd] # the same metric may exist multiple times, for different things, if we want to flatten them out we can use this parameter
      ############        eg. "redis_commands_duration_seconds_total" Metric exists for multiple commands, there is a "cmd" attribute on each metric to distinguish each command
      ############        so we add "cmd" to the array to flatten it like this eg. "redis_commands_duration_seconds_total.info" = 132 ("info was the command in this case")
      ###########        db could also be added here, so you could just add to the array eg. key_merge: [cmd,db]
      sample_keys:
        prometheusRedisDbSample: db # multiple metrics may exist where they correspond to the same thing like metrics of each particular database
      ############                     eg. redis_db_keys_expiring and redis_db_keys, both have a "db" key to distinguish each database
      ############                     this will let us roll up all the metrics that contain the "db" key into a "prometheusRedisDbSample"
      ############                     we could also use cmd here, if we wanted them in separate samples add for eg. prometheusRedisCmdSample: cmd
    custom_attributes: # apply any custom attributes as you require
      serverName: mySuperServer
    #snake_to_camel: true

# Etcd Example
---
name: prometheusEtcdFlex
apis: 
  - name: prometheusEtcd
    url: http://localhost:2379/metrics
    prometheus: 
      enable: true
      flattened_event: "prometheusEtcdSample"
      key_merge: [action]
      sample_keys:
        prometheusEtcdServiceSample: grpc_service