Commit Graph

28885 Commits

Author SHA1 Message Date
Owen Diehl
e37a780e14
Inhouse alerting api (#33129)
* init

* autogens AM route

* POST dashboards/db spec

* POST alert-notifications spec

* fix description

* re inits vendor, updates grafana to master

* go mod updates

* alerting routes

* renames to receivers

* prometheus endpoints

* align config endpoint with cortex, include templates

* Change grafana receiver type

* Update receivers.go

* rename struct to stop swagger thrashing

* add rules API

* index html

* standalone swagger ui html page

* Update README.md

* Expose GrafanaManagedAlert properties

* Some fixes

- /api/v1/rules/{Namespace} should return a map
- update ExtendedUpsertAlertDefinitionCommand properties

* am alerts routes

* rename prom swagger section for clarity, remove example endpoints

* Add missing json and yaml tags

* folder perms

* make folders POST again

* fix grafana receiver type

* rename fodler->namespace for perms

* make ruler json again

* PR fixes

* silences

* fix Ok -> Ack

* Add id to POST /api/v1/silences (#9)

Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>

* Add POST /api/v1/alerts (#10)

Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>

* fix silences

* Add testing endpoints

* removes grpc replace directives

* [wip] starts validation

* pkg cleanup

* go mod tidy

* ignores vendor dir

* Change response type for Cortex/Loki alerts

* receiver unmarshaling tests

* ability to split routes between AM & Grafana

* api marshaling & validation

* begins work on routing lib

* [hack] ignores embedded field in generation

* path specific datasource for alerting

* align endpoint names with cloud

* single route per Alerting config

* removes unused routing pkg

* regens spec

* adds datasource param to ruler/prom route paths

* Modifications for supporting migration

* Apply suggestions from code review

* hack for cleaning circular refs in swagger definition

* generates files

* minor fixes for prom endpoints

* decorate prom apis with required: true where applicable

* Revert "generates files"

This reverts commit ef7e975584.

* removes server autogen

* Update imported structs from ngalert

* Fix listing rules response

* Update github.com/prometheus/common dependency

* Update get silence response

* Update get silences response

* adds ruler validation & backend switching

* Fix GET /alertmanager/{DatasourceId}/config/api/v1/alerts response

* Distinct gettable and postable grafana receivers

* Remove permissions routes

* Latest JSON specs

* Fix testing routes

* inline yaml annotation on apirulenode

* yaml test & yamlv3 + comments

* Fix yaml annotations for embedded type

* Rename DatasourceId path parameter

* Implement Backend.String()

* backend zero value is a real backend

* exports DiscoveryBase

* Fix GO initialisms

* Silences: Use PostableSilence as the base struct for creating silences

* Use type alias instead of struct embedding

* More fixes to alertmanager silencing routes

* post and spec JSONs

* Split rule config to postable/gettable

* Fix empty POST /silences payload

Recreating the generated JSON specs fixes the issue
without further modifications

* better yaml unmarshaling for nested yaml docs in cortex-am configs

* regens spec

* re-adds config.receivers

* omitempty to align with prometheus API behavior

* Prefix routes with /api

* Update Alertmanager models

* Make adjustments to follow the Alertmanager API

* ruler: add for and annotations to grafana alert (#45)

* Modify testing API routes

* Fix grafana rule for field type

* Move PostableUserConfig validation to this library

* Fix PostableUserConfig YAML encoding/decoding

* Use common fields for grafana and lotex rules

* Add namespace id in GettableGrafanaRule

* Apply suggestions from code review

* fixup

* more changes

* Apply suggestions from code review

* aligns structure pre merge

* fix new imports & tests

* updates tooling readme

* goimports

* lint

* more linting!!

* revive lint

Co-authored-by: Sofia Papagiannaki <papagian@gmail.com>
Co-authored-by: Domas <domasx2@gmail.com>
Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>
Co-authored-by: gotjosh <josue@grafana.com>
Co-authored-by: David Parrott <stomp.box.yo@gmail.com>
Co-authored-by: Kyle Brandt <kyle@grafana.com>
2021-04-19 14:26:04 -04:00
Diana Payton
6238a7c4c4
Docs: Update pie-chart-panel.md (#33132) 2021-04-19 11:16:08 -07:00
Marcus Efraimsson
747f3cd300
Auth: Don't clear auth token cookie when lookup token fails (#32999)
If LookupToken fails we don't clear the auth token cookie.

Ref #15316
2021-04-19 19:46:25 +02:00
Alexander Emelin
3e3a0a1ea1
bump jaeger-client-go to v2.27.0 (#33134) 2021-04-19 20:38:14 +03:00
Ryan McKinley
f93b05f506
PanelEdit: only update when config changes (#33133) 2021-04-19 19:24:39 +02:00
Alexander Emelin
d807fbc9e9
Live: Telegraf input modifiers (#32982) 2021-04-19 18:48:43 +03:00
Uchechukwu Obasi
f92b6518c5
ValuePicker: refactors story from knobs to control (#33122)
* ValuePicker: refactors story from knobs to control

* fixes wrong type issue
2021-04-19 15:45:28 +01:00
Andrej Ocenas
13cb34bbca
Plugins: Support es5 plugins extending LanguageProvider (#33127) 2021-04-19 16:37:27 +02:00
Giordano Ricci
875fa37d10
Elasticsearch: Add documentation for supported Elasticsearch query transformations (#33072)
* Elasticsearch:  Add documentation for supported Elasticsearch query transformation

* Update docs/sources/datasources/elasticsearch.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Remove beta notives for ES logs

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-04-19 15:18:50 +01:00
Hugo Häggmark
9bb1484dc5
ConfirmModal: Migrates to React with new theme (#33107)
* ConfirmModal: Migrates to React

* Refactor: migrates to v2 styles

* Chore: updates after PR comments
2021-04-19 14:30:18 +02:00
dependabot[bot]
33621e6f9b
Bump github.com/uber/jaeger-client-go from 2.25.0+incompatible to 2.26.0+incompatible (#33106)
* Bump github.com/uber/jaeger-client-go

Bumps [github.com/uber/jaeger-client-go](https://github.com/uber/jaeger-client-go) from 2.25.0+incompatible to 2.26.0+incompatible.
- [Release notes](https://github.com/uber/jaeger-client-go/releases)
- [Changelog](https://github.com/jaegertracing/jaeger-client-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/uber/jaeger-client-go/compare/v2.25.0...v2.26.0)

Signed-off-by: dependabot[bot] <support@github.com>

* Fix go.sum

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-04-19 12:33:31 +02:00
Domas
60b469f836
Alerting: receivers page + template list (#33112) 2021-04-19 13:02:58 +03:00
Domas
382cab6406
Alerting: misc fixes (#33070) 2021-04-19 12:53:02 +03:00
Alexander Zobnin
41f6af96c4
Access control: Build navigation links with access control (#33024)
* Build nav links with access control

* Break up getNavTree (reduce cyclomatic complexity)

* Fix tests

* Use only ActionUsersRead permissions

* Remove unused permissions definitions

* Chore: remove unused fallbacks

* Fix linter error
2021-04-19 12:23:29 +03:00
Arve Knudsen
381e4a51cd
SQL data sources: Fix configuration UI (#33110)
* fix frontend mssql/postgres

* fix frontend

Co-authored-by: Ying WANG <ying.wang@grafana.com>
2021-04-19 10:30:29 +02:00
Ryan McKinley
0c64d88d64
Live: support legacy stream paths (#33101) 2021-04-19 00:47:14 -07:00
Torkel Ödegaard
76034ad1cb
Annotations: Fixing recursive angular watch loop (#33090) 2021-04-19 09:35:43 +02:00
dependabot[bot]
58380368af
Bump github.com/mattn/go-sqlite3 from 1.14.6 to 1.14.7 (#33104)
Bumps [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) from 1.14.6 to 1.14.7.
- [Release notes](https://github.com/mattn/go-sqlite3/releases)
- [Commits](https://github.com/mattn/go-sqlite3/compare/v1.14.6...v1.14.7)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-19 09:26:51 +02:00
Ryan McKinley
98789e7ed9
MatcherUI: show field name even when not found in results (#33102) 2021-04-19 09:02:58 +02:00
Ganesh Vernekar
6271777ec6
AlertingNG: Remove the receivers field from postable alerts (#33068)
* AlertingNG: Remove the receivers field from postable alerts and update tests

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>

* Fix review comments

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-04-19 12:28:44 +05:30
Torkel Ödegaard
d62601e664
Theme: Variable name changes & progress (#33088)
* Theme variable renames

* Fixed variable issue issue

* Fixed test

* fixed story

* More tweaks

* Updated snapshot
2021-04-17 19:17:18 +02:00
Torkel Ödegaard
c46f992bfb
Theme: More theme updates (#33076)
* Theme: More theme updates

* Updated so Switch design

* increase limit
2021-04-17 07:13:25 +02:00
Alexander Emelin
7d5a46ffda
Live: RunStream improvements – backoff, better layout, tests (#33029) 2021-04-17 01:17:08 +03:00
Per
1ed724ea6e
Update team.md (#33060)
Missing start { in http response.

Co-authored-by: achatterjee-grafana <aparajita.chatterjee@grafana.com>
2021-04-16 16:39:38 -04:00
achatterjee-grafana
79a4a86ee2
GE issue 1268 (#33049)
* Updated sentence format.

* Added new placeholder page for Enterprise License information, added links also adjusted weights.

* Created new folder license and moved 4 files to here.

* Added aliases.

* link fixes and such

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2021-04-16 12:47:07 -04:00
achatterjee-grafana
8edeae416e
Fixed some formatting issues for PRs from yesterday. (#33078) 2021-04-16 12:35:49 -04:00
Robby Milo
882e074ff6
update docs commands (#33062) 2021-04-16 11:29:06 -04:00
Piotr Jamróz
dd095642e2
Prometheus: Use fuzzy string matching to autocomplete metric names and label (#32207)
* Fuzzy search prototype

* Aggregate filter and sorting functions for auto-complete suggestions

* Add a test for fuzzy search

* Simplify setting fuzzy search information

* Rename SimpleHighlighter

* Test PartialHighlighter

* Add PartialHighlighter snapshot

* Simplify PartialHighlighter

* Revert env change

* Clean up the code

* Add fuzzy search for labels

* Bring back backwards compatiblity

* Expose search function type only

* Update docs

* Covert snapshot test to assertions

* Fix docs

* Fix language provider test

* Add a test for autocomplete logic

* Clean up

* Mock Editor functions

* Add fuzzy search to Prometheus labels

* Add docs about backwards compatibility

* Simplify main fuzzy search loop
2021-04-16 17:06:33 +02:00
Kyle Brandt
2c862678ab
AlertingNG/SSE: Datasource UID and UID/ID only (drop name) (#33039)
SSE still will support ID until dashboard/frontend always requests UID
update *.http examples

Co-authored-by: gotjosh <josue@grafana.com>
2021-04-16 15:29:19 +02:00
Torkel Ödegaard
5d1ec39224 RadioButton: Fixed line-height 2021-04-16 15:23:12 +02:00
Torkel Ödegaard
733bb45172
Button/Link Focus: Use focus-visible for keyboard focus (#33066)
* outside react approach

* fixed ts issues and updated radio button

* css only solution

* Removed a bit

* Updated radio button design and fixed focus state on ToolbarButton

* Fixes

* Added missing fullWidth
2021-04-16 15:22:31 +02:00
David Parrott
555da77527
Dparrott/labels on alert rule (#33057)
* move state tracker tests to /tests

* set default labels on alerts

* handle empty labels in result.Instance

* create annotation on transition to alerting state
2021-04-16 15:11:40 +02:00
Alexander Zobnin
8b843eb0a6
Access control: expose permissions to the frontend (#32954)
* Expose user permissions to the frontend

* Do not include empty scope

* Extend ContextSrv with hasPermission() method

* Add access control types

* Fix type error (make permissions optional)

* Fallback if access control disabled

* Move UserPermission to types

* Simplify hasPermission()
2021-04-16 16:02:16 +03:00
Piotr Jamróz
6ae73eaa22
Fix SCSS for dark (#33071) 2021-04-16 14:13:21 +02:00
gotjosh
362c4d4276
Alerting: Integration test rule creation (#33047)
* Alerting: Integration test rule creation

* Appease the linter

* Cleanup

* Make anonymous user role a parameter
2021-04-16 08:00:07 -04:00
Domas
0491fe0a5c
Alerting: separate namespace & group inputs for system alerts (#33026) 2021-04-16 14:57:33 +03:00
Arve Knudsen
dbe2f1871f
Chore: Sync go.mod and go.sum (#33065)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-04-16 13:41:17 +02:00
Uchechukwu Obasi
41b704716f
VizLayout: refactored story from knobs to controls (#33043)
* VizLayout: refactored storys from knobs to controls

* abstracted the array logic to a separate function
2021-04-16 10:13:24 +01:00
Domas
19c6a02f49
Alerting: alert list state view (#33020) 2021-04-16 12:08:08 +03:00
Domas
826d82fe95
Alerting: editing existing rules via UI (#33005) 2021-04-16 11:08:26 +03:00
Uchechukwu Obasi
cb6fe5e65b
Pagination: refactored story from knobs to controls (#33045) 2021-04-16 09:05:23 +01:00
Torkel Ödegaard
66485b3e70
Theme: V8 Theme updates (#33050)
* GraphNG: Use new theme props

* Minor fix to letterspacing in button

* Minor tweaks

* Updated

* Revert to roboto

* Added concept of a dark or white base

* Style updates

* Sass

* Updated light text blue

* updates

* reverting button group design

* Fixed tests

* updates

* Updated tests
2021-04-16 09:48:52 +02:00
Piotr Jamróz
da03175d0b
Explore: Load default data source in Explore when the provided source does not exist (#32992)
* Fallback to default data source in Explore and use uid for history

uid is used to allow changing the name of the datasource and preserve history

* Remove redundant console logs
2021-04-16 08:32:33 +02:00
Diana Payton
db29a8a8de
Docs: Replace next with latest in aliases (#33054) 2021-04-15 23:08:58 +02:00
achatterjee-grafana
cf6d3fb8fb
Added missing link item. (#33052) 2021-04-15 16:56:29 -04:00
David Parrott
2276e9556a
Alerting: set query in rules response (#33010)
* set query in rules response

* Theme: tweaking dark theme colors (#33007)

* Library Panels: Add library panel tab to share modal (#32953)

* Explore: Scroll split panes in Explore independently (#32978)

* Change default prometheus to latest and prometheus v1 to prometheus1

* Update README

* Remove prometheus1 block as not used

* Explore: Separatae scrolling in split view

* Update snapshot

* Allow skip migrations in tests via environment variable (#32958)

* Dashboard: Fix issue where Slack notifications won't link to users (#32861)

* DashboardPage: refactored styles from sass to emotion (#32955)

* DashboardPage: refactored styles from sass to emotion

* refactored dashboardPage component to be alot easier to read and understand

* more refactoring...

* more cleaning...

* fixes frontend test

* fixes frontend test- I hope

* fixes frontend test- I hope

* moves dashboard scss styles back to it's standalone file

* GraphNG: use theme font family and size for axis labels (#33009)

* GraphNG: use theme font family and size for axis labels

* fix test

* AlertingNG: Slack notification channel (#32675)

* AlertingNG: Slack notification channel

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>

* Add tests

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>

* Fix review comments

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>

* Fix review comments and small refactoring

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>

* GraphNG: stacking (#30749)

* First iteration

* Dev dash

* Re-use StackingMode type

* Fix ts and api issues

* Stacking work resurected

* Fix overrides

* Correct values in tooltip and updated test dashboard

* Update dev dashboard

* Apply correct bands for stacking

* Merge fix

* Update snapshot

* Revert go.sum

* Handle null values correctyl and make filleBelowTo and stacking mutual exclusive

* Snapshots update

* Graph->Time series stacking migration

* Review comments

* Indicate overrides in StandardEditorContext

* Change stacking UI editor, migrate stacking to object option

* Small refactor, fix for hiding series and dev dashboard

* VizLegend: sets a min and max value of the seriesCount control in Storybook (#33022)

* Alerting: Filter rules list (#32818)

* Chore: Reduces strict errors (#33012)

* Chore: reduces strict error in OptionPicker tests

* Chore: reduces strict errors in FormDropdownCtrl

* Chore: reduces has no initializer and is not definitely assigned in the constructor errors

* Chore: reduces has no initializer and is not definitely assigned in the constructor errors

* Chore: lowers strict count limit

* Tests: updates snapshots

* Tests: updates snapshots

* Chore: updates after PR comments

* Refactor: removes throw and changes signature for DashboardSrv.getCurrent

* [Alerting]: Several modifications in alert rules (#32983)

* [Alerting]: Use common properties for all rules

* Add Labels in rules

* Fix update ruleGroup API

Return 400 Bad Request response
when the request contains a UID that does not exist

* Check permissions and return namespace id

* Apply suggestions from code review

Co-authored-by: gotjosh <josue@grafana.com>

* WIP (#33025)

* Chore: Bump strict error count limit (#33035)

* set query in rules response

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
Co-authored-by: Dafydd <72009875+dafydd-t@users.noreply.github.com>
Co-authored-by: n-wbrown <n-wbrown@users.noreply.github.com>
Co-authored-by: Uchechukwu Obasi <obasiuche62@gmail.com>
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
Co-authored-by: Nathan Rodman <nathanrodman@gmail.com>
Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
Co-authored-by: gotjosh <josue@grafana.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-04-15 22:23:16 +02:00
achatterjee-grafana
57091e3d62
Fix for doc issue https://github.com/grafana/grafana/issues/32890 (#33034)
* Added new section "Implications of enabling `Anonymous` access to dashboards".

* Linked from Anonymous authentication section in "Grafana Auth".

* Update docs/sources/administration/security.md

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* Update docs/sources/auth/grafana.md

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* Fixed formatting issues.

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2021-04-15 11:39:41 -04:00
Marcus Efraimsson
442d3df29c
Chore: Bump strict error count limit (#33035) 2021-04-15 16:21:33 +02:00
Ivana Huckova
4f7728738e
WIP (#33025) 2021-04-15 15:06:26 +02:00
Sofia Papagiannaki
6bbb2fd4ba
[Alerting]: Several modifications in alert rules (#32983)
* [Alerting]: Use common properties for all rules

* Add Labels in rules

* Fix update ruleGroup API

Return 400 Bad Request response
when the request contains a UID that does not exist

* Check permissions and return namespace id

* Apply suggestions from code review

Co-authored-by: gotjosh <josue@grafana.com>
2021-04-15 15:54:37 +03:00