diff --git a/.betterer.results b/.betterer.results index 3202ad9c3ab..4af05d03985 100644 --- a/.betterer.results +++ b/.betterer.results @@ -6967,8 +6967,8 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "49"], [0, 0, 0, "Unexpected any. Specify a different type.", "50"], [0, 0, 0, "Unexpected any. Specify a different type.", "51"], - [0, 0, 0, "Do not use any type assertions.", "52"], - [0, 0, 0, "Do not use any type assertions.", "53"], + [0, 0, 0, "Unexpected any. Specify a different type.", "52"], + [0, 0, 0, "Unexpected any. Specify a different type.", "53"], [0, 0, 0, "Unexpected any. Specify a different type.", "54"], [0, 0, 0, "Unexpected any. Specify a different type.", "55"], [0, 0, 0, "Unexpected any. Specify a different type.", "56"], @@ -6977,10 +6977,7 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "59"], [0, 0, 0, "Unexpected any. Specify a different type.", "60"], [0, 0, 0, "Unexpected any. Specify a different type.", "61"], - [0, 0, 0, "Unexpected any. Specify a different type.", "62"], - [0, 0, 0, "Unexpected any. Specify a different type.", "63"], - [0, 0, 0, "Unexpected any. Specify a different type.", "64"], - [0, 0, 0, "Unexpected any. Specify a different type.", "65"] + [0, 0, 0, "Unexpected any. Specify a different type.", "62"] ], "public/app/plugins/datasource/graphite/datasource_integration.test.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], diff --git a/public/app/plugins/datasource/graphite/datasource.ts b/public/app/plugins/datasource/graphite/datasource.ts index d974a5f3f51..ba3643684f8 100644 --- a/public/app/plugins/datasource/graphite/datasource.ts +++ b/public/app/plugins/datasource/graphite/datasource.ts @@ -17,6 +17,7 @@ import { QueryResultMetaStat, ScopedVars, TimeRange, + TimeZone, toDataFrame, } from '@grafana/data'; import { getBackendSrv } from '@grafana/runtime'; @@ -37,8 +38,8 @@ import { GraphiteMetricLokiMatcher, GraphiteOptions, GraphiteQuery, - GraphiteQueryRequest, GraphiteQueryImportConfiguration, + GraphiteQueryRequest, GraphiteQueryType, GraphiteType, MetricTankRequestMeta, @@ -451,7 +452,7 @@ export class GraphiteDatasource return this.templateSrv.containsTemplate(target.target ?? ''); } - translateTime(date: any, roundUp: any, timezone: any) { + translateTime(date: any, roundUp: any, timezone: TimeZone) { if (isString(date)) { if (date === 'now') { return 'now'; @@ -855,15 +856,24 @@ export class GraphiteDatasource } testDatasource() { - const query = { + const query: DataQueryRequest = { + app: 'graphite', + interval: '10ms', + intervalMs: 10, + requestId: 'reqId', + scopedVars: {}, + startTime: 0, + timezone: 'browser', panelId: 3, rangeRaw: { from: 'now-1h', to: 'now' }, range: { + from: dateTime('now-1h'), + to: dateTime('now'), raw: { from: 'now-1h', to: 'now' }, }, - targets: [{ target: 'constantLine(100)' }], + targets: [{ refId: 'A', target: 'constantLine(100)' }], maxDataPoints: 300, - } as unknown as DataQueryRequest; + }; return lastValueFrom(this.query(query)).then(() => ({ status: 'success', message: 'Data source is working' })); }