Sophonz Chart Panels
The eight chart panels built on the shared Sophonz Chart library — TopN, Hitmap, Equalizer, Arc Equalizer, Waterfall, Line, Pie and Gauge — with the frame shape each one reads, every option and a query from a provisioned dashboard.
The panels in Custom Panels each solve one Sophonz-specific view. The eight on this page are general-purpose charts: a ranked time series, a density heatmap, a proportion band, a multi-ring donut, a phase bar, a line chart with threshold bands, a pie and an arc gauge. They are drawn by one shared canvas library, Sophonz Chart, so they share a palette, tooltips, field detection and option names. The Sophonz RUM (v3) and Sophonz Charts (v3) dashboards are built from them.
The panels
| Panel | id | Version documented | Draws | Dashboards |
|---|---|---|---|---|
| Sophonz TopN | sophonz-topn-panel | 1.0.0 | Time series on top, ranking bars below, in the same colours | RUM, Charts |
| Sophonz Hitmap | sophonz-hitmap-panel | 1.0.0 | Time × value density grid with a separate error ramp | RUM, Charts |
| Sophonz Equalizer | sophonz-equalizer-panel | 1.0.0 | One horizontal band split by group share | RUM, Charts |
| Sophonz Arc Equalizer | sophonz-arc-equalizer-panel | 1.0.0 | Concentric rings, each split into segments | RUM, Charts |
| Sophonz Waterfall | sophonz-waterfall-panel | 1.0.0 | Phases laid end to end in one bar | Charts |
| Sophonz Line | sophonz-line-panel | 1.0.0 | Multi-series line or area chart with threshold bands | RUM |
| Sophonz Pie | sophonz-pie-panel | 1.0.0 | Pie or donut with a legend | RUM |
| Sophonz Gauge | sophonz-gauge-panel | 1.0.0 | One value on an arc, coloured by band | RUM |
They install the same way as the other custom panels — a pinned zip from the CDN in GF_INSTALL_PLUGINS, and the id in GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS. See How they are installed.
https://cdn.sophonz.com/release/grafana/plugins/sophonz-topn-panel/1.0.0/sophonz-topn-panel.zip;sophonz-topn-panelBoth dashboards that use these panels are provisioned into the main organization. The public demo organization does not carry them. Where each panel sits is in the Dashboard Reference.
Common rules
Theme. Light or dark follows Grafana, and the axes, grid and tooltip take Grafana's colours. The series palette is Sophonz Chart's own and changes with the mode.
Title. These panels draw no title of their own. Use the Grafana panel title.
Field mapping. Every field option takes a column name, matched case-insensitively — an exact match first, then a substring. Left empty, the panel looks for a column whose name contains one of its keywords, and failing that takes the first unused column of the right type. Naming columns with AS in the query is the reliable way to get the right one.
Two frame shapes. Equalizer, Waterfall, Pie and Gauge read rows first: one row per group, with a string column and a numeric column. If a result has no such pair, they fall back to reading it as time series and collapse each series to one number with the reducer option (sum, max, mean or last). mean and last skip missing values. TopN and Line only read time series.
Time series and labels. A time series is a time column plus one or more numeric columns; each numeric column becomes a series. With the ClickHouse data source in Time Series format ("format": 0), a long (time, label, value) query is split per label by the data source, and the panel names each series by the label value — Chrome, not c {browser="Chrome"}. Several labels are joined with /. This is why the TopN and Line queries below keep the label column instead of pivoting with countIf: a new label value needs no query change.
Colours. colors is a comma-separated list of name=#hex pairs, matched to group names case-insensitively. Anything not listed takes the next palette colour.
Units. unit is a Grafana unit id (short, ms, percent, bytes, …) and decimals the number of decimal places.
Empty results. A panel with nothing to draw shows 데이터 없음. Gauge is the exception: with no value it shows 0.
The JSON below is the panel definition taken from the provisioned dashboards. The per-query datasource is the same as the panel's and has been left out.
Sophonz TopN
A time series with a ranking under it. The top part draws one line per series; the bottom part reduces each series to one number and lists the largest as horizontal bars. A series has the same colour in both parts, so a bar can be traced back to its line. Use it when the question is both "which ones are biggest" and "when".
Colours follow the order the series arrive in, and only the bars are sorted. Every series is drawn as a line even when the ranking shows fewer rows. When the ranking has more rows than fit, the rows get thinner instead of being cut off.
Data. Time series: a time column and one or more numeric columns, or a long (time, label, value) result in Time Series format. The time axis spans the data's first and last timestamp, or the dashboard range when there is no data.
Options
| Option | Default | Meaning |
|---|---|---|
maxRows | 6 | Rows in the ranking, 1–30. The largest by reducer are kept |
lineRatio | 0.62 | Share of the panel height given to the time series, 0.2–0.9. The rest is the ranking |
area | false | Fill under the lines |
peakMarker | true | Mark and label the largest point across all series |
xGridLines | false | Vertical dotted grid lines |
reducer | sum | How a series becomes its ranking number: sum, max, mean or last |
unit | "" | Unit for the y axis and the ranking numbers. Empty abbreviates, like 1.2K |
decimals | 0 | Decimal places. Only applied when unit is set |
timeField | "" | Time column. Empty uses the time-typed field |
valueFields | "" | Comma-separated names; a numeric column is kept when its name contains one of them. Empty uses every numeric column |
{
"type": "sophonz-topn-panel",
"title": "화면별 페이지 로드 TopN",
"datasource": {
"type": "grafana-clickhouse-datasource",
"uid": "clickhouse"
},
"targets": [
{
"refId": "A",
"format": 0,
"editorType": "sql",
"queryType": "table",
"rawSql": "SELECT\n $__timeInterval(timestamp) AS time,\n if(appScreenName != '', appScreenName, stringTagMap['app.screen.name']) AS screen,\n count() AS loads\nFROM sophonz_traces.distributed_sophonz_index_v2\nWHERE $__timeFilter(timestamp)\n AND webVersion != ''\n AND $__conditionalAll(serviceNamespace IN (${serviceNamespace:singlequote}), $serviceNamespace)\n AND $__conditionalAll(serviceName IN (${serviceName:singlequote}), $serviceName)\n AND $__conditionalAll(if(appScreenName != '', appScreenName, stringTagMap['app.screen.name']) IN (${screen:singlequote}), $screen)\n AND lower(if(appSpanType != '', appSpanType, stringTagMap['span.type'])) = 'render'\n AND if(appScreenName != '', appScreenName, stringTagMap['app.screen.name']) != ''\nGROUP BY time, screen\nORDER BY time"
}
],
"options": {
"area": false,
"decimals": 0,
"lineRatio": 0.6,
"maxRows": 8,
"peakMarker": true,
"reducer": "sum",
"timeField": "",
"unit": "short",
"valueFields": "",
"xGridLines": false
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 10
}
}Sophonz Hitmap
A density heatmap of individual events. Time runs across in bins, the value — normally a duration — runs up in buckets, and each cell's colour says how many events landed in it. A cell holding at least one error switches to a second colour ramp and is shaded by its error count, so failures stand out from an otherwise normal band. Use it to see the shape of a latency distribution over time rather than a single percentile line.
It differs from Request Map, which colours cells by the dominant HTTP status class. Hitmap colours by density and knows only error or not.
Events are gathered into the grid before drawing, so the cost of rendering does not grow with the row count. Hovering a cell shows the bin's start time, its value range, the count and, if any, the error count.
Data. One row per event with a time column and a numeric value column. An optional error column (boolean, 0/1) marks errors; without one, a status code column is used and 400 and above counts as an error. Pre-aggregated rows can carry a count column, in which case a row stands for that many events, up to 5,000 per row. Rows outside the dashboard time range are dropped.
Colour steps. hitLevels and errorLevels are three ascending counts. A cell uses the lightest colour up to the second number, the middle colour above it and the strongest colour above the third. With 0,5,20, a cell holding 1–5 events is lightest, 6–20 middle, 21 and above strongest. Set them to match the traffic: the defaults are sized for a busy service, and a quiet one draws everything in the lightest colour.
Options
| Option | Default | Meaning |
|---|---|---|
autoScale | true | Fit the top of the y axis to the largest value, with a little headroom |
maxValue | 0 | Top of the y axis in the chosen unit. Used only when autoScale is off; 0 reads it from the data |
errorOnly | false | Draw only the events marked as errors |
yScale | linear | linear or log. Log spreads out the short end, where most requests sit |
rows | 40 | Number of value buckets, 5–120 |
binMs | 0 | Width of a time bin in ms. 0 divides the dashboard range into 120 columns, with a 1 s minimum |
unit | ms | Unit for the y axis labels |
hitLevels | 0,150,300 | Density steps for cells without errors. Falls back to the default unless exactly three numbers are given |
errorLevels | 0,3,6 | Density steps for cells with errors |
timeField | "" | Event time. Empty uses the time-typed field |
valueField | "" | The y value. Empty picks a numeric column named like duration, responsetime, latency, elapsed, ms or value, otherwise the first numeric column |
errorField | "" | Error flag. Empty looks for haserror, iserror, error or failed |
statusField | "" | Status code, used when there is no error column. Empty looks for statuscode, status, code, … |
countField | "" | Events per row for pre-aggregated results. Empty looks for a numeric column named like count, hits, requests or total |
A result frame without both a time and a value field is skipped.
{
"type": "sophonz-hitmap-panel",
"title": "Fetch/XHR 응답시간 분포",
"datasource": {
"type": "grafana-clickhouse-datasource",
"uid": "clickhouse"
},
"targets": [
{
"refId": "A",
"format": 1,
"editorType": "sql",
"queryType": "table",
"rawSql": "SELECT timestamp AS time, durationNano / 1e6 AS duration, hasError\nFROM sophonz_traces.distributed_sophonz_index_v2\nWHERE $__timeFilter(timestamp)\n AND webVersion != ''\n AND $__conditionalAll(serviceNamespace IN (${serviceNamespace:singlequote}), $serviceNamespace)\n AND $__conditionalAll(serviceName IN (${serviceName:singlequote}), $serviceName)\n AND $__conditionalAll(if(appScreenName != '', appScreenName, stringTagMap['app.screen.name']) IN (${screen:singlequote}), $screen)\n AND lower(if(appSpanType != '', appSpanType, stringTagMap['span.type'])) IN ('fetch','xhr')\nORDER BY time\nLIMIT 200000"
}
],
"options": {
"autoScale": true,
"binMs": 0,
"countField": "",
"errorField": "hasError",
"errorLevels": "0,1,3",
"errorOnly": false,
"hitLevels": "0,3,10",
"maxValue": 0,
"rows": 40,
"statusField": "",
"timeField": "",
"unit": "ms",
"valueField": "duration",
"yScale": "log"
},
"gridPos": {
"h": 10,
"w": 16,
"x": 0,
"y": 18
}
}Sophonz Equalizer
One horizontal band divided between groups in proportion to their values, each part filled with a run of thin vertical bars. The total sits in the middle. It answers "what share is slow" at a glance and takes very little height, so it fits in a short row.
Groups are laid out left to right in the order the query returns them. The provisioned queries sort by the lower bound of each bucket so the fast group is always on the left. Hovering a part shows its value and percentage.
Data. Rows of (label, value): a string column and a numeric column. A time-series result is also accepted, one group per series, reduced with reducer.
Options
| Option | Default | Meaning |
|---|---|---|
colors | "" | name=#hex pairs. Empty walks the palette in order |
barPitch | 6 | Spacing between the vertical bars in px, 2–24 |
showTotal | true | Show the sum of all groups in the middle of the band |
leadingLabel | "" | Text to the left of the band. Hidden when empty |
trailingLabel | "" | Text to the right of the band. Hidden when empty |
unit | "" | Unit for the total and tooltip. Empty abbreviates numbers |
decimals | 0 | Decimal places. Only applied when unit is set |
reducer | last | Used only for time-series input |
labelField | "" | Group name. Empty looks for a string column named like label, name, group, status, type or category, otherwise the first string column |
valueField | "" | Group value. Empty looks for count, value, total or hits, otherwise the first numeric column |
{
"type": "sophonz-equalizer-panel",
"title": "Fetch/XHR 속도 분포",
"datasource": {
"type": "grafana-clickhouse-datasource",
"uid": "clickhouse"
},
"targets": [
{
"refId": "A",
"format": 1,
"editorType": "sql",
"queryType": "table",
"rawSql": "SELECT label, value\nFROM (\n SELECT\n multiIf(durationNano < 300000000, 'Normal',\n durationNano < 1000000000, 'Slow', 'Very Slow') AS label,\n count() AS value,\n min(durationNano) AS ord\n FROM sophonz_traces.distributed_sophonz_index_v2\n WHERE $__timeFilter(timestamp)\n AND webVersion != ''\n AND $__conditionalAll(serviceNamespace IN (${serviceNamespace:singlequote}), $serviceNamespace)\n AND $__conditionalAll(serviceName IN (${serviceName:singlequote}), $serviceName)\n AND $__conditionalAll(if(appScreenName != '', appScreenName, stringTagMap['app.screen.name']) IN (${screen:singlequote}), $screen)\n AND lower(if(appSpanType != '', appSpanType, stringTagMap['span.type'])) IN ('fetch','xhr')\n GROUP BY label\n)\nORDER BY ord"
}
],
"options": {
"barPitch": 6,
"colors": "Normal=#2295FF,Slow=#FF9900,Very Slow=#DF3737",
"decimals": 0,
"labelField": "label",
"leadingLabel": "빠름",
"reducer": "last",
"showTotal": true,
"trailingLabel": "느림",
"unit": "short",
"valueField": "value"
},
"gridPos": {
"h": 4,
"w": 12,
"x": 12,
"y": 28
}
}Sophonz Arc Equalizer
Concentric rings, one per entity — a service, an instance, a metric — each divided into segments such as status or rating. A segment name keeps the same colour on every ring, so the same slice of the distribution can be compared across entities in one figure.
Rings are ordered by their total, largest outside, and anything past maxRings is dropped. The centre shows the sum of the rings drawn. Hovering a segment shows the ring name, the segment and its value.
By default each ring fills a full turn with its own total, which compares shares: a small service and a large one both draw a complete ring. Turn on sharedScale to scale every ring to the largest total, so shorter arcs mean less volume.
Data. Rows of (ring, segment, value): two string columns and a numeric column. Rows with the same ring and segment are added together. With only one string column, each ring is drawn as a single segment.
Options
| Option | Default | Meaning |
|---|---|---|
colors | "" | name=#hex pairs for segment names. Unlisted segments take palette colours in order of first appearance |
maxRings | 8 | Most rings drawn, 1–20 |
ringThickness | 14 | Ring thickness in px. An upper bound — rings get thinner when there are many |
ringGap | 3 | Gap between rings in px |
sharedScale | false | Scale every ring to the largest ring total instead of its own |
centerCaption | "" | Small text under the centre total |
unit | "" | Unit for the total and tooltip. Empty abbreviates numbers |
decimals | 0 | Decimal places. Only applied when unit is set |
ringField | "" | One ring per distinct value. Empty looks for a string column named like instance, service, host, app, ring or name |
segmentField | "" | Splits each ring. Empty looks for status, state, level, segment, category or type, otherwise the next string column |
valueField | "" | Segment value. Empty looks for count, value or total, otherwise the first numeric column |
A result frame without a ring field and a value field is skipped.
{
"type": "sophonz-arc-equalizer-panel",
"title": "Web Vitals 평가 분포",
"datasource": {
"type": "grafana-clickhouse-datasource",
"uid": "clickhouse"
},
"targets": [
{
"refId": "A",
"format": 1,
"editorType": "sql",
"queryType": "table",
"rawSql": "SELECT\n upper(stringTagMap['browser.web_vital.name']) AS ring,\n stringTagMap['browser.web_vital.rating'] AS segment,\n count() AS value\nFROM sophonz_traces.distributed_sophonz_index_v2\nWHERE $__timeFilter(timestamp)\n AND webVersion != ''\n AND $__conditionalAll(serviceNamespace IN (${serviceNamespace:singlequote}), $serviceNamespace)\n AND $__conditionalAll(serviceName IN (${serviceName:singlequote}), $serviceName)\n AND $__conditionalAll(if(appScreenName != '', appScreenName, stringTagMap['app.screen.name']) IN (${screen:singlequote}), $screen)\n AND stringTagMap['browser.web_vital.name'] != ''\nGROUP BY ring, segment"
}
],
"options": {
"centerCaption": "vitals",
"colors": "good=#00B543,needs-improvement=#FF9900,poor=#DF3737",
"decimals": 0,
"maxRings": 5,
"ringField": "ring",
"ringGap": 3,
"ringThickness": 12,
"segmentField": "segment",
"sharedScale": false,
"unit": "short",
"valueField": "value"
},
"gridPos": {
"h": 6,
"w": 4,
"x": 20,
"y": 4
}
}Sophonz Waterfall
A single bar made of phases laid end to end, each as wide as its duration. It suits steps that follow one another and add up to a whole — the stages of a query, the phases of a page load. A legend above the bar lists each phase with its value, and hovering a phase shows its value and share of the total. A phase with any duration at all is drawn at least 2 px wide, so short steps stay visible.
Order is the point of this chart, so it can be pinned with order instead of relying on the query. Phases not named in order follow the named ones.
Data. Rows of (phase, duration): a string column and a numeric column, one row per phase. A time-series result is also accepted, one phase per series, reduced with reducer.
Options
| Option | Default | Meaning |
|---|---|---|
order | "" | Comma-separated phase names, case-insensitive. Empty keeps the query's order |
colors | "" | name=#hex pairs. Empty walks the palette in order |
legend | true | Show the legend above the bar |
barHeight | 34 | Bar height in px, 8–120 |
total | 0 | Full length of the bar, in the chosen unit. 0 uses the sum of the phases; a larger value leaves the remainder empty on the right |
unit | ms | Unit for the legend and tooltip |
decimals | 0 | Decimal places |
reducer | mean | Used only for time-series input |
labelField | "" | Phase name. Empty looks for a string column named like phase, label, name, step or stage, otherwise the first string column |
durationField | "" | Phase length. Empty looks for duration, ms, elapsed, time or value, otherwise the first numeric column |
The provisioned example reads the phases of PostgreSQL queries reported by the database's own tracing: it is filtered to one service by name, so change serviceName to your own before reusing it.
{
"type": "sophonz-waterfall-panel",
"title": "쿼리 단계별 소요시간",
"datasource": {
"type": "grafana-clickhouse-datasource",
"uid": "clickhouse"
},
"targets": [
{
"refId": "A",
"format": 0,
"editorType": "sql",
"queryType": "table",
"rawSql": "SELECT\n component AS phase,\n sum(durationNano) / 1e6 AS duration\nFROM sophonz_traces.distributed_sophonz_index_v2\nWHERE $__timeFilter(timestamp)\n AND serviceName = 'sophonz-postgres'\n AND component IN ('Planner','ExecutorRun','Result')\n AND $__conditionalAll(serviceNamespace IN (${serviceNamespace:singlequote}), $serviceNamespace)\nGROUP BY phase"
}
],
"options": {
"barHeight": 28,
"colors": "Planner=#7632FF,ExecutorRun=#2295FF,Result=#00BEB8",
"decimals": 3,
"durationField": "duration",
"labelField": "phase",
"legend": true,
"order": "Planner,ExecutorRun,Result",
"reducer": "mean",
"total": 0,
"unit": "ms"
},
"gridPos": {
"h": 6,
"w": 8,
"x": 16,
"y": 6
}
}Sophonz Line
A multi-series line or area chart. What it adds over a plain time series is threshold bands: coloured background stripes at fixed values, so it is obvious when a line crossed from good to poor without reading the axis. It is meant for metrics with agreed limits, such as Core Web Vitals.
A missing value breaks the line instead of being bridged. Hovering shows a vertical crosshair and one tooltip with every series' value at that time.
Data. Time series, the same as TopN.
Bands. bands is a comma-separated list of label:from-to:colour. Leave the upper bound off for "and above", as in poor:4000-:#DF373726. Use a colour with an alpha channel so the lines stay readable. An entry that does not parse is skipped rather than breaking the chart. Bands are drawn against the y axis, so pin maxValue if they should stay in the same place as data changes.
Options
| Option | Default | Meaning |
|---|---|---|
bands | "" | Threshold bands, as above |
area | false | Fill under the lines |
peakMarker | true | Mark and label the largest point across all series |
xGridLines | false | Vertical dotted grid lines |
lineWidth | 1.5 | Line width in px, 0.5–4 |
maxValue | 0 | Top of the y axis. 0 reads it from the data |
unit | "" | Unit for the y axis and tooltip. Empty abbreviates numbers |
decimals | 0 | Decimal places. Only applied when unit is set |
timeField | "" | Time column. Empty uses the time-typed field |
valueFields | "" | Comma-separated names; a numeric column is kept when its name contains one of them. Empty uses every numeric column |
The provisioned panel draws LCP, FCP and TTFB together against the LCP limits of 2.5 s and 4 s.
{
"type": "sophonz-line-panel",
"title": "LCP 추이",
"datasource": {
"type": "grafana-clickhouse-datasource",
"uid": "clickhouse"
},
"targets": [
{
"refId": "A",
"format": 0,
"editorType": "sql",
"queryType": "table",
"rawSql": "SELECT\n $__timeInterval(timestamp) AS time,\n upper(stringTagMap['browser.web_vital.name']) AS vital,\n avg(numberTagMap['browser.web_vital.value']) AS value\nFROM sophonz_traces.distributed_sophonz_index_v2\nWHERE $__timeFilter(timestamp)\n AND webVersion != ''\n AND $__conditionalAll(serviceNamespace IN (${serviceNamespace:singlequote}), $serviceNamespace)\n AND $__conditionalAll(serviceName IN (${serviceName:singlequote}), $serviceName)\n AND $__conditionalAll(if(appScreenName != '', appScreenName, stringTagMap['app.screen.name']) IN (${screen:singlequote}), $screen)\n AND stringTagMap['browser.web_vital.name'] IN ('lcp','fcp','ttfb')\nGROUP BY time, vital\nORDER BY time"
}
],
"options": {
"area": false,
"bands": "좋음:0-2500:#00B54326,개선 필요:2500-4000:#FF990026,나쁨:4000-:#DF373726",
"decimals": 0,
"lineWidth": 1.5,
"maxValue": 6000,
"peakMarker": true,
"timeField": "",
"unit": "ms",
"valueFields": "",
"xGridLines": false
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 10
}
}Sophonz Pie
A pie, or a donut with a total in the hole. Slices are drawn in the order the query returns them and the legend lists the same names. Hovering a slice shows its value and percentage.
When there are more slices than maxSlices, the largest maxSlices − 1 are kept and the rest are folded into one slice labelled 기타.
Data. Rows of (label, value): a string column and a numeric column. A time-series result is also accepted, one slice per series, reduced with reducer.
Options
| Option | Default | Meaning |
|---|---|---|
donut | 0 | Inner radius as a share of the outer, 0–0.85. 0 draws a full pie |
showTotal | true | Show the sum in the middle. Only visible when donut is above 0 |
centerCaption | "" | Small text under the total. Only visible when donut is above 0 |
legend | right | Legend position: right, bottom or none |
maxSlices | 8 | Most slices drawn, 2–20, including the folded one |
colors | "" | name=#hex pairs. Empty walks the palette in order |
unit | short | Unit for values |
decimals | 0 | Decimal places |
labelField | "" | Slice name. Empty looks for a string column named like label, name, browser, os, group, type, category or screen, otherwise the first string column |
valueField | "" | Slice value. Empty looks for count, value, total, sessions or hits, otherwise the first numeric column |
reducer | sum | Used only for time-series input |
{
"type": "sophonz-pie-panel",
"title": "브라우저별 세션",
"datasource": {
"type": "grafana-clickhouse-datasource",
"uid": "clickhouse"
},
"targets": [
{
"refId": "A",
"format": 1,
"editorType": "sql",
"queryType": "table",
"rawSql": "SELECT\n resourceTagsMap['sophonz.browser.name'] AS browser,\n uniqExact(sessionID) AS sessions\nFROM sophonz_traces.distributed_sophonz_index_v2\nWHERE $__timeFilter(timestamp)\n AND webVersion != ''\n AND $__conditionalAll(serviceNamespace IN (${serviceNamespace:singlequote}), $serviceNamespace)\n AND $__conditionalAll(serviceName IN (${serviceName:singlequote}), $serviceName)\n AND $__conditionalAll(if(appScreenName != '', appScreenName, stringTagMap['app.screen.name']) IN (${screen:singlequote}), $screen)\nGROUP BY browser\nORDER BY sessions DESC"
}
],
"options": {
"centerCaption": "세션",
"colors": "",
"decimals": 0,
"donut": 0.62,
"labelField": "browser",
"legend": "right",
"maxSlices": 8,
"reducer": "sum",
"showTotal": true,
"unit": "short",
"valueField": "sessions"
},
"gridPos": {
"h": 5,
"w": 8,
"x": 16,
"y": 18
}
}Sophonz Gauge
One value on a 270° arc, with the number in the middle. Bands give the arc its colour and put a word under the number — the name of the band the value fell into — so the panel reads as "2.1 s, good" without a legend. Small ticks on the arc mark where each band starts.
The arc is filled in proportion to where the value sits between min and max and stops at either end; the number itself is always the real value.
Data. A single number. The panel collects every value of the value column; one value is used as is, and several are reduced with reducer. A one-row SELECT … AS value is the usual input.
Bands. bands is a comma-separated list of label:from:colour, where from is the lower bound of the band. The value belongs to the last band whose lower bound it has reached. Without bands the arc uses the first palette colour and no caption is shown unless caption is set.
Options
| Option | Default | Meaning |
|---|---|---|
min | 0 | Value at the start of the arc |
max | 100 | Value at the end of the arc |
bands | "" | Value bands, as above |
thickness | 14 | Arc thickness in px, 4–40 |
caption | "" | Text under the number. Empty shows the current band's label |
unit | "" | Unit for the number. Empty means none |
decimals | 0 | Decimal places |
valueField | "" | Value column. Empty looks for a numeric column named like value, score, avg, mean, p50, p95 or count, otherwise the first numeric column |
reducer | mean | How several values become one: mean, last, max or sum |
The RUM dashboard uses five of these in a row for LCP, FCP, INP, CLS and TTFB. Only the metric name in the query, max and the band limits differ between them.
{
"type": "sophonz-gauge-panel",
"title": "LCP",
"datasource": {
"type": "grafana-clickhouse-datasource",
"uid": "clickhouse"
},
"targets": [
{
"refId": "A",
"format": 1,
"editorType": "sql",
"queryType": "table",
"rawSql": "SELECT avg(numberTagMap['browser.web_vital.value']) AS value\nFROM sophonz_traces.distributed_sophonz_index_v2\nWHERE $__timeFilter(timestamp)\n AND webVersion != ''\n AND $__conditionalAll(serviceNamespace IN (${serviceNamespace:singlequote}), $serviceNamespace)\n AND $__conditionalAll(serviceName IN (${serviceName:singlequote}), $serviceName)\n AND $__conditionalAll(if(appScreenName != '', appScreenName, stringTagMap['app.screen.name']) IN (${screen:singlequote}), $screen)\n AND stringTagMap['browser.web_vital.name'] = 'lcp'"
}
],
"options": {
"bands": "좋음:0:#00B543,개선 필요:2500:#FF9900,나쁨:4000:#DF3737",
"caption": "",
"decimals": 0,
"max": 6000,
"min": 0,
"reducer": "mean",
"thickness": 14,
"unit": "ms",
"valueField": "value"
},
"gridPos": {
"h": 6,
"w": 4,
"x": 0,
"y": 4
}
}