Vibe coded mlflow to prometheus metrics
  • Rust 76.4%
  • Nix 12.4%
  • Dockerfile 11.2%
Find a file
damfle 1fb9aac166
Some checks failed
CI / Lint (push) Successful in 47s
CI / Test (push) Successful in 53s
CI / Build (push) Successful in 1m3s
CI / Create Tag (push) Failing after 8s
init: initial commit
2026-05-08 13:33:53 +02:00
.forgejo/workflows init: initial commit 2026-05-08 13:33:53 +02:00
src init: initial commit 2026-05-08 13:33:53 +02:00
.dockerignore init: initial commit 2026-05-08 13:33:53 +02:00
.gitignore init: initial commit 2026-05-08 13:33:53 +02:00
Cargo.lock init: initial commit 2026-05-08 13:33:53 +02:00
Cargo.toml init: initial commit 2026-05-08 13:33:53 +02:00
Dockerfile init: initial commit 2026-05-08 13:33:53 +02:00
README.md init: initial commit 2026-05-08 13:33:53 +02:00
shell.nix init: initial commit 2026-05-08 13:33:53 +02:00

mlflowtoprom

A simple Rust service that receives MLflow metrics and exposes them in Prometheus format.

Usage

  1. Send metrics (from TensorFlow/MLflow):

    curl -X POST http://localhost:8080/api/v2.0/mlflow/runs/MY_RUN_ID/log-metrics \
      -H "Content-Type: application/json" \
      -d '{"metrics": [{"key": "accuracy", "value": 0.95, "timestamp": 123, "step": 10}]}'
    
  2. Scrape metrics (Prometheus):

    curl http://localhost:8080/metrics
    

    Output:

    # HELP mlflow_MY_RUN_ID_accuracy Metric from MLflow run MY_RUN_ID
    # TYPE mlflow_MY_RUN_ID_accuracy gauge
    mlflow_MY_RUN_ID_accuracy 0.95
    
  3. Health checks (Kubernetes):

    curl http://localhost:8080/healthz  # Liveness probe
    curl http://localhost:8080/ready   # Readiness probe
    

Run

cargo run

Server listens on 0.0.0.0:8080.

Endpoints

Method Endpoint Description
POST /api/v2.0/mlflow/runs/{run_id}/log-metrics Accept MLflow metrics
GET /metrics Prometheus metrics
GET /healthz Kubernetes liveness
GET /ready Kubernetes readiness

Docker (optional)

FROM rust:1.70
WORKDIR /app
COPY . .
RUN cargo build --release
CMD ["./target/release/mlflowtoprom"]