Code Monkey home page Code Monkey logo

tungsten-prometheus-exporter's Introduction

tungsten-prometheus-exporter

A simple prometheus exporter for OpenContrail/TungstenFabric.

Usage

$ tungsten-prometheus-exporter --config /path/to/config.yml
or
$ TUNGSTEN_PROMETHEUS_EXPORTER=/path/to/config.yml tungsten-prometheus-exporter

Metrics are available on port 8080 by default.

Authentication

If authentication is enabled on the analytics API you need to provide Openstack credentials.

By default no authentication is made. Use the --os-auth-type to choose the desired authentication plugin (v2password, v3password).

Depending on the selected auth plugin multiple options needs to be set on the command line or exported in environment variables (use --help to see them all). For example to use v2password:

$ tungsten-prometheus-exporter --config config.yaml --os-auth-type v2password --os-username admin --os-password development --os-auth-url http://localhost:35357/v2.0/ --os-tenant-name openstack

Configuration

Configuration is provided as a yaml file.

You should at least configure analytics.host and metrics.

Analytics host can be configured with the --host option or TUNGSTEN_PROMETHEUS_EXPORTER_ANALYTICS_HOST env variable.

Configuration file location can be configured with the --config option or TUNGSTEN_PROMETHEUS_EXPORTER_CONFIG env variable.

Other configuration options are described below with default values for reference.

Section analytics

analytics:
  host: http://ANALYTICS_API:8081
  base_url: /analytics/uves

Section prometheus

Define port of metrics endpoint and prefix for all metric names.

Default settings:

prometheus:
  port: 8080
  metric_name_prefix: "tungsten"

Section logging

Defines the pyhon logging level of tungsten-prometheus-exporter.

Default settings:

logging:
  level: INFO

Section scraper

Settings for scraper workers that will fetch data from analytics API.

Default settings:

scraper:
  max_retry: 3      # number of retries when an http call fails
  timeout: 1        # http timeout in seconds
  pool_size: 10     # maximum number of concurrent http calls
  interval: 60      # wait time in seconds between scrapes

Section metrics

Describes the list of metrics to export.

A metric is described with the following attributes:

  • name: base name of the metric
  • type: prometheus metric type (eg: Gauge, Enum)
  • uve_type: uve type to fetch (eg: vrouter, bgp-peer...)
  • uve_module: uve module data to fetch (eg: NodeStatus...)
  • uve_instances: list of instances (default: *)
  • json_path: a JSON path expression to target the metric in the json
  • labels_from_path: add metric labels based on the attribute path
  • append_field_name: append the target attribute to the metric name (default: true)

Look at ./examples directory for metrics examples.

Vrouters drop stats example

metrics:
  - name: vrouter_drop_stats
    type: Gauge
    uve_type: vrouter
    uve_module: VrouterStatsAgent
    json_path: drop_stats.*

This will scrape the url http://ANALYTICS_IP:8081/analytics/uves/vrouter/*?flat&cfilt=VrouterStatsAgent.

The returned json will contain:

{
  "VrouterStatsAgent": {
    "drop_stats": {
      "ds_rewrite_fail": 0,
      "ds_mcast_df_bit": 0,
      "ds_flow_no_memory": 0,
      "ds_push": 0,
      ...
    }
  }
}

Because of json_path for every attribute in the drop_stats object a prometheus gauge will be created:

  • vrouter_drop_stats_ds_rewrite_fail
  • vrouter_drop_stats_ds_mcast_df_bit
  • ...

tungsten-prometheus-exporter's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

tungsten-prometheus-exporter's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.