import { ConfigService } from '@nestjs/config';
import { Repository } from 'typeorm';
import { ClusterEntity } from '../../infrastructure/clusters/entities/cluster.entity';
import { GrafanaConfigService } from './grafana-config.service';
/**
 * Service for managing Grafana datasources via HTTP API
 * Automatically adds/removes datasources when clusters are created/deleted
 */
export declare class GrafanaDatasourceService {
    private readonly clusterRepository;
    private readonly configService;
    private readonly grafanaConfigService;
    private readonly logger;
    private grafanaClient;
    constructor(clusterRepository: Repository<ClusterEntity>, configService: ConfigService, grafanaConfigService: GrafanaConfigService);
    /**
     * Add Prometheus datasource to Grafana for a workload cluster
     * Called automatically when a workload cluster becomes READY
     *
     * NOTE: Loki datasource is NOT created per-cluster.
     * A centralized Loki datasource is created once for the observability cluster.
     * All workload clusters send logs to the same Loki instance, filtered by labels.
     */
    addClusterDatasources(cluster: ClusterEntity): Promise<void>;
    /**
     * Remove datasources when cluster is deleted
     * Called automatically before cluster deletion
     */
    removeClusterDatasources(clusterId: string): Promise<void>;
    /**
     * Create Prometheus datasource in Grafana
     * Returns the auto-generated UID
     */
    private createPrometheusDatasource;
    /**
     * Create centralized Loki datasource in Grafana
     * This datasource is shared across all workload clusters
     * Logs are filtered using labels: {cluster_name="...", service="...", etc.}
     */
    createCentralizedLokiDatasource(): Promise<void>;
    private updateDatasource;
    /**
     * Delete datasource by UID
     */
    private deleteDatasource;
    /**
     * Initialize Grafana HTTP client with authentication
     */
    private initializeGrafanaClient;
    /**
     * Test Grafana connectivity
     * Useful for health checks and debugging
     */
    testGrafanaConnection(): Promise<boolean>;
    /**
     * List all datasources in Grafana
     * Useful for debugging and validation
     */
    listDatasources(): Promise<any[]>;
    /**
     * Find datasource UID by name
     * Used when we need to update an existing datasource
     */
    private findDatasourceUidByName;
    /**
     * Save Grafana datasource UIDs to cluster metadata
     * This allows the UIDs to be exposed via API and tracked over time
     */
    private saveGrafanaDatasourceUIDs;
}
