-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Two issues when we migrate from prometheus to victoriametrics datasource #205
Comments
@Loori-R could you please take a look? The first one is very annoying issue |
Unfortunately, we are unable to prevent the query from being lost when switching the datasource in alert rules. This behavior is controlled by Grafana's internal code. When a datasource is switched, Grafana checks the type (which corresponds to the plugin ID that we cannot modify). If the type differs from the previous one, Grafana resets the query by invoking the if (settings.type === previousSettings?.type) {
return copyModel(item, settings);
}
return newModel(item, settings); The function newModel(item: AlertQuery, settings: DataSourceInstanceSettings): Omit<AlertQuery, 'datasource'> {
return {
refId: item.refId,
relativeTimeRange: item.relativeTimeRange,
queryType: '',
datasourceUid: settings.uid,
model: {
refId: item.refId,
hide: false,
datasource: getDataSourceRef(settings),
},
};
} As you can see, the |
@Loori-R Thank you.
Beside the alert rules, we find that things seem different for the dashboard panels or metric explorer. You can see that the query expression is retained, but not completely right. The metric name is put as the |
* feature: set default Type to instant for alert rules #205 * Update CHANGELOG.md --------- Co-authored-by: Roman Khavronenko <[email protected]>
How it works: The datasource uses the What we can do: We can adjust our implementation to correctly handle labels with dots during import. This will preserve labels with dots when switching from VictoriaMetrics to Prometheus. Why this isn't a complete solution: This only resolves the issue in one direction. To fully address the problem, the |
@Loori-R Understood, thank you very much! |
@Loori-R is this a complex task? Do you think you can submit a PR to grafana with fix? |
Hi @chenlujjj ! This feature was implemented in the new release. Please check it, and if you find any problem, please reopen the issue. |
The following functionality has been implemented and included in the release: "set the default query type to However, I am reopening this issue because there is still a problem with dots in the labels when switching between VictoriaMetrics and Prometheus. |
Related change grafana/grafana#95163 |
Hi team, we're migrating the datasource from prometheus to victoriametrics, but find two issues:
before:
after:
Can you help to take a look into them? Thanks in advance
The text was updated successfully, but these errors were encountered: