UNPKG

@stolostron/multicluster-sdk

Version:

Provides extensions and APIs that dynamic plugins can use to leverage multicluster capabilities provided by Red Hat Advanced Cluster Management.

43 lines 1.7 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.useIsFleetObservabilityInstalled = useIsFleetObservabilityInstalled; /* Copyright Contributors to the Open Cluster Management project */ const useHubConfigurationItem_1 = require("../internal/useHubConfigurationItem"); /** * Hook that determines if the Observability service has been installed on the hub * * @returns A tuple containing: * - `response`: Boolean indicating whether the Observability service has been installed * - `loaded`: Boolean indicating if the request has completed (successfully or with error) * - `error`: Any error that occurred during the request, including dependency check failures * * @example * ```typescript * // Check if the Observability service has been installed * const [response, loaded, error] = useIsFleetObservabilityInstalled() * if (!loaded) { * return <Loading /> * } * if (error) { * return <ErrorState error={error} /> * } * if (!loaded) { * return <Loading /> * } * * if (error) { * return <ErrorState error={error} /> * } * ``` * * @remarks * This hook * - is used by the useFleetPrometheusPoll() hook to determine if metrics can be retrieved from clusters outside of the hub cluster. * - see RHACM documentation for how to enable observability * https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/2.14/html/observability/observing-environments-intro#enabling-observability-service * */ function useIsFleetObservabilityInstalled() { return (0, useHubConfigurationItem_1.useHubConfigurationItem)('isObservabilityInstalled'); } //# sourceMappingURL=useIsFleetObservabilityInstalled.js.map