Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bump grafonnet-lib version #170

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion terraform/monitoring/grafonnet-lib
Submodule grafonnet-lib updated 60 files
+5 −0 .editorconfig
+21 −0 LICENSE
+12 −6 alert.libsonnet
+34 −8 alert_condition.libsonnet
+3 −1 defaults.libsonnet
+53 −95 defaults/alerts.libsonnet
+13 −56 defaults/configuration.libsonnet
+30 −47 defaults/overrides.libsonnet
+35 −0 defaults/panels.libsonnet
+29 −0 defaults/panels/aws/amqp/available_messages.libsonnet
+66 −0 defaults/panels/aws/amqp/cpu.libsonnet
+31 −0 defaults/panels/aws/amqp/in_flight_messages.libsonnet
+30 −0 defaults/panels/aws/amqp/memory.libsonnet
+41 −0 defaults/panels/aws/amqp/storage.libsonnet
+90 −0 defaults/panels/aws/docdb/available_memory.libsonnet
+35 −0 defaults/panels/aws/docdb/buffer_cache_hit_ratio.libsonnet
+31 −0 defaults/panels/aws/docdb/connections.libsonnet
+114 −0 defaults/panels/aws/docdb/cpu.libsonnet
+68 −0 defaults/panels/aws/docdb/low_mem_op_throttled.libsonnet
+28 −0 defaults/panels/aws/docdb/net_throughput.libsonnet
+36 −0 defaults/panels/aws/docdb/volume.libsonnet
+40 −0 defaults/panels/aws/docdb/write_latency.libsonnet
+78 −0 defaults/panels/aws/ecs/cpu.libsonnet
+118 −0 defaults/panels/aws/ecs/cpu_memory.libsonnet
+78 −0 defaults/panels/aws/ecs/memory.libsonnet
+60 −0 defaults/panels/aws/redis/cpu.libsonnet
+47 −0 defaults/panels/aws/redis/memory.libsonnet
+80 −0 defaults/panels/aws/redis/swap_usage.libsonnet
+42 −32 defaults/values.libsonnet
+240 −105 field_config.libsonnet
+41 −37 grafana.libsonnet
+19 −0 override.libsonnet
+26 −23 panels/panel.libsonnet
+161 −212 panels/timeseries.libsonnet
+629 −18 targets/cloudwatch.libsonnet
+27 −0 tests/defaults/alerts.jsonnet
+6 −0 tests/defaults/configuration.jsonnet
+11 −0 tests/defaults/panels/docdb/available_memory.jsonnet
+8 −0 tests/defaults/panels/docdb/buffer_cache_hit_ratio.jsonnet
+8 −0 tests/defaults/panels/docdb/connections.jsonnet
+11 −0 tests/defaults/panels/docdb/cpu.jsonnet
+11 −0 tests/defaults/panels/docdb/low_mem_op_throttled.jsonnet
+8 −0 tests/defaults/panels/docdb/net_throughput.jsonnet
+8 −0 tests/defaults/panels/docdb/volume.jsonnet
+8 −0 tests/defaults/panels/docdb/write_latency.jsonnet
+11 −0 tests/defaults/panels/ecs/cpu.jsonnet
+11 −0 tests/defaults/panels/ecs/cpu_memory.jsonnet
+11 −0 tests/defaults/panels/ecs/memory.jsonnet
+11 −0 tests/defaults/panels/redis/cpu.jsonnet
+11 −0 tests/defaults/panels/redis/memory.jsonnet
+11 −0 tests/defaults/panels/redis/swap_usage.jsonnet
+37 −0 tests/field_config.jsonnet
+43 −0 tests/panels/timeseries.jsonnet
+36 −0 tests/utils/arrays.jsonnet
+27 −0 tests/utils/strings.jsonnet
+64 −0 tests/utils/units.jsonnet
+6 −0 threshold.libsonnet
+14 −0 utils/arrays.libsonnet
+13 −13 utils/strings.libsonnet
+64 −17 utils/units.libsonnet
3 changes: 1 addition & 2 deletions terraform/monitoring/panels/app/app_metric.libsonnet
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
local grafana = import '../../grafonnet-lib/grafana.libsonnet';
local defaults = import '../../grafonnet-lib/defaults.libsonnet';
local panels = grafana.panels;
local targets = grafana.targets;

local defaults = import '../defaults.libsonnet';

{
new(ds, vars, title, metric_name, metric_label)::
panels.timeseries(
Expand Down
6 changes: 0 additions & 6 deletions terraform/monitoring/panels/defaults.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,5 @@ local grafana = import '../grafonnet-lib/grafana.libsonnet';
color : 'red',
value : 50
}),

timeseries_tr80:: self.timeseries
.addThreshold({
color : 'red',
value : 80
}),
},
}
5 changes: 4 additions & 1 deletion terraform/monitoring/panels/docdb/available_memory.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ local mem_alert(vars) = alert.new(
value = mem_threshold,
)

