* AuthProxy: Fixes bug where long username could not be cached (#22926)
(cherry picked from commit 6c9d833602)
* Server: Exit with 0 if no error (#23312)
Make grafana-server exit with 0 if no error occurred.
(cherry picked from commit 5645d74cbc)
* Dashboard: Save json should preserve folderId (#23314)
(cherry picked from commit 7e3b43eabb)
* TimeSrv: Try to parse 8 and 15 digit numbers as timestamps if parsing as date fails (#21694)
* Try to parse 8 and 15 digit numbers as timestamps if parsing as date fails
Fixes#19738
* Add tests
(cherry picked from commit c89ad9b038)
* BackendSrv: include credentials when withCredentials option is set (#23380)
The fetch() API won't send cookies or other type of credentials unless
you set the credentials init option. Some datasources like Prometheus
and Elasticsearch have `withCredentials` option in Browser access mode,
but this option is not currently getting passed in the fetch() API.
Fixes#23338.
(cherry picked from commit afd8ffde69)
* Dashlist: Fixed dashlist broken in edit mode (#23426)
(cherry picked from commit 363bf7506d)
* Admin: Fix Synced via LDAP message for non-LDAP external users (#23477)
* UserAdmin: remove Synced via LDAP message for non-LDAP users
* UserAdmin: show "Synced via <provider>" message for external users
(cherry picked from commit 4d81cec34f)
* Graphite: Fixed cannot read finally of undefiend (#23512)
(cherry picked from commit 61460ea3a2)
* Hangouts: fixes notifications for alerts with empty message (#23559)
* Hangouts: fixes notifications for alerts with empty message
* Update pkg/services/alerting/notifiers/googlechat.go
Co-Authored-By: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
(cherry picked from commit 2661054fe8)
* Variables: fixes error when setting adhoc variables values (#23580)
(cherry picked from commit 0091885b13)
* Release 6.7.3
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
* ci-metrics-publisher.sh: Fix linting issue
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
* TablePanel: Fix XSS issue in header column rename (backport) (#23814)
* escaping html when rendering table header alias.
* fixed tooltip.
Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
* Security: Fix annotation popup XSS vulnerability (#23813)
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
(cherry picked from commit 3955e8cbad)
Co-authored-by: Jon McKenzie <jcmcken@gmail.com>
Co-authored-by: Peter Holmberg <peterholmberg@users.noreply.github.com>
Co-authored-by: Jesse Tan <jessetan@users.noreply.github.com>
Co-authored-by: Tuan Anh Hoang-Vu <hvtuananh@gmail.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>
Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
* BackendSrv: Added config to response
* QueryInspector: Removing config from showing up
* Replace config with request and make it be the unmodified params sent in
(cherry picked from commit 40d195e4a7)
* Fix to make sure we have the correct dataIndex when using data links.
* fixed strict null errors.
* decreased number of errors.
(cherry picked from commit 41bc1aa3ae)
* Initial commit
* Visualised renamed or deleted datasources as well, if they have queries
* Pass ds image to card and information if the datasource was removed/renamed
* Set up card with datasource info and change run query
* Style comment, run button
* Fix button naming
* Remember last filters
* Update public/app/core/store.ts
* Update public/app/features/explore/RichHistory/RichHistory.tsx
* Update comments
* Rename datasource to data source
* Add test coverage, fix naming
* Remove unused styles, add feedback info
Co-authored-by: Ivana <ivana.huckova@gmail.com>
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
(cherry picked from commit db85c3e7b9)
* azuremonitor: adds support for workspaces query macro...
...for Azure Logs template variable queries
* docs: azure logs workspaces templating function
* Update docs/sources/features/datasources/azuremonitor.md
Co-Authored-By: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
* docs: convert list into table
* docs: fixes prettier formatting problem
Prettier adds a slash before dollar signs in markdown. Disabling it
for this table with a prettier comment.
https://prettier.io/docs/en/ignore.html
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
(cherry picked from commit 3b9a4e6444)
* Initial commit
* Fix spelling of data sources
* Display sorting value for starred and query tab
* Fix handle color for light theme
* Add close button and fix animation
* Remove toggling of tabs
* Stop event propagation when clicking on comment buttons
* Add title for card functionality
* Remove interpolation for easier searchability of variables
* Improve syncing of comments and starred
* Add modal to check if user wants to permanently delete history
* Fix the height of the query card buttons
* Adjust slider's width based on drawer width
* Add spacing between slider and legend
* Semantic variable naming
* Fix disabled button when live tailing
* Add error handling
* Remove unused imports
* Fix starring, remove useEffect
* Remove emiting of appEvents.alertError in store
* Remove unused imports
(cherry picked from commit 544690060a)
* changed so data query response always it returned in the correct order when using mixed data sources.
* refactored the code to make it a bit simpler and not failing the tests.
* changed to simple array type.
(cherry picked from commit f44c0f0643)
* Revert "API: Fix redirect issue when configured to use a subpath (#21652)" (#22671)
This reverts commit 0e2d874ecf.
* Fix redirect validation (#22675)
* Chore: Add test for parse of app url and app sub url
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
* Fix redirect: prepend subpath only if it's missing (#22676)
* Validate redirect in login oauth (#22677)
* Fix invalid redirect for authenticated user (#22678)
* Login: Use correct path for OAuth logos
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
* Explore: adds QueryRowErrors component
* Explore: updates QueryRow to use QueryRowErrors component
* Explore: updates PromQueryField to remove error render
* Explore: updates Elastic query field to remove error render
* Explore: updates LokiQueryFieldForm to remove error render
* Explore: updates QueryRow component - brings back passing errors down
* Explore: removes QueryRowErrors component
* Explore: updates ErrorContainer component - moves out data filtering
* Explore: updates QueryRow component - changes QueryRowErrors to ErrorContainer
* Explore: updates Explore component - adds error filtering for ErrorContainer
* Explore: updates ErrorContainer and adds a basic test for it
* Explore: updates Explore component props name and adds a basic render test
* Explore: adds snapshots for Explore and ErrorContainer
* Explore: adds a test for error render
* Explore: adds a comment to Explore component explaining the way we filter non-query-row-specific errors
* Explore: adds getFirstNonQueryRowSpecificError method to explore utilities
* Explore: extracts getFirstNonQueryRowSpecificError method and slightly refactors Explore component
* Explore: updates Explore component tests to cover non-query-row-specific errors
line 31 : makes user a superadmin : multiple use of 'a' can be avoided for better reading
line 35: User can belong to : remove 'be' it is incorrect
line 51: allow you : typo correction
* Minor changes
* Only exclude installed packages that are not @grafana/e2e itself
* Explicitly load Cypress tsconfig for clarity
* Fix Cypress tsconfig
* it was trying to extend a config that is not published
* it needs to be commonjs
* Explore: Refactor active buttons css
* Explore: Add query history button
* WIP: Creating drawer
* WIP: Create custom drawer (for now)
* Revert changes to Drawer.tsx
* WIP: Layout finished
* Rich History: Set up boilerplate for Settings
* WIP: Query history cards
* Refactor, split components
* Add resizability, interactivity
* Save history to local storage
* Visualise queries from queryhistory local storage
* Set up query history settings
* Refactor
* Create link, un-refactored verison
* Copyable url
* WIP: Add slider
* Commenting feature
* Slider filtration
* Add headings
* Hide Rich history behind feature toggle
* Cleaning up, refactors
* Update tests
* Implement getQueryDisplayText
* Update lockfile for new dependencies
* Update heading based on sorting
* Fix typescript strinctNullCheck errors
* Fix Forms, new forms
* Fixes based on provided feedback
* Fixes, splitting component into two
* Add tooltips, add delete history button
* Clicking on card adds queries to query rows
* Delete history, width of drawers
* UI/UX changes, updates
* Add number of queries to headings, box shadows
* Fix slider, remove feature toggle
* Fix typo in the beta announcement
* Fix how the rich history state is rendered when initialization
* Move updateFilters when activeDatasourceFilter onlyto RichHistory, remove duplicated code
* Fix typescript strictnull errors, not used variables errors
* Fix property descriptions, add missing properties
Fixes incorrect property descriptions, adds missing properties, and adds an up-to-date example.
* Update logo descriptions
Updates the "large" and "small" logo descriptions to specify SVG image type requirement, and that they may be identical
* Update docs/sources/plugins/developing/plugin.json.md
* Refactor the picker to FC
* Remove redundant variable
* currentDashboardId => currentDashboard
* Make isClearable configurable
* Use useAsyncFn for options loading
* Move getDashboards outside of component
* Refactor: Adds variables in state to TemplateSrv
* Refactor: Introduces some typings and structures
* Refactor: Introduces picker to adapter
* Refactor: Removes useState and introduces contains instead
* Refactor: Introduces Variable Editor
* Refactor: Adds uuid and simplifies state
* Refactor: Consolidates to VariableRenderer
* Refactor: Adds name change capability
* Refactor: Adds variableMiddleware
* Refactor: Adds ability to change Angular type to type in State
* Fix: Fixes so we check for duplicate names
* Refactor: Adds ability to change State type to type in Angular
* Refactor: Updates name in dashboard templating list
* Refactor: Adds label change to VariableEditor
* Refactor: Adds hide change to VariableEditor
* Refactor: Adds update ability
* Refactor: Adds tooltip
* Refactor: Adds SelectionOptionsEditor
* Refactor: Adds query editor and validation
* Refactor: Adds regex and sort to editor
* Refactor: Adds Selection options
* Refactor: Adds Varible Values Previewer
* Refactor: Changes from array in state to Record
* Refactor: Removes getVariableAtIndex from templateSrv
* Tests: Fixs broken tests
* Chore: Fixes duplicate merge import
* Refactor: Removes strict null errors
* Refactor: Adds duplicate variable
* Refactor: Adds remove variable
* Refactor: Adds change order of variables
* Refactor: Adds add new variable
* Chore: Fixes Prettier formatting
* Refactor: Adds VariablePicker
* Fixed so sub menu is displayed when we only have redux template variables.
* removed unused variable.
* tags will be visibile in the new react picker.
* added some nice colors to the tags.
* Added thunk for selecting a tag.
* Refactor: Cleans up templating state when dashboard unloads
* Refactor: Adds save capabilities for variables in state
* added possibility to select tag.
* Added so you can deselect a tag.
* Fixed issue with coloring on top.
* minor refactoring to make the code more slim.
* Refactor: Fixes dispatch return and copy of variable
* selecting options when tag i selected
* small refactoring.
* fixed so we use options.
* Refactor: Adds getValueForUrl capabilities
* first implementation of keyboard navigation on picker.
* removed comment.
* fixed so you can toggle all options.
* Refactor: Simplified state handling using Redux Toolkit and flat reducer structure
* Refactor: Adds sharedTemplatingReducer and queryVariableReducer
* Tests: Fixs broken tests
* Chore: Removes some strict null errors
* Tests: Fix broken tests
* Refactor: Splitted QueryVariablePicker into smaller components
* Refactor: Moves linktext and selected tags to component instead
* Fix: Fixes the ability to have multiple dropdowns opened at same time
* Fix: Fixes onKeyDown from prev refactor
* Refactor: Adds searchfilter searching
* Tests: Fixes after running e2e tests
* Refactor: Adds an attempt to solve dependencies at startup
* Refactor: Adds feature toggle
* Refactor: Resets all angular files to master
* Refactor: Move stuff to query folder
* Refactor: Initial commit for SubMenu component
* Refactor: Updated DashboardModel with new list
* Refactor: Adds feature toggle to dashboard model and friends
* Refactor: Adds picker to SubMenu
* Refactor: Fixes styling on SubMenu
* Refactor: Fixes processvariables
* Refactor: Initial EditorList skeleton
* Refactor: Refactors out VariableEditorList and VariableEditorContainer
* Refactor: Adds New variable functionality
* Refactor: Adds registred types
* Refactor: Adds edit existing variable functionality
* Refactor: Changes params to thunks
* Refactor: Small fix for cleaning up state when clicking update/add
* Refactor: Better typings for outer containers
* Refactor: Adds change order functionality
* Refactor: Removed notify angular args
* Change so the url is in sync with the redux template variables.
* Adding support for saving proper values and checking changes.
* Refactor: Adds duplicate variable functionality
* Feature: Adds remove variable functionality
* Refactor: Small refactor so e2e tests work as before
* Refactor: Returns null if no visible variables
* Refactor: Adds annotations to SubMenu
* Refactor: Fixes toggling of annotations in SubMenu
* added dashboard links to new submehu.
* Refactor: Small refactor breaking up into smaller components
* Fix: Fixes infinite recursive loop when changing varible name
* Templating: Do not mutate location query state
* Refactor: Fixes minor timing issue when adding new variable
* Refactor: removes initialization in variable_srv constructor
* Refactor: Suggestion on how to handle templating.list in DashboardExporter
* Refactor: Adds getVariables typings and changes ChangeTracker and ShareSnapshotCtrl
* Refactor: Adds getVariable on DashboardModel and changes DashboardMigrator
* Fix: Fixes repeated panels
* wip: starting to add custom variable type.
* Refactor: Merging two different toVariablePayload functions
* Tests: Fixes broken tests
* Fix: Reduces strict null errors
* Tests: Initial commit and fixes strange dependency order
* Tests: Covers sharedTemplatingReducer with tests
* Refactor: Rename state/index.ts => state/reducers.ts as every where else
* Refactor: Renames and moves adapters.ts
* Tests: Adds tests for templatingReducer
* Tests: Adds intitial tests for queryVariableReducer
* starting to ad custom variable.
* Tests: Adds more queryVariableReducer tests
* Added support for custom variable. Next up applying some DRY principles and refactoring.
* fixed compile issue.
* added todo.
* Tests: Fixes broken test
* Tests: Covers queryVariableReducer with tests and fixed a couple of bugs
* Fix: Fixes broken test
* Fix: Reduces strict null errors
* change so custom won't be depending on anything elese.
* fixed descriptions.
* removed unused dependency.
* Fixed issue when adding a new variable and editor is being unmount twice.
* fixed issue with select option loop.
* changed so we update query on typing in editor and removed it from component state.
* Moved runQuery up one level in the component tree.
* renamed action and moved it to custom actions.
* moved applyStateChanges to shared code.
* removed todo comment.
* first stab on moving picker to more general.
* Refactor: Changes so we always show variables type
* removed duplicate code regarding picker.
* Did some renamings.
* Feature: Adds text box variable type
* moved tests from query reducer to picker reducer.
* Removed picker from VariableState.
* removed reference to picker.
* Some more refactorings of the picker reducer + actions.
* Chore: Refactors away editor state to its own state slice (#22515)
* Refactor: Inital move, tests not working
* Tests: Adds editorReducer tests
* Refactor: Cleaning up
* Refactor: Moves logic to thunk instead
* Refactor: Initial commit
* Refactor: Combines reducers to one state
* Refactor: Adds combine reducers
* moved navigation logic flow to a thunk instead of in the component.
* fixed issue with rendering picker link.
* Refactor: Removes variable prop from templating.variables
* refactored and removed some more code.
* Feature: adds Constant variable type
* fixed so tags can be selected.
* Fix: fixes default hide for constant and enum order
* fixed so tags works again.
* Fix: fixes so we use Angular editor when newVariables is not defined
* Fix: fixes wrong hide default for Constant variable
* Fix: fixes bug when using duplicate button
* Fix: changes action id
* Tests: prepares for newVariables
* Chore: reduces strict null errors
* Refactor: removes uuidInEditorReducer for simplification
* Chore: changes after PR comments
* Chore: uses getConfig instead of config
* Tests: fixes so e2e tests check for feature toggle and fixed initLock bug
* Refactor: changes so sharedReducer uses createSlice instead
* Refactor: changes textBoxVariableReducer to use creactSlice instead
* Refactor: changes queryBoxVariableReducer to use creactSlice instead
* Refactor: changes customVariableReducer to use creactSlice instead
* Refactor: changes constantVariableReducer to use creactSlice instead
* Refactor: moves types to specific types.ts files instead
* changed so we use queryValue stored on the variable to populate options input when opening picker.
* Feature: adds the ability to test templating thunks using real store and middleware
* Chore: cleans up unused import
* excluded queryValue from the getSaveModel
* Refactor: adds whenAsyncActionIsDispatched to reduxTester
* Tests: adds initial tests for processVariables
* Added reducer tests for constant variable.
* added tests for custom reducer.
* added tets for texbox reducer.
* Tests: adds more tests for ProcessVariable
* Refactor: fixes processVariable flow so we do notrun updateOptions twice
* Tests: finishes tests for processVariables and removed skip test
* added actions tests for custom and constant.
* Tests: adds tests for setOptionFromUrl
* Tests: adds a naive variable mock builder
* Tests: adds tests for validateVariableSelectionState
* added tests for query variable actions.
* added last test for query actions.
* added more tests.
* some more tests.
* fixed typing errors.
* Fixed issues with variable tags.
Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
* Minor changes
* Revert CLI to JavaScript
... as Rollup is only accepts ESM modules and TypeScript would need to use the new incremental builds feature which causes weird Redux module errors.
* Adding git publish to toolkit
* grafana-toolkit new feature plugin:github-release
* Feedback from code review
1. Used async await and exec for executing commands
2. Using dist folder to get plugin information
* Reverting change to plugin.json back to original value.
* reverted changes to yarn.lock
* reverted changes to yarn.lock
* feedback from code review
* feedback from code review 2
* moved constants to recommended functions
* styling changes and reverting yarn.lock
* removing changes to package.json
* replced execLine with execa
* better error detection around the publish token
* made simpler with commitHash from build
* Testing showed a number of required changes:
- Make the sha configurable
or through environment variable
or through git config.
- Allow a release to be recreated
- Set name and repo from git config as this is what
ghr is expecting anyway.
- Appropriate errors if the user
tries to run a release without
doing a ci-build and ci-package first.
* Using spinner.
Took out extra dependencies out of project.json
wrote tests manually.
* Updated tests. Now passing
* Adding git publish to toolkit
* grafana-toolkit new feature plugin:github-release
* Feedback from code review
1. Used async await and exec for executing commands
2. Using dist folder to get plugin information
* Reverting change to plugin.json back to original value.
* reverted changes to yarn.lock
* reverted changes to yarn.lock
* feedback from code review
* feedback from code review 2
* moved constants to recommended functions
* styling changes and reverting yarn.lock
* removing changes to package.json
* replced execLine with execa
* better error detection around the publish token
* made simpler with commitHash from build
* Testing showed a number of required changes:
- Make the sha configurable
or through environment variable
or through git config.
- Allow a release to be recreated
- Set name and repo from git config as this is what
ghr is expecting anyway.
- Appropriate errors if the user
tries to run a release without
doing a ci-build and ci-package first.
* Using spinner.
Took out extra dependencies out of project.json
wrote tests manually.
* Updated tests. Now passing
* updated test for reducers, from master
* package.json and yarn.lock from master
* Trigger onchange in case user has edited a custom option, and then clicked outside the react select dropdown
* The width of the label is calculated so that the react select input field could get the same width. However, the react select input font is slightly wider, so we need to make that width a little bit larget than the label.
Use v0.19.0 of SDK.
Support handling of streaming resource response.
Disable gzip/compression middleware for resources
to allow chunked/streaming response to clients the gzip
middleware had to be disabled since it buffers the full
response before sending it to the client.
Closes#22569
Co-Authored-By: Arve Knudsen <arve.knudsen@gmail.com>
* Stats: add active user count query
* License: add info in settings
* Stats: Retrieve active users stats for different roles
+ Clean files and tests
* Stats: add dialect.Quote in queries
* Stats: improve tests (require instead of assert)
* Stats: improve tests (require instead of assert)
* ShareModal: use generic tab type
* ShareModal: able to extend with custom tabs
* ShareModal: able to extend dash/panel tabs separately
* grafana-ui: ModalTabContent component
* Minor changes
* Include Cypress support files in published package
* Added CLI
… with support for custom configurations (which Cypress does not currently support by default):
* Loads cypress.json from @grafana/e2e as a base config (via a custom Cypress plugin)
* Sets default values for project-level Cypress files (tests, etc)
* Optionally loads a cypress.json from the current working directory as overrides
* Updated lockfile
* Add fallback to search_base_dns if group_search_base_dns is undefined.
refs: #20862
* removed newline to make lint-go happy
* Added requested changes on ldap.md for last commit
Refs: #21263
* Docs: Adding a Markdown Style Guide
What this PR does / why we need it: This request builds a markdown style guide for writers documenting information about Grafana services for users.
This PR serves the need to make documentation and READMEs more consistent and maintainable.
Which issue(s) this PR fixes: This request fixes the issue grafana#19592
Fixes grafana#19592
Special notes for your reviewer:
@marcusolsson and @oddlittlebird, sorry for the delay. I've set up the style guide, and it is ready for review, or additional sections.
* Docs: Adding a Markdown Style Guide
What this PR does / why we need it: This request builds a markdown style guide for writers documenting information about Grafana services for users.
This PR serves the need to make documentation and READMEs more consistent and maintainable.
Which issue(s) this PR fixes: This request fixes the issue grafana#19592
Fixes grafana#19592
Special notes for your reviewer:
@marcusolsson and @oddlittlebird, sorry for the delay. I've set up the style guide, and it is ready for review, or additional sections.
* Docs: fixing typos and char repetition
Editing some typos in the text, and removing the repetition of A and B characters that appeared in the file.
* Docs: Changing content following review of new Markdown Style Guide
- adjustment to headings to sentence case.
- adding an introduction
- removing punctuation content
- making suggested word and punctuation fixes
Fixes#19592
* Add new form styles to dashboard picker
* Use Forms.Select for TimeZonePicker
* Use new form elements for DashboardPicker
* Grafana UI: Extract types from SelectBase, add utils.ts
* Grafana UI: Fix imports
* Grafana UI: Add support for value of type number
* Grafana UI: tweak value search function
* Grafana UI: Add tests for findSelectedValue
* Grafana UI: Add tests for cleanValue
* Grafana UI: Remove redundant check
* Grafana UI: Order imports
* Grafana-UI: Fix TimeZonePicker.story.tsx
* Grafana-UI: Fix timezone value
* Fix merge
* Grafana-UI: Use Cascader vs Forms.Select for TimeZonePicker
* Grafana-UI: Add default size props
Moves common request proxy utilities to proxyutil package with
support for removing X-Forwarded-Host, X-Forwarded-Port,
X-Forwarded-Proto headers, setting X-Forwarded-For header
and cleaning Cookie header.
Using the proxyutil package to prepare and clean request
headers before resource calls.
Closes#21512
* Add mechanism for imperatively showing modals
* Migration work in progress
* Reorganise save modal components
* use app events emmiter instead of root scope one
* Add center alignment to layoout component
* Make save buttons wotk
* Prettier
* Remove save dashboard logic from dashboard srv
* Remove unused code
* Dont show error notifications
* Save modal when dashboard is overwritten
* For tweaks
* Folder picker tweaks
* Save dashboard tweaks
* Copy provisioned dashboard to clipboard
* Enable saving dashboard json to file
* Use SaveDashboardAsButton
* Review
* Align buttons in dashboard settings
* Migrate SaveDashboardAs tests
* TS fixes
* SaveDashboardForm tests migrated
* Fixe some failing tests
* Fix folder picker tests
* Fix HistoryListCtrl tests
* Remove old import
* Enable fixed positioning for folder picker select menu
* Modal: show react modals with appEvents
* Open react modals using event
* Move save dashboard modals to dashboard feature
* Make e2e pass
* Update public/app/features/dashboard/components/SaveDashboard/SaveDashboardButton.tsx
* Hacking old vs new buttons to make all the things look like it's old good Grafana ;)
Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>
* clean PR #17366
* udpate vendor
* [WIP] Implement projects management for stackdriver
* [WIP] Implement projects management for stackdriver
* [WIP] Implement projects management for stackdriver
* Implement projects management for stackdriver
* [WIP][Tests] Fix errors
* clean anonymous struct
* remove await
* don't store project list
* Add default project on query editor
* gofmt
* Fix tests
* Move test data source to backend
* Use segment instead of dropdown. remove ensure default project since it's not being used anymore.
* Fix broken annotation editor
* Load gceDefaultAccount only once when in the config page
* Reset error message on auth type change
* Add metric find query for projects
* Remove debug code
* Fix broken tests
* Fix typings
* Fix lint error
* Slightly different approach - now having a distiction between config page default project, and project that is selectable from the dropdown in the query editor.
* Fix broken tests
* Attempt to fix strict ts errors
* Prevent state from being set multiple times
* Remove noOptionsMessage since it seems to be obosolete in react select
* One more attempt to solve ts strict error
* Interpolate project template variable. Make sure its loaded correctly when opening variable query editor first time
* Implicit any fix
* fix: typescript strict null check fixes
* Return empty array in case project endpoint fails
* Rename project to projectName to prevent clashing with legacy query prop
* Fix broken test
* fix: Stackdriver - template replace on filter label
should have a regex format as that escapes the dots
in the label name which is not valid.
Co-authored-by: Labesse Kévin <kevin@labesse.me>
Co-authored-by: Elias Cédric Laouiti <elias@abtasty.com>
Co-authored-by: Daniel Lee <dan.limerick@gmail.com>
* Elastic: To get fields, start with today's index and go backwards
* Elastic: distinguish non-existing indices from other issues; change index traversal from recursive to iterative; go through a max of 7 days
* Elastic: fix the comments
Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
* Inital commit with new page
* Make routing work
* Correct field
* Move submit button and fix routing after signup
* Remove comments
* Fix feedback
* Undo mistake
This feature would provide a way for administrators to limit the minimum
dashboard refresh interval globally.
Filters out the refresh intervals available in the time picker that are lower
than the set minimum refresh interval in the configuration .ini file
Adds the minimum refresh interval as available in the time picker.
If the user tries to enter a refresh interval that is lower than the minimum
in the URL, defaults to the minimum interval.
When trying to update the JSON via the API, rejects the update if the
dashboard's refresh interval is lower than the minimum.
When trying to update a dashboard via provisioning having a lower
refresh interval than the minimum, defaults to the minimum interval
and logs a warning.
Fixes#3356
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
* NewPanelEdit: Added angular options to new panel editor and started looking and angular component state
* Moved angular component state to redux
* Close to working 100%
* Think everything is working
* AlertTab: Alert tab now gets angularComponent from redux
* Fixed panel menu access to angular panel component
* Added new tests
* Fixed unit test
* Fixed strict null errors
* Fixed typescript issues
* fixed issues
* Specify usage of datasource whitelist
Added a sentence explaining the data_source_proxy_whitelist property does not have any effect on pgsql mssql and mysql.
Co-Authored-By: Arve Knudsen <arve.knudsen@gmail.com>
Co-Authored-By: Marcus Efraimsson <marcus.efraimsson@gmail.com>
* trying out api-extractor.
* works with our setup of build.
* wip.
* changed the packages so it works better with the api-extractor.
* Changes to make the api-extractor to work.
* cleaned up the api-extractor config files.
* added some more documentation.
* added tsdoc-metadata to gitignore.
* removed the generated docs (will do that in another PR).
* added execute permission to script for generating dosc.
* added so we will push generated docs to branch.
* will clean packages_api on abort.
* Fixed failing tests.
* fixed formatting issue with typedoc comment.
* temporarily disabled tslint rules about namespace until https://github.com/microsoft/rushstack/issues/1029 is resolved
* temporary enabled bable namespaces.
* updated build script.
* updated script.
* updated script with some colors.
* changed to camelCase.
* removed spacing.
* Starting to add documentation guidelines.
* added examples headline.
* added menu options.
* added parameters and return values.
* Fixed merge error.
* Added first version of auto-generated docs.
* changed so we use the eslint ignore syntax.
* changed to correct eslint ingnore comment.
* fixed some spelling errors reported by codespell.
* added script to generate docs in current folder.
* updated api docs.
* lerna bootstrap.
* added eror to the ingore words list.
* removed file that should be ignored.
* updated locKFILE.
* referenced the code comments guidelines.
* updated packages.
* updated deps.
* updated the autogenerated dosc.
* adding missing new line.
* trying out api-extractor.
* works with our setup of build.
* wip.
* changed the packages so it works better with the api-extractor.
* Changes to make the api-extractor to work.
* cleaned up the api-extractor config files.
* added some more documentation.
* added tsdoc-metadata to gitignore.
* removed the generated docs (will do that in another PR).
* added execute permission to script for generating dosc.
* added so we will push generated docs to branch.
* will clean packages_api on abort.
* Fixed failing tests.
* fixed formatting issue with typedoc comment.
* temporarily disabled tslint rules about namespace until https://github.com/microsoft/rushstack/issues/1029 is resolved
* temporary enabled bable namespaces.
* updated build script.
* updated script.
* updated script with some colors.
* changed to camelCase.
* removed spacing.
* Starting to add documentation guidelines.
* added examples headline.
* added parameters and return values.
* Fixed merge error.
* changed so we use the eslint ignore syntax.
* changed to correct eslint ingnore comment.
* fixed some spelling errors reported by codespell.
* added script to generate docs in current folder.
* lerna bootstrap.
* removed file that should be ignored.
* updated locKFILE.
* referenced the code comments guidelines.
* updated packages.
* updated deps.
* Docs: Add info on active LDAP sync
* Update docs/sources/enterprise/enhanced_ldap.md
Co-Authored-By: Leonard Gram <leo@xlson.com>
* Docs: remove usage of "he" in LDAP sync
Co-authored-by: Leonard Gram <leo@xlson.com>
* Adding new svg for back arrow button
* Created new back button component
* same stroke width
* minor fix
* Style changes
* hover animation
* Minor tweak
* Suggesting couple of changes to the document
Line 15 should be modified to use your application instead of an application, same way it is being used in other auth docs.
typo in line 76, can is repeated twice . Correcting that typo
* Update docs/sources/auth/gitlab.md
Co-Authored-By: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
* Update gitlab.md
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
* Add new form and functionality
* Add new files
* Connect to Redux and add navigation stuff
* Add required login/name
* Remove import
* Fix feedback
* Replace direct button spacing with HorizontalGroup
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
* Couple of changes to the document
Correcting a typo in line 53
Line 226 should be re-written as "To easily configure"
* Update docs/sources/auth/generic-oauth.md
Co-Authored-By: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
By storing render key in remote cache it will enable
image renderer to use public facing url or load
balancer url to render images and thereby remove
the requirement of image renderer having to use the
url of the originating Grafana instance when running
HA setup (multiple Grafana instances).
Fixes#17704
Ref grafana/grafana-image-renderer#91
Suppresses stacktrace in recovery middleware if error is
http.ErrAbortHandler.
Skips writing response error in recovery middleware if
resoonse have already been written.
Skips try rotate of auth token if response have already
been written.
Skips adding default response headers if response have
already been written.
Fixes#15728
Ref #18082
Co-Authored-By: Arve Knudsen <arve.knudsen@gmail.com>
Put the cipher suites with Forward Secrecy at or nearer the top, keeping any TLS v1.3 suites at the top, following best practice guides for the ordering of the rest. There is no change to the selection of suites only reordering.
Now any errors logged by http.ReverseProxy are forwarded to
Grafana's logger and includes more contextual information like
level (error), user id, org id, username, proxy path, referer and
IP address.
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
* fixed issues with timepicker closing when month is changed.
* removed console.logs.
* fixed so calendar isn't changing size when selecting several dates.
* Prevent calendar from closing when changing year.
* fixed according to PR feedback.
* Update timeseries.md
Update to docs-imagebox for the image link.
* Update docs/sources/guides/timeseries.md
Co-Authored-By: Marcus Olsson <olsson.e.marcus@gmail.com>
Co-authored-by: Marcus Olsson <accounts+github@marcus.se.net>
if the client closes the connection we should not
rotate token since the client will never receive the
new token.
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
* Start Angular migration
* Add SignupCtrl
* Change name signup
* Add backend call
* Put form in separate file
* Add form model
* Start using react-hook-forms
* Add FormModel to state
* Reduxify
* Connect nav with Redux
* Fix routing and navModel
* Fetch state options on mount
* Add default values and add button margin
* Add errror messages
* Fix title
* Remove files and cleanup
* Add Signup tests
* Add boot config assingnAutoOrg and verifyEmailEnabled
* Remove onmount call
* Remove ctrl and move everything to SignupForm
* Make routeParams optional for testing
* Remove name if it is empty
* Set username
* Make function component
* Fix subpath issues and add link button
* Move redux to SignupPage
* Add color theme and serve static files for storybook
* Add color theme and serve static files for storybook
* Export dark and light theme
* Add storybook-dark-mode package
* Add theme toggle functionality
* Toggle story theme too
* Remove unused import
* webpack config changes not needed
* initial wip
* Progress on new threshold design
* Testing radio button group for mode option
* Starting to come together
* Fixed percent mode
* Full width radio groups
* Minor tweaks, cursor to trash icon and hover state
* fixed unit tests
* Fixed storybook
* re-ordering fields
* Updated snapshot
* Make it consistent, add vs create
* first things
* rename
* add stats, remove table related changes
* header size and expand icon
* add case for nan request time
* fixing null checks
* reverting changes to table
* fix background on header
* Some small fixes after review
* do not use formInputBg
* test apply
* test apply
* Move standard field config editor registry to grafana-data
* merge master
* Apply field config defaults
* Make field and dataFrameIndex optional on on FieldOverrideContext
* Apply custom field config overrides
* Gauge - make sure thresholds are set
* Move series and field scoped vars calculation
* Enable template variables interpolation in title fields
* Expose standars field configs from grafana ui via function
* Add missing option to the config for the min value to be derived from field values
* Fix ts issue
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
* Suggesting few changes to the doc
1. Note should be followed by a dot (.)
2. Correcting a typo in default
3. Re-writing sub sentence to make reading better
* Update docs/sources/installation/configuration.md
Co-Authored-By: Arve Knudsen <arve.knudsen@gmail.com>
* Update configuration.md
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Idea is to provide information to the user that query can be executed on any data source that is available in grafana, therefore suggested little modification
* PanelEdit: Fixed timing and state related issues
* Added unit test and changed some logic
* Fixed id logic
* Updated snapshots
* Update public/app/features/dashboard/state/PanelModel.ts
Co-Authored-By: Dominik Prokop <dominik.prokop@grafana.com>
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
* Angular/React: Migrates FolderPicker from angular to react
* move to core
* snap
* minor changes
* more removes
* Managing creating new and saving in movetofolderctrl
* Do not use new forms.field, fix select menu
* FolderPicker responsible to creating new folder
* create new as prop
* snap
* remove unnecessary things
* remove console log
* snap
* fix null checks
* add search debouncing
* set folder to state, null check
* typing folder
* adding case for loadOptions
* snap
Co-authored-by: Peter Holmberg <peterholmberg@users.noreply.github.com>
* Implement Azure AD oauth
* Use go-jose and cleanup
* Update go-jose in go.mod
* cleanup
* Add unit tests
* Fix scopes
* Add documentation page
* Improve documentation
* Convert extract_role into function.
* Do not use upn and replace unique_name with preferred_username
* Configure login button
* Use official microsoft icon and color from branding guideline.
* Add Azure AD config section in sample.ini.
* Loki, Prometheus: Fix syntax to not highlight # in quotes as a comment in queryField
* Loki, Prometheus: Fix syntax to not highlight # in quotes as a comment in queryField
* Fix regex
* PromQL, LogQL: Update syntax
* LogQL, PromQL highlighting: Add tests
* Annotations: Makes various annotation and alert calls cancelable
Fixes#21943
* Refactor: Uses backendSrv.get method with requestId instead
* Update public/app/features/annotations/annotations_srv.ts
Co-Authored-By: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
* Forms/RadioButtonGroup: Improves semantics and simplifies CSS
- Changes base element to radio input for improved semantics & automatic keyboard support
- Simplifies CSS
* Docs: add LDAP active sync limitation for single bind
* Docs: update header for LDAP active sync limitation
Co-Authored-By: Leonard Gram <leo@xlson.com>
* Make $__range more precise in Prometheus
It is now always equivalent to `${__range_s}s`, rather than rounding
down to an integer multiple of the biggest possible unit. For example,
a range of 47 hours is now represented as `169200s` rather than `1d`.
Closes#21689.
* Update a unit test to match new __range calc
* Move data links suggestions to grafana-data
* Data links - field config and overrides
* Lint
* Fix test
* Add variable suggestions to field override context
* Revert "Move data links suggestions to grafana-data"
This reverts commit 5d8d01a65e.
* Move FieldConfigEditor to core
- Fix bug with NaN in alerting - Closes#21953
- Alert reducers (avg/max/etc) drop null values from their calculation. This change makes it so NaN values are handled in the same way as null values.
* Grafana-UI: Add caret to the picker
* Grafana-UI: Customise popup's font-size and border-color
* Grafana-UI: Replace highlight background with border color
* Grafana-UI: Use stylesFactory vs inline classes
* Grafana-UI: Import stylesFactory from themes vs index
* Assure base url when single stat, panel and data links are built
* Update public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderCorner.tsx
* Update public/app/features/panel/panellinks/link_srv.ts
* Update public/app/features/panel/panellinks/link_srv.ts
* Update public/app/features/panel/panellinks/link_srv.ts
* Update public/app/features/panel/panellinks/link_srv.ts
* Review updates
* Remove unnecessary code
* Add title editor
* Wip
* FIeld config overrides UI (v1)
* Basic property override editors
* name to prop
* use prop not path
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* WIP: Angular panel chrome, this is going to be tricky
* AngularPanelChrome: initial render works
* Options are showing up
* viz options working
* Fixed singlestat background
* AngularPanels: Fixed alert tab
* Removed anuglar loading spinner
* Dashboard: Refactor dashboard reducer & actions
* Dashboard: minor refactoring
* PanelChrome: loading state moved to header
* Subscribe to render events to solve title update issue
* Time info and query errors now works
* PanelHeader: unifying angular and react behavior
* added getPanelMenu test
* Scrollable now works again
* Various fixes
* Making stuff work
* seperate event emitter for angular
* Fixed issue sending updated dimensions to angular panel
* Minor tweaks
* Fixed tests
* Alerting: alert state now works
* Fixed unit tests
* Fixed a few null check errors
* Simplified events handling
* Fixed strict null checks
* initial POC
* fix import
* field config editor in the sidebar
* field config editor in the sidebar
* field config editor in the sidebar
* sidebar
* include threshold in sidebar
* include threshold in sidebar
* include threshold in sidebar
* init to empty threshold
* merge
* Make sure editor is fully rendered when page is refreshed
* use scrollbars
* add matcher UI folder
* remove
* Field options basic editors
* Removed deebugger
* Make number field editor controlled
* Update public/app/features/dashboard/state/PanelModel.ts
* Update public/app/plugins/panel/gauge/GaugePanel.tsx
* Ready for production
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
* Add an early exit
* Fix issue with blur and only display label
* Remove unused code
* Enabled custom value
* Update test
* Add custom value creating according to #21869
* Alphabetized tslint and tsconfig files
* Optimized tsconfig files
* Optimized editorconfig & prettier config files
… to reduce redundancy
* Switched to @grafana/tsconfig
… and:
* de-duped options
* removed options with default values
* Fixed nasty issue with types for nested slate-react
* Replaced TSLint with ESLint
* TSLint disables → ESLint disables
… also JSHint removals, which haven’t had an affect since it was replaced with TSLint.
* Compliances for ESLint, Prettier and TypeScript
* Updated lockfile
* First attempt
* Save confirmation with discard option, reusing queriess a little bit differently
* simplify cloning panels and restoring last results in panel query runner
* Remove save button
* Update public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx
* Exit/discard buttons
* Update snaps
* Review comments
* Fix lint
* Explore: updates grafana-data explore query field props with explore mode
* Explore: updates query row to pass down explore mode to query fields
* Explore: adds LokiExploreQueryEditor
* Explore: updates loki query field form to render children
* Explore: adds loki explore extra field component
* Explore: adds extra field element to loki query field form
* Explore: updates loki explore query editor to use extra field element
* Explore: moves ExploreMode to grafana-data
* Explore: updates query row limit string
* Explore: adds maxLines to DataQuery
* Explore: adds maxLines to loki datasource runRangeQueryWithFallback
* Explore: adds onChangeQueryLimit to LokiExploreQueryEditor
* Explore: updates loki explore query editor to render extra field only in logs mode
* Explore: fixes query limits for live and legacy queries
* Explore: fixes result processor max lines limit in get logs result
* Explore: fixes Loki datasource limit test
* Explore: removes unnecessary ExploreMode from Loki language provider
* Explore: fixes formatting
* Explore: updates grafana-data datasource types - replaces strings with explore mode enum
* Explore: updates loki explore query field props to take ReactNode
* Explore: updates the way we calculate loki query lines limit to fall back to 0 lines on negative or invalid input instead of datasource maxLines
* Explore: updates result processor get logs result method to avoid counting invalid/negative line limits
* Explore: updates loki result transformer to process only an appropriate slice of a result instead of an entire one
* Explore: adds a method for query limit preprocessing/mapping
* Explore: updates loki datasource run range query with fallback method to use options.maxDataPoints in dashboards
* Explore: removes unnecessary maxlineslimt from getLogsResult in resultProcessor
* Explore: moves line limit to metadata
* Explore: adds an ability to specify input type of extra field
* Explore: updates LokiExploreQueryEditor - adds an input type
* Explore: updates LokiExploreQueryEditor to run queries when maxLines is positive
* Explore: fixes failing import of ExploreMode
* Explore: fixes reducers test imports formatting
* Explore: updates Loki extra field with min value set to 0
* Explore: exports LokiExploreExtraFieldProps
* Explore: adds render test of LokiExploreQueryEditor
* Explore: adds LokiExploreQueryEditor snapshot
* Explore: updates LokiExploreQueryEditor onChangeQueryLimit method to prevent it from running when query input is empty - fixes cheatsheet display issue
* Explore: updates Loki editor snapshots
* Explore: fixes typo in test set name in LokiExploreQueryEditor
* Explore: adds a render test of LokiExploreExtraField
* Explore: fixes typo in LokiExploreQueryEditor
* Explore: updates LokiExploreQueryEditor snapshot due to timezone issues
* Explore: updates LokiExploreExtraField to export both functional component and a version using memo
* Explore: updates LokiExploreQueryEditor to export both functional component and memoized function
* Explore: updates LokiExploreQueryEditor - removes unnecessary react fragment
* Explore: updates LokiExploreQueryEditor snapshot
* Explore: adds LokiExploreQueryEditor tests for different explore mode cases
* Explore: fixes Loki datasource and result transformer
* Explore: updates LokiExploreQueryEditor snapshot
* Explore: updates LokiExploreQueryEditor tests and test setup
* Explore: updates LokiExploreQueryEditor - refactors component
* Explore: updates LokiExploreQueryEditor to use default import from LokiExploreExtraField
* Explore: updates LokiExploreQueryEditor snapshot
* Explore: fixes formatting
* Explore: updates LokiExploreQueryEditor max lines change
* Explore: updates LokiExploreQueryEditor tests checking ExtraFieldElement
* Explore: adds mock loki datasource to LokiExploreQueryEditor
* Explore: updates LokiExploreQueryEditor test mock - adds language provider
* Explore: updates LokiExploreQueryEditor snapshot
* Explore: updates Loki ResultTransformer to filter out rows on limit - logic to be moved into a component with new form styles
* Explore: updates LokiExploreQueryEditor tests
It was missing for ldap_login which means that the first signup failed
for users with LDAP+quota enabled. There's also potential cases where we
can't provide a request context (background jobs) which is also covered,
but needs a refactoring.
Drop indices and create new ones and rewrites annotation find query
to address performance issues when querying annotation table and
there is a large amount of rows.
Fixes#21902
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Kyle Brandt <kyle@kbrandt.com>
* CircleCI: Move postgres/mysql integration tests to step after linting
* CircleCI: Implement publishing of packages and Docker images for new master pipeline
* DatasourceEditor: Add UI to edit custom HTTP headers
Support for custom headers was added in #11643 but was missing in the UI.
Fixes#12779
* Review
* Layout updates
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
One has to use "grafana/grafana" image - only using "grafana" will
result in an error message like this:
Error response from daemon: pull access denied for grafana, repository does not exist or may require 'docker login'
It's a good idea to daemonize new container. The install instructions
for Docker do this, and this instructions assume that running container
already is daemonized (otherwise you wouldn't have to stop it).
Best practise would be to create a new container, then stop old one and
start new one - this would reduce downtime. To keep instructions simple
and understandable, I didn't include that.
* Add new global built-in variables #20523
new branch from master
* #20523 Revert change on __from and __to like requested
* #20523 simplify contextSrv access
* #20523 simplify contextSrv access
* #20523 repair jest tests
This is to make the custom dockerfiles compatible with our instruction
to use persitent volumes for the /var/lib/grafana dir. Without this
change the contents of that folder will be overshadowed by the persitent
volume and none of the pre-installed plugins will be available.
* Applied prettier to relevant webpack configs
* Replaced ng-annotate with babel-plugin-angularjs-annotate
… and replaced ts-loader with @preset/typescript
* Removed redundant import
… that is problematic with Babel's module resolver
* Updated lockfile
* Traspile debug package to es5 for PhantomJS support
* Update babel to latest version
* Remove @babel/poolyfill and url search params polyfill
* Add ts-loader to grafana-ui dependencies
* Update prod webpack build to use cor-js 3
* Applied prettier to relevant webpack configs
* Replaced ng-annotate with babel-plugin-angularjs-annotate
… and replaced ts-loader with @preset/typescript
* Updated lockfile
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
* Docs: Add information about license expiration
* Docs: Improve clarity of license expiration page
* review comments
* change renewal instructions to a list
* language improvements
* review fixes
* add error tab
* conditional tabs
* feedback from review
* expose lastResult via function
* remove todo and weird char
* fixing overflow states and height of tabcontent
* style fixes
* more changes to scroll handling
* fixing null checks
* Change drawer content padding
* Add scroll in the story
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
* Fixed issue where gauge throw error on empty result.
* Some refactorings to improve the code.
* Added some tests to make sure this doesn't happen again.
This is a small documentation update for the situation that led to
#19842 in the first place. It describes a procedure required to
provide root certificates to the headless Chrome instance used
by the Grafana image renderer plugin.
* Replace bash/json with http in http_api codeblocks
Since http is used elsewhere on the API docs and makes the
markdown rendering look different on the blocks that use bash/json
* Fix the annotations API link on 'Features'
- Noticed the Features/Dashboard Features/Annotations link pointing to
the HTTP API was linking itself instead of '../http_api/annotations.md'.
- Also add a link on Dashboard Export and Import to its HTTP API.
* Add missing links to features in API Index
Noticed there was 3 missing references in the API docs index.
- https://grafana.com/docs/grafana/latest/http_api/playlist
- https://grafana.com/docs/grafana/latest/http_api/datasource_permissions
- https://grafana.com/docs/grafana/latest/http_api/external_group_sync
Last two are Grafana Enterprise -only, so created a separate subsection
for them.
* Add info about meta data labels
* Add part about auto period calculations in cloudwatch
* Minor adjustments
* Updates after feedback
* Add more context
* Clarify what a metadata label is
* BackendSrv: Adds status, headers, statusText, redirect, type and url back to response
Fixes#21662
* BackendSrv: Adds request object back to datasourceRequest response
Fixes#21662
* Docs: gitlab team-sync documented correctly
* docs: initial docs for whitelabeling
* Docs: enterprise repositories
* Docs: rpm enterprise install
* Docs: re-structured the rpm install page to be more similar to the deb page
* Docs: responded to review feedback
* Docs: recommends the enterprise edition
* Update docs/sources/installation/debian.md
Add support for passing tags to Pagerduty and allow notification
on specific event categories such as Class, Group and Component.
Ref #19912, #19913
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
In 043bb59 a URLSearchParams usage was introduced which is not supported by PhantomJS. @babel/polyfill(deprecated) does not contain polyfill for URLSearchParams, hence the code (and Prometheus graphs rendering) was failing in PhantomJS environment.
The solution is to add https://www.npmjs.com/package/url-search-params-polyfill that takes care of the URLSearchParams
* Create basic react page for AdminUserCreate
* Forms.Field - render asterisk when field is marked as required
* Add validation to user create form wih react-hook-form
* Remove Angular code for UserCreatePage
* Remove commented route for admin settings
* Remove unused import
* Hide react-hooks-form behind Form component
* Fix webkit autofill
* Webkit autofill on inpiuts - bring back focus shadow
* Temporarily fix story (before 21635 is merged)
* Form: docs and minor updates to new form elements (#21635)
* Allow Switch, checkbox to be uncontrolled, forward refs, styles update
* Add Form docs
* User create page update
* Remove unused import
* Apply review notes
* Docs: Whats new updates
* Add cloudwatch and stackdriver paragraphs
* Minor changes
* Add link helper to render gif
* Docs: what's new updates
Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
* Changelod: v6.6.0-beta1
* Changelog: grafana/ui v6.6.0-beta.1.0
* Changelog: moved toolkit to its own file
* Changelog: fix version
* Remove closed PR
Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
* Chore: Remove angular dependency from backendSrv
* Refactor: Naive soultion for logging out unauthorized users
* Refactor: Restructures to different streams
* Refactor: Restructures datasourceRequest
* Refactor: Flipped back if statement
* Refactor: Extracted getFromFetchStream
* Refactor: Extracts toFailureStream operation
* Refactor: Fixes issue when options.params contains arrays
* Refactor: Fixes broken test (but we need a lot more)
* Refactor: Adds explaining comments
* Refactor: Adds latest RxJs version so cancellations work
* Refactor: Cleans up the takeUntil code
* Refactor: Adds tests for request function
* Refactor: Separates into smaller functions
* Refactor: Adds last error tests
* Started to changed so we require getBackendSrv from the @grafana-runtime when applicable.
* Using the getBackendSrv from @grafana/runtime.
* Changed so we use the getBackendSrv from the @grafana-runtime when possible.
* Fixed so Server Admin -> Orgs works again.
* Removed unused dependency.
* Fixed digest issues on the Server Admin -> Users page.
* Fix: Fixes digest problems in Playlists
* Fix: Fixes digest issues in VersionHistory
* Tests: Fixes broken tests
* Fix: Fixes digest issues in Alerting => Notification channels
* Fixed digest issues on the Intive page.
* Fixed so we run digest after password reset email sent.
* Fixed digest issue when trying to sign up account.
* Fixed so the Server Admin -> Edit Org works with backendSrv
* Fixed so Server Admin -> Users works with backend srv.
* Fixed digest issues in Server Admin -> Orgs
* Fix: Fixes digest issues in DashList plugin
* Fixed digest issues on Server Admin -> users.
* Fix: Fixes digest issues with Snapshots
* Fixed digest issue when deleting a user.
* Fix: Fixes digest issues with dashLink
* Chore: Changes RxJs version to 6.5.4 which includes the same cancellation fix
* Fix: Fixes digest issue when toggling folder in manage dashboards
* Fix: Fixes bug in executeInOrder
* Fix: Fixes digest issue with CreateFolderCtrl and FolderDashboardsCtrl
* Fix: Fixes tslint error in test
* Refactor: Changes default behaviour for emitted messages as before migration
* Fix: Fixes various digest issues when saving, starring or deleting dashboards
* Fix: Fixes digest issues with FolderPickerCtrl
* Fixed digest issue.
* Fixed digest issues.
* Fixed issues with angular digest.
* Removed the this.digest pattern.
Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
Co-authored-by: Marcus Andersson <systemvetaren@gmail.com>
* CI: ee msi build
* shellcheck
* Fake it so that we get a ee msi build on pull request runs
* fix error in prep job
* save msi for testing
* get enterprise zip
* Fixes to version and hash detection.
* Removes ci test code
As part of the new improvements to JMESPath in #17149 a
commit ensuring Role and Email data could be queried from
id_token was lost.
This refactors and fixes extracting from both token and user
info api consistently where before only either token or
either user info api was used for extracting data/attributes.
Fixes#20243
Co-authored-by: Timo Wendt <timo@tjwendt.de>
Co-authored-by: twendt <timo@tjwendt.de>
Co-authored-by: henninge <henning@eggers.name>
Co-Authored-by: Henning Eggers <henning.eggers@inovex.de>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
6.2-beta1 changed so that data sources, dashboards and alert notifiers
are provisioned on service Init where's before only data sources and
alert notifiers was provisioned on service Init and dashboards was first
provisioned in service Run which happens after Grafana server have
started.
This change reverts so that dashboard provisioning are first happening
in service Run, after Grafana server have started.
Fixes#21133
* Calculate min period based on time range and no of queries
* Use hardcoded array of periods if period is not defined actively by the user
* Fix broken tests
* Use a smaller max period for auto interval
* Fix broken tests
* Test period calculation
* Test min retention period
* Fix broken test
* Applied prettier to some webpack configs
* Removed ng-annotate
… and used same annotation approach as webpack.hot.js
* Removed redundant import
… that is problematic with Babel's module resolver
* Updated lockfile
* Replace ts-loader with babel-loader in webpack.dev
* Change tslint-loade order in dev webpack config
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
* Rewrite angular segments for filter and group by in react
* wip: refactoring
* Update metric find queries
* Remove old maps used to create labels - use one map for all types instead
* Use value as label (again) for filters ang groupby
* Remove old filter
* Remove not used code
* Fixes after pr feedback
* Fix broken tests and add new metadata tests
* Add index file to make imports cleaner
* Cleanup. Remove old angular filter code
* Fix broken tests
* Use type switching instead of if statements
* Use globals for regex
* Updates after pr feedback
* Make sure it's possible to filter using the same key multiple times
* Replace metric select with segment component
* Pass template vars as props
* Refactor meta labels code
* Reorder template variables
* Fix broken tests
* Reset metric value when changing service
* Fix lint issue.
* Make tests independant of element order
* Include kubernetes.io in regex
* Add instruction in help section
* svc alerting - use a shorter ctx to upload the img
This will prevent timeout on img upload to cancel the notifications from being sent
* components img uploader - pass the ctx to aws lib
* make webdavuploader use the ctx
* make azureblobuploader use the ctx
* rename uploadImage() to renderAndUploadImage()
for better clarity about what this method work
* Use timeout + 2s for plugin renderer (same as service and phantomjs)
* Make sure that original EvalContext is updated after render and upload
* Verify notification sent even if render or image upload times out
* fix lint
* fixes after review
Co-authored-by: Edouard Hur <3418467+hekmon@users.noreply.github.com>
Fixes#21018
* Rename old cascader
* Change name of old cascader
* Add basic cascader without search
* Add basic cascader without search
* Flatten options to make it searchable
* Add regex search and make backspace work
* Add barebone search without styles
* Add SearchResult list
* Add search navigation
* Rewrite of cascader and add some things to SelectBase
* Make SelectBase controlllable
* Cleanup
* Add initial value functionality
* Add onblur to hand caret direction
* New storyboom format for ButtonCascader
* Add knobs to story
* Add story and docs for UnitPicker
* Make UnitPicker use Cascader
* Fix backspace issue and empty value
* Fix backspace issue for real
* Remove unused code
* Fix focus issue
* Change children to items and remove ButtonCascaderProps
* Remove local CascaderOption
* Fix failed test
* Revert UnitPicker changes and change format for ButtonCascader
* Fix failing tests
* Update mac.md
Reviewed and edited macOS install instructions.
* Updated mac.md and configuration.md
Removed developer build instructions from mac.md and moved configuration information from mac.md to configuration.md.
* Update mac.md
Updated to reflect the new fields on the Downloads page
* Update mac.md
* Update mac.md
* wrap content in autosizer
* replace lib
* removing react-virtualized, correct type in editor.ts
* remove caret
* remove dep from grafana/ui and remove story util
* Clarify readme for extended webpack config
* Add support for ES2019 features
* Build task: path.resolve → resolvePath
* Build task: avoid fs race conditions
* Build task: use async fs functions
* Build task: use rimraf directly
... because depending on the workspace parent to have it installed is fragile, and a child process is always slower.
* Build task: misc
* wip: react rewrite
* Cleanup
* Break out non annontations specific fields
* Cleanup. Make annontations editor a functional component
* Remove redundant classnames
* Add paneldata to props
* Cleanup
* Fix rebase merge problem
* Updates after pr feedback
* Fix conflict with master
Adds support for collecting metrics from backend plugins and
exposing them thru Grafana's Prometheus metrics endpoint.
Enables to check health of backend plugin by using the route
`/api/plugins/<plugin id>/health`.
Uses sdk v0.6.0.
Closes#20984
By rotating the auth tokens at the end of the request we ensure
that there is minimum delay between a new token being generated
and the client receiving it.
Adds auth token slow load test which uses random latency for all
tsdb queries..
Cleans up datasource proxy response handling.
DefaultHandler in middleware tests should write a response, the
responseWriter BeforeFuncs wont get executed unless a response
is written.
Fixes#18644
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
#21350 introduced a bug regarding import of plugin dashboards.
This should fix this and add custom validation if not importing
plugin dashboard and dashboard property is missing.
Ref #21350
Co-Authored-By: Arve Knudsen <arve.knudsen@gmail.com>
Breaking change: If disabled the cookie samesite cookie attribute
will not be set, but if none the attribute will be set and is a
breaking change compared to before where none did not render the
attribute. This was due to a known issue in Safari.
Co-Authored-By: Arve Knudsen <arve.knudsen@gmail.com>
Co-Authored-By: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
Fixes#19847
* Fixed so when clicking a plot on a touch device we won't display the annotation context menue.
* Refactorings after feedback.
* changed to standard-ish comment.
* add common backend
* use const for range
* likely not differnt
* send the right orgId
* Add DataSourceWithBackend to @grafana/runtime mock in root reducer test
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
* add min_interval_seconds setting to alerting config
It will let operator enforce a minimum time for the scheduler to enqueue evaluations
* Introduce UI modifications
* Update docs
Co-authored-by: Martin <uepoch@users.noreply.github.com>
* Update rpm.md
* Update rpm.md
* Moved content to troubleshooting
Updated rpm.md and moved content from rpm.md to troubleshooting.md
* Update rpm.md
* Update rpm.md
* Update rpm.md
* Update rpm.md
* Update rpm.md
* Update rpm.md
* Update rpm.md
* Update docs/sources/installation/rpm.md
Co-Authored-By: Dan Cech <dcech@grafana.com>
* Update docs/sources/installation/rpm.md
Co-Authored-By: Dan Cech <dcech@grafana.com>
Co-authored-by: Dan Cech <dan@aussiedan.com>
OpsGenie's model works heavily off of the priority of an alert,
e.g. routing and escalation. Currently this plugin only supports
the default "P3".
Setting a tag og_priority to the correct P-value, e.g. P1, P2, P3,
P4 or P5, will call the OpsGenie API with the correct priority value
set.
Add fallbackText to Google Chat notifications.
Definition of fallbackText: A plain-text description of the message's
cards, used when the actual cards cannot be displayed,
e.g. mobile notifications.
Fixes#21463
* refactoring BigValue layout to use polymorphism
* Renamed file
* StatPanel: Fixed min & max handling, white theme background
* Typescript and test fixes
* Fixed justify center logic
* Updated test dashboard
* Updated test dashboard
* Adjust time xMax to align with last data point if it's close
* Fixed color issue
* removed text shadow
* Removed unused stuff
* Fixed auto min max
* Fixed strict typescript issues
* Updated
* Refactoring to get the correct spacing between the first icon and button border.
* Should not be smaller then 8px to the left.
* Removed unused dependency.
* Updated snapshot for LinkButton.
* remove anon funcs, removed options from state, removed update method, static selects as constants
* cancellable promise
* cancel promise on unmount
* use new datasource funcs for dryer component
* event handler funcs
* updated funcs and moved to utils, updating config editors
* S has no keys. never will never work
* remove report json
* update azure snapshot
* DataSourceSettings keyof
* rename reset funcs
* Update plugin docs
* Updated plugins installation documentation
Moved all Grafana CLI commands into cli.md, moved API script into user.md, rewrote installation.md as an actual task that refers the user to the plugins installation page
* Update cli.md
* Update cli.md
* Update docs/sources/administration/cli.md
Co-Authored-By: Dan Cech <dcech@grafana.com>
* Update docs/sources/administration/cli.md
Co-Authored-By: Dan Cech <dcech@grafana.com>
* Update docs/sources/http_api/user.md
Co-Authored-By: Dan Cech <dcech@grafana.com>
* Update docs/sources/http_api/user.md
Co-Authored-By: Dan Cech <dcech@grafana.com>
* Update cli.md
* Fixed links
* Update cli.md
* Update cli.md
* Update cli.md
* Update cli.md
Co-authored-by: Dan Cech <dan@aussiedan.com>
* Docs: Update debian.md
Simplified the APT install instructions by bundling the commands into one block, added steps in the .deb instructions to refer to new fields on the installation page.
* Update debian.md
* Update debian.md
* Update debian.md
* Update debian.md
* Update debian.md
* Update debian.md
When an alert is sent by e-mail, the process sends an e-mail to
each recipient separately. This PR is a single delivery to all recipients.
For companies that use e-mail extensively, this is necessary in order
not to overload the sending queue.
Replaces #18013Fixes#12650
Co-authored-by: Henrique Oliveira <holiiveira@users.noreply.github.com>
* Settings: supports env overrrides for dynamic settings
* Settings: makes it possible to explicitly get env override support for dynamic settings
* Make linter happy
* Refactor redirect_to cookie with secure flag in middleware
* Refactor redirect_to cookie with secure flag in api/login
* Refactor redirect_to cookie with secure flag in api/login_oauth
* Removed the deletion of 'Set-Cookie' header to prevent logout
* Removed the deletion of 'Set-Cookie' at top of api/login.go
* Add HttpOnly flag on redirect_to cookies where missing
* Refactor duplicated code
* Add tests
* Refactor cookie options
* Replace local function for deleting cookie
* Delete redundant calls
Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
Besides minor language corrections, this tries in particular to
provide some clarity about the `step` setting in the Prometheus range
query and the `$__interval` variable:
- First of all: They are both always the same.
- What's really confusing (and arguably really un-helpful) is that the
_Min time interval_ is multiplied by the resolution
factor. Therefore, I just state the fact here now but don't add
anything like "This should be the scrape interval" because it is not
true (if resolution is `1/10`, a meaningful _Min time interval_ is
generally a tenth of the scrape interval).
- More helpful is the _Min step_ parameter, because it is not
multiplied by the resolution factor (which I have now stated
explicitly). Of course, the _Min time interval_ has to be set to
something small so that the _Min step_ parameter can kick in.
It would be good if we could also override the _Min time interval_
tool tip because that is where most people will look, and the current,
very Graphite-centric tool tip is very confusing for the Prometheus
query editor, in particular because it doesn't have any hint about the
resolution factor being applied. See #21413.
Signed-off-by: beorn7 <beorn@grafana.com>
* create tabs component
* replace tabs in pageheader
* splitting two different types of tabitems
* fix index and conditionals in tabs
* redo tabs to not render anchor links
* rename to className and use cx to combine classes
* reverting back to a simpler use case
* moving type to types file
* fix import
* redoing Tabs to simpler composition components
* pr feedback
* update snapshot
* use icon component, added knob for storybook
* Added text align option to column styles, tests
* table panel migrations
* added tests
* default column style is now auto
* tests and fixtures...
* wrong comments need removing
* xss guard
* test
* Some test for invalid options, formatting.
* Remote branch tracking.
* Footer: Single footer implementation for both react & angular pages
* Export type
* Updates
* Use footer links in help menu
* Updates & Fixes
* Updated snapshot
* updated snapshot
* added alert state validation before changing its state
* modified boolean condition
* converted most occurring string into const
* referred the const of alert models
* Prometheus: user metrics metadata to inform query hints
- no longer analyse datapoints
- either use metrics metadata to determine metrics type or use metric
name suffix
- removed testcases based on datapoints
* Added hint certainty and tests
* Prometheus: Disable suggestions at beginning of value
- fixed comparison operator regex
- no longer suggest anything at beginning of label value
* Detect cursor in front of label values
I standardized the readme for `sudo` and removed the `$`.
Now you can copy paste the commands and just "install" via the rpm
based distros.
Signed-off-by: JJ Asghar <jjasghar@gmail.com>
Signed-off-by: JJ Asghar <awesome@ibm.com>
* imguploader: add support for non-Amazon S3 endpoints and forcing of path-style S3 addressing
fixes#11240
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
* Loki: fix filter expression suggestions
- dont suggest term completion items in filter expression
- allow at least one character before suggesting term items
- keep logql expression when switching between Metrics/Logs mode
- show only history by default in completion items
* Clear results when changing mode
- `unless`, `or` and `and` are binary operators
- if they appear in a query the query was broken up so the suggestor
only works on the current term
- this change fixes the splitter logic to make sure those keywords are
not inside a word
* Edited Windows install instructions
Moved one section from Windows install guide to developer-guide.md. Edited some content in windows.md and will add questions.
* Updated per comments
* Fixed broken links in basic_concepts.md
* Revert "Fixed broken links in basic_concepts.md"
This reverts commit e524ea9e7b.
* Update windows.md
* Prometheus data source: Update tooltip for _Scrape interval_
The old tool tip was plainly wrong. The globally configured scrape
interval is not necessarily the most used scrape interval, so the new
wording is describing what actually matters. The evaluation interval
wasn't even mentioned before. And finally, the configured value is
not strictly a lower limit for the step query parameter as it can be
overridden by the panel option _Min time interval_.
I plan to explain the overriding intricacies in the tool tip for _Min
time interval_.
Signed-off-by: beorn7 <beorn@grafana.com>
* Improve tooltip for _Min step_
The previous tool tip was mostly addressing aspects that are not
specific to _Min step_ (and might be more appropriate to be added to
the _Min time interval_ tool tip as that setting has a wider
scope). The new version emphasizes the important gotchas: that this is
an _additional_ lower limit, and that it is _not_ multiplied by the
resolution factor.
Signed-off-by: beorn7 <beorn@grafana.com>
* Fixed snapshot
Co-authored-by: David <david.kaltschmidt@gmail.com>
Closes#19598
Fixes bug introduced recently where the new PromQueryEditor did not preserve
the PromContext.Explore set on the query model by PromQueryField which caused
the table to be empty for Prometheus in explore.
* Pagerduty notifier: configurable severity
Instead of hardcoding `critical` make it configurable per notification channel instance.
* fix html
* Add a test to ensure default severity is correct
* Notifications doc
* Add a non-default test
* Add err check on NewJson (all tests)
* Add default severity (critical) to AlertNotificationEditCtrl class
- prometheus explore editor introduced new styles for the hint display
- when multiple rows are rendered the hints are covered because they are
forced to have 0 height
- this change removes the 0-height
* Editor: Ignore closing brace when it was added by editor
- brace completion gets annoying if the user still types closing brace
- this change marks automatically added closing braces and when the user
types a closing brace at that position, it will be overridden instead of
added
* Fix label suggestions
* Correct brace behavior, but broken completion
* Rewrite auto-match detection with annotations
Much easier to wrap one's head around it if it is expressed more
directly.
This is not mathematically the same as the previous version involved
more rounding than necessary because of the way the intervalFactor was
handled. I'd argue the new version is better because it gets closer to
the 11,000 points limit and thus approaches better what the user
wanted within the limits of Prometheus.
Note that in practice, the 11,000 points limit should never be of
relevance. (Even a 4k screen doesn't have 11k points on the x axis.)
Signed-off-by: beorn7 <beorn@grafana.com>
* Table: Set & use field display processor
* Use applyFieldOverrides outside in story instead
* Change types a bit
* Table: Move to flexible layout
* Simplest possible custom field option
* Skip default column
* Added textAlign
* Explore: Set display processor for table data frame
* Fixed storybook
* Refactoring
* Progress on cell display mode
* Major progress
* Progress & refactoring
* Fixes
* Updated tests
* Added more tests
* Table: Progress on cell style customization
* Restored testdata random walk table scenario
* put back unrelated change
* remove unused things
* Updated table story
* Renamed property
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* Dashboard: started to implement new time picker.
* TimePicker: working in full screen (except calendar).
* TimePicker: first draft on narrow screen variant.
* TimePicker: small adjustments to the narrow design.
* TimePicker: enabled range selection and started to style calendar.
* TimePicker: applied some more styling.
* Calendar: added so the calendar range selection is styled properly.
* Calendar: added styling for timepicker calendar in narrow screen.
* TimePicker: made it possible to select range from calendar.
* TimePicker: made the calendar have previous selected value.
* TimePicker: moved calendar to be able to update form state.
* TimePicker: calendar is now displayed onFocus or onClick.
* TimePicker: calendar will be closed if click outside input.
* Calendar: fixed the styling of the calendar in narrow screen.
* Calendar: made it work properly with narrow screen.
* TimePicker: connected recent to absolute time range.
* TimePicker: changed the label on recent ranges.
* TimePicker: cleaned up the range list and options.
* TimePicker: some more cleaning up.
* TimePicker: cleaned up the calendar a bit.
* TimePicker: some more refactorings.
* TimePicker: refactorings.
* TimePicker: styled modal properly.
* TimePicker: empty recent list.
* TimePicker: width when calendar in full screen.
* TimePicker: will validate input value.
* TimePicker: removed unused code.
* TimePicker: positioning with emotion instead of sass.
* Calendar: Made sure we send the dates in the correct order to the calendar.
* TimePicker: fixed theme.
* TimePicker: fixed positioning of the content.
* TimePicker: positioning of narrow.
* TimePicker: added some simple tets.
* TimePicker: fixed issue with invalid and added error message.
* TimePicker: added history.
* TimePicker: cleaned up snapshot data.
* TimePicker: fixed so we keep the quick values in the input.
* TimePicker: fixed the missing styling on UTC.
* TimePicker: added missing caret icon.
* TimePicker: fixed formatting on recent time ranges.
* TimePicker: added missing -.
* TimePicker: refactorings after feedback.
* TimePicker: renamed reserved prop name.
* TimePicker: added missing onChange call.
* TimePicker: removed alternative return type.
* TimePicker: fixed the sorting order on the recent list.
* TimePicker: added useCallback for the onEvent functions.
* TimePicker: moving away from default export.
* TimePicker: used the isMathString instead of private function.
* TimePicker: minor refactoring simplify the code.
* TimePicker: Added empty container that will expand when less then 4 recent searches.
* TimePicker: changed the top to be absolute relative to the container.
* TimePicker: updated snapshots for failing tests.
* Fixed shadow
* Move it down a bit
* added some more tests.
* Fixed so we change the anchor point of the time picker in really small screens.
* removed memo.
* fixed snapshot.
* Make sure that we always use the correct timeZone when formatting output.
* Fixed form background.
* Some minor fixes after demo.
* Making sure that empty info box is centered.
* updated snapshots for timepicker after css changes.
* fixed so we don't overflow when input validation error.
* adjusted final things on the time picker.
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
* Tooltip: preventing xss injections via the colors variable.
* added xss check for single series tooltop color.
* added sanitize to the hoverInfo.value.
* first working example
* Support sorting, adding types while waiting for official ones
* using react-window for windowing
* styles via emotion
* sizing
* set an offset for the table
* change table export
* fixing table cell widths
* Explore: Use new table component in explore (#21031)
* Explore: Use new table component in explore
* enable oncellclick
* only let filterable columns be clickable, refactor renderrow
* remove explore table
* Keep using old merge tables logic
* prettier
* remove unused typings file
* fixing tests
* Fixed explore table issue
* NewTable: Updated styles
* Fixed unit test
* Updated TableModel
* Minor update to explore table height
* typing
* Refactor: Adds params to visit
* Refactor: Restructures exported Pages somewhat
* Refactor: Moves more into new framework but holdup because of bugs in digest
* Refactor: Finish migrating templating e2e tests to new framework
* Refactor: Changes after merge with master
* Refactor: Removes weird change
* Refactor: Adds duplication test
* Refactor: Adds move down and move up variable asserts
* Refactor: Adds some test to value select dropdown
* Prometheus: Display HELP and TYPE of metrics if available
- Prometheus recently added a metadata API around HELP and TYPE of
metrics
- request metadata when datasource instance is created
- use metadata to show help and type in typeahead suggestions and in
metrics selector as tooltip
* Fix types
* Refactor: Adds ScenarioContext
* Refactor: Removes async
* Refactor: Adds video and reverts CIRCLE_SHA2 to CIRCLE_SHA1
* Refactor: Adds videos to release job as well
* use default from datasource if not saved on dash/query
* find datasource default workspace in returned workspace list
* don't need the find
* fix dropdown
* UI: ConfirmButton component
* UI: add link button variant
* UI: add ConfirmButton story with delete option
* Chore: use ConfirmButton instead of DeleteButton
* UI: remove DeleteButton
* UI: rename confirmButtonVariant to confirmVariant
* UI: use Form.Button in ConfirmButton
* Chore: use sm ConfirmButton size after changing defaults
* Revert "UI: add link button variant"
This reverts commit 4372350daa.
* Chore: add 'link' variant type to the Button
* UI: DeleteButton component on top of ConfirmButton
* Chore: use DeleteButton instead of ConfirmButton
* Chore: DeleteButton, use md size by default
* Chore: update test snapshots
* Update configuration.md
Updated logs section and clarified some of the file location and commenting information.
* Update docs/sources/installation/configuration.md
Co-Authored-By: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Removes send_client_credentials_via_post oauth setting and
use auto-detect mechanism instead.
By these changes also fixes statichcheck errors
Ref #8968
* feat: adding lookup limit to OpenTSDB settings
Adding lookup to OpenTSDB datasource settings and using it in the datasource for tag value lookup and suggest
* Document the change.
* feat: UI for configuring OpenTSDB lookup limit.
* Apply prettier.
* Fix compilation error.
* Logs: Optional logs label column
- reintroduces label column that was removed when log details were
introduced
- added to explore and also as a new option to logs panel
- explore column settings now stored in localstorage
- labels are rendered with font size xs
- labels that start with `_` or are called `level` or `filename` are not
displayed
- removed click handlers and moved remaining `LogLabel` logic into `LogLabels`
* Added prop to satisfy interface
* Review feedback
* removed comment
* Changed label of label column switch
Moving info log from phantomjs to rendering service
so it's logged for all kinds of renderers.
Add debug log for image renderer plugin and remote
renderer.
* Add support for primitive values/onchange
* Fix segment clickaway bug
* Fix onchange
* Use primitive in cloudwatch
* Add placeholder
* Use placeholder in cloudwatch editor
* Fix lint error
* Fix lodash import
* Use new component story format
* Add support for autofocus
* Use selectable value for onchange event
* Fix lint error
* UI: ConfirmModal component based on Modal
* UI: refactor ConfirmModal after Modal changes
* UI: use Icon component for Modal
* UI: ConfirmModal tests
* UI: ConfirmModal story
* Prometheus: disable dynamic label lookup on big datasources
- when a prometheus datasource has more than 10000 metrics, label lookup
for the query field is disabled
- installations of that size have slow typehead lookup times and make
the editor sluggish
* Raise dynamic lookup threshold to 10000 metrics
* Run start tasks again
- since the API update, the URL fallback was working, but the response
format also needed adapting: `data` (v1) vs `values` (pre-v1)
- this change looks for either data or values in the response for test
and metadata requests
* Update debian-ubuntu installation
Major rework of debian.md, minor updates to a configuration.md and upgrading.md.
* updated docs
Updated per Torkel's comments
* Update debian.md
Added wget to common properties install command
* Update docs/sources/installation/debian.md
Co-Authored-By: Dan Cech <dcech@grafana.com>
* Update docs/sources/installation/debian.md
Co-Authored-By: Dan Cech <dcech@grafana.com>
* Update docs/sources/installation/debian.md
Co-Authored-By: Dan Cech <dcech@grafana.com>
* Update docs/sources/installation/debian.md
Co-Authored-By: Dan Cech <dcech@grafana.com>
* Update docs/sources/installation/debian.md
Co-Authored-By: Dan Cech <dcech@grafana.com>
* Update docs/sources/installation/debian.md
Co-Authored-By: Dan Cech <dcech@grafana.com>
* Update docs/sources/installation/debian.md
Co-Authored-By: Dan Cech <dcech@grafana.com>
* Apply suggestions from code review
Co-Authored-By: Dan Cech <dcech@grafana.com>
* Update upgrading.md
* Update upgrading.md
* Update debian.md
Added ARM link
Updates the docs to work with the website repo - mainly
relative link updates.
Adds a menu.yaml file to build the sidebar menu (no longer
using front matter weight).
* Chore/Tech debt: Remove (most) instances of $q angular service use
Removes instances where the angular $q service is used and replaces
it with native Promises.
* FieldDisplay: added support for value mapping of no data state.
Committer: Marcus Andersson <marcus.andersson@grafana.com>
* FieldDisplay: fixed issue when switching between modes and display numeric was null.
* ValueMapping: introduced a private function for checking null values.
* FieldDisplay: refactoring of test setup to reduce duplication.
* Docs: added info about new 'no data' value to text mapping.
* Docs: improved according to feedback. Reverted prettier formatting changes.
* FieldDisplay: removed unused import.
* Datasource/Loki: Fixes issue where time range wasn't being supplied with annotation query
Closes#20667
* Add test to verify new behavior
* Added end/start check to test
* update fixed
* update fixed
* update fixed
* don't change any tests
* add mising space
* Custom unit formats
* return a string for kbn
* return a string for kbn
* return a string for kbn
* Simplify unit tests
* More units
* fix more tests
* fix more tests
* fix more tests
* format values
* format values
* TimeSeries to string
* more kbn tests
* use the formatted value
* BarGauge: Fixed font size calculations
* support prefix
* add si support
* avoid npe
* BarGauge/BigValue: value formatting
* fix some tests
* fix tests
* remove displayDateFormat
* another unicode char
* Graph: Use react unit picker
* Updated unit picker
* Fixed build errors
* more formatting
* graph2 tooltip formatting
* optional chaining
* TablePanel: Don't include hidden columns in CSV export
Fixes#12076
* GraphPanel: Don't include hidden series in CSV export
Series are hidden if all values are zero/empty and the relevant graph
option is enabled as well. (e.g. "Hide series: With only nulls")
Fixes#12076
* adding configeditor
* fix method signature and add state for metrictankhelper
* fix onChangeHandler
* prettier fix
* remove config and fix autoversion
* adding optional parameter to make this build
* set default version if none specified
* Graphite: removed version detection
* Adding component, story and documentation file
* forgot files
* Add label and formvalidation
* fix for error/invalid message
* fixing font color when input is disabled
* red border if invalid
* fixing props and label margin
* added support for icon in input
* support for button and loading state
* redoing some of the markup
* fixing height on addons
* Adding some basic documentation
* remove not used types file
* Add some more knobs
* move component to it's own directory, updated styling
* create component and extract some shared styles
* update story name
* Adding focusstyle and knobs
* Sorting knobs, fix paddings
* accidentaly put in a line break
* use variable names in commonStyles
* add simple mdx docs
* Adding size to TextArea
* more shared styles
* remove unused import
* Units: Add unit for currency - South Korean Won
* Units: Add support for 'femto' and 'pico' decimal SI prefix
* Units: Expand library of energy units
Add:
Power - Giga-watt (useful for viewing metrics of power flow through large-scale electrical infrastructure)
Electrical Resistance - Kilo-ohm, Mega-ohm (useful for viewing metrics of energy storage e.g. internal resistance of a battery and more)
Electrical Capacitance - Farad, Micro-farad, Nano-farad, Pico-farad, Femto-farad
Electrical Inductance - Henry, Milli-henry, Micro-henry
* Units: Add unit test for currency ₩
* Units: Add unit tests for energy units
* Loki: Fix query error for step parameter
- Loki does not fully support float steps like prometheus and returns a
query error
- this change makes sure that the step parameter is rounded to an
integer
* Added test and comments
* Panels: Added support to set panel padding to zero
* WIP: fullChromeControl work
* Tweaks to header position
* Reverted some overlay mechanic and now back to no title only
* Fixed test
* Fixed transparent flag
* Added show title
* Added font weight to value
* Reverted back to no padding option
* Fixed issue with border and width and height
* Introduce new Switch component
* Experiment with different focus style
* Review update
* Update on/off swtch colors
* Introduce Form.Field component
* Enable className prop on form's field
* Remove not used imports
* Update packages/grafana-ui/src/components/Forms/Field.tsx
Co-Authored-By: Peter Holmberg <peterholmberg@users.noreply.github.com>
* Make switch usable in field story
* Add predefined input sizes
* Add util to display story on a debug canvas
* Test form
* Updated the test form
* Fix snapshot
Profiling and tracing can now be enabled/disabled separately.
Adds argument for trace file path.
Support overriding profiling and tracing argument using
environment variables.
Update docs.
Fixes#20576
* Add Service Quota part
* Update docs after pr feedback
* Describing new features
* Divide into subheaders
* Changes after feedback
* cloudwatch: add min time interval section to docs
* docs: json format fix
* cloudwatch: move min time interval section in docs
* cloudwatch: docs fix
* docs: cloudwatch fixes
* docs: s/you are/you're
* docs: Cloudwatch - escapes underscores in tables
Adds support for using custom dockerfiles to pre-install image
renderer plugins.
Updates docs for docker and image rendering.
Fixes#20241
Co-Authored-By: Leonard Gram <leo@xlson.com>
* refactor to multiple rows
* added name for org user struct
* added name getorgusers
* added user name to tableview
* made test pass
* updated userMocks to user name field
* added missing UsersTable snapshot
* added name on teammembers page, be able to search query for name, login and email
* added the updated snapshots
* conform to same sorting as output form
* conform to previous way of using it
* sort first by login and after by email, as it was before
* Adding cloudwatch related stuff - images will come later on
* Changes after pr feedback
* Add images
* Update image path
* Remove react migration part - might not be so interesting for our users
* Removing part about curated dashboards since it's not released yet - will be re-added later on
Backend plugins is recommended to use hclog with json
formatting to get proper log output in grafana server log.
Old hclog-wrapper.go that I deleted while back is still in
the repo so deletes that.
* Remove highres flag since it's not being used
* Remove not used code. Init id field correctly
* Fix broken tests
* Remove GMS related calculations
* Rename period field
* Add breaking changes to changelog. Also update upgrading docs
* Update snapshot
* Update docs after feedback
* Changes after feedback
* Adding component, story and documentation file
* forgot files
* Add label and formvalidation
* fix for error/invalid message
* fixing font color when input is disabled
* red border if invalid
* fixing props and label margin
* added support for icon in input
* support for button and loading state
* redoing some of the markup
* fixing height on addons
* Adding some basic documentation
* remove not used types file
* Add some more knobs
* move component to it's own directory, updated styling
* Adding component, story and documentation file
* forgot files
* Add label and formvalidation
* fix for error/invalid message
* fixing font color when input is disabled
* red border if invalid
* fixing props and label margin
* added support for icon in input
* support for button and loading state
* redoing some of the markup
* fixing height on addons
* Adding some basic documentation
* remove not used types file
* Add some more knobs
* move component to it's own directory, updated styling
* Add Icon component
* Add useClientRect helper hook
* Add missing Icon types
* Simplify Inputs styling (POC)
* Render theme knob in a separate group
* Update packages/grafana-ui/src/components/Forms/Input/Input.tsx
Co-Authored-By: Peter Holmberg <peterholmberg@users.noreply.github.com>
* Update packages/grafana-ui/src/components/Forms/Input/Input.tsx
* Improve comment
* Restore increase/decrease spinner on number inputs
* Add period
* use input color variables
* fix test
* Expose input styles from getFormStyles
* grafana/build-container: Upgrade to Ubuntu 18.04 base image
* grafana/build-container: Upgrade to Go 1.13.4
* grafana/build-container: Upgrade to Node 10.17.0
Problem was that yaml unmarshal returned nested maps as
map[interface{}]interface{} which are then not marshal-able
to json because of that interface{} key type. This adds explicit
casting of the keys in the yaml value types to string which
then makes the values marshal-able to JSON in DB.
Fixes: #11537
* Fix integration of postgres and fake-data-gen containers
This fix introduces the following modifications:
- Upgrades to 2.1 docker-compose file format
- Adds a health check for determining that postgrestest service is healthy
- Modifies the fake-postgres-data service to wait for postgrestest to be
"healthy" before starting.
- Renames postgrestest to postgres
* Util: Optionally allow empty input in SplitHostPortDefault
Due to a recent change the SQL Server tests failed because passing an
empty datasource url in `util.SplitHostPortDefault` was no more allowed.
This fix contains the following modifications:
- Modifies the util.SplitHostPortDefault not to return an error for empty input.
- Modifies the util.SplitHostPort to return an error for empty input.
- Introduces an additional test for empty input.
* convert config editor to react
* tests and some cleanup
* test
* snaps
* updating per comments
* remove anonymous funcs, remove config from state
* remove unecessaries
* Grafana/Loki: Adds support for new Loki endpoints and metrics
* Adds `/loki/` prefix to new loki endpoints and updates response interfaces
* Improved legacy support
* Removed changes related to plugin.json and added Loki-specific hacks
* Fixes live streaming for legacy loki datasources
The ordering of links in the navigation bar is currently based the order of the slice containing the navigation tree. Since Grafana supports adding more links to the navigation bar with `RunIndexDataHooks` which runs at the very end of the function this means that any link registered through a hook will be placed last in the slice and be displayed last in the menu. With this PR the ordering can be specified with a weight which allows for placing links created by extensions in a more intuitive place where applicable.
Stable sorting is used to ensure that the current FIFO ordering is preserved when either no weight is set or two items shares the same weight.
* Chore: Move and wrap Cascader component to @grafana/ui
Closes#19042
* Removes unneeded props from interface and removes rc-trigger
* Removes more unneeded props
* CloudWatch: Datasource improvements
* Add statistic as template variale
* Add wildcard to list of values
* Template variable intercept dimension key
* Return row specific errors when transformation error occured
* Add meta feedback
* Make it possible to retrieve values without known metrics
* Add curated dashboard for EC2
* Fix broken tests
* Use correct dashboard name
* Display alert in case multi template var is being used for some certain props in the cloudwatch query
* Minor fixes after feedback
* Update dashboard json
* Update snapshot test
* Make sure region default is intercepted in cloudwatch link
* Update dashboards
* Include ec2 dashboard in ds
* Do not include ec2 dashboard in beta1
* Display actual region
* LDAP: last org admin (that's going to be removed) can login
Previously, if you tried to login with LDAP but were that last org admin
of an org that you would no longer be an admin of after sync (which
happens at login), you wouldn't be able to login due to an error.
* Docker blocks: Add loki blocks for loki releases
- Loki did major API changes between 0.3 and 0.4
- Adding blocks to simplify Grafana datasource testing for different
versions
- keeing `loki` block pointing at loki master
- Run all versions in parallel:
```
./create_docker_compose.sh loki0.3 loki0.4 loki
```
- all versions have different hostnames and ports internally
- datasource url depends on version so you can set them up as separate
datasources:
- master: http://localhost:3100/
- 0.3.0: http://localhost:3103/
- 0.4.0: http://localhost:3104/
* Add loki minor version datasources
* **Slack**: Removed _Mention_ setting and instead introduce _Mention Users_, _Mention Groups_, and _Mention Channel_. The first two settings require user and group IDs, respectively. This change was necessary because the way of mentioning via the Slack API [changed](https://api.slack.com/changelog/2017-09-the-one-about-usernames) and mentions in Slack notifications no longer worked.
* **Alerting**: Reverts the behavior of `diff` and `percent_diff` to not always be absolute. Something we introduced by mistake in [6.1.0](https://github.com/grafana/grafana/commit/28eaac3a9c7082e8c496005c1cb66b4b70a4f82f). Alerting now support `diff()`, `diff_abs()`, `percent_diff()` and `percent_diff_abs()`. [#21338](https://github.com/grafana/grafana/pull/21338)
### Notice about changes in backendSrv for plugin authors
In our mission to migrate away from AngularJS to React we have removed all AngularJS dependencies in the core data retrieval service `backendSrv`.
Removing the AngularJS dependencies in `backendSrv` has the unfortunate side effect of AngularJS digest no longer being triggered for any request made with `backendSrv`. Because of this, external plugins using `backendSrv` directly may suffer from strange behaviour in the UI.
To remedy this issue, as a plugin author you need to trigger the digest after a direct call to `backendSrv`.
* **Metrics**: Add gauge for requests currently in flight. [#22168](https://github.com/grafana/grafana/pull/22168), [@bergquist](https://github.com/bergquist)
### Bug Fixes
* **@grafana/ui**: Fix displaying of bars in React Graph. [#21968](https://github.com/grafana/grafana/pull/21968), [@ivanahuckova](https://github.com/ivanahuckova)
* **API**: Fix redirect issue when configured to use a subpath. [#21652](https://github.com/grafana/grafana/pull/21652), [@briangann](https://github.com/briangann)
* **API**: Improve recovery middleware when response already been written. [#22256](https://github.com/grafana/grafana/pull/22256), [@marefr](https://github.com/marefr)
* **Auth**: Don't rotate auth token when requests are cancelled by client. [#22106](https://github.com/grafana/grafana/pull/22106), [@bergquist](https://github.com/bergquist)
* **Docker**: Downgrade to 18.04 LTS base image. [#22313](https://github.com/grafana/grafana/pull/22313), [@aknuds1](https://github.com/aknuds1)
* **Elasticsearch**: Fix auto interval for date histogram in explore logs mode. [#21937](https://github.com/grafana/grafana/pull/21937), [@ivanahuckova](https://github.com/ivanahuckova)
* **Links**: Assure base url when single stat, panel and data links are built. [#21956](https://github.com/grafana/grafana/pull/21956), [@dprokop](https://github.com/dprokop)
* **OAuth**: Enforce auto_assign_org_id setting when role mapping enabled using Generic OAuth. [#22268](https://github.com/grafana/grafana/pull/22268), [@aknuds1](https://github.com/aknuds1)
* **Prometheus**: Updates explore query editor to prevent it from throwing error on edit. [#21605](https://github.com/grafana/grafana/pull/21605), [@Estrax](https://github.com/Estrax)
* **Server**: Reorder cipher suites for better security. [#22101](https://github.com/grafana/grafana/pull/22101), [@tofu-rocketry](https://github.com/tofu-rocketry)
* **TimePicker**: fixing weird behavior with calendar when switching between months/years . [#22253](https://github.com/grafana/grafana/pull/22253), [@mckn](https://github.com/mckn)
# 6.6.1 (2020-02-06)
### Bug Fixes
* **Annotations**: Change indices and rewrites annotation find query to improve database query performance. [#21915](https://github.com/grafana/grafana/pull/21915), [@papagian](https://github.com/papagian), [@marefr](https://github.com/marefr), [@kylebrandt](https://github.com/kylebrandt)
* **Azure Monitor**: Fix Application Insights API key field to allow input. [#21738](https://github.com/grafana/grafana/pull/21738), [@shavonn](https://github.com/shavonn)
* **BarGauge**: Fix so we properly display the "no result" value when query returns empty result. [#21791](https://github.com/grafana/grafana/pull/21791), [@mckn](https://github.com/mckn)
* **Datasource**: Show access (Browser/Server) select on the Prometheus datasource. [#21833](https://github.com/grafana/grafana/pull/21833), [@jorgelbg](https://github.com/jorgelbg)
* **DatasourceSettings**: Fixed issue navigating away from data source settings page. [#21841](https://github.com/grafana/grafana/pull/21841), [@torkelo](https://github.com/torkelo)
* **Graph Panel**: Fix typo in thresholds form. [#21903](https://github.com/grafana/grafana/pull/21903), [@orendain](https://github.com/orendain)
* **Graphite**: Fixed issue with functions with multiple required params and no defaults caused params that could not be edited (groupByNodes groupByTags). [#21814](https://github.com/grafana/grafana/pull/21814), [@torkelo](https://github.com/torkelo)
* **Image Rendering**: Fix render of graph panel legend aligned to the right using Grafana image renderer plugin/service. [#21854](https://github.com/grafana/grafana/pull/21854), [@marefr](https://github.com/marefr)
* **Metrics**: Adds back missing summary quantiles. [#21858](https://github.com/grafana/grafana/pull/21858), [@kogent](https://github.com/kogent)
* **OpenTSDB**: Adds back missing ngInject to make it work again. [#21796](https://github.com/grafana/grafana/pull/21796), [@marefr](https://github.com/marefr)
* **Plugins**: Fix routing in app plugin pages. [#21847](https://github.com/grafana/grafana/pull/21847), [@dprokop](https://github.com/dprokop)
* **Prometheus**: Fixes default step value for annotation query. [#21934](https://github.com/grafana/grafana/pull/21934), [@hugohaggmark](https://github.com/hugohaggmark)
* **Quota**: Makes LDAP + Quota work for the first login of a new user. [#21949](https://github.com/grafana/grafana/pull/21949), [@xlson](https://github.com/xlson)
* **StatPanels**: Fixed change from singlestat to Gauge / BarGauge / Stat where default min & max (0, 100) was copied . [#21820](https://github.com/grafana/grafana/pull/21820), [@torkelo](https://github.com/torkelo)
* **TimePicker**: Should display in kiosk mode. [#21816](https://github.com/grafana/grafana/pull/21816), [@evgbibko](https://github.com/evgbibko)
* **grafana/toolkit**: Fix failing linter when there were lint issues. [#21849](https://github.com/grafana/grafana/pull/21849), [@dprokop](https://github.com/dprokop)
* **CloudWatch**: Auto period snap to next higher period. [#21659](https://github.com/grafana/grafana/pull/21659), [@sunker](https://github.com/sunker)
* **Template variables**: Add error for failed query variable on time range update. [#21731](https://github.com/grafana/grafana/pull/21731), [@tskarhed](https://github.com/tskarhed)
* **Explore**: Fix colors for log level when level value is capitalised. [#21646](https://github.com/grafana/grafana/pull/21646), [@ivanahuckova](https://github.com/ivanahuckova)
* **Explore**: Fix context view in logs, where some rows may have been filtered out.. [#21729](https://github.com/grafana/grafana/pull/21729), [@aocenas](https://github.com/aocenas)
* **Loki**: Fix Loki with repeated panels and interpolation for Explore. [#21685](https://github.com/grafana/grafana/pull/21685), [@ivanahuckova](https://github.com/ivanahuckova)
* **SQLStore**: Fix PostgreSQL failure to create organisation for first time. [#21648](https://github.com/grafana/grafana/pull/21648), [@papagian](https://github.com/papagian)
# 6.6.0-beta1 (2020-01-20)
## Breaking changes
* **PagerDuty**: Change `payload.custom_details` field in PagerDuty notification to be a JSON object instead of a string.
* **Security**: The `[security]` setting `cookie_samesite` configured to `none` now renders cookies with `SameSite=None` attribute compared to before where no `SameSite` attribute was added to cookies. To get the old behavior, use value `disabled` instead of `none`. Refer to [Upgrade Grafana](https://grafana.com/docs/grafana/latest/installation/upgrading/#upgrading-to-v6-6) for more information.
### Features / Enhancements
* **Graphite**: Add Metrictank dashboard to Graphite datasource
* **Admin**: Show name of user in users table view. [#18108](https://github.com/grafana/grafana/pull/18108), [@eleijonmarck](https://github.com/eleijonmarck)
* **Alerting**: Add configurable severity support for PagerDuty notifier. [#19425](https://github.com/grafana/grafana/pull/19425), [@yemble](https://github.com/yemble)
* **Alerting**: Add more information to webhook notifications. [#20420](https://github.com/grafana/grafana/pull/20420), [@michael-az](https://github.com/michael-az)
* **Alerting**: Add support for sending tags in OpsGenie notifier. [#20810](https://github.com/grafana/grafana/pull/20810), [@aSapien](https://github.com/aSapien)
* **Alerting**: Added fallbackText to Google Chat notifier. [#21464](https://github.com/grafana/grafana/pull/21464), [@alvarolmedo](https://github.com/alvarolmedo)
* **Alerting**: Adds support for sending a single email to all recipients in email notifier. [#21091](https://github.com/grafana/grafana/pull/21091), [@marefr](https://github.com/marefr)
* **Alerting**: Enable setting of OpsGenie priority via a tag. [#21298](https://github.com/grafana/grafana/pull/21298), [@zabullet](https://github.com/zabullet)
* **Alerting**: Use fully qualified status emoji in Threema notifier. [#21305](https://github.com/grafana/grafana/pull/21305), [@dbrgn](https://github.com/dbrgn)
* **Alerting**: new min_interval_seconds option to enforce a minimum evaluation frequency . [#21188](https://github.com/grafana/grafana/pull/21188), [@papagian](https://github.com/papagian)
* **CloudWatch**: Calculate period based on time range. [#21471](https://github.com/grafana/grafana/pull/21471), [@sunker](https://github.com/sunker)
* **CloudWatch**: Display partial result in graph when max DP/call limit is reached . [#21533](https://github.com/grafana/grafana/pull/21533), [@sunker](https://github.com/sunker)
* **DataLinks**: allow using values from other fields in the same row (cells). [#21478](https://github.com/grafana/grafana/pull/21478), [@ryantxu](https://github.com/ryantxu)
* **Editor**: Ignore closing brace when it was added by editor. [#21172](https://github.com/grafana/grafana/pull/21172), [@davkal](https://github.com/davkal)
* **Explore**: Context tooltip to copy labels and values from graph. [#21405](https://github.com/grafana/grafana/pull/21405), [@ivanahuckova](https://github.com/ivanahuckova)
* **Explore**: Log message line wrapping options for logs. [#20360](https://github.com/grafana/grafana/pull/20360), [@ivanahuckova](https://github.com/ivanahuckova)
* **Frontend**: Changes in Redux location should not strip subpath from location url. [#20161](https://github.com/grafana/grafana/pull/20161), [@wybczu](https://github.com/wybczu)
* **Graph**: Add fill gradient option to series override line fill. [#20941](https://github.com/grafana/grafana/pull/20941), [@hendrikvh](https://github.com/hendrikvh)
* **Graphite**: Add metrictank dashboard to Graphite datasource. [#20776](https://github.com/grafana/grafana/pull/20776), [@Dieterbe](https://github.com/Dieterbe)
* **Graphite**: Do not change query when opening the query editor and there is no data. [#21588](https://github.com/grafana/grafana/pull/21588), [@daniellee](https://github.com/daniellee)
* **Gravatar**: Use HTTPS by default. [#20964](https://github.com/grafana/grafana/pull/20964), [@jiajunhuang](https://github.com/jiajunhuang)
* **Loki**: Support for template variable queries. [#20697](https://github.com/grafana/grafana/pull/20697), [@ivanahuckova](https://github.com/ivanahuckova)
* **NewsPanel**: Add news as a builtin panel. [#21128](https://github.com/grafana/grafana/pull/21128), [@ryantxu](https://github.com/ryantxu)
* **Postgres/MySQL/MSSQL**: Adds support for region annotations. [#20752](https://github.com/grafana/grafana/pull/20752), [@Bercon](https://github.com/Bercon)
* **Prometheus**: Field to specify step in Explore. [#20195](https://github.com/grafana/grafana/pull/20195), [@Estrax](https://github.com/Estrax)
* **Prometheus**: User metrics metadata to inform query hints. [#21304](https://github.com/grafana/grafana/pull/21304), [@davkal](https://github.com/davkal)
* **Renderer**: Add user-agent to remote rendering service requests. [#20956](https://github.com/grafana/grafana/pull/20956), [@kfdm](https://github.com/kfdm)
* **Stackdriver**: Support meta labels. [#21373](https://github.com/grafana/grafana/pull/21373), [@sunker](https://github.com/sunker)
* **TablePanel, GraphPanel**: Exclude hidden columns from CSV. [#19925](https://github.com/grafana/grafana/pull/19925), [@literalplus](https://github.com/literalplus)
* **Templating**: Update variables on location changed. [#21480](https://github.com/grafana/grafana/pull/21480), [@ryantxu](https://github.com/ryantxu)
* **Tracing**: Support configuring Jaeger client from environment. [#21103](https://github.com/grafana/grafana/pull/21103), [@hairyhenderson](https://github.com/hairyhenderson)
* **Units**: Add currency and energy units. [#20428](https://github.com/grafana/grafana/pull/20428), [@anirudh-ramesh](https://github.com/anirudh-ramesh)
* **Units**: Support dynamic count and currency units. [#21279](https://github.com/grafana/grafana/pull/21279), [@ryantxu](https://github.com/ryantxu)
* **grafana/toolkit**: Add option to override webpack config. [#20872](https://github.com/grafana/grafana/pull/20872), [@sebimarkgraf](https://github.com/sebimarkgraf)
* **grafana/ui**: New table component. [#20991](https://github.com/grafana/grafana/pull/20991), [@peterholmberg](https://github.com/peterholmberg)
* **grafana/ui**: New updated time picker. [#20931](https://github.com/grafana/grafana/pull/20931), [@mckn](https://github.com/mckn)
* **White-labeling**: Makes it possible to customize the footer and login background (Enterprise)
### Bug Fixes
* **API**: Optionally list expired API keys. [#20468](https://github.com/grafana/grafana/pull/20468), [@papagian](https://github.com/papagian)
* **Alerting**: Fix custom_details to be a JSON object instead of a string in PagerDuty notifier. [#21150](https://github.com/grafana/grafana/pull/21150), [@tehGoti](https://github.com/tehGoti)
* **Alerting**: Fix image rendering and uploading timeout preventing to send alert notifications. [#21536](https://github.com/grafana/grafana/pull/21536), [@marefr](https://github.com/marefr)
* **Alerting**: Fix panic in dingding notifier . [#20378](https://github.com/grafana/grafana/pull/20378), [@csyangchen](https://github.com/csyangchen)
* **Alerting**: If no permission to clear history, keep the historical data. [#19007](https://github.com/grafana/grafana/pull/19007), [@lzdw](https://github.com/lzdw)
* **Alerting**: Unpausing a non-paused alert rule should not change status to Unknown. [#21375](https://github.com/grafana/grafana/pull/21375), [@vikkyomkar](https://github.com/vikkyomkar)
* **Api**: Fix returned message when enabling, disabling and deleting a non-existing user. [#21391](https://github.com/grafana/grafana/pull/21391), [@dpavlos](https://github.com/dpavlos)
* **Auth**: Rotate auth tokens at the end of requests. [#21347](https://github.com/grafana/grafana/pull/21347), [@woodsaj](https://github.com/woodsaj)
* **Azure Monitor**: Fixes error using azure monitor credentials with log analytics and non-default cloud. [#21032](https://github.com/grafana/grafana/pull/21032), [@shavonn](https://github.com/shavonn)
* **CLI**: Return error and aborts when plugin file extraction fails. [#20849](https://github.com/grafana/grafana/pull/20849), [@marefr](https://github.com/marefr)
* **CloudWatch**: Multi-valued template variable dimension alias fix. [#21541](https://github.com/grafana/grafana/pull/21541), [@sunker](https://github.com/sunker)
* **Dashboard**: Disable draggable panels on small devices. [#20629](https://github.com/grafana/grafana/pull/20629), [@peterholmberg](https://github.com/peterholmberg)
* **DataLinks**: Links with ${__value.time} do not work when clicking on first result . [#20019](https://github.com/grafana/grafana/pull/20019), [@dweineha](https://github.com/dweineha)
* **Explore**: Fix showing of results in selected timezone (UTC/local). [#20812](https://github.com/grafana/grafana/pull/20812), [@ivanahuckova](https://github.com/ivanahuckova)
* **Explore**: Fix timepicker when browsing back after switching datasource. [#21454](https://github.com/grafana/grafana/pull/21454), [@ivanahuckova](https://github.com/ivanahuckova)
* **Explore**: Sync timepicker and logs after live-tailing stops. [#20979](https://github.com/grafana/grafana/pull/20979), [@ivanahuckova](https://github.com/ivanahuckova)
* **Graph**: Fix when clicking a plot on a touch device we won't display the annotation menu. [#21479](https://github.com/grafana/grafana/pull/21479), [@mckn](https://github.com/mckn)
* **OAuth**: Fix role mapping from id token. [#20300](https://github.com/grafana/grafana/pull/20300), [@seanson](https://github.com/seanson)
* **Plugins**: Add appSubUrl string to config pages. [#21414](https://github.com/grafana/grafana/pull/21414), [@Maddin-619](https://github.com/Maddin-619)
* **Provisioning**: Start provision dashboards after Grafana server have started. [#21564](https://github.com/grafana/grafana/pull/21564), [@marefr](https://github.com/marefr)
* **Render**: Use https as protocol when rendering if HTTP2 enabled. [#21600](https://github.com/grafana/grafana/pull/21600), [@marefr](https://github.com/marefr)
* **Security**: Use same cookie settings for all cookies. [#19787](https://github.com/grafana/grafana/pull/19787), [@jeffdesc](https://github.com/jeffdesc)
* **Singlestat**: Support empty value map texts. [#20952](https://github.com/grafana/grafana/pull/20952), [@hendrikvh](https://github.com/hendrikvh)
* **Units**: Custom suffix and prefix units can now be specified, for example custom currency & SI & time formats. [#20763](https://github.com/grafana/grafana/pull/20763), [@ryantxu](https://github.com/ryantxu)
* **grafana/ui**: Do not build grafana/ui in strict mode as it depends on non-strict libs. [#21319](https://github.com/grafana/grafana/pull/21319), [@dprokop](https://github.com/dprokop)
# 6.5.3 (2020-01-15)
### Features / Enhancements
* **API**: Validate redirect_to cookie has valid (Grafana) url . [#21057](https://github.com/grafana/grafana/pull/21057), [@papagian](https://github.com/papagian), Thanks Habi S Ravi for reporting this issue.
### Bug Fixes
* **AdHocFilter**: Shows SubMenu when filtering directly from table. [#21017](https://github.com/grafana/grafana/pull/21017), [@hugohaggmark](https://github.com/hugohaggmark)
* **Cloudwatch**: Fixed crash when switching from cloudwatch data source. [#21376](https://github.com/grafana/grafana/pull/21376), [@torkelo](https://github.com/torkelo)
* **DataLinks**: Sanitize data/panel link URLs. [#21140](https://github.com/grafana/grafana/pull/21140), [@dprokop](https://github.com/dprokop)
* **Elastic**: Fix multiselect variable interpolation for logs. [#20894](https://github.com/grafana/grafana/pull/20894), [@ivanahuckova](https://github.com/ivanahuckova)
* **Prometheus**: Fixes so user can change HTTP Method in config settings. [#21055](https://github.com/grafana/grafana/pull/21055), [@hugohaggmark](https://github.com/hugohaggmark)
* **Prometheus**: Prevents validation of inputs when clicking in them without changing the value. [#21059](https://github.com/grafana/grafana/pull/21059), [@hugohaggmark](https://github.com/hugohaggmark)
* **Rendering**: Fix panel PNG rendering when using sub url & serve_from_sub_path = true. [#21306](https://github.com/grafana/grafana/pull/21306), [@bgranvea](https://github.com/bgranvea)
* **AngularPanels**: Fixed loading spinner being stuck in some rare cases. [#20878](https://github.com/grafana/grafana/pull/20878), [@torkelo](https://github.com/torkelo)
* **CloudWatch**: Fix query editor does not render in Explore. [#20909](https://github.com/grafana/grafana/pull/20909), [@davkal](https://github.com/davkal)
* **CloudWatch**: Remove illegal character escaping in inferred expressions. [#20915](https://github.com/grafana/grafana/pull/20915), [@sunker](https://github.com/sunker)
* **CloudWatch**: Use datasource template variable in curated dashboards. [#20917](https://github.com/grafana/grafana/pull/20917), [@sunker](https://github.com/sunker)
* **Elasticsearch**: Set default port to 9200 in ConfigEditor. [#20948](https://github.com/grafana/grafana/pull/20948), [@papagian](https://github.com/papagian)
* **Gauge/BarGauge**: Added support for value mapping of "no data"-state to text/value. [#20842](https://github.com/grafana/grafana/pull/20842), [@mckn](https://github.com/mckn)
* **Graph**: Prevent tooltip from being displayed outside of window. [#20874](https://github.com/grafana/grafana/pull/20874), [@mckn](https://github.com/mckn)
* **Login**: Fix fatal error when navigating from reset password page. [#20747](https://github.com/grafana/grafana/pull/20747), [@peterholmberg](https://github.com/peterholmberg)
* **MixedDatasources**: Do not filter out all mixed data sources in add mixed query dropdown. [#20990](https://github.com/grafana/grafana/pull/20990), [@torkelo](https://github.com/torkelo)
* **Prometheus**: Fix caching for default labels request. [#20718](https://github.com/grafana/grafana/pull/20718), [@aocenas](https://github.com/aocenas)
* **Prometheus**: Run default labels query only once. [#20898](https://github.com/grafana/grafana/pull/20898), [@aocenas](https://github.com/aocenas)
* **Security**: Fix invite link still accessible after completion or revocation. [#20863](https://github.com/grafana/grafana/pull/20863), [@aknuds1](https://github.com/aknuds1)
* **Server**: Fail when unable to create log directory. [#20804](https://github.com/grafana/grafana/pull/20804), [@aknuds1](https://github.com/aknuds1)
* **TeamPicker**: Increase size limit from 10 to 100. [#20882](https://github.com/grafana/grafana/pull/20882), [@hendrikvh](https://github.com/hendrikvh)
* **Units**: Remove SI prefix symbol from new milli/microSievert(/h) units. [#20650](https://github.com/grafana/grafana/pull/20650), [@zegelin](https://github.com/zegelin)
# 6.5.1 (2019-11-28)
### Bug Fixes
* **CloudWatch**: Region template query fix. [#20661](https://github.com/grafana/grafana/pull/20661), [@sunker](https://github.com/sunker)
* **Panel**: Fixes undefined services/dependencies in plugins without `/**@ngInject*/`. [#20696](https://github.com/grafana/grafana/pull/20696), [@hugohaggmark](https://github.com/hugohaggmark)
* **Server**: Fix failure to start with "bind: address already in use" when using socket as protocol. [#20679](https://github.com/grafana/grafana/pull/20679), [@aknuds1](https://github.com/aknuds1)
* **Stats**: Fix active admins/editors/viewers stats are counted more than once if the user is part of more than one org. [#20711](https://github.com/grafana/grafana/pull/20711), [@papagian](https://github.com/papagian)
# 6.5.0 (2019-11-25)
### Features / Enhancements
* **CloudWatch**: Add curated dashboards for most popular amazon services. [#20486](https://github.com/grafana/grafana/pull/20486), [@sunker](https://github.com/sunker)
* **CloudWatch**: Enable Min time interval. [#20260](https://github.com/grafana/grafana/pull/20260), [@mtanda](https://github.com/mtanda)
* **Explore**: UI improvements for log details. [#20485](https://github.com/grafana/grafana/pull/20485), [@ivanahuckova](https://github.com/ivanahuckova)
* **Server**: Improve grafana-server diagnostics configuration for profiling and tracing. [#20593](https://github.com/grafana/grafana/pull/20593), [@papagian](https://github.com/papagian)
### Bug Fixes
* **BarGauge/Gauge**: Add back missing title option field display options. [#20616](https://github.com/grafana/grafana/pull/20616), [@torkelo](https://github.com/torkelo)
* **CloudWatch**: Fix high CPU load. [#20579](https://github.com/grafana/grafana/pull/20579), [@marefr](https://github.com/marefr)
* **CloudWatch**: Fix high resolution mode without expression. [#20459](https://github.com/grafana/grafana/pull/20459), [@mtanda](https://github.com/mtanda)
* **CloudWatch**: Make sure period variable is being interpreted correctly. [#20447](https://github.com/grafana/grafana/pull/20447), [@sunker](https://github.com/sunker)
* **CloudWatch**: Remove HighResolution toggle since it's not being used. [#20440](https://github.com/grafana/grafana/pull/20440), [@sunker](https://github.com/sunker)
* **Cloudwatch**: Fix LaunchTime attribute tag bug. [#20237](https://github.com/grafana/grafana/pull/20237), [@sunker](https://github.com/sunker)
* **Data links**: Fix URL field turns read-only for graph panels. [#20381](https://github.com/grafana/grafana/pull/20381), [@dprokop](https://github.com/dprokop)
* **Explore**: Keep logQL filters when selecting labels in log row details. [#20570](https://github.com/grafana/grafana/pull/20570), [@ivanahuckova](https://github.com/ivanahuckova)
* **Server**: Should fail when server is unable to bind port. [#20409](https://github.com/grafana/grafana/pull/20409), [@aknuds1](https://github.com/aknuds1)
* **Templating**: Prevents crash when $__searchFilter is not a string. [#20526](https://github.com/grafana/grafana/pull/20526), [@hugohaggmark](https://github.com/hugohaggmark)
* **TextPanel**: Fixes issue with template variable value not properly html escaped [#20588](https://github.com/grafana/grafana/pull/20588), [@torkelo](https://github.com/torkelo)
* **TimePicker**: Should update after location change. [#20466](https://github.com/grafana/grafana/pull/20466), [@torkelo](https://github.com/torkelo)
## Breaking changes
* **CloudWatch**: Pre Grafana 6.5.0, the CloudWatch datasource used the GetMetricStatistics API for all queries that did not have an ´id´ and did not have an ´expression´ defined in the query editor. The GetMetricStatistics API has a limit of 400 transactions per second. In this release, all queries use the GetMetricData API. The GetMetricData API has a limit of 50 transactions per second and 100 metrics per transaction. For API pricing information, please refer to the CloudWatch pricing page (https://aws.amazon.com/cloudwatch/pricing/).
* **CloudWatch**: The GetMetricData API does not return metric unit, so unit auto detection in panels is no longer supported.
* **CloudWatch**: The `HighRes` switch has been removed from the query editor. Read more about this in [upgrading to 6.5](https://grafana.com/docs/installation/upgrading/#upgrading-to-v6-5).
* **CloudWatch**: In previous versions of Grafana, there was partial support for using multi-valued template variables as dimension values. When a multi-valued template variable is being used for dimension values in Grafana 6.5, a [search expression](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-search-expressions.html) will be generated. In the GetMetricData API, expressions are limited to 1024 characters, so you might reach this limit if you are using a large number of values. Read our [upgrading to 6.5](https://grafana.com/docs/installation/upgrading/#upgrading-to-v6-5) guide to see how you can use the `*` wildcard for this use case.
# 6.5.0-beta1 (2019-11-14)
### Features / Enhancements
* **API**: Add `createdAt` and `updatedAt` to api/users/lookup. [#19496](https://github.com/grafana/grafana/pull/19496), [@gotjosh](https://github.com/gotjosh)
@@ -43,6 +286,7 @@
* **Templating**: Made default template variable query editor field a textarea with automatic height. [#20288](https://github.com/grafana/grafana/pull/20288), [@torkelo](https://github.com/torkelo)
* **Units**: Add milli/microSievert, milli/microSievert/h and pixels. [#20144](https://github.com/grafana/grafana/pull/20144), [@ryantxu](https://github.com/ryantxu)
* **Units**: Added mega ampere and watt-hour per kg. [#19922](https://github.com/grafana/grafana/pull/19922), [@Karan96Kaushik](https://github.com/Karan96Kaushik)
* **Enterprise**: Enterprise without a license behaves like OSS (Enterprise)
### Bug Fixes
* **API**: Added dashboardId and slug in response to dashboard import api. [#19692](https://github.com/grafana/grafana/pull/19692), [@jongyllen](https://github.com/jongyllen)
@@ -67,25 +311,36 @@
* **ReactPanels**: Adds Explore menu item. [#20236](https://github.com/grafana/grafana/pull/20236), [@hugohaggmark](https://github.com/hugohaggmark)
* **Team Sync**: Fix URL encode Group IDs for external team sync. [#20280](https://github.com/grafana/grafana/pull/20280), [@gotjosh](https://github.com/gotjosh)
## Breaking changes
* **CloudWatch**: Pre Grafana 6.5.0, the CloudWatch datasource used the GetMetricStatistics API for all queries that did not have an ´id´ and did not have an ´expression´ defined in the query editor. The GetMetricStatistics API has a limit of 400 transactions per second. In this release, all queries use the GetMetricData API. The GetMetricData API has a limit of 50 transactions per second and 100 metrics per transaction. Also the GetMetricData API pricing is different from GetMetricStatistics. While GetMetricStatistics qualified for the CloudWatch API free tier, this is not the case for GetMetricData calls. For more information, please refer to the CloudWatch pricing page (https://aws.amazon.com/cloudwatch/pricing/). Read more about GetMetricData limits in [upgrading to 6.5](https://grafana.com/docs/installation/upgrading/#upgrading-to-v6-5).
* **CloudWatch**: Pre Grafana 6.5.0, the CloudWatch datasource used the GetMetricStatistics API for all queries that did not have an ´id´ and did not have an ´expression´ defined in the query editor. The GetMetricStatistics API has a limit of 400 transactions per second. In this release, all queries use the GetMetricData API. The GetMetricData API has a limit of 50 transactions per second and 100 metrics per transaction. For API pricing information, please refer to the CloudWatch pricing page (https://aws.amazon.com/cloudwatch/pricing/).
* **CloudWatch**: The GetMetricData API does not return metric unit, so unit auto detection in panels is no longer supported.
* **CloudWatch**: The GetMetricData API does not return metric unit, so unit auto detection in panels is no longer supported.
* **CloudWatch**: The `HighRes` switch has been removed from the query editor. Read more about this in [upgrading to 6.5](https://grafana.com/docs/installation/upgrading/#upgrading-to-v6-5).
* **CloudWatch**: The `HighRes` switch has been removed from the query editor. Read more about this in [upgrading to 6.5](https://grafana.com/docs/installation/upgrading/#upgrading-to-v6-5).
* **CloudWatch**: In previous versions of Grafana, there was partial support for using multi template variables as dimension values. When a multi template variable is being used for dimension values in Grafana 6.5, a [search expression](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-search-expressions.html) will be generated. In the GetMetricData API, expressions are limited to 1024 characters, so it might be the case that this limit is reached when a multi template variable that has a lot of values is being used. Read about the suggested workaround in [upgrading to 6.5](https://grafana.com/docs/installation/upgrading/#upgrading-to-v6-5).
* **CloudWatch**: In previous versions of Grafana, there was partial support for using multi-valued template variables as dimension values. When a multi-valued template variable is being used for dimension values in Grafana 6.5, a [search expression](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-search-expressions.html) will be generated. In the GetMetricData API, expressions are limited to 1024 characters, so you might reach this limit if you are using a large number of values. Read our [upgrading to 6.5](https://grafana.com/docs/installation/upgrading/#upgrading-to-v6-5) guide to see how you can use the `*` wildcard for this use case.
# 6.4.5 (2019-11-25)
### Bug Fixes
* **CloudWatch**: Fix high CPU load [#20579](https://github.com/grafana/grafana/pull/20579)
# 6.4.4 (2019-11-06)
### Bug Fixes
* **MySQL**: Fix encoding in connection string [#20192](https://github.com/grafana/grafana/pull/20192)
* **Docker**: Makes it possible to parse timezones in the docker image. [#20081](https://github.com/grafana/grafana/pull/20081), [@xlson](https://github.com/xlson)
* **LDAP**: All LDAP servers should be tried even if one of them returns a connection error. [#20077](https://github.com/grafana/grafana/pull/20077), [@jongyllen](https://github.com/jongyllen)
* **LDAP**: No longer shows incorrectly matching groups based on role in debug page. [#20018](https://github.com/grafana/grafana/pull/20018), [@xlson](https://github.com/xlson)
* **Singlestat**: Fix no data / null value mapping . [#19951](https://github.com/grafana/grafana/pull/19951), [@ryantxu](https://github.com/ryantxu)
#### Security vulnerability
The MySQL data source connnection string fix, [#20192](https://github.com/grafana/grafana/pull/20192), that was part of this release
also fixed a security vulnerability. Thanks Yuriy Dyachenko for discovering and notifying us about this.
# 6.4.3 (2019-10-16)
### Bug Fixes
@@ -133,6 +388,7 @@
* **Explore**: Take root_url setting into account when redirecting from dashboard to explore. [#19447](https://github.com/grafana/grafana/pull/19447), [@ivanahuckova](https://github.com/ivanahuckova)
* **Explore**: Update broken link to logql docs. [#19510](https://github.com/grafana/grafana/pull/19510), [@ivanahuckova](https://github.com/ivanahuckova)
* **Logs**: Adds Logs Panel as a visualization. [#19504](https://github.com/grafana/grafana/pull/19504), [@davkal](https://github.com/davkal)
* **Reporting**: Generate and email PDF reports based on Dashboards (Enterprise)
### Bug Fixes
* **CLI**: Fix version selection for plugin install. [#19498](https://github.com/grafana/grafana/pull/19498), [@aocenas](https://github.com/aocenas)
@@ -177,7 +433,7 @@
* **Dashboard**: Adds Logs Panel (alpha) as visualization option for Dashboards. [#18641](https://github.com/grafana/grafana/pull/18641), [@hugohaggmark](https://github.com/hugohaggmark)
* **Dashboard**: Reuse query results between panels . [#16660](https://github.com/grafana/grafana/pull/16660), [@ryantxu](https://github.com/ryantxu)
* **Dashboard**: Set time to to 23:59:59 when setting To time using calendar. [#18595](https://github.com/grafana/grafana/pull/18595), [@simPod](https://github.com/simPod)
* **DataLinks**: Add DataLinks support to Gauge, BarGauge and SingleStat2 panel. [#18605](https://github.com/grafana/grafana/pull/18605), [@ryantxu](https://github.com/ryantxu)
* **DataLinks**: Add DataLinks support to Gauge, BarGauge and stat panel. [#18605](https://github.com/grafana/grafana/pull/18605), [@ryantxu](https://github.com/ryantxu)
* **DataLinks**: Enable access to labels & field names. [#18918](https://github.com/grafana/grafana/pull/18918), [@torkelo](https://github.com/torkelo)
* **DataLinks**: Enable multiple data links per panel. [#18434](https://github.com/grafana/grafana/pull/18434), [@dprokop](https://github.com/dprokop)
* **Docker**: switch docker image to alpine base with phantomjs support. [#18468](https://github.com/grafana/grafana/pull/18468), [@DanCech](https://github.com/DanCech)
@@ -247,6 +503,11 @@ Grafana is now using Alpine 3.10 as docker base image.
Please consider migrating from PhantomJS to the [Grafana Image Renderer plugin](https://grafana.com/grafana/plugins/grafana-image-renderer).
# 6.3.7 (2019-11-22)
### Bug Fixes
* **CloudWatch**: Fix high CPU load [#20579](https://github.com/grafana/grafana/pull/20579)
# 6.3.6 (2019-09-23)
### Features / Enhancements
@@ -380,6 +641,7 @@ Please consider migrating from PhantomJS to the [Grafana Image Renderer plugin](
* **Templating**: Support selecting all filtered values of a multi-value variable. [#16873](https://github.com/grafana/grafana/pull/16873), [@r66ad](https://github.com/r66ad)
* **Tracing**: allow propagation with Zipkin headers. [#17009](https://github.com/grafana/grafana/pull/17009), [@jrockway](https://github.com/jrockway)
* **Users**: Disable users removed from LDAP. [#16820](https://github.com/grafana/grafana/pull/16820), [@alexanderzobnin](https://github.com/alexanderzobnin)
* **SAML**: Add SAML as an authentication option (Enterprise)
### Bug Fixes
* **AddPanel**: Fix issue when removing moved add panel widget . [#17659](https://github.com/grafana/grafana/pull/17659), [@dehrax](https://github.com/dehrax)
@@ -2896,4 +3158,3 @@ Thanks to everyone who contributed fixes and provided feedback :+1:
# Number dashboard versions to keep (per dashboard). Default: 20, Minimum: 1
versions_to_keep=20
# Minimum dashboard refresh interval. When set, this will restrict users to set the refresh interval of a dashboard lower than given interval. Per default this is not set/unrestricted.
# The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
# Serve Grafana from subpath specified in `root_url` setting. By default it is set to `false` for compatibility reasons.
;serve_from_sub_path = false
@@ -87,6 +87,11 @@
# For "postgres" only, either "disable", "require" or "verify-full"
;ssl_mode = disable
;ca_cert_path =
;client_key_path =
;client_cert_path =
;server_cert_name =
# For "sqlite3" only, path relative to data_path setting
;path = grafana.db
@@ -175,7 +180,7 @@
# set to true if you host Grafana behind HTTPS. default is false.
;cookie_secure = false
# set cookie SameSite attribute. defaults to `lax`. can be set to "lax", "strict" and "none"
# set cookie SameSite attribute. defaults to `lax`. can be set to "lax", "strict", "none" and "disabled"
;cookie_samesite = lax
# set to true if you want to allow browsers to render Grafana in a <frame>, <iframe>, <embed> or <object>. default is false.
@@ -224,6 +229,10 @@
# Number dashboard versions to keep (per dashboard). Default: 20, Minimum: 1
;versions_to_keep = 20
# Minimum dashboard refresh interval. When set, this will restrict users to set the refresh interval of a dashboard lower than given interval. Per default this is not set/unrestricted.
# The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
# Used for uploading images to public servers so they can be included in slack/email messages.
@@ -578,6 +663,8 @@
;provider =
[external_image_storage.s3]
;endpoint =
;path_style_access =
;bucket =
;region =
;path =
@@ -610,10 +697,6 @@
# If the remote HTTP image renderer service runs on a different server than the Grafana server you may have to configure this to a URL where Grafana is reachable, e.g. http://grafana.domain/.
;callback_url =
[enterprise]
# Path to a valid Grafana Enterprise license.jwt file
;license_path =
[panels]
# If set to true Grafana will allow script tags in text panels. Not recommended as it enable XSS vulnerabilities.
;disable_sanitize_html = false
@@ -621,3 +704,11 @@
[plugins]
;enable_alpha = false
;app_tls_skip_verify_insecure = false
[enterprise]
# Path to a valid Grafana Enterprise license.jwt file
@@ -10,7 +10,7 @@ Before you begin, you might want to read [How to contribute to Grafana as a juni
Make sure you have the following dependencies installed before setting up your developer environment:
- [Git](https://git-scm.com/)
- [Go](https://golang.org/dl/)
- [Go](https://golang.org/dl/) (see [go.mod](../go.mod#L3) for minimum required version)
- [Node.js (Long Term Support)](https://nodejs.org)
- [Yarn](https://yarnpkg.com)
@@ -72,6 +72,10 @@ Log in using the default credentials:
When you log in for the first time, Grafana asks you to change your password.
#### Building on Windows
The Grafana backend includes Sqlite3 which requires GCC to compile. So in order to compile Grafana on Windows you need to install GCC. We recommend [TDM-GCC](http://tdm-gcc.tdragon.net/download).
## Test Grafana
The test suite consists of three types of tests: _Frontend tests_, _backend tests_, and _end-to-end tests_.
@@ -94,7 +98,9 @@ go test -v ./pkg/...
### Run end-to-end tests
The end-to-end tests in Grafana uses [puppeteer](https://github.com/GoogleChrome/puppeteer) to run automated scripts in a headless Chrome browser. To run the tests:
The endtoend tests in Grafana use [Cypress](https://www.cypress.io/) to run automated scripts in a headless Chromium browser. Read more about our [e2e framework](/contribute/style-guides/e2e.md).
To run the tests:
```
yarn e2e-tests
@@ -106,10 +112,10 @@ By default, the end-to-end tests assumes Grafana is available on `localhost:3000
BASE_URL=http://localhost:3333 yarn e2e-tests
```
To follow the tests in the browser while they're running, add the `BROWSER` and `SLOWMO` environment variables:
To follow the tests in the browser while they're running, use the `yarn e2e-tests:debug` instead.
@@ -39,7 +39,3 @@ Tests must use the standard library, `testing`. For assertions, prefer using [te
The majority of our tests uses [GoConvey](http://goconvey.co/) but that's something we want to avoid going forward.
In the `sqlstore` package we do database operations in tests and while some might say that's not suited for unit tests. We think they are fast enough and provide a lot of value.
## General guidelines
- Avoid using import aliases, e.g. `import m "github.com/grafana/grafana/pkg/models"`.
1. [Set stability of an API](#set-stability-of-an-api)
1. [Deprecate an API](#deprecate-an-api)
1. [Specify parameters](#specify-parameters)
1. [Set return values](#set-return-values)
____
## Add package description
Each package has an overview explaining the overall responsibility and usage of the package.
You can document this description with [`@packageDocumentation`](https://api-extractor.com/pages/tsdoc/tag_packagedocumentation/) tag.
Add this tag to the `<packageRoot>/src/index.ts` entry file to have one place for the package description.
## Set stability of an API
All `exported` apis from the package should have a release tag to indicate its stability.
- [`@alpha`](https://api-extractor.com/pages/tsdoc/tag_alpha/) - early draft of api and will probably change.
- [`@beta`](https://api-extractor.com/pages/tsdoc/tag_beta/) - close to being stable but might change.
- [`@public`](https://api-extractor.com/pages/tsdoc/tag_public/) - ready for useage in production.
- [`@internal`](https://api-extractor.com/pages/tsdoc/tag_internal/) - for internal use only.
### Main stability of APIs
Add a tag to mark the stability of the whole exported `class/interface/function/type` etc.
Please place the `release tag` at the bottom of the comment to make it consistent among files and easier to read.
**Do:**
```typescript
/**
* Will help to create DataFrame objects and handle
* the heavy lifting of creating a complex object.
*
* @example
* ```typescript
* const dataFrame = factory.create();
* ```
*
* @public
**/
exportclassDataFrameFactory{
create():DataFrame{}
}
```
**Don't**
```typescript
/**
* Will help to create DataFrame objects and handle
* the heavy lifting of creating a complex object.
*
* @public
* @example
* ```typescript
* const dataFrame = factory.create();
* ```
**/
exportclassDataFrameFactory{
create():DataFrame{}
}
```
### Partial stability of APIs
Add the main stability of the API at the top according to [Main stability of API](#main-stability-of-api).
Then override the non-stable parts of the API with the proper [release tag](#release-tags). This should also be place at the bottom of the comment block.
**Do:**
```typescript
/**
* Will help to create DataFrame objects and handle
* the heavy lifting of creating a complex object.
*
* @example
* ```typescript
* const dataFrame = factory.create();
* ```
*
* @public
**/
exportclassDataFrameFactory{
create():DataFrame{}
/**
* @beta
**/
createMany():DataFrames[]{}
}
```
**Don't**
```typescript
/**
* Will help to create DataFrame objects and handle
* the heavy lifting of creating a complex object.
*
* @example
* ```typescript
* const dataFrame = factory.create();
* ```
**/
exportclassDataFrameFactory{
/**
* @public
**/
create():DataFrame{}
/**
* @beta
**/
createMany():DataFrame[]{}
}
```
## Deprecate an API
If you want to mark an API as deprecated to signal that this API will be removed in the future, then add the [`@deprecated`](https://api-extractor.com/pages/tsdoc/tag_deprecated/) tag.
If applicable add a reason why the API is deprecated directly after the `@deprecated tag`.
## Specify parameters
If you want to specify the possible parameters that can be passed to an API, then add the [`@param`](https://api-extractor.com/pages/tsdoc/tag_param/) tag.
This attribute can be skipped if the type provided by `typescript` and the function comment or the function name is enough to explain what the parameters are.
**Do:**
```typescript
/**
* Will help to create a resource resovler depending
* on the current execution context.
*
* @param context - The current execution context.
* @returns FileResolver if executed on the server otherwise a HttpResolver.
If you want to specify the return value from a function you can use the [`@returns`](https://api-extractor.com/pages/tsdoc/tag_returns/) tag.
This attribute can be skipped if the type provided by `typescript` and the function comment or the function name is enough to explain what the function returns.
**Do:**
```typescript
/**
* Will help to create a resource resovler depending
* on the current execution context.
*
* @param context - The current execution context.
* @returns FileResolver if executed on the server otherwise a HttpResolver.
This guide for Markdown style helps keep contributions consistent across all documentation
created for Grafana products. Refer to the guide and update its sections as needed when a
Subject Matter Expert answers a question on Markdown style, or a decision is made about
how to apply Markdown.
## Headers
In Markdown, the number of "#" symbols creates different heading levels, similar to
HTML heading levels:
**Example**
* \# is \<h1>.
* \#\# is \<h2>.
* \#\#\# is \<h3>.
Start your document with a single ``#`` for the title of the page. Add the sub-headings with two ``##``.
## Bold and emphasis
* Make text **bold** using two asterisks.
**Example:** It is ``**important**`` to use Github Flavored Markdown emoji consistently.
* Make text ``*emphasized*`` using single `` _underscores_`` or a single asterisk.
**Example:** Github Flavored Markdown emoji should _only_ appear in specific cases.
## Links and references
Create links to other website by wrapping the display text in square brackets, and
the web URL in curved brackets.
\[text to display](www.website.com)
**Example:** For more information on including emoji in Github flavored Markdown, refer to the [webfx page on emoji](https://www.webfx.com/tools/emoji-cheat-sheet/) for a list of emoji.
## Block quotes
Include Block quotes inside text using right-facing arrows:
**Example**
> Any important information
> about emoji can be separated into
> a blockquote.
## Code blocks
Code blocks written with markdown can show off syntax highlighting specific
to different languages. Use three back tics to create a code block:
```
function testNum(a) {
if (a > 0) {
return "positive";
} else {
return "NOT positive";
}
}
```
Write the name of the language after the first set of back tics, no spaces,
to show specific syntax highlighting. For example; "\```javascript" produces the following:
```javascript
function testNum(a) {
if (a > 0) {
return "positive";
} else {
return "NOT positive";
}
}
```
## Tables
Construct a table by typing the table headings, and separating them with
a "|" character. Then, add a second line of dashes ("-") separated by
another "|" character. When constructing the table cells, separate each cell data with another
"|".
**Example**
Heading one | Heading two
\------------|------------
Cell one data| Cell two data
Will publish as:
Heading one | Heading two
------------|------------
Cell one data| Cell two data
## Lists
### Numbered lists
To avoid inconsistent list numbering, use repetitive list numbering:
\1. First
\1. Second
\1. Third
The list above will always display as:
1. First
2. Second
3. Third
### Unordered lists
Build a list of points - an unordered or unnumbered list - by
using "\*" characters.
**Example**
* First
* Another item
* The last list item
## Images
Include images in a document using the following syntax:
This style guide applies to all documentation created for Grafana products.
For information about how to write technical documentation, we suggest reviewing the content of the [Google Technical Writing courses](https://developers.google.com/tech-writing).
## Contributing
The *Documentation style guide* is a living document. Add to it whenever a style decision is made or a question is answered regarding style, grammar, or word choice.
@@ -81,12 +83,44 @@ Always give the reader some idea of what to expect in the reference. Avoid blind
When possible, use the exact title of the page or section you are linking to as the link text.
**Example**
*Refer to the [Documentation style guide](documentation-style-guide.md) for information about word usage and capitalization guidelines.
Refer to the [Documentation style guide](documentation-style-guide.md) for information about word usage and capitalization guidelines.
### Command line examples
* Do not assume everyone is using Linux. Make sure instructions include enough information for Windows and Mac users to successfully complete procedures.
* Do not add `$` before commands. Make it easy for users to copy and paste commands.
* **Wrong:** `$ sudo yum install grafana`
* **Right:** `sudo yum install grafana`
* Include `sudo` before commands that require `sudo` to work.
For terminal examples and Grafana configuration, use a `bash` code block:
```bash
sudo yum install grafana
```
For HTTP request/response, use an `http` code block:
Grafana products has some words, abbreviations, and slang particular to this discourse community.
#### checkout, check out
Two words if used as a verb, one word if used as a noun.
**Examples**
* Check out these new features!
* Proceed to checkout.
#### data source
Two words, not one
@@ -94,7 +128,6 @@ Two words, not one
**Exceptions:**
* "datasource" used as an identifier
* "datasource" in a URL
* "Open source" should be hyphenated when used as an adjective, e.g. *open-source software*. The open form should be preferred when used as a noun, e.g. *Grafana is open source*.
* Use "data source" instead of "datasource" unless used as an identifier, in code, or as part of a URL.
* Spell out "repository" and avoid the shorter "repo."
* Use "Unix" as the preferred spelling (as opposed to "UNIX", or "unix") when referring to the family of operating systems.
@@ -106,9 +139,13 @@ Two words, not one
* Correct, but passive voice: Your list of active alarms is displayed.
* Incorrect: The list of active alarms displays.
#### metadata
One word, not two.
#### open source, open-source
Hyphenate when used as an adjective. For example: _open-source software._
Do not hyphenate when used as an adjective unless the lack of hyphen would cause confusion. For example: _Opensource software design is the most open open-source system I can imagine._
Do not hyphenate when it is used as a noun. For example: _Open source is the best way to develop software._
We could define a selector using `JQuery` [type selectors](https://api.jquery.com/category/selectors/) with a string like `'.gf-form-input.login-form-input'` but that would be brittle as style changes occur frequently. Furthermore there is nothing that signals to future developers that this input is part of an e2e test.
At Grafana, we use `aria-label` as our preferred way of defining selectors instead of `data-*` attributes. This also aids in accessibility.
Let's add a descriptive `aria-label` to our simple example.
Now that we added the `aria-label` we suddenly get more information about this particular field. It's an input field that represents a username, but there it's still not really signaling that it's part of an e2e test.
The next step is to create a `Page` representation in our e2e test framework to glue the test with the real implementation using the `pageFactory` function. For that function we can supply a `url` and `selectors` like in the example below:
```typescript
export const Login = pageFactory({
url: '/login', // used when called from Login.visit()
selectors: {
username: 'Username input field', // used when called from Login.username().type('Hello World')
},
});
```
The next step is to add the `Login` page to the exported const `Pages` in `packages/grafana-e2e/src/pages/index.ts` so that it appears when we type `e2e.pages` in our IDE.
```ecmascript 6
export const Pages = {
Login,
...,
...,
...,
};
```
Now that we have a `Page` called `Login` in our `Pages` const we can use that to add a selector in our html like shown below and now this really signals to future developers that it is part of an e2e test.
The last step in our example is to use our `Login` page as part of a test. The `pageFactory` function we used before gives us two things:
- The `url` property is used whenever we call the `visit` function and is equivalent to the Cypress function [cy.visit()](https://docs.cypress.io/api/commands/visit.html#Syntax).
> Best practice after calling `visit` is to always call `should` on a selector to prevent flaky tests when you try to access an element that isn't ready. For more information, refer to [Commands vs. assertions](https://docs.cypress.io/guides/core-concepts/retry-ability.html#Commands-vs-assertions).
- Any defined selector in the `selectors` property can be accessed from the `Login` page by invoking it. This is equivalent to the result of the Cypress function [cy.get(...)](https://docs.cypress.io/api/commands/get.html#Syntax).
```ecmascript 6
describe('Login test', () => {
it('Should pass', () => {
e2e.pages.Login.visit();
// To prevent flaky tests, always do a .should on any selector that you expect to be in the DOM.
// Read more here: https://docs.cypress.io/guides/core-concepts/retry-ability.html#Commands-vs-assertions
e2e.pages.Login.username().should('be.visible');
e2e.pages.Login.username().type('admin');
});
});
```
## Advanced example
Let's take a look at an example that uses the same `selector` for multiple items in a list for instance. In this example app we have a list of data sources that we want to click on during an e2e test.
Just as before in the basic example we'll start by creating a page abstraction using the `pageFactory` function:
```typescript
export const DataSources = pageFactory({
url: '/datasources',
selectors: {
dataSources: (dataSourceName: string) => `Data source list item ${dataSourceName}`,
},
});
```
You might have noticed that instead of a simple `string` as the `selector`, we're using a `function` that takes a string parameter as an argument and returns a formatted string using the argument.
Just as before we need to add the `DataSources` page to the exported const `Pages` in `packages/grafana-e2e/src/pages/index.ts`.
The next step is to use the `dataSources` selector function as in our example below:
When this list is rendered with the data sources with names `A`, `B`, `C` the resulting html would become:
```jsx harmony
<div class="card-item-name" aria-label="Data source list item A">
A
</div>
...
<div class="card-item-name" aria-label="Data source list item B">
B
</div>
...
<div class="card-item-name" aria-label="Data source list item C">
C
</div>
```
Now we can write our test. The one thing that differs from the `Basic example` is that we pass in which data source we want to click on as an argument to the selector function:
> Best practice after calling `visit` is to always call `should` on a selector to prevent flaky tests when you try to access an element that isn't ready. For more information, refer to [Commands vs. assertions](https://docs.cypress.io/guides/core-concepts/retry-ability.html#Commands-vs-assertions).
```ecmascript 6
describe('List test', () => {
it('Clicking on data source named B', () => {
e2e.pages.DataSources.visit();
// To prevent flaky tests, always do a .should on any selector that you expect to be in the DOM.
// Read more here: https://docs.cypress.io/guides/core-concepts/retry-ability.html#Commands-vs-assertions
The most common error with PhantomJs image rendering is when a PR introduces an import that has functionality that's not supported by PhantomJs. To quickly identify which new import causes this you can use a tool like `es-check`.
1. Run > `npx es-check es5 './public/build/*.js'`
2. Check the output for files that break es5 compatibility.
3. Lazy load the failing imports if possible.
### Debugging
There is no easy or comprehensive way to debug PhantomJS smoke test (image rendering) failures. However, PhantomJS exposes remote debugging interface which can give you a sense of what is going wrong in the smoke test. Before performing the steps described below make sure your local Grafana instance is running:
@@ -7,31 +7,239 @@ Generally we follow the Airbnb [React Style Guide](https://github.com/airbnb/jav
- [Frontend Style Guide](#frontend-style-guide)
- [Table of Contents](#table-of-contents)
- [Basic rules](#basic-rules)
- [Organization](#organization)
- [Props](#props)
- [Naming conventions](#naming-conventions)
- [Files and directories naming conventions](#files-and-directories-naming-conventions)
- [Code organization](#code-organization)
- [Exports](#exports)
- [Comments](#comments)
- [React](#react)
- [Props](#props)
- [State management](#state-management)
## Basic rules
- Try to keep files small and focused.
- Break large components up into sub-components.
- Use spaces for indentation.
## Organization
### Naming conventions
- Components and types that needs to be used by external plugins needs to go into @grafana/ui
- Components should get their own folder under features/xxx/components
- Sub components can live in that component folders, so small component do not need their own folder
- Place test next to their component file (same dir)
- Component sass should live in the same folder as component code
- State logic & domain models should live in features/xxx/state
- Containers (pages) can live in feature root features/xxx
- up for debate?
#### Use `PascalCase` for:
## Props
##### Typescript class names
- Name callback props and handlers with an "on" prefix.
```typescript
// bad
classdataLink{
//...
}
// good
classDataLink{
//...
}
```
##### Types and interfaces
```
// bad
interface buttonProps {
//...
}
// bad
interface button_props {
//...
}
// bad
interface IButtonProps {
//...
}
// good
interface ButtonProps {
//...
}
// bad
type requestInfo = ...
// bad
type request_info = ...
// good
type RequestInfo = ...
```
##### Enums
```
// bad
enum buttonVariant {
//...
}
// good
enum ButtonVariant {
//...
}
```
#### Use `camelCase` for:
##### Functions
```typescript
// bad
constCalculatePercentage=()=>{...}
// bad
constcalculate_percentage=()=>{...}
// good
constcalculatePercentage=()=>{...}
```
##### Methods
```typescript
classDateCalculator{
// bad
CalculateTimeRange(){...}
}
classDateCalculator{
// bad
calculate_timee_range(){...}
}
classDateCalculator{
// good
calculateTimeRange(){...}
}
```
##### Variables
```typescript
// bad
constQueryTargets=[];
// bad
constquery_targets=[];
// good
constqueryTargets=[];
```
##### React state and properties
```typescript
interfaceModalState{
// bad
IsActive: boolean;
// bad
is_active: boolean;
// good
isActive: boolean;
}
```
##### Emotion class names
```typescript
constgetStyles==()=>({
// bad
ElementWraper: css`...`,
// bad
["element-wrapper"]:css`...`,
// good
elementWrapper: css`...`,
});
```
#### Use `ALL_CAPS` for constants.
```typescript
// bad
constconstantValue="This string won't change";
// bad
constconstant_value="This string won't change";
// good
constCONSTANT_VALUE="This string won't change";
```
#### Use [BEM](http://getbem.com/) convention for SASS styles.
_SASS styles are deprecated. Please migrate to Emotion whenever you need to modify SASS styles._
### File and directory naming conventions
Name files according to the primary export:
- When the primary export is a class or React component, use PascalCase.
- When the primary export is a function, use camelCase.
For files exporting multiple utility functions, use the name that describes the responsibility of grouped utilities. For example, a file exporting math utilities should be named `math.ts`.
- Use `constants.ts` for files exporting constants.
- Use `actions.ts` for files exporting Redux actions.
- Use `reducers.ts` Redux reducers.
- Use `*.test.ts(x)` for test files.
### Code organization
Organize your code in a directory that encloses feature code:
- Put Redux state and domain logic code in `state` directory (i.e. `features/my-feature/state/actions.ts`).
- Put React components in `components` directory (i.e. `features/my-feature/components/ButtonPeopleDreamOf.tsx`).
- Put test files next to the test subject.
- Put containers (pages) in feature root (i.e. `features/my-feature/DashboardPage.tsx`).
- Subcomponents can live in the component folders. Small component do not need their own folder.
- Component SASS styles should live in the same folder as component code.
For code that needs to be used by external plugin:
- Put components and types in `@grafana/ui`.
- Put data models and data utilities in `@grafana/data`.
- Put runtime services interfaces in `@grafana/runtime`.
#### Exports
- Use named exports for all code you want to export from a file.
- Use declaration exports (i.e. `export const foo = ...`).
- Export only the code that is meant to be used outside the module.
### Comments
- Use [TSDoc](https://github.com/microsoft/tsdoc) comments to document your code.
- Use [react-docgen](https://github.com/reactjs/react-docgen) comments (`/** ... */`) for props documentation.
- Use inline comments for comments inside functions, classes etc.
- Please try to follow the [code comment guidelines](./code-comments.md) when adding comments.
### Linting
Linting is performed using [@grafana/eslint-config](https://github.com/grafana/eslint-config-grafana).
## React
Use the following conventions when implementing React components:
### Props
##### Name callback props and handlers with an "on" prefix.
To reduce the amount of boilerplate code used to create a strongly typed redux solution with actions, action creators, reducers and tests we've introduced a small framework around Redux.
Grafana uses [Redux Toolkit](https://redux-toolkit.js.org/) to handle Redux boilerplate code.
> Some of our Reducers are used by Angular and therefore state is to be considered as mutable for those reducers.
`+` Much less boilerplate code
`-` Non Redux standard api
## New core functionality
### actionCreatorFactory
Used to create an action creator with the following signature
Sometimes you encounter a `resulting state` that contains properties that are hard to compare, such as `Dates`, but you still want to compare that other props in state are correct.
Then you can use `thenStatePredicateShouldEqual` function on `reducerTester` that will return the `resulting state` so that you can expect upon individual properties..
[Storybook](https://storybook.js.org/) is a tool which we use to manage our design system and the components which are a part of it. Storybook consists of _stories:_ each story represents a component and a case in which it is used. To show a wide variety of use cases is good both documentation wise and for troubleshooting -- it might be possible to reproduce a bug for an edge case in a story.
Storybook is:
- A good way to publish our design system with its implementations
- Used as a tool for documentation
- Used for debugging and displaying edge cases
## How to create stories
Stories for a component should be placed next to the component file. The Storybook file requires the same name as the component file. For example, a story for `SomeComponent.tsx` will have the file name `SomeComponent.story.tsx`.
### Writing stories
When writing stories, we use the [CSF format](https://storybook.js.org/docs/formats/component-story-format/). For more in-depth information on writing stories, see [Storybook’s documentation on writing stories](https://storybook.js.org/docs/basics/writing-stories/).
With the CSF format, the default export defines some general information about the stories in the file:
-`title`: Where the component is going to live in the hierarchy
-`decorators`: A list which can contain wrappers or provide context, such as theming
```jsx
// In MyComponent.story.tsx
importMyComponentfrom'./MyComponent';
exportdefault{
title:'General/MyComponent',
component:MyComponent,
decorators:[...],
}
```
When it comes to writing the actual stories, you continue in the same file with named exports. The exports are turned into the story name.
```jsx
// Will produce a story name “some story”
exportconstsomeStory=()=><MyComponent/>;
```
If you want to write cover cases with different values for props, then using knobs is usually enough. You don’t need to create a new story. This will be covered further down.
### Categorization
We currently have these categories:
- **Docs Overview** - Guidelines and information regarding the design system
- **Forms** - Components commonly used in forms such as different kind of inputs
- **General** - Components which can be used in a lot of different places
- **Visualizations** - Data visualizations
- **Panel** - Components belonging to panels and panel editors
## Writing MDX documentation
An MDX file is basically a markdown file with the possibility to add jsx. These files are used by Storybook to create a “docs” tab.
### Link the MDX file to a component’s stories
To link a component’s stories with an MDX file you have to do this:
```jsx
// In TabsBar.story.tsx
import{TabsBar}from"./TabsBar";
// Import the MDX file
importmdxfrom"./TabsBar.mdx";
exportdefault{
title:"General/Tabs/TabsBar",
component:TabsBar,
parameters:{
docs:{
// This is the reference required for the MDX file
page:mdx,
},
},
};
```
### MDX file structure
There are some things that the MDX file should contain:
- When and why the component should be used
- Best practices - dos and don’ts for the component
- Usage examples with code. It is possible to use the `Preview` element to show live examples in MDX
- Props table. This can be generated by doing the following:
```jsx
// In MyComponent.mdx
import{Props}from"@storybook/addon-docs/blocks";
import{MyComponent}from"./MyComponent";
<Propsof={MyComponent}/>;
```
### MDX file without a relationship to a component
An MDX file can exist by itself without any connection to a story. This can be good for writing things such as a general guidelines page. Something that is required when the MDX file has no relation to a component is a `Meta` tag that says where in the hierarchy the component will live. It can look like this:
```jsx
<Metatitle="Docs Overview/Color Palettes"/>
#Guidelinesforusingcolors
...
```
You can add parameters to the Meta tag. This example shows how to hide the tools:
A quick way to get an overview of what a component does is by looking at its properties. That's why it is important that we document these in a good way.
### Comments
When writing the props interface for a component, it is possible to add a comment to that specific property, which will end up in the Props table in the MDX file. The comments are generated by [react-docgen](https://github.com/reactjs/react-docgen) and are formatted by writing `/** */`.
```jsx
interfaceMyProps{
/** Sets the initial values, which are overridden when the query returns a value*/
defaultValues:Array<T>;
}
```
### Knobs
Knobs is an [addon to Storybook](https://github.com/storybookjs/storybook/tree/master/addons/knobs) which can be used to easily switch values in the UI. A good use case for it is to try different props for the component. Using knobs is easy. Grafana is set up so knobs can be used straight out of the box. Here is an example of how you might use it.
```jsx
// In MyComponent.story.tsx
import{number,text}from"@storybook/addon-knobs";
exportconstbasicStory=()=>(
<MyComponent
max={number("Max value",10)}
min={number("Min value",-10)}
title={text("Title","Look at the value!")}
/>
);
```
The general convention is that the first parameter of the knob is its name and the second is the default value. There are some more types:
[Emotion](https://emotion.sh/docs/introduction) is our default-to-be approach to styling React components. It provides a way for styles to be a consequence of properties and state of a component.
### Usage
## Usage
#### Basic styling
### Basic styling
For styling components use Emotion's `css` function
For styling components, use [Emotion's `css` function](https://emotion.sh/docs/emotion#css).
```tsx
import{css}from'emotion';
importReactfrom'react';
import{css}from'emotion';
constComponentA=()=>{
return(
<divclassName={css`background: red;`}>
Asredasyoucange
</div>
);
}
constComponentA=()=>(
<div
className={css`
background: red;
`}
>
Asredasyoucanget
</div>
);
```
#### Styling complex components
### Styling complex components
In more complex cases, especially when you need to style multiple DOM elements in one component or when your styles that depend on properties and/or state, you should create a helper function that returns an object with desired stylesheet. This function should also be wrapped in `stylesFactory` helper function that will provide basic memoization.
In more complex cases, especially when you need to style multiple DOM elements in one component, or when using styles that depend on properties and/or state, you should create a helper function that returns an object of styles. This function should also be wrapped in the `stylesFactory` helper function, which will provide basic memoization.
Let's say you need to style a component that has different background depending on the theme:
Let's say you need to style a component that has a different background depending on the theme:
**Themes are implemented in Typescript.** That's because our goal is to share variables between Grafana Typescript code and SASS files. Theme definitions are located in `packages/grafana-ui/src/themes/[default|dark|light].ts` files. `default.ts` file holds common variables like typography and spacing definitions, while `[light|dark].ts` primarily specify colors used in themes.
**Themes are implemented in Typescript.** That's because our goal is to share variables between Grafana TypeScript and [Sass](https://sass-lang.com/) code. Theme definitions are located in the following files:
// Your component has access to the theme variables now
}
```
#### Using `withTheme` higher-order component (HOC)
With this method your component will be automatically wrapped in `ThemeContext.Consumer` and provided with current theme via `theme` prop. Component used with `withTheme` must implement `Themeable` interface.
With this method your component will be automatically wrapped in `ThemeContext.Consumer` and provided with current theme via `theme` prop. Components used with `withTheme` must implement the `Themeable` interface.
When implementing snapshot tests for components that use the `withTheme` HOC, the snapshot will contain the entire theme object. Any change to the theme renders the snapshot outdated.
### Using themes in [Storybook](https://storybook.js.org/)
All stories are wrapped with `ThemeContext.Provider` using global decorator. To render `Themeable` component that's not wrapped by `withTheme` HOC you either create a new component in your story:
All stories are wrapped with `ThemeContext.Provider` using a global decorator. To render a `Themeable` component that isn't wrapped by a `withTheme` HOC, either create a new component in your story, or use the `renderComponentWithTheme` helper.
There should be very few cases where theme would be used in Angular context. For this purpose there is a function available that retrieves current theme:`import { getCurrentTheme } from app/core/utils/ConfigProvider`. Angular components should be migrated to React, or if that's not possible at the moment, styled using SASS.
There should be very few cases where a theme would be used in an Angular context. For this purpose, there is a function available that retrieves the current theme:
Angular components should be migrated to React, or if that's not possible at the moment, styled using Sass.
## FAQ
### How can I modify SASS variable files?
This section provides insight into frequently-asked questions.
### How can I modify Sass variable files?
> For the following to apply you need to run `yarn dev` task.
`[_variables|_variables.dark|_variables.light].generated.scss` files are the ones that are referenced in the main SASS files for SASS variables to be available. **These files are automatically generated and should never be modified by hand!**.
`[_variables|_variables.dark|_variables.light].generated.scss` files are the ones that are referenced in the main Sass files for Sass variables to be available. **These files are automatically generated and should never be modified by hand!**
#### If you need to modify *SASS variable value* you need to modify corresponding Typescript file that is a source of the variables:
#### If you need to modify a *Sass variable value* you need to modify the corresponding Typescript file that is the source of the variables:
### You must ensure ThemeContext provider is available in a React tree
By default all react2angular directives have `ThemeContext.Provider` ensured. But, there are cases where we create another React tree via `ReactDOM.render`. This happens in case of graph legend rendering and `ReactContainer` directive. In such cases theme consumption will fail. To make sure theme context is available in such cases, you need to wrap your rendered component with ThemeContext.Provider using `provideTheme` function:
This section describes limitations with Grafana's theming system.
### You must ensure `ThemeContext` provider is available in a React tree
By default all react2angular directives have `ThemeContext.Provider` ensured. But, there are cases where we create another React tree via `ReactDOM.render`. This happens in the case of graph legend rendering and the `ReactContainer` directive. In such cases theme consumption will fail. To make sure theme context is available in such cases, you need to wrap your rendered component with ThemeContext.Provider using the `provideTheme` function:
Templates are both a starting point and an instruction manual for writing something new. They are intended to make life easier by providing a jumping-off point, something besides a blank page to start from. They are not intended to be a limitation. If the template does not work perfectly for your use case, you can adjust or change it. We will work it out in code review.
## Create a template
Feel free to add templates to the `templates` folder. Try to make them as generic as possible and include clear instructions for when and how to use the template. Assume that the template user is a brand new contributor and write accordingly.
## Use a template
1. Read the template. Make sure you understand what it is for and how it is intended to be used.
1. Copy and rename the template. Move it to where you actually need it.
You might also want to copy the content of the template and paste it into a different file. This is acceptable use.
1. Replace the template content with your own. Delete whatever is unnecessary.
## Documentation templates
In an ideal world, each topic will correspond to an information *type* ([task](doc-task-template.md), [reference](doc-reference-template.md), [concept](doc-concept-template.md)) and contain only that type of information.
However, this is not always practical. For example, you have a series of short topics, you can group them into one topic.
Try to *chunk* your content. This means you should organize the document so that the same kinds of content are grouped together.
### Chunking example
If I was writing a topic called *Doggie handbook*, I might organize it like this.
**Concept**
* What a dog is
* Brief history of dogs
* Why you might want a dog
* Tasks dogs can be trained to do
**Tasks**
* Feed the dog
* Groom the dog
* Train the dog
**Reference**
* List of dog equipment you will need
* Table of breeds that includes breed name, size range, short or long hair, and type of dog
### Audience
Write for an audience that is computer literate and has general technical knowledge, but is not necessarily familiar with Grafana or the finer points of observability.
Pretend you are explaining your topic to a brand new Grafana user or developer.
### Self-contained
Thanks to search engines, every page in the documentation might be a reader's entry point. This means that each page needs to be self-contained and make sense on its own. The reader should not need to read other topics in order to perform the task or understand the concept.
However, try to be helpful and link to related information. Using the *Doggie handbook* example, the concept topic that explains what dogs can be trained to do might link to the Train the dog task.
DELETE THIS LINE: If draft = false, then the document will not be built in the doc site. If the date is earlier than the build date, than the document will not show in the build site. Use these settings to control whether future content is shown in the doc site.
The title of the concept topic will generally be a noun or a gerund. Examples include Templates, Templating, Dashboards, and panels.
Concepts are topic types for any information that doesn't involve task lists or reference information. Ideally you use concept elements to explain concepts, ideas, overviews, workflows, and the like. In the intro section, this first paragraph or two, you should explain to the user what to expect in this topic or section.
[Permissions overview](https://grafana.com/docs/grafana/latest/permissions/overview/) is an example of a concept topic.
## Idea
Concept topics or sections explain *what* and *why*. They do not explain *how*. If you are a new user, you might look for concept information to learn about what Grafana is, why it might be useful to you, and what the general workflow is.
## Workflow
Continuing the example in the previous section, here is a sample Grafana workflow.
1. Install Grafana. <link to task for installing Grafana>
2. Set up data sources. <link to data sources concept topic, which links to data source task topics>
3. Create panels. <link to panel concept topic, which links to tasks>
4. Create dashboards. <link to panel concept topic, which links to tasks>
5. Enter queries. <link to query editor concept topic>
6. Add users. <link to user management concept topic, which links to tasks>
7. Create playlists. <link to Playlist topic that contains concept information and tasks>
## Next steps
Concept tasks often link to related information, including *tasks* related to the concept and *reference* topics related to the concept.
DELETE THIS LINE: If draft = false, then the document will not be built in the doc site. If the date is earlier than the build date, than the document will not show in the build site. Use these settings to control whether future content is shown in the doc site.
The *reference* topic type is for storing reference information, such as extensive tables, lists, or other information that is used as support for a task. Reference topics are also designed for API information.
Often reference topics are linked from *task* topics, because they contain information the user needs in order to perform a task.
[Grafana CLI](https://grafana.com/docs/grafana/latest/administration/cli/) is one example of a reference topic.
## Lists
Lists of commands or parameters are often organized in reference topics. The information you need to present will dictate the format.
* They might
* be in
* unordered lists.
[Configuration](https://grafana.com/docs/grafana/latest/installation/configuration/) is an example of lists.
## Tables
If you have a large list of things to store in a table, then you are probably dealing with reference information. Hugo accepts either tables in Markdown or in HTML format, so use whichever is easier for you.
The [Glossary](https://grafana.com/docs/grafana/latest/guides/glossary/) provides an example of reference data in a table.
### Empty markdown table
While you might not need a heading for each table, headings are a good way to chunk information if you have several tables. They also make the content easy to skim. Use headings or intro paragraphs like this one to explain to the reader what the information in the table is used for.
| | | | | | |
|:---|:---|:--:|:--:|---:|---:|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
### Empty HTML table
And here is intro text, similar to the paragraph in the previous section. Do not add local styling to the table. The website CSS will take care of that for you.
<table>
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
</table>
## API documentation
API documentation is always a reference topic rather than a task topic, but it has its own rules.
A *task* topic is intended for a procedure that describes how to accomplish a task. It lists a series of steps that users follow to produce an intended outcome. It tells the reader *how* to do something. [Install Grafana plugins](https://grafana.com/docs/grafana/latest/plugins/installation/) and [Playlist](https://grafana.com/docs/grafana/latest/reference/playlist/) are examples of task topics. Playlist includes a small amount of concept information in the introduction, which is appropriate.
Always include an introduction of a short paragraph or two to explain what the task is for, perhaps give the reader an idea of what the outcome will be.
In most cases, each topic should only contain one task. If you have several very short, related tasks, then you might combine them into one topic.
In the case of a long task, then you probably won't need any headings except for the h1 at the top of the page.
1. Start with step one.
1. Use second-person imperative tense.
1. Basically, "You, do this" with every sentence.
1. Do not use the third-person "user" for steps you want the reader ("you") to perform.
1. Write steps that contain one action, possibly two related actions, such as copy and paste a thing or save and quite the program.
If a sentence is not telling the reader to do something, then it is not a step. You can use nested images or paragraphs like this one to add information if necessary.
In many cases, you should tell the reader what the outcome should be so that they know when they are done.
## One-step task
Some tasks are so short, they only contain one step.
Write one-step tasks as simple sentences, not as unordered lists or numbered lists.
## Short task
Short tasks can be grouped. How short constitutes "short" is a judgment call based on number of steps and how long individual steps are.
1. Use your judgment.
2. Ask your coworkers or someone on the Comm team for advice if you aren't sure.
## Next steps
If the task you are writing leads naturally to one or more other tasks, then include links after the task to help the reader figure out where to go next.
Thanks to internet search engines, every page in the documentation could be page one. Pretend you are explaining your task to a new Grafana user who just walked in off the street.
## Testing
It is a good practice to have someone else test the task you have written. If they can successfully complete the task using *only* what the steps you have written, not guessing or using their inherent knowledge, then your task has passed the test. However, it is very common to find you have skipped steps, because *you* are very familiar with Grafana and the topic you are explaining.
New users or people from other teams are very helpful for these tests.
"rawQuery":"SELECT TOP 1\n createdAt as time,\n 'single' as text,\n hostname as tags\nFROM\n grafana_metric\nWHERE\n $__timeFilter(createdAt)\nORDER BY time\n",
"showIn":0,
"tags":[],
"type":"tags"
},
{
"datasource":"gdev-mssql",
"enable":false,
"hide":false,
"iconColor":"rgba(0, 211, 255, 1)",
"limit":100,
"name":"Region",
"rawQuery":"SELECT TOP 1\n DATEADD(MINUTE, 1, createdAt) as time,\n DATEADD(MINUTE, 6, createdAt) as timeend,\n 'region' as text,\n hostname as tags\nFROM\n grafana_metric\nWHERE\n $__timeFilter(createdAt)\nORDER BY time",
"rawQuery":"SELECT\n createdAt as time,\n 'single' as text,\n hostname as tags\nFROM\n grafana_metric\nWHERE\n $__timeFilter(createdAt)\nORDER BY time\nLIMIT 1\n",
"showIn":0,
"tags":[],
"type":"tags"
},
{
"datasource":"gdev-mysql",
"enable":false,
"hide":false,
"iconColor":"rgba(0, 211, 255, 1)",
"limit":100,
"name":"Region",
"rawQuery":"SELECT\n ADDTIME(createdAt, '00:01:00') as time,\n ADDTIME(createdAt, '00:06:00') as timeend,\n 'region' as text,\n hostname as tags\nFROM\n grafana_metric\nWHERE\n $__timeFilter(createdAt)\nORDER BY time\nLIMIT 1\n",
"rawQuery":"SELECT\n \"createdAt\" as time,\n 'single' as text,\n hostname as tags\nFROM\n grafana_metric\nWHERE\n $__timeFilter(\"createdAt\")\nORDER BY time\nLIMIT 1\n",
"showIn":0,
"tags":[],
"type":"tags"
},
{
"datasource":"gdev-postgres",
"enable":false,
"hide":false,
"iconColor":"rgba(0, 211, 255, 1)",
"limit":100,
"name":"Region",
"rawQuery":"SELECT\n \"createdAt\" + (interval '1 minute') as time,\n \"createdAt\" + (6 * interval '1 minute') as timeend,\n 'region' as text,\n hostname as tags\nFROM\n grafana_metric\nWHERE\n $__timeFilter(\"createdAt\")\nORDER BY time\nLIMIT 1\n",
"showIn":0,
"tags":[],
"type":"tags"
}
]
},
@@ -16,7 +40,7 @@
"editable":true,
"gnetId":null,
"graphTooltip":0,
"iteration":1532620601931,
"iteration":1576249087264,
"links":[],
"panels":[
{
@@ -28,12 +52,14 @@
"dashes":false,
"datasource":"gdev-postgres",
"fill":2,
"fillGradient":0,
"gridPos":{
"h":9,
"w":12,
"x":0,
"y":0
},
"hiddenSeries":false,
"id":2,
"legend":{
"avg":false,
@@ -48,6 +74,9 @@
"linewidth":2,
"links":[],
"nullPointMode":"null",
"options":{
"dataLinks":[]
},
"percentage":false,
"pointradius":5,
"points":false,
@@ -67,20 +96,59 @@
{
"alias":"",
"format":"time_series",
"group":[],
"hide":false,
"metricColumn":"none",
"rawQuery":true,
"rawSql":"SELECT\n $__timeGroup(\"createdAt\",'$summarize'),\n avg(value) as \"value\",\n hostname as \"metric\"\nFROM \n grafana_metric\nWHERE\n $__timeFilter(\"createdAt\") AND\n measurement = 'logins.count' AND\n hostname IN($host)\nGROUP BY time, metric\nORDER BY time",
"refId":"A",
"target":""
"select":[
[
{
"params":["value"],
"type":"column"
}
]
],
"target":"",
"timeColumn":"time",
"where":[
{
"name":"$__timeFilter",
"params":[],
"type":"macro"
}
]
},
{
"alias":"",
"format":"time_series",
"group":[],
"metricColumn":"none",
"rawQuery":true,
"rawSql":"SELECT\n $__timeGroup(\"createdAt\",'$summarize'),\n min(value) as \"value\",\n 'total avg' as \"metric\"\nFROM \n grafana_metric\nWHERE\n $__timeFilter(\"createdAt\") AND\n measurement = 'logins.count'\nGROUP BY time\nORDER BY time",
docker run -v $(PWD)/sources:/hugo/content/docs/grafana/latest -p 3002:3002 --rm -it grafana/docs-base:latest /bin/bash -c 'npm i && make webpack && make docs-menu && hugo server -p 3002 -D --ignoreCache --baseUrl http://localhost:3002 --bind 0.0.0.0'
DOCKER_DOCS_IMAGE:= grafana/grafana-docs
SOURCES_HOST_DIR:="$(shell pwd)/sources"
docs-no-pull:
docker run -v $(PWD)/sources:/hugo/content/docs/grafana/latest -p 3002:3002 --rm -it grafana/docs-base:latest /bin/bash -c 'make docs-menu && hugo server -p 3002 -D --ignoreCache --baseUrl http://localhost:3002 --bind 0.0.0.0'
# assuming grafana and grafana.org-repo to be checked out in the same folder
We are currently working on migrating the docs to a new static website. The `grafana/website` repository will be private during this migration, which unfortunately means the docs site can't be built without access.
When you contribute to documentation, it is a good practice to build the docs on your local machine to make sure your changes appear as you expect. This README explains the process for doing that.
The Markdown content however, is still public in this repository. We still encourage pull requests to make the docs better, and we will make sure the changed content works well on the current docs site. Include any images in your pull request, and we will move them to the `grafana/website` repository.
## Requirements
# Building the docs
Docker >= 2.1.0.3
To build the docs locally, you need to have Docker installed. The docs are built using [Hugo](http://gohugo.io/) - a static site generator.
## Build the doc site
**Prepare the Docker image**:
1. In the command line, make sure you are in the docs folder: `cd docs`.
2. Run `make docs`. This launches a preview of the docs website at `http://localhost:3002/docs/grafana/latest/` which will refresh automatically when changes to content in the `sources` directory are made.
> Due to migration to new static site, the Docker image needs to be built from `old-docs` branch.
---
Git clone `grafana/website` repo. Run these commands in the root of that repo. **Note** that you may require `sudo`
when running `make docs-build` depending on how your system's Docker
service is configured):
## Content guidelines
```
git clone https://github.com/grafana/website
cd website
make docs-build
```
Edit content in the `sources` directory.
**Build the Documentation**:
### Using `relref` for internal links
Now that the Docker image has been prepared we can build the
grafana docs and start a docs server.
Use the Hugo shortcode [relref](https://gohugo.io/content-management/cross-references/#use-ref-and-relref) any time you are linking to other internal docs pages.
If you have not cloned the Grafana repository already then:
### Edit the side menu
```
cd ..
git clone https://github.com/grafana/grafana
```
Edit [sources/menu.yaml](sources/menu.yaml) to make changes to the sidebar. Stop and rerun the `make docs` command for changes to take effect.
Switch your working directory to the directory this file
(README.md) is in.
### Add images
```
cd grafana/docs
```
Images are currently hosted in the grafana/website repo.
An AWS config file is required to build the docs Docker image and to publish the site to AWS. If you are building locally only and do not have any AWS credentials for docs.grafana.org then create an empty file named `awsconfig` in the current directory.
---
```
touch awsconfig
```
## Deploy changes to grafana.com
Then run (possibly with `sudo`):
When a PR is merged to master with changes in the `docs` directory, those changes are automatically synched to the grafana/website repo on the `docs-grafana` branch.
```
make watch
```
This command will not return control of the shell to the user. Instead
the command is now running a new Docker container built from the image
we created in the previous step.
Open [localhost:3004](http://localhost:3004) to view the docs.
### Images and Content
All markdown files are part of [this repository](https://github.com/grafana/grafana). However, all images are added to the [website repository](https://github.com/grafana/website). Therefore, the process of adding images is not as straightforward. These are the steps:
1. Ensure you create a feature branch within the [website repository](https://github.com/grafana/website) to make the change. This branch needs to be based on the `old-docs` branch.
1. Ensure the image(s) are compressed and optimised e.g. Using [tinypng](https://tinypng.com/).
1. Add the image(s) to the `/static/img/docs` directory.
1. Then, make a commit that adds the image(s).
1. The Pull Request you create needs to target where you branched off, the branch `old-docs`.
Finally, run:
```
make docs-build
```
This will rebuild the docs Docker image.
To be able to use your image(s) you have to quit (Ctrl+C) the `make watch` command (that you run in the same directory as this README). Then simply rerun `make watch`, it will restart the docs server but now with access to your image(s).
### Editing content
Changes to the markdown files should automatically cause a docs rebuild and live reload should reload the page in your browser.
### Troubleshooting
#### Running `make watch` errors out with `Warning: Task "default" not found.`
Ensure that the Docker image from the [website repository](https://github.com/grafana/website) is built using the `old-docs` branch.
In order to make those changes live, open a PR in the website repo that merges the `docs-grafana` branch into `master`. Then follow the publishing guidelines in that repo.
Grafana CLI allows you to temporarily override certain Grafana default settings. Except for `--help` and `--version`, most global options are only used by developers.
Each global option applies only to the command in which it is used. For example, `--pluginsDir value` does not permanently change where Grafana saves plugins. It only changes it for command in which you apply the option.
### Display Grafana CLI help
`--help` or `-h` displays the help, including default paths and Docker configuration information.
**Example:**
```bash
grafana-cli -h
```
### Display Grafana CLI version
`--version` or `-v` prints the version of Grafana CLI currently running.
**Example:**
```bash
grafana-cli -v
```
### Override default plugin directory
`--pluginsDir value` overrides the path to where your local Grafana instance stores plugins. Use this option if you want to install, update, or remove a plugin somewhere other than the default directory ("/var/lib/grafana/plugins") [$GF_PLUGIN_DIR].
**Warning:** Turning off TLS is a significant security risk. We do not recommend using this option.
`--insecure` allows you to turn off Transport Layer Security (TLS) verification (insecure). You might want to do this if you are downloading a plugin from a non-default source.
`--debug` or `-d` enables debug logging. Debug output is returned and shown in the terminal.
**Example:**
```bash
grafana-cli --debug plugins install <plugin-id>
```
### Override a configuration setting
`--configOverrides` is a command line argument that acts like an environmental variable override.
For example, you can use it to redirect logging to another file (maybe to log plugin installs in a service like Hosted Grafana) or when resetting the admin password and you have non-default values for some important config value (like where the database is located).
Sets the path for the Grafana install/home path, defaults to working directory. You do not need to use this if you are in the Grafana installation directory when using the CLI.
`--config value` overrides the default location where Grafana expects the configuration file. Refer to [Configuration]({{< relref "../installation/configuration.md" >}}) for more information about configuring Grafana and default configuration file locations.
Grafana CLI allows you to install, upgrade, and manage your Grafana plugins. For more information about installing plugins, refer to [plugins page]({{< relref "../plugins/installation.md" >}}).
All listed commands apply to the Grafana default repositories and directories. You can override the defaults with [Global Options](#global-options).
### List available plugins
```bash
grafana-cli plugins list-remote
```
### Install the latest version of a plugin
```bash
grafana-cli plugins install <plugin-id>
```
### Install a specific version of a plugin
```bash
grafana-cli plugins install <plugin-id> <version>
```
### List installed plugins
```bash
grafana-cli plugins ls
```
### Update all installed plugins
```bash
grafana-cli plugins update-all
```
### Update one plugin
```bash
grafana-cli plugins update <plugin-id>
```
### Remove one plugin
```bash
grafana-cli plugins remove <plugin-id>
```
## Admin commands
Admin commands are only available in Grafana 4.1 and later.
### Show all admin commands
```bash
grafana-cli admin
```
### Reset admin password
You can reset the password for the admin user using the CLI. The use case for this command is when you have lost the admin password.
`grafana-cli admin reset-admin-password <new password>` resets the password for the admin user using the CLI. You might need to do this if you lose the admin password.
`grafana-cli admin reset-admin-password ...`
If there are two flags being used to set the homepath and the config file path, then running the command returns this error:
If running the command returns this error:
> Could not find config defaults, make sure homepath command line parameter is set or working directory is homepath
> Could not find config defaults, make sure homepath command line parameter is set or working directory is homepath
then there are two flags that can be used to set homepath and the config file path.
If you have not lost the admin password then it is better to set in the Grafana UI. If you need to set the password in a script then the [Grafana API](http://docs.grafana.org/http_api/user/#change-password) can be used. Here is an example using curl with basic auth:
To correct this, use the `--homepath` global option to specify the Grafana default homepath for this command:
```bash
curl -X PUT -H "Content-Type: application/json" -d '{
If you have not lost the admin password, we recommend that you change the user password either in the User Preferences or in the Server Admin > User tab.
If you need to set the password in a script, then you can use the [Grafana User API]({{< relref "../http_api/user.md#change-password" >}}).
### Migrate data and encrypt passwords
`data-migration` runs a script that migrates or cleans up data in your database.
`encrypt-datasource-passwords` migrates passwords from unsecured fields to secure_json_data field. Returns `ok` unless there is an error. Safe to execute multiple times.
Grafana supports rendering of panels and dashboards as PNG-images.
Grafana supports automatic rendering of panels and dashboards as PNGimages. This allows Grafana to automatically generate images of your panels to include in [alert notifications]({{< relref "../alerting/notifications.md" >}}).
When an image is being rendered the PNG-image is temporary written to the filesystem, i.e. a sub-directory of Grafana's [data](/installation/configuration/#data) directory named `png`.
When an image is being rendered the PNG-image is temporarily written to the filesystem. When an image is rendered, the PNG image is temporary written to the `png` folder in the Grafana `data` folder.
A background job runs each 10 minutes and will remove temporary images. You can configure how long time an image should be stored before being removed by configuring the [temp-data-lifetime](/installation/configuration/#temp-data-lifetime) setting.
A background job runs every 10 minutes and removes temporary images. You can configure how long an image should be stored before being removed by configuring the [temp-data-lifetime]({{< relref "../installation/configuration/#temp-data-lifetime" >}}) setting.
## Requirements
You can also render a PNG by clicking the dropdown arrow next to a panel title, then clicking **Share > Direct link rendered image**.
Rendering images may require quite a lot of memory, mainly because there are "browser instances" started in the
background responsible for the actual rendering. Further, if multiple images are being rendered in parallel it most
certainly has a bigger memory footprint. Minimum free memory recommendation is 1GB.
## Memory requirements
Depending on [rendering method](#rendering-methods) you would need that memory available in the system where the
rendering process is running. For [Grafana Image renderer plugin](#grafana-image-renderer-plugin) and [PhantomJS](#phantomjs)
it's the system which Grafana is installed on. For [Remote rendering service](#remote-rendering-service) it is the system where
that's installed.
Minimum free memory recommendation is 16GB on the system doing therendering.
## Rendering methods
Rendering images can require a lot of memory, mainly because Grafana creates browser instances in the background for the actual rendering. If multiple images are rendered in parallel, then the rendering has a bigger memory footprint. One advantage of using the remote rendering service is that the rendering will be done on the remote system, so your local system resources will not be affected by rendering.
### Grafana image renderer plugin
## Alerting and render limits
> This plugin currently does not work if it is installed in the Grafana docker image. See [Install in Grafana docker image](#install-in-grafana-docker-image).
Alert notifications can include images, but rendering many images at the same time can overload the server where the renderer is running. For instructions of how to configure this, see [concurrent_render_limit]({{< relref "../installation/configuration/#concurrent_render_limit" >}}).
The [Grafana image renderer plugin](https://grafana.com/grafana/plugins/grafana-image-renderer) is a plugin that runs on the backend and handles rendering panels and dashboards as PNG-images using headless chrome.
## Install Grafana Image Renderer plugin
You can install it using grafana-cli:
The [Grafana image renderer plugin](https://grafana.com/grafana/plugins/grafana-image-renderer) is a plugin that runs on the backend and handles rendering panels and dashboards as PNG images using headless Chrome.
To install the plugin, refer to the [Grafana Image Renderer Installation instructions](https://grafana.com/grafana/plugins/grafana-image-renderer/installation).
For further information and instructions refer to [troubleshooting](#troubleshooting) and the [plugin details](https://grafana.com/grafana/plugins/grafana-image-renderer).
## Run in custom Grafana Docker image
#### Install in Grafana docker image
We recommend setting up another Docker container for rendering and using remote rendering. Refer to [Remote rendering service]({{< relref "#remote-rendering-service" >}}) for instructions.
This plugin is not compatible with the current Grafana Docker image without installing further system-level dependencies. We recommend setting up another Docker container for rendering and using remote rendering, see [Remote rendering service](#remote-rendering-service) for reference.
If you still want to install the plugin in the Grafana Docker image, refer to [Build with Grafana Image Renderer plugin pre-installed]({{< relref "../installation/docker/#build-with-grafana-image-renderer-plugin-pre-installed" >}}).
If you still want to install the plugin in the Grafana docker image we provide instructions for how to build a custom Grafana image, see [Installing using Docker](/installation/docker/#custom-image-with-grafana-image-renderer-plugin-pre-installed).
## Remote rendering service
### Remote rendering service
> Requires an internet connection.
The [Grafana image renderer plugin](https://grafana.com/grafana/plugins/grafana-image-renderer) can also be run as a remote HTTP rendering service. In this setup Grafana will render an image by making a HTTP request to the remote rendering service, which in turn render the image and returns it back in the HTTP response to Grafana.
The [Grafana Image Renderer plugin](https://grafana.com/grafana/plugins/grafana-image-renderer) can also be run as a remote HTTP rendering service. In this setup, Grafana renders an image by making a HTTP request to the remote rendering service, which in turn renders the image and returns it back in the HTTP response to Grafana.
You can run the remote HTTP rendering service using Docker or as a standalone Node.js application.
**Using Docker:**
### Run in Docker
The following example describes how to run Grafana and the remote HTTP rendering service in two separate docker containers using Docker Compose.
The following example shows how to run Grafana and the remote HTTP rendering service in two separate Docker containers using Docker Compose.
Create a `docker-compose.yml` with the following content.
Create a `docker-compose.yml` with the following content:
```yaml
version:'2'
@@ -80,54 +72,45 @@ services:
- 8081
```
and finally run:
And then run:
```bash
docker-compose up
```
**Running as standalone Node.js application:**
## Run as standalone Node.js application
The following example describes how to build and run the remote HTTP rendering service as a standalone node.js application and configure Grafana appropriately.
The following example describes how to build and run the remote HTTP rendering service as a standalone Node.js application and configure Grafana appropriately.
1.Git clone the [Grafana image renderer plugin](https://grafana.com/grafana/plugins/grafana-image-renderer) repository.
1.Clone the [Grafana image renderer plugin](https://grafana.com/grafana/plugins/grafana-image-renderer) Git repository.
2. Install dependencies and build:
```bash
yarn install --pure-lockfile
yarn run build
```
3. Run the server
```bash
yarn install --pure-lockfile
yarn run build
```
```bash
node build/app.js server --port=8081
```
3. Update Grafana configuration:
3. Run the server:
```
[rendering]
server_url = http://localhost:8081/render
callback_url = http://localhost:3000/
```
4. Restart Grafana
```bash
node build/app.js server --port=8081
```
For further information and instructions refer to [troubleshooting](#troubleshooting) and the [plugin details](https://grafana.com/grafana/plugins/grafana-image-renderer).
4. Update Grafana configuration:
### PhantomJS
```
[rendering]
server_url = http://localhost:8081/render
callback_url = http://localhost:3000/
```
> PhantomJS is deprecated since Grafana v6.4 and will be removed in a future release. Please migrate to Grafana image renderer plugin or remote rendering service.
5. Restart Grafana.
[PhantomJS](https://phantomjs.org/) have been the only supported and default image renderer since Grafana v2.x and is shipped with Grafana.
## PhantomJS
PhantomJS binaries are included for Linux (x64), Windows (x64) and Darwin (x64). For Linux you should ensure that any required libraries, e.g. libfontconfig1, are available.
> PhantomJS is deprecated since Grafana v6.4 and will be removed in a future release. Please migrate to the Grafana Image Renderer plugin or remote rendering service.
Please note that PhantomJS binaries are not included for ARM. To support this you will need to ensure that a phantomjs binary is available under tools/phantomjs/phantomjs.
## Alerting and render limits
Alert notifications can include images, but rendering many images at the same time can overload the server where the renderer is running. For instructions of how to configure this, see [concurrent_render_limit](/installation/configuration/#concurrent-render-limit).
## Troubleshooting
## Troubleshoot image rendering
Enable debug log messages for rendering in the Grafana configuration file and inspect the Grafana server log.
@@ -147,19 +130,19 @@ error while loading shared libraries: libX11.so.6: cannot open shared object fil
```
In general you can use the [`ldd`](https://en.wikipedia.org/wiki/Ldd_(Unix)) utility to figure out what shared libraries
### Certificate signed by internal certificate authorities
In many cases Grafana, runs on internal servers and uses certificates that have not been signed by a CA ([Certificate Authority](https://en.wikipedia.org/wiki/Certificate_authority)) known to Chrome, and therefore cannot be validated. Chrome internally uses NSS ([Network Security Services](https://en.wikipedia.org/wiki/Network_Security_Services)) for cryptogtraphic operations such as the validation of certificates.
If you are using the Grafana Image Renderer with a Grafana server that uses a certificate signed by such a custom CA (for example a company-internal CA), rendering images will fail and you will see messages like this in the Grafana log:
(The severity-level `error` in the above messages might be misspelled with a single `r`)
If this happens, then you have to add the certificate to the trust store. If you have the certificate file for the internal root CA in the file `internal-root-ca.crt.pem`, then use these commands to create a user specific NSS trust store for the Grafana user (`grafana` for the purpose of this example) and execute the following steps:
As a last resort, if you already have [Chrome](https://www.google.com/chrome/) or [Chromium](https://www.chromium.org/)
installed on your system you can configure [Grafana Image renderer plugin](#grafana-image-renderer-plugin) to use this
installed on your system, then you can configure [Grafana Image renderer plugin](#grafana-image-renderer-plugin) to use this
instead of the pre-packaged version of Chromium.
> Please note that this is not recommended since you may encounter problems if the installed version of Chrome/Chromium is not
> is compatible with the [Grafana Image renderer plugin](#grafana-image-renderer-plugin).
> Please note that this is not recommended, since you may encounter problems if the installed version of Chrome/Chromium is not
> compatible with the [Grafana Image renderer plugin](#grafana-image-renderer-plugin).
To override the path to the Chrome/Chromium executable you can set an environment variable and make sure that
it's available for the Grafana process, e.g.
To override the path to the Chrome/Chromium executable, set an environment variable and make sure that it's available for the Grafana process. For example:
Secure json data is a map of settings that will be encrypted with [secret key](/installation/configuration/#secret-key) from the Grafana config. The purpose of this is only to hide content from the users of the application. This should be used for storing TLS Cert and password that Grafana will append to the request on the server side. All of these settings are optional.
Secure json data is a map of settings that will be encrypted with [secret key]({{< relref "../installation/configuration/#secret-key" >}}) from the Grafana config. The purpose of this is only to hide content from the users of the application. This should be used for storing TLS Cert and password that Grafana will append to the request on the server side. All of these settings are optional.
| Name | Type | Datasource | Description |
| ----| ---- | ---- | --- |
@@ -253,9 +253,9 @@ Note: The JSON definition in the input field when using `Copy JSON to Clipboard`
If the dashboard in the json file contains an [uid](/reference/dashboard/#json-fields), Grafana will force insert/update on that uid. This allows you to migrate dashboards betweens Grafana instances and provisioning Grafana from configuration without breaking the urls given since the new dashboard url uses the uid as identifier.
If the dashboard in the json file contains an [uid](/reference/dashboard/#json-fields), Grafana will force insert/update on that uid. This allows you to migrate dashboards betweens Grafana instances and provisioning Grafana from configuration without breaking the URLs given since the new dashboard URL uses the uid as identifier.
When Grafana starts, it will update/insert all dashboards available in the configured folders. If you modify the file, the dashboard will also be updated.
By default Grafana will delete dashboards in the database if the file is removed. You can disable this behavior using the `disableDeletion` setting.
@@ -270,7 +270,7 @@ Alert Notification Channels can be provisioned by adding one or more yaml config
Each config file can contain the following top-level fields:
-`notifiers`, a list of alert notifications that will be added or updated during start up. If the notification channel already exists, Grafana will update it to match the configuration file.
-`delete_notifiers`, a list of alert notifications to be deleted before before inserting/updating those in the `notifiers` list.
-`delete_notifiers`, a list of alert notifications to be deleted before inserting/updating those in the `notifiers` list.
Provisioning looks up alert notifications by uid, and will update any existing notification with the provided uid.
@@ -348,10 +348,12 @@ The following sections detail the supported settings for each alert notification
| url |
| recipient |
| username |
| iconEmoji |
| iconUrl |
| icon_emoji |
| icon_url |
| uploadImage |
| mention |
| mentionUsers |
| mentionGroups |
| mentionChannel |
| token |
#### Alert notification `victorops`
@@ -430,6 +432,7 @@ The following sections detail the supported settings for each alert notification
| apiKey |
| apiUrl |
| autoClose |
| overridePriority |
#### Alert notification `telegram`
@@ -437,6 +440,7 @@ The following sections detail the supported settings for each alert notification
> Alerting is only available in Grafana v4.0 and above.
The alert engine publishes some internal metrics about itself. You can read more about how Grafana publishes [internal metrics](/installation/configuration/#metrics).
The alert engine publishes some internal metrics about itself. You can read more about how Grafana publishes [internal metrics]({{< relref "../administration/metrics/" >}}).
@@ -40,7 +40,7 @@ When checked, this option will notify for all alert rules - existing and new.
When this option is checked additional notifications (reminders) will be sent for triggered alerts. You can specify how often reminders
should be sent using number of seconds (s), minutes (m) or hours (h), for example `30s`, `3m`, `5m` or `1h` etc.
**Important:** Alert reminders are sent after rules are evaluated. Therefore a reminder can never be sent more frequently than a configured [alert rule evaluation interval](/alerting/rules/#name-evaluation-interval).
**Important:** Alert reminders are sent after rules are evaluated. Therefore a reminder can never be sent more frequently than a configured [alert rule evaluation interval]({{< relref "rules/#name-evaluation-interval" >}}).
These examples show how often and when reminders are sent for a triggered alert.
@@ -65,7 +65,7 @@ Grafana ships with the following set of notification types:
### Email
To enable email notifications you have to setup [SMTP settings](/installation/configuration/#smtp)
To enable email notifications you have to setup [SMTP settings]({{< relref "../installation/configuration/#smtp" >}})
in the Grafana config. Email notifications will upload an image of the alert graph to an
external image destination if available or fallback to attaching the image to the email.
Be aware that if you use the `local` image storage email servers and clients might not be
To set up slack you need to configure an incoming webhook url at slack. You can follow their guide on how
to do that [here](https://api.slack.com/incoming-webhooks). If you want to include screenshots of the firing alerts
in the Slack messages you have to configure either the [external image destination](#external-image-store) in Grafana,
or a bot integration via Slack Apps. Follow Slack's guide to set up a bot integration and use the token provided
(https://api.slack.com/bot-users), which starts with "xoxb".
To set up Slack, you need to configure an incoming Slack webhook URL. You can follow
[their guide](https://api.slack.com/incoming-webhooks) on how to do that. If you want to include screenshots of the
firing alerts in the Slack messages you have to configure either the [external image destination](#external-image-store)
in Grafana, or a bot integration via Slack Apps. Follow Slack's guide to set up a bot integration and use the token
provided (https://api.slack.com/bot-users), which starts with "xoxb".
Setting | Description
---------- | -----------
Url | Slack incoming webhook url.
Url | Slack incoming webhook URL.
Username | Set the username for the bot's message.
Recipient | Allows you to override the Slack recipient.
Recipient | Allows you to override the Slack recipient. You must either provide a channel Slack ID, a user Slack ID, a username reference (@<user>, all lowercase, no whitespace), or a channel reference (#<channel>, all lowercase, no whitespace).
Icon emoji | Provide an emoji to use as the icon for the bot's message. Ex :smile:
Icon URL | Provide a url to an image to use as the icon for the bot's message.
Mention | make it possible to include a mention in the Slack notification sent by Grafana. Ex @here or @channel
Icon URL | Provide a URL to an image to use as the icon for the bot's message.
Mention Users | Optionally mention one or more users in the Slack notification sent by Grafana. You have to refer to users, comma-separated, via their corresponding Slack IDs (which you can find by clicking the overflow button on each user's Slack profile).
Mention Groups | Optionally mention one or more groups in the Slack notification sent by Grafana. You have to refer to groups, comma-separated, via their corresponding Slack IDs (which you can get from each group's Slack profile URL).
Mention Channel | Optionally mention either all channel members or just active ones.
Token | If provided, Grafana will upload the generated image via Slack's file.upload API method, not the external image destination.
If you are using the token for a slack bot, then you have to invite the bot to the channel you want to send notifications and add the channel to the recipient field.
### PagerDuty
To set up PagerDuty, all you have to do is to provide an API key.
To set up PagerDuty, all you have to do is to provide an integration key.
Setting | Description
---------- | -----------
Integration Key | Integration key for PagerDuty.
Severity | Level for dynamic notifications, default is `critical`
Auto resolve incidents | Resolve incidents in PagerDuty once the alert goes back to ok
**Note:** The tags `Class`, `Group`, and `Component` have special meaning in the [Pagerduty Common Event Format - PD-CEF](https://support.pagerduty.com/docs/pd-cef). If an alert panel defines these tag keys they will be transposed to the root of the event sent to Pagerduty. This means they will be available within the Pagerduty UI and Filtering tools.
### Webhook
The webhook notification is a simple way to send information about a state change over HTTP to a custom endpoint.
@@ -165,6 +176,10 @@ Once these two properties are set, you can send the alerts to Kafka for further
Notifications can be sent by setting up an incoming webhook in Google Hangouts chat. Configuring such a webhook is described [here](https://developers.google.com/hangouts/chat/how-tos/webhooks).
### Squadcast
Squadcast helps you get alerted via Phone call, SMS, Email and Push notifications and lets you take actions on those alerts. Grafana notifications can be sent to Squadcast via a simple incoming webhook. Refer the official [Squadcast support documentation](https://support.squadcast.com/docs/grafana) for configuring these webhooks.
### All supported notifiers
Name | Type | Supports images | Support alert rule tags
@@ -177,12 +192,13 @@ Hipchat | `hipchat` | yes, external only | no
Kafka | `kafka` | yes, external only | no
Line | `line` | yes, external only | no
Microsoft Teams | `teams` | yes, external only | no
OpsGenie | `opsgenie` | yes, external only | no
Pagerduty | `pagerduty` | yes, external only | no
OpsGenie | `opsgenie` | yes, external only | yes
Pagerduty | `pagerduty` | yes, external only | yes
Prometheus Alertmanager | `prometheus-alertmanager` | yes, external only | yes
# Enable images in notifications {#external-image-store}
Grafana can render the panel associated with the alert rule as a PNG image and include that in the notification. Read more about the requirements and how to configure image rendering [here](/administration/image_rendering/).
Grafana can render the panel associated with the alert rule as a PNG image and include that in the notification. Read more about the requirements and how to configure
Most Notification Channels require that this image be publicly accessible (Slack and PagerDuty for example). In order to include images in alert notifications, Grafana can upload the image to an image store. It currently supports
Amazon S3, Webdav, Google Cloud Storage and Azure Blob Storage. So to set that up you need to configure the [external image uploader](/installation/configuration/#external-image-storage) in your grafana-server ini config file.
Amazon S3, Webdav, Google Cloud Storage and Azure Blob Storage. So to set that up you need to configure the [external image uploader]({{< relref "../installation/configuration/#external-image-storage" >}}) in your grafana-server ini config file.
Be aware that some notifiers requires public access to the image to be able to include it in the notification. So make sure to enable public access to the images. If you're using local image uploader, your Grafana instance need to be accessible by the internet.
@@ -212,4 +229,4 @@ It currently supports only the Prometheus Alertmanager notifier.
# Configure the link back to Grafana from alert notifications
All alert notifications contain a link back to the triggered alert in the Grafana instance.
This url is based on the [domain](/installation/configuration/#domain) setting in Grafana.
This URL is based on the [domain]({{< relref "../installation/configuration/#domain" >}}) setting in Grafana.
@@ -28,11 +24,9 @@ and the conditions that need to be met for the alert to change state and trigger
The alert rules are evaluated in the Grafana backend in a scheduler and query execution engine that is part
of core Grafana. Only some data sources are supported right now. They include `Graphite`, `Prometheus`, `InfluxDB`, `Elasticsearch`,
`Stackdriver`, `Cloudwatch`, `Azure Monitor`, `MySQL`, `PostgreSQL`, `MSSQL`, `OpenTSDB`, `Oracle` and `Azure Data Explorer`.
`Stackdriver`, `Cloudwatch`, `Azure Monitor`, `MySQL`, `PostgreSQL`, `MSSQL`, `OpenTSDB`, `Oracle`, and `Azure Data Explorer`.
> Alerting support for Azure Monitor is only available in Grafana v6.0 and above.
### Clustering
## Clustering
Currently alerting supports a limited form of high availability. Since v4.2.0 of Grafana, alert notifications are deduped when running multiple servers. This means all alerts are executed on every server but no duplicate alert notifications are sent due to the deduping logic. Proper load balancing of alerts will be introduced in the future.
@@ -40,14 +34,12 @@ Currently alerting supports a limited form of high availability. Since v4.2.0 of
## Rule Config
Currently only the graph panel supports alert rules but this will be added to the **Singlestat** and **Table**
panels as well in a future release.
Currently only the graph panel supports alert rules.
### Name and Evaluation interval
Here you can specify the name of the alert rule and how often the scheduler should evaluate the alert rule.
**Note:** You can set a minimum interval in the `alerting.min_interval_seconds` config field, to set a minimum time between evaluations. Check out the [[configuration]]({{< relref "../installation/configuration.md" >}}#min-interval-seconds) page for more information.
### For
@@ -69,7 +61,6 @@ Below you can see an example timeline of an alert using the `For` setting. At ~1
Currently the only condition type that exists is a `Query` condition that allows you to
specify a query letter, time range and an aggregation function.
### Query condition example
```sql
@@ -107,7 +98,7 @@ we plan to track state **per series** in a future release.
> Starting with Grafana v5.3 you can configure reminders to be sent for triggered alerts. This will send additional notifications
> when an alert continues to fire. If other series (like server2 in the example above) also cause the alert rule to fire they will
> be included in the reminder notification. Depending on what notification channel you're using you may be able to take advantage
> of this feature for identifying new/existing series causing alert to fire. [Read more about notification reminders here](/alerting/notifications/#send-reminders).
> of this feature for identifying new/existing series causing alert to fire. [Read more about notification reminders here]({{< relref "notifications/#send-reminders" >}}).
You use the `X-WEBAUTH-GROUPS` header to send the team information for each user. Specifically, the set of Grafana's group IDs that the user belongs to.
First, we need to set up the mapping between your authentication provider and Grafana. Follow [these instructions]({{< relref "auth/team-sync.md#enable-synchronization-for-a-team" >}}) to add groups to a team within Grafana.
First, we need to set up the mapping between your authentication provider and Grafana. Follow [these instructions]({{< relref "team-sync.md#enable-synchronization-for-a-team" >}}) to add groups to a team within Grafana.
Once that's done. You can verify your mappings by querying the API.
The Azure AD authentication provides the possibility to use an Azure Active Directory tenant as an identity provider for Grafana. By using Azure AD Application Roles it is also possible to assign Users and Groups to Grafana roles from the Azure Portal.
## Create the Azure AD application
To enable the Azure AD OAuth2 you must register your application with Azure AD.
1. Log in to [Azure Portal](https://portal.azure.com) and click **Azure Active Directory** in the side menu.
1. Click **App Registrations** and add a new application registration:
1. Click the name of the new application to open the application details page.
1. Click **Endpoints**.
- Note down the **OAuth 2.0 authorization endpoint (v2)**, this will be the auth url.
- Note down the **OAuth 2.0 token endpoint (v2)**, this will be the token url.
1. Close the Endpoints page to come back to the application details page.
1. Note down the "Application ID", this will be the OAuth client id.
1. Click **Certificates & secrets** and add a new entry under Client secrets.
- Description: Grafana OAuth
- Expires: Never
1. Click **Add** then copy the key value, this will be the OAuth client secret.
1. Click **Manifest**.
- Add definitions for the required Application Roles for Grafana (Viewer, Editor, Admin). Without this configuration all users will be assigned to the Viewer role.
- Every role has to have a unique id. On Linux this can be created with `uuidgen` for instance.
```json
"appRoles": [
{
"allowedMemberTypes": [
"User"
],
"description": "Grafana admin Users",
"displayName": "Grafana Admin",
"id": "SOME_UNIQUE_ID",
"isEnabled": true,
"lang": null,
"origin": "Application",
"value": "Admin"
},
{
"allowedMemberTypes": [
"User"
],
"description": "Grafana read only Users",
"displayName": "Grafana Viewer",
"id": "SOME_UNIQUE_ID",
"isEnabled": true,
"lang": null,
"origin": "Application",
"value": "Viewer"
},
{
"allowedMemberTypes": [
"User"
],
"description": "Grafana Editor Users",
"displayName": "Grafana Editor",
"id": "SOME_UNIQUE_ID",
"isEnabled": true,
"lang": null,
"origin": "Application",
"value": "Editor"
}
],
```
1. Click Overview and then on **Managed application in local directory** to show the Enterprise Application details.
1. Click on **Users and groups** and add Users/Groups to the Grafana roles by using **Add User**.
## Enable Azure AD Oauth in Grafana
1. Add the following to the [Grafana configuration file]({{< relref "../installation/configuration.md#config-file-locations" >}}):
> Note: Ensure that the [root_url]({{< relref "../installation/configuration/#root-url" >}}) in Grafana is set in your Azure Application Reply URLs (App -> Settings -> Reply URLs)
### Configure allowed groups and domains
To limit access to authenticated users that are members of one or more groups, set `allowed_groups`
to a comma- or space-separated list of group Object Ids. Object Id for a specific group can be found on the Azure portal: go to Azure Active Directory -> Groups. For instance, if you want to
only give access to members of the group `example` which has Id `8bab1c86-8fba-33e5-2089-1d1c80ec267d`, set
With the enhanced LDAP integration it's possible to setup synchronization between LDAP groups and teams. This enables LDAP users which are members
of certain LDAP groups to automatically be added/removed as members to certain teams in Grafana. Currently the synchronization will only happen every
time a user logs in, unless Grafana 6.3 (or later) is used with active background synchronization enabled.
Grafana keeps track of all synchronized users in teams and you can see which users have been synchronized from LDAP in the team members list, see `LDAP` label in screenshot.
This mechanism allows Grafana to remove an existing synchronized user from a team when its LDAP group membership changes. This mechanism also enables you to manually add
a user as member of a team and it will not be removed when the user signs in. This gives you flexibility to combine LDAP group memberships and Grafana team memberships.
[Learn more about Team Sync]({{< relref "auth/team-sync.md">}})
<div class="clearfix"></div>
## Active LDAP Synchronization
> Only available in Grafana Enterprise v6.3+
In the open source version of Grafana, user data from LDAP will be synchronized only during the login process when authenticating using LDAP.
With this feature you can configure Grafana to actively sync users with LDAP server(s) in the background. Role and team membership will be updated, removed users will be disabled and logged out. Only users that have logged into Grafana at least once will be synchronized.
```bash
[auth.ldap]
...
# You can use the Cron syntax or several predefined schedulers -
# @yearly (or @annually) | Run once a year, midnight, Jan. 1st | 0 0 0 1 1 *
# @monthly | Run once a month, midnight, first of month | 0 0 0 1 * *
# @weekly | Run once a week, midnight between Sat/Sun | 0 0 0 * * 0
# @daily (or @midnight) | Run once a day, midnight | 0 0 0 * * *
# @hourly | Run once an hour, beginning of hour | 0 0 * * * *
sync_cron="0 0 1 * * *"# This is default value (At 1 am every day)
# This cron expression format uses 6 space-separated fields (including seconds), for example
# sync_cron = "* */10 * * * *"
# This will run the LDAP Synchronization every 10th minute, which is also the minimal interval between the grafana sync times i.e. you cannot set it for every 9th minute
# You can also disable active LDAP synchronization
active_sync_enabled=true# enabled by default
```
> Enhanced LDAP integration is only available in Grafana Enterprise. For more information, refer to [Enhanced LDAP integration]({{< relref "../enterprise/enhanced_ldap.md" >}}) in [Grafana Enterprise]({{< relref "../enterprise" >}}).
@@ -50,7 +50,7 @@ Grafana will also attempt to do role mapping through OAuth as described below.
> Only available in Grafana v6.5+.
Check for the presence of an role using the [JMESPath](http://jmespath.org/examples.html) specified via the `role_attribute_path` configuration option. The JSON used for the path lookup is the HTTP response obtained from querying the UserInfo endpoint specified via the `api_url` configuration option. The result after evaluating the `role_attribute_path` JMESPath expression needs to be a valid Grafana role, i.e. `Viewer`, `Editor` or `Admin`.
Check for the presence of a role using the [JMESPath](http://jmespath.org/examples.html) specified via the `role_attribute_path` configuration option. The JSON used for the path lookup is the HTTP response obtained from querying the UserInfo endpoint specified via the `api_url` configuration option. The result after evaluating the `role_attribute_path` JMESPath expression needs to be a valid Grafana role, i.e. `Viewer`, `Editor` or `Admin`.
See [JMESPath examples](#jmespath-examples) for more information.
@@ -105,7 +105,7 @@ allowed_organizations =
then:
3. Under the SSO tab on the Grafana App details page you'll find the Client ID and Client Secret.
Your OneLogin Domain will match the url you use to access OneLogin.
Your OneLogin Domain will match the URL you use to access OneLogin.
Configure Grafana as follows:
@@ -188,7 +188,7 @@ allowed_organizations =
allowed_organizations =
```
> Note: It's important to ensure that the [root_url](/installation/configuration/#root-url) in Grafana is set in your Azure Application Reply URLs (App -> Settings -> Reply URLs)
> Note: It's important to ensure that the [root_url]({{< relref "../installation/configuration/#root-url" >}}) in Grafana is set in your Azure Application Reply URLs (App -> Settings -> Reply URLs)
@@ -18,8 +18,8 @@ To enable the Google OAuth2 you must register your application with Google. Goog
First, you need to create a Google OAuth Client:
1. Go to https://console.developers.google.com/apis/credentials
2. Click the 'Create Credentials' button, then click 'OAuth Client ID' in the menu that drops down
1. Go to https://console.developers.google.com/apis/credentials.
2. Click **Create Credentials**, then click **OAuth Client ID** in the drop-down menu
3. Enter the following:
- Application Type: Web Application
- Name: Grafana
@@ -31,7 +31,7 @@ First, you need to create a Google OAuth Client:
## Enable Google OAuth in Grafana
Specify the Client ID and Secret in the [Grafana configuration file]({{< relref "installation/configuration.md#config-file-locations" >}}). For example:
Specify the Client ID and Secret in the [Grafana configuration file]({{< relref "../installation/configuration.md#config-file-locations" >}}). For example:
The LDAP integration in Grafana allows your Grafana users to login with their LDAP credentials. You can also specify mappings between LDAP
group memberships and Grafana Organization user roles.
> [Enhanced LDAP authentication]({{< relref "../enterprise/enhanced_ldap.md" >}}) is available in [Grafana Enterprise]({{< relref "../enterprise" >}}).
## Supported LDAP Servers
Grafana uses a [third-party LDAP library](https://github.com/go-ldap/ldap) under the hood that supports basic LDAP v3 functionality.
@@ -24,7 +26,7 @@ This means that you should be able to configure LDAP integration using any compl
## Enable LDAP
In order to use LDAP integration you'll first need to enable LDAP in the [main config file]({{< relref "installation/configuration.md" >}}) as well as specify the path to the LDAP
In order to use LDAP integration you'll first need to enable LDAP in the [main config file]({{< relref "../installation/configuration.md" >}}) as well as specify the path to the LDAP
specific configuration file (default: `/etc/grafana/ldap.toml`).
Users with nested/recursive group membership must have an LDAP server that supports `LDAP_MATCHING_RULE_IN_CHAIN`
and configure `group_search_filter` in a way that it returns the groups the submitted username is a member of.
To configure `group_search_filter`:
* You can set `group_search_base_dns` to specify where the matching groups are defined.
* If you do not use `group_search_base_dns`, then the previously defined `search_base_dns` is used.
**Active Directory example:**
Active Directory groups store the Distinguished Names (DNs) of members, so your filter will need to know the DN for the user based only on the submitted username.
Multiple DN templates can be searched by combining filters with the LDAP OR-operator. Examples:
Multiple DN templates can be searched by combining filters with the LDAP OR-operator. Two examples:
group_search_filter="(|(member:1.2.840.113556.1.4.1941:=CN=%s,[user container/OU])(member:1.2.840.113556.1.4.1941:=CN=%s,[another user container/OU]))"
group_search_filter_user_attribute="cn"
```
For more information on AD searches see [Microsoft's Search Filter Syntax](https://docs.microsoft.com/en-us/windows/desktop/adsi/search-filter-syntax) documentation.
For troubleshooting, by changing `member_of` in `[servers.attributes]` to "dn" it will show you more accurate group memberships when [debug is enabled](#troubleshooting).
@@ -334,7 +347,7 @@ Please inspect your Active Directory configuration and documentation to find the
## Troubleshooting
To troubleshoot and get more log info enable ldap debug logging in the [main config file]({{< relref "installation/configuration.md" >}}).
To troubleshoot and get more log info enable ldap debug logging in the [main config file]({{< relref "../installation/configuration.md" >}}).
> SAML Authentication integration is only available in Grafana Enterprise. Read more about [Grafana Enterprise]({{< relref "enterprise" >}}).
The SAML authentication integration allows your Grafana users to log in by using an external SAML Identity Provider (IdP). To enable this, Grafana becomes a Service Provider (SP) in the authentication flow, interacting with the IdP to exchange user information.
> Only available in Grafana v6.3+
The SAML authentication integration allows your Grafana users to log in by
using an external SAML Identity Provider (IdP). To enable this, Grafana becomes
a Service Provider (SP) in the authentication flow, interacting with the IdP to
exchange user information.
## Supported SAML
The SAML single-sign-on (SSO) standard is varied and flexible. Our implementation contains the subset of features needed to provide a smooth authentication experience into Grafana.
> Should you encounter any problems with our implementation, please don't hesitate to contact us.
At the moment of writing, Grafana supports:
1. From the Service Provider (SP) to the Identity Provider (IdP)
-`HTTP-POST` binding
-`HTTP-Redirect` binding
2. From the Identity Provider (IdP) to the Service Provider (SP)
-`HTTP-POST` binding
3. In terms of security, we currently support signed and encrypted Assertions. However, signed or encrypted requests are not supported.
4. In terms of initiation, only SP-initiated requests are supported. There's no support for IdP-initiated request.
## Set up SAML Authentication
To use the SAML integration, you need to enable SAML in the [main config file]({{< relref "installation/configuration.md" >}}).
```bash
[auth.saml]
# Defaults to false. If true, the feature is enabled
enabled=true
# Base64-encoded public X.509 certificate. Used to sign requests to the IdP
certificate=
# Path to the public X.509 certificate. Used to sign requests to the IdP
certificate_path=
# Base64-encoded private key. Used to decrypt assertions from the IdP
private_key=
# Path to the private key. Used to decrypt assertions from the IdP
private_key_path=
# Base64-encoded IdP SAML metadata XML. Used to verify and obtain binding locations from the IdP
idp_metadata=
# Path to the SAML metadata XML. Used to verify and obtain binding locations from the IdP
idp_metadata_path=
# URL to fetch SAML IdP metadata. Used to verify and obtain binding locations from the IdP
idp_metadata_url=
# Duration, since the IdP issued a response and the SP is allowed to process it. Defaults to 90 seconds
max_issue_delay=
# Duration, for how long the SP's metadata should be valid. Defaults to 48 hours
metadata_valid_duration=
# Friendly name or name of the attribute within the SAML assertion to use as the user's name
assertion_attribute_name= displayName
# Friendly name or name of the attribute within the SAML assertion to use as the user's login handle
assertion_attribute_login= mail
# Friendly name or name of the attribute within the SAML assertion to use as the user's email
assertion_attribute_email= mail
```
Important to note:
- like any other Grafana configuration, use of [environment variables for these options is supported]({{< relref "installation/configuration.md#using-environment-variables" >}})
- only one form of configuration option is required. Using multiple forms, e.g. both `certificate` and `certificate_path` will result in an error
## Grafana Configuration
An example working configuration example looks like:
| `enabled` | No | Whenever SAML authentication is allowed | `false` |
| `certificate` or `certificate_path` | Yes | Base64-encoded string or Path for the SP X.509 certificate | |
| `private_key` or `private_key_path` | Yes | Base64-encoded string or Path for the SP private key | |
| `idp_metadata` or `idp_metadata_path` or `idp_metadata_url` | Yes | Base64-encoded string, Path or URL for the IdP SAML metadata XML | |
| `max_issue_delay` | No | Duration, since the IdP issued a response and the SP is allowed to process it | `90s` |
| `metadata_valid_duration` | No | Duration, for how long the SP's metadata should be valid | `48h` |
| `assertion_attribute_name` | No | Friendly name or name of the attribute within the SAML assertion to use as the user's name | `displayName` |
| `assertion_attribute_login` | No | Friendly name or name of the attribute within the SAML assertion to use as the user's login handle | `mail` |
| `assertion_attribute_email` | No | Friendly name or name of the attribute within the SAML assertion to use as the user's email | `mail` |
### Cert and Private Key
The SAML SSO standard uses asymmetric encryption to exchange information between the SP (Grafana) and the IdP. To perform such encryption, you need a public part and a private part. In this case, the X.509 certificate provides the public part, while the private key provides the private part.
Grafana supports two ways of specifying both the `certificate` and `private_key`. Without a suffix (e.g. `certificate=`), the configuration assumes you've supplied the base64-encoded file contents. However, if specified with the `_path` suffix (e.g. `certificate_path=`) Grafana will treat it as a file path and attempt to read the file from the file system.
### IdP Metadata
Expanding on the above, we'll also need the public part from our IdP for message verification. The SAML IdP metadata XML tells us where and how we should exchange the user information.
Currently, we support three ways of specifying the IdP metadata. Without a suffix `idp_metadata=` Grafana assumes base64-encoded XML file contents, with the `_path` suffix assumes a file path and attempts to read the file from the file system and with the `_url` suffix assumes an URL and attempts to load the metadata from the given location.
### Max Issue Delay
Prevention of SAML response replay attacks and internal clock skews between the SP (Grafana), and the IdP is covered. You can set a maximum amount of time between the IdP issuing a response and the SP (Grafana) processing it.
The configuration options is specified as a duration e.g. `max_issue_delay = 90s` or `max_issue_delay = 1h`
### Metadata valid duration
As an SP, our metadata is likely to expire at some point, e.g. due to a certificate rotation or change of location binding. Grafana allows you to specify for how long the metadata should be valid. Leveraging the standard's `validUntil` field, you can tell consumers until when your metadata is going to be valid. The duration is computed by adding the duration to the current time.
The configuration option is specified as a duration e.g. `metadata_valid_duration = 48h`
## Identity Provider (IdP) registration
For the SAML integration to work correctly, you need to make the IdP aware of the SP.
The integration provides two key endpoints as part of Grafana:
- The `/saml/metadata` endpoint. Which contains the SP's metadata. You can either download and upload it manually or make the IdP request it directly from the endpoint. Some providers name it Identifier or Entity ID.
- The `/saml/acs` endpoint. Which is intended to receive the ACS (Assertion Customer Service) callback. Some providers name it SSO URL or Reply URL.
## Assertion mapping
During the SAML SSO authentication flow, we receive the ACS (Assertion Customer Service) callback. The callback contains all the relevant information of the user under authentication embedded in the SAML response. Grafana parses the response to create (or update) the user within its internal database.
For Grafana to map the user information, it looks at the individual attributes within the assertion. You can think of these attributes as Key/Value pairs (although, they contain more information than that).
Grafana provides configuration options that let you modify which keys to look at for these values. The data we need to create the user in Grafana is Name, Login handle, and email.
An example is `assertion_attribute_name = "givenName"` where Grafana looks within the assertion for an attribute with a friendly name or name of `givenName`. Both, the friendly name (e.g. `givenName`) or the name (e.g. `urn:oid:2.5.4.42`) can be used interchangeably as the value for the configuration option.
## Troubleshooting
To troubleshoot and get more log info enable saml debug logging in the [main config file]({{< relref "installation/configuration.md" >}}).
```bash
[log]
filters= saml.auth:debug
```
> SAML authentication integration is only available in Grafana Enterprise v6.3 or later. For more information, refer to [SAML authentication]({{< relref "../enterprise/saml.md" >}}) in [Grafana Enterprise]({{< relref "../enterprise" >}}).
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.