Skip to main content

DQRAlert

PyPI version License: GPL v3 Docs

DQRAlert listens for igwn-alert messages from GraceDB and launches an external processing command (such as the DQR task manager) when an appropriate gravitational-wave candidate alert is received.

Overview

When GraceDB issues a superevent alert, DQRAlert:

  1. Receives the alert payload via the IGWN Kafka/hop-client infrastructure
  2. Filters it by alert type and false-alarm rate (FAR)
  3. Writes the event JSON to a configured output directory
  4. Optionally saves all received alerts (including filtered ones) to a separate archive directory
  5. Launches a user-supplied shell command to process the accepted event

Installation

pip install dqralert

Quick Start

1. Set up SCIMMA / hop credentials

hop auth add
# follow the prompts to enter your SCIMMA username and password

Verify the connection:

igwn-alert topics

2. Create a configuration file

[alerts]
# Kafka topic(s) to subscribe to (space-separated)
topics = mdc_superevent

# GraceDB server group: gracedb (production), gracedb-playground, gracedb-test
group = gracedb-playground

# Alert types to process (space-separated); omit or set to 'any' for all
type = new

# False-alarm rate threshold [Hz] — alerts with FAR above this are ignored
max_far = 1.57e-5

# Directory to write the accepted event JSON payload
json_dir = /path/to/json

# Command to run for each accepted alert
# Variables: ${json} = path to the JSON file, ${graceid} = GraceDB S-event ID
run = /path/to/my-processing-script.sh ${json} ${graceid}

# Maximum runtime [seconds] for the processing command
timeout = 1800

# Optional: save ALL received alerts (including filtered ones) here
# saveall_dir = /path/to/archive

3. Run the listener

dqralert -v -c /path/to/dqr-alert.ini -l /path/to/dqralert.log

Command-Line Reference

usage: dqralert [-h] [-v] [-V] [-q] [-u USER] [-c CONFIG] [-l LOG_FILE] [-f] [--memstat MEMSTAT]

Accept an igwn-alert, call dqr-create-dag

options:
  -h, --help            show this help message and exit
  -v, --verbose         increase verbose output (repeat for more detail)
  -V, --version         show program's version number and exit
  -q, --quiet           show only fatal errors
  -u USER, --user USER  igwn-alert username
  -c CONFIG, --config CONFIG
                        path to configuration file
  -l LOG_FILE, --log-file LOG_FILE
                        save log messages to this file
  -f, --full-payload    store the full alert payload (default: store only the
                        'object' field, compatible with a GraceDB query)
  --memstat MEMSTAT     record memory statistics to this file

dqralert-latency

A utility to compute processing latencies from saved event JSON files:

dqralert-latency event1.json event2.json ...

Prints a CSV table with the GraceDB ID, event time, superevent creation time, and the time the JSON file was written.

Configuration Reference

Key Default Description
topics (required) Space-separated list of Kafka topics to subscribe to
group gracedb GraceDB server group (gracedb, gracedb-playground, gracedb-test)
type any Space-separated alert types to process (e.g. new signoff_created); any processes all
max_far 1 Maximum false-alarm rate [Hz]; alerts above this threshold are ignored
json_dir (required) Directory to write accepted event JSON payloads
run (none) Shell command to execute for each accepted alert
timeout 600 Maximum runtime [seconds] for the processing command
saveall_dir (none) Directory to archive all received alerts (including filtered ones)
save_list any Alert types to save in saveall_dir; any saves all
save_ignore (none) Alert types to exclude from saveall_dir (e.g. log)
refresh_alert_counters (disabled) Print alert rate statistics every N seconds

License

DQRAlert is distributed under the GNU General Public License v3 or later.

Metadata

Release files for DQRAlert 0.5.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 DQRAlert 0.5.1
File Size Uploaded
dqralert-0.5.1.tar.gz 1.6 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for DQRAlert 0.5.1
File Interpreter ABI Platform
dqralert-0.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 3.2 MB

Release files / dqralert-0.5.1.tar.gz

Download URL dqralert-0.5.1.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
be408ac162b7dd3f31f59e7033f6667487d4a3ce53d80687c2954825d3f3d26e
BLAKE2b-256 checksum
How to use checksums
16af1c3095bbfcf95853a9b2068bee02bffb3a041a4839ed7386983d9f4d8bd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.8

Release files / dqralert-0.5.1-py3-none-any.whl

Download URL dqralert-0.5.1-py3-none-any.whl
Size 1.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
341fb9ea7eacc8f29ebf21d174e8006f9880f5d781e217911c16a19ae9ab1b6a
BLAKE2b-256 checksum
How to use checksums
c2fe54ed081b5a229e480630c1847656b450cd53b076ea3637a274949f7e8b18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.8

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 release files

0.5.0

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