Skip to main content

opium

https://img.shields.io/pypi/v/opium.svg https://img.shields.io/travis/panagiks/opium.svg Documentation Status

OpenShift Pod Independent Usage Metrics (OPIUM) pulling & aggregating metrics from multiple pods made easy!

Aggregating metrics from pods through OKD’s router can be a challenge. OPIUM offers the next best thing. While it doesn’t (yet) aggregate the varius metrics it gathers the metrics from the defined Deployment Configs on a specific OKD project and serves them to a single /metrics endpoint. This way it allows for easier gathering of per-pod metrics.

Configuration

OPIUM is configured through environment variables and specifically the following:

  • OPIUM_OKD_URL => The url of the OKD instance’s master, including the scheme and without a trailing /

  • OPIUM_OKD_TOKEN => An access token for a service account with view and edit permissions on the desired project

  • OPIUM_PROJECT => Project to be exported

  • OPIUM_DEPLOYMENT_CONFIGS => Comma separated (no spaces) list of Deployment Configs to export

OKD Preparation

In your OKD admin CLI you will need to run the following

# create a service account
oc create serviceaccount <account>
# Retrieve the service account's access token (set this to OPIUM_OKD_TOKEN)
oc serviceaccounts get-token <account>
# Give the service account the required permissions to the desired project
oc policy add-role-to-user view system:serviceaccount:<project>:<account>
oc policy add-role-to-user edit system:serviceaccount:<project>:<account>

Execution

To start OPIUM (after you’ve set the configuration environment variables appropriately) simly run:

opium

This will spawn an HTTP server listening on your system’s public interface and on port 8080.

Configuration for the listening interface, as well as a containerized version of OPIUM will follow in later versions.

Features

  • Gather the response of /metrics from all the pods of the specified deployment_config

  • Serve them as one response

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.1.0 (2020-10-25)

  • First release on PyPI.

Metadata

Release files for opium 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for opium 0.1.1
File Size Uploaded
opium-0.1.1.tar.gz 12.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for opium 0.1.1
File Interpreter ABI Platform
opium-0.1.1-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 18.5 kB

Release files / opium-0.1.1.tar.gz

Download URL opium-0.1.1.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0fed721cc927a0fd7bd5492b2962bcebb6252b34312fa03a322fcc85428b09d6
BLAKE2b-256 checksum
How to use checksums
8c674cc65cfbfb772f1581ceb777e301f6b8ad09c950863d77545d3bc65d0033
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.0

Release files / opium-0.1.1-py2.py3-none-any.whl

Download URL opium-0.1.1-py2.py3-none-any.whl
Size 6.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
0c256acaa132d58ddd4af5ecccaef1b9dd2edd35545da60833713a68542af586
BLAKE2b-256 checksum
How to use checksums
bbf823513dab75f292f5c1816ca370e53cd2636350645129a83475aaca888fb4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.0

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page