-
Notifications
You must be signed in to change notification settings - Fork 495
feat: HQL datadog dashboard #4692
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,131 @@ | ||
| resource "datadog_dashboard_json" "hql_overview" { | ||
| dashboard = <<JSON | ||
| { | ||
| "title": "HQL Overview", | ||
| "description": "Overview of Helicone Query Language traces (counts, latency, errors).", | ||
| "layout_type": "ordered", | ||
| "template_variables": [ | ||
| { "name": "service", "prefix": "service" }, | ||
| { "name": "env", "prefix": "env" } | ||
| ], | ||
| "widgets": [ | ||
| { | ||
| "definition": { | ||
| "type": "timeseries", | ||
| "title": "HQL span count by operation", | ||
| "show_legend": true, | ||
| "requests": [ | ||
| {"display_type": "line", "apm_query": {"index": "trace-search", "search": {"query": "service:$service env:$env name:hql.executeSql"}, "compute": {"aggregation": "count"}, "group_by": [{"facet": "resource_name"}]}}, | ||
| {"display_type": "line", "apm_query": {"index": "trace-search", "search": {"query": "service:$service env:$env name:hql.getClickHouseSchema"}, "compute": {"aggregation": "count"}, "group_by": [{"facet": "resource_name"}]}}, | ||
| {"display_type": "line", "apm_query": {"index": "trace-search", "search": {"query": "service:$service env:$env name:hql.downloadCsv"}, "compute": {"aggregation": "count"}, "group_by": [{"facet": "resource_name"}]}} | ||
| ] | ||
| } | ||
| }, | ||
| { | ||
| "definition": { | ||
| "type": "timeseries", | ||
| "title": "executeSql latency (p50/p95/p99)", | ||
| "show_legend": true, | ||
| "requests": [ | ||
| {"display_type": "line", "apm_query": {"index": "trace-search", "search": {"query": "service:$service env:$env name:hql.executeSql"}, "compute": {"aggregation": "pc50"}, "group_by": [{"facet": "resource_name"}]}}, | ||
| {"display_type": "line", "apm_query": {"index": "trace-search", "search": {"query": "service:$service env:$env name:hql.executeSql"}, "compute": {"aggregation": "pc95"}, "group_by": [{"facet": "resource_name"}]}}, | ||
| {"display_type": "line", "apm_query": {"index": "trace-search", "search": {"query": "service:$service env:$env name:hql.executeSql"}, "compute": {"aggregation": "pc99"}, "group_by": [{"facet": "resource_name"}]}} | ||
| ] | ||
| } | ||
| }, | ||
| { | ||
| "definition": { | ||
| "type": "timeseries", | ||
| "title": "executeSql hits vs errors", | ||
| "show_legend": true, | ||
| "requests": [ | ||
| {"display_type": "line", "style": {"palette": "dog_classic"}, "apm_query": {"index": "trace-search", "search": {"query": "service:$service env:$env name:hql.executeSql"}, "compute": {"aggregation": "count"}, "group_by": [{"facet": "resource_name"}]}}, | ||
| {"display_type": "line", "style": {"palette": "warm"}, "apm_query": {"index": "trace-search", "search": {"query": "service:$service env:$env name:hql.executeSql status:error"}, "compute": {"aggregation": "count"}, "group_by": [{"facet": "resource_name"}]}} | ||
| ] | ||
| } | ||
| }, | ||
| { | ||
| "definition": { | ||
| "type": "toplist", | ||
| "title": "Top HQL resources by p95 latency - executeSql", | ||
| "requests": [ | ||
| {"apm_query": {"index": "trace-search", "search": {"query": "service:$service env:$env name:hql.executeSql"}, "compute": {"aggregation": "pc95"}, "group_by": [{"facet": "resource_name"}]}} | ||
| ] | ||
| } | ||
| }, | ||
| { | ||
| "definition": { | ||
| "type": "toplist", | ||
| "title": "Top HQL resources by p95 latency - getClickHouseSchema", | ||
| "requests": [ | ||
| {"apm_query": {"index": "trace-search", "search": {"query": "service:$service env:$env name:hql.getClickHouseSchema"}, "compute": {"aggregation": "pc95"}, "group_by": [{"facet": "resource_name"}]}} | ||
| ] | ||
| } | ||
| }, | ||
| { | ||
| "definition": { | ||
| "type": "toplist", | ||
| "title": "Top HQL resources by p95 latency - downloadCsv", | ||
| "requests": [ | ||
| {"apm_query": {"index": "trace-search", "search": {"query": "service:$service env:$env name:hql.downloadCsv"}, "compute": {"aggregation": "pc95"}, "group_by": [{"facet": "resource_name"}]}} | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| JSON | ||
| } | ||
|
|
||
| resource "datadog_dashboard_json" "hql_controllers" { | ||
| dashboard = <<JSON | ||
| { | ||
| "title": "HQL Controllers", | ||
| "description": "Controller-level HQL traces (counts, latency, errors).", | ||
| "layout_type": "ordered", | ||
| "template_variables": [ | ||
| { "name": "service", "prefix": "service" }, | ||
| { "name": "env", "prefix": "env" } | ||
| ], | ||
| "widgets": [ | ||
| { | ||
| "definition": { | ||
| "type": "timeseries", | ||
| "title": "Controller span counts", | ||
| "show_legend": true, | ||
| "requests": [ | ||
| {"display_type": "line", "apm_query": {"index": "trace-search", "search": {"query": "service:$service env:$env name:hql.controller.executeSql"}, "compute": {"aggregation": "count"}, "group_by": [{"facet": "resource_name"}]}}, | ||
| {"display_type": "line", "apm_query": {"index": "trace-search", "search": {"query": "service:$service env:$env name:hql.controller.getClickHouseSchema"}, "compute": {"aggregation": "count"}, "group_by": [{"facet": "resource_name"}]}}, | ||
| {"display_type": "line", "apm_query": {"index": "trace-search", "search": {"query": "service:$service env:$env name:hql.controller.downloadCsv"}, "compute": {"aggregation": "count"}, "group_by": [{"facet": "resource_name"}]}} | ||
| ] | ||
| } | ||
| }, | ||
| { | ||
| "definition": { | ||
| "type": "timeseries", | ||
| "title": "Controller p95 latency", | ||
| "show_legend": true, | ||
| "requests": [ | ||
| {"display_type": "line", "apm_query": {"index": "trace-search", "search": {"query": "service:$service env:$env name:hql.controller.executeSql"}, "compute": {"aggregation": "pc95"}, "group_by": [{"facet": "resource_name"}]}}, | ||
| {"display_type": "line", "apm_query": {"index": "trace-search", "search": {"query": "service:$service env:$env name:hql.controller.getClickHouseSchema"}, "compute": {"aggregation": "pc95"}, "group_by": [{"facet": "resource_name"}]}}, | ||
| {"display_type": "line", "apm_query": {"index": "trace-search", "search": {"query": "service:$service env:$env name:hql.controller.downloadCsv"}, "compute": {"aggregation": "pc95"}, "group_by": [{"facet": "resource_name"}]}} | ||
| ] | ||
| } | ||
| }, | ||
| { | ||
| "definition": { | ||
| "type": "timeseries", | ||
| "title": "Controller errors", | ||
| "show_legend": true, | ||
| "requests": [ | ||
| {"display_type": "line", "apm_query": {"index": "trace-search", "search": {"query": "service:$service env:$env name:hql.controller.executeSql status:error"}, "compute": {"aggregation": "count"}, "group_by": [{"facet": "resource_name"}]}}, | ||
| {"display_type": "line", "apm_query": {"index": "trace-search", "search": {"query": "service:$service env:$env name:hql.controller.getClickHouseSchema status:error"}, "compute": {"aggregation": "count"}, "group_by": [{"facet": "resource_name"}]}}, | ||
| {"display_type": "line", "apm_query": {"index": "trace-search", "search": {"query": "service:$service env:$env name:hql.controller.downloadCsv status:error"}, "compute": {"aggregation": "count"}, "group_by": [{"facet": "resource_name"}]}} | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| JSON | ||
| } | ||
|
|
||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Datadog API credentials | ||
| # Get these from your Datadog account: https://app.datadoghq.com/organization-settings/api-keys | ||
| datadog_api_key = "your_datadog_api_key_here" | ||
| datadog_app_key = "your_datadog_app_key_here" | ||
| datadog_api_url = "https://api.us5.datadoghq.com" | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,12 @@ | ||||||||||||||||
| variable "datadog_api_key" { | ||||||||||||||||
| type = string | ||||||||||||||||
| } | ||||||||||||||||
|
Comment on lines
+1
to
+3
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: API key should be marked as sensitive to prevent exposure in logs
Suggested change
|
||||||||||||||||
|
|
||||||||||||||||
| variable "datadog_app_key" { | ||||||||||||||||
| type = string | ||||||||||||||||
| } | ||||||||||||||||
|
Comment on lines
+5
to
+7
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: App key should be marked as sensitive to prevent exposure in logs
Suggested change
|
||||||||||||||||
|
|
||||||||||||||||
| variable "datadog_api_url" { | ||||||||||||||||
| description = "Datadog API base URL, e.g. https://api.us5.datadoghq.com" | ||||||||||||||||
| type = string | ||||||||||||||||
| } | ||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| terraform { | ||
| required_version = ">= 1.3.0" | ||
|
|
||
| required_providers { | ||
| datadog = { | ||
| source = "DataDog/datadog" | ||
| version = ">= 3.40.0" | ||
| } | ||
| } | ||
| cloud { | ||
| organization = "helicone" | ||
| workspaces { | ||
| name = "helicone-datadog" | ||
| } | ||
| } | ||
| } | ||
|
|
||
| provider "datadog" { | ||
| api_key = var.datadog_api_key | ||
| app_key = var.datadog_app_key | ||
| api_url = var.datadog_api_url | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax: Missing trailing newline