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:
Open the Deployment tab
Select your deployment
Click on a version
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:
Navigate to your deployment version
Select an endpoint
Click Log tab
Filter by time range or search for specific events
Next: Learn how to troubleshoot failing endpoints.
Last updated
Was this helpful?
