Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

MADSci Event Manager

Handles distributed logging and events throughout a MADSci-powered Lab.

MADSci Event Manager Architecture Diagram

Features

  • Centralized logging from distributed lab components
  • Event querying with structured filtering
  • Arbitrary event data support with standard schema
  • Python logging-style log levels
  • Alert notifications (email, etc.)

Installation

See the main README for installation options. This package is available as:

Dependencies: MongoDB database (see the example_lab)

Usage

Quick Start

Use the example_lab as a starting point:

# Start with working example
docker compose up  # From repo root
# Event Manager available at http://localhost:8001/docs

# Or run standalone
python -m madsci.event_manager.event_server

Manager Setup

For custom deployments, create an Event Manager definition:

madsci manager add -t event_manager

See example_event.manager.yaml for configuration options.

Client

You can use MADSci's EventClient (madsci.client.event_client.EventClient) in your python code to log new events to the event manager, or fetch/query existing events.

from madsci.client.event_client import EventClient
from madsci.common.types.event_types import Event, EventLogLevel, EventType

event_client = EventClient(
    event_server="https://127.0.0.1:8001", # Update with the host/port you configured for your EventManager server
)

event_client.log_info("This logs a simple string at the INFO level, with event_type LOG_INFO")
event_client.info("This does the same thing")
event = Event(
    event_type="NODE_CREATE",
    log_level=EventLogLevel.DEBUG,
    event_data="This logs a NODE_CREATE event at the DEBUG level. The event_data field should contain relevant data about the event (in this case, something like the NodeDefinition, for instance)"
)
event_client.log(event)
event_client.log_warning(event) # Log the same event, but override the log level.

# Get the 50 most recent events
event_client.get_events(number=50)
# Get all events from a specific node
event_client.query_events({"source": {"node_id": "01JJ4S0WNGEF5FQAZG5KDGJRBV"}})

event_client.alert(event) # Will force firing any configured alert notifiers on this event

Alerts

The Event Manager provides some native alerting functionality. A default alert level can be set in the event manager definition's alert_level, which will determine the minimum log level at which to send an alert. Calls directly to the EventClient.alert method will send alerts regardless of the alert_level.

You can configure Email Alerts by setting up an EmailAlertsConfig (madsci.common.types.event_types.EmailAlertsConfig) in the email_alerts field of your EventManagerSettings.

Metadata

Release files for madsci.event_manager 0.5.0rc3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for madsci.event_manager 0.5.0rc3
File Size Uploaded Provenance Actions
madsci_event_manager-0.5.0rc3.tar.gz 42.1 kB Without provenance Details for madsci_event_manager-0.5.0rc3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for madsci.event_manager 0.5.0rc3
File Interpreter ABI Platform Actions
madsci_event_manager-0.5.0rc3-py3-none-any.whl Python 3 none any Details for madsci_event_manager-0.5.0rc3-py3-none-any.whl

Total release size: 83.6 kB

Release files / madsci_event_manager-0.5.0rc3.tar.gz

Download URL madsci_event_manager-0.5.0rc3.tar.gz
Size 42.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a4516eaf3707b9113dfb4653e36874bfb636e7a93db2d94840d32b276129c3b8
BLAKE2b-256 checksum
How to use checksums
7e3505d47480d11fbca3b591e2dd68d2c172a6a115a209244b4a04fb2a6ba9c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via pdm/2.26.0 CPython/3.9.23 Linux/6.11.0-1018-azure

Release files / madsci_event_manager-0.5.0rc3-py3-none-any.whl

Download URL madsci_event_manager-0.5.0rc3-py3-none-any.whl
Size 41.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3f28e7b704baaee6f3404de90095560401e6db8433cf2b741c1803fa97e14993
BLAKE2b-256 checksum
How to use checksums
ce87c958e7584f4ce83f18da4b3b5ce1d3a584da4e70281286b14c1befcc2dfc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via pdm/2.26.0 CPython/3.9.23 Linux/6.11.0-1018-azure

Security for madsci.event_manager 0.5.0rc3

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.

Release history Release notifications | RSS feed

This release
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