Skip to content

Conversation

@tisnik
Copy link
Contributor

@tisnik tisnik commented Jul 23, 2025

Description

LCORE-380: regenerated schema

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up service version
  • Bump-up dependent library
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change
  • Unit tests improvement
  • Integration tests improvement
  • End to end tests improvement

Related Tickets & Documents

  • Related Issue #LCORE-380

Summary by CodeRabbit

  • New Features

    • Added a new /metrics endpoint for retrieving metrics in plain text format.
  • Documentation

    • Updated and reorganized API documentation for improved clarity.
    • Corrected a schema title typo in the API specification.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 23, 2025

Walkthrough

The OpenAPI specification was updated to add a new /metrics GET endpoint, reorganize schema definitions by moving LivenessResponse above LlamaStackConfiguration, and correct the schema title and references from "LLamaStackConfiguration" to "LlamaStackConfiguration".

Changes

File Change Summary
docs/openapi.json Added /metrics GET endpoint; moved LivenessResponse schema; corrected schema title and references.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant API

    Client->>API: GET /metrics
    API-->>Client: 200 OK (plain text metrics)
Loading

Estimated code review effort

1 (~2 minutes)

Possibly related PRs

  • LCORE-304: Updated config diagram #263: Corrects the schema/class name from "LLamaStackConfiguration" to "LlamaStackConfiguration" in documentation and diagrams, similar to the schema correction in this PR.

Poem

In the meadow of code, a new path appears,
/metrics now sings for all engineers.
A schema’s name, once tangled, set right,
Liveness hops higher, now first in sight.
With specs aligned and endpoints anew,
This rabbit’s delighted—so should be you! 🐇


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3e7e289 and fc90c5b.

📒 Files selected for processing (1)
  • docs/openapi.json (4 hunks)
🔇 Additional comments (3)
docs/openapi.json (3)

1096-1114: Schema insertion looks correct

LivenessResponse is now defined before it’s referenced, its title/description are consistent with the other health probes, and no required/optional fields changed.
No issues spotted.


1163-1164: Title typo fixed

LlamaStackConfiguration title casing is now consistent with the filename and $refs.


740-741: All $ref references correctly updated

I ran a search for the old #/components/schemas/LLamaStackConfiguration string in docs/openapi.json and found no matches. The schema reference now uses the correct casing throughout. Approving these changes.

Comment on lines +596 to 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"
}
}
}
}
}
}
}
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.

@tisnik tisnik merged commit e1c09c3 into lightspeed-core:main Jul 23, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant