Skip to main content

Systemd journal reader and exporter

Project description

Propagation Exporter

A small tool that watches systemd journal entries from opendnssec-signer.service, parses zone update stats, checks downstream DNS SOA serial propagation, and exposes Prometheus metrics.

Install

This project uses pyproject.toml. Install in your environment of choice.

Run

  • As a console script (recommended):

    propagation-exporter -c /etc/coralogix-exporter/zones.yaml --metrics-port 8000

  • As a module:

    python -m propagation_exporter -c /etc/coralogix-exporter/zones.yaml

  • Legacy script (still supported):

    python main.py -c /etc/coralogix-exporter/zones.yaml

Testing with uv

This project uses uv for Python environment and dependency management in development.

  • Install dev deps (once):

    uv sync --extra dev

  • Run tests with coverage:

    uv run pytest -q --cov=propagation_exporter --cov-report=term-missing

  • Optional: type and style checks:

    uv run mypy propagation_exporter uv run flake8 propagation_exporter

CLI options

  • -c, --config-file: YAML with zones and nameservers
  • --metrics-port: Prometheus HTTP port (default 8000)
  • --zone / --ns: Ad-hoc SOA serial checks without systemd
  • --stats-regex: Override the regex used to parse journal "[STATS]" lines.

Regex parsing

By default, the parser extracts zone, serial, and RR count from lines like:

[STATS] example.com 2024072826 RR[count=4 time=0(sec)] ...

Default pattern:

^\[STATS\]\s+(?P<zone>\S+)\s+(?P<serial>\d+)\s+RR\[count=(?P<rr_count>\d+)

You can override it via CLI --stats-regex or programmatically when creating ZoneManager.

Module layout

  • propagation_exporter/
    • init.py: public exports
    • main.py: python -m entry
    • cli.py: argument parsing and app wiring
    • journal.py: systemd journal reader
    • zone.py: ZoneInfo, ZoneConfig, ZoneManager, and parsing
    • dns_utils.py: DNSChecker utilities
    • metrics.py: Prometheus metrics

Prometheus metrics

  • zone_rr_count{zone}
  • zone_in_sync{zone}
  • zone_propagation_delay_seconds{zone, nameserver, serial}

Config file

YAML example:

zones:
	example.com.:
		primary_nameserver: 192.0.2.1
		downstream_nameservers:
			- 192.0.2.2
			- 192.0.2.3

Notes

  • Ensure systemd-python, dnspython, PyYAML, and prometheus-client are available in the runtime environment.

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

propagation_exporter-0.4.1.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

propagation_exporter-0.4.1-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file propagation_exporter-0.4.1.tar.gz.

File metadata

  • Download URL: propagation_exporter-0.4.1.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for propagation_exporter-0.4.1.tar.gz
Algorithm Hash digest
SHA256 9442bee7fd5c2c2528cbce84141a3e7c9c44881282199ee0931b2bd1f9bec06f
MD5 8c8616c5407c7c9b58e2fa57dbc07721
BLAKE2b-256 243f8c27c33d13f8f987da99162c2ce5737b753ce253bdd9c8ea0efadd6448dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for propagation_exporter-0.4.1.tar.gz:

Publisher: build.yml on icann-dns/zone_propagation_exporter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file propagation_exporter-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for propagation_exporter-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 27718f6eb4e4edf2395fad02e4574904fe4d84df0bc9be70de97b43d5e9a98b6
MD5 899894653bc706a42bc5491bc096aeb2
BLAKE2b-256 4f4d3a2efe7ec3e57ba4fcccfdd85ecca933f821b6537b7a34e6af2eae5730e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for propagation_exporter-0.4.1-py3-none-any.whl:

Publisher: build.yml on icann-dns/zone_propagation_exporter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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