-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
137 additions
and
0 deletions.
There are no files selected for viewing
129 changes: 129 additions & 0 deletions
129
collector-dashboards/otel-collector-squid-dashboard/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
|
||
} | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
collector-dashboards/otel-collector-squid-dashboard/outputs.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
4 changes: 4 additions & 0 deletions
4
collector-dashboards/otel-collector-squid-dashboard/variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
variable "lightstep_project" { | ||
description = "Name of Lightstep project" | ||
type = string | ||
} |