Skip to main content

Prometheus exporter for kobo hub

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-kobo-exporter-1.1.0.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

django_kobo_exporter-1.1.0-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file django-kobo-exporter-1.1.0.tar.gz.

File metadata

  • Download URL: django-kobo-exporter-1.1.0.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for django-kobo-exporter-1.1.0.tar.gz
Algorithm Hash digest
SHA256 46093c82fc360383355f5dd440eefae6dc9e554560df9ce99777309973970267
MD5 f350f8d35fbffcb79593c3992f258575
BLAKE2b-256 841525926e750861c3acf7ea0ff4025a2a3947bfddc0c0d5bd8abe3adb95747f

See more details on using hashes here.

File details

Details for the file django_kobo_exporter-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_kobo_exporter-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 54297aab46ebd03e4d7d95ca09f8715dff11415e971897b1e8fff42bf8f64eff
MD5 b91a4f1d5427fd0643a61f510fd2fac1
BLAKE2b-256 d7d1c542be7a56fc5c01f7352ed7cd170ce8dd1c05a25ffff13eee904f34ee36

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page