Skip to content

feat(llm-api-gateway): expose GET /info endpoint - #710

Open
priyaselvaganesan wants to merge 1 commit into
mainfrom
feat/version-endpoint-llm-api-gateway
Open

feat(llm-api-gateway): expose GET /info endpoint#710
priyaselvaganesan wants to merge 1 commit into
mainfrom
feat/version-endpoint-llm-api-gateway

Conversation

@priyaselvaganesan

@priyaselvaganesan priyaselvaganesan commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Why

DGXC Ops and QA need a reliable way to identify the exact build of each deployed NVCF service. This adds a GET /info endpoint to llm-api-gateway returning service name, semver, and commit SHA stamped at build time.

What changed

  • Registers GET /info on the echo router via echo.WrapHandler(golibversion.Handler()), so it runs through echo's existing middleware stack.
  • x_defs stamp Service (nvcf-llm-api-gateway), Version ({STABLE_VERSION}), and GitHash ({STABLE_GIT_COMMIT_FULL}) into the go-lib version package at link time, on the cmd/llm-api-gateway go_binary.
  • Bumps go-lib from v0.0.0-20260513170923-714a7c905aa0 to v0.0.0-20260728185909-afca4ec2fb26 to pick up pkg/version with Handler(). Go MVS pulls otel and related transitive deps forward.
  • Tests cover GET returning 200 JSON with the three fields and non-GET returning 405 with Allow: GET.

Additional Details

/info returns:

{"service":"nvcf-llm-api-gateway","version":"<semver>","commit":"<full-40-char-sha>"}

service, version, and commit are injected via Bazel x_defs at build time. Unknown fallbacks apply for unstamped builds.

Customer Release Notes

Not customer visible.

Plan Summary

Not applicable.

Usage

Not applicable.

Testing

Built a stamped image from the repo root with bazel build //src/invocation-plane-services/llm-api-gateway/cmd/llm-api-gateway:image.tar --stamp and verified the binary embeds the expected service name, version, and full commit SHA. Unit tests pass with go test ./....

Notes

