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

Duration metrics #46

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
10 changes: 10 additions & 0 deletions terraform/indexing-subsystem/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,14 @@ locals {
uploader_lambda = {
name = "uploader"
}

percentiles = [
"1",
"10",
"25",
"50",
"75",
"90",
"99",
]
}
49 changes: 49 additions & 0 deletions terraform/indexing-subsystem/log.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,53 @@ resource "aws_cloudwatch_log_metric_filter" "uploader_lambda_s3_heads_count" {
}
}

resource "aws_cloudwatch_log_metric_filter" "uploader_lambda_s3_heads_duration_count" {
name = "uploader-lambda-s3-heads-duration-count"
pattern = "{ $.ipfs_provider_component = \"uploader-lambda\" }"
log_group_name = aws_cloudwatch_log_group.uploader_log_group.name

metric_transformation {
namespace = "uploader-lambda-metrics"
name = "s3-heads-duration-count"
value = "$.metrics.s3-heads-durations.count"
dimensions = {
ipfs_provider_component = "$.ipfs_provider_component"
}
}
}

resource "aws_cloudwatch_log_metric_filter" "uploader_lambda_s3_heads_duration_mean" {
name = "uploader-lambda-s3-heads-duration-mean"
pattern = "{ $.ipfs_provider_component = \"uploader-lambda\" }"
log_group_name = aws_cloudwatch_log_group.uploader_log_group.name

metric_transformation {
namespace = "uploader-lambda-metrics"
name = "s3-heads-duration-mean"
value = "$.metrics.s3-heads-durations.mean"
dimensions = {
ipfs_provider_component = "$.ipfs_provider_component"
}
}
}

resource "aws_cloudwatch_log_metric_filter" "uploader_lambda_s3_heads_duration_percentiles" {
for_each = { for percentile in local.percentiles : percentile => percentile }
name = "uploader-lambda-s3_heads_duration-percentile-${each.value}"
pattern = "{ $.ipfs_provider_component = \"uploader-lambda\" }"
log_group_name = aws_cloudwatch_log_group.uploader_log_group.name

metric_transformation {
namespace = "uploader-lambda-metrics"
name = "s3_heads_duration-percentile-${each.value}"
value = "$.metrics.s3-heads-durations.percentiles.${each.value}"
dimensions = {
ipfs_provider_component = "$.ipfs_provider_component"
}
}
}


resource "aws_cloudwatch_log_metric_filter" "uploader_lambda_s3_signs_count" {
name = "uploader-lambda-s3-signs-count"
pattern = "{ $.ipfs_provider_component = \"uploader-lambda\" }"
Expand All @@ -63,3 +110,5 @@ resource "aws_cloudwatch_log_metric_filter" "uploader_lambda_s3_signs_count" {
}
}


# TODO: Also get signs_durations
2 changes: 0 additions & 2 deletions terraform/peer-subsystem/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ resource "aws_security_group_rule" "fargate_ingress" {
security_group_id = module.eks.cluster_primary_security_group_id
}


resource "aws_security_group_rule" "fargate_egress" {
description = "Node to cluster - Fargate kubelet (Required for Metrics Server)"
protocol = "tcp"
Expand Down Expand Up @@ -198,7 +197,6 @@ resource "aws_security_group_rule" "dns_ingress_udp" {
security_group_id = module.eks.node_security_group_id
}


module "kube-base-components" {
source = "../modules/kube-base-components"
cluster_oidc_issuer_url = module.eks.cluster_oidc_issuer_url
Expand Down