Graphite: Fix annotation queries (#106553)

* Add refid to annotation queries

* Fix errors
This commit is contained in:
Andreas Christou
2025-06-18 17:03:25 +02:00
committed by GitHub
parent 4020a3d96a
commit 6e45069cdd

View File

@ -410,7 +410,7 @@ export class GraphiteDatasource
const targetAnnotation = this.templateSrv.replace(target.target, {}, 'glob');
const graphiteQuery = {
range: range,
targets: [{ target: targetAnnotation }],
targets: [{ target: targetAnnotation, refId: target.refId }],
format: 'json',
maxDataPoints: 100,
} as unknown as DataQueryRequest<GraphiteQuery>;
@ -979,7 +979,10 @@ export class GraphiteDatasource
.fetch(options)
.pipe(
catchError((err) => {
return throwError(reduceError(err));
return throwError(() => {
const reduced = reduceError(err);
return new Error(`${reduced.data.message}`);
});
})
);
}