Skip to content

Commit

Permalink
[bugfix] Json convert error at grafana Alert
Browse files Browse the repository at this point in the history
  • Loading branch information
masterjyq authored and twou12031 committed Jan 15, 2024
1 parent 2a388a1 commit 75a6881
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions deepflow-querier-datasource/src/utils/genQueryParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,11 @@ export function genQueryParams(queryData: Record<any, any>, scopedVars: ScopedVa

export const replaceIntervalAndVariables = (queryText: string, scopedVars?: ScopedVars) => {
let _queryText = queryText
.replace(`"${TIME_VARIABLE_FROM}"`, TIME_VARIABLE_FROM)
.replace(`"${TIME_VARIABLE_TO}"`, TIME_VARIABLE_TO)
if ((getTemplateSrv() as any).timeRange) {
_queryText = queryText
.replace(`"${TIME_VARIABLE_FROM}"`, TIME_VARIABLE_FROM)
.replace(`"${TIME_VARIABLE_TO}"`, TIME_VARIABLE_TO)
}
if (typeof scopedVars?.__interval_ms?.value === 'number') {
const intervalSecond = scopedVars.__interval_ms.value / 1000
_queryText = queryText
Expand Down

0 comments on commit 75a6881

Please sign in to comment.