Skip to content

Commit

Permalink
Add squid dashboard (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
heydbut authored May 1, 2023
1 parent 03be76d commit 31f8f47
Show file tree
Hide file tree
Showing 3 changed files with 137 additions and 0 deletions.
129 changes: 129 additions & 0 deletions collector-dashboards/otel-collector-squid-dashboard/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
terraform {
required_providers {
lightstep = {
source = "lightstep/lightstep"
version = "~> 1.70.10"
}
}
required_version = ">= v1.0.11"
}

resource "lightstep_dashboard" "otel_collector_squid_dashboard" {
project_name = var.lightstep_project
dashboard_name = "Squid - Overview"
dashboard_description = "A squid overview dashboard displays real-time metrics including bytes hit rate, cache hit rate, error rate, client requests, and client traffic, providing insights into the performance and usage of the proxy server."

chart {
name = "Bytes Hit Rate"
rank = "0"
type = "timeseries"

query {
query_name = "(a/b)"
display = "big_number"
hidden = false
query_string = <<EOT
with
a = metric squid_client_http_hit_kbytes_out_bytes_total | rate 5m | group_by [], sum;
b = metric squid_client_http_kbytes_out_kbytes_total | rate 5m | group_by [], sum;
join ((a / b)), a=0, b=0
EOT
}

}

chart {
name = "Catch Hit Rate"
rank = "0"
type = "timeseries"

query {
query_name = "(a/b)"
display = "big_number"
hidden = false
query_string = <<EOT
with
a = metric squid_client_http_hits_total | rate 5m | group_by [], sum;
b = metric squid_client_http_requests_total | rate 5m | group_by [], sum;
join ((a / b)), a=0, b=0
EOT
}

}

chart {
name = "Error Rate"
rank = "0"
type = "timeseries"

query {
query_name = "(a/b)"
display = "big_number"
hidden = false
query_string = <<EOT
with
a = metric squid_client_http_errors_total | rate 5m | group_by [], sum;
b = metric squid_client_http_requests_total | rate 5m | group_by [], sum;
join ((a / b)), a=0, b=0
EOT
}

}

chart {
name = "Client Requests"
rank = "0"
type = "timeseries"

query {
query_name = "a"
display = "line"
hidden = false
query_string = "metric squid_client_http_requests_total | rate 5m | group_by [], sum"
}

query {
query_name = "b"
display = "line"
hidden = false
query_string = "metric squid_client_http_hits_total | rate 5m | group_by [], sum"
}

query {
query_name = "c"
display = "line"
hidden = false
query_string = "metric squid_client_http_errors_total | rate 5m | group_by [], sum"
}

}

chart {
name = "Client Traffic"
rank = "0"
type = "timeseries"

query {
query_name = "a"
display = "line"
hidden = false
query_string = "metric squid_client_http_kbytes_in_kbytes_total | rate 5m | group_by [], sum"
}

query {
query_name = "b"
display = "line"
hidden = false
query_string = "metric squid_client_http_kbytes_out_kbytes_total | rate 5m | group_by [], sum"
}

query {
query_name = "c"
display = "line"
hidden = false
query_string = "metric squid_client_http_hit_kbytes_out_bytes_total | rate 5m | group_by [], sum"
}

}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
output "dashboard_url" {
value = "https://app.lightstep.com/${var.lightstep_project}/dashboard/${lightstep_dashboard.otel_collector_squid_dashboard.id}"
description = "OpenTelemetry Collector Squid Metrics Dashboard URL"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
variable "lightstep_project" {
description = "Name of Lightstep project"
type = string
}

0 comments on commit 31f8f47

Please sign in to comment.