File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
src/pybind/mgr/dashboard/frontend/src/app/shared/api Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -154,10 +154,16 @@ export class PrometheusService {
154154 }
155155
156156 getGaugeQueryData ( query : string ) : Observable < PromqlGuageMetric > {
157- return this . getPrometheusQueryData ( { params : query } ) . pipe (
158- map ( ( result : PromqlGuageMetric ) => result ) ,
159- catchError ( ( ) => of ( { result : [ ] } as PromqlGuageMetric ) )
160- ) ;
157+ let result$ : Observable < PromqlGuageMetric > = of ( { result : [ ] } as PromqlGuageMetric ) ;
158+
159+ this . ifPrometheusConfigured ( ( ) => {
160+ result$ = this . getPrometheusQueryData ( { params : query } ) . pipe (
161+ map ( ( result : PromqlGuageMetric ) => result ) ,
162+ catchError ( ( ) => of ( { result : [ ] } as PromqlGuageMetric ) )
163+ ) ;
164+ } ) ;
165+
166+ return result$ ;
161167 }
162168
163169 formatGuageMetric ( data : string ) : number {
You can’t perform that action at this time.
0 commit comments