This is one of several Phase 1 Go service /info PRs. Pattern follows merged go-lib handler (#270), helm-reval (#275), and grpc-proxy (#610). Each service PR is independent.

References

POR: https://docs.google.com/document/d/1XigTpFIMVfkR-RgwdF7urquq8YxGYDEVamsrJNJwC-U

Issues

Relates to #315

Related Pull Requests

Dependencies

Bumps go-lib from v0.0.0-20260513170923-714a7c905aa0 to v0.0.0-20260728185909-afca4ec2fb26 (Apache-2.0). Go MVS pulls otel 1.43->1.44 and related golang.org/x deps forward as go-lib requires.

Summary by CodeRabbit

  • New Features

    • Added an /info endpoint to report the API gateway’s service version and Git commit information.
    • The endpoint accepts GET requests and returns structured JSON details.
    • Unsupported HTTP methods now receive a clear 405 response indicating that only GET is allowed.
  • Tests

    • Added coverage for successful responses, JSON content, headers, and unsupported methods.

Signed-off-by: priyaselvaganesan <pselvaganesa@nvidia.com>
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The gateway adds a version-backed /info endpoint, embeds service and Git metadata at build time, adds endpoint tests, updates Bazel targets, and upgrades Go module dependencies.

Changes

Gateway info endpoint

Layer / File(s) Summary
Version metadata and build wiring
src/invocation-plane-services/llm-api-gateway/api/BUILD.bazel, src/invocation-plane-services/llm-api-gateway/cmd/llm-api-gateway/BUILD.bazel, src/invocation-plane-services/llm-api-gateway/go.mod
The API links the shared version package. The binary embeds the service name, stable version, and full Git commit hash. Go dependencies are updated.
Info route registration
src/invocation-plane-services/llm-api-gateway/api/routes.go
The API registers /info with the shared version handler for all HTTP methods.
Info endpoint validation
src/invocation-plane-services/llm-api-gateway/api/info_test.go, src/invocation-plane-services/llm-api-gateway/api/BUILD.bazel
Tests validate GET responses, JSON fields, content type, and HTTP 405 responses for non-GET methods. Bazel includes the new test source.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • NVIDIA/nvcf#591: Adds a similar version-backed /info endpoint with build metadata and tests.
  • NVIDIA/nvcf#610: Adds and tests a similar /info endpoint in another service.

Suggested reviewers: famousdirector

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title uses the required Conventional Commits format and accurately describes the new customer-facing GET /info feature.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/version-endpoint-llm-api-gateway

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/invocation-plane-services/llm-api-gateway/go.mod`:
- Around line 24-33: Update the stable OpenTelemetry exporter dependencies in
go.mod from v1.42.0 to v1.44.0, including the OTLP metric, OTLP trace HTTP/gRPC,
stdout trace, and indirect otlptrace modules. Then run go mod tidy to
synchronize go.mod and go.sum.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: e8a760dd-5b51-4f2e-b40f-ebb66e6c9d49

📥 Commits

Reviewing files that changed from the base of the PR and between 6bb0cde and d11e60f.

⛔ Files ignored due to path filters (1)
  • src/invocation-plane-services/llm-api-gateway/go.sum is excluded by !**/*.sum
📒 Files selected for processing (5)
  • src/invocation-plane-services/llm-api-gateway/api/BUILD.bazel
  • src/invocation-plane-services/llm-api-gateway/api/info_test.go
  • src/invocation-plane-services/llm-api-gateway/api/routes.go
  • src/invocation-plane-services/llm-api-gateway/cmd/llm-api-gateway/BUILD.bazel
  • src/invocation-plane-services/llm-api-gateway/go.mod

Comment on lines +24 to +33
go.opentelemetry.io/otel v1.44.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.42.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.42.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.42.0
go.opentelemetry.io/otel/exporters/prometheus v0.64.0
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.42.0
go.opentelemetry.io/otel/metric v1.42.0
go.opentelemetry.io/otel/sdk v1.42.0
go.opentelemetry.io/otel/sdk/metric v1.42.0
go.opentelemetry.io/otel/trace v1.42.0
go.opentelemetry.io/otel/metric v1.44.0
go.opentelemetry.io/otel/sdk v1.44.0
go.opentelemetry.io/otel/sdk/metric v1.44.0
go.opentelemetry.io/otel/trace v1.44.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

According to official OpenTelemetry Go documentation for v1.44.0, are OTLP exporter modules at v1.42.0 supported with go.opentelemetry.io/otel, metric, sdk, and trace modules at v1.44.0?

💡 Result:

The OpenTelemetry Go project does not explicitly define or document support for mixing different versions of its modules within the same application [1][2]. According to its versioning policy, OpenTelemetry-Go follows Go's idiomatic module versioning [1], which generally assumes that dependencies should be kept synchronized across related modules to ensure expected behavior and compatibility [3]. In practice, the OpenTelemetry-Go repository releases its core stable modules (such as go.opentelemetry.io/otel, go.opentelemetry.io/otel/sdk, and the various OTLP exporters) as a set with matching version numbers [3][4][5]. While the Go module system allows for version mismatches in some cases if APIs remain compatible, OpenTelemetry's own release notes and repository structure strongly imply that stable modules are intended to be used at the same version [3][4]. Mixing a v1.42.0 exporter with v1.44.0 core modules is not officially supported or recommended, as newer features—such as those introduced in v1.44.0—may rely on APIs or behaviors not present or fully matched in the older v1.42.0 exporter code [6]. To ensure stability and access to the latest features and fixes, it is recommended that you update your OTLP exporter modules to match the version of your core OpenTelemetry modules (v1.44.0) [3].

Citations:


🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- guidance files ---'
find .. -name AGENTS.md -print
printf '%s\n' '--- module files ---'
cat -n src/invocation-plane-services/llm-api-gateway/go.mod
printf '%s\n' '--- relevant checksums ---'
rg -n 'go\.opentelemetry\.io/(otel|otel/exporters/otlp)' src/invocation-plane-services/llm-api-gateway/go.sum 2>/dev/null || true
printf '%s\n' '--- repository state ---'
git status --short
printf '%s\n' '--- available Go tooling ---'
go version 2>&1 || true

Repository: NVIDIA/nvcf

Length of output: 14040


🏁 Script executed:

#!/bin/bash
set -u
printf '%s\n' '--- repository guidance ---'
cat -n AGENTS.md 2>/dev/null || true
printf '%s\n' '--- llm-api-gateway guidance ---'
cat -n src/invocation-plane-services/llm-api-gateway/AGENTS.md 2>/dev/null || true
printf '%s\n' '--- tidy diff (offline, non-mutating) ---'
cd src/invocation-plane-services/llm-api-gateway
GOTOOLCHAIN=local GOPROXY=off go mod tidy -diff 2>&1
tidy_status=$?
printf 'tidy_status=%s\n' "$tidy_status"
printf '%s\n' '--- cached OpenTelemetry module requirements ---'
for f in \
  "$OLDPWD/../../go/pkg/mod/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc@v1.42.0/go.mod" \
  "$OLDPWD/../../go/pkg/mod/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc@v1.42.0/go.mod" \
  "$OLDPWD/../../go/pkg/mod/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp@v1.42.0/go.mod" \
  "$OLDPWD/../../go/pkg/mod/go.opentelemetry.io/otel/exporters/stdout/stdouttrace@v1.42.0/go.mod"; do
  if [ -f "$f" ]; then
    printf '\n--- %s ---\n' "$f"
    sed -n '1,80p' "$f"
  else
    printf 'missing: %s\n' "$f"
  fi
done
exit 0

Repository: NVIDIA/nvcf

Length of output: 28045


🏁 Script executed:

#!/bin/bash
set -u
printf '%s\n' '--- repository guidance ---'
cat -n AGENTS.md 2>/dev/null || true
printf '%s\n' '--- llm-api-gateway guidance ---'
cat -n src/invocation-plane-services/llm-api-gateway/AGENTS.md 2>/dev/null || true
printf '%s\n' '--- tidy diff (offline, non-mutating) ---'
cd src/invocation-plane-services/llm-api-gateway
GOTOOLCHAIN=local GOPROXY=off go mod tidy -diff 2>&1
tidy_status=$?
printf 'tidy_status=%s\n' "$tidy_status"
printf '%s\n' '--- cached OpenTelemetry module requirements ---'
modcache="$(go env GOPATH)/pkg/mod"
for f in \
  "$modcache/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc@v1.42.0/go.mod" \
  "$modcache/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc@v1.42.0/go.mod" \
  "$modcache/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp@v1.42.0/go.mod" \
  "$modcache/go.opentelemetry.io/otel/exporters/stdout/stdouttrace@v1.42.0/go.mod"; do
  if [ -f "$f" ]; then
    printf '\n--- %s ---\n' "$f"
    sed -n '1,80p' "$f"
  else
    printf 'missing: %s\n' "$f"
  fi
done
exit 0

Repository: NVIDIA/nvcf

Length of output: 33914


🌐 Web query:

site:github.com/open-telemetry/opentelemetry-go VERSIONING.md module versions independently versioned stable v1.44.0 exporters

💡 Result:

In the OpenTelemetry Go project, modules are versioned based on their stability status as defined in the project's VERSIONING.md [1][2]. While stable modules—which guarantee a stable public API and telemetry—are often released as part of a coordinated set (such as the v1.44.0 release) [3][4][5], the project architecture supports independent versioning for experimental modules [6][2]. Key points regarding the versioning policy: * Stable vs. Experimental Stability: Experimental modules are versioned starting at v0.0.0, allowing for breaking changes [1][2]. Mature modules that provide stable guarantees are versioned with a major version greater than v0 [2]. * Coordinated Releases: To maintain usability, stable modules within the same major version series typically use the same entire version number (e.g., v1.44.0) during project-wide releases [4][2]. For instance, the v1.44.0 release included coordinated versions for multiple modules, such as v1.44.0, v0.66.0, and v0.20.0 [3][7]. * Module Encapsulation: Modules are used to encapsulate distinct components like instrumentation, detectors, and exporters [1][2]. This structure allows the project to evolve different parts of the library at different rates while maintaining stability for production-grade components [1][6]. * Recent Practice: While releases are often published as a group to ensure compatibility, recent discussions and practices have moved toward more explicit module-specific release notes to improve clarity, even when published under a coordinated repository-level version [4]. In summary, while stable exporters are generally kept in alignment with the core stable release (such as v1.44.0) to simplify dependency management and ensure compatibility, the underlying versioning policy explicitly permits and facilitates independent versioning for experimental components [1][4][6].

Citations:


🌐 Web query:

site:opentelemetry.io/docs/languages/go versioning modules exporter core same version

💡 Result:

In modular software architecture, including projects like OpenTelemetry, modules and core components do not strictly require the same version number. Versioning strategies are typically determined by the release lifecycle, dependency compatibility, and stability guarantees of the specific components rather than a forced lock-step with a core package [1]. For example, within the OpenTelemetry Go ecosystem, while the core API and SDK components are often released and tracked together, individual exporters and instrumentation libraries may follow their own release cycles or versioning schemes depending on their stability status (e.g., stable, beta) and maintenance cadence [2][1]. Best practices for versioning modules in such systems include: 1. Independent Versioning: If modules are functionally decoupled from the core, they can be versioned independently to allow for faster updates or bug fixes without requiring a full system-wide version bump. 2. Semantic Versioning (SemVer): Use SemVer to signal the nature of changes (major, minor, patch). This allows users to understand the impact of upgrading a specific module without needing the core version to match [1]. 3. Compatibility Guarantees: If you choose to use independent versioning, maintain clear documentation regarding compatibility between module versions and core versions. 4. Lock-step Versioning: Only adopt this if the modules are tightly coupled, have shared internal dependencies that break frequently, or if your deployment strategy specifically requires uniform versions across the entire stack to simplify configuration and testing. In summary, matching versions is often unnecessary and can be counterproductive if it forces unnecessary releases. Prioritize independent, semantic versioning to provide flexibility and clarity to your users [1].

Citations:


🏁 Script executed:

#!/bin/bash
set -u
modcache="$(go env GOPATH)/pkg/mod"
printf '%s\n' '--- OpenTelemetry versioning policy ---'
for f in \
  "$modcache/go.opentelemetry.io/otel@v1.44.0/VERSIONING.md" \
  "$modcache/go.opentelemetry.io/otel@v1.44.0/README.md"; do
  if [ -f "$f" ]; then
    printf '\n--- %s ---\n' "$f"
    rg -n -i -C 3 'version|module|compatib|release|stable|export' "$f" | head -240
  else
    printf 'missing: %s\n' "$f"
  fi
done
printf '%s\n' '--- cached v1.44.0 core module metadata ---'
for f in \
  "$modcache/go.opentelemetry.io/otel@v1.44.0/go.mod" \
  "$modcache/go.opentelemetry.io/otel/metric@v1.44.0/go.mod" \
  "$modcache/go.opentelemetry.io/otel/sdk@v1.44.0/go.mod" \
  "$modcache/go.opentelemetry.io/otel/sdk/metric@v1.44.0/go.mod" \
  "$modcache/go.opentelemetry.io/otel/trace@v1.44.0/go.mod"; do
  if [ -f "$f" ]; then
    printf '\n--- %s ---\n' "$f"
    sed -n '1,70p' "$f"
  else
    printf 'missing: %s\n' "$f"
  fi
done
printf '%s\n' '--- module graph (offline) ---'
cd src/invocation-plane-services/llm-api-gateway
GOTOOLCHAIN=local GOPROXY=off go mod graph 2>&1 | rg 'go\.opentelemetry\.io/(otel|proto)' | head -160
printf 'graph_status=%s\n' "${PIPESTATUS[0]}"

Repository: NVIDIA/nvcf

Length of output: 19027


Align the stable OpenTelemetry modules to v1.44.0.

OpenTelemetry Go requires stable modules to use the same full version. Update the v1.42.0 OTLP and stdout exporters, including the indirect otlptrace module, to v1.44.0 and run go mod tidy.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/invocation-plane-services/llm-api-gateway/go.mod` around lines 24 - 33,
Update the stable OpenTelemetry exporter dependencies in go.mod from v1.42.0 to
v1.44.0, including the OTLP metric, OTLP trace HTTP/gRPC, stdout trace, and
indirect otlptrace modules. Then run go mod tidy to synchronize go.mod and
go.sum.

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