Correct the table suffix of CF's Analytics Engine (#5554)

This commit is contained in:
Kamil Kisiela 2024-08-29 15:20:56 +02:00 committed by GitHub
parent 419181b131
commit 42b48708b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 57 additions and 42 deletions

View file

@ -115,8 +115,8 @@
"format": "time_series",
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"intervalFactor": 1,
"query": "SELECT\n $timeSeries AS t,\n blob1 AS statusCode,\n COUNT() as total\nFROM hive_ha_cdn_response_ENV_NAME\n\nWHERE $timeFilter\n\nGROUP BY\n statusCode,\n t\nORDER BY t\n",
"rawQuery": "SELECT\n (intDiv(toUInt32(timestamp), 20) * 20) * 1000 AS t,\n blob1 AS statusCode,\n COUNT() as total\nFROM hive_ha_cdn_response_ENV_NAME\n\nWHERE timestamp >= toDateTime(1694666628) AND timestamp <= toDateTime(1694688228)\n\nGROUP BY\n statusCode,\n t\nORDER BY t",
"query": "SELECT\n $timeSeries AS t,\n blob1 AS statusCode,\n COUNT() as total\nFROM hive_ha_cdn_response_TABLE_SUFFIX\n\nWHERE $timeFilter\n\nGROUP BY\n statusCode,\n t\nORDER BY t\n",
"rawQuery": "SELECT\n (intDiv(toUInt32(timestamp), 20) * 20) * 1000 AS t,\n blob1 AS statusCode,\n COUNT() as total\nFROM hive_ha_cdn_response_TABLE_SUFFIX\n\nWHERE timestamp >= toDateTime(1694666628) AND timestamp <= toDateTime(1694688228)\n\nGROUP BY\n statusCode,\n t\nORDER BY t",
"refId": "A",
"round": "0s",
"skip_comments": true
@ -185,8 +185,8 @@
"format": "time_series",
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"intervalFactor": 1,
"query": "SELECT\n $timeSeries AS t,\n blob1 AS statusCode,\n COUNT() as total\nFROM hive_ha_cdn_response_ENV_NAME\n\nWHERE $timeFilter\n\nGROUP BY\n statusCode,\n t\nORDER BY t\n",
"rawQuery": "SELECT\n (intDiv(toUInt32(timestamp), 20) * 20) * 1000 AS t,\n blob1 AS statusCode,\n COUNT() as total\nFROM hive_ha_cdn_response_ENV_NAME\n\nWHERE timestamp >= toDateTime(1694666678) AND timestamp <= toDateTime(1694688278)\n\nGROUP BY\n statusCode,\n t\nORDER BY t",
"query": "SELECT\n $timeSeries AS t,\n blob1 AS statusCode,\n COUNT() as total\nFROM hive_ha_cdn_response_TABLE_SUFFIX\n\nWHERE $timeFilter\n\nGROUP BY\n statusCode,\n t\nORDER BY t\n",
"rawQuery": "SELECT\n (intDiv(toUInt32(timestamp), 20) * 20) * 1000 AS t,\n blob1 AS statusCode,\n COUNT() as total\nFROM hive_ha_cdn_response_TABLE_SUFFIX\n\nWHERE timestamp >= toDateTime(1694666678) AND timestamp <= toDateTime(1694688278)\n\nGROUP BY\n statusCode,\n t\nORDER BY t",
"refId": "A",
"round": "0s",
"skip_comments": true
@ -283,8 +283,8 @@
"format": "time_series",
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"intervalFactor": 1,
"query": "SELECT\n $timeSeries AS t,\n blob1 AS statusCode,\n blob2 as requestPath,\n COUNT() as total\nFROM hive_ha_cdn_response_ENV_NAME\n\nWHERE $timeFilter\n\nGROUP BY\n statusCode,\n requestPath,\n t\nORDER BY t\n",
"rawQuery": "SELECT\n (intDiv(toUInt32(timestamp), 1) * 1) * 1000 AS t,\n blob1 AS statusCode,\n blob2 as requestPath,\n COUNT() as total\nFROM hive_ha_cdn_response_ENV_NAME\n\nWHERE timestamp >= toDateTime(1699350434) AND timestamp <= toDateTime(1699350734)\n\nGROUP BY\n statusCode,\n requestPath,\n t\nORDER BY t",
"query": "SELECT\n $timeSeries AS t,\n blob1 AS statusCode,\n blob2 as requestPath,\n COUNT() as total\nFROM hive_ha_cdn_response_TABLE_SUFFIX\n\nWHERE $timeFilter\n\nGROUP BY\n statusCode,\n requestPath,\n t\nORDER BY t\n",
"rawQuery": "SELECT\n (intDiv(toUInt32(timestamp), 1) * 1) * 1000 AS t,\n blob1 AS statusCode,\n blob2 as requestPath,\n COUNT() as total\nFROM hive_ha_cdn_response_TABLE_SUFFIX\n\nWHERE timestamp >= toDateTime(1699350434) AND timestamp <= toDateTime(1699350734)\n\nGROUP BY\n statusCode,\n requestPath,\n t\nORDER BY t",
"refId": "A",
"round": "0s",
"skip_comments": true
@ -381,8 +381,8 @@
"format": "time_series",
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"intervalFactor": 1,
"query": "SELECT\n $timeSeries AS t,\n blob1 AS action,\n blob2 AS statusCode,\n COUNT() as total\nFROM hive_ha_cdn_r2_ENV_NAME\n\nWHERE $timeFilter\n\nGROUP BY\n action,\n statusCode,\n t\nORDER BY t\n",
"rawQuery": "SELECT\n (intDiv(toUInt32(timestamp), 20) * 20) * 1000 AS t,\n blob1 AS action,\n blob2 AS statusCode,\n COUNT() as total\nFROM hive_ha_cdn_r2_ENV_NAME\n\nWHERE timestamp >= toDateTime(1694666810) AND timestamp <= toDateTime(1694688410)\n\nGROUP BY\n action,\n statusCode,\n t\nORDER BY t",
"query": "SELECT\n $timeSeries AS t,\n blob1 AS action,\n blob2 AS statusCode,\n COUNT() as total\nFROM hive_ha_cdn_r2_TABLE_SUFFIX\n\nWHERE $timeFilter\n\nGROUP BY\n action,\n statusCode,\n t\nORDER BY t\n",
"rawQuery": "SELECT\n (intDiv(toUInt32(timestamp), 20) * 20) * 1000 AS t,\n blob1 AS action,\n blob2 AS statusCode,\n COUNT() as total\nFROM hive_ha_cdn_r2_TABLE_SUFFIX\n\nWHERE timestamp >= toDateTime(1694666810) AND timestamp <= toDateTime(1694688410)\n\nGROUP BY\n action,\n statusCode,\n t\nORDER BY t",
"refId": "A",
"round": "0s",
"skip_comments": true
@ -451,8 +451,8 @@
"format": "time_series",
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"intervalFactor": 1,
"query": "SELECT\n $timeSeries AS t,\n blob1 AS action,\n blob2 AS statusCode,\n COUNT() as total\nFROM hive_ha_cdn_r2_ENV_NAME\n\nWHERE $timeFilter\n\nGROUP BY\n action,\n statusCode,\n t\nORDER BY t\n",
"rawQuery": "SELECT\n (intDiv(toUInt32(timestamp), 20) * 20) * 1000 AS t,\n blob1 AS action,\n blob2 AS statusCode,\n COUNT() as total\nFROM hive_ha_cdn_r2_ENV_NAME\n\nWHERE timestamp >= toDateTime(1694666815) AND timestamp <= toDateTime(1694688415)\n\nGROUP BY\n action,\n statusCode,\n t\nORDER BY t",
"query": "SELECT\n $timeSeries AS t,\n blob1 AS action,\n blob2 AS statusCode,\n COUNT() as total\nFROM hive_ha_cdn_r2_TABLE_SUFFIX\n\nWHERE $timeFilter\n\nGROUP BY\n action,\n statusCode,\n t\nORDER BY t\n",
"rawQuery": "SELECT\n (intDiv(toUInt32(timestamp), 20) * 20) * 1000 AS t,\n blob1 AS action,\n blob2 AS statusCode,\n COUNT() as total\nFROM hive_ha_cdn_r2_TABLE_SUFFIX\n\nWHERE timestamp >= toDateTime(1694666815) AND timestamp <= toDateTime(1694688415)\n\nGROUP BY\n action,\n statusCode,\n t\nORDER BY t",
"refId": "A",
"round": "0s",
"skip_comments": true
@ -552,8 +552,8 @@
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"interval": "",
"intervalFactor": 1,
"query": "SELECT\n $timeSeries AS t,\n blob1 AS action,\n blob2 AS statusCode,\n COUNT() as total\nFROM hive_ha_cdn_s3_ENV_NAME\n\nWHERE $timeFilter\n\nGROUP BY\n action,\n statusCode,\n t\nORDER BY t\n",
"rawQuery": "/* grafana dashboard=CDN Usage, user=19 */\nSELECT\n (intDiv(toUInt32(timestamp), 5) * 5) * 1000 AS t,\n blob1 AS action,\n blob2 AS statusCode,\n COUNT() as total\nFROM hive_ha_cdn_s3_ENV_NAME\n\nWHERE timestamp >= toDateTime(1724917446) AND timestamp <= toDateTime(1724921046)\n\nGROUP BY\n action,\n statusCode,\n t\nORDER BY t",
"query": "SELECT\n $timeSeries AS t,\n blob1 AS action,\n blob2 AS statusCode,\n COUNT() as total\nFROM hive_ha_cdn_s3_TABLE_SUFFIX\n\nWHERE $timeFilter\n\nGROUP BY\n action,\n statusCode,\n t\nORDER BY t\n",
"rawQuery": "/* grafana dashboard=CDN Usage, user=19 */\nSELECT\n (intDiv(toUInt32(timestamp), 5) * 5) * 1000 AS t,\n blob1 AS action,\n blob2 AS statusCode,\n COUNT() as total\nFROM hive_ha_cdn_s3_TABLE_SUFFIX\n\nWHERE timestamp >= toDateTime(1724917446) AND timestamp <= toDateTime(1724921046)\n\nGROUP BY\n action,\n statusCode,\n t\nORDER BY t",
"refId": "A",
"round": "0s",
"skip_comments": true
@ -625,8 +625,8 @@
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"interval": "",
"intervalFactor": 1,
"query": "SELECT\n $timeSeries AS t,\n blob1 AS action,\n blob2 AS statusCode,\n COUNT() as total\nFROM hive_ha_cdn_s3_ENV_NAME\n\nWHERE $timeFilter\n\nGROUP BY\n action,\n statusCode,\n t\nORDER BY t\n",
"rawQuery": "/* grafana dashboard=CDN Usage, user=19 */\nSELECT\n (intDiv(toUInt32(timestamp), 5) * 5) * 1000 AS t,\n blob1 AS action,\n blob2 AS statusCode,\n COUNT() as total\nFROM hive_ha_cdn_s3_ENV_NAME\n\nWHERE timestamp >= toDateTime(1724917446) AND timestamp <= toDateTime(1724921046)\n\nGROUP BY\n action,\n statusCode,\n t\nORDER BY t",
"query": "SELECT\n $timeSeries AS t,\n blob1 AS action,\n blob2 AS statusCode,\n COUNT() as total\nFROM hive_ha_cdn_s3_TABLE_SUFFIX\n\nWHERE $timeFilter\n\nGROUP BY\n action,\n statusCode,\n t\nORDER BY t\n",
"rawQuery": "/* grafana dashboard=CDN Usage, user=19 */\nSELECT\n (intDiv(toUInt32(timestamp), 5) * 5) * 1000 AS t,\n blob1 AS action,\n blob2 AS statusCode,\n COUNT() as total\nFROM hive_ha_cdn_s3_TABLE_SUFFIX\n\nWHERE timestamp >= toDateTime(1724917446) AND timestamp <= toDateTime(1724921046)\n\nGROUP BY\n action,\n statusCode,\n t\nORDER BY t",
"refId": "A",
"round": "0s",
"skip_comments": true
@ -727,8 +727,8 @@
"format": "time_series",
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"intervalFactor": 1,
"query": "SELECT\n $timeSeries AS t,\n blob1 AS action,\n quantileWeighted(0.95, double1, _sample_interval) as p95\nFROM hive_ha_cdn_r2_ENV_NAME\n\nWHERE $timeFilter\n\nGROUP BY\n action,\n t\nORDER BY t\n",
"rawQuery": "SELECT\n (intDiv(toUInt32(timestamp), 20) * 20) * 1000 AS t,\n blob1 AS action,\n quantileWeighted(0.95, double1, _sample_interval) as p95\nFROM hive_ha_cdn_r2_ENV_NAME\n\nWHERE timestamp >= toDateTime(1724821505) AND timestamp <= toDateTime(1724843105)\n\nGROUP BY\n action,\n t\nORDER BY t",
"query": "SELECT\n $timeSeries AS t,\n blob1 AS action,\n quantileWeighted(0.95, double1, _sample_interval) as p95\nFROM hive_ha_cdn_r2_TABLE_SUFFIX\n\nWHERE $timeFilter\n\nGROUP BY\n action,\n t\nORDER BY t\n",
"rawQuery": "SELECT\n (intDiv(toUInt32(timestamp), 20) * 20) * 1000 AS t,\n blob1 AS action,\n quantileWeighted(0.95, double1, _sample_interval) as p95\nFROM hive_ha_cdn_r2_TABLE_SUFFIX\n\nWHERE timestamp >= toDateTime(1724821505) AND timestamp <= toDateTime(1724843105)\n\nGROUP BY\n action,\n t\nORDER BY t",
"refId": "A",
"round": "0s",
"showFormattedSQL": false,
@ -833,8 +833,8 @@
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"interval": "",
"intervalFactor": 1,
"query": "SELECT\n $timeSeries AS t,\n blob1 AS action,\n quantileWeighted(0.95, double1, _sample_interval) as p95\nFROM hive_ha_cdn_s3_ENV_NAME\n\nWHERE $timeFilter\n\nGROUP BY\n action,\n t\nORDER BY t\n",
"rawQuery": "/* grafana dashboard=CDN Usage, user=19 */\nSELECT\n (intDiv(toUInt32(timestamp), 30) * 30) * 1000 AS t,\n blob1 AS action,\n quantileWeighted(0.95, double1, _sample_interval) as p95\nFROM hive_ha_cdn_s2_ENV_NAME\n\nWHERE timestamp >= toDateTime(1724917446) AND timestamp <= toDateTime(1724921046)\n\nGROUP BY\n action,\n t\nORDER BY t",
"query": "SELECT\n $timeSeries AS t,\n blob1 AS action,\n quantileWeighted(0.95, double1, _sample_interval) as p95\nFROM hive_ha_cdn_s3_TABLE_SUFFIX\n\nWHERE $timeFilter\n\nGROUP BY\n action,\n t\nORDER BY t\n",
"rawQuery": "/* grafana dashboard=CDN Usage, user=19 */\nSELECT\n (intDiv(toUInt32(timestamp), 30) * 30) * 1000 AS t,\n blob1 AS action,\n quantileWeighted(0.95, double1, _sample_interval) as p95\nFROM hive_ha_cdn_s2_TABLE_SUFFIX\n\nWHERE timestamp >= toDateTime(1724917446) AND timestamp <= toDateTime(1724921046)\n\nGROUP BY\n action,\n t\nORDER BY t",
"refId": "A",
"round": "0s",
"showFormattedSQL": false,
@ -931,8 +931,8 @@
"format": "time_series",
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"intervalFactor": 1,
"query": "SELECT\n $timeSeries AS t,\n blob2 AS feature,\n COUNT() as total\nFROM hive_ha_cdn_usage_ENV_NAME\n\nWHERE $timeFilter\n\nGROUP BY\n feature,\n t\nORDER BY t\n",
"rawQuery": "SELECT\n (intDiv(toUInt32(timestamp), 2) * 2) * 1000 AS t,\n blob2 AS feature,\n COUNT() as total\nFROM hive_ha_cdn_usage_ENV_NAME\n\nWHERE timestamp >= toDateTime(1671448241) AND timestamp <= toDateTime(1671451841)\n\nGROUP BY\n feature,\n t\nORDER BY t",
"query": "SELECT\n $timeSeries AS t,\n blob2 AS feature,\n COUNT() as total\nFROM hive_ha_cdn_usage_TABLE_SUFFIX\n\nWHERE $timeFilter\n\nGROUP BY\n feature,\n t\nORDER BY t\n",
"rawQuery": "SELECT\n (intDiv(toUInt32(timestamp), 2) * 2) * 1000 AS t,\n blob2 AS feature,\n COUNT() as total\nFROM hive_ha_cdn_usage_TABLE_SUFFIX\n\nWHERE timestamp >= toDateTime(1671448241) AND timestamp <= toDateTime(1671451841)\n\nGROUP BY\n feature,\n t\nORDER BY t",
"refId": "A",
"round": "0s",
"skip_comments": true
@ -1000,8 +1000,8 @@
"format": "time_series",
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"intervalFactor": 1,
"query": "SELECT \n $timeSeries AS t,\n\tblob2 AS feature,\n\tCOUNT() as total\nFROM hive_ha_cdn_usage_ENV_NAME\nWHERE $timeFilter\nGROUP BY feature, t\nORDER BY t",
"rawQuery": "SELECT \n (intDiv(toUInt32(timestamp), 1) * 1) * 1000 AS t,\n\tblob2 AS feature,\n\tCOUNT() as total\nFROM hive_ha_cdn_usage_ENV_NAME\nWHERE timestamp >= toDateTime(1671444869) AND timestamp <= toDateTime(1671445769)\nGROUP BY feature, t\nORDER BY t",
"query": "SELECT \n $timeSeries AS t,\n\tblob2 AS feature,\n\tCOUNT() as total\nFROM hive_ha_cdn_usage_TABLE_SUFFIX\nWHERE $timeFilter\nGROUP BY feature, t\nORDER BY t",
"rawQuery": "SELECT \n (intDiv(toUInt32(timestamp), 1) * 1) * 1000 AS t,\n\tblob2 AS feature,\n\tCOUNT() as total\nFROM hive_ha_cdn_usage_TABLE_SUFFIX\nWHERE timestamp >= toDateTime(1671444869) AND timestamp <= toDateTime(1671445769)\nGROUP BY feature, t\nORDER BY t",
"refId": "A",
"round": "0s",
"skip_comments": true
@ -1098,8 +1098,8 @@
"format": "time_series",
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"intervalFactor": 1,
"query": "SELECT \n $timeSeries AS t,\n blob1 AS cdnVersion,\n\tCOUNT() as total\nFROM hive_ha_cdn_usage_ENV_NAME\nWHERE $timeFilter\nGROUP BY cdnVersion, t\nORDER BY t",
"rawQuery": "SELECT \n (intDiv(toUInt32(timestamp), 20) * 20) * 1000 AS t,\n blob1 AS cdnVersion,\n\tCOUNT() as total\nFROM hive_ha_cdn_usage_ENV_NAME\nWHERE timestamp >= toDateTime(1671424022) AND timestamp <= toDateTime(1671445622)\nGROUP BY cdnVersion, t\nORDER BY t",
"query": "SELECT \n $timeSeries AS t,\n blob1 AS cdnVersion,\n\tCOUNT() as total\nFROM hive_ha_cdn_usage_TABLE_SUFFIX\nWHERE $timeFilter\nGROUP BY cdnVersion, t\nORDER BY t",
"rawQuery": "SELECT \n (intDiv(toUInt32(timestamp), 20) * 20) * 1000 AS t,\n blob1 AS cdnVersion,\n\tCOUNT() as total\nFROM hive_ha_cdn_usage_TABLE_SUFFIX\nWHERE timestamp >= toDateTime(1671424022) AND timestamp <= toDateTime(1671445622)\nGROUP BY cdnVersion, t\nORDER BY t",
"refId": "A",
"round": "0s",
"skip_comments": true
@ -1167,8 +1167,8 @@
"format": "time_series",
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"intervalFactor": 1,
"query": "SELECT \n $timeSeries AS t,\n blob1 AS cdnVersion,\n\tCOUNT() as total\nFROM hive_ha_cdn_usage_ENV_NAME\nWHERE $timeFilter\nGROUP BY cdnVersion, t\nORDER BY t",
"rawQuery": "SELECT \n (intDiv(toUInt32(timestamp), 1) * 1) * 1000 AS t,\n blob1 AS cdnVersion,\n\tCOUNT() as total\nFROM hive_ha_cdn_usage_ENV_NAME\nWHERE timestamp >= toDateTime(1671444913) AND timestamp <= toDateTime(1671445813)\nGROUP BY cdnVersion, t\nORDER BY t",
"query": "SELECT \n $timeSeries AS t,\n blob1 AS cdnVersion,\n\tCOUNT() as total\nFROM hive_ha_cdn_usage_TABLE_SUFFIX\nWHERE $timeFilter\nGROUP BY cdnVersion, t\nORDER BY t",
"rawQuery": "SELECT \n (intDiv(toUInt32(timestamp), 1) * 1) * 1000 AS t,\n blob1 AS cdnVersion,\n\tCOUNT() as total\nFROM hive_ha_cdn_usage_TABLE_SUFFIX\nWHERE timestamp >= toDateTime(1671444913) AND timestamp <= toDateTime(1671445813)\nGROUP BY cdnVersion, t\nORDER BY t",
"refId": "A",
"round": "0s",
"skip_comments": true
@ -1275,8 +1275,8 @@
"format": "time_series",
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"intervalFactor": 1,
"query": "SELECT\n $timeSeries AS t,\n blob1,\n blob2,\n COUNT() as total\nFROM hive_ha_cdn_error_ENV_NAME\n\nWHERE $timeFilter\n\nGROUP BY\n t,\n blob1,\n blob2\nORDER BY t\n",
"rawQuery": "SELECT\n (intDiv(toUInt32(timestamp), 1) * 1) * 1000 AS t,\n blob1,\n blob2,\n COUNT() as total\nFROM hive_ha_cdn_error_ENV_NAME\n\nWHERE timestamp >= toDateTime(1674578665) AND timestamp <= toDateTime(1674579565)\n\nGROUP BY\n t,\n blob1,\n blob2\nORDER BY t",
"query": "SELECT\n $timeSeries AS t,\n blob1,\n blob2,\n COUNT() as total\nFROM hive_ha_cdn_error_TABLE_SUFFIX\n\nWHERE $timeFilter\n\nGROUP BY\n t,\n blob1,\n blob2\nORDER BY t\n",
"rawQuery": "SELECT\n (intDiv(toUInt32(timestamp), 1) * 1) * 1000 AS t,\n blob1,\n blob2,\n COUNT() as total\nFROM hive_ha_cdn_error_TABLE_SUFFIX\n\nWHERE timestamp >= toDateTime(1674578665) AND timestamp <= toDateTime(1674579565)\n\nGROUP BY\n t,\n blob1,\n blob2\nORDER BY t",
"refId": "A",
"round": "0s",
"skip_comments": true
@ -1344,8 +1344,8 @@
"format": "time_series",
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"intervalFactor": 1,
"query": "SELECT \n $timeSeries AS t,\n blob1,\n blob2,\n\tCOUNT() as total\nFROM hive_ha_cdn_error_ENV_NAME\nWHERE $timeFilter\nGROUP BY blob1, blob2, t\nORDER BY t",
"rawQuery": "SELECT \n (intDiv(toUInt32(timestamp), 30) * 30) * 1000 AS t,\n blob1,\n blob2,\n\tCOUNT() as total\nFROM hive_ha_cdn_error_ENV_NAME\nWHERE timestamp >= toDateTime(1672691916) AND timestamp <= toDateTime(1672735116)\nGROUP BY blob1, blob2, t\nORDER BY t",
"query": "SELECT \n $timeSeries AS t,\n blob1,\n blob2,\n\tCOUNT() as total\nFROM hive_ha_cdn_error_TABLE_SUFFIX\nWHERE $timeFilter\nGROUP BY blob1, blob2, t\nORDER BY t",
"rawQuery": "SELECT \n (intDiv(toUInt32(timestamp), 30) * 30) * 1000 AS t,\n blob1,\n blob2,\n\tCOUNT() as total\nFROM hive_ha_cdn_error_TABLE_SUFFIX\nWHERE timestamp >= toDateTime(1672691916) AND timestamp <= toDateTime(1672735116)\nGROUP BY blob1, blob2, t\nORDER BY t",
"refId": "A",
"round": "0s",
"skip_comments": true
@ -1420,8 +1420,8 @@
"format": "time_series",
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"intervalFactor": 1,
"query": "SELECT \n $timeSeries AS t,\n\tCOUNT() as total\nFROM hive_ha_cdn_error_ENV_NAME\nWHERE $timeFilter\nGROUP BY t\nORDER BY t",
"rawQuery": "SELECT \n (intDiv(toUInt32(timestamp), 15) * 15) * 1000 AS t,\n\tCOUNT() as total\nFROM hive_ha_cdn_error_ENV_NAME\nWHERE timestamp >= toDateTime(1674558093) AND timestamp <= toDateTime(1674579693)\nGROUP BY t\nORDER BY t",
"query": "SELECT \n $timeSeries AS t,\n\tCOUNT() as total\nFROM hive_ha_cdn_error_TABLE_SUFFIX\nWHERE $timeFilter\nGROUP BY t\nORDER BY t",
"rawQuery": "SELECT \n (intDiv(toUInt32(timestamp), 15) * 15) * 1000 AS t,\n\tCOUNT() as total\nFROM hive_ha_cdn_error_TABLE_SUFFIX\nWHERE timestamp >= toDateTime(1674558093) AND timestamp <= toDateTime(1674579693)\nGROUP BY t\nORDER BY t",
"refId": "A",
"round": "0s",
"skip_comments": true
@ -1521,8 +1521,8 @@
"format": "time_series",
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"intervalFactor": 1,
"query": "SELECT\n $timeSeries AS t,\n blob1 AS action,\n blob2 AS value,\n COUNT() as total\nFROM hive_ha_cdn_key_validation_ENV_NAME\n\nWHERE $timeFilter\n\nGROUP BY\n action,\n value,\n t\nORDER BY t\n",
"rawQuery": "SELECT\n (intDiv(toUInt32(timestamp), 2) * 2) * 1000 AS t,\n blob1 AS action,\n blob2 AS value,\n COUNT() as total\nFROM hive_ha_cdn_key_validation_ENV_NAME\n\nWHERE timestamp >= toDateTime(1674646874) AND timestamp <= toDateTime(1674650474)\n\nGROUP BY\n action,\n value,\n t\nORDER BY t",
"query": "SELECT\n $timeSeries AS t,\n blob1 AS action,\n blob2 AS value,\n COUNT() as total\nFROM hive_ha_cdn_key_validation_TABLE_SUFFIX\n\nWHERE $timeFilter\n\nGROUP BY\n action,\n value,\n t\nORDER BY t\n",
"rawQuery": "SELECT\n (intDiv(toUInt32(timestamp), 2) * 2) * 1000 AS t,\n blob1 AS action,\n blob2 AS value,\n COUNT() as total\nFROM hive_ha_cdn_key_validation_TABLE_SUFFIX\n\nWHERE timestamp >= toDateTime(1674646874) AND timestamp <= toDateTime(1674650474)\n\nGROUP BY\n action,\n value,\n t\nORDER BY t",
"refId": "A",
"round": "0s",
"skip_comments": true
@ -1590,8 +1590,8 @@
"format": "time_series",
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"intervalFactor": 1,
"query": "SELECT\n $timeSeries AS t,\n blob1 AS action,\n blob2 AS value,\n COUNT() as total\nFROM hive_ha_cdn_key_validation_ENV_NAME\n\nWHERE $timeFilter\n\nGROUP BY\n action,\n value,\n t\nORDER BY t\n",
"rawQuery": "SELECT\n (intDiv(toUInt32(timestamp), 2) * 2) * 1000 AS t,\n blob1 AS action,\n blob2 AS value,\n COUNT() as total\nFROM hive_ha_cdn_key_validation_ENV_NAME\n\nWHERE timestamp >= toDateTime(1674646880) AND timestamp <= toDateTime(1674650480)\n\nGROUP BY\n action,\n value,\n t\nORDER BY t",
"query": "SELECT\n $timeSeries AS t,\n blob1 AS action,\n blob2 AS value,\n COUNT() as total\nFROM hive_ha_cdn_key_validation_TABLE_SUFFIX\n\nWHERE $timeFilter\n\nGROUP BY\n action,\n value,\n t\nORDER BY t\n",
"rawQuery": "SELECT\n (intDiv(toUInt32(timestamp), 2) * 2) * 1000 AS t,\n blob1 AS action,\n blob2 AS value,\n COUNT() as total\nFROM hive_ha_cdn_key_validation_TABLE_SUFFIX\n\nWHERE timestamp >= toDateTime(1674646880) AND timestamp <= toDateTime(1674650480)\n\nGROUP BY\n action,\n value,\n t\nORDER BY t",
"refId": "A",
"round": "0s",
"skip_comments": true

