-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Migrate to new Grafonnet lib (#15)
* feat: Migrate to new Graffonet lib * feat: progress * feat: progress * feat: progress * style: Lint and fix
- Loading branch information
1 parent
b3e389d
commit fbe228a
Showing
15 changed files
with
2,700 additions
and
2,250 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
--- | ||
exclusions: | ||
template-job-rule: | ||
panel-job-instance-rule: | ||
target-rate-interval-rule: | ||
template-job-rule: | ||
reason: Jobs are not set to multi in our case. | ||
template-instance-rule: | ||
reason: We don't use instances. | ||
panel-datasource-rule: | ||
reason: Using a datasource for each panel. | ||
panel-title-description-rule: | ||
reason: TODO(adinhodovic) | ||
target-instance-rule: |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,55 @@ | ||
local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; | ||
local annotation = g.dashboard.annotation; | ||
|
||
{ | ||
_config+:: { | ||
// Bypasses grafana.com/dashboards validator | ||
bypassDashboardValidation: { | ||
__inputs: [], | ||
__requires: [], | ||
}, | ||
|
||
// Selectors are inserted between {} in Prometheus queries. | ||
ingressNginxSelector: 'job="ingress-nginx-controller-metrics"', | ||
ingressNginxSelector: 'job=~"ingress-nginx-controller-metrics"', | ||
|
||
grafanaUrl: 'https://grafana.com', | ||
overviewDashboardUid: 'ingress-nginx-overview-12mk4klgjweg', | ||
dashboardLabelQueryParams: 'var-exported_namespace={{ $labels.exported_namespace }}&var-ingress={{ $labels.ingress }}', | ||
dashboardUrl: '%s/d/%s/nginx-ingress-controller?%s' % [self.grafanaUrl, self.overviewDashboardUid, self.dashboardLabelQueryParams], | ||
requestHandlingPerformanceDashboardUid: 'ingress-nginx-request-jqkwfdqwd', | ||
tags: ['nginx', 'ingress-nginx'], | ||
|
||
overviewDashboardUid: 'ingress-nginx-overview-12mk', | ||
requestHandlingPerformanceDashboardUid: 'ingress-nginx-request-handling-jqkw', | ||
|
||
overviewDashboardUrl: '%s/d/%s/ingress-nginx-overview' % [self.grafanaUrl, self.overviewDashboardUid], | ||
requestHandlingPerformanceDashboardUrl: '%s/d/%s/fix tis' % [ | ||
self.grafanaUrl, | ||
self.requestHandlingPerformanceDashboardUid, | ||
], // TODO: fix this | ||
|
||
tags: ['ingress-nginx', 'ingress-nginx-mixin'], | ||
|
||
ignoredIngresses: '', | ||
ingressNginx4xxSeverity: 'info', | ||
ingressNginx4xxInterval: '5m', | ||
ingressNginx4xxThreshold: '5', // percent | ||
ingressNginx5xxSeverity: 'warning', | ||
ingressNginx5xxInterval: '5m', | ||
ingressNginx5xxThreshold: '5', // percent | ||
|
||
// Custom annotations to display in graphs | ||
annotation: { | ||
enabled: false, | ||
name: 'Custom Annotation', | ||
datasource: '-- Grafana --', | ||
iconColor: 'green', | ||
tags: [], | ||
}, | ||
|
||
customAnnotation:: if $._config.annotation.enabled then | ||
annotation.withName($._config.annotation.name) + | ||
annotation.withIconColor($._config.annotation.iconColor) + | ||
annotation.withHide(false) + | ||
annotation.datasource.withUid($._config.annotation.datasource) + | ||
annotation.target.withMatchAny(true) + | ||
annotation.target.withTags($._config.annotation.tags) + | ||
annotation.target.withType('tags') | ||
else {}, | ||
}, | ||
} |
Oops, something went wrong.