Skip to content

fix(docker-image): include metrics-mcp module in the runtime image - #1840

Merged
jfallows merged 1 commit into
developfrom
fix/docker-image-metrics-mcp
Jun 6, 2026
Merged

jfallows merged 1 commit into
developfrom
fix/docker-image-metrics-mcp

Conversation

@jfallows

@jfallows jfallows commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Problem

PR #1837 added MCP metrics (mcp.* counters + histograms) and wired metrics-mcp as a cloud/docker-image maven dependency, but did not add it to the zpm image manifest (zpm.json.template). The Dockerfile builds the runtime via zpmw install from that manifest, so the packaged image's jlink module set never included io.aklivity.zilla.runtime.metrics.mcp.

Effect: in a deployed Zilla, any telemetry.metrics entry like mcp.tools.call fails schema validation —

ConfigException: [/telemetry/metrics/...] The value must be one of
["grpc.request.size", ..., "http.duration", ..., "stream.closes.sent"].

— because the mcp metrics group (and its schema patch) isn't on the engine classpath. So MCP metrics couldn't actually be used despite #1837.

Fix

Add io.aklivity.zilla:metrics-mcp to zpm.json.template (alongside metrics-stream/http/grpc). The Dockerfile regenerates zpm.json from the template, so this is the single source of truth.

Verification

Rebuilt develop-SNAPSHOT:

  • java --list-modules now includes io.aklivity.zilla.runtime.metrics.mcp
  • a config with telemetry.metrics: [mcp.*] on an mcp server binding validates and emits, e.g. mcp_tools_call_total{method="tools.call",outcome="ok",tool="..."} via the prometheus exporter.

Follow-up to #1837.

🤖 Generated with Claude Code

PR #1837 added the MCP metrics group as a docker-image maven dependency but
omitted it from the zpm image manifest, so the packaged runtime image's jlink
module set did not include io.aklivity.zilla.runtime.metrics.mcp. As a result
mcp.* metric names failed engine schema validation ("must be one of
[grpc/http/stream...]") and MCP metrics could not be enabled in a deployed Zilla.

Add io.aklivity.zilla:metrics-mcp to zpm.json.template (the Dockerfile
regenerates zpm.json from it) so the image links the metrics.mcp module.
Verified: the rebuilt image's `java --list-modules` now includes
io.aklivity.zilla.runtime.metrics.mcp and an mcp.* metrics config validates.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

@jfallows jfallows left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

LGTM

@jfallows
jfallows merged commit 7fde2a0 into develop Jun 6, 2026
4 of 5 checks passed
@jfallows
jfallows deleted the fix/docker-image-metrics-mcp branch July 1, 2026 23:04
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