File tree Expand file tree Collapse file tree
prometheus/schemas/prometheus-time-series-query/migrate Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414package migrate
1515
1616#target : {
17- // /!\ Best-effort conversion logic that may wrongly convert not-prometheus queries to PrometheusTimeSeriesQuery:
18- // Ideally we should rely on datasource.type = "prometheus" to identify prometheus queries. But in some cases,
19- // this information is not be available. Thus the condition relies on the presence of the "expr" field, that
20- // likely indicates that this is a prometheus query.
2117 datasource ?: {
22- uid : string
18+ type ?: " prometheus "
19+ uid : string
2320 }
21+ // /!\ Best-effort conversion logic that may wrongly convert not-prometheus queries to PrometheusTimeSeriesQuery:
22+ // Ideally we should only rely on datasource.type = "prometheus" to identify prometheus queries. But in some cases,
23+ // this information is not present. Thus, in addition to the check on the optional type above, the below condition
24+ // relies on the presence of the "expr" field, that likely indicates that this is a prometheus query.
2425 expr : string
2526 legendFormat ?: string
2627 interval ?: string
Original file line number Diff line number Diff line change 11{
22 "datasource" : {
3+ "type" : " prometheus" ,
34 "uid" : " ${datasource}"
45 },
56 "editorMode" : " code" ,
You can’t perform that action at this time.
0 commit comments