-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Weifeng Wang <[email protected]> Agent integrations module Signed-off-by: Weifeng Wang <[email protected]> agent set clustering = true Signed-off-by: Weifeng Wang <[email protected]>
- Loading branch information
Showing
12 changed files
with
147 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
docker-compose/common/config/agent-flow/modules/docker/metrics/jobs/integrations.river
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
Module: integration-job | ||
Description: Wrapper module to include all Docker containers metric modules | ||
*/ | ||
argument "forward_to" { | ||
comment = "Must be a list(MetricssReceiver) where collected metrics should be forwarded to" | ||
} | ||
|
||
argument "scrape_interval" { | ||
comment = "How often to scrape metrics from the targets (default: 60s)" | ||
optional = true | ||
} | ||
|
||
argument "scrape_timeout" { | ||
comment = "How long before a scrape times out (default: 10s)" | ||
optional = true | ||
} | ||
|
||
/******************************************** | ||
* Integrations Node Exporter | ||
********************************************/ | ||
prometheus.exporter.unix "peu_unix" { | ||
set_collectors = ["cpu"] | ||
disable_collectors = ["diskstats", "mdadm", "textfile", "hwmon"] | ||
} | ||
|
||
/******************************************** | ||
* Prometheus Scrape Integrations Targets | ||
********************************************/ | ||
prometheus.scrape "ps_integrations" { | ||
targets = concat( | ||
prometheus.exporter.unix.peu_unix.targets, | ||
) | ||
|
||
enable_protobuf_negotiation = true | ||
scrape_classic_histograms = true | ||
|
||
scrape_interval = coalesce(argument.scrape_interval.value, "60s") | ||
scrape_timeout = coalesce(argument.scrape_timeout.value, "10s") | ||
|
||
clustering { | ||
enabled = true | ||
} | ||
|
||
forward_to = [prometheus.relabel.pr_integrations.receiver] | ||
} | ||
|
||
/******************************************** | ||
* Prometheus Metric Relabelings (post-scrape) | ||
********************************************/ | ||
prometheus.relabel "pr_integrations" { | ||
forward_to = argument.forward_to.value | ||
|
||
rule { | ||
source_labels = ["job"] | ||
regex = "integrations/(.*)" | ||
target_label = "pod" | ||
replacement = "${1}" | ||
} | ||
|
||
rule { | ||
source_labels = ["job"] | ||
regex = "integrations/(.*)" | ||
target_label = "container" | ||
replacement = "${1}" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.