Add serving endpoint metrics export with Prometheus parser#415
Open
jralfonsog wants to merge 2 commits intodatabricks-solutions:mainfrom
Open
Add serving endpoint metrics export with Prometheus parser#415jralfonsog wants to merge 2 commits intodatabricks-solutions:mainfrom
jralfonsog wants to merge 2 commits intodatabricks-solutions:mainfrom
Conversation
Co-authored-by: Isaac
- Docstrings: opening """ on its own line - Returns sections: bullet list format for dict keys Co-authored-by: Isaac
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
export_serving_endpoint_metrics()wraps the SDK'sexport_metricsAPI, returning both parsed structured dicts and raw Prometheus text_parse_prometheus_metrics()handles the full OpenMetrics exposition format — HELP/TYPE metadata, labels, histogram buckets, and optional timestamps{"name", "labels", "value", "help", "type"}so LLMs can reason about endpoint health without parsing raw textAvailable metrics
cpu_usage_percentagemem_usage_percentagerequest_count_totalrequest_4xx_count_totalrequest_5xx_count_totalrequest_latency_msgpu_usage_percentagegpu_memory_usage_percentageChanges
serving/endpoints.pyexport_serving_endpoint_metrics(), +_parse_prometheus_metrics(), addedreimport andResourceDoesNotExist/NotFoundfor typed error handlingserving/__init__.pytools/serving.py@mcp.tool(timeout=30)wrappertests/unit/test_serving_metrics.pyTest plan
aws-feworkspace — returned 3 metrics for a scaled-to-zero sklearn endpointThis pull request was AI-assisted by Isaac