package com.octadata.integrations.metrics.datadog

import com.octaldata.domain.integrations.IntegrationConfig
import com.octaldata.domain.integrations.configSecretResolver
import com.octaldata.integrations.metrics.IntegrationProvider
import io.micrometer.core.instrument.Clock
import io.micrometer.core.instrument.MeterRegistry
import io.micrometer.datadog.DatadogConfig
import io.micrometer.datadog.DatadogMeterRegistry

class GrafanaIntegrationProvider(private val config: IntegrationConfig.Grafana) : IntegrationProvider {
   override fun registry(): MeterRegistry = DatadogMeterRegistry(object : DatadogConfig {
      override fun get(key: String): String? = null
      override fun apiKey(): String = configSecretResolver(config.apiKey)
   }, Clock.SYSTEM)
}