Vibe coded mlflow to prometheus metrics
  • Rust 75.5%
  • Nix 13.4%
  • Dockerfile 11.1%
Find a file
damfle 341e0c9842
All checks were successful
CI / Lint (push) Successful in 37s
CI / Test (push) Successful in 48s
CI / Build (push) Successful in 58s
CI / Create Tag (push) Successful in 7s
CD / Build and Push Container (push) Successful in 1m21s
fix: format
2026-06-19 16:39:31 +02:00
.forgejo/workflows init: initial commit 2026-05-08 13:33:53 +02:00
src fix: format 2026-06-19 16:39:31 +02:00
.dockerignore fix: dockerignore and rust version 2026-06-19 16:37: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 fix: dockerignore and rust version 2026-06-19 16:37:53 +02:00
Dockerfile init: initial commit 2026-05-08 13:33:53 +02:00
flake.nix min: move to flake 2026-06-19 16:33:09 +02:00
README.md 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"]