Skip to content

Commit

Permalink
add short config doc
Browse files Browse the repository at this point in the history
Signed-off-by: Augustin Husson <[email protected]>
  • Loading branch information
Nexucis committed Oct 25, 2024
1 parent 08d5e36 commit 44c6abc
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 4 deletions.
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
```
4 changes: 2 additions & 2 deletions config/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions dev/config.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit 44c6abc

Please sign in to comment.