Skip to main content

Prometheus exporter for kobo hub.

tests PyPI version

Overview

The kobo framework provides, among other things, a Django-based "hub" web service which is used to manage tasks and workers.

django-kobo-exporter is a Django app which may be installed to a kobo hub in order to add a prometheus-compatible metrics endpoint exposing kobo metrics.

Usage

  1. Ensure django-kobo-exporter is installed, e.g.
pip install django-kobo-exporter
  1. In your app's settings, add kobo_exporter to INSTALLED_APPS, e.g.
INSTALLED_APPS = [
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'kobo.django.auth',
    'django.contrib.messages',
    'django.contrib.admin',
    'django.contrib.staticfiles',
    'kobo.django.xmlrpc',
    'kobo.hub',
    # added here
    'kobo_exporter',
    # your app's own stuff below...
    ...,
]
  1. Mount kobo_exporter.urls somewhere in your project.

/kobo_exporter/ is recommended; for example, in your root urlpatterns:

from django.urls import include, path

urlpatterns = [
    # ... snip ...
    path('kobo_exporter/', include('kobo_exporter.urls')),
    # ... snip ...
]
  1. Access metrics at <your_service>/kobo_exporter/metrics.

The metrics endpoint will provide basic information on workers, as in example:

# HELP kobo_worker_enabled 1 if worker is enabled
# TYPE kobo_worker_enabled gauge
kobo_worker_enabled{worker="localhost"} 1.0
kobo_worker_enabled{worker="pub-dev-pubd7"} 1.0
# HELP kobo_worker_ready 1 if worker is ready
# TYPE kobo_worker_ready gauge
kobo_worker_ready{worker="localhost"} 1.0
kobo_worker_ready{worker="pub-dev-pubd7"} 1.0
# HELP kobo_worker_load Current load of worker (sum of task weights)
# TYPE kobo_worker_load gauge
kobo_worker_load{worker="localhost"} 0.0
kobo_worker_load{worker="pub-dev-pubd7"} 0.0
# HELP kobo_worker_max_load Maximum permitted load of worker
# TYPE kobo_worker_max_load gauge
kobo_worker_max_load{worker="localhost"} 60.0
kobo_worker_max_load{worker="pub-dev-pubd7"} 60.0
# HELP kobo_worker_open_tasks Current number of OPEN tasks for worker
# TYPE kobo_worker_open_tasks gauge
kobo_worker_open_tasks{worker="localhost"} 0.0
kobo_worker_open_tasks{worker="pub-dev-pubd7"} 0.0
# HELP kobo_worker_last_seen_seconds Time of worker's last communication with hub
# TYPE kobo_worker_last_seen_seconds gauge
kobo_worker_last_seen_seconds{worker="localhost"} 1.625644554e+09
kobo_worker_last_seen_seconds{worker="pub-dev-pubd7"} 0.0

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Metadata

Release files for django-kobo-exporter 1.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 django-kobo-exporter 1.1.1
File Size Uploaded Provenance Actions
django_kobo_exporter-1.1.1.tar.gz 17.9 kB Without provenance Details for django_kobo_exporter-1.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-kobo-exporter 1.1.1
File Interpreter ABI Platform Actions
django_kobo_exporter-1.1.1-py3-none-any.whl Python 3 none any Details for django_kobo_exporter-1.1.1-py3-none-any.whl

Total release size: 35.4 kB

Release files / django_kobo_exporter-1.1.1.tar.gz

Download URL django_kobo_exporter-1.1.1.tar.gz
Size 17.9 kB
Tags Source
SHA-256 checksum
How to use checksums
650804ea5e6976b08424920be95b94f0c14f58a9dd7fa872d9a2770de0b49b0c
BLAKE2b-256 checksum
How to use checksums
3810f9429020c4eb5e0a6eb03ab7100ab27366dbd0f44528ad886a9c0e77b2d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.6

Release files / django_kobo_exporter-1.1.1-py3-none-any.whl

Download URL django_kobo_exporter-1.1.1-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e0f7273813b520dc816293f2134ca4a391a8dce5c811d1b7da9d292db38670dc
BLAKE2b-256 checksum
How to use checksums
727582f4622ae7f91de49af6a77ec1f0ac623fdbf6054b3b1447d075fbc7541b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.6

Security for django-kobo-exporter 1.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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