forked from qclaogui/codelab-monitoring
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmetrics.alloy
43 lines (36 loc) · 1.32 KB
/
metrics.alloy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
logging {
level = coalesce(env("ALLOY_LOG_LEVEL"), "info")
format = "logfmt"
}
/********************************************
* Grafana LGTMP Stack Receiver Provider
********************************************/
import.git "provider" {
repository = "https://github.com/qclaogui/codelab-monitoring.git"
revision = "main"
path = "alloy-modules/provider"
pull_frequency = "24h"
}
provider.self_hosted_stack "kubernetes" {
metrics_endpoint_url = coalesce(env("SELF_HOSTED_METRICS_ENDPOINT_URL"), "http://nginx.gateway.svc:8080/api/v1/push")
}
/********************************************
* Metrics
********************************************/
import.file "metrics" {
filename = coalesce(env("ALLOY_MODULES_FOLDER"), "/etc/alloy/modules") + "/kubernetes/metrics"
}
metrics.integrations_scrape "kubernetes" {
forward_to = [provider.self_hosted_stack.kubernetes.metrics_receiver]
}
metrics.podmonitors_scrape "kubernetes" {
forward_to = [provider.self_hosted_stack.kubernetes.metrics_receiver]
}
metrics.servicemonitors_scrape "kubernetes" {
forward_to = [provider.self_hosted_stack.kubernetes.metrics_receiver]
}
// metrics.annotations_scrape "kubernetes" {
// label_prefix = "metrics.grafana.com"
// forward_to = [provider.self_hosted_stack.kubernetes.metrics_receiver]
// scrape_interval = "15s"
// }