16 Commits

Author SHA1 Message Date
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
Kristian Bremberg
6580bf8f6e Refactor regex pattern validation to use timeout-based approach (#2090)
- Remove isPathologicalRegex function and replace with MatchTimeout
- Simplify parseFilter by relying on runtime timeout protection
- Add comprehensive timeout test for pathological regex patterns
- Set 5-second timeout for all compiled regex operations
2025-09-24 14:27:16 +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
6a1d3b6abe Add regex safety checks and tests for pathological patterns (#2083) 2025-09-17 23:16:55 +02:00
Zoltán Bedi
c2ffd31b1a Add error source (#1954)
Fixes  #1879
2025-02-04 12:40:33 +01:00
Alexander Zobnin
c06683cd37 Fix backend linter errors 2023-08-30 12:48:38 +02:00
Alexander Zobnin
24285a9483 Fix item tag filter, #1594 2023-03-23 14:40:22 +01:00
Alexander Zobnin
dd6798834a Improve tags performance (#1526)
Co-authored-by: Erik De Neve <erik.de.neve@telenet.be>
2023-03-21 12:28:34 +01:00
Alexander Zobnin
799875866a Fix matching 2022-09-01 10:30:55 +03:00
Daniel Poßmann
70055b0682 switch to regexp2 for parsed filter 2022-07-07 14:28:55 +02:00
Alexander Zobnin
0a4714f9e9 Fix parsing regex, #1318 2022-02-16 17:59:56 +03:00
Alexander Zobnin
78fe0dd7a9 Fix expanding item name with unicode params, fixes #1269 2021-08-25 12:06:25 +03:00
Alexander Zobnin
915973829d Support item tags, fixes #1258 2021-08-09 14:57:49 +03:00
Alexander Zobnin
7748508a5c Use time series format internally 2021-05-24 17:11:36 +03:00
Alexander Zobnin
94b5c88366 Fix item filtering 2021-05-24 11:20:14 +03:00
Alexander Zobnin
badecc3aae Refactor: zabbix client 2021-05-19 13:17:46 +03:00