Skip to content

Commit 7d58919

Browse files
authored
Grafana: Use 'production' instead of 'prod' in ENV_NAME variable and add p95 for R2 calls (#5544)
1 parent b5ddafb commit 7d58919

File tree

2 files changed

+105
-2
lines changed

2 files changed

+105
-2
lines changed

deployment/grafana-dashboards/CDN-Usage.json

Lines changed: 104 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,109 @@
454454
"title": "R2 calls",
455455
"type": "piechart"
456456
},
457+
{
458+
"datasource": {
459+
"type": "vertamedia-clickhouse-datasource",
460+
"uid": "$Subscription"
461+
},
462+
"fieldConfig": {
463+
"defaults": {
464+
"color": {
465+
"mode": "palette-classic"
466+
},
467+
"custom": {
468+
"axisBorderShow": false,
469+
"axisCenteredZero": false,
470+
"axisColorMode": "text",
471+
"axisLabel": "",
472+
"axisPlacement": "auto",
473+
"axisWidth": 0,
474+
"barAlignment": 0,
475+
"barWidthFactor": 0.6,
476+
"drawStyle": "line",
477+
"fillOpacity": 0,
478+
"gradientMode": "none",
479+
"hideFrom": {
480+
"legend": false,
481+
"tooltip": false,
482+
"viz": false
483+
},
484+
"insertNulls": false,
485+
"lineInterpolation": "linear",
486+
"lineWidth": 1,
487+
"pointSize": 5,
488+
"scaleDistribution": {
489+
"type": "linear"
490+
},
491+
"showPoints": "auto",
492+
"spanNulls": false,
493+
"stacking": {
494+
"group": "A",
495+
"mode": "none"
496+
},
497+
"thresholdsStyle": {
498+
"mode": "off"
499+
}
500+
},
501+
"fieldMinMax": false,
502+
"mappings": [],
503+
"min": 0,
504+
"thresholds": {
505+
"mode": "absolute",
506+
"steps": [
507+
{
508+
"color": "green",
509+
"value": null
510+
}
511+
]
512+
},
513+
"unit": "dtdurationms"
514+
},
515+
"overrides": []
516+
},
517+
"gridPos": {
518+
"h": 7,
519+
"w": 24,
520+
"x": 0,
521+
"y": 21
522+
},
523+
"id": 17,
524+
"options": {
525+
"legend": {
526+
"calcs": ["max", "min", "mean"],
527+
"displayMode": "table",
528+
"placement": "right",
529+
"showLegend": true
530+
},
531+
"tooltip": {
532+
"mode": "single",
533+
"sort": "none"
534+
}
535+
},
536+
"pluginVersion": "11.3.0-74868",
537+
"targets": [
538+
{
539+
"datasource": {
540+
"uid": "$Subscription"
541+
},
542+
"dateTimeColDataType": "timestamp",
543+
"dateTimeType": "DATETIME",
544+
"datetimeLoading": false,
545+
"extrapolate": true,
546+
"format": "time_series",
547+
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
548+
"intervalFactor": 1,
549+
"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",
550+
"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",
551+
"refId": "A",
552+
"round": "0s",
553+
"showFormattedSQL": false,
554+
"skip_comments": true
555+
}
556+
],
557+
"title": "R2 calls (p95 latency)",
558+
"type": "timeseries"
559+
},
457560
{
458561
"datasource": {
459562
"uid": "$Subscription"
@@ -1193,7 +1296,7 @@
11931296
"type": "piechart"
11941297
}
11951298
],
1196-
"refresh": "5s",
1299+
"refresh": "",
11971300
"revision": 1,
11981301
"schemaVersion": 39,
11991302
"tags": ["hive", "cdn"],

deployment/services/cf-cdn.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function deployCFCDN({
2424
const cfConfig = new pulumi.Config('cloudflareCustom');
2525

2626
const cdn = new CloudflareCDN({
27-
envName: environment.envName,
27+
envName: environment.envName === 'prod' ? 'production' : environment.envName,
2828
zoneId: cfConfig.require('zoneId'),
2929
// We can't cdn for staging env, since CF certificate only covers
3030
// one level of subdomains. See: https://community.cloudflare.com/t/ssl-handshake-error-cloudflare-proxy/175088

0 commit comments

Comments
 (0)