Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
Expand lambda metrics in SFN + APIG + Increase refresh interval (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
Puneeth-n authored Jan 20, 2022
1 parent de5501e commit d2c7ead
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 28 deletions.
4 changes: 3 additions & 1 deletion lib/api_gateways.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from lib.commons import (
ALERT_REF_ID,
ALERT_THRESHOLD,
DEFAULT_REFRESH,
EDITABLE,
SHARED_CROSSHAIR,
TIMEZONE,
Expand Down Expand Up @@ -164,7 +165,7 @@ def generate_api_gateways_dashboard(
lambda_metrics_row = Row(
title="{} Lambda Metrics".format(l),
showTitle=True,
collapse=True,
collapse=False,
panels=[
lambda_generate_invocations_graph(
name, cloudwatch_data_source, notifications=[]
Expand Down Expand Up @@ -199,5 +200,6 @@ def generate_api_gateways_dashboard(
tags=tags,
timezone=TIMEZONE,
sharedCrosshair=SHARED_CROSSHAIR,
refresh=DEFAULT_REFRESH,
rows=rows,
).auto_panel_ids()
1 change: 1 addition & 0 deletions lib/commons.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
TRANSPARENT = True
RAW_QUERY = True
RETENTION_POLICY = "autogen"
DEFAULT_REFRESH = "1m"


def get_documentation_link(url: str):
Expand Down
14 changes: 2 additions & 12 deletions lib/ecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from grafanalib.core import (
Alert,
AlertCondition,
AlertList,
Dashboard,
Graph,
GreaterThan,
Expand All @@ -25,6 +24,7 @@
from lib.commons import (
ALERT_REF_ID,
ALERT_THRESHOLD,
DEFAULT_REFRESH,
EDITABLE,
SHARED_CROSSHAIR,
TIMEZONE,
Expand Down Expand Up @@ -95,17 +95,6 @@ def generate_running_count_stats_panel(
)


# def generate_alert_list_panel(name: str, grid_pos: GridPos):
# return AlertList(
# title="Alerts: {}".format(name),
# gridPos=grid_pos,
# description="Alerts for service {}".format(name),
# transparent=TRANSPARENT,
# onlyAlertsOnDashboard=True,
# show=True
# )


def generate_cpu_utilization_graph(
name: str,
cloudwatch_data_source: str,
Expand Down Expand Up @@ -793,4 +782,5 @@ def generate_ecs_alb_service_dashboard(
timezone=TIMEZONE,
sharedCrosshair=SHARED_CROSSHAIR,
panels=panels,
refresh=DEFAULT_REFRESH,
).auto_panel_ids()
6 changes: 2 additions & 4 deletions lib/elasticache_redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,13 @@
Dashboard,
LowerThan,
Graph,
GreaterThan,
MILLISECONDS_FORMAT,
OP_OR,
PERCENT_FORMAT,
Repeat,
Row,
RTYPE_MAX,
SHORT_FORMAT,
Target,
Template,
Templating,
TimeRange,
single_y_axis,
YAxes,
Expand All @@ -33,6 +29,7 @@
from lib import colors
from lib.commons import (
ALERT_REF_ID,
DEFAULT_REFRESH,
EDITABLE,
SHARED_CROSSHAIR,
TIMEZONE,
Expand Down Expand Up @@ -626,4 +623,5 @@ def generate_elasticache_redis_dashboard(
sharedCrosshair=SHARED_CROSSHAIR,
rows=rows,
links=[DOCUMENTATION_LINK],
refresh=DEFAULT_REFRESH,
).auto_panel_ids()
7 changes: 2 additions & 5 deletions lib/elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@
GreaterThan,
OP_OR,
PERCENT_FORMAT,
Repeat,
Row,
RTYPE_MAX,
SHORT_FORMAT,
Target,
Template,
Templating,
TimeRange,
single_y_axis,
YAxes,
Expand All @@ -32,9 +29,8 @@
from lib import colors
from lib.commons import (
ALERT_REF_ID,
DEFAULT_REFRESH,
EDITABLE,
RAW_QUERY,
RETENTION_POLICY,
SHARED_CROSSHAIR,
TIMEZONE,
TRANSPARENT,
Expand Down Expand Up @@ -727,4 +723,5 @@ def generate_elasticsearch_dashboard(
sharedCrosshair=SHARED_CROSSHAIR,
rows=rows,
links=[DOCUMENTATION_LINK],
refresh=DEFAULT_REFRESH,
).auto_panel_ids()
2 changes: 2 additions & 0 deletions lib/lambdas.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from lib.commons import (
ALERT_REF_ID,
ALERT_THRESHOLD,
DEFAULT_REFRESH,
EDITABLE,
SHARED_CROSSHAIR,
TIMEZONE,
Expand Down Expand Up @@ -710,4 +711,5 @@ def lambda_sns_sqs_dashboard(
panels=[dead_letter_sqs_graph],
),
],
refresh=DEFAULT_REFRESH,
).auto_panel_ids()
6 changes: 2 additions & 4 deletions lib/rds.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
TimeRange,
Row,
Target,
YAxes,
YAxis,
)
from grafanalib.formatunits import BYTES, BYTES_SEC, SECONDS
from grafanalib.cloudwatch import CloudwatchMetricsTarget
Expand All @@ -28,11 +26,10 @@
from lib.annotations import get_release_annotations
from lib.commons import (
ALERT_REF_ID,
DEFAULT_REFRESH,
EDITABLE,
get_documentation_link,
get_series_overrides,
RAW_QUERY,
RETENTION_POLICY,
SHARED_CROSSHAIR,
TIMEZONE,
TRANSPARENT,
Expand Down Expand Up @@ -562,4 +559,5 @@ def generate_rds_dashboard(
"https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/MonitoringOverview.html"
)
],
refresh=DEFAULT_REFRESH,
).auto_panel_ids()
5 changes: 3 additions & 2 deletions lib/step_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
)
from grafanalib.cloudwatch import CloudwatchMetricsTarget

from lib.annotations import get_release_annotations
from lib.commons import (
ALERT_THRESHOLD,
DEFAULT_REFRESH,
EDITABLE,
SHARED_CROSSHAIR,
TIMEZONE,
Expand Down Expand Up @@ -315,7 +315,7 @@ def generate_sfn_dashboard(
lambda_metrics_row = Row(
title="{} Lambda Metrics".format(l),
showTitle=True,
collapse=True,
collapse=False,
panels=[
lambda_generate_invocations_graph(
l, cloudwatch_data_source, notifications=[]
Expand Down Expand Up @@ -351,4 +351,5 @@ def generate_sfn_dashboard(
timezone=TIMEZONE,
sharedCrosshair=SHARED_CROSSHAIR,
rows=rows,
refresh=DEFAULT_REFRESH,
).auto_panel_ids()

0 comments on commit d2c7ead

Please sign in to comment.