Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 44 additions & 22 deletions docs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,28 @@
}
}
}
},
"/metrics": {
"get": {
"tags": [
"metrics"
],
"summary": "Metrics Endpoint Handler",
"description": "Handle request to the /metrics endpoint.",
"operationId": "metrics_endpoint_handler_metrics_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"text/plain": {
"schema": {
"type": "string"
}
}
}
}
}
}
}
Comment on lines +596 to 618
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

❓ Verification inconclusive

Clarify metrics response format & hard-code the correct media type

Prometheus/OpenMetrics scrapers expect the response to be served under the text/plain; version=0.0.4 (or application/openmetrics-text) content-type.
Keeping it as a generic text/plain can break auto-discovery and disables content-negotiation.
Consider also specifying a 503 error response for parity with the other health endpoints.

-                            "text/plain": {
+                            "text/plain; version=0.0.4": {
                               "schema": {
                                   "type": "string"
                               }
                             }

and optionally append:

             "responses": {
                 "200": { … },
+                "503": {
+                    "description": "Service Unavailable"
+                }
             }

Clarify metrics response media type & add 503 response

Prometheus/OpenMetrics scrapers require the exposition format to be served under text/plain; version=0.0.4 (or application/openmetrics-text) rather than a generic text/plain. Without this, auto-discovery and content-negotiation may break. Also, for consistency with other health endpoints, add a 503 Service Unavailable response.

• File: docs/openapi.json
• Lines: ~596–618

         "/metrics": {
             "get": {
                 "tags": [
                     "metrics"
                 ],
                 "summary": "Metrics Endpoint Handler",
                 "description": "Handle request to the /metrics endpoint.",
                 "operationId": "metrics_endpoint_handler_metrics_get",
                 "responses": {
-                    "200": {
-                        "description": "Successful Response",
-                        "content": {
-                            "text/plain": {
-                                "schema": {
-                                    "type": "string"
-                                }
-                            }
-                        }
-                    }
+                    "200": {
+                        "description": "Successful Response",
+                        "content": {
+                            "text/plain; version=0.0.4": {
+                                "schema": {
+                                    "type": "string"
+                                }
+                            }
+                        }
+                    },
+                    "503": {
+                        "description": "Service Unavailable"
+                    }
                 }
             }
         }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
},
"/metrics": {
"get": {
"tags": [
"metrics"
],
"summary": "Metrics Endpoint Handler",
"description": "Handle request to the /metrics endpoint.",
"operationId": "metrics_endpoint_handler_metrics_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"text/plain": {
"schema": {
"type": "string"
}
}
}
}
}
}
}
},
"/metrics": {
"get": {
"tags": [
"metrics"
],
"summary": "Metrics Endpoint Handler",
"description": "Handle request to the /metrics endpoint.",
"operationId": "metrics_endpoint_handler_metrics_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"text/plain; version=0.0.4": {
"schema": {
"type": "string"
}
}
}
},
"503": {
"description": "Service Unavailable"
}
}
}
}
🤖 Prompt for AI Agents
In docs/openapi.json around lines 596 to 618, update the response media type for
the /metrics GET endpoint from "text/plain" to "text/plain; version=0.0.4" or
"application/openmetrics-text" to comply with Prometheus/OpenMetrics
requirements. Additionally, add a 503 Service Unavailable response with an
appropriate description to match other health endpoints for consistency.

},
"components": {
Expand Down Expand Up @@ -715,7 +737,7 @@
"$ref": "#/components/schemas/ServiceConfiguration"
},
"llama_stack": {
"$ref": "#/components/schemas/LLamaStackConfiguration"
"$ref": "#/components/schemas/LlamaStackConfiguration"
},
"user_data_collection": {
"$ref": "#/components/schemas/UserDataCollection"
Expand Down Expand Up @@ -1071,7 +1093,26 @@
}
]
},
"LLamaStackConfiguration": {
"LivenessResponse": {
"properties": {
"alive": {
"type": "boolean",
"title": "Alive"
}
},
"type": "object",
"required": [
"alive"
],
"title": "LivenessResponse",
"description": "Model representing a response to a liveness request.\n\nAttributes:\n alive: If app is alive.\n\nExample:\n ```python\n liveness_response = LivenessResponse(alive=True)\n ```",
"examples": [
{
"alive": true
}
]
},
"LlamaStackConfiguration": {
"properties": {
"url": {
"anyOf": [
Expand Down Expand Up @@ -1119,28 +1160,9 @@
}
},
"type": "object",
"title": "LLamaStackConfiguration",
"title": "LlamaStackConfiguration",
"description": "Llama stack configuration."
},
"LivenessResponse": {
"properties": {
"alive": {
"type": "boolean",
"title": "Alive"
}
},
"type": "object",
"required": [
"alive"
],
"title": "LivenessResponse",
"description": "Model representing a response to a liveness request.\n\nAttributes:\n alive: If app is alive.\n\nExample:\n ```python\n liveness_response = LivenessResponse(alive=True)\n ```",
"examples": [
{
"alive": true
}
]
},
"ModelContextProtocolServer": {
"properties": {
"name": {
Expand Down