Skip to main content

Prometheus Graphite Exporter

Project description

graphite_exporter

Prometheus Graphite Exporter

Installation

pip install graphite_exporter

Usage

How to run

can use python -m after install graphite_exporter

>> python3 -m graphite_exporter -h

usage: __main__.py [-h] [-i IP] [-c CONFIG] [-p PORT] [-P LISTEN_PORT]
                   [-l LOG_LEVEL] [-L APSCHEDULER_LOG_LEVEL]
                   [-s SYSTEM_METRIC]

optional arguments:
  -h, --help            show this help message and exit
  -i IP, --ip IP        graphite web ip. eg: 127.0.0.1 or 127.0.0.1,127.0.0.2
  -c CONFIG, --config CONFIG
                        Metric config path
  -p PORT, --port PORT  graphite web port
  -P LISTEN_PORT, --listen_port LISTEN_PORT
                        graphite exporter listen port
  -l LOG_LEVEL, --log_level LOG_LEVEL
                        log level
  -L APSCHEDULER_LOG_LEVEL, --apscheduler_log_level APSCHEDULER_LOG_LEVEL
                        apscheduler log level, default warning
  -s SYSTEM_METRIC, --system_metric SYSTEM_METRIC
                        Select the system metric to use. System Metric: carbon
                        _update_operations,carbon_metrics_received,carbon_comm
                        itted_points,carbon_points_per_update,carbon_cpu_usage
                        ,carbon_creates

Custom Metric and Config

The graphite_exporter can be configured to translate specific dot-separated graphite metrics into labeled Prometheus metrics via YAML configuration file.

An example configuration:

# base param
global:
  prefix: graphite      # prometheus metric prefix
  interval: 1m          # collection data interval
  from: -1min           # graphite web requests param. learn more: https://graphite.readthedocs.io/en/latest/render_api.html#from-until
  until: now            # graphite web requests param. learn more: https://graphite.readthedocs.io/en/latest/render_api.html#from-until
  timeout: 10           # requests timeout

metrics:
  - metric: example.*.*.user    # graphite metric
    name: user_cnt              # prometheus metric name
    doc: user cnt               # prometheus metric doc 
    prefix: gaphite1
    interval: 2m
    from: -10min
    until: now
    timeout: 20
    labels:                     # prometheus metric tag info:
      service: ${0}             #   service: ${0}  -> {service='example'}
      app: ${1}
      project: ${2}

  - metric: example.*.app1.dau
    name: dau
    doc: dau
    # No base parameters are set, 
    # this metric base param will auto set from global base param
    labels:
      service_project: ${0}-${2}  # service_project: ${0}-${2} -> {service_project='example-app1'}    
      app: ${1}
      project: ${2}

  - metric: aliasByMetric(example.*.*.dau)  # graphite return metric name: dau
    name: dau
    doc: dau
    labels:
      metric: dau    # metric only be one value: dau

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

graphite_exporter-1.2.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

graphite_exporter-1.2.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file graphite_exporter-1.2.0.tar.gz.

File metadata

  • Download URL: graphite_exporter-1.2.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.5.3

File hashes

Hashes for graphite_exporter-1.2.0.tar.gz
Algorithm Hash digest
SHA256 74f289c1f744b59f7861222974eb211b20296cf12f1727d2d48fae6038692a9d
MD5 cc5399eaa6b97e04d17e0d21cbdd1ace
BLAKE2b-256 e355a4ccea8c6973d06b57e91612ca6719bc0b296e5be25cf9307f4e0098c760

See more details on using hashes here.

File details

Details for the file graphite_exporter-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: graphite_exporter-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.5.3

File hashes

Hashes for graphite_exporter-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4048dba7e4f68f2fff154a7dbcf05e446330af92ac5a09fc7459fe30567f4c5b
MD5 8ce261bbe6ff6fd5991916d6cd628bd5
BLAKE2b-256 2084ea4ae57b131e0bc0b2adcdc15608ad079e40c50511894162c5d2060c95cc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page