Menu

MetricShell: How We Tried to Solve the Metrics Problem for Short-Lived Containers
πŸ“°

MetricShell: How We Tried to Solve the Metrics Problem for Short-Lived Containers

DEV Community: kubernetesΒ·Denis FomenkovΒ·7 days ago
#K7Q0FVxz
#devtokubernetes#devto#dev#metrics#application
Reading 0:00
15s threshold

The problem

I've heard this question come up many times over the years, and I've been involved in quite a few discussions about it myself: how do you collect metrics from an application running in a container if the application doesn't expose an HTTP /metrics endpoint?

Maybe it was never designed to do that. Or maybe adding an HTTP server just for monitoring feels like unnecessary overhead.

The question becomes particularly interesting when the application runs a short-lived task: a CLI command, a cron job, or a batch job.

One example I dealt with involved CLI commands in a PHP 7.4 monolith that we were gradually moving into a containerized environment.

The application already existed, did its job, and had years of development behind it. We needed both business metrics, such as counters and histograms, and technical metrics, such as database query execution times.

On physical or virtual servers, this was relatively straightforward.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.