elastic / elastic/observability-migration-platform

Support Grafana advanced Expressions (Math / Reduce / Resample / Classic condition)

Open
#194 0 comments 0 reactions 0 assignees View on GitHub
asset:alerts enhancement phase:8 program:grafana-engine source:grafana workstream:translator
Dominant language
Python
Stars
6
Forks
8
Avg merge
2d 22h
Merged PRs (30d)
23

Description

## Problem

Grafana alerts have two shapes:

- With **Advanced options off**, the rule is a single **"WHEN `[reducer]` OF query IS ABOVE `N`"** — one reducer + one threshold. This is the common case and migrates today.
- With **Advanced options on**, the **Expressions** section lets users chain steps — **Math**, additional **Reduce** steps, **Resample**, **Classic condition** — and the migration parks any such alert for manual review and **does not create it**.

## Impact

Hand-built Grafana alerts that use Advanced options (Math, Classic condition, multi-step chains) don't migrate and must be rebuilt by hand.

## Steps to reproduce

1. Create an alert, enable **Advanced options**, and add a **Classic condition** (or a **Math** step).
2. Migrate it.

**Current behavior:** parked for review, not created.

## Scope of translation

- **Math** (arithmetic/logic across steps) → expressible as arithmetic in the query. *Translatable.*
- **Classic condition** (legacy reduce + threshold in one) → expressible as aggregate + threshold. *Translatable.*
- **Reduce** variants beyond the simple form → aggregation in the query. *Translatable.*
- **Resample** (re-align a series to a fixed step) → **no Kibana equivalent.** *Not translatable — flag and warn.*

## Acceptance criteria

- [ ] Math and Classic-condition alerts migrate to a working rule.
- [ ] Multi-step Reduce chains migrate where the operations have query equivalents.
- [ ] Resample (and any other untranslatable step) is clearly flagged with a reason instead of being silently parked.

Contributor guide

Open the contributing guide

Research direction

Start by locating the Grafana alert migration and expression-translation logic, then inspect how advanced Expressions are currently parked for manual review. Verify that Math, Classic condition, and supported multi-step Reduce chains migrate to working rules, while Resample and other unsupported steps are flagged with clear reasons.

Written by the indexing model from the issue text.

Assessment

Tech stack
grafana, python
Domain
observability-sre
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.