[release-12.0.3] Graphite: Fix annotation queries (#106941)

Graphite: Fix annotation queries (#106553)

* Add refid to annotation queries

* Fix errors

(cherry picked from commit 6e45069cdd)

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
This commit is contained in:
grafana-delivery-bot[bot] 2025-06-18 18:30:31 +01:00 committed by GitHub
parent c0bf61f5e7
commit e0b1e649b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 2 deletions

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}`);
});
})
);
}