Interview Prep/Monitoring & Observability/Prometheus and PromQL at Scale

A legacy app has no `/metrics` endpoint and cannot be changed. How do you get metrics out of it?

IntermediateScenarioPrometheus and PromQL at Scale
Answer

Situation read → Without code access you must observe the app from outside or translate its existing outputs.

What I'd do →

  1. If it writes logs with useful lines, use mtail or grok_exporter to derive counters and histograms from the log stream.
  2. If it emits StatsD or JMX, use statsd_exporter or the JMX exporter as a Java agent.
  3. If it has a management API or DB, write a small exporter or use the matching community exporter.
  4. Otherwise monitor from outside with blackbox probes and process metrics from node_exporter or process-exporter.
  5. Document the gap and plan native instrumentation.

Why → Translating existing signals is faster than modifying legacy code and gives metrics right away.

Interview tip → Prefer the lowest-effort source of truth, and record the tech debt.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Prometheus and PromQL at Scale