grafana / grafana

The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
https://grafana.com
GNU Affero General Public License v3.0
65.13k stars 12.15k forks source link

Feature request: add support for zabbix data source when sharing public dashboards #77458

Closed sebelk closed 11 months ago

sebelk commented 1 year ago

What happened?

On Public Dashboards in some cases "No Data" errors appears in panel as shown below:

5PkcdU8OnjsJ 8IdndxdaS5M2

Also I get http 401 on /api/datasources/1/resources/zabbix-api (always) and in thi case http 404 on https://grafana.example.com/api/public/dashboards/92d96d9bf2f94c65868a932f41949687/panels/2/query

What did you expect to happen?

I expect not to encounter any 404 errors or Data errors. Unauthorized (401) error, it seems harmless when shows data, but this is not the case...

Did this work before?

Yes, but always it shows temporary popup "Unauthorized"

How do we reproduce it?

Steps to recreate this issue:

Click on "Share dashboard or panel  (that uses Zabbix as a datasource)"
Check "Your entire dashbaoard will be public"
Check "Publishing currently only works with a subset of datasource"
Check "Making your dashboard public will cause queries to run each time the dashboard is viewed which may increase costos"
Switch to "Enabled"
Save public dashboard

Is the bug inside a dashboard panel?

Yes, Below one of the panels:

