Make ottyl_seq/ottyl_ts usable in dashboard PromQL queries (ticket 055)
evaluate_promql previously resolved every metric name through bucket_values, which only returns data for a real MetricDeclaration — so a dashboard panel querying ottyl_seq/ottyl_ts/ottyl_fmt (already supported in the filter bar and alert conditions) silently returned an empty series. ottyl_seq/ottyl_ts are now synthesized directly from the ingested-log index instead of requiring a declaration; ottyl_fmt is categorical (json/logfmt/none) with no sensible numeric reading, so it's rejected up front with a clear error pointing back at the filter bar rather than returning nothing. GET /api/params now also lists the three reserved names (marked `reserved: true`, distinct from `auto_derived`) purely for discoverability — merged in at the API layer only, not the engine's internal ParamDeclarations query, so profile-switch removal and metric-param-promotion logic are unaffected. declare_param also now rejects declaring a param under one of these names. Docs.tsx and the Params panel are updated to reflect the new dashboard support and the reserved/non-editable listing. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XFUNZwCvz3kcod3352ZR2o
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
d17cfe9b83
commit
ff56558b2e
@@ -32,6 +32,8 @@ export interface ParamDeclaration {
|
||||
kind: 'string' | 'number' | 'timestamp' | 'duration' | 'boolean'
|
||||
/** A third extraction source, distinct from `capture_group`/`json_field_path`: when true, this param's value is never parsed from text — it's computed as elapsed time since the previous event sharing the same label set. Only meaningful paired with `kind: 'duration'`. */
|
||||
elapsed_since_last?: boolean
|
||||
/** Set only for the built-in `ottyl_seq`/`ottyl_ts`/`ottyl_fmt` names, synthesized into `GET /api/params` for discoverability — they're usable in the filter bar (and `ottyl_seq`/`ottyl_ts` in dashboard PromQL queries) without ever being declared, and can't be edited or removed. */
|
||||
reserved?: boolean
|
||||
}
|
||||
|
||||
export interface TimelineBucket {
|
||||
|
||||
Reference in New Issue
Block a user