Scrivio Interview library
ScenarioIntermediate7 min read · updated 12 November 2026

During an incident you need to know which version is running on each of 40 pods. How would you make this quick and reliable?

I would put the version in every signal we already look at during an incident, so nobody has to ask 40 pods one by one. Each service exposes build and git info in /actuator/info, adds the version as a common tag on all metrics and as a field in every structured log line, and its pods carry the version and image digest as Kubernetes labels. Then one dashboard grouped by version shows how many pods run each build and whether errors come from the new one during a rollout.

Why this question is asked

During an incident, minutes matter, and one of the first questions is always what changed. If the answer requires someone to exec into pods or curl 40 endpoints by hand, the team loses time and often gets it wrong, especially in the middle of a rollout when two versions run side by side. Interviewers ask this scenario to see whether we think about operability before the incident, and whether we know which tools can carry the version. In this answer, we will set up the version at its source, attach it to metrics and logs, label the pods, and build the views that answer the question in seconds.

1The Situation and What We Need

Picture a payment service with 40 pods. A deploy started twenty minutes ago, the error rate has doubled, and the deployment might be half done, paused, or rolled back by someone else. We need to know three things quickly: which versions are running, on how many pods each, and whether the errors correlate with one of them.

The reliable answer cannot depend on reading one pod at a time. It should come from systems that already aggregate across pods: the metrics backend, the log platform and the Kubernetes API. So the plan is to make sure the version is attached at the source, the build, and carried into each of those systems.

2The Version at the Source

The build should stamp the version and commit into the artifact. In Spring Boot, the spring-boot-maven-plugin build-info goal (or springBoot { buildInfo() } in Gradle) writes META-INF/build-info.properties, and a git commit id plugin writes git.properties. Boot's info contributors then show both in /actuator/info, and Boot creates BuildProperties and GitProperties beans our code can inject.

Java
GET /actuator/info
{
"build": { "version": "2.31.0", "time": "2026-11-05T08:40:02Z" },
"git": { "branch": "main", "commit": { "id": "9c41e07" } }
}

This is the ground truth for a single pod, and it is useful for a spot check or a deployment tool that verifies each pod after rollout. But it is still one pod per request, which is why the next steps matter more during an incident.

3Version as a Common Tag on Metrics

If every metric a service publishes carries a version tag, every dashboard can be split by version without any extra work. Spring Boot lets us add common tags to all meters, and we can take the value from BuildProperties so it can never drift from the build.

Java
@Bean
MeterRegistryCustomizer<MeterRegistry> versionTag(ObjectProvider<BuildProperties> build) {
String version = build.getIfAvailable() != null ? build.getIfAvailable().getVersion() : "unknown";
return registry -> registry.config().commonTags("version", version);
}
# PromQL: pods per version, and error rate per version
count by (version) (count by (version, pod) (process_uptime_seconds{job="payments"}))
# {version="2.30.4"} 28
# {version="2.31.0"} 12
sum by (version) (rate(http_server_requests_seconds_count{job="payments", outcome="SERVER_ERROR"}[5m]))
# {version="2.30.4"} 0.2
# {version="2.31.0"} 6.8

Notice what the two queries tell us in one glance: 12 pods run the new version, and almost all server errors come from them. That is enough to pause or roll back the deploy with confidence.

A version tag is safe for cardinality because it has very few values at a time, usually one or two during a rollout. Spring Boot also supports common tags through properties (management.metrics.tags.version in Boot 3; check your version for the exact property in newer releases), but taking the value from BuildProperties in code avoids a second place where the version must be set.

4Version as a Field in Structured Logs

Logs are where we look next, so every log line should carry the version too. With structured JSON logging, available out of the box since Spring Boot 3.4, the ECS format has a service.version field. We can set it, along with the service name and environment, once in configuration.

Properties
logging.structured.format.console=ecs
logging.structured.ecs.service.name=payments
logging.structured.ecs.service.version=@project.version@ # filled in by Maven resource filtering
logging.structured.ecs.service.environment=production
# One log line (shortened):
# {"@timestamp":"2026-11-05T09:03:11.402Z","log.level":"ERROR",
# "service.name":"payments","service.version":"2.31.0",
# "message":"Card network timeout","trace.id":"5f2c..."}

Now a log search for errors grouped by service.version gives the same answer as the metrics, and links each error to a trace. The @project.version@ placeholder works when Maven resource filtering is on, as it is with the Boot parent; in Gradle we would expand it in processResources. Check your Boot version for the exact ecs property names.

