1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/src/main/start-main-application/on-application-is-ready/implementations/setup-prometheus-registry.injectable.ts
Janne Savolainen 9d193c672f
Reimplement setup for after application is ready using runnables instead of non-OCP in index.ts
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
2022-05-11 08:18:36 +03:00

34 lines
1.3 KiB
TypeScript

/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import { onApplicationIsReadyInjectionToken } from "../on-application-is-ready-injection-token";
import { PrometheusLens } from "../../../prometheus/lens";
import { PrometheusHelm } from "../../../prometheus/helm";
import { PrometheusOperator } from "../../../prometheus/operator";
import { PrometheusStacklight } from "../../../prometheus/stacklight";
import prometheusProviderRegistryInjectable from "../../../prometheus/prometheus-provider-registry.injectable";
const setupPrometheusRegistryInjectable = getInjectable({
id: "setup-prometheus-registry",
instantiate: (di) => {
const prometheusProviderRegistry = di.inject(prometheusProviderRegistryInjectable);
return {
run: () => {
prometheusProviderRegistry
.registerProvider(new PrometheusLens())
.registerProvider(new PrometheusHelm())
.registerProvider(new PrometheusOperator())
.registerProvider(new PrometheusStacklight());
},
};
},
injectionToken: onApplicationIsReadyInjectionToken,
});
export default setupPrometheusRegistryInjectable;