0

I want to create a Kubernetes Job object like the example: https://kubernetes.io/docs/concepts/workloads/controllers/job/

Now imagine I want to have the result (in this case the value of Pi: 3.14159...) available in Prometheus.

Is this possible?

In a more complex example, imagine the output of my pod was JSON:

{
  "foo": 200,
  "bar": 10,
  "baz": 999
}

I somehow need to denote that I'm interested in foo and baz "being available" in Prom (note I'm not opinionated on whether the solution is push or pull.

Option 1

The first option I've thought of is somehow attaching the result 3.14159 to the job and Prom can scrape it as normal.

Option 2

Don't run the Pi-generator container at all, instead run something like a Python script that runs the Pi process. Then we can push from Python to Prom.

Option 3

Some other way?

John Smith
  • 31
  • 1
  • 5
  • While Stack Overflow does permit certain questions about Kubernetes, we require that they (like all questions asked here) be specifically related to programming. This question does not appear to be specifically related to programming, but metrics collection via prometheus, which makes it off-topic here. You might be able to ask questions like this one on [sf] or [DevOps](https://devops.stackexchange.com/). – Turing85 Aug 08 '22 at 22:05
  • 1
    Closed in favour of this post at DevOps: https://devops.stackexchange.com/questions/16408/kubernetes-job-metrics-in-prometheus – John Smith Aug 08 '22 at 23:18

0 Answers0