Fix manually set prometheus service address to work after re-connect

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
Lauri Nevala committed 2022-10-20 10:21:38 +03:00
1 parent 024c5ee52c
commit a7ce4aebae
1 file changed
+2 -1
+2 -1
View File
@@ -53,7 +53,6 @@ export class ContextHandler implements ClusterContextHandler {
constructor(private dependencies: Dependencies, protected cluster: Cluster) {
this.clusterUrl = url.parse(cluster.apiUrl);
this.setupPrometheus(cluster.preferences);
}
public setupPrometheus(preferences: ClusterPrometheusPreferences = {}) {
@@ -94,6 +93,8 @@ export class ContextHandler implements ClusterContextHandler {
}
protected async getPrometheusService(): Promise<PrometheusService> {
this.setupPrometheus(this.cluster.preferences);
if (this.prometheus && this.prometheusProvider) {
return {
id: this.prometheusProvider,