Skip to content

Commit

Permalink
Feat: kdp built-in grafana integration with external prometheus datas…
Browse files Browse the repository at this point in the history
…ource

Signed-off-by: jason.jin <jason@linktime.cloud>
  • Loading branch information
jason-ltc committed May 16, 2024
1 parent 4424181 commit d81cf45
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion infra/plg-stack/parameter.cue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ parameter: {
// +usage=Enable/Disable Prometheus default rules installation
prometheusDefaultRules: enabled: *true | bool
// +usage=Enable/Disable Prometheus/AlertManager installation
prometheus: enabled: *true | bool
prometheus: {
enabled: *true | bool
externalUrl: *"" | string
}
// +usage=Enable/Disable Grafana installation
grafana: enabled: *true | bool
// +usage=Enable/Disable Loki/Prometheus installation
Expand Down
7 changes: 6 additions & 1 deletion infra/plg-stack/resources/prometheus.cue
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,12 @@ _prometheus: {
defaultDatasourceEnabled: true
isDefaultDatasource: true
uid: "prometheus"
url: "http://kps-prometheus:9090/"
if parameter.prometheus.externalUrl != "" {
url: "\(parameter.prometheus.externalUrl)"
}
if parameter.prometheus.externalUrl == "" {
url: "http://prometheus:9090/"
}
label: "grafana_datasource"
labelValue: "1"
alertmanager: {
Expand Down

0 comments on commit d81cf45

Please sign in to comment.