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: CI #208

Merged
merged 1 commit into from
Jun 27, 2023
Merged

fix: CI #208

merged 1 commit into from
Jun 27, 2023

Conversation

chris13524
Copy link
Member

Description

ecr_app_version variable was recently introduced in #197, but I didn't account for CI which doesn't set this variable.

This PR adds a default value for this variable which matches the expected behavior before.

How Has This Been Tested?

Not tested

Due Diligence

  • Breaking change
  • Requires a documentation update
  • Requires a e2e/integration test update

@chris13524 chris13524 requested review from arein and Rakowskiii June 27, 2023 14:34
@github-actions
Copy link
Contributor

No linked issues found. Please add the corresponding issues in the pull request description.
Use GitHub automation to close the issue when a PR is merged

@arein arein added the accepted The issue has been accepted into the project label Jun 27, 2023
@github-actions
Copy link
Contributor

Show Plan

terraform
data.assert_test.workspace: Reading...
data.assert_test.workspace: Read complete after 0s
module.monitoring.grafana_data_source.cloudwatch: Refreshing state... [id=55]
module.dns.aws_acm_certificate.domain_certificate: Refreshing state... [id=arn:aws:acm:eu-central-1:898587786287:certificate/b0653f13-6cc0-4285-9977-f3921aff8ab4]
module.backup_dns.data.aws_route53_zone.hosted_zone: Reading...
module.dns.data.aws_route53_zone.hosted_zone: Reading...
aws_kms_key.analytics_bucket: Refreshing state... [id=6bfc377d-7703-430c-ab6f-ccdc2c595e8d]
aws_prometheus_workspace.prometheus: Refreshing state... [id=ws-bbafeb15-8e6b-4c49-a272-7b9f5b454692]
data.aws_ecr_repository.repository: Reading...
aws_s3_bucket.analytics-data-lake_bucket: Refreshing state... [id=walletconnect.rpc-proxy.staging.analytics.data-lake]
module.ecs.aws_cloudwatch_log_group.cluster_logs: Refreshing state... [id=staging_rpc-proxy_logs]
module.ecs.aws_iam_policy.geoip_bucket_access: Refreshing state... [id=arn:aws:iam::898587786287:policy/staging_rpc-proxy_geoip_bucket_access]
module.ecs.data.aws_vpc.vpc: Reading...
module.ecs.data.aws_iam_policy_document.assume_role_policy: Reading...
module.ecs.data.aws_iam_policy_document.assume_role_policy: Read complete after 0s [id=320642683]
module.backup_dns.aws_acm_certificate.domain_certificate: Refreshing state... [id=arn:aws:acm:eu-central-1:898587786287:certificate/01db5774-a887-4ef5-bd91-ba53f7d482f5]
module.backup_dns.data.aws_route53_zone.hosted_zone: Read complete after 1s [id=Z025697917GKV1T3MTR7I]
module.ecs.data.aws_ecr_image.service_image: Reading...
module.logging.aws_s3_bucket.logging_bucket: Refreshing state... [id=walletconnect.rpc-proxy.staging.access-logs]
module.dns.data.aws_route53_zone.hosted_zone: Read complete after 1s [id=Z09669243E0Q6ZCWCIW2U]
module.ecs.aws_iam_role.ecs_task_execution_role: Refreshing state... [id=staging_rpc-proxy_ecs_task_execution_role]
module.ecs.aws_ecs_cluster.app_cluster: Refreshing state... [id=arn:aws:ecs:eu-central-1:898587786287:cluster/staging_rpc-proxy_cluster]
aws_kms_alias.analytics_bucket: Refreshing state... [id=alias/analytics/rpc-proxy/staging]
module.ecs.data.aws_ecr_image.service_image: Read complete after 0s [id=sha256:fabdcf76bd69802b22e0a49b2ff7a9ed254c697dd5f55c762464aef013359af7]
module.redis.data.aws_vpc.vpc: Reading...
module.dns.aws_route53_record.cert_verification[0]: Refreshing state... [id=Z09669243E0Q6ZCWCIW2U__4298f596ebd4d4df199cb24cba8db7f8.staging.rpc.walletconnect.com._CNAME]
module.ecs.aws_iam_role_policy_attachment.ecs_task_execution_role_policy: Refreshing state... [id=staging_rpc-proxy_ecs_task_execution_role-20230531132946444300000003]
module.ecs.aws_iam_role_policy_attachment.prometheus_write_policy: Refreshing state... [id=staging_rpc-proxy_ecs_task_execution_role-20230531132946808400000005]
module.ecs.aws_iam_role_policy_attachment.cloudwatch_write_policy: Refreshing state... [id=staging_rpc-proxy_ecs_task_execution_role-20230531132946627800000004]
module.ecs.aws_iam_role_policy_attachment.attachment: Refreshing state... [id=staging_rpc-proxy_ecs_task_execution_role-20230606101901548400000001]
module.ecs.aws_iam_role_policy_attachment.geoip-bucket-policy-attach: Refreshing state... [id=staging_rpc-proxy_ecs_task_execution_role-20230531132946907600000006]
module.monitoring.grafana_data_source.prometheus: Refreshing state... [id=56]
module.backup_dns.aws_route53_record.cert_verification[0]: Refreshing state... [id=Z025697917GKV1T3MTR7I__4d22d935f4bfd18f85fd77a386484a45.staging.rpc.walletconnect.org._CNAME]
data.aws_ecr_repository.repository: Read complete after 2s [id=rpc-proxy]
module.ecs.data.aws_vpc.vpc: Read complete after 2s [id=vpc-09dce0b23af575478]
module.ecs.aws_security_group.vpc_app_ingress: Refreshing state... [id=sg-08dd28bde6f2433a8]
module.ecs.aws_security_group.sigv4_proxy_vpc_ingress: Refreshing state... [id=sg-03a9fb9aed01c7eac]
module.ecs.aws_security_group.tls_ingress: Refreshing state... [id=sg-05bbe738c981c03fd]
module.ecs.aws_lb_target_group.target_group: Refreshing state... [id=arn:aws:elasticloadbalancing:eu-central-1:898587786287:targetgroup/staging-rpc-proxy-5b3/162d6f2524f3d01b]
module.ecs.aws_security_group.vpc-endpoint-group: Refreshing state... [id=sg-09dbb8bc18186aa9b]
module.ecs.data.aws_subnets.private_subnets: Reading...
module.ecs.data.aws_subnets.public_subnets: Reading...
module.redis.data.aws_vpc.vpc: Read complete after 1s [id=vpc-09dce0b23af575478]
module.redis.data.aws_subnets.private_subnets: Reading...
module.redis.aws_security_group.service_security_group: Refreshing state... [id=sg-0ac7678fe5cb03d2c]
module.ecs.data.aws_subnets.private_subnets: Read complete after 0s [id=eu-central-1]
module.ecs.aws_vpc_endpoint.prometheus: Refreshing state... [id=vpce-0cfaae08f7c8ac662]
module.ecs.data.aws_subnets.public_subnets: Read complete after 0s [id=eu-central-1]
module.ecs.aws_alb.network_load_balancer: Refreshing state... [id=arn:aws:elasticloadbalancing:eu-central-1:898587786287:loadbalancer/net/staging-rpc-proxy-lb-c1c/31a81479cdf3c9dc]
module.redis.data.aws_subnets.private_subnets: Read complete after 0s [id=eu-central-1]
module.redis.aws_elasticache_subnet_group.private_subnets: Refreshing state... [id=rpc-proxy-rpc-staging-private-subnet-group]
aws_s3_bucket_public_access_block.analytics-data-lake_bucket: Refreshing state... [id=walletconnect.rpc-proxy.staging.analytics.data-lake]
aws_s3_bucket_versioning.analytics-data-lake_bucket: Refreshing state... [id=walletconnect.rpc-proxy.staging.analytics.data-lake]
aws_s3_bucket_server_side_encryption_configuration.analytics-data-lake_bucket: Refreshing state... [id=walletconnect.rpc-proxy.staging.analytics.data-lake]
module.ecs.aws_iam_policy.analytics-data-lake_bucket_access: Refreshing state... [id=arn:aws:iam::898587786287:policy/staging_rpc-proxy_analytics-data-lake_bucket_access]
aws_s3_bucket_acl.analytics-data-lake_acl: Refreshing state... [id=walletconnect.rpc-proxy.staging.analytics.data-lake,private]
module.ecs.aws_iam_role_policy_attachment.analytics-data-lake-bucket-policy-attach: Refreshing state... [id=staging_rpc-proxy_ecs_task_execution_role-20230531151148871800000002]
module.ecs.aws_lb_listener.listener: Refreshing state... [id=arn:aws:elasticloadbalancing:eu-central-1:898587786287:listener/net/staging-rpc-proxy-lb-c1c/31a81479cdf3c9dc/e74dba939acf5741]
module.ecs.aws_route53_record.dns_load_balancer: Refreshing state... [id=Z09669243E0Q6ZCWCIW2U_staging.rpc.walletconnect.com_A]
module.ecs.aws_route53_record.backup_dns_load_balancer: Refreshing state... [id=Z025697917GKV1T3MTR7I_staging.rpc.walletconnect.org_A]
module.logging.aws_s3_bucket_versioning.logging_bucket: Refreshing state... [id=walletconnect.rpc-proxy.staging.access-logs]
module.logging.aws_s3_bucket_server_side_encryption_configuration.logging_bucket: Refreshing state... [id=walletconnect.rpc-proxy.staging.access-logs]
module.logging.aws_s3_bucket_lifecycle_configuration.logging_bucket: Refreshing state... [id=walletconnect.rpc-proxy.staging.access-logs]
module.logging.aws_s3_bucket_public_access_block.logging_bucket: Refreshing state... [id=walletconnect.rpc-proxy.staging.access-logs]
module.logging.data.aws_iam_policy_document.allow_logging_service: Reading...
module.logging.data.aws_iam_policy_document.allow_logging_service: Read complete after 0s [id=3646663536]
module.logging.aws_s3_bucket_acl.logging_bucket-acl: Refreshing state... [id=walletconnect.rpc-proxy.staging.access-logs,log-delivery-write]
module.logging.aws_s3_bucket_policy.allow_logging_service: Refreshing state... [id=walletconnect.rpc-proxy.staging.access-logs]
aws_s3_bucket_logging.analytics-data-lake_bucket: Refreshing state... [id=walletconnect.rpc-proxy.staging.analytics.data-lake]
module.redis.aws_elasticache_cluster.cache: Refreshing state... [id=rpc-proxy-rpc-staging]
module.monitoring.data.jsonnet_file.dashboard: Reading...
module.ecs.aws_ecs_task_definition.app_task: Refreshing state... [id=staging_rpc-proxy]
module.monitoring.data.jsonnet_file.dashboard: Read complete after 0s [id=0b5e36954758e5693ffa87feb6f798909e08ca6d384b3144084696f2192242ea]
module.monitoring.grafana_dashboard.dashboard: Refreshing state... [id=0:staging-rpc-proxy]
module.ecs.aws_ecs_service.app_service: Refreshing state... [id=arn:aws:ecs:eu-central-1:898587786287:service/staging_rpc-proxy_cluster/staging_rpc-proxy-service]
module.ecs.aws_lb_listener_certificate.backup_cert: Refreshing state... [id=arn:aws:elasticloadbalancing:eu-central-1:898587786287:listener/net/staging-rpc-proxy-lb-c1c/31a81479cdf3c9dc/e74dba939acf5741_arn:aws:acm:eu-central-1:898587786287:certificate/01db5774-a887-4ef5-bd91-ba53f7d482f5]
module.ecs.aws_appautoscaling_target.ecs_target: Refreshing state... [id=service/staging_rpc-proxy_cluster/staging_rpc-proxy-service]
module.ecs.aws_appautoscaling_policy.cpu_scaling: Refreshing state... [id=staging_rpc-proxy-application-scaling-policy-cpu]
module.ecs.aws_appautoscaling_policy.memory_scaling: Refreshing state... [id=staging_rpc-proxy-application-scaling-policy-memory]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place

