This commit adds support for limits and filters to the Prometheus Rules
API.
Limits:
It adds a number of limits to the Grafana flavour of the Prometheus Rules
API:
- `limit` limits the maximum number of Rule Groups returned
- `limit_rules` limits the maximum number of rules per Rule Group
- `limit_alerts` limits the maximum number of alerts per rule
It sorts Rule Groups and rules within Rule Groups such that data in the
response is stable across requests. It also returns summaries (totals)
for all Rule Groups, individual Rule Groups and rules.
Filters:
Alerts can be filtered by state with the `state` query string. An example
of an HTTP request asking for just firing alerts might be
`/api/prometheus/grafana/api/v1/rules?state=alerting`.
A request can filter by two or more states by adding additional `state`
query strings to the URL. For example `?state=alerting&state=normal`.
Like the alert list panel, the `firing`, `pending` and `normal` state are
first compared against the state of each alert rule. All other states are
ignored. If the alert rule matches then its alert instances are filtered
against states once more.
Alerts can also be filtered by labels using the `matcher` query string.
Like `state`, multiple matchers can be provided by adding additional
`matcher` query strings to the URL.
The match expression should be parsed using existing regular expression
and sent to the API as URL-encoded JSON in the format:
{
"name": "test",
"value": "value1",
"isRegex": false,
"isEqual": true
}
The `isRegex` and `isEqual` options work as follows:
| IsEqual | IsRegex | Operator |
| ------- | -------- | -------- |
| true | false | = |
| true | true | =~ |
| false | true | !~ |
| false | false | != |
* try a different way to run integration tests
* fix formatting
* clean test cache again
* use previous command
* playing around with random commands
* dont run tests in parallel yet
* use parallel option instead of gomaxprocs
* use same package set for redis/memcached; use p=1
* TraceView: update the queryType to traceql for checking if same trace when clicking span link
* TraceView: linting
* TraceView: remove traceid check completely
* Use headings in bug report template
I've reported a lot of bugs recently, and I've found that headings
are a far better way to format bug reports.
See https://github.com/grafana/grafana/issues/65426 for an example. Thanks
* Switch from H1s to H2s
As per PR feedback, H1 already exists as the issue title :-)
* poc for virtual tree
* remove my silly debug stuff
* wip
* style table
* improve styles
* fix
* start to split tree into seperate component
* cleanup unused function
* split into more components
* more better
* secondary color type column
* simple tests for DashboardsTree
* restore styles from dodgy rebase
* remove my weirdo text component thing
* initial restructuring
* add weights for ordering
* fix links
* remove aliases, add script
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: David Harris <david.harris@grafana.com>
* make pretty
* use correct link for angular to react guide
* refactor: move the migration guide to /Developers
* Revert "refactor: move the migration guide to /Developers"
This reverts commit 8f31af8dfd.
* fix: only redirect if the URL-hash has a valid redirect
* fix: use a rel-ref for the Angular-React migration guide link
* fix: update the hash redirects
---------
Co-authored-by: David Harris <david.harris@grafana.com>
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
* Add key service
Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
* Wire the service
* Rename Service
* Implement GetJWKS
* Slipt interface and implementation
Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
* Change implementation, add tests
* Align to the expected package hierarchy
* Update CODEOWNERS
* Align names and fix wire.go
* Update pkg/services/signingkeys/signingkeysimpl/service.go
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
* Update pkg/services/signingkeys/signingkeysimpl/service_test.go
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
* Update pkg/services/signingkeys/signingkeysimpl/service_test.go
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
* Update pkg/services/signingkeys/signingkeysimpl/service_test.go
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
* Add AddPrivateKey method to SigningKeysService
* Align tests to the guidelines
* Add test for GetJWKS() method
* Add comments to the interface
* Add FakeSigningKeysService
---------
Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
* Update e2e package
- Ensure health request is monitored for addDatasource flow
- Add custom timeout to configurePanel flow
* Make health check optional
* add how to start live tailing logs
* update old media
* Update docs/sources/datasources/loki/query-editor/index.md
Co-authored-by: Matias Chomicki <matyax@gmail.com>
---------
Co-authored-by: Matias Chomicki <matyax@gmail.com>
* RBAC: Feature to override default assignments
Co-authored-by: Kalle Persson <kalle.persson@grafana.com>
* Add test and trim spaces
* Pass linting
* Apply the rbac overrides to fixed_authentication.config_writer
* Removing from the default ini file for now
* Add grants overrides section to cfg
* slimmer handleGrantOverrides function
---------
Co-authored-by: Kalle Persson <kalle.persson@grafana.com>
* Logs: Add new LogRowContext types to grafana/data
* use right type for `RowContextOptions`
* add missing renames
* add show context modal
* no need to call
* removed unused css
* sort properties
* rename
* use correct
* use
* add tests for
* wip
* remove add/minus buttons
* add tests
* disable processing of context results in Loki
* moved into table to align properly
* remove imports
* add highlighting of opened logline
* improve scrolling behavior
* correct style for the table
* use correct query direction
* fix text
* use LoadingBar
* use overflow auto
* rename `onToggleContext` to `onOpenContext`
* add missing import
* mock scrollIntoView
* update unused props
* remove unused import
* no need to process context dataframes
* only show `LogRowContextModal` if `getRowContext` is defined
* remove unused param
* use `userEvent` rather `fireEvent`
* change to `TimeZone`
* directly use style classes
* revert change to public_dashboard_service_mock.go
* improved styling
* add missing await in test
* fix lint
* fix lint
* remove LogRow scrolling when context is opened
* remove references to `scrollElement`
* Update public/app/features/logs/components/log-context/LogRowContextModal.tsx
Co-authored-by: Matias Chomicki <matyax@gmail.com>
* fix lint
* add comment explaining `onCloseContext`
* add comment about debounced onClose
* add comments and remove `showRowMenu`
* scroll twice to correctly center the element
* revert double scrolling
* remove unnecessary `processDataFrame`
* trigger drone
---------
Co-authored-by: Matias Chomicki <matyax@gmail.com>
* make timestamp field time type
* Add test for type on handleLogEvents data frame field response
---------
Co-authored-by: Shirley Leu <4163034+fridgepoet@users.noreply.github.com>