* Alerting: Fix alert flapping in the alertmanager
fixes a bug that caused Alerts that are evaluated at low intervals (sub 1 minute), to flap in the Alertmanager.
Mostly due to a combination of `EndsAt` and resend delay.
The Alertmanager uses `EndsAt` as a heuristic to know whenever it should resolve a firing alert, in the case that it hasn't heard
back from the alert generation system.
Because grafana sent the alert with an `EndsAt` which is equal to the `For` of the alert itself,
and we had a hard-coded 1 minute re-send delay (only applicable to firing alerts) this meant that a firing alert would resolve in the Alertmanager before we re-notify that it still firing.
This commit, increases the `EndsAt` by 3x the the resend delay or alert interval (depending on which one is higher). The resendDelay has been decreased to 30 seconds.
* Check navigator property exists before acecssing it
* fix: pass undefined to Intl.DateTimeFormat if no locale can be determined
* Update packages/grafana-data/src/datetime/formats.ts
replacing ternary by or
Co-authored-by: Ashley Harrison <ashharrison90@gmail.com>
Co-authored-by: Ashley Harrison <ashharrison90@gmail.com>
* Add UMLs
* Add rendered diagrams
* Move QueryCtrl to flux
* Remove redundant param in the reducer
* Use named imports for lodash and fix typing for GraphiteTagOperator
* Add missing async/await
* Extract providers to a separate file
* Clean up async await
* Rename controller functions back to main
* Simplify creating actions
* Re-order controller functions
* Separate helpers from actions
* Rename vars
* Simplify helpers
* Move controller methods to state reducers
* Remove docs (they are added in design doc)
* Move actions.ts to state folder
* Add docs
* Add old methods stubs for easier review
* Check how state dependencies will be mapped
* Rename state to store
* Rename state to store
* Rewrite spec tests for Graphite Query Controller
* Update docs
* Update docs
* Add GraphiteTextEditor
* Add play button
* Add AddGraphiteFunction
* Use Segment to simplify AddGraphiteFunction
* Memoize function defs
* Fix useCallback deps
* Update public/app/plugins/datasource/graphite/state/helpers.ts
Co-authored-by: Giordano Ricci <me@giordanoricci.com>
* Update public/app/plugins/datasource/graphite/state/helpers.ts
Co-authored-by: Giordano Ricci <me@giordanoricci.com>
* Update public/app/plugins/datasource/graphite/state/helpers.ts
Co-authored-by: Giordano Ricci <me@giordanoricci.com>
* Update public/app/plugins/datasource/graphite/state/providers.ts
Co-authored-by: Giordano Ricci <me@giordanoricci.com>
* Update public/app/plugins/datasource/graphite/state/providers.ts
Co-authored-by: Giordano Ricci <me@giordanoricci.com>
* Update public/app/plugins/datasource/graphite/state/providers.ts
Co-authored-by: Giordano Ricci <me@giordanoricci.com>
* Update public/app/plugins/datasource/graphite/state/providers.ts
Co-authored-by: Giordano Ricci <me@giordanoricci.com>
* Update public/app/plugins/datasource/graphite/state/providers.ts
Co-authored-by: Giordano Ricci <me@giordanoricci.com>
* Update public/app/plugins/datasource/graphite/state/providers.ts
Co-authored-by: Giordano Ricci <me@giordanoricci.com>
* Add more type definitions
* Remove submitOnClickAwayOption
This behavior is actually needed to remove parameters in functions
* Load function definitions before parsing the target on initial load
* Add button padding
* Fix loading function definitions
* Change targetChanged to updateQuery to avoid mutating state directly
It's also needed for extra refresh/runQuery execution as handleTargetChanged doesn't handle changing the raw query
* Fix updating query after adding a function
* Simplify updating function params
* Migrate function editor to react
* Simplify setting Segment Select min width
* Remove unnecessary changes to SegmentInput
* Extract view logic to a helper and update types definitions
* Clean up types
* Update FuncDef types and add tests
* Show red border for unknown functions
* Autofocus on new params
* Extract params mapping to a helper
* Split code between params and function editor
* Focus on the first param when a function is added even if it's an optional argument
* Add function editor tests
* Remove todo marker
* Fix adding new functions
* Allow empty value in selects for removing function params
* Add placeholders and fix styling
* Add more docs
* Create basic implementation for metrics and tags
* Post merge fixes
These files are not .ts
* Remove mapping to Angular dropdowns
* Simplify mapping tag names, values and operators
* Simplify mapping metrics
* Fix removing tags and autocomplete
* Simplify debouncing providers
* Ensure options are loaded twice and segment is opened
* Remove focusing new segments logic (not supported by React's segment)
* Clean up
* Move debouncing to components
* Simplify mapping to selectable options
* Add docs
* Group all components
* Remove unused controller methods
* Create Dispatch context
* Group Series and Tags Sections
* Create Functions section
* Create Section component
* use getStyles
* remove redundant async/await
* Remove
* remove redundant async/await
* Remove console.log and silent test console output
* Do not display the name of the selected dropdown option
* Move Section to grafana-ui
* Update storybook
* Simplify SectionLabel
* Fix Influx tests
* Fix API Extractor warnings
* Fix API Extractor warnings
* Do not show hidden functions
* Use block docs for better doc generation
* Handle undefined values provided for autocomplete
* Basic integration
* Move creating state to context.tsx
* Update tests
* Rename test
* Clean up dependencies
panel.targets is not needed for interpolation - it happens in the data source itself. It was used only to show query ref in the the dropdown for the segment.
* Update time range when it changes
* Change action name
* Simplify segments cloning
* Remove redundant variable
* Use styles instead of direct css
* Update docs
* Remove angular wrappers
* Remove redundant tests
* Section -> SegmentSection
* Simplify section styling
* Remove redundant div
* Fix unit tests
* Simplify SegmentSection component
* Use theme.spacing
* Use empty label instead of a single space label
* Remove targetFull
It was used in the past two store the query interpolated with sub-queries inside the model and send both to the backed (interpolated and not interpolated). This has been changed though - the logic has been moved away from model to the data source where interpolation happens and now only interpolated query is passed meaning targetFull is not needed anymore.
* Revert "Remove targetFull"
This reverts commit 499f8b33
* Bring back calculating targetFull
* Clean up
* Add missing dep
* Add missing dep in tests
* Fix time range synchronization
* Fix warning message
* Remove unused type
* Synchronize changes to the query
Co-authored-by: Giordano Ricci <me@giordanoricci.com>
* Sidemenu: Refactor TopSectionItem and BottomNavLinks into SideMenuItem
* Update failing snapshot
* BottomSection: Convert tests to RTL + add some extra unit tests
* Setup filter
* Enable filtering users by active in last 30 days
* Add loading state
* Update last active age strings
* Tweak user list
* Use theme spacing
* Improve table's accessibility
* Add more aria-labels
* AccessControl: add one-dimensional permissions to datasources in the backend
* AccessControl: add one-dimensional permissions to datasources in the frontend (#38080)
Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
* WIP: add delete functionality to playlist
* fixes deleted item to be removed instantly without manual refresh
* update confirmModal to reference playlist name
* refactor confirmModal message to be clear enough
* WIP: some unit tests for the playlistPage
* added more tests and did some cleanup
* some code refactoring
* adds ability for user roles to control playlist delete
* some abstraction to cleanup code
* modified alert message for delete button to correspond with action
* tried a better approach to modify the alert message
* fixes playlist lookup on each render
* update handlers to not use anonymous function
* exposed getBackendSrv().get api to fetch all playlist
* used better naming convention
* removes unecessary async/await construct
* some code refactoring
* used the correct param structure
* LibraryPanels: Separates name from panel title
* WIP
* Chore: fixes update for duplicate lib panels
* Chore: reverts implementation
* Chore: show library options only for library panels
* Chore: ui fixes after PR comments
* Chore: fixes issue when creating library panels
* Add encryption service
* Add tests for encryption service
* Inject encryption service into http server
* Replace encryption global function usage in login tests
* Migrate to Wire
* Move Encryption bindings to OSS Wire set
* Chore: Refactor securedata to remove global encryption calls from dashboard snapshots
* Fix dashboard snapshot tests
* Remove no longer user test
* Add dashboard snapshots service tests
* Refactor service initialization
* Set up dashboard snapshots service as a background service
Co-authored-by: Tania B <yalyna.ts@gmail.com>
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
* now to get it to build
* modified names, added the 455 day case, and added a comment
* removed wireguard override i used for my local
* updated the docs
* add key/value store service
* don't export kvStoreSQL, consumers should interact with KVStore & NamespacedKVStore
* add del method, avoid ErrNotFound (#38627)
* switch value column to medium text
Co-authored-by: Alexander Emelin <frvzmb@gmail.com>
* Add encryption service
* Add tests for encryption service
* Inject encryption service into http server
* Replace encryption global function usage in login tests
* Refactor UpdatePluginSetting
* Refactor EncryptSecureSettings
* Fix wire.go
* Refactor service initialization
Co-authored-by: Joan López de la Franca Beltran <joanjan14@gmail.com>
Co-authored-by: Joan López de la Franca Beltran <5459617+joanlopez@users.noreply.github.com>
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
* Add encryption service
* Add tests for encryption service
* Inject encryption service into http server
* Replace encryption global function usage in login tests
* Migrate to Wire
* Refactor authinfoservice to use encryption service
Co-authored-by: Joan López de la Franca Beltran <joanjan14@gmail.com>
Co-authored-by: Joan López de la Franca Beltran <5459617+joanlopez@users.noreply.github.com>
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
* prometheus: add monaco-based query-field
for now it is behind a feature-flag
* added new trigger character
* better separate grafana-specifc and prom-specific code
* better styling
* more styling
* more styling
* simpler monaco-import
* better imports
* simplified code
* simplified type imports
* refactor: group completion-provider files together
* renamed type
* simplify type-import
Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
* handle no-metric-name autocompletes
* updated comment
Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>