A simple program to watch pods in a Kubernetes cluster and report their lifetime to OpenMeter.
This application is meant to be run using Helm, but you can test it directly on your machine using the binary build.
- You have a Kubernetes cluster running
- You have a running OpenMeter instance (cloud or self-hosted)
- You have an API key from OpenMeter
When running locally, this assumes you have a Kubernetes context already configured.
-
Set your environment variables
export OPENMETER_TOKEN=om_1234567890abcdef export OPENMETER_URL=https://openmeter.cloud # this is the default and you only need to set when self-hosting export NAMESPACE=default # this is the default, change to the namespace you want to watch export MONITOR_RATE_SECONDS=5 # this is the default, change to the rate you want to monitor pods (i.e. how often should we check for alive pods)
-
Run the binary
./openmeter-pod-runtime-watcher