{"id":17384294,"url":"https://github.com/panagiks/opium","last_synced_at":"2025-07-10T06:39:37.572Z","repository":{"id":57449326,"uuid":"307095562","full_name":"panagiks/opium","owner":"panagiks","description":"OpenShift Pod Independent Usage Metrics (OPIUM) pulling \u0026 aggregating metrics from multiple pods made easy!","archived":false,"fork":false,"pushed_at":"2020-10-25T20:32:11.000Z","size":20,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-02T16:49:42.657Z","etag":null,"topics":["observability","okd","prometheus"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/panagiks.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-25T12:37:19.000Z","updated_at":"2020-10-28T07:54:57.000Z","dependencies_parsed_at":"2022-09-26T17:31:03.185Z","dependency_job_id":null,"html_url":"https://github.com/panagiks/opium","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panagiks%2Fopium","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panagiks%2Fopium/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panagiks%2Fopium/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panagiks%2Fopium/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/panagiks","download_url":"https://codeload.github.com/panagiks/opium/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245924499,"owners_count":20694731,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["observability","okd","prometheus"],"created_at":"2024-10-16T07:45:04.194Z","updated_at":"2025-03-27T21:17:53.736Z","avatar_url":"https://github.com/panagiks.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"=====\nopium\n=====\n\n\n.. image:: https://img.shields.io/pypi/v/opium.svg\n        :target: https://pypi.python.org/pypi/opium\n\n.. image:: https://img.shields.io/travis/panagiks/opium.svg\n        :target: https://travis-ci.com/panagiks/opium\n\n.. image:: https://readthedocs.org/projects/opium/badge/?version=latest\n        :target: https://opium.readthedocs.io/en/latest/?badge=latest\n        :alt: Documentation Status\n\n\n\n\nOpenShift Pod Independent Usage Metrics (OPIUM) pulling \u0026 aggregating metrics from multiple pods made easy!\n\n\n* Free software: MIT license\n* Documentation: https://opium.readthedocs.io.\n\n\nAggregating metrics from pods through OKD's router can be a challenge. OPIUM offers the next best thing.\nWhile it doesn't (yet) aggregate the varius metrics it gathers the metrics from the defined Deployment Configs\non a specific OKD project and serves them to a single /metrics endpoint. This way it allows for easier gathering\nof per-pod metrics.\n\nOf course, given no real aggregation is happening, it makes sense that your metrics should contain some unique label\nvalue to differentiate the same measurements from different pods. The contents of the HOSTNAME env variable are usually\na good fit for the value of such a label since they will be unique (within a project). This way 'true' aggregation can happen\nat a later stage (i.e. with a sum across all instances while graphing the values).\n\nConfiguration\n-------------\n\nOPIUM is configured through environment variables and specifically the following:\n\n* OPIUM_OKD_URL =\u003e The url of the OKD instance's master, including the scheme and without a trailing `/`\n* OPIUM_OKD_TOKEN =\u003e An access token for a service account with `view` and `edit` permissions on the desired project\n* OPIUM_PROJECT =\u003e Project to be exported\n* OPIUM_DEPLOYMENT_CONFIGS =\u003e Comma separated (no spaces) list of Deployment Configs to export\n\nOKD Preparation\n---------------\n\nIn your OKD admin CLI you will need to run the following\n\n.. code-block:: bash\n\n    # create a service account\n    oc create serviceaccount \u003caccount\u003e\n    # Retrieve the service account's access token (set this to OPIUM_OKD_TOKEN)\n    oc serviceaccounts get-token \u003caccount\u003e\n    # Give the service account the required permissions to the desired project\n    oc policy add-role-to-user view system:serviceaccount:\u003cproject\u003e:\u003caccount\u003e\n    oc policy add-role-to-user edit system:serviceaccount:\u003cproject\u003e:\u003caccount\u003e\n\n\nExecution\n---------\n\nTo start OPIUM (after you've set the configuration environment variables appropriately) simly run:\n\n.. code-block:: bash\n\n    opium\n\nThis will spawn an HTTP server listening on your system's public interface and on port 8080.\n\nConfiguration for the listening interface, as well as a containerized version of OPIUM will follow in later versions.\n\nFeatures\n--------\n\n* Gather the response of `/metrics` from all the pods of the specified `deployment_config`\n* Serve them as one response\n\nCredits\n-------\n\nThis package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\n\nThis repository uses the following as a preview image (under CC BY-SA 2.0): \"July 19th. Opium Poppy\" by amandabhslater is licensed with CC BY-SA 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-sa/2.0/\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanagiks%2Fopium","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpanagiks%2Fopium","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanagiks%2Fopium/lists"}