diff --git a/README.md b/README.md index df68239..f9ae714 100644 --- a/README.md +++ b/README.md @@ -72,10 +72,51 @@ There is a various way to collect the metric usage, here the complete list of th This collector gets the list of metrics for a defined period of time. This list is then stored in the system waiting to associate them with their usage find by the other collectors. +#### Configuration + +```yaml +metric_collector: + enable: true + prometheus_client: + url: "https://prometheus.demo.do.prometheus.io" +``` + ### Prometheus Rule Collector This collector gets the Prometheus Rules Group using the HTTP API. Then it extracts the metric used in the alert rule or in the recording rule. +#### Configuration + +```yaml +rules_collector: + enable: true + prometheus_client: + url: "https://prometheus.demo.do.prometheus.io" +``` + ### Perses Collector This collector gets the list of dashboards using the HTTP API of Perses. Then it extracts the metric used in the variables and in the different panels. + +#### Configuration + +```yaml +perses_collector: + enable: true + http_client: + url: "https://demo.perses.dev" +``` + +### Grafana Collector + +This collector gets the list of dashboards using the HTTP API of Grafana. Then it extracts the metric used in the different panels. +Extraction from variable still needs to be done. + +#### Configuration + +```yaml +grafana_collector: + enable: true + http_client: + url: "https//demo.grafana.dev" +``` diff --git a/config/collector.go b/config/collector.go index ac6ea50..1ec52c8 100644 --- a/config/collector.go +++ b/config/collector.go @@ -53,7 +53,7 @@ func NewHTTPClient(cfg HTTPClient) (*http.Client, error) { type MetricCollector struct { Enable bool `yaml:"enable"` Period model.Duration `yaml:"period,omitempty"` - PrometheusClient HTTPClient `yaml:"prometheus_client"` + PrometheusClient HTTPClient `yaml:"http_client"` } func (c *MetricCollector) Verify() error { @@ -72,7 +72,7 @@ func (c *MetricCollector) Verify() error { type RulesCollector struct { Enable bool `yaml:"enable"` Period model.Duration `yaml:"period,omitempty"` - PrometheusClient HTTPClient `yaml:"prometheus_client"` + PrometheusClient HTTPClient `yaml:"http_client"` } func (c *RulesCollector) Verify() error { diff --git a/dev/config.yaml b/dev/config.yaml index f2b60d6..2c66013 100644 --- a/dev/config.yaml +++ b/dev/config.yaml @@ -1,11 +1,11 @@ metric_collector: enable: true - prometheus_client: + http_client: url: "https://prometheus.demo.do.prometheus.io" rules_collector: enable: true - prometheus_client: + http_client: url: "https://prometheus.demo.do.prometheus.io" perses_collector: