Skip to main content

Returns

Returns a Monitor object for the given parameters, or None if an error occurs.

Example

monitor = galtea.monitors.create(
    name="Production quality monitor",
    product_id=product_id,
    metric_group_ids=[metric_group_id],
    # Optional: watch a single version. Omit to watch every version of the product.
    # version_id="your-version-id",
    sampling_percentage=10,  # score 10% of production sessions (default)
    monthly_credit_cap=5000,  # stop scoring after 5000 credits this month; None means uncapped
    inactivity_window_minutes=5,  # a session is scored 5 minutes after its last activity (default)
)

Parameters

name
string
required
Name of the monitor.
product_id
string
required
The ID of the product whose production sessions this monitor scores.
metric_group_ids
list[string]
required
The metric family IDs (metric.metric_group_id) the monitor scores with. At least one is required. The monitor binds the family, not a specific revision, so revising a metric is picked up automatically.
version_id
string
The ID of a single version to watch. Omit to watch every version of the product.
sampling_percentage
number
default:"10"
Percentage of production sessions to score, from just above 0 up to 100. Defaults to 10 (10%).
monthly_credit_cap
int
Maximum credits to spend per month. Must be positive when set. None (default) means uncapped. The effective budget is min(organization balance, cap), so a cap may exceed the monthly allocation.
inactivity_window_minutes
int
default:"5"
Minutes of session inactivity before a session is treated as finished and eligible for scoring. Defaults to 5.