1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

add support for Victoria Metrics Single

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen 2022-01-14 16:43:14 +02:00 committed by Sebastian Malton
parent d31ab690c2
commit ce82f2f2a5
2 changed files with 21 additions and 0 deletions

View File

@ -8,11 +8,13 @@ import { PrometheusHelm } from "../prometheus/helm";
import { PrometheusLens } from "../prometheus/lens";
import { PrometheusOperator } from "../prometheus/operator";
import { PrometheusStacklight } from "../prometheus/stacklight";
import { PrometheusVictoriaMetricsSingle } from "../prometheus/victoria-metrics-single";
export function initPrometheusProviderRegistry() {
PrometheusProviderRegistry
.getInstance()
.registerProvider(new PrometheusLens())
.registerProvider(new PrometheusVictoriaMetricsSingle())
.registerProvider(new PrometheusHelm())
.registerProvider(new PrometheusOperator())
.registerProvider(new PrometheusStacklight());

View File

@ -0,0 +1,19 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { PrometheusLens } from "./lens";
import type { CoreV1Api } from "@kubernetes/client-node";
import type { PrometheusService } from "./provider-registry";
export class PrometheusVictoriaMetricsSingle extends PrometheusLens {
readonly id: string = "victoria-metrics-single";
readonly name: string = "Victoria Metrics (single)";
readonly rateAccuracy: string = "5m";
readonly isConfigurable: boolean = true;
public async getPrometheusService(client: CoreV1Api): Promise<PrometheusService> {
return this.getFirstNamespacedService(client, "app=server,app.kubernetes.io/name=victoria-metrics-single");
}
}