Commit Graph

41 Commits

Author SHA1 Message Date
ismail simsek
592380851c Fix moment rendering bug (#2199)
While we are rendering Problems table for each cell we use a different
renderer. For `Age` field we didn't pass the data properly and it caused
errors. The problem is we were trying to render the whole moment object
instead of just the datatime.

Part of: https://github.com/grafana/grafana-zabbix/issues/2197

This PR will fix the issue. This happens when user wants to add a new
panel with `Age` field or try to edit a problems panel `Age` field
enabled.

Kudos to @yesoreyeram
2026-01-14 20:25:48 +01:00
Zoltán Bedi
4e6a75c93d Release 6.1.0 (#2194) 2026-01-13 13:50:49 +01:00
Jocelyn Collado-Kuri
9fda7768ff Add support to use custom values in dropdown (#2163)
## Summary
When we switched to use `Combobox` we were no longer able to add custom
values for our dropdowns, and this prevented users from using regexp
values for `group`, `host`, `proxy` etc. This PR adds
`createCustomValue` flag so that any custom value can be entered into
the dropdowns.

## Detailed summary
- Make use of `Combobox`'s `createCustomValues` so that wherever
necessary, users are able to enter regex values.
    
<img width="720" height="221" alt="Screenshot 2026-01-05 at 7 15 23 AM"
src="https://github.com/user-attachments/assets/841716eb-cd86-49d1-b13c-a0e37e8a37b9"
/>

## Why
For users to be able to use regexp, and any custom value in our
dropdowns.

## How to test
For all query types where dropdowns are used and user configurable (i.e.
group, host, proxy, application) start typing a value that does not
already exist in the dropdown. You should see an option to `Use custom
value`

Fixes
[comment](https://github.com/grafana/grafana-zabbix/pull/2141#issuecomment-3698818476),
thanks for the testing and call out @christos-diamantis
2026-01-05 09:34:17 -08:00
Jocelyn Collado-Kuri
0d64736e86 Adds support for host tags (#2140)
## Sumary
When dealing with multiple hosts, it can be hard for customers filter
through and figure out which host to query metric data from. This PR
aims to make this easier by adding support for host tags so that there
is another layer of filtering / grouping applied for hosts.

## Detailed explanation
- Adds new UI components to allow adding one or more host tag filter,
and a switch to choose between `AND/OR` and `OR` operators when using
more than one filter following Zabbix's UI:
  

https://github.com/user-attachments/assets/c971f5eb-7e93-4238-bd6b-902cc657c014


https://github.com/user-attachments/assets/5f8996de-684e-4ffa-b98e-8e205c4fc1df

- Modifies the existing `getHosts` function to make a call to the
backend with a few additional parameters to `extend` (essentially
extract) the host tags for a given selected group. No backend changes
were required for this.

## Why
To make it easier for customers to query metric data when dealing with
multiple hosts.

## How to test
- Go to explore or a dashboard and create a Zabbix query where the query
type is `Metrics`
- The easiest way to test is by selecting `/.*/` for Groups, checking
the returned `Hosts` they should all be there
- Add a host tag filter and change the keys and operators as well as
switching from `AND/OR` to `OR` you should see how the values returned
for `Host` changes

## Future work
Adding variable support for host tags once this is completed.

Fixes:
https://github.com/orgs/grafana/projects/457/views/40?pane=issue&itemId=3609900134&issue=grafana%7Coss-big-tent-squad%7C126
and https://github.com/grafana/grafana-zabbix/issues/927

---------

Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
2026-01-05 05:30:55 -08:00
Jocelyn Collado-Kuri
3d0895c008 Fix the way we merge frontend and backend queries (#2158)
## Summary

With the new logic to merge backend and frontend query responses, some
of the frontend query responses were being lost due to early
termination.

Merging frontend and backend responses was not properly waiting for all
promises to resolve before returning this "merged" result

## Detailed explanation

In `mergeQueries` although `Promise.all` was triggered, we returned
immediately without waiting for the promises to actually resolve, now
instead of passing down promises:
- use `switchMap` so that the upstream backend response observable can
be used as an inner Observable value to be concatenated with the rest of
the responses
- Why not use `map`? To prevent out of sync results, we need to wait for
the promises to resolve **before** we pass it down to the `mergeQueries`
function, `map` does not allow that.
- use `from` and trigger `Promise.all` **before** calling `mergeQueries`
so that all promise results can be resolved and converted to observables
by the time they get passed into the function
- modify `mergeQueries` to accept `DataResponse` for arguments, clone
the existing data and return the merged result.

<img width="1700" height="398" alt="Screenshot 2025-12-29 at 1 06 05 PM"
src="https://github.com/user-attachments/assets/c07c59b1-43b8-47f9-adc6-67583b125856"
/>

## Why

To fix how frontend and backend queries are merged so that no response
gets lost in the process

## How to test
1. Create a new dashboard or go to Explore
2. For query type select `Problems` or anything that is not `Metrics` 
3. Execute the query, and you should be able to see a response.
2025-12-31 06:46:56 -08:00
Jocelyn Collado-Kuri
127367464e Standardization across Zabbix UI components (#2141)
## Summary

Throughout Zabbix we did not have a uniform UI - some drop-down were
using `Select` others `Combobox` others a custom one that we created.
Some had placeholders and others did not. This PR aims to standardize
our Zabbix UI across our query, variable and config editors

## Detailed summary 

- Migrate from `Select` to `Combobox` -> `Select` component is
deprecated
- Migrate from `HorizontalGroup` to `Stack` -> `HorizontalGroup` is also
deprecated
- Remove use of "custom" dropdown `MetricPickerMenu` in favor of
`Combobox` ensuring uniformity across our drop-down and removing
maintenance overhead for us down the line
- Standardize placeholders across all inputs

<img width="630" height="243" alt="Screenshot 2025-12-17 at 1 13 45 PM"
src="https://github.com/user-attachments/assets/9382057e-b443-4474-a9c8-850086d7f3d4"
/>

<img width="691" height="256" alt="Screenshot 2025-12-17 at 1 14 05 PM"
src="https://github.com/user-attachments/assets/a05ff2af-8603-4752-8d12-337dc381c0fd"
/>

## Why
To have a clean and standard UI and remove use of UI deprecated
packages.

## How to test
- Query Editor:
- By creating a new query in a dashboard or Explore and interacting with
all the different query types and drop-downs
     - All drop-downs should be searchable and have placeholders
- Config Editor:
- By going to a datasource and ensuring that the dropdown for Datasource
(when DB connection is enabled) and Auth type are responsive and working
as expected)


Fixes:
https://github.com/orgs/grafana/projects/457/views/40?pane=issue&itemId=3740545830&issue=grafana%7Coss-big-tent-squad%7C139
2025-12-18 14:28:29 +00:00
Jocelyn Collado-Kuri
ce4a8d3e19 Migrate from DatasourceAPI to DatasourceWithBackend (#2123)
This PR migrates the use of `DatasourceApi` to `DatasourceWithBackend`,
with this a couple additional improvements were made:

1. Migrate to use `interpolateVariablesInQuery` everywhere instead of
the custom `replaceTemplateVariables` we were using
2. Moves util functions out of `datasource.ts` and into the existing
`utils.ts`

<img width="1261" height="406" alt="Screenshot 2025-11-20 at 11 37
56 AM"
src="https://github.com/user-attachments/assets/9e396cf2-eab0-49d1-958c-963a2e896eba"
/>

Now we can see the `query` calls being made to the backend:
<img width="367" height="102" alt="Screenshot 2025-11-20 at 11 38 18 AM"
src="https://github.com/user-attachments/assets/a5a9a337-7f19-4f7c-9d04-9d30c0216fb2"
/>

Tested:
- By running queries from Explore and Dashboards (with and without
variables)
- By interacting with all the different Editors to make sure `ComboBox`
was working as expected


Next:
Once this is merged, we will next be able to slowly move away from using
the `ZabbixConnector` to make backend datasource calls.

Fixes:
[#131](https://github.com/orgs/grafana/projects/457/views/40?pane=issue&itemId=139450234&issue=grafana%7Coss-big-tent-squad%7C131)
2025-12-16 09:58:02 -08:00
ismail simsek
cc492b916d Update react-table to v8 (#2131)
Updating react-table to v8. 
- Migrating the existing table to v8
- Preserving the visuals and logic

What's done?
- Cell components are moved under `Cells` folder
- Old styles for react-table-6 is removed.
- Old types are removed
- All logic was preserved
- Some cell components are removed for simplicity


Fixes: https://github.com/grafana/oss-big-tent-squad/issues/125
2025-12-10 19:25:04 +01:00
Jocelyn Collado-Kuri
e073382983 Fix always fetch Zabbix version before issuing new requests (#2133)
Previously we were only fetching the version when the version was `0`.
This generally worked, but posed some problems when customers were
updating their Zabbix version, specifically when upgrading from a
version < `7.2.x` to `7.2.x` or above.

Before `7.2.x`, an `auth` parameter was still supported when issuing a
zabbix request, this was deprecated in `6.4.x` and later removed in
`7.2.x`. When a user was on a version < `7.2.x` all the outgoing
requests would add this `auth` parameter. When upgrading to `7.2.x` this
was a problem, because the version was not `0`, hence, not requiring
getting the version again, but also because we were still building the
request considering an older version and adding the `auth` parameter,
when this was no longer supported.

This PR removes the check for `version == 0`, though this now means that
every request that goes out will check the version before hand, I think
this will give us a more accurate representation of the version that
needs to be used.

fixes
https://github.com/orgs/grafana/projects/457/views/40?pane=issue&itemId=3683181283&issue=grafana%7Coss-big-tent-squad%7C135
2025-12-05 17:34:20 -08:00
Jocelyn Collado-Kuri
89ae290942 Move health check to the backend (#2120)
This PR moves the health check to backend only leaving in the frontend
the functionality to test the dbconnector datasource.

Leaving the `dbconnector.testDataSource` should be fine since the
datasource types we allow for db connection with Zabbix already are
backend datasources, and so their health requests would go through the
backend.

Verified:
Clicking test and seeing a `health` request go out.

IMPORTANT: While testing this in the UI, I found a bug with the config
editor - whenever a change is made in the UI and tested, the changes
don't take effect (i.e. disabling trends, keeps `trends` set to `true`,
enabling db connection keep `dbConnectionEnabled` set to `false` and so
on.). Created a separate
[issue](https://github.com/orgs/grafana/projects/457/views/40?pane=issue&itemId=3627315751&issue=grafana%7Coss-big-tent-squad%7C132)
to fix this

Fixes https://github.com/grafana/oss-big-tent-squad/issues/124
Fixes https://github.com/grafana/grafana-zabbix/issues/2004
2025-11-25 14:54:18 -08:00
Jocelyn Collado-Kuri
86b7328f39 Variables: Allow fetching disabled items for Item type variable (#2109)
This PR adds support for showing disabled items when using the `Item`
type template variable. Similar to how we support disabled items today
in our query editor:


<img width="435" height="254" alt="Screenshot 2025-10-21 at 9 00 11 AM"
src="https://github.com/user-attachments/assets/832537c8-84c3-45fe-a85d-b16c8e15f759"
/>

In this example, the host contains a disabled item `CPU iowait time`

<img width="1763" height="46" alt="Screenshot 2025-10-21 at 9 02 08 AM"
src="https://github.com/user-attachments/assets/85419e88-280d-4dce-baee-bf403e1de05d"
/>

Which we can now show and hide from the variable in Grafana:



https://github.com/user-attachments/assets/eca9327e-40a6-4852-92e9-71ff1ad9ea32

I also removed some deprecated types and packages :)!
Fixes: #2025

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-28 19:57:55 -07:00
Jocelyn Collado-Kuri
045c708c69 Fix: ensure that applicationids parameter only gets passed when the datasource supports it. (#2110)
Zabbix 5.0.x supported filtering `Problems` feature with `applications`.
When this got removed, we removed the filter dropdown from the UI, but
failed to check whether applications were supported before sending out
the request with the parameters.

This was causing dashboards that had been created with zabbix version
`5.0.x` to fail when querying with newer versions of our plugin with
error: `Invalid params. Invalid parameter "/": unexpected parameter
"applicationids".`

These changes now ensure that we also check whether applications filter
should be supported before sending the backend request to fetch
problems.

How to test:
- use the attached JSON file. This was created using zabbix50 and
applying an `applicationids` filter for `Problems` query type OR

- run the `zabbix50` test environment:
    ```
       cd devenv/zabbix50
       docker-compose up -d
    ```
- create a dashboard that queries for `Problems` and filters with
applications then export the dashboard JSON
- stop the `zabbix50` test environment and start the `zabbix74` test
environment
    ```
          docker-compose stop
          cd ../zabbix74
          docker-compose up -d
     ```
- import the dashboard you created above, it should load and work as
expected.


Bottom panel was created using zabbix50 and it used the application
filter. Both panels now load as expected:
<img width="2558" height="1018" alt="Screenshot 2025-10-21 at 2 28
25 PM"
src="https://github.com/user-attachments/assets/9613d59b-3f88-420c-9897-f8d988b3d2f0"
/>

Fixes https://github.com/grafana/grafana-zabbix/issues/1852
2025-10-28 19:57:45 -07:00
ismail simsek
d4e717c757 Release v6.0.3 (#2102) 2025-10-17 09:47:21 +00:00
ismail simsek
a489c588d0 Chore: Set grpc limits explicitly (#2101)
Set `MaxReceiveMsgSize` as 32mb and `MaxSendMsgSize` as 100mb
2025-10-17 17:41:30 +08:00
Zoltán Bedi
0194360f61 Release 6.0.1 (#2088) 2025-09-23 12:27:13 +02:00
Zoltán Bedi
5db35450a2 Fix: Remove regex pattern length restriction (#2087)
In this PR I removed the regex pattern length restriction because from
multi value variables this length can be easly reached, also if the
regex is going to be too long it will be caught in the timeout.

Fixes #2086
2025-09-23 11:51:31 +02:00
Zoltán Bedi
e559459a96 Release 6.0.0 (#2084)
Co-authored-by: Kristian Bremberg <114284895+KristianGrafana@users.noreply.github.com>
2025-09-18 16:36:00 +02:00
HH-Harry
b7adcea1fb More info about acknowledges from zabbix (#2071)
This PR is trying to add functionality requested in [#2061 More info
about acknowledges from
zabbix](https://github.com/grafana/grafana-zabbix/issues/2061)

### Key features

- already described in [Enhancement
request](https://github.com/grafana/grafana-zabbix/issues/2061)

### How It Works

- using bitwise AND checks of [**action** field in zabbix
event.acknowledges](https://www.zabbix.com/documentation/current/en/manual/api/reference/event/acknowledge)
keywords are added at beginning of ack.message field on problem panel in
grafana in fllowing order:
  - (un)acknowledged
  - (un)supressed
  - changed severity

### Testing
- No testing was done, sorry

---------

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2025-09-18 14:18:47 +02:00
Zoltán Bedi
6a1d3b6abe Add regex safety checks and tests for pathological patterns (#2083) 2025-09-17 23:16:55 +02:00
github-actions[bot]
b13d567eee chore: bump @grafana/create-plugin configuration to 5.26.4 (#2082)
Bumps
[`@grafana/create-plugin`](https://github.com/grafana/plugin-tools/tree/main/packages/create-plugin)
configuration from 4.2.1 to 5.26.4.

**Notes for reviewer:**
This is an auto-generated PR which ran `@grafana/create-plugin update`.
Please consult the create-plugin
[CHANGELOG.md](https://github.com/grafana/plugin-tools/blob/main/packages/create-plugin/CHANGELOG.md)
to understand what may have changed.
Please review the changes thoroughly before merging.

---------

Co-authored-by: grafana-plugins-platform-bot[bot] <144369747+grafana-plugins-platform-bot[bot]@users.noreply.github.com>
Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2025-09-17 20:33:12 +02:00
Zoltán Bedi
e76741b453 Fix: alias functions in Services query type (#2078) 2025-09-17 20:22:12 +02:00
Zoltán Bedi
b95859cf52 Fix: Functions dropdown positioning (#2073)
Now it uses the position where it have enough space for it. Also removed
the input component as it didn't do anything.

<img width="2032" height="1167" alt="Screenshot 2025-09-05 at 14 29 00"
src="https://github.com/user-attachments/assets/0f75e4c3-ae7d-4200-b76c-e1f781f339ac"
/>

Fixes #2069
2025-09-15 20:12:36 +02:00
Zoltán Bedi
9089067e03 Fix: slaid is missing error (#2077)
In order to reproduce this you need to create a Service and an SLO. The
bug appears when an SLO is not set.


Fixes #1784
2025-09-15 20:11:59 +02:00
Zoltán Bedi
fb6b95b92b Release 5.2.1 (#2066) 2025-08-07 16:21:59 +02:00
Hugo Häggmark
6cc6dcabe1 Chore: removes props mutation (#2056)
While investigating some potential mutations
[here](https://ops.grafana-ops.net/d/83f4951f-2ef3-4260-91a0-39a031992b75/getmutationobserverproxy-logs)
I was able to find these mutating
[lines](https://github.com/grafana/grafana-zabbix/blob/main/src/datasource/components/ConfigEditor.tsx#L55-L57)

Although this works right now, this might not work in future Grafana
versions. This PR makes sure we don't mutate the props.

I haven't been able to test this manually so I could use some help to
make sure the plugin works as expected.

---------

Co-authored-by: ivanahuckova <ivana.huckova@gmail.com>
2025-07-18 12:14:27 +02:00
Zoltán Bedi
7e0070e4f6 Release: Bump version to 5.2.0 and update changelog for new features and fixes (#2054) 2025-07-10 15:37:39 +00:00
Zoltán Bedi
bb6ade69c8 Fix: Update Zabbix API connector to handle versioning for 'with_hosts' parameter (#2049)
This changes the version number for `with_hosts` to return `real_hosts`
when version is 6.0.0 or below.

In 6.2 `real_hosts` is deprecated.
https://www.zabbix.com/documentation/6.2/en/manual/api/reference/hostgroup/get

In 6.0 it isn't.
https://www.zabbix.com/documentation/6.0/en/manual/api/reference/hostgroup/get

Fixes https://github.com/grafana/grafana-zabbix/issues/2048
2025-07-10 17:28:04 +02:00
Christos Diamantis
30c0b0e982 Ability to execute "Manual event actions" on Zabbix Problems panel (#2024)
This PR resolves the below issues:
#2022 #1465 

Specifically, when executing a script on the problems panel, we do check
if the script scope is event or host.
Based on the script scope, the Zabbix API call is constructed
differently.

---------

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2025-07-09 13:56:14 +00:00
Zoltán Bedi
764a945fb0 Chore: update version to 5.1.0 and update changelog (#2026) 2025-05-12 09:01:29 +02:00
Zoltán Bedi
301326084a Fix: Variable item not filtering for item tag (#2006)
Fixes #1930
Fixes #1543 
Fixes #1329 

TODO

- [x] Add test
2025-05-09 20:08:44 +00:00
Zoltán Bedi
8136184a54 Fix: d.for.Each is not a function errors (#2005)
Fixes #2002
2025-05-05 13:58:42 +02:00
Zoltán Bedi
c0d212d3ae Feat: add option to show data source name (#2007)
Original [PR](https://github.com/grafana/grafana-zabbix/pull/2003)

Fixes #1766

---------

Co-authored-by: olaf <olaf@initworks.com>
2025-05-05 13:39:04 +02:00
Zoltán Bedi
db7d5b3cb9 Release version 5.0.4 with a fix for TLS handshake timeout issues by … (#2000)
…disabling the post-quantum key exchange mechanism in Go.
2025-03-26 14:45:44 +00:00
Zoltán Bedi
a02a88579e Fix: TLS handshake timeout caused by go 1.23 (#1997) 2025-03-25 12:12:18 +01:00
Zoltán Bedi
bc6211568f Release version 5.0.3 with security updates and bug fixes (#1995)
- Updated golang.org/x/net from v0.35.0 to v0.37.0 for security
improvements.
- Built the plugin with Go version 1.24.1.
- Fixed basic authentication issues for Zabbix versions <7.2.
- Bumped grafana-plugin-sdk-go from v0.270.0 to v0.274.0.
2025-03-19 14:35:41 +01:00
Zoltán Bedi
4036bc585b Add compatibility workflows and integration tests (#1991)
Fixes #1986
Fixes #1994

- Updated .gitignore to include SSL certificate files.
- Introduced new GitHub Actions workflows for testing compatibility with
Zabbix versions 5.0, 6.0, 7.0, and 7.2.
- Added integration tests for Zabbix API for each version, ensuring
proper authentication and API version handling.
- Updated Docker Compose files to support SSL configuration for Zabbix
web services.
- Removed deprecated default Docker Compose and bootstrap files.
- Removed devenv for version 6.2.
2025-03-19 14:04:52 +01:00
Zoltán Bedi
356dbb62ad Update Go version and dependencies in workflow files (#1993)
- Bump Go version from 1.23.5 to 1.24 in both publish and push
workflows.
- Upgrade github.com/grafana/grafana-plugin-sdk-go from v0.270.0 to
v0.274.0.
- Update golang.org/x/net from v0.35.0 to v0.37.0, golang.org/x/sync
from v0.11.0 to v0.12.0, and golang.org/x/sys from v0.30.0 to v0.31.0.
- Upgrade golang.org/x/text from v0.22.0 to v0.23.0.
2025-03-17 16:05:20 +01:00
Ivana Huckova
d28a715bb1 Release 5.0.1 (#1976) 2025-02-25 10:11:33 +01:00
Zoltán Bedi
6034153046 Fix: host groups not showing in problems panel (#1965)
This PR fixes 2 issues mentioned below.
Fixes #1943
Fixes #1946

## Problems Panel not showing host groups:


[src/panel-triggers/components/Problems/Problems.tsx](0355f40fc2/src/panel-triggers/components/Problems/Problems.tsx)

![Image](https://github.com/user-attachments/assets/2d5d8207-dcd6-4e80-aef3-a9eadf4d3dc9)

### How to reproduce

1. Go to `Zabbix data source features` dashboard
2. Open Problems panel
3. In the panel config enable host groups field
4. Host groups should show up in the table

## Triggers not showing


![Image](https://github.com/user-attachments/assets/4319ebc1-bbdb-4648-b7d5-269e82351804)

### How to reproduce

1. Go to explore and select the zabbix ds
2. Select `Triggers` Query type
3. Add `Backend` as a group
4. Add `/.*/` as host
5. There should be 2 average triggers
2025-02-24 17:54:34 +01:00
Sriram
f4376363eb Fix problems panel broken when selecting triggers (#1960)
This PR fixes an issue where the problems panel breaks when you change
to query type to `Triggers`.

![](https://grafana.zendesk.com/attachments/token/MNBgVTPRKZkwa6TsMBbtBQdIp/?name=image.png)

How to reproduce:

1. Go to `Zabbix data source features` dashboard
2. Open Problems panel
3. Change`Query type` to `Triggers`
4. Select `Problems` from `Count by`
5. Change the `Group` to `Backend`
6. The problems panel should not error

---------

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2025-02-24 11:01:08 +01:00
Zoltán Bedi
aa63bb8835 Add Changesets configuration and update development documentation (#1964)
Introduce Changesets for versioning and changelog generation, and
enhance development documentation to guide contributors on using
Changesets effectively.
2025-02-06 10:35:36 +01:00