5Labels on the Pods

Finally, Kubernetes itself should know the version. The deployment template sets the recommended label app.kubernetes.io/version, and the image tag should be immutable, a version or commit, never latest. Because tags can still be moved, the image digest, the content hash Kubernetes records once the image is pulled, is the strongest answer to exactly what code is running.

YAML
# Deployment template (Helm)
metadata:
labels:
app.kubernetes.io/name: payments
app.kubernetes.io/version: "2.31.0"
spec:
containers:
- image: registry.acme.io/payments:2.31.0
# Pods per version straight from the cluster
kubectl get pods -l app.kubernetes.io/name=payments -L app.kubernetes.io/version
# NAME READY STATUS VERSION
# payments-7d9f-a 1/1 Running 2.31.0
# payments-5c2b-k 1/1 Running 2.30.4
kubectl get pods -l app.kubernetes.io/name=payments \
-o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.status.containerStatuses[0].imageID}{"\n"}{end}'
# payments-7d9f-a registry.acme.io/payments@sha256:4be1...
Step throughWhere the version is carried
  1. Buildbuild-info.properties and git.properties in the jar
  2. Imageimmutable tag 2.31.0 and a content digest
  3. Pod labelsapp.kubernetes.io/version, visible to kubectl and Prometheus
  4. Metricscommon tag version on every meter
  5. Logsservice.version on every line
  6. Dashboarderrors, latency and pod count grouped by version

6 layers, from the top down. Step through them one at a time.

Prometheus can attach these pod labels to scraped metrics through its Kubernetes service discovery, which gives a second, independent source for the version tag.

6Putting It on One Dashboard

The last step turns this into a habit. The standard service dashboard gets a panel for pods per version and splits error rate and latency by version. During a rollout, two lines appear side by side and a regression shows itself without anybody asking. Because the platform starter adds the version tag and the Helm chart adds the labels, every service gets this for free. In an incident, the question 'which version runs where' takes one look instead of 40 requests.

7Follow-up questions

Why not just curl /actuator/info on every pod with a script?

It works as a last resort, but it is slow, needs network access to every pod, and gives no history. It cannot tell us what ran at 09:00 when the errors started. Metrics and logs carry the version over time, which is what an incident needs.

Is a version tag a cardinality problem?

No, as long as it holds released versions. At any moment there are usually one or two values per service, and old values disappear as old pods stop. It would become a problem if it held something unique per build in a system that deploys hundreds of times a day without restarting series, which is rare.

How does this help with canary releases?

A canary is a small number of pods on the new version. With version on every metric, comparing the canary's error rate and latency with the stable version is a single query, and automated canary analysis tools can use the same tag to decide whether to continue the rollout.

8Conclusion

In this answer, we made the running version visible everywhere we look during an incident. Build and git info show it per pod in /actuator/info, a common version tag on all metrics lets dashboards count pods and errors per version, a service.version field in structured logs does the same for log searches, and Kubernetes labels and image digests answer it from the cluster. With this in place, a rollout regression is visible in one dashboard panel instead of 40 manual checks.

What to say in the interviewAbout 80 seconds aloud

Open with

I would make the version part of every signal we already use, instead of asking pods one by one. At the source, the build writes build-info.properties and git.properties, so each pod shows its version and commit in /actuator/info, and Boot gives me a BuildProperties bean.

Then, if they want more

From that bean I add the version as a common tag on all metrics with a MeterRegistryCustomizer. That is safe for cardinality because there are only one or two versions at a time.

Then a query counting pods by version and another for error rate by version show immediately, for example, that 12 pods run the new build and nearly all errors come from them. In logs I use structured JSON, ECS since Boot 3.4, with service.version on every line, so log searches can group errors by version and link to traces.

In Kubernetes, pods carry the app.kubernetes.io/version label, images use immutable tags, and the image digest is the final proof of what runs. Finally, the standard service dashboard has a pods-per-version panel and splits errors and latency by version, provided through the platform starter and Helm chart, so during an incident the answer takes one look.

About this answer

Last updated
12 November 2026
Versions it names
Spring Boot 3.4
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
Spring Boot reference, Actuator
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "During an incident you need to know which version is running on each of 40 pods. How...": https://scrivio-interview-library.netlify.app/spring-boot/actuator/f592092ae7/