.setAlert(mem_alert(vars))
.setAlert(
vars.environment,
mem_alert(vars)
)

.addTarget(targets.cloudwatch(
refId = 'Mem_Min',
Expand Down
7 changes: 5 additions & 2 deletions terraform/monitoring/panels/docdb/cpu.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ local cpu_alert(vars) = alert.new(
title = 'CPU Utilization',
datasource = ds.cloudwatch,
)
.configure(defaults.configuration.timeseries_resource)
.setAlert(cpu_alert(vars))
.configure(defaults.configuration.timeseries)
.setAlert(
vars.environment,
cpu_alert(vars)
)

.addTarget(targets.cloudwatch(
refId = 'CPU_Max',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ local ops_alert(vars) = alert.new(
)
.configure(_configuration)

.setAlert(ops_alert(vars))
.setAlert(
vars.environment,
ops_alert(vars)
)

.addTarget(targets.cloudwatch(
alias = 'LowMem Num Operations Throttled (Max)',
Expand Down
17 changes: 10 additions & 7 deletions terraform/monitoring/panels/ecs/cpu.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ local overrides = defaults.overrides;
title = 'CPU Utilization',
datasource = ds.cloudwatch,
)
.configure(overrides.cpu(defaults.configuration.timeseries_resource))
.setAlert(defaults.alerts.cpu(
namespace = vars.namespace,
title = 'ECS',
env = vars.environment,
notifications = vars.notifications,
))
.configure(overrides.cpu(defaults.configuration.timeseries))
.setAlert(
vars.environment,
defaults.alerts.cpu(
namespace = vars.namespace,
title = 'ECS',
env = vars.environment,
notifications = vars.notifications,
)
)

.addTarget(targets.cloudwatch(
alias = 'CPU (Max)',
Expand Down
17 changes: 10 additions & 7 deletions terraform/monitoring/panels/ecs/memory.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@ local targets = grafana.targets;
title = 'Memory Utilization',
datasource = ds.cloudwatch,
)
.configure(defaults.overrides.memory(defaults.configuration.timeseries_resource))
.configure(defaults.overrides.memory(defaults.configuration.timeseries))

.setAlert(defaults.alerts.memory(
namespace = vars.namespace,
title = 'ECS',
env = vars.environment,
notifications = vars.notifications,
))
.setAlert(
vars.environment,
defaults.alerts.memory(
namespace = vars.namespace,
title = 'ECS',
env = vars.environment,
notifications = vars.notifications,
)
)

.addTarget(targets.cloudwatch(
alias = 'Memory (Max)',
Expand Down
4 changes: 2 additions & 2 deletions terraform/monitoring/panels/lb/error_4xx.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ local _configuration = defaults.configuration.timeseries
axisSoftMin = 0,
axisSoftMax = threshold * 1.2,
)
.withThresholdStyle(grafana.fieldConfig.thresholdStyle.dashed)
.withThresholdStyle(grafana.fieldConfig.thresholdStyle.Dashed)
.addThreshold({
color : defaults.values.colors.critical,
value : threshold,
Expand All @@ -29,7 +29,7 @@ local _configuration = defaults.configuration.timeseries
axisSoftMin = 0,
axisSoftMax = threshold * 1.2,
)
.withThresholdStyle(grafana.fieldConfig.thresholdStyle.dashed)
.withThresholdStyle(grafana.fieldConfig.thresholdStyle.Dashed)
.addThreshold({
color : defaults.values.colors.critical,
value : threshold,
Expand Down
3 changes: 2 additions & 1 deletion terraform/monitoring/panels/lb/error_5xx.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ local _configuration = defaults.configuration.timeseries
axisSoftMin = 0,
axisSoftMax = threshold * 1.2,
)
.withThresholdStyle(grafana.fieldConfig.thresholdStyle.dashed)
.withThresholdStyle(grafana.fieldConfig.thresholdStyle.Dashed)
.addThreshold({
color : defaults.values.colors.critical,
value : threshold,
Expand All @@ -30,6 +30,7 @@ local _configuration = defaults.configuration.timeseries
)

.setAlert(
vars.environment,
grafana.alert.new(
namespace = vars.namespace,
name = "%(env)s - 5XX alert" % { env: grafana.utils.strings.capitalize(vars.environment) },
Expand Down
2 changes: 1 addition & 1 deletion terraform/monitoring/panels/lb/healthy_hosts.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ local _configuration = defaults.configuration.timeseries

.addTarget(targets.cloudwatch(
datasource = ds.cloudwatch,
metricQueryType = grafana.target.cloudwatch.metricQueryTypes.query,
metricQueryType = grafana.target.cloudwatch.queryTypes.Query,

dimensions = {
TargetGroup: vars.target_group
Expand Down
Loading