Terraform will perform the following actions:

  # aws_s3_bucket_ownership_controls.analytics-data-lake_controls will be created
  + resource "aws_s3_bucket_ownership_controls" "analytics-data-lake_controls" {
      + bucket = "walletconnect.rpc-proxy.staging.analytics.data-lake"
      + id     = (known after apply)

      + rule {
          + object_ownership = "BucketOwnerPreferred"
        }
    }

  # module.ecs.aws_ecs_service.app_service will be updated in-place
  ~ resource "aws_ecs_service" "app_service" {
        id                                 = "arn:aws:ecs:eu-central-1:898587786287:service/staging_rpc-proxy_cluster/staging_rpc-proxy-service"
        name                               = "staging_rpc-proxy-service"
        tags                               = {}
      ~ task_definition                    = "arn:aws:ecs:eu-central-1:898587786287:task-definition/staging_rpc-proxy:154" -> "arn:aws:ecs:eu-central-1:898587786287:task-definition/staging_rpc-proxy"
        # (15 unchanged attributes hidden)

        # (4 unchanged blocks hidden)
    }

  # module.logging.aws_s3_bucket_ownership_controls.logging_bucket-controls will be created
  + resource "aws_s3_bucket_ownership_controls" "logging_bucket-controls" {
      + bucket = "walletconnect.rpc-proxy.staging.access-logs"
      + id     = (known after apply)

      + rule {
          + object_ownership = "BucketOwnerPreferred"
        }
    }

  # module.monitoring.grafana_dashboard.dashboard will be updated in-place
  ~ resource "grafana_dashboard" "dashboard" {
      ~ config_json  = jsonencode(
          ~ {
              ~ panels        = [
                    {
                        collapsed  = false
                        datasource = {
                            type = "datasource"
                            uid  = "grafana"
                        }
                        gridPos    = {
                            h = 1
                            w = 24
                            x = 0
                            y = 0
                        }
                        targets    = [
                            {
                                datasource = {
                                    type = "datasource"
                                    uid  = "grafana"
                                }
                            },
                        ]
                        title      = "ECS"
                        type       = "row"
                    },
                  ~ {
                      ~ fieldConfig   = {
                          ~ defaults  = {
                              ~ custom     = {
                                  + axisSoftMax       = 100
                                  + axisSoftMin       = 98
                                    # (12 unchanged attributes hidden)
                                }
                                # (4 unchanged attributes hidden)
                            }
                            # (1 unchanged attribute hidden)
                        }
                        # (9 unchanged attributes hidden)
                    },
                    {
                        alert         = {
                            alertRuleTags       = [
                                {},
                            ]
                            conditions          = [
                                {
                                    evaluator = {
                                        params = [
                                            70,
                                        ]
                                        type   = "gt"
                                    }
                                    operator  = {
                                        type = "and"
                                    }
                                    query     = {
                                        params = [
                                            "Mem_Avg",
                                            "5m",
                                            "now",
                                        ]
                                    }
                                    reducer   = {
                                        params = []
                                        type   = "avg"
                                    }
                                    type      = "query"
                                },
                            ]
                            executionErrorState = "alerting"
                            for                 = "5m"
                            frequency           = "1m"
                            handler             = 1
                            message             = "RPC Proxy - Staging - Memory Utilization - Memory utilization is high (over 70)"
                            name                = "RPC Proxy - Staging - Memory Utilization - Memory Utilization alert"
                            noDataState         = "alerting"
                            notifications       = []
                        }
                        datasource    = {
                            type = "cloudwatch"
                            uid  = "A6KUYzu4z"
                        }
                        description   = null
                        fieldConfig   = {
                            defaults  = {
                                color      = {
                                    mode = "palette-classic"
                                }
                                custom     = {
                                    axisPlacement     = "auto"
                                    axisSoftMax       = 40
                                    axisSoftMin       = 0
                                    barAlignment      = 0
                                    drawStyle         = "line"
                                    fillOpacity       = 0
                                    gradientMode      = "none"
                                    lineInterpolation = "linear"
                                    lineWidth         = 1
                                    pointSize         = 5
                                    scaleDistribution = {
                                        type = "linear"
                                    }
                                    showPoints        = "auto"
                                    spanNulls         = false
                                    thresholdsStyle   = {
                                        mode = "area"
                                    }
                                }
                                mappings   = []
                                thresholds = {
                                    mode  = "absolute"
                                    steps = [
                                        {
                                            color = "green"
                                            value = null
                                        },
                                        {
                                            color = "orange"
                                            value = 40
                                        },
                                        {
                                            color = "red"
                                            value = 70
                                        },
                                    ]
                                }
                                unit       = "percent"
                            }
                            overrides = [
                                {
                                    matcher    = {
                                        id      = "byFrameRefID"
                                        options = "Mem_Max"
                                    }
                                    properties = [
                                        {
                                            id    = "color"
                                            value = {
                                                fixedColor = "dark-purple"
                                                mode       = "fixed"
                                            }
                                        },
                                    ]
                                },
                                {
                                    matcher    = {
                                        id      = "byFrameRefID"
                                        options = "Mem_Avg"
                                    }
                                    properties = [
                                        {
                                            id    = "color"
                                            value = {
                                                fixedColor = "purple"
                                                mode       = "fixed"
                                            }
                                        },
                                    ]
                                },
                            ]
                        }
                        gridPos       = {
                            h = 8
                            w = 8
                            x = 8
                            y = 1
                        }
                        links         = []
                        options       = {
                            legend  = {
                                calcs       = []
                                displayMode = "list"
                                placement   = "bottom"
                            }
                            tooltip = {
                                mode = "multi"
                                sort = "none"
                            }
                        }
                        pluginVersion = "8.4.7"
                        targets       = [
                            {
                                alias            = "Memory (Max)"
                                datasource       = {
                                    type = "cloudwatch"
                                    uid  = "A6KUYzu4z"
                                }
                                dimensions       = {
                                    ServiceName = "staging_rpc-proxy-service"
                                }
                                expression       = ""
                                matchExact       = false
                                metricEditorMode = 0
                                metricName       = "MemoryUtilization"
                                metricQueryType  = 0
                                namespace        = "AWS/ECS"
                                period           = "auto"
                                queryMode        = "Metrics"
                                refId            = "Mem_Max"
                                region           = "default"
                                statistic        = "Maximum"
                            },
                            {
                                alias            = "Memory (Avg)"
                                datasource       = {
                                    type = "cloudwatch"
                                    uid  = "A6KUYzu4z"
                                }
                                dimensions       = {
                                    ServiceName = "staging_rpc-proxy-service"
                                }
                                expression       = ""
                                matchExact       = false
                                metricEditorMode = 0
                                metricName       = "MemoryUtilization"
                                metricQueryType  = 0
                                namespace        = "AWS/ECS"
                                period           = "auto"
                                queryMode        = "Metrics"
                                refId            = "Mem_Avg"
                                region           = "default"
                                statistic        = "Average"
                            },
                        ]
                        title         = "Memory Utilization"
                        type          = "timeseries"
                    },
                    # (17 unchanged elements hidden)
                    {
                        datasource    = {
                            type = "prometheus"
                            uid  = "EK5UYku4k"
                        }
                        description   = null
                        fieldConfig   = {
                            defaults  = {
                                color      = {
                                    mode = "palette-classic"
                                }
                                custom     = {
                                    axisPlacement     = "auto"
                                    axisSoftMax       = 1.1
                                    axisSoftMin       = 0.4
                                    barAlignment      = 0
                                    drawStyle         = "line"
                                    fillOpacity       = 0
                                    gradientMode      = "none"
                                    lineInterpolation = "linear"
                                    lineWidth         = 1
                                    pointSize         = 5
                                    scaleDistribution = {
                                        type = "linear"
                                    }
                                    showPoints        = "auto"
                                    spanNulls         = false
                                    thresholdsStyle   = {
                                        mode = "off"
                                    }
                                }
                                mappings   = []
                                thresholds = {
                                    mode  = "absolute"
                                    steps = [
                                        {
                                            color = "green"
                                            value = null
                                        },
                                    ]
                                }
                                unit       = "ms"
                            }
                            overrides = []
                        }
                        gridPos       = {
                            h = 8
                            w = 12
                            x = 12
                            y = 44
                        }
                        links         = []
                        options       = {
                            legend  = {
                                calcs       = []
                                displayMode = "list"
                                placement   = "bottom"
                            }
                            tooltip = {
                                mode = "multi"
                                sort = "none"
                            }
                        }
                        pluginVersion = "8.4.7"
                        targets       = [
                            {
                                datasource   = {
                                    type = "prometheus"
                                    uid  = "EK5UYku4k"
                                }
                                exemplar     = false
                                expr         = "histogram_quantile(0.95, sum(rate(http_external_latency_tracker_bucket{}[$__rate_interval])) by (le, provider))"
                                legendFormat = "__auto"
                                refId        = "A"
                            },
                        ]
                        title         = "Latency"
                        type          = "timeseries"
                    },
                  ~ {
                      ~ alert         = {
                          ~ conditions          = [
                              ~ {
                                  ~ evaluator = {
                                      ~ params = [
                                          - 15,
                                          + 10,
                                        ]
                                        # (1 unchanged attribute hidden)
                                    }
                                  ~ reducer   = {
                                      ~ type   = "max" -> "sum"
                                        # (1 unchanged attribute hidden)
                                    }
                                    # (3 unchanged attributes hidden)
                                },
                            ]
                            name                = "RPC - RPC staging - Non-Provider Error alert"
                            # (8 unchanged attributes hidden)
                        }
                      ~ targets       = [
                          ~ {
                              ~ expr         = "round(sum(increase(http_call_counter{code=~\"50[0-1]|503|50[5-9]|5[1-9][0-9]\"}[5m])))" -> "round(sum(increase(http_call_counter{code=~\"50[0-1]|50[3-9]|5[1-9][0-9]\"}[5m])))"
                              + hide         = true
                                # (4 unchanged attributes hidden)
                            },
                        ]
                        # (9 unchanged attributes hidden)
                    },
                  ~ {
                      ~ alert         = {
                          ~ conditions          = [
                              ~ {
                                  ~ evaluator = {
                                      ~ params = [
                                          - 5000,
                                          + 3000,
                                        ]
                                        # (1 unchanged attribute hidden)
                                    }
                                  ~ reducer   = {
                                      ~ type   = "max" -> "sum"
                                        # (1 unchanged attribute hidden)
                                    }
                                    # (3 unchanged attributes hidden)
                                },
                            ]
                            name                = "RPC - RPC staging - Provider Error alert"
                            # (8 unchanged attributes hidden)
                        }
                        # (10 unchanged attributes hidden)
                    },
                    {
                        datasource    = {
                            type = "prometheus"
                            uid  = "EK5UYku4k"
                        }
                        description   = null
                        fieldConfig   = {
                            defaults  = {
                                color      = {
                                    mode = "palette-classic"
                                }
                                custom     = {
                                    axisPlacement     = "auto"
                                    barAlignment      = 0
                                    drawStyle         = "line"
                                    fillOpacity       = 0
                                    gradientMode      = "none"
                                    lineInterpolation = "linear"
                                    lineWidth         = 1
                                    pointSize         = 5
                                    scaleDistribution = {
                                        type = "linear"
                                    }
                                    showPoints        = "auto"
                                    spanNulls         = false
                                    thresholdsStyle   = {
                                        mode = "off"
                                    }
                                }
                                mappings   = []
                                thresholds = {
                                    mode  = "absolute"
                                    steps = [
                                        {
                                            color = "green"
                                            value = null
                                        },
                                    ]
                                }
                            }
                            overrides = []
                        }
                        gridPos       = {
                            h = 8
                            w = 8
                            x = 16
                            y = 52
                        }
                        links         = []
                        options       = {
                            legend  = {
                                calcs       = []
                                displayMode = "list"
                                placement   = "bottom"
                            }
                            tooltip = {
                                mode = "multi"
                                sort = "none"
                            }
                        }
                        pluginVersion = "8.4.7"
                        targets       = [
                            {
                                datasource   = {
                                    type = "prometheus"
                                    uid  = "EK5UYku4k"
                                }
                                expr         = "sum (increase(rejected_project_counter[5m]))"
                                legendFormat = "__auto"
                                refId        = "A"
                            },
                        ]
                        title         = "Rejected Project IDs"
                        type          = "timeseries"
                    },
                    # (3 unchanged elements hidden)
                    {
                        alert         = {
                            alertRuleTags       = [
                                {
                                    og_priority = "P2"
                                },
                            ]
                            conditions          = [
                                {
                                    evaluator = {
                                        params = [
                                            70,
                                        ]
                                        type   = "gt"
                                    }
                                    operator  = {
                                        type = "and"
                                    }
                                    query     = {
                                        params = [
                                            "CPU_Avg",
                                            "5m",
                                            "now",
                                        ]
                                    }
                                    reducer   = {
                                        params = []
                                        type   = "avg"
                                    }
                                    type      = "query"
                                },
                                {
                                    evaluator = {
                                        params = [
                                            70,
                                        ]
                                        type   = "gt"
                                    }
                                    operator  = {
                                        type = "and"
                                    }
                                    query     = {
                                        params = [
                                            "Mem_Avg",
                                            "5m",
                                            "now",
                                        ]
                                    }
                                    reducer   = {
                                        params = []
                                        type   = "avg"
                                    }
                                    type      = "query"
                                },
                            ]
                            executionErrorState = "alerting"
                            for                 = "5m"
                            frequency           = "1m"
                            handler             = 1
                            message             = "RPC Proxy - Staging - CPU/Memory Utilization - CPU/Memory utilization is high (over 70/70)"
                            name                = "RPC Proxy - Staging - CPU/Memory Utilization - CPU/Memory Utilization alert"
                            noDataState         = "alerting"
                            notifications       = []
                        }
                        datasource    = {
                            type = "cloudwatch"
                            uid  = "A6KUYzu4z"
                        }
                        description   = null
                        fieldConfig   = {
                            defaults  = {
                                color      = {
                                    mode = "palette-classic"
                                }
                                custom     = {
                                    axisPlacement     = "auto"
                                    axisSoftMax       = 40
                                    axisSoftMin       = 0
                                    barAlignment      = 0
                                    drawStyle         = "line"
                                    fillOpacity       = 0
                                    gradientMode      = "none"
                                    lineInterpolation = "linear"
                                    lineWidth         = 1
                                    pointSize         = 5
                                    scaleDistribution = {
                                        type = "linear"
                                    }
                                    showPoints        = "auto"
                                    spanNulls         = false
                                    thresholdsStyle   = {
                                        mode = "area"
                                    }
                                }
                                mappings   = []
                                thresholds = {
                                    mode  = "absolute"
                                    steps = [
                                        {
                                            color = "green"
                                            value = null
                                        },
                                        {
                                            color = "orange"
                                            value = 40
                                        },
                                        {
                                            color = "red"
                                            value = 70
                                        },
                                    ]
                                }
                                unit       = "percent"
                            }
                            overrides = [
                                {
                                    matcher    = {
                                        id      = "byFrameRefID"
                                        options = "CPU_Max"
                                    }
                                    properties = [
                                        {
                                            id    = "color"
                                            value = {
                                                fixedColor = "dark-blue"
                                                mode       = "fixed"
                                            }
                                        },
                                    ]
                                },
                                {
                                    matcher    = {
                                        id      = "byFrameRefID"
                                        options = "CPU_Avg"
                                    }
                                    properties = [
                                        {
                                            id    = "color"
                                            value = {
                                                fixedColor = "blue"
                                                mode       = "fixed"
                                            }
                                        },
                                    ]
                                },
                                {
                                    matcher    = {
                                        id      = "byFrameRefID"
                                        options = "Mem_Max"
                                    }
                                    properties = [
                                        {
                                            id    = "color"
                                            value = {
                                                fixedColor = "dark-purple"
                                                mode       = "fixed"
                                            }
                                        },
                                    ]
                                },
                                {
                                    matcher    = {
                                        id      = "byFrameRefID"
                                        options = "Mem_Avg"
                                    }
                                    properties = [
                                        {
                                            id    = "color"
                                            value = {
                                                fixedColor = "purple"
                                                mode       = "fixed"
                                            }
                                        },
                                    ]
                                },
                            ]
                        }
                        gridPos       = {
                            h = 8
                            w = 12
                            x = 0
                            y = 69
                        }
                        links         = []
                        options       = {
                            legend  = {
                                calcs       = []
                                displayMode = "list"
                                placement   = "bottom"
                            }
                            tooltip = {
                                mode = "multi"
                                sort = "none"
                            }
                        }
                        pluginVersion = "8.4.7"
                        targets       = [
                            {
                                alias            = "CPU (Max)"
                                datasource       = {
                                    type = "cloudwatch"
                                    uid  = "A6KUYzu4z"
                                }
                                dimensions       = {
                                    CacheClusterId = "rpc-proxy-rpc-staging"
                                }
                                expression       = ""
                                matchExact       = true
                                metricEditorMode = 0
                                metricName       = "CPUUtilization"
                                metricQueryType  = 0
                                namespace        = "AWS/ElastiCache"
                                period           = "auto"
                                queryMode        = "Metrics"
                                refId            = "CPU_Max"
                                region           = "default"
                                statistic        = "Maximum"
                            },
                            {
                                alias            = "CPU (Avg)"
                                datasource       = {
                                    type = "cloudwatch"
                                    uid  = "A6KUYzu4z"
                                }
                                dimensions       = {
                                    CacheClusterId = "rpc-proxy-rpc-staging"
                                }
                                expression       = ""
                                matchExact       = true
                                metricEditorMode = 0
                                metricName       = "CPUUtilization"
                                metricQueryType  = 0
                                namespace        = "AWS/ElastiCache"
                                period           = "auto"
                                queryMode        = "Metrics"
                                refId            = "CPU_Avg"
                                region           = "default"
                                statistic        = "Average"
                            },
                            {
                                alias            = "Memory (Max)"
                                datasource       = {
                                    type = "cloudwatch"
                                    uid  = "A6KUYzu4z"
                                }
                                dimensions       = {
                                    CacheClusterId = "rpc-proxy-rpc-staging"
                                }
                                expression       = ""
                                matchExact       = true
                                metricEditorMode = 0
                                metricName       = "DatabaseMemoryUsagePercentage"
                                metricQueryType  = 0
                                namespace        = "AWS/ElastiCache"
                                period           = "auto"
                                queryMode        = "Metrics"
                                refId            = "Mem_Max"
                                region           = "default"
                                statistic        = "Maximum"
                            },
                            {
                                alias            = "Memory (Avg)"
                                datasource       = {
                                    type = "cloudwatch"
                                    uid  = "A6KUYzu4z"
                                }
                                dimensions       = {
                                    CacheClusterId = "rpc-proxy-rpc-staging"
                                }
                                expression       = ""
                                matchExact       = true
                                metricEditorMode = 0
                                metricName       = "DatabaseMemoryUsagePercentage"
                                metricQueryType  = 0
                                namespace        = "AWS/ElastiCache"
                                period           = "auto"
                                queryMode        = "Metrics"
                                refId            = "Mem_Avg"
                                region           = "default"
                                statistic        = "Average"
                            },
                        ]
                        title         = "Redis CPU/Memory EU"
                        type          = "timeseries"
                    },
                  + {
                      + collapsed  = false
                      + datasource = {
                          + type = "datasource"
                          + uid  = "grafana"
                        }
                      + gridPos    = {
                          + h = 1
                          + w = 24
                          + x = 0
                          + y = 77
                        }
                      + targets    = [
                          + {
                              + datasource = {
                                  + type = "datasource"
                                  + uid  = "grafana"
                                }
                            },
                        ]
                      + title      = "Identity (ENS) Metrics"
                      + type       = "row"
                    },
                  + {
                      + datasource    = {
                          + type = "prometheus"
                          + uid  = "EK5UYku4k"
                        }
                      + description   = null
                      + fieldConfig   = {
                          + defaults  = {
                              + color      = {
                                  + mode = "palette-classic"
                                }
                              + custom     = {
                                  + axisPlacement     = "auto"
                                  + barAlignment      = 0
                                  + drawStyle         = "line"
                                  + fillOpacity       = 0
                                  + gradientMode      = "none"
                                  + lineInterpolation = "linear"
                                  + lineWidth         = 1
                                  + pointSize         = 5
                                  + scaleDistribution = {
                                      + type = "linear"
                                    }
                                  + showPoints        = "auto"
                                  + spanNulls         = false
                                  + thresholdsStyle   = {
                                      + mode = "off"
                                    }
                                }
                              + mappings   = []
                              + thresholds = {
                                  + mode  = "absolute"
                                  + steps = [
                                      + {
                                          + color = "green"
                                          + value = null
                                        },
                                    ]
                                }
                              + unit       = "reqps"
                            }
                          + overrides = []
                        }
                      + gridPos       = {
                          + h = 6
                          + w = 12
                          + x = 0
                          + y = 78
                        }
                      + links         = []
                      + options       = {
                          + legend  = {
                              + calcs       = []
                              + displayMode = "list"
                              + placement   = "bottom"
                            }
                          + tooltip = {
                              + mode = "multi"
                              + sort = "none"
                            }
                        }
                      + pluginVersion = "8.4.7"
                      + targets       = [
                          + {
                              + datasource   = {
                                  + type = "prometheus"
                                  + uid  = "EK5UYku4k"
                                }
                              + expr         = "sum(rate(identity_lookup_counter{}[$__rate_interval]))"
                              + legendFormat = ""
                              + refId        = "Requests"
                            },
                        ]
                      + title         = "Requests"
                      + type          = "timeseries"
                    },
                  + {
                      + datasource    = {
                          + type = "prometheus"
                          + uid  = "EK5UYku4k"
                        }
                      + description   = null
                      + fieldConfig   = {
                          + defaults  = {
                              + color      = {
                                  + mode = "palette-classic"
                                }
                              + custom     = {
                                  + axisPlacement     = "auto"
                                  + axisSoftMax       = 100
                                  + axisSoftMin       = 98
                                  + barAlignment      = 0
                                  + drawStyle         = "line"
                                  + fillOpacity       = 0
                                  + gradientMode      = "none"
                                  + lineInterpolation = "linear"
                                  + lineWidth         = 1
                                  + pointSize         = 5
                                  + scaleDistribution = {
                                      + type = "linear"
                                    }
                                  + showPoints        = "auto"
                                  + spanNulls         = false
                                  + thresholdsStyle   = {
                                      + mode = "off"
                                    }
                                }
                              + mappings   = []
                              + thresholds = {
                                  + mode  = "absolute"
                                  + steps = [
                                      + {
                                          + color = "green"
                                          + value = null
                                        },
                                    ]
                                }
                              + unit       = "percent"
                            }
                          + overrides = []
                        }
                      + gridPos       = {
                          + h = 6
                          + w = 12
                          + x = 12
                          + y = 78
                        }
                      + links         = []
                      + options       = {
                          + legend  = {
                              + calcs       = []
                              + displayMode = "list"
                              + placement   = "bottom"
                            }
                          + tooltip = {
                              + mode = "multi"
                              + sort = "none"
                            }
                        }
                      + pluginVersion = "8.4.7"
                      + targets       = [
                          + {
                              + datasource   = {
                                  + type = "prometheus"
                                  + uid  = "EK5UYku4k"
                                }
                              + expr         = "sum(rate(identity_lookup_counter{}[$__rate_interval]))"
                              + hide         = true
                              + legendFormat = ""
                              + refId        = "lookup"
                            },
                          + {
                              + datasource   = {
                                  + type = "prometheus"
                                  + uid  = "EK5UYku4k"
                                }
                              + expr         = "sum(rate(identity_lookup_success_counter{}[$__rate_interval]))"
                              + hide         = true
                              + legendFormat = ""
                              + refId        = "lookup_success"
                            },
                          + {
                              + datasource = {
                                  + type = "__expr__"
                                  + uid  = "__expr__"
                                }
                              + expression = "($lookup_success / $lookup) * 100"
                              + refId      = "Availability"
                              + type       = "math"
                            },
                          + {
                              + datasource   = {
                                  + type = "prometheus"
                                  + uid  = "EK5UYku4k"
                                }
                              + expr         = "sum(rate(identity_lookup_name_counter{}[$__rate_interval]))"
                              + hide         = true
                              + legendFormat = ""
                              + refId        = "lookup_name"
                            },
                          + {
                              + datasource   = {
                                  + type = "prometheus"
                                  + uid  = "EK5UYku4k"
                                }
                              + expr         = "sum(rate(identity_lookup_name_success_counter{}[$__rate_interval]))"
                              + hide         = true
                              + legendFormat = ""
                              + refId        = "lookup_name_success"
                            },
                          + {
                              + datasource = {
                                  + type = "__expr__"
                                  + uid  = "__expr__"
                                }
                              + expression = "($lookup_name_success / $lookup_name) * 100"
                              + refId      = "Name availability"
                              + type       = "math"
                            },
                          + {
                              + datasource   = {
                                  + type = "prometheus"
                                  + uid  = "EK5UYku4k"
                                }
                              + expr         = "sum(rate(identity_lookup_avatar_counter{}[$__rate_interval]))"
                              + hide         = true
                              + legendFormat = ""
                              + refId        = "lookup_avatar"
                            },
                          + {
                              + datasource   = {
                                  + type = "prometheus"
                                  + uid  = "EK5UYku4k"
                                }
                              + expr         = "sum(rate(identity_lookup_avatar_success_counter{}[$__rate_interval]))"
                              + hide         = true
                              + legendFormat = ""
                              + refId        = "lookup_avatar_success"
                            },
                          + {
                              + datasource = {
                                  + type = "__expr__"
                                  + uid  = "__expr__"
                                }
                              + expression = "($lookup_avatar_success / $lookup_avatar) * 100"
                              + refId      = "Avatar availability"
                              + type       = "math"
                            },
                        ]
                      + title         = "Availability"
                      + type          = "timeseries"
                    },
                  + {
                      + datasource    = {
                          + type = "prometheus"
                          + uid  = "EK5UYku4k"
                        }
                      + description   = null
                      + fieldConfig   = {
                          + defaults  = {
                              + color      = {
                                  + mode = "palette-classic"
                                }
                              + custom     = {
                                  + axisPlacement     = "auto"
                                  + axisSoftMax       = 1.1
                                  + axisSoftMin       = 0.4
                                  + barAlignment      = 0
                                  + drawStyle         = "line"
                                  + fillOpacity       = 0
                                  + gradientMode      = "none"
                                  + lineInterpolation = "linear"
                                  + lineWidth         = 1
                                  + pointSize         = 5
                                  + scaleDistribution = {
                                      + type = "linear"
                                    }
                                  + showPoints        = "auto"
                                  + spanNulls         = false
                                  + thresholdsStyle   = {
                                      + mode = "off"
                                    }
                                }
                              + mappings   = []
                              + thresholds = {
                                  + mode  = "absolute"
                                  + steps = [
                                      + {
                                          + color = "green"
                                          + value = null
                                        },
                                    ]
                                }
                              + unit       = "ms"
                            }
                          + overrides = []
                        }
                      + gridPos       = {
                          + h = 6
                          + w = 12
                          + x = 0
                          + y = 84
                        }
                      + links         = []
                      + options       = {
                          + legend  = {
                              + calcs       = []
                              + displayMode = "list"
                              + placement   = "bottom"
                            }
                          + tooltip = {
                              + mode = "multi"
                              + sort = "none"
                            }
                        }
                      + pluginVersion = "8.4.7"
                      + targets       = [
                          + {
                              + datasource   = {
                                  + type = "prometheus"
                                  + uid  = "EK5UYku4k"
                                }
                              + expr         = "sum(rate(identity_lookup_latency{}[$__rate_interval]))"
                              + legendFormat = ""
                              + refId        = "Latency"
                            },
                          + {
                              + datasource   = {
                                  + type = "prometheus"
                                  + uid  = "EK5UYku4k"
                                }
                              + expr         = "sum(rate(identity_lookup_cache_latency_tracker{}[$__rate_interval]))"
                              + legendFormat = ""
                              + refId        = "Cache latency"
                            },
                          + {
                              + datasource   = {
                                  + type = "prometheus"
                                  + uid  = "EK5UYku4k"
                                }
                              + expr         = "sum(rate(identity_lookup_name_latency_tracker{}[$__rate_interval]))"
                              + legendFormat = ""
                              + refId        = "Name RPC latency"
                            },
                          + {
                              + datasource   = {
                                  + type = "prometheus"
                                  + uid  = "EK5UYku4k"
                                }
                              + expr         = "sum(rate(identity_lookup_avatar_latency_tracker{}[$__rate_interval]))"
                              + legendFormat = ""
                              + refId        = "Avatar RPC latency"
                            },
                        ]
                      + title         = "Latency"
                      + type          = "timeseries"
                    },
                  + {
                      + datasource    = {
                          + type = "prometheus"
                          + uid  = "EK5UYku4k"
                        }
                      + description   = null
                      + fieldConfig   = {
                          + defaults  = {
                              + color      = {
                                  + mode = "palette-classic"
                                }
                              + custom     = {
                                  + axisPlacement     = "auto"
                                  + axisSoftMax       = 100
                                  + axisSoftMin       = 0
                                  + barAlignment      = 0
                                  + drawStyle         = "line"
                                  + fillOpacity       = 0
                                  + gradientMode      = "none"
                                  + lineInterpolation = "linear"
                                  + lineWidth         = 1
                                  + pointSize         = 5
                                  + scaleDistribution = {
                                      + type = "linear"
                                    }
                                  + showPoints        = "auto"
                                  + spanNulls         = false
                                  + thresholdsStyle   = {
                                      + mode = "off"
                                    }
                                }
                              + mappings   = []
                              + thresholds = {
                                  + mode  = "absolute"
                                  + steps = [
                                      + {
                                          + color = "green"
                                          + value = null
                                        },
                                    ]
                                }
                              + unit       = "percent"
                            }
                          + overrides = []
                        }
                      + gridPos       = {
                          + h = 6
                          + w = 12
                          + x = 12
                          + y = 84
                        }
                      + links         = []
                      + options       = {
                          + legend  = {
                              + calcs       = []
                              + displayMode = "list"
                              + placement   = "bottom"
                            }
                          + tooltip = {
                              + mode = "multi"
                              + sort = "none"
                            }
                        }
                      + pluginVersion = "8.4.7"
                      + targets       = [
                          + {
                              + datasource   = {
                                  + type = "prometheus"
                                  + uid  = "EK5UYku4k"
                                }
                              + exemplar     = false
                              + expr         = "sum(rate(identity_lookup_success_counter{}[$__rate_interval]))"
                              + hide         = true
                              + legendFormat = ""
                              + refId        = "lookups"
                            },
                          + {
                              + datasource   = {
                                  + type = "prometheus"
                                  + uid  = "EK5UYku4k"
                                }
                              + exemplar     = false
                              + expr         = "sum(rate(identity_lookup_success_counter{source=\"cache\"}[$__rate_interval]))"
                              + hide         = true
                              + legendFormat = ""
                              + refId        = "cache_hits"
                            },
                          + {
                              + datasource = {
                                  + type = "__expr__"
                                  + uid  = "__expr__"
                                }
                              + expression = "($cache_hits / $lookups) * 100"
                              + refId      = "Cache-hits"
                              + type       = "math"
                            },
                        ]
                      + title         = "Cache-hit ratio"
                      + type          = "timeseries"
                    },
                  + {
                      + datasource    = {
                          + type = "prometheus"
                          + uid  = "EK5UYku4k"
                        }
                      + description   = null
                      + fieldConfig   = {
                          + defaults  = {
                              + color      = {
                                  + mode = "palette-classic"
                                }
                              + custom     = {
                                  + axisPlacement     = "auto"
                                  + barAlignment      = 0
                                  + drawStyle         = "line"
                                  + fillOpacity       = 0
                                  + gradientMode      = "none"
                                  + lineInterpolation = "linear"
                                  + lineWidth         = 1
                                  + pointSize         = 5
                                  + scaleDistribution = {
                                      + type = "linear"
                                    }
                                  + showPoints        = "auto"
                                  + spanNulls         = false
                                  + thresholdsStyle   = {
                                      + mode = "off"
                                    }
                                }
                              + mappings   = []
                              + thresholds = {
                                  + mode  = "absolute"
                                  + steps = [
                                      + {
                                          + color = "green"
                                          + value = null
                                        },
                                    ]
                                }
                              + unit       = "percent"
                            }
                          + overrides = []
                        }
                      + gridPos       = {
                          + h = 6
                          + w = 12
                          + x = 0
                          + y = 90
                        }
                      + links         = []
                      + options       = {
                          + legend  = {
                              + calcs       = []
                              + displayMode = "list"
                              + placement   = "bottom"
                            }
                          + tooltip = {
                              + mode = "multi"
                              + sort = "none"
                            }
                        }
                      + pluginVersion = "8.4.7"
                      + targets       = [
                          + {
                              + datasource   = {
                                  + type = "prometheus"
                                  + uid  = "EK5UYku4k"
                                }
                              + exemplar     = false
                              + expr         = "sum(rate(identity_lookup_success_counter{}[$__rate_interval]))"
                              + hide         = true
                              + legendFormat = ""
                              + refId        = "lookups"
                            },
                          + {
                              + datasource   = {
                                  + type = "prometheus"
                                  + uid  = "EK5UYku4k"
                                }
                              + exemplar     = false
                              + expr         = "sum(rate(identity_lookup_name_present_counter{}[$__rate_interval]))"
                              + hide         = true
                              + legendFormat = ""
                              + refId        = "name_present"
                            },
                          + {
                              + datasource   = {
                                  + type = "prometheus"
                                  + uid  = "EK5UYku4k"
                                }
                              + exemplar     = false
                              + expr         = "sum(rate(identity_lookup_avatar_present_counter{}[$__rate_interval]))"
                              + hide         = true
                              + legendFormat = ""
                              + refId        = "avatar_present"
                            },
                          + {
                              + datasource = {
                                  + type = "__expr__"
                                  + uid  = "__expr__"
                                }
                              + expression = "($name_present / $lookups) * 100"
                              + refId      = "% of lookups with name"
                              + type       = "math"
                            },
                          + {
                              + datasource = {
                                  + type = "__expr__"
                                  + uid  = "__expr__"
                                }
                              + expression = "($avatar_present / $lookups) * 100"
                              + refId      = "% of lookups with avatar"
                              + type       = "math"
                            },
                        ]
                      + title         = "Avatar usage"
                      + type          = "timeseries"
                    },
                ]
                tags          = []
                # (19 unchanged attributes hidden)
            }
        )
        id           = "0:staging-rpc-proxy"
        # (7 unchanged attributes hidden)
    }

Plan: 2 to add, 2 to change, 0 to destroy.

─────────────────────────────────────────────────────────────────────────────

Saved the plan to: /tmp/plan.tfplan

To perform exactly these actions, run the following command to apply:
    terraform apply "/tmp/plan.tfplan"

Action: pull_request

@chris13524 chris13524 merged commit 5adf051 into master Jun 27, 2023
@chris13524 chris13524 deleted the chris/fix/terraform branch June 27, 2023 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted The issue has been accepted into the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants