-
Notifications
You must be signed in to change notification settings - Fork 7
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]>
- Loading branch information
Showing
35 changed files
with
6,347 additions
and
1,102 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
40 changes: 40 additions & 0 deletions
40
kubernetes/common/alloy/configs/kubernetes/logs/rules-to-loki.alloy
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,40 @@ | ||
/* | ||
Module Components: rules_to_loki | ||
Description: Auto discovers PrometheusRule Kubernetes resources and loads them into a Loki instance. | ||
*/ | ||
|
||
declare "rules_to_loki" { | ||
|
||
/***************************************************************** | ||
* ARGUMENTS | ||
*****************************************************************/ | ||
argument "address" { | ||
comment = "URL of the Loki ruler. (default: http://nginx.gateway.svc:3100)" | ||
optional = true | ||
} | ||
|
||
argument "tenant" { | ||
comment = "Mimir tenant ID. (default: fake)" | ||
optional = true | ||
} | ||
|
||
/******************************************** | ||
* Kubernetes Prometheus Rules To Loki | ||
********************************************/ | ||
loki.rules.kubernetes "rules_to_loki" { | ||
address = coalesce(argument.address.value, "http://nginx.gateway.svc:3100") | ||
tenant_id = coalesce(argument.tenant.value, "anonymous") | ||
|
||
// rule_namespace_selector { | ||
// match_labels = { | ||
// auto_rules_to_loki= "true", | ||
// } | ||
// } | ||
|
||
rule_selector { | ||
match_labels = { | ||
auto_rules_to_loki = "true", | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.