Skip to content

A simple program to watch pods in a Kubernetes cluster and report their lifetime to OpenMeter.

License

Notifications You must be signed in to change notification settings

openmeterio/openmeter-pod-runtime-watcher

 
 

Repository files navigation

OpenMeter Pod Runtime Watcher

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.

Getting started

Prerequisites

  1. You have a Kubernetes cluster running
  2. You have a running OpenMeter instance (cloud or self-hosted)
  3. You have an API key from OpenMeter

Helm (recommended)

See the helm chart README.

Local (testing only)

When running locally, this assumes you have a Kubernetes context already configured.

  1. 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)
  2. Run the binary

    ./openmeter-pod-runtime-watcher

About

A simple program to watch pods in a Kubernetes cluster and report their lifetime to OpenMeter.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 70.6%
  • Dockerfile 16.2%
  • Smarty 13.2%