Skip to main content

prometheus exporter for OpenMLDB

Project description

OpenMLDB Prometheus Exporter

Intro

This directory contains

  1. OpenMLDB Exporter exposing prometheus metrics
  2. OpenMLDB mixin provides well-configured examples for prometheus server and grafana dashboard

Supported versions:

  • OpenMLDB >= 0.5.0

Development

Requirements

  • Python >= 3.8
  • poetry as build tool
  • cmake (optional if want to test latest commit)
  • a runnable OpenMLDB instance that is accessible from your network

Build

The exporter is a python project, the only thing need to built was the native library required by python sdk. To build, cd to root directory of OpenMLDB, and run:

make SQL_PYSDK_ENABLE=ON

Note: build is only required when tesing over latest commit is needed, otherwise, it can installed directly from pip (when 0.5.0 released):

pip install openmldb-exporter==0.5.0

Run

  1. setup python dependencies:

    poetry install
    
  2. enter virtual environment

    poetry shell
    
  3. start openmldb exporter

    poetry run openmldb-exporter
    

    you need pass necessary flags after openmldb-exporter. run poetry run openmldb-exporter --help to get the help info

    usage: openmldb-exporter [-h] [--log.level LOG.LEVEL] [--web.listen-address WEB.LISTEN_ADDRESS]
                             [--web.telemetry-path WEB.TELEMETRY_PATH] [--config.zk_root CONFIG.ZK_ROOT]
                             [--config.zk_path CONFIG.ZK_PATH] [--config.interval CONFIG.INTERVAL]
    
    OpenMLDB exporter
    
    optional arguments:
      -h, --help            show this help message and exit
      --log.level LOG.LEVEL
                            config log level, default WARN
      --web.listen-address WEB.LISTEN_ADDRESS
                            process listen port, default 8000
      --web.telemetry-path WEB.TELEMETRY_PATH
                            Path under which to expose metrics, default metrics
      --config.zk_root CONFIG.ZK_ROOT
                            endpoint to zookeeper, default 127.0.0.1:6181
      --config.zk_path CONFIG.ZK_PATH
                            root path in zookeeper for OpenMLDB, default /
      --config.interval CONFIG.INTERVAL
                            interval in seconds to pull metrics periodically, default 30.0
    
  4. view the available metrics, you can pull through curl

    curl http://127.0.0.1:8000/metrics
    

    a example output:

    # HELP openmldb_connected_seconds_total duration for a component conncted time in seconds                              
    # TYPE openmldb_connected_seconds_total counter                                                                        
    openmldb_connected_seconds_total{endpoint="172.17.0.15:9520",role="tablet"} 208834.70900011063                         
    openmldb_connected_seconds_total{endpoint="172.17.0.15:9521",role="tablet"} 208834.70700001717                         
    openmldb_connected_seconds_total{endpoint="172.17.0.15:9522",role="tablet"} 208834.71399998665                         
    openmldb_connected_seconds_total{endpoint="172.17.0.15:9622",role="nameserver"} 208833.70000004768                     
    openmldb_connected_seconds_total{endpoint="172.17.0.15:9623",role="nameserver"} 208831.70900011063                     
    openmldb_connected_seconds_total{endpoint="172.17.0.15:9624",role="nameserver"} 208829.7230000496                      
    # HELP openmldb_connected_seconds_created duration for a component conncted time in seconds                            
    # TYPE openmldb_connected_seconds_created gauge                                                                        
    openmldb_connected_seconds_created{endpoint="172.17.0.15:9520",role="tablet"} 1.6501813860467942e+09                   
    openmldb_connected_seconds_created{endpoint="172.17.0.15:9521",role="tablet"} 1.6501813860495396e+09                   
    openmldb_connected_seconds_created{endpoint="172.17.0.15:9522",role="tablet"} 1.650181386050323e+09                    
    openmldb_connected_seconds_created{endpoint="172.17.0.15:9622",role="nameserver"} 1.6501813860512116e+09               
    openmldb_connected_seconds_created{endpoint="172.17.0.15:9623",role="nameserver"} 1.650181386051238e+09                
    openmldb_connected_seconds_created{endpoint="172.17.0.15:9624",role="nameserver"} 1.6501813860512598e+09               
    

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

openmldb-exporter-0.5.0a0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

openmldb_exporter-0.5.0a0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file openmldb-exporter-0.5.0a0.tar.gz.

File metadata

  • Download URL: openmldb-exporter-0.5.0a0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.2 Darwin/21.4.0

File hashes

Hashes for openmldb-exporter-0.5.0a0.tar.gz
Algorithm Hash digest
SHA256 1ec663f3dab24a8554828c79d80696147317a2813fbd780b22917f173ff364fc
MD5 d97e92a30c78c4d2a0034ca6e8ceaab2
BLAKE2b-256 34e2a9f823e02ce803e18d0790e6223df3f6f8953482fb0684690eb930a1a90d

See more details on using hashes here.

File details

Details for the file openmldb_exporter-0.5.0a0-py3-none-any.whl.

File metadata

File hashes

Hashes for openmldb_exporter-0.5.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 b4810e43a0840391f695481aab7ed0b4a3b66a1fa3e803fe526c97930fffff4f
MD5 057693e31326aa92d2761f29e3c8e43d
BLAKE2b-256 d5321b8f6ecc8981b9508fe57b806817b144e39949fbda1312b08e8968f32825

See more details on using hashes here.

Supported by

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