Skip to content

Commit

Permalink
Allow config overwrite, and make grafanaDashboards and prometheusAler…
Browse files Browse the repository at this point in the history
…ts hidden
  • Loading branch information
gaantunes committed May 27, 2024
1 parent 6ef896d commit a1eea90
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion operations/alloy-mixin/alerts.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ local openTelemetryAlerts = (import './alerts/opentelemetry.libsonnet');
openTelemetryAlerts.newOpenTelemetryAlertsGroup($._config.enableK8sCluster)
],

prometheusAlerts+: {
prometheusAlerts+:: {
groups+:
if $._config.enableAlloyCluster then
alloyClusterAlerts + otherAlerts
Expand Down
28 changes: 15 additions & 13 deletions operations/alloy-mixin/dashboards.libsonnet
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
local alloyClusterDashboards =
(import './dashboards/cluster-node.libsonnet') +
(import './dashboards/cluster-overview.libsonnet') +
(import './config.libsonnet');
(import './dashboards/alloy-logs.libsonnet') +
{
local alloyClusterDashboards =
(import './dashboards/cluster-node.libsonnet') +
(import './dashboards/cluster-overview.libsonnet') +
config,

local otherDashboards =
(import './dashboards/resources.libsonnet') +
(import './dashboards/controller.libsonnet') +
(import './dashboards/prometheus.libsonnet') +
(import './dashboards/opentelemetry.libsonnet') +
(import './config.libsonnet');
local otherDashboards =
(import './dashboards/resources.libsonnet') +
(import './dashboards/controller.libsonnet') +
(import './dashboards/prometheus.libsonnet') +
(import './dashboards/opentelemetry.libsonnet') +
config,

(import './dashboards/alloy-logs.libsonnet') +
{
grafanaDashboards+:
local config = {_config:: $._config},

grafanaDashboards+::
if $._config.enableAlloyCluster then
alloyClusterDashboards +
otherDashboards
Expand Down

0 comments on commit a1eea90

Please sign in to comment.