Monitor Endpoints

Track custom metrics from your deployment endpoints by printing JSON metadata. Valohai automatically collects and visualizes these metrics.

Collect metrics

Print JSON with vh_metadata to log metrics from your endpoint:

import json
 
print(json.dumps({
    "vh_metadata": {
        "accuracy": 0.9247,
        "best_guess": "dog",
        "confidence": 0.87
    }
}))

Valohai parses this output and makes it available for visualization.

View metrics

Access deployment metrics from your deployment version:

  1. Open the Deployment tab

  2. Select your deployment

  3. Click on a version

  4. View metrics in the Monitoring tab

Available visualizations:

  • Time series charts (metrics over time)

  • Histograms (distribution of values)

  • Request logs (individual predictions)

Common metrics to track

Model performance:

print(json.dumps({
    "vh_metadata": {
        "prediction_confidence": 0.94,
        "processing_time_ms": 23
    }
}))

Business metrics:

print(json.dumps({
    "vh_metadata": {
        "fraud_detected": True,
        "transaction_amount": 1250.00
    }
}))

System metrics:

import time

start = time.time()
# ... inference code ...
duration = time.time() - start

print(json.dumps({
    "vh_metadata": {
        "inference_latency_ms": int(duration * 1000)
    }
}))

View endpoint logs

Access full logs for debugging or detailed inspection:

  1. Navigate to your deployment version

  2. Select an endpoint

  3. Click Log tab

  4. Filter by time range or search for specific events


Next: Learn how to troubleshoot failing endpoints.

Last updated

Was this helpful?