I have an experimental host running a Docker containerised app. cAdvisor and Prometheus containers are also running.
The app spawns containers to run jobs pertaining to one of a set of namespaces (could be thousands of namespaces) and names the container with a uuid. cAdvisor picks these up OK and I can see metric usage in prometheus OK per container. These containers run from a few seconds to about an hour.
I need to be able to correlate the namespace ID (from an API call in the container) with the metrics in prometheus as the container name is unique to the run and I need it by the namespace ID.
This doc says not to use lots of different labels as it generates lots of separate time series, but adding a kv seems the most convenient way.
This doc says to use the pushgateway for service-level batch jobs and as my containers are namespace-related rather than whole-service related, it seems incorrect to use this.
I might have 5-10 containers a day which run under different container names which correspond to the same namespace in the app, and I need a time series across all 5-10.
What is the best way to do this correlation?
How can I send a bit of arbitrary data from inside a container to prometheus?