Skip to main content

prometheus exporter for OpenMLDB

Project description

OpenMLDB Exporter

PyPI PyPI - Python Version

Features

Requirements

  • A runnable OpenMLDB instance that is accessible from your network
  • OpenMLDB version >= 0.5.0
  • Python >= 3.8

Quick Start

You can run openmdlb-exporter from docker, or install and run directly from PyPI.

Use docker
docker run ghcr.io/4paradigm/openmldb-exporter \
    --config.zk_root=<openmldb_zk_addr> \
    --config.zk_path=<openmldb_zk_path>
Install and Run from PyPI
pip install openmldb-exporter

# start
openmldb-exporter \
    --config.zk_root=<openmldb_zk_addr> \
    --config.zk_path=<openmldb_zk_path>

And replace <openmdlb_zk_addr> and <openmldb_zk_path> to correct value. Afterwards, you can check metrics with curl:

curl http://<IP>:8000/metrics

<IP> is docker container IP, or 127.0.0.1 if installing from PyPI.

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               

Configuration

You can view the help from:

openmldb-exporter -h

--config.zk_root and --config.zk_path are mandatory.

Available options
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

Development

Extra Requirements

Run

  1. Setup python dependencies:

    poetry install
    
  2. Start openmldb exporter

    poetry run openmldb-exporter
    

    Pass in necessary flags after openmldb-exporter. Run poetry run openmldb-exporter --help to get the help info.

Release History

  • 0.8.0

    • Features
      • Upgrade OpenMLDB SDK to v0.8
      • improve test code
  • 0.7.1

    • Features
      • Upgrade OpenMLDB SDK to v0.7
      • Upgrade prometheus client to 0.16
  • 0.6.0

    • Features
      • Depends on OpenMLDB SDK v0.6

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.8.2.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

openmldb_exporter-0.8.2-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file openmldb_exporter-0.8.2.tar.gz.

File metadata

  • Download URL: openmldb_exporter-0.8.2.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.1 Darwin/23.1.0

File hashes

Hashes for openmldb_exporter-0.8.2.tar.gz
Algorithm Hash digest
SHA256 f5858e813dae3b60fe3905ffb62c856c0ffd55d0d0f43ce974878cd1c8f250d5
MD5 e32674df590a70f338b4619e700a9100
BLAKE2b-256 30a2a26516096b55e36fbacbee8cc89d835d9637f0e4c99046a0a259d9c8e5f8

See more details on using hashes here.

File details

Details for the file openmldb_exporter-0.8.2-py3-none-any.whl.

File metadata

File hashes

Hashes for openmldb_exporter-0.8.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7895e069376f3178649c22c9686fe578ff64586e55bcbe7123947de06294796c
MD5 09ec90abec5c911dd3d7bcb5c2519ad5
BLAKE2b-256 354428ab3e77042f9b000df6d52d80d446f448c323b412588960239b283f8399

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