import { configApiRef , createApiFactory , createComponentExtension , createPlugin , createRoutableExtension , createRouteRef , discoveryApiRef , } from '@backstage/core-plugin-api' ; import { PrometheusApi , prometheusApiRef } from './api' ; export const rootRouteRef = createRouteRef ( { id : 'backstage-plugin-prometheus' , } ) ; export const backstagePluginPrometheusPlugin = createPlugin ( { id : 'backstage-plugin-prometheus' , apis : [ createApiFactory ( { api : prometheusApiRef , deps : { discoveryApi : discoveryApiRef , configApi : configApiRef } , factory : ( { discoveryApi , configApi } ) => new PrometheusApi ( { discoveryApi , configApi } ) , } ) , ] , routes : { root : rootRouteRef , } , } ) ; export const EntityPrometheusContent = backstagePluginPrometheusPlugin . provide ( createRoutableExtension ( { name : 'EntityPrometheusContent' , component : ( ) => import ( './components/PrometheusContentWrapper' ) . then ( m => m . default ) , mountPoint : rootRouteRef , } ) ) ; export const EntityPrometheusAlertCard = backstagePluginPrometheusPlugin . provide ( createComponentExtension ( { name : 'EntityPrometheusAlertCard' , component : { lazy : ( ) => import ( './components/PrometheusAlertStatus' ) . then ( m => m . PrometheusAlertEntityWrapper ) , } , } ) ) ; export const EntityPrometheusGraphCard = backstagePluginPrometheusPlugin . provide ( createComponentExtension ( { name : 'EntityPrometheusGraphCard' , component : { lazy : ( ) => import ( './components/PrometheusGraph' ) . then ( m => m . PrometheusGraphEntityWrapper ) , } , } ) ) ;