Skip to main content

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] [--syslog_address SYSLOG_ADDRESS]
                   [--syslog_facility {auth,authpriv,cron,daemon,ftp,kern,lpr,mail,news,security,syslog,user,uucp,local0,local1,local2,local3,local4,local5,local6,local7}]
                   [--request_pool_connections REQUEST_POOL_CONNECTIONS]
                   [--request_pool_maxsize REQUEST_POOL_MAXSIZE]
                   [--request_max_retries REQUEST_MAX_RETRIES]
                   [--request_pool_block REQUEST_POOL_BLOCK]
                   [--request_timeout REQUEST_TIMEOUT]

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.The default is Select All
  --syslog_address SYSLOG_ADDRESS
                        syslog address, enable syslog handle when value is not
                        empty, If you want to send to the local, the value is
                        '/dev/log'
  --syslog_facility {auth,authpriv,cron,daemon,ftp,kern,lpr,mail,news,security,syslog,user,uucp,local0,local1,local2,local3,local4,local5,local6,local7}
                        syslog facility, can only be used when syslog is
                        enabled
  --request_pool_connections REQUEST_POOL_CONNECTIONS
                        init connections for the requests pool, default is 10
  --request_pool_maxsize REQUEST_POOL_MAXSIZE
                        max size for the requests pool, default is 10
  --request_max_retries REQUEST_MAX_RETRIES
                        max retries for the request, default is 3
  --request_pool_block REQUEST_POOL_BLOCK
                        whether to block the request when pool is full,
                        default is False
  --request_timeout REQUEST_TIMEOUT
                        timeout of request in seconds, default is 9

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

Metadata

Release files for graphite-exporter 1.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for graphite-exporter 1.2.2
File Size Uploaded
graphite_exporter-1.2.2.tar.gz 13.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for graphite-exporter 1.2.2
File Interpreter ABI Platform
graphite_exporter-1.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 26.1 kB

Release files / graphite_exporter-1.2.2.tar.gz

Download URL graphite_exporter-1.2.2.tar.gz
Size 13.2 kB
Tags Source
SHA-256 checksum
How to use checksums
196c96be98c787d8115c8945ec7ac045e338b3b53999922d07e3e87298b8f017
BLAKE2b-256 checksum
How to use checksums
9afd45028b054d4e51a7d2e6cc582180780467595d67212a3edbd6bcc6c82e32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.7.3 Linux/5.15.77-amd64-desktop

Release files / graphite_exporter-1.2.2-py3-none-any.whl

Download URL graphite_exporter-1.2.2-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d5552146f0ebe2ad08fe3473068a239499a34167e26a8ae23ba46a6858f8097
BLAKE2b-256 checksum
How to use checksums
d98e832f1a1f34222ff24a869ce53fc609485206ff1063e9e737e8553f370db7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.7.3 Linux/5.15.77-amd64-desktop

Release history Release notifications | RSS feed

This release

1.2.2 This release

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page