grafana / grafana-zabbix

Zabbix plugin for Grafana dashboard
http://play.grafana-zabbix.org
Apache License 2.0
2.06k stars 458 forks source link

Query breaks when adding Expression #1601

Open Ricaz opened 1 year ago

Ricaz commented 1 year ago

Describe the bug Basically the same issue as #1314. Queries work fine on their own, but once I add an expression, the panel breaks. Doesn't matter if I reference the other queries in the expression. If it's there, nothing works. Even if I disable the expression -- I have to remove it entirely for the data to show.

No error messages to be found.

Expected behavior Expressions work normally as with other data sources.

Screenshots Without expression: image

With expression: image

Query inspector: image

Software versions

Grafana Zabbix Grafana-Zabbix Plugin
9.4.7 6.2.1 4.3.1
alexanderzobnin commented 1 year ago

That's strange, I cannot replicate it on the latest Grafana.

Ricaz commented 1 year ago

If you "need more info", please be a bit more specific.

tylersiemers commented 1 year ago

Same issue here. I noticed in the query response that when you use an expression it sends the raw variable.

Grafana 9.4.3

URL with no expression: url:"api/ds/query" URL with expression: url:"api/ds/query?expression=true"

Data example with no expression

image

host:Object filter:"/^Depere Heritage 8300 1$/"

With Math Expression

host:Object filter:"$hfm_hosts"

image

tylersiemers commented 1 year ago

I opened this issue on Grafana as well since I am not sure this is a Zabbix plugin issue. I saw the same thing happen on another plugin

https://github.com/grafana/grafana/issues/66028

BIGW3NDY commented 1 year ago

I have met the same problem.

Grafana: enterprise-10.0.2.linux-amd64 Zabbix: 6.4.4 Zabbix plugin for Grafana: 4.3.1

It's okay with queries. image

But when I added a expression Grafana shows "no data". image

There is the expression part of query. image

dbuconn commented 1 year ago

I am noticing the same behavior, as soon as I add an expression (even something as simple as $A-1, where $A is Numeric unsigned) - no data is rendered.

Zabbix 6.4.4 Grafana 10.1.0 Plugin 4.4.1

dbuconn commented 1 year ago

Edit - I just discovered that the issue might be because I am using a variable for the host. Without the expression, selecting a host from the drop down, both queries work OK. Adding the Expression causes No Data to appear in the panel.

However if I explicitly enter the same host in both queries, then the Expression works without a problem.

marvinborner commented 1 year ago

I have the same problem and can reproduce the solution of @dbuconn. By using a variable in Host of a query, expressions that use the query will return no data.

MatiasJAco commented 4 months ago

Having the same issue, still no workaround?

AnsgarKlein commented 3 months ago

Hi @alexanderzobnin ,

I have created a docker-compose bundle that sets up Zabbix and Grafana, adds the alexanderzobnin-zabbix-app plugin and creates a dashboard to reproduce the problem.

issue-1601.zip

Usage:

As soon as we add an expression to a query that uses a variable, both the expression and the query stop working:

grafana-zabbix-variablebug

Is that enough to get rid of the need-more-info tag? :)