Key Value
Panel timeseries @ 9.3.1 (89b365f8b1)
Grafana 9.3.1 (89b365f8b1) // Enterprise
Panel debug snapshot dashboard ```json { "panels": [ { "id": 2, "gridPos": { "h": 13, "w": 15, "x": 0, "y": 0 }, "type": "timeseries", "title": "Reproduced with embedded data", "datasource": { "type": "grafana", "uid": "grafana" }, "fieldConfig": { "defaults": { "custom": { "drawStyle": "line", "lineInterpolation": "linear", "barAlignment": 0, "lineWidth": 1, "fillOpacity": 21, "gradientMode": "none", "spanNulls": false, "showPoints": "auto", "pointSize": 5, "stacking": { "mode": "none", "group": "A" }, "axisPlacement": "auto", "axisLabel": "CPU LOAD", "axisColorMode": "text", "scaleDistribution": { "type": "linear" }, "axisCenteredZero": false, "hideFrom": { "tooltip": false, "viz": false, "legend": false }, "thresholdsStyle": { "mode": "off" } }, "color": { "mode": "palette-classic" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "max": 100, "min": 0, "unit": "%" }, "overrides": [] }, "options": { "tooltip": { "mode": "single", "sort": "none" }, "legend": { "showLegend": true, "displayMode": "list", "placement": "bottom", "calcs": [] } }, "targets": [ { "refId": "A", "datasource": { "type": "grafana", "uid": "grafana" }, "queryType": "snapshot", "snapshot": [ { "schema": { "refId": "A", "name": "server123: CPU utilization", "fields": [ { "name": "Time", "type": "time", "typeInfo": { "frame": "time.Time" }, "config": {} }, { "name": "Value", "type": "number", "typeInfo": { "frame": "float64", "nullable": true }, "labels": { "host": "server123", "item": "CPU utilization", "item_key": "system.cpu.util" }, "config": { "displayNameFromDS": "server123: CPU utilization", "custom": { "scopedVars": { "__zbx_host": { "text": "", "value": "server123" }, "__zbx_host_name": { "text": "", "value": "server123" }, "__zbx_item": { "text": "", "value": "CPU utilization" }, "__zbx_item_interval": { "text": "", "value": "1m" }, "__zbx_item_key": { "text": "", "value": "system.cpu.util" }, "__zbx_item_name": { "text": "", "value": "CPU utilization" } }, "units": "%" } } } ] }, "data": { "values": [ [ 1698742680000, 1698742740000, 1698742800000, 1698742860000, 1698742920000, 1698742980000, 1698743040000, 1698743100000, 1698743160000, 1698743220000, 1698743280000, 1698743340000, 1698743400000, 1698743460000, 1698743520000, 1698743580000, 1698743640000, 1698743700000, 1698743760000, 1698743820000, 1698743880000, 1698743940000, 1698744000000, 1698744060000, 1698744120000, 1698744180000, 1698744240000, 1698744300000, 1698744360000, 1698744420000, 1698744480000, 1698744540000, 1698744600000, 1698744660000, 1698744720000, 1698744780000, 1698744840000, 1698744900000, 1698744960000, 1698745020000, 1698745080000, 1698745140000, 1698745200000, 1698745260000, 1698745320000, 1698745380000, 1698745440000, 1698745500000, 1698745560000, 1698745620000, 1698745680000, 1698745740000, 1698745800000, 1698745860000, 1698745920000, 1698745980000, 1698746040000, 1698746100000, 1698746160000, 1698746220000, 1698746280000, 1698746340000, 1698746400000, 1698746460000, 1698746520000, 1698746580000, 1698746640000, 1698746700000, 1698746760000, 1698746820000, 1698746880000, 1698746940000, 1698747000000, 1698747060000, 1698747120000, 1698747180000, 1698747240000, 1698747300000, 1698747360000, 1698747420000, 1698747480000, 1698747540000, 1698747600000, 1698747660000, 1698747720000, 1698747780000, 1698747840000, 1698747900000, 1698747960000, 1698748020000, 1698748080000, 1698748140000, 1698748200000, 1698748260000, 1698748320000, 1698748380000, 1698748440000, 1698748500000, 1698748560000, 1698748620000, 1698748680000, 1698748740000, 1698748800000, 1698748860000, 1698748920000, 1698748980000, 1698749040000, 1698749100000, 1698749160000, 1698749220000, 1698749280000, 1698749340000, 1698749400000, 1698749460000, 1698749520000, 1698749580000, 1698749640000, 1698749700000, 1698749760000, 1698749820000, 1698749880000, 1698749940000, 1698750000000, 1698750060000, 1698750120000, 1698750180000, 1698750240000, 1698750300000, 1698750360000, 1698750420000, 1698750480000, 1698750540000, 1698750600000, 1698750660000, 1698750720000, 1698750780000, 1698750840000, 1698750900000, 1698750960000, 1698751020000, 1698751080000, 1698751140000, 1698751200000, 1698751260000, 1698751320000, 1698751380000, 1698751440000, 1698751500000, 1698751560000, 1698751620000, 1698751680000, 1698751740000, 1698751800000, 1698751860000, 1698751920000, 1698751980000, 1698752040000, 1698752100000, 1698752160000, 1698752220000, 1698752280000, 1698752340000, 1698752400000, 1698752460000, 1698752520000, 1698752580000, 1698752640000, 1698752700000, 1698752760000, 1698752820000, 1698752880000, 1698752940000, 1698753000000, 1698753060000, 1698753120000, 1698753180000, 1698753240000, 1698753300000, 1698753360000, 1698753420000, 1698753480000, 1698753540000, 1698753600000, 1698753660000, 1698753720000, 1698753780000, 1698753840000, 1698753900000, 1698753960000, 1698754020000, 1698754080000, 1698754140000, 1698754200000, 1698754260000, 1698754320000, 1698754380000, 1698754440000, 1698754500000, 1698754560000, 1698754620000, 1698754680000, 1698754740000, 1698754800000, 1698754860000, 1698754920000, 1698754980000, 1698755040000, 1698755100000, 1698755160000, 1698755220000, 1698755280000, 1698755340000, 1698755400000, 1698755460000, 1698755520000, 1698755580000, 1698755640000, 1698755700000, 1698755760000, 1698755820000, 1698755880000, 1698755940000, 1698756000000, 1698756060000, 1698756120000, 1698756180000, 1698756240000, 1698756300000, 1698756360000, 1698756420000, 1698756480000, 1698756540000, 1698756600000, 1698756660000, 1698756720000, 1698756780000, 1698756840000, 1698756900000, 1698756960000, 1698757020000, 1698757080000, 1698757140000, 1698757200000, 1698757260000, 1698757320000, 1698757380000, 1698757440000, 1698757500000, 1698757560000, 1698757620000, 1698757680000, 1698757740000, 1698757800000, 1698757860000, 1698757920000, 1698757980000, 1698758040000, 1698758100000, 1698758160000, 1698758220000, 1698758280000, 1698758340000, 1698758400000, 1698758460000, 1698758520000, 1698758580000, 1698758640000, 1698758700000, 1698758760000, 1698758820000, 1698758880000, 1698758940000, 1698759000000, 1698759060000, 1698759120000, 1698759180000, 1698759240000, 1698759300000, 1698759360000, 1698759420000, 1698759480000, 1698759540000, 1698759600000, 1698759660000, 1698759720000, 1698759780000, 1698759840000, 1698759900000, 1698759960000, 1698760020000, 1698760080000, 1698760140000, 1698760200000, 1698760260000, 1698760320000, 1698760380000, 1698760440000, 1698760500000, 1698760560000, 1698760620000, 1698760680000, 1698760740000, 1698760800000, 1698760860000, 1698760920000, 1698760980000, 1698761040000, 1698761100000, 1698761160000, 1698761220000, 1698761280000, 1698761340000, 1698761400000, 1698761460000, 1698761520000, 1698761580000, 1698761640000, 1698761700000, 1698761760000, 1698761820000, 1698761880000, 1698761940000, 1698762000000, 1698762060000, 1698762120000, 1698762180000, 1698762240000, 1698762300000, 1698762360000, 1698762420000, 1698762480000, 1698762540000, 1698762600000, 1698762660000, 1698762720000, 1698762780000, 1698762840000, 1698762900000, 1698762960000, 1698763020000, 1698763080000, 1698763140000, 1698763200000, 1698763260000, 1698763320000, 1698763380000, 1698763440000, 1698763500000, 1698763560000, 1698763620000, 1698763680000, 1698763740000, 1698763800000, 1698763860000, 1698763920000, 1698763980000, 1698764040000, 1698764100000, 1698764160000, 1698764220000 ], [ 2.574332, 2.796287, 4.48517, 2.385365, 2.981358, 2.391003, 2.736327, 2.542011, 2.244045, 2.457735, 3.405136, 2.784493, 2.526733, 2.520798, 2.56532, 2.443776, 2.723987, 3.326471, 2.313206, 2.511881, 2.658391, 2.447848, 2.711469, 2.368977, 2.644339, 2.552078, 2.252791, 2.565118, 2.517859, 2.425035, 2.455901, 2.435963, 3.351687, 2.187457, 2.250283, 2.698755, 2.386864, 2.418771, 20.160099, 7.251088, 4.407005, 2.539814, 2.657167, 2.892744, 2.533243, 2.629245, 2.390005, 3.029108, 2.631654, 2.381133, 2.575706, 2.526292, 2.385665, 3.028787, 2.381319, 2.33773, 3.240114, 2.345056, 2.442857, 13.997785, 2.640394, 2.284872, 3.021559, 2.392573, 2.879669, 2.846417, 2.844375, 2.580347, 2.615406, 2.519191, 2.977495, 2.539958, 2.519704, 2.343851, 2.453736, 2.793637, 2.122706, 3.256591, 2.192806, 5.506145, 3.01032, 3.04506, 2.495094, 19.947275, 7.25605, 2.59012, 2.436358, 2.616361, 2.594125, 2.504375, 2.711998, 2.303098, 2.710705, 2.535103, 2.422627, 2.435043, 2.467623, 2.822368, 2.622549, 2.311685, 2.489308, 3.257147, 2.801085, 2.453018, 2.822816, 2.702866, 2.506719, 3.005722, 2.493662, 2.614502, 2.131118, 2.392034, 2.663451, 2.991104, 2.464714, 2.508462, 3.76934, 2.632653, 2.757982, 2.448107, 2.349671, 2.719626, 4.107667, 2.458347, 4.052749, 2.376108, 2.761694, 4.613203, 21.292496, 7.490767, 2.471614, 2.872375, 2.628577, 2.827357, 2.660195, 2.219144, 2.444473, 2.705562, 2.501169, 3.645341, 2.803719, 2.575001, 2.443839, 2.796387, 2.128775, 2.690084, 2.596085, 2.690877, 3.295979, 2.384762, 2.513734, 2.339643, 2.921115, 2.360847, 2.664765, 2.295638, 2.449842, 2.428135, 2.995167, 2.673184, 13.495462, 2.951775, 2.706608, 2.355119, 2.627249, 2.810406, 2.403157, 3.064554, 2.606971, 3.045222, 2.657954, 2.581994, 2.712938, 20.201542, 7.952256, 2.871022, 3.40185, 2.753169, 2.680174, 2.416434, 12.402703, 2.404606, 3.129483, 2.644576, 2.764229, 2.903607, 2.766561, 2.772252, 2.722711, 2.899691, 2.869874, 15.097595, 3.211877, 2.475831, 2.598833, 2.800834, 2.868522, 3.232981, 2.51108, 2.591679, 2.44957, 2.846582, 3.172512, 3.578375, 2.744621, 2.646925, 2.808368, 2.651062, 2.410439, 2.526033, 4.929873, 2.208311, 4.072283, 2.403186, 2.097112, 3.676372, 2.414016, 4.113888, 19.93377, 10.517926, 2.87469, 2.495592, 2.996638, 2.833809, 3.260747, 3.34646, 3.265483, 5.421094, 2.744421, 2.98919, 2.340751, 2.492006, 2.637408, 3.357823, 3.130961, 3.348614, 3.138934, 2.718737, 2.888544, 2.799074, 3.939875, 2.665635, 3.662275, 3.469412, 3.735394, 3.142999, 3.044863, 2.962801, 2.631241, 4.0467, 2.617392, 2.853196, 7.211305, 4.325345, 3.360556, 2.932633, 3.049149, 3.062117, 2.714047, 2.540331, 3.423427, 2.869594, 3.010033, 19.650376, 9.599083, 2.846634, 2.816868, 3.461773, 4.399623, 3.894774, 4.260008, 14.278547, 3.307581, 2.724049, 2.268511, 3.906213, 2.933179, 2.10199, 3.026549, 3.154355, 2.809659, 4.605351, 2.758843, 4.09984, 3.383528, 2.49365, 2.836491, 3.526753, 2.72521, 4.156745, 2.782334, 3.637162, 3.070306, 3.552038, 3.017632, 3.182778, 4.168164, 3.483754, 3.378156, 2.358608, 4.660549, 2.742575, 3.935319, 3.336161, 3.018959, 3.187804, 2.586214, 2.982172, 19.912759, 9.220765, 3.802696, 3.395425, 4.413086, 3.55037, 3.184215, 3.087513, 3.067597, 3.207591, 3.684033, 3.30156, 2.747396, 3.49005, 2.453605, 4.305663, 2.678779, 2.581656, 2.542584, 2.4858, 2.451444, 3.508935, 2.908326, 2.703415, 4.430273, 3.400614, 3.779692, 3.544965, 4.560075, 3.126755, 2.97876, 3.732684, 3.307605, 3.883776, 3.406809, 2.798157, 2.823696, 3.932213, 3.091304, 3.120759, 3.565342, 2.335139, 3.753264, 2.768763, 3.958646, 20.25741, 10.257375, 3.306627, 4.596863, 3.958761, 3.379619, 3.164992 ] ] } } ] } ] }, { "gridPos": { "h": 7, "w": 9, "x": 15, "y": 0 }, "id": 5, "options": { "content": "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Paneltimeseries @ 9.3.1 (89b365f8b1)
QueriesA[alexanderzobnin-zabbix-datasource]
Data 1 frames, 2 fields, 360 rows
Grafana9.3.1 (89b365f8b1) // Enterprise
", "mode": "html" }, "title": "Debug info", "type": "text" }, { "id": 6, "title": "Original Panel JSON", "type": "text", "gridPos": { "h": 13, "w": 9, "x": 15, "y": 7 }, "options": { "content": "{\n \"id\": 2,\n \"gridPos\": {\n \"h\": 6,\n \"w\": 6,\n \"x\": 0,\n \"y\": 5\n },\n \"type\": \"timeseries\",\n \"title\": \"Uso de CPU\",\n \"datasource\": {\n \"type\": \"alexanderzobnin-zabbix-datasource\",\n \"uid\": \"UJ15oQm4k\"\n },\n \"fieldConfig\": {\n \"defaults\": {\n \"custom\": {\n \"drawStyle\": \"line\",\n \"lineInterpolation\": \"linear\",\n \"barAlignment\": 0,\n \"lineWidth\": 1,\n \"fillOpacity\": 21,\n \"gradientMode\": \"none\",\n \"spanNulls\": false,\n \"showPoints\": \"auto\",\n \"pointSize\": 5,\n \"stacking\": {\n \"mode\": \"none\",\n \"group\": \"A\"\n },\n \"axisPlacement\": \"auto\",\n \"axisLabel\": \"CPU LOAD\",\n \"axisColorMode\": \"text\",\n \"scaleDistribution\": {\n \"type\": \"linear\"\n },\n \"axisCenteredZero\": false,\n \"hideFrom\": {\n \"tooltip\": false,\n \"viz\": false,\n \"legend\": false\n },\n \"thresholdsStyle\": {\n \"mode\": \"off\"\n }\n },\n \"color\": {\n \"mode\": \"palette-classic\"\n },\n \"mappings\": [],\n \"thresholds\": {\n \"mode\": \"absolute\",\n \"steps\": [\n {\n \"color\": \"green\",\n \"value\": null\n },\n {\n \"color\": \"red\",\n \"value\": 80\n }\n ]\n },\n \"max\": 100,\n \"min\": 0,\n \"unit\": \"%\"\n },\n \"overrides\": []\n },\n \"options\": {\n \"tooltip\": {\n \"mode\": \"single\",\n \"sort\": \"none\"\n },\n \"legend\": {\n \"showLegend\": true,\n \"displayMode\": \"list\",\n \"placement\": \"bottom\",\n \"calcs\": []\n }\n },\n \"targets\": [\n {\n \"application\": {\n \"filter\": \"CPU\"\n },\n \"datasource\": {\n \"type\": \"alexanderzobnin-zabbix-datasource\",\n \"uid\": \"UJ15oQm4k\"\n },\n \"functions\": [],\n \"group\": {\n \"filter\": \"Windows Servers\"\n },\n \"host\": {\n \"filter\": \"server123\"\n },\n \"item\": {\n \"filter\": \"CPU utilization\"\n },\n \"itemTag\": {\n \"filter\": \"\"\n },\n \"options\": {\n \"disableDataAlignment\": false,\n \"showDisabledItems\": false,\n \"skipEmptyValues\": false,\n \"useZabbixValueMapping\": false\n },\n \"proxy\": {\n \"filter\": \"\"\n },\n \"queryType\": \"0\",\n \"refId\": \"A\",\n \"resultFormat\": \"time_series\",\n \"table\": {\n \"skipEmptyValues\": false\n },\n \"tags\": {\n \"filter\": \"\"\n },\n \"trigger\": {\n \"filter\": \"\"\n },\n \"triggers\": {\n \"acknowledged\": 2,\n \"count\": true,\n \"minSeverity\": 3\n }\n }\n ]\n}", "mode": "code", "code": { "language": "json", "showLineNumbers": true, "showMiniMap": true } } }, { "id": 3, "title": "Data from panel above", "type": "table", "datasource": { "type": "datasource", "uid": "-- Dashboard --" }, "gridPos": { "h": 7, "w": 15, "x": 0, "y": 13 }, "options": { "showTypeIcons": true }, "targets": [ { "datasource": { "type": "datasource", "uid": "-- Dashboard --" }, "panelId": 2, "withTransforms": true, "refId": "A" } ] } ], "schemaVersion": 37, "title": "Debug: Uso de CPU // 2023-10-31 11:59:36", "tags": [ "debug", "debug-timeseries" ], "time": { "from": "2023-10-31T08:59:36.813Z", "to": "2023-10-31T14:59:36.813Z" } } ```

