justin 2836e1ae10 Refactor to prometheus_client, JSON logging, and codebase cleanup
- Replace file-based metrics and HTTP server with prometheus_client
  (Gauge + start_http_server), eliminating file I/O race conditions
- Fix ThreadProbe and thread restart lambda bugs
- Switch logging from RotatingFileHandler to JSON stdout for fluentd/Loki
- Add PYTHONUNBUFFERED=1 to Dockerfile for immediate container log output
- Upgrade base image from python:3.12.3-slim to python:3.13-slim
- Upgrade pyvmomi to 9.0.0.0; pin pydantic>=2.9.0 and typing_extensions>=4.12.2
  to use pre-built Python 3.13 wheels (removes Rust toolchain from build)
- Remove unused packages: boto3, botocore, s3transfer, jmespath, redis,
  docopt, pyflakes, posthog
- Remove unused imports (Posthog, CaseInsensitiveDict) and dead variables
  (callhomestats, local_site_info, lastStats)
- Fix service_profile() NameError (siteidentifier -> serviceProfileIdentifier)
- Remove bare print() in zvma.py __authhandler__, replace with self.log.info()
- Remove all commented-out PostHog blocks from zvma10/zvma.py
- Delete legacy zvma9_7/ module and app/logs/ directory
- Remove deprecated 'version: 3.3' from docker-compose.yml

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 19:05:45 -05:00
2023-03-22 22:59:30 -04:00
2023-12-21 10:34:41 -05:00
2023-04-01 14:57:38 -04:00
2023-03-06 07:07:51 -05:00

About the app

This Python App will export Zerto API data from the new ZVM appliance in prometheus format. It has several different threads that each scrape different parts of the ZVM API. To visualize the data in Grafana you will need to scrape this app with Prometheus and then create dashboards using Grafana.

Run Program

Login to the server where you want to run this exporter and clone the project:

  git clone https://github.com/recklessop/Zerto_Exporter.git

Go to the project directory:

  cd Zerto_Exporter

Build image and start the container:

  docker-compose up -d --build --force-recreate

Add the exporter to Prometheus

Add this part at the end of the configuration of your Prometheus (prometheus.yaml):

  - job_name: python-exporter
    metrics_path: /metrics.txt
    static_configs:
      - targets: ['<IP-of-Node-Exporter-Server>:9999']

Forked from

Huge shout out to hmdhszd for the framework that started this project. You can find his non-zerto version of a Python Prometheus Exporter here.

S
Description
No description provided
Readme Apache-2.0 433 KiB
Languages
Python 99.2%
Dockerfile 0.8%