View file

@ -40,4 +40,5 @@ grafanaDashboards:params:
Then, in the dashboard's JSON model file, you can use the variable name, as is (we do a simple
string replacement).
> The `ENV_NAME` is injected automatically, with the name of the Pulumi stack.
> The `TABLE_SUFFIX` is injected automatically, with the name of the Pulumi stack ("prod" is
> replaced with "production").

View file

@ -74,7 +74,10 @@ const environment = prepareEnvironment({
rootDns: new pulumi.Config('common').require('dnsZone'),
});
deploySentryEventsMonitor({ docker, environment, sentry });
const observability = deployObservability({ envName });
const observability = deployObservability({
envName,
tableSuffix: envName === 'prod' ? 'production' : envName,
});
const clickhouse = deployClickhouse();
const postgres = deployPostgres();
const redis = deployRedis({ environment });

View file

@ -5,7 +5,11 @@ import * as pulumi from '@pulumi/pulumi';
const dashboardDirectory = join(__dirname, '../grafana-dashboards/');
export function deployGrafana(envName: string) {
/**
* @param envName name of the stack (prod, staging, dev)
* @param tableSuffix suffix for the table names (production, staging, dev)
*/
export function deployGrafana(envName: string, tableSuffix: string) {
const availableFiles = readdirSync(dashboardDirectory)
.filter(f => f.endsWith('.json'))
// Temp workaround
@ -17,7 +21,7 @@ export function deployGrafana(envName: string) {
const params = new pulumi.Config('grafanaDashboards').requireObject<Record<string, string>>(
'params',
);
params['ENV_NAME'] = envName;
params['TABLE_SUFFIX'] = tableSuffix;
const dashboards = availableFiles.map(filePath => {
const fullPath = join(dashboardDirectory, filePath);

View file

@ -3,7 +3,14 @@ import { serviceLocalHost } from '../utils/local-endpoint';
import { Observability as ObservabilityInstance } from '../utils/observability';
import { deployGrafana } from './grafana';
export function deployObservability(config: { envName: string }) {
export function deployObservability(config: {
envName: string;
/**
* Suffix for the table names (production, staging, dev).
* It can't be envName as "prod" is not a valid table suffix.
*/
tableSuffix: string;
}) {
const observabilityConfig = new pulumi.Config('observability');
if (!observabilityConfig.getBoolean('enabled')) {
@ -41,7 +48,7 @@ export function deployObservability(config: { envName: string }) {
host => `http://${host}:4318/v1/traces`,
),
observability: observabilityInstance,
grafana: deployGrafana(config.envName),
grafana: deployGrafana(config.envName, config.tableSuffix),
enabled: true,
};
}