This commit adds debug logs for previous_ends_at and next_ends_at
to state.go to help us debug issues where alerts are resolved in
Alertmanager due to expiration. This change is in response to a
support escalation where this information was needed but unavailable.
* [Chore] Remove setting provider from secret service
Co-authored-by: Tania B <yalyna.ts@gmail.com>
Co-authored-by: Joan López de la Franca Beltran <joanjan14@gmail.com>
* Add a ShouldBeRedacted func
Co-authored-by: Tania B <yalyna.ts@gmail.com>
Co-authored-by: Joan López de la Franca Beltran <joanjan14@gmail.com>
* Secrets: Make Migrator extensible
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
Co-authored-by: Tania B <yalyna.ts@gmail.com>
* Alerting: Fix tests after refactor
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
Co-authored-by: Tania B <yalyna.ts@gmail.com>
* Remove commented code no longer used
* Fix Wire bindings
Co-authored-by: Tania B <yalyna.ts@gmail.com>
* Add constructors to secrets
* Linting
* Undo undesired change
---------
Co-authored-by: gamab <gabi.mabs@gmail.com>
Co-authored-by: Tania B <yalyna.ts@gmail.com>
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
* Add notification policies preview in alert rule form
Co-authored-by: Konrad Lalik <konrad.lalik@grafana.com>
* Refactor using new useGetPotentialInstances hook and apply some style changes
* Add notification policy detail modal
* Use backtesting api for simulating potential alert instances
* Fix logic to travserse all the children from the root route
* Split notification preview by alert manager
* Add instance count to matching policy header and fix some styles
* Move some logic to a new hook useGetAlertManagersSourceNames to make the code more clean
* Fix some tests
* Add initial test for NotificationPreview
* Use button to preview potential instances
* Add link to contact point details
* Add route matching result details
* Show AlertManager image in the routing preview list
* Add tests setup, add single AM preview test
* Handle no matchers and no labels use case
* Update some style in collapse component and fix policy path in modal
* Update modal styles
* Update styles
* Update collapse header styling
* Normalize tree nodes should happen before findMatchingRoutes call
* Fix findMatchingRoutes and findMatchingAlertGroups methods after reabasing
* Move instances matching to the web worker code
* Fix config fetching for vanilla prometheus AMs
* Add tests
* Add tests mocks
* Fix tests after adding web worker
* Display matching labels for each matching alert instance
* Add minor css improvements
* Revert changes added in Collapse component as we don't use it anymore
* Move the route details modal to a separate file
* Move NotificationRoute and preview hook into separate files
* Fix Alertmanager preview tests
* Fix tests
* Move matcher code to a separate file, improve matcher mock
* Add permissions control for contact point edit view link
* Fix from and to for the temporal use of backtesting api
* Fix tests, add lazy loading of the preview component
Co-authored-by: Sonia Aguilar <soniaaguilarpeiron@gmail.com>
* Fix preview test
* Add onclick on the header div so it collapse and expands when clicking on it, and update styles to be consistent with the rest of tables
* Adapt the code to the new rule testing endpoint definition
* Fix tests
* small changes after reviewing the final code
* compute entire inherited tree before computing the routes map
* Throw error in case of not having receiver in routesByIdMap and add test for the use case of inheriting receiver from parent to check UI throws no errors
* Add list of labels in the policy route path that produces the policy matchers to match potential instances
* Use color determined by the key, in label tags when hovering matchers in the policy tree
* Remove labels in modal and handle empty string as receiver to inherit from parent as we do with undefined
* Revert "Add list of labels in the policy route path that produces the policy matchers to match potential instances"
This reverts commit ee73ae9cf9.
* fix inheritance for computeInheritedTree
* Fix message shown when preview has not been executed yet
* First round for adressing PR review comments
* Adress the rest of PR review commments
* Update texts and rename id prop in NotificaitonStep to alertUid
---------
Co-authored-by: Konrad Lalik <konrad.lalik@grafana.com>
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
* Elasticsearch: remove usages of any
* Elasticsearch: check for filter type when accessing field aggs
* Elasticsearch: use type guards instead of checking types
* Use unknown for isPrimitive function
* Add deprecation notice
* Remove unused type
* Fix bug in "isPrimitive" function
* Remove unused import
* Revert "Fix bug in "isPrimitive" function"
This reverts commit 27f9874cce.
* Reformatting and restructuring
* Update unit test
* Always send the default retention policy as first element
* Fix typo
* Update test
* Update test once more
* refactor metric select and label filters, add variables to label names dropdown
* use MetricsLabelsSection in variable editor
* use variable editor UI with MetricsLabelsSection
* filter label names by optional metric and allow metric to be cleared
* fix tests
* testing types for onChangeLabels
* testing types for onChangeLabels
* testing types for onChangeLabels
* Ismails review, remove comment and indent
* wrap label filters
* improved behavior for selects and inputs, add tests and document behavior
* Add option to make QueryEditor not collapsable
* Make QueryEditor not collapsable in Alerting
* Change query editor border to weak
The medium border is really only for inputs, everything else should use weak border
* Add tests
## 4.1.0 (2023-06-16)
### Added
- Mounts of `layouts` and `config` directories for the `website` project.
Ensures that local changes to mounts or shortcodes are reflected in the development server.
### Fixed
- Version inference for versioned docs pages.
Pages in versioned projects now have the `versioned: true` front matter set to ensure that "version" in $.Page.Scratch is set on builds.
## 4.0.0 (2023-06-06)
### Removed
- `doc-validator/%` target.
The behavior of the target was not as described.
Instead, to limit `doc-validator` to only specific files, refer to https://grafana.com/docs/writers-toolkit/writing-guide/tooling-and-workflows/validate-technical-documentation/#run-on-specific-files.
## 3.0.0 (2023-05-18)
### Fixed
- Compatibility with the updated Make targets in the `website` repository.
`docs` now runs this script itself, `server-docs` builds the site with the `docs` Hugo environment.
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* add NodeTypeFromDatasourceUID and DataSourceModelFromNodeType()
* deprecate expr.DataSourceModel
* replace usages of IsDataSource to NodeTypeFromDatasourceUID
* replace usages of DataSourceModel to DataSourceModelFromNodeType()
* Use docs/reference for flexible linking for content reused in Grafana Cloud
Documented in https://github.com/grafana/website/pull/13878
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Use docs-base image that has docs/reference shortcode
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
---------
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>