Skip to main content

Unattended cross-platform anomaly monitoring for the Measure ecosystem: fetch metric observations, detect irregular drops/spikes, deliver alerts.

Project description

Measure Monitor

Unattended cross-platform anomaly monitoring for the Measure ecosystem.

measure-monitor is the ecosystem's orchestrator, not an MCP product. It sits one level above the products — which never import one another — and wires them together: it fetches metric Observations from a source product (paid media today), runs the SDK's shared anomaly detector, and delivers alerts to your channels. Run it on a schedule for hands-off monitoring of irregular drops and spikes.

  ┌── cron / /schedule ──────────────────────────────────────────────┐
  │  measure-monitor run --config monitors.toml                       │
  │                                                                   │
  │   paid-media.get_metric_observations(metric)   ← fetch + history  │
  │            │                                                      │
  │            ▼  detect_anomaly (SDK)              ← shared brain     │
  │       irregular drop/spike?                                       │
  │            │                                                      │
  │            ▼                                                      │
  │     Slack / Teams / email                       ← centralized     │
  └───────────────────────────────────────────────────────────────────┘

Install

pip install measure-monitor          # pulls in measure-paid-media-mcp + measure-sdk
measure login                        # one-time Google sign-in (from the SDK)

Configure

Describe what to watch in a JSON or TOML file — see examples/monitors.toml:

[[monitors]]
name = "spend-anomaly"
metric = "spend"        # spend | revenue | conversions | clicks | impressions | roas | cpa | ctr
days = 7                # each period is a 7-day window
periods = 4             # 4 prior windows form the baseline
method = "z_score"      # z_score | mad | pct_change
sensitivity = 3.0       # stdevs (z_score/mad) or fraction (pct_change)

  [[monitors.channels]]
  type = "console"      # console | slack | teams | discord | email

Run

measure-monitor run --config monitors.toml            # detect + deliver
measure-monitor run --config monitors.toml --dry-run  # detect only, no delivery

Output is a JSON report. Exit code is 1 when any anomaly was found (0 = clean, 2 = error), so a cron wrapper can react to it.

Email delivery reads SMTP from the environment: MEASURE_SMTP_HOST, MEASURE_SMTP_PORT, MEASURE_SMTP_USER, MEASURE_SMTP_PASSWORD, MEASURE_SMTP_FROM.

Schedule it

System cron — every hour:

0 * * * * cd /path/to/work && measure-monitor run --config monitors.toml >> monitor.log 2>&1

Claude Code /schedule — a cloud routine that runs the check and reacts to the result in natural language (no config file needed; the agent has both MCPs connected). Example prompt to schedule:

Every hour: use paid-media get_metric_observations for spend and roas across all platforms; for any anomaly, deliver a summary with the alerts engine.

Both modes respect the ecosystem rule: products never import each other — only this orchestrator depends on more than one.

How it fits the ecosystem

  • Source of truth for detection: measure_sdk.detect_anomaly — the same brain every product uses, so results are comparable across platforms.
  • Extensible: as GA4 / SEO products expose get_metric_observations, point a monitor at them; the runner is source-agnostic (it depends only on the Observation contract).

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

measure_monitor-0.1.0.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

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

measure_monitor-0.1.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file measure_monitor-0.1.0.tar.gz.

File metadata

  • Download URL: measure_monitor-0.1.0.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for measure_monitor-0.1.0.tar.gz
Algorithm Hash digest
SHA256 411051ab36203e53749deef3b3923149f368acc12327af8495f2babec57c049a
MD5 cef785d2f30f0175d91de596a2eee204
BLAKE2b-256 19731f0f660b7df4f46cea983d06778393fec659fb79ccdc51b87293ee292d2c

See more details on using hashes here.

Provenance

The following attestation bundles were made for measure_monitor-0.1.0.tar.gz:

Publisher: release.yml on measure-mcp/measure-monitor

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

File details

Details for the file measure_monitor-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for measure_monitor-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 96bd4da9127684a488f17c4b7494c864859312dad52be094b72bdd93cbae7bfe
MD5 6e0e3b744fdd4e8394c57219a1fbdae4
BLAKE2b-256 4337b4a840e5344d5f504dcd54a7389ac176c1840be107e373f892719d9e6b7a

See more details on using hashes here.

Provenance

The following attestation bundles were made for measure_monitor-0.1.0-py3-none-any.whl:

Publisher: release.yml on measure-mcp/measure-monitor

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