mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
prometheus: more correct jsonData typescript type (#40559)
* prometheus: fix strict-mode typescript error * it does not make the limit lower but the change is still correct
This commit is contained in:
parent
4a3be0f845
commit
bd8e07d6ed
@ -56,7 +56,7 @@ export class PrometheusDatasource extends DataSourceWithBackend<PromQuery, PromO
|
||||
withCredentials: any;
|
||||
metricsNameCache = new LRU<string, string[]>(10);
|
||||
interval: string;
|
||||
queryTimeout: string;
|
||||
queryTimeout: string | undefined;
|
||||
httpMethod: string;
|
||||
languageProvider: PrometheusLanguageProvider;
|
||||
exemplarTraceIdDestinations: ExemplarTraceIdDestination[] | undefined;
|
||||
@ -80,7 +80,9 @@ export class PrometheusDatasource extends DataSourceWithBackend<PromQuery, PromO
|
||||
this.interval = instanceSettings.jsonData.timeInterval || '15s';
|
||||
this.queryTimeout = instanceSettings.jsonData.queryTimeout;
|
||||
this.httpMethod = instanceSettings.jsonData.httpMethod || 'POST';
|
||||
this.directUrl = instanceSettings.jsonData.directUrl;
|
||||
// `directUrl` is never undefined, we set it at https://github.com/grafana/grafana/blob/main/pkg/api/frontendsettings.go#L108
|
||||
// here we "fall back" to this.url to make typescript happy, but it should never happen
|
||||
this.directUrl = instanceSettings.jsonData.directUrl ?? this.url;
|
||||
this.exemplarTraceIdDestinations = instanceSettings.jsonData.exemplarTraceIdDestinations;
|
||||
this.ruleMappings = {};
|
||||
this.languageProvider = new PrometheusLanguageProvider(this);
|
||||
|
@ -20,10 +20,10 @@ export interface PromQuery extends DataQuery {
|
||||
}
|
||||
|
||||
export interface PromOptions extends DataSourceJsonData {
|
||||
timeInterval: string;
|
||||
queryTimeout: string;
|
||||
httpMethod: string;
|
||||
directUrl: string;
|
||||
timeInterval?: string;
|
||||
queryTimeout?: string;
|
||||
httpMethod?: string;
|
||||
directUrl?: string;
|
||||
customQueryParameters?: string;
|
||||
disableMetricsLookup?: boolean;
|
||||
exemplarTraceIdDestinations?: ExemplarTraceIdDestination[];
|
||||
|
Loading…
Reference in New Issue
Block a user