Skip to main content

Datus plugin: read Statsig metrics & experiment results, author warehouse-native metric SQL, and drive ETL ingestion from `datus statsig` (Console API v20240601)

Project description

datus-statsig-plugin

A Datus plugin that wraps the Statsig Console API (version 20240601) as datus statsig. It focuses on the data-analysis surface of the API: reading metrics and experiment results, authoring warehouse-native metric SQL, and driving ETL ingestion — not feature-flag / project management.

Install

pip install -e datus-statsig-plugin
datus statsig --help

Configure

Add a profile under agent.plugins.statsig in your agent.yml:

agent:
  plugins:
    statsig:
      prod:
        default: true
        api_key: ${STATSIG_CONSOLE_API_KEY}   # secret — env var reference, never a literal
        # optional:
        api_base_url: https://statsigapi.net   # Console API root (plugin appends /console/v1)
        api_version: "20240601"
        timeout: 30

Create a Console API key at console.statsig.com/api_keys. Or run the bundled statsig-setup skill for a guided setup.

Field Required Secret Default
api_key yes yes (${VAR})
api_base_url no no https://statsigapi.net
api_version no no 20240601
timeout no no 30

Commands

datus statsig [--profile <env>] <group> <subcommand> [args...]
Group Subcommands Posture
metrics list, get, sql, values / create, update, reload reads allow · writes ask
metric-source list, get / create, update, delete reads allow · writes ask
experiments list, get, pulse, summary, exposures, pulse-status / load-pulse reads allow · writes ask
ingestion get, runs, run, status, schedule-get / backfill, schedule-set reads allow · writes ask
warehouse-connections update ask
events list, get allow
logs query allow
reports get allow
describe <group> <subcommand> allow (prints a write command's body template)

Output is JSON by default (--compact for one line; -o table|plain|yaml). Write commands take their body via --json '<inline>' or --json-file <path> (warehouse-connections update accepts only --json-file, since it carries credentials). Run datus statsig describe <group> <subcommand> — or add --help — to see the body template; --dry-run validates without persisting.

Rate limits: mutations are capped at ~100/10s and ~900/15min per project.

Permissions

When the agent runs these commands through its bash tool, read-only commands (and describe) auto-run; every mutation confirms under both the normal and auto permission profiles (re-running a write costs warehouse compute and consumes the mutation rate limit).

Bundled skills

  • statsig — how to use the CLI for metric/experiment analysis and SQL authoring.
  • statsig-setup — configure an environment profile.

Development

pip install -e 'datus-statsig-plugin[dev]'
pytest datus-statsig-plugin

The plugin never imports datus — Datus is the config broker and calls the plugin by duck typing.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

datus_statsig_plugin-0.1.0-py3-none-any.whl (28.0 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for datus_statsig_plugin-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 02eaaffba01bdadc8e75300a462931576aa3567d92f55cea566904f89f23a96c
MD5 54fadb19ffe9caee6f83e11c77fea4ab
BLAKE2b-256 1df56212c205955e9eb1d76dad90070aa52c49f3b79175152bf3ed7cde57ebec

See more details on using hashes here.

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