Environment (with versions)?

Grafana:: 9.3.1 OS: RHEL 7.9 Browser: Edge 113.0.1774.57

Grafana platform?

A package manager (APT, YUM, BREW, etc.)

Datasource(s)?

Zabbix: 5.0.22 with Grafana-Zabbix: 4.2.9

sebelk commented 1 year ago

FYI, I've found the causes of "No data" and http 404 errors when panels are collapsed, it works otherwise mean:

photo_2023-10-31_15-39-45

Is that a bug? or is it intended? Is that "what you see is what you share". AFAIK it's not documented.

That being said, the (harmless but?) annoying popup Unauthorized remains.

bernardolankheet commented 1 year ago

Zabbix datasource is not yet supported for using the public dashboard feature. There is this issue open ( #https://github.com/grafana/grafana-zabbix/issues/1635), but it has not yet been made available by Alexander.

Unsupported data sources There are data sources in this dashboard that are unsupported for public dashboards. Panels that use these data sources may not function properly: alexanderzobnin-zabbix-datasource. Read more about supported data sources image

Below we have a list of supported datasources for this feature, https://grafana.com/docs/grafana/next/dashboards/dashboard-public/#supported-data-sources

tonypowa commented 1 year ago

hi @sebelk thank you @bernardolankheet for the info with https://github.com/grafana/grafana-zabbix/issues/1635#issue-1715646066 in mind, what we could do is mark this issue as a feature request, and if it receives enough upvotes (>=10), the dashboard squad could consider adding support for zabbix

zoltanbedi commented 11 months ago

I'm going to close this issue here as this needs to be added in the zabbix datasource.