Compare commits

..

500 Commits

Author SHA1 Message Date
Leonard Gram
57a57932af release 6.3.0-beta4 2019-08-02 14:24:40 +02:00
Torkel Ödegaard
62a226b1c3 Navigation: Fixed double settings menus (#18349)
(cherry picked from commit f3fb178efa)
2019-08-02 14:24:40 +02:00
Oleg Gaidarenko
a38dcc3ac7 Build: allow bash to expand the wildcard (#18354)
If wildcards are in the quotes they not going to be expanded

(cherry picked from commit 89a4f30eab)
2019-08-02 14:24:40 +02:00
Torkel Ödegaard
c39b0e246b Gauges: Fixes error when mappings array was undefined (#18353)
(cherry picked from commit 142c7eb0e6)
2019-08-02 14:24:40 +02:00
gotjosh
f8f1f506ed Auth Proxy: Include additional headers as part of the cache key (#18298)
* Auth Proxy: Include additional headers as part of the cache key

Auth proxy has support to send additional user attributes as part of the
authentication flow. These attributes (e.g. Groups) need to be monitored
as part of the process in case of change.

This commit changes the way we compute the cache key to include all of the
attributes sent as part of the authentication request. That way, if we
change any user attributes we'll upsert the user information.

(cherry picked from commit ed8aeb2999)
2019-08-02 14:24:40 +02:00
Ryan McKinley
9d57a1f192 Plugins: avoid app importDashboards() NPE (#18128)
* tables display

* add missing file

* adding toolbar option

* adding toolbar option

* add items to index

* use root import path

* merge master

* show tables info

* add importDashboards code

* remove table changes

* remove table changes

* use deprecation warning

(cherry picked from commit 06b43f6d4b)
2019-08-02 14:24:40 +02:00
Leonard Gram
ba4a870632 release 6.3.0-beta3 2019-08-02 11:47:05 +02:00
kay delaney
ef9ec32c32 QueryEditors: Fixes flakey text edit mode toggle (#18335)
Closes #18037

(cherry picked from commit 9b5890cc62)
2019-08-02 11:47:05 +02:00
Oleg Gaidarenko
17235e4bd1 Auth: consistently return same basic auth errors (#18310)
* Auth: consistently return same basic auth errors

* Put repeated errors in consts and return only those consts as error strings

* Add tests for errors basic auth cases and moves tests to separate test-case.
  Also names test cases consistently

* Add more error logs and makes their messages consistent

* A bit of code style

* Add additional test helper

* Auth: do not expose even incorrect password

* Auth: address review comments

Use `Debug` for the cases when it's an user error

(cherry picked from commit 82661b9f69)
2019-08-02 11:47:05 +02:00
Leonard Gram
eb82b77782 cli: fix for recognizing when in dev mode. (#18334)
(cherry picked from commit c675449aa2)
2019-08-02 11:47:05 +02:00
Sofia Papagiannaki
3af8aa5c4f Fix failing end to end tests job for release (#18323)
Create and push the expected tag to grafana-dev repository
and use this instead for running the end to end tests
for the release.

(cherry picked from commit c9f7e3059f)
2019-08-02 11:47:05 +02:00
Sofia Papagiannaki
5b588af73c Fix OAuth error due to SameSite cookie policy (#18332)
The `oauth_state` cookie used to be created with the SameSite value set
according to the `cookie_samesite` configuration.
However, due to a Safari bug SameSite=None or SameSite=invalid are treated
as Strict which results in "missing saved state" OAuth login failures
because the cookie is not sent with the redirect requests to the OAuth
provider.
This commit always creates the `oauth_state` cookie with SameSite=Lax
to compensate for this.

(cherry picked from commit 69b7b8bb46)
2019-08-02 11:47:05 +02:00
kay delaney
5ec6eccfac [Shortcuts] Fixes shortcuts for moving time range backwards and forwards (#18305)
Closes #18159

(cherry picked from commit bcf28cb7a2)
2019-08-02 11:47:05 +02:00
Oleg Gaidarenko
237e0e8631 Build: fix use of env vars in parentheses execs (#18249)
* Build: fix use of env vars in parentheses execs

* Build: disable shellcheck rule SC2086 for a file

Follow up for 4b16cd6cc8

(cherry picked from commit f9a6414b92)
2019-08-02 11:47:05 +02:00
Oleg Gaidarenko
7a165febf3 Build: correct verify script (#18236)
Follow-up for 4b16cd6cc8

(cherry picked from commit ba46cf40e4)
2019-08-02 11:47:05 +02:00
Oleg Gaidarenko
fd7c38c62f Build: Introduce shellcheck (#18081)
* Build: introduce shellcheck

Fixes #16198

(cherry picked from commit 4b16cd6cc8)
2019-08-02 11:47:05 +02:00
Oleg Gaidarenko
00519f1105 Build: change definition of the vars in makefile (#18151)
Prompted by the @slim-bean talk (thanks!). With that definition
`GO_FILES` var can be dynamically changed, that will be very helpful
in grafana enterprise repo

(cherry picked from commit 8202fa2fde)
2019-08-02 11:47:05 +02:00
Leonard Gram
c8740d98b0 release 6.3.0-beta2 2019-07-26 15:56:18 +02:00
gotjosh
54030deaf6 SAML: Only show SAML login button on Enterprise version (#18270)
SAML Authentication is an Enterprise only feature. This change enables
the SAML login button to only be shown on enterprise.

(cherry picked from commit 2f240a11ce)
2019-07-26 15:56:18 +02:00
Andrej Ocenas
880f6b63a1 Permissions: Show plugins in nav for non admin users but hide plugin configuration (#18234)
Allow non admins to see plugins list but only with readme. Any config tabs are hidden from the plugin page. Also plugin panel does not show action buttons (like Enable) for non admins.

(cherry picked from commit 7f1214ac46)
2019-07-26 15:56:18 +02:00
Sofia Papagiannaki
d8ddfa5622 Run End-to-End tests for release builds (#18211)
(cherry picked from commit 13c41b781a)
2019-07-26 15:56:18 +02:00
Torkel Ödegaard
9af2ea1b53 DataLinks: Fixed interpolation of series name, fixes #18250 (#18251)
(cherry picked from commit 43543d5682)
2019-07-26 15:56:18 +02:00
kay delaney
d98ee66bd8 Timerange: Fixes a bug where custom time ranges didn't respect UTC (#18248)
Closes #18170
Closes #18178

(cherry picked from commit c01bbf2058)
2019-07-26 15:56:18 +02:00
Ryan McKinley
d3ecc963e6 Registry: add a reusable function registry (#17047)
(cherry picked from commit c194ae1ba5)
2019-07-26 15:56:18 +02:00
Ryan McKinley
0961ec9748 FieldDisplay: move threshold and mapping to Field (#17043)
(cherry picked from commit 14caa6a068)
2019-07-26 15:56:18 +02:00
Torkel Ödegaard
a2c7570c5c TimePicker: Increase max height of quick range dropdown (#18247)
(cherry picked from commit 996567ac42)
2019-07-26 15:56:18 +02:00
Torkel Ödegaard
9cbe0abb44 TimePicker: Fixed css issue casued by CSS Optimizer (#18244)
Fixes #18158

(cherry picked from commit 3145a1dd29)
2019-07-26 15:56:18 +02:00
Oleg Gaidarenko
2fecdaf6b4 LDAP: improve POSIX support (#18235)
* LDAP: improve POSIX support

* Correctly abtain DN attributes result

* Allow more flexibility with comparison mapping between POSIX group & user

* Add devenv for POSIX LDAP server

* Correct the docs

Fixes #18140

(cherry picked from commit 1e5fc76601)
2019-07-26 15:56:18 +02:00
Hassan Farid
a5f360e50e Replaced ubuntu:latest with ubuntu:18.04; specific image version to make grafana build images consistent (#18224)
(cherry picked from commit 711f62c813)
2019-07-26 15:56:18 +02:00
Markus Blaschke
99f2386bd9 remote_cache: Fix redis connstr parsing (#18204)
* Fix redis connstr parsing

* Don’t log the password

(cherry picked from commit 31547597d3)
2019-07-26 15:56:18 +02:00
Oleg Gaidarenko
bffa956068 Auth: do not expose disabled user disabled status (#18229)
Fixes #17947

(cherry picked from commit d16fd58bdb)
2019-07-26 15:56:18 +02:00
gotjosh
1b7a54c084 Docs: Update documentation with new SAML features (#18163)
* Update defaults.ini and sample.ini with the SAML assertion mapping
fields

* Document Grafana's ability to map ACS attributes while a Grafana user is created

(cherry picked from commit 87a794fe0a)
2019-07-26 15:56:18 +02:00
David
8128eb6c77 Graph: fix time label description for datalink suggestions (#18214)
(cherry picked from commit 9cd069f2c5)
2019-07-26 15:56:18 +02:00
Leonard Gram
10c4d6eccc PhantomJS: Fixes rendering on Debian Buster (#18162)
Closes #17588

(cherry picked from commit 2014549fa5)
2019-07-26 15:56:18 +02:00
Alexander Zobnin
8a062dde35 SAML: add auth provider label (#18197)
(cherry picked from commit ccf11fb7a2)
2019-07-26 15:56:18 +02:00
Ryan McKinley
041c1c3cb1 Plugins: fix previous commit, output "build" property in json
(cherry picked from commit 0ca1e90b2e)
2019-07-26 15:56:18 +02:00
Alexander Zobnin
aba6df2e09 SAML: add metrics (#18194)
(cherry picked from commit 214195441f)
2019-07-26 15:56:18 +02:00
Oleg Gaidarenko
5192504748 Metrics: use consistent naming for exported variables (#18134)
* Metrics: remove unused metrics

Metric `M_Grafana_Version` is not used anywhere, nor the mentioned
`M_Grafana_Build_Version`. Seems to be an artefact?

* Metrics: make the naming consistent

* Metrics: add comments to exported vars

* Metrics: use proper naming

Fixes #18110

(cherry picked from commit 75fa1f0207)
2019-07-26 15:56:18 +02:00
Ryan McKinley
8a0e2ac3a4 Plugins: add build info to plugin metadata (#18164)
(cherry picked from commit 3e0625ff3d)
2019-07-26 15:56:18 +02:00
Alexander Zobnin
373d082363 Docs: SAML idp_metadata_url option (#18181)
(cherry picked from commit e47546d529)
2019-07-26 15:56:18 +02:00
gotjosh
94765294a2 Docs: SAML (#18069)
* docs: Link to SAML docs and document configuration options

- Document configuration options `defaults.ini` and `sample.ini`
- Add the SAML documentation
- Link to the SAML documentation from "what's new in 6.3"

(cherry picked from commit d006f7c916)
2019-07-26 15:56:18 +02:00
Oleg Gaidarenko
1f482a5f0b SQLStore: use bool pointer instead of string (#18111)
(cherry picked from commit d9f01cb822)
2019-07-26 15:56:18 +02:00
Oleg Gaidarenko
ae04813045 SQLStore: allow to look for is_disabled flag (#18032)
* Add support for `is_disabled` to `CreateUser()`

* Add support for `is_disabled` to `SearchUsers()`
  Had to add it as a `string` type not as `bool`, since if that's property
  is omitted, we would have add it to SQL request, which might be dangerous

* Restructure desctructive tests and add more

(cherry picked from commit 8e0f091f14)
2019-07-26 15:56:18 +02:00
Oleg Gaidarenko
3d7c52dcd1 Metrics: add LDAP active sync summary metric (#18079)
(cherry picked from commit 09eb9a45ce)
2019-07-26 15:56:18 +02:00
Sofia Papagiannaki
81f8158010 API: Minor fix for nil pointer when trying to log error during creating new dashboard via the API (#18003)
* Minor fix for nil pointer when trying to log error

* Do not return error if a dashboard is created

Only log the failures

* Do not return error if the folder is created

Only log the failures

(cherry picked from commit f2ad3242be)
2019-07-26 15:56:18 +02:00
kay delaney
5de014a91d Explore/Loki: Display live tailed logs in correct order (#18031)
Closes #18027

(cherry picked from commit bf7fb67f73)
2019-07-26 15:56:18 +02:00
gotjosh
777311a759 Docs: Archive 6.2 and make 6.3 current version (#18257) 2019-07-24 19:30:03 +01:00
Marcus Efraimsson
829b5d0d40 Build: Update links to release notes and what's new article for v6.3.x 2019-07-11 16:34:05 +02:00
Sofia Papagiannaki
12878409db release 6.3.0-beta1 2019-07-10 15:58:07 +03:00
Tobias Skarhed
ffa9429c68 Fix unused variable errors (#18030) 2019-07-10 13:46:33 +02:00
Torkel Ödegaard
6649c5d75b Docs: First draft of whats new in 6.3 (#17962)
* Docs: First draft of whats new in 6.3

* Docs: Updated whats new article

* Docs: typos

* docs: fix broken link, add links and update docs index

* Docs: whats new in enterprise
2019-07-10 13:40:32 +02:00
Tobias Skarhed
d6e8129588 Packages: create shared tsconfig.json (#18010) 2019-07-10 12:50:52 +02:00
Marcus Efraimsson
6a3a2f5f94 CLI: Fix encrypt-datasource-passwords fails with sql error (#18014)
Now handles secure_json_data stored as null in database when
running the encrypt-datasource-passwords migration.

Fixes #17948
2019-07-10 12:28:40 +02:00
Leonard Gram
5d3a60d46e LDAP: Adds bind before searching LDAP for non-login cases. (#18023) 2019-07-10 12:25:21 +02:00
Alexander Zobnin
5f0a7f43c3 Users: show badges for each auth provider (#17869)
* Users: show badges for each auth provider

* Chore: don't use functions in angular bindings

* Users: minor style changes to labels

* Chore: convert auth labels on the backed side, deduplicate frontend code

* Users: use authLabels everywhere instead of authModule

* User: fix edit user page style

* Users: minor fixes after review
2019-07-10 12:06:51 +03:00
Damien Lespiau
ebff883016 Loki: Don't use _ numerical separator (#18016)
It breaks the build on a fresh checkout and install.

Fixes: #18015
2019-07-10 11:03:06 +02:00
Ryan McKinley
81ff856568 grafana-cli: allow installing plugins from a local zip file (#18021) 2019-07-10 00:40:33 -07:00
Dominik Prokop
648aa62264 grafana/toolkit: Copy or extract static files (#18006)
* Replace webpack ng annotate plugin with babel-plugin-angularjs-annotate

* Copy statics(png/svg) when necessary or keep the original path when files loaded via file-loader

* Update readme
2019-07-09 20:33:56 +02:00
Dominik Prokop
c32365f424 Packages: Use lerna for release orchestration (#17985) 2019-07-09 09:43:53 -07:00
Ryan McKinley
6599bdc7f1 AnnoList: add alpha annotations list plugin (#17187)
adding an alpha panel
2019-07-09 09:28:19 -07:00
Dominik Prokop
b44be990bc grafana/toolkit: Use babel-plugin-angularjs-annotate (#18005)
This fixes error caused by ng-annotate mentioned in #17819 (comment)
2019-07-09 17:22:17 +02:00
Tobias Skarhed
9e87dbb153 CSV Export: Timezone based on dashboard setting (#18002)
* Timezone export CSV based on dashboard setting

* Add options object and interface
2019-07-09 16:16:46 +02:00
Leonard Gram
25506829be LDAP: Adds back support for single bind. (#17999) 2019-07-09 14:12:17 +02:00
Ryan McKinley
d918d1f5f4 Reducers: consistent result for first/last reducer shortcut (#17911)
* find the last non-null value

* also fix first

* check empty first

* remove unused import

* adding lastNotNull
2019-07-09 13:56:00 +02:00
gotjosh
332920954e SAML: Show SAML login button even if OAuth is disabled (#17993)
* Move the SAML button outside of the oauth div
* Don't attempt to search cookies with an empty name
2019-07-09 10:15:52 +01:00
Sofia Papagiannaki
78ca55f3d7 Fix: Break redirect loop if oauth_auto_login = true and OAuth login fails (#17974)
* Add tests for login view

* Fix OAuth auto login redirect loop

login_error cookie is only set when the OAuth login fails
for some reason. Therefore, the login view should return
immediately if a login_error cookie exists before trying
to login the user using OAuth again.

* Fix test

Use 'index-template' instead of 'index' for testing

* Add some comments
2019-07-09 09:37:24 +03:00
Ryan McKinley
66a4d1a57e Refactor: fix range util imports (#17988) 2019-07-08 10:12:02 -07:00
Ryan McKinley
ccc3d88cee Refactor: move dom utils to @grafana/ui (#17976) 2019-07-08 10:02:16 -07:00
kay delaney
98ba3f34a6 Docs: Documents new features available with Loki data source in Explore (#17984)
* Docs: Documents new features available with Loki data source in Explore
Closes #17898

* Docs: Formats note as a quote and adds additional detail regarding live tailing
2019-07-08 17:48:47 +02:00
Martin Chodur
c284a11a95 Prometheus: added time range filter to series labels query (#16851)
* fix datasource/prometheus: added time range filter to prom series labels

* fix datasource/prometheus: added missing method to test mock
2019-07-08 17:48:09 +02:00
kay delaney
246358344c Explore: Adds support for new loki 'start' and 'end' params for labels endpoint (#17512)
* Explore: Adds support for new loki 'start' and 'end' params for labels endpoint
Also initializes absoluteRange when explore is initialized
Closes #16788

* Explore: Dispatches updateTimeRangeAction instead of passing absoluteRange when initializing
Also removes dependency on sinon from loki language provider test

* Loki: Refactors transformation of absolute time range to URL params into small utility function

* Makes use of rangeToParams() util function in loki language provider test
Also updates LanguageProvider.request() interface so that url should be type string, and adds optional params argument
2019-07-08 16:14:48 +01:00
Ryan McKinley
8f5df80161 Chore: Removes custom debounce utility in favor of lodash/debounce (#17977) 2019-07-08 15:20:29 +01:00
Marcus Efraimsson
962d4daabd Api: Fix auth tokens returning wrong seenAt value (#17980)
Changes so a non-set seenAt property gets the createdAt value.

Fixes #17953
2019-07-08 14:30:02 +02:00
Ryan McKinley
bdaf0aa81a Refactor: move more files to @grafana/data (#17972) 2019-07-06 09:18:23 -07:00
Ryan McKinley
fcdc29746f @grafana/data: export dateMath and rangeUtil (#17971) 2019-07-05 23:43:12 -07:00
Ryan McKinley
3f15170914 Refactor: move some files to @grafana/data (#17952)
* moving to data WIP

* more refactoring

* add missing test

* mock full path

* remove sinon from grafana-ui
2019-07-06 08:05:53 +02:00
Tobias Skarhed
baed5d7bd9 noImplicitAny: Azure Monitor (#17966) 2019-07-06 07:01:22 +02:00
Ryan McKinley
83366b91de grafana/toolkit: initial CI task and various small improvements (#17914) 2019-07-05 15:09:30 -07:00
Dominik Prokop
8219fdf7c0 First version of prettier checks in toolkit (#17964) 2019-07-05 12:52:51 -07:00
Oleg Gaidarenko
e2cf7c9698 LDAP: finishing touches (#17945)
* LDAP:Docs: `active_sync_enabled` setting

Mention `active_sync_enabled` setting and enable it by default

* LDAP: move "disableExternalUser" method

Idea behind new design of the LDAP module is to minimise conflation
between other parts of the system, so it would decoupled as much as
possible from stuff like database, HTTP transport and etc.

Following "Do One Thing and Do It Well" Unix philosophy principal, other things
could be better fitted on the consumer side of things.

Which what this commit trying to archive

* LDAP: correct user/admin binding

The second binding was not happening, so if the admin login/password
in LDAP configuration was correct, anyone could had login as anyone using
incorrect password
2019-07-05 17:49:00 +03:00
Tobias Skarhed
88a2c6fce7 Graphite: Refactor lexer and parser (#17958) 2019-07-05 16:47:21 +02:00
Tobias Skarhed
9b468caea4 noImplicitAny: Datasource files, under 2500 (#17959)
* noImplicitAny on Graphite

* More noImplicitAny
2019-07-05 16:46:46 +02:00
Leonard Gram
b67905a963 Auth: saml enabled check. (#17960) 2019-07-05 16:39:52 +02:00
Leonard Gram
e574147b1e Auth: SAML login button. (#17932)
* Auth: SAML login button.

* Fixed ts issue
2019-07-05 15:24:52 +02:00
Dominik Prokop
c5b6365858 grafana/toolkit: Add support for extensions styling (#17938)
* Add support for static files

* Use url-loader in single css setup

* Add postcss setup

* Expose emotion to plugins and externalise it in toolkit

* Add readme note about emotion
2019-07-05 13:33:42 +02:00
Tobias Skarhed
17b5f48cf6 Datasource: Refactor Graphite to class (#17942)
* Rewrite Graphite Datasources to class

* Graphite: removed unused prop
2019-07-05 13:26:14 +02:00
gotjosh
e6b8a1529b SAML: Configuration defaults, examples and dependencies (#17954)
* Add SAML configuration options

* Add crewjam/saml as a depdency

Needed as part of the enterprise SAML integration.

* Vendor github.com/stretchr/testify/require

The package require implements the same assertions as the `assert` package but stops test execution when a test fails.
2019-07-05 11:27:14 +01:00
Alexander Zobnin
48d5a1bcd3 OAuth: deny login for disabled users (#17957) 2019-07-05 11:35:04 +02:00
Hugo Häggmark
b1a0bd115c Build: Adds pre-commit check that fails if node versions are not synced (#17820)
* Build: Adds pre-commit check that fails if node versions are not synced

* Build: Throws error instead

* Minor refactoring and testing
2019-07-05 10:46:25 +02:00
Torkel Ödegaard
315177fad7 Docs: minor ha-setup edit (#17950)
* Docs: minor ha-setup edit

* Docs: minor ha-setup edit2
2019-07-05 09:13:15 +02:00
Torkel Ödegaard
d1588ec455 Docs: Added very basic docs about revoking user sessions (#17931)
* Docs: Added very basic docs that mention you can log yourself and other out

* Docs: fixed spelling issue
2019-07-05 08:20:21 +02:00
kay delaney
b2aa236bdf Docs: Updates documentation regarding logs integration in Explore (#17896)
Closes #17786
2019-07-05 08:18:22 +02:00
Tobias Skarhed
418dba4b21 noImplicitAnys: Fix InfluxDB type issues #17937) 2019-07-05 07:52:23 +02:00
Torkel Ödegaard
de71875e6b TimePicker: align position between dashboard and explore (#17940) 2019-07-05 07:49:45 +02:00
Daniel Lee
7e95ded164 AzureMonitor: remove duplicate query logic on the frontend (#17198)
* feat: AzureMonitor implements legend key on backend

To be able to remove the duplicated query logic on the
frontend, the backend code needs to implement alias
patterns for legend keys as well as allowing the default
list of allowed time grains to be overridden. Some metrics
do not support all the time grains and the auto timegrain
calculation can be incorrect if the list is not overridden.

* feat: AzureMonitor - removes duplicate query logic on frontend

* AzureMonitor small refactoring

Extracted method and tidied up the auto time grain
code.

* azuremonitor: support for auto time grains for alerting

Converts allowed timegrains into ms and saves in dashboard json.
This makes queries for alerting with an auto time grain work in
the same way as the frontend.

* chore: typings -> implicitAny count down to 3413

* azuremonitor: add more typings
2019-07-04 22:47:24 +02:00
Tobias Skarhed
55b63905ea UserProfilePage: Fix team avatar urls #17866 (#17930) 2019-07-04 16:54:44 +02:00
kay delaney
d4e9a8c009 Explore: Introduces storage keys for last used data source on per-orgId basis (#17934)
* Explore: Introduces storage keys for last used data source on per-orgId basis
Closes #17903
2019-07-04 15:31:15 +01:00
Torkel Ödegaard
57c220c93d Docs: added version notice to new ldap feature docs (#17929) 2019-07-04 14:39:11 +02:00
kay delaney
3a18098760 Explore: Restricts query text edit toggle to metrics mode (#17921)
* Explore: Adds datasource plugin config option 'modesSupportingTextEdit'
This allows one to specify which modes support toggling query text edit on and off
Closes #17904

* Explore: Restricts query text edit toggle to metrics mode
2019-07-04 14:10:44 +02:00
Dominik Prokop
cf37b5439f grafana/runtime: Expose SystemJS from @grafana/runtime (#17927)
In 4281344 the loadPluginCss util was migrated to @grafana/runtime package. This made SystemJS to fail loading the css files for a plugin. Root cause was that core and runtime used different SystemJS instances.

To solve the issue, I am exposing SystemJS from @grafana/runtime package to make sure we are always using the same instance. Also, the SystemJS dependency was moved to runtime.
2019-07-04 13:32:09 +02:00
Eduard Sergeev
19ae5351fb Templating: Correctly display __text in multi-values variable after refresh (#17918)
Fixes: #17915 - Templating: __value's are displayed instead of __text's after variable is updated
2019-07-04 08:34:42 +02:00
Dominik Prokop
9f351156c3 grafana/toolkit: bundle plugins with webpack (#17850) 2019-07-03 09:25:12 -07:00
kay delaney
164fb13d99 Explore: Adds orgId to URL for sharing purposes (#17895)
Also replaces one-off segment detection functions in explore.ts with general purpose function
Closes #15462
2019-07-03 16:36:12 +01:00
Ryan McKinley
22e2ac270b grafana/toolkit: copy sass files (#17888)
include sass files in toolkit
2019-07-03 08:17:18 -07:00
Shavonn Brown
874b8abcc0 ChangePassword: Rewrite change password page to react (#17811)
* ChangePassword to React, created PasswordInput component, attempting UserProvider wrapper component, adding flex to btn row

* UserAPI interface, force classes on PasswordInput, remove api call from ChangePassword

* refactored out form

* clean up

* removed unnecessary bind, added loading state and loading component to change password form

* should be OR

* arrow funcs instead of binds, inline-block instead of flex, isSaving instead of isLoading, disabled button instead of spinner

* inline-flex on the react btn

* change state instatiatiation
2019-07-03 17:02:11 +02:00
Torkel Ödegaard
b1126cb0ed AngularPanels: Fixed loading state indication for angular panels (#17900) 2019-07-03 16:58:38 +02:00
kay delaney
98147fd52b Explore: Adds support for toggling text edit mode in explore (#17870)
* Explore: Adds support for toggling text edit mode in explore
Also modifies query-row-status css to use relative position instead of absolute
Closes #16770

* Explore: Defines State interface for <QueryRow /> and removes unnecessary constructor
2019-07-03 15:42:03 +01:00
Oleg Gaidarenko
444c4d5999 LDAP: Divide the requests (#17885)
* LDAP: Divide the requests

Active Directory does indeed have a limitation with 1000 results
per search (default of course).

However, that limitation can be workaround with the pagination search feature,
meaning `pagination` number is how many times LDAP compatible server will be
requested by the client with specified amount of users (like 1000). That feature
already embeded with LDAP compatible client (including our `go-ldap`).

But slapd server has by default stricter settings. First, limitation is not 1000
but 500, second, pagination workaround presumably (information about it a bit
scarce and I still not sure on some of the details from my own testing)
cannot be workaround with pagination feature.

See
https://www.openldap.org/doc/admin24/limits.html
https://serverfault.com/questions/328671/paging-using-ldapsearch
hashicorp/vault#4162 - not sure why they were hitting the limit in
the first place, since `go-ldap` doesn't have one by default.

But, given all that, for me `ldapsearch` command with same request
as with `go-ldap` still returns more then 500 results, it can even return
as much as 10500 items (probably more).

So either there is some differences with implementation of the LDAP search
between `go-ldap` module and `ldapsearch` or I am missing a step :/.

In the wild (see serverfault link), apparently, people still hitting that
limitation even with `ldapsearch`, so it still seems to be an issue.

But, nevertheless, I'm still confused by this incoherence.

To workaround it, I divide the request by no more then
500 items per search
2019-07-03 17:39:54 +03:00
Leonard Gram
2596974cd2 Build: fixes missing shebang in release tagging script. (#17894) 2019-07-03 16:00:34 +02:00
Alexander Zobnin
3d848d0fdf Teams: show proper label for each auth provider (#17860)
* Teams: show proper label for each auth provider

Teams: don't sore AuthModule in team_member table, use JOIN to get it instead

* Teams: fix AddTeamMember after last changes

* Teams: add more auth provider labels

* Teams: show external sync badge if LDAP is not enabled

* Teams: tests for getting auth module
2019-07-03 16:52:10 +03:00
Anthony Templeton
0d2be0a7ed Logging: Login and Logout logging actions (#17760) (#17883) 2019-07-03 15:16:00 +02:00
kay delaney
1c291e26f8 Loki: Adds comment explaining usage of RFC3339Nano string (#17872)
* Loki: Adds comment explaining usage of RFC3339Nano string
2019-07-03 13:54:06 +01:00
kay delaney
b06ad02a74 Explore: Query rows are now reset when changing data sources (#17865)
Except when those data sources are compatible, via query import.
Closes #17861
2019-07-03 13:49:47 +01:00
Sofia Papagiannaki
2ae6adef26 Codestyle: add guidelines for removing the m alias for models (#17890)
* Add guidelines for avoiding use of m alias for models

* Add suggestion for elimination of existing aliases
2019-07-03 11:36:01 +03:00
Tobias Skarhed
498572d2d8 Docs: How to work with themes (#17876)
* Add docs for themes

* Edit description a little bit

* Update themes.md
2019-07-03 09:50:42 +02:00
Marcus Efraimsson
a2c1462675 Docs: Fix developing plugins index page (#17877)
Fixes #17874
2019-07-02 18:06:02 +02:00
Tobias Skarhed
3aed4d3613 StatsPicker: Fix multiple value input layout etc. (#17827)
* Add padding and centering

* Vertically center input

* Add noOptions styles

* Move reove button to same line

* StatsPicker: style tweak
2019-07-02 16:42:08 +02:00
Marcus Efraimsson
9620ac4b92 Chore: Build grafana-cli when running bra run (#17788) 2019-07-02 15:25:31 +02:00
Oleg Gaidarenko
caa1314f44 Build: use golangci-lint as a make command (#17739)
* Build: use golangci-lint as a make command

* Since gometalinter was deprecated in favor of golangci-lint so it was
  replaced by it. Responsibilities held by the gometalinter was moved to
  golangci-lint

* There was some changes in implementation (that was also mentioned in
  the code comment) between the tools, which uncovered couple errors
  in the code. Those issues were either solved or disabled by
  the inline comments

* Introduce the golangci-lint config, to make their
  configuration more manageable

* Build: replace backend-lint.sh script with make
2019-07-02 16:06:59 +03:00
kay delaney
364f1f2e55 Explore: Log highlights only update when user stops typing (#17845)
Reverts performance enhancements made to LogsContainer as they are no
longer needed, and complicated things.
Closes #17818
2019-07-02 09:06:21 +01:00
kay delaney
0a1bb97a2f Loki: getHighlighterExpressionsFromQuery Returns null if filter term is not quoted (#17852)
Closes #17687
2019-07-02 09:06:04 +01:00
Leonard Gram
8f150c67aa Docs upgrading deps (#17657)
* Docs: correct link to the Grafana build-container.

* Docs: documents usage on the gopath when upgrading deps.

* Dev docs: info for upgrading deps only in one location.
2019-07-02 09:43:25 +02:00
Leonard Gram
d71043609e Testing: Include BatchRevoke for all tokens in the fake. (#17728) 2019-07-02 09:42:35 +02:00
Ryan McKinley
e7c3d0ed97 Refactor: rename SeriesData to DataFrame (#17854) 2019-07-01 12:00:29 -07:00
Kyle Brandt
c9f4cf8b53 devenv: switch OpenTSDB docker block (#17849)
old docker image, https://hub.docker.com/r/opower/opentsdb/,  seems to be gone
2019-07-01 09:11:25 -04:00
Oleg Gaidarenko
ca136c7c22 Devenv:LDAP: couple simplifications for LDAP (#17807)
* Add LDAP config instead sed use

* Add container name

* Add SizeLimit option to client and to server.
  Probably useless at this point, but it's better to have it then otherwise
2019-07-01 15:09:04 +03:00
Oleg Gaidarenko
5836427794 Login: divide login errors by pkg and service (#17835)
Define errors in the login module only if they are used
2019-07-01 14:32:17 +03:00
Sofia Papagiannaki
f3f03ceb6a Auth Proxy: Respect auto_sign_up setting (#17843)
* Add test for disabled auth proxy auto signup option

* Set correctly auth proxy auto signup
2019-07-01 14:29:41 +03:00
Alexander Zobnin
c2affdee1e OAuth: return github teams as a part of user info (enable team sync) (#17797)
* OAuth: github team sync POC

* OAuth: minor refactor of github module

* OAuth: able to use team shorthands for github team sync

* support passing a list of groups via auth-proxy header
2019-07-01 12:30:17 +03:00
Tobias Skarhed
4e27ba9646 noImplicitAny: Sub 3000 errors (#17821)
* noImplicitAny Stackdriver

* Sub 3000 noImplicitAny

* Update error count limit

* Add DataQueryRequest type
2019-07-01 11:11:57 +02:00
Torkel Ödegaard
bd4a7ddf3a TimePicker: Style and responsive fixes, restored dashboard settings (#17822)
* TimePicker: Restore time picker settings

* CleanUp: removed unuused angular-ui (calendar) components

* Fix angular boot dependency list

* TimePicker: set time to 23:59:00 when setting To time using calendar
2019-07-01 10:16:33 +02:00
Eduard Sergeev
d94bdb930f Templating: Correctly display __text in multi-values variable (#17840)
Fixes #17839: __value is displayed instead of __text when single item is selected
2019-07-01 09:42:36 +02:00
Marcus Efraimsson
0833f26b43 Elasticsearch: Fix default max concurrent shard requests (#17770)
Elasticsearch v7.0 changed the behavior of max concurrent shard
requests and the default to 5. v5.6 and before 7.0 the default
is 256. This adds some additional behavior given certain
version is selected when configure the datasource to set
default max concurrent shard requests.
Changing from a version pre-v7.0+ to v7.0+ sets max
concurrent shard requests to 5.
Changing from a version v7.0+ to a pre-v7.0 sets max
concurrent shard requests to 256.

Fixes #17454
2019-06-28 18:38:16 +02:00
Marcus Efraimsson
53db823511 Explore: Fix filter by series level in logs graph (#17798)
Adds back support for filtering log messages by series level 
in logs graph which seem to have been broken since merging
of #17027.

Fixes #17769
2019-06-28 17:05:59 +02:00
Marcus Efraimsson
c392a492ae Docs: Add v6.3 version notes and encryption format information (#17825)
Adds version note for alert rule tags.
Adds version note for graph data links.
Adds information about secret_key and encryption format in use

Fixes #17815
Fixes #17803
2019-06-28 16:32:42 +02:00
Sofia Papagiannaki
d9fea07e6e Graphite: use POST for /metrics/find requests (#17814)
* Add test that expects a POST request

* Change graphite /metric/find request to POST

Query parameter can become large enough
to exceed GET URI limits.

* Fix requests with time range

Initialise httpOptions.params

* Fix for supporting queries referencing template variable
2019-06-28 16:21:32 +03:00
Ryan McKinley
70d4dfe9f7 Dashboard: Force update after dashboard resize (#17808) 2019-06-28 14:25:38 +02:00
Dominik Prokop
742e0d56eb Toolkit: moved front end cli scripts to separate package and introduced very early version of plugin tools
* Move cli to grafana-toolkit

* Moving packages, fixing ts

* Add basics of plugin build task

* Add toolkit build task

* Circle - use node 10 for test-frontend

* Prettier fix

* First attempt for having shared tsconfig for plugins

* Add enzyme as peer depencency

* Do not expose internal commands when using toolkit from npm package

* Introduce plugin linting

* Fix missing file

* Fix shim extenstion

* Remove rollup typings

* Add tslint as dependency

* Toolkit - use the same versions of enzyme and tslint as core does

* Remove include property from plugin tsconfig

* Take failed suites into consideration when tests failed

* Set ts-jest preset for jest

* Cleanup tsconfig.plugins

* Add plugin:test task

* Rename file causing build failute

* Fixing those missed renames

* Add ts as peer dependency

* Remove enzyme dependency and tweak test plugin task

* Allow jest options overrides via package.json config

* Improvements

* Remove rollup node packages

* TMP : Fix ts errors when linked

* use local tslint if it exists

* support coverage commands

* Fix merge

* fix build

* Some minors

* Make jest pass when no tests discovered
2019-06-28 14:11:12 +02:00
Hugo Häggmark
ead4b1f5c7 Explore: Uses new TimePicker from Grafana/UI (#17793)
* Wip: Intiail commit

* Refactor: Replaces TimePicker in Explore

* Refactor: Removes Angular TimePicker folder

* Refactor: Adds tests for getShiftedTimeRange

* Fix: Fixes invalid import to removed TimePicker

* Fix: Fixes dateTime tests

* Refactor: Reuses getShiftedTimeRange for both Explore and Dashboards

* Refactor: Shares getZoomedTimeRange between Explore and Dashboard
2019-06-28 12:07:55 +02:00
Hugo Häggmark
2379de53c4 Explore: Uses RFC3339Nano string to retrieve LogRow contexts from Loki API (#17813)
* Refactor: Uses nanosecond string to retreive LogRow contexts

* Reafactor: Small changes to comments after PR comments
2019-06-28 10:47:19 +02:00
Tobias Skarhed
0b9de3f761 noImplicitAny: Lower count to about 3450 (#17799) 2019-06-27 15:56:02 +02:00
Torkel Ödegaard
8fcc370fe9 Graphite: Fixes issue with seriesByTag & function with variable param (#17795)
Fixes #17696
2019-06-27 14:10:43 +02:00
Tobias Skarhed
3045daedbd noImplicitAny: Reduce errors to 3800-ish (#17781)
* Reduce noImplicitAny errors to 3900-ish

* Fix lots of errors

* Add interface
2019-06-27 13:21:04 +02:00
Torkel Ödegaard
013a1abb6f Graphite: remove feature that moves alias function last (#17791) 2019-06-27 11:16:11 +02:00
kay delaney
5f3a71bc7a Explore: Adds URL support for select mode (#17755)
Adds URL support for mode state (Metrics/Logs). It's important 
to be able to share a link to logs when a data source supports 
both metrics and logs.

Closes #17101
2019-06-27 11:11:49 +02:00
Ryan McKinley
021f5351fa TestData: add option to increase the number of test streams (#17789)
* variable number of points

* add variable number of bands
2019-06-27 10:28:35 +02:00
Marcus Efraimsson
0a3f977ea2 Usage Stats: Update known datasource plugins (#17787) 2019-06-26 21:15:45 +02:00
kay delaney
3af7eeb331 Docs: Adds section on Querying Logs for Elasticsearch (#17730)
Closes #17713
2019-06-26 20:06:32 +02:00
Hugo Häggmark
f53f0c8063 Docs: Adds section on Querying Logs for InfluxDB (#17726)
Fixes #17715
2019-06-26 19:40:38 +02:00
Leonard Gram
8493965d31 Devenv: makes the grafana users default for saml. (#17782) 2019-06-26 16:10:45 +01:00
Hugo Häggmark
7cac7435ce Explore: Displays only one Time column as configured in TimeZone settings (#17775)
* Refactor: Removes switches for TimeStamp and LocalTime and displays time as configured for user

* Styles: Updates classname used to display timeUtc

* Refactor: Adds switch for Time column
2019-06-26 13:35:23 +02:00
Tobias Skarhed
8541214c9e Markdown: Replace rendering library (#17686)
* Replace remarkable with marked

* Add wrapper and options for marked
2019-06-26 13:15:45 +02:00
Sofia Papagiannaki
6fb36e705f ApiKeys: Fix check for UTC timezone (#17776)
getTimeZone() no longer returns an object, but a string
2019-06-26 10:26:16 +02:00
Torkel Ödegaard
40e5c4f8ba Prometheus: Minor style fix (#17773)
* Prometheus: Minor style fix

* Updated snapshot
2019-06-26 09:56:11 +02:00
Torkel Ödegaard
7acbb94bb8 Docs: fixed notifications table 2019-06-26 09:44:19 +02:00
Sofia Papagiannaki
dc9ec7dc91 Auth: Allow expiration of API keys (#17678)
* Modify backend to allow expiration of API Keys

* Add middleware test for expired api keys

* Modify frontend to enable expiration of API Keys

* Fix frontend tests

* Fix migration and add index for `expires` field

* Add api key tests for database access

* Substitude time.Now() by a mock for test usage

* Front-end modifications

* Change input label to `Time to live`
* Change input behavior to comply with the other similar
* Add tooltip

* Modify AddApiKey api call response

Expiration should be *time.Time instead of string

* Present expiration date in the selected timezone

* Use kbn for transforming intervals to seconds

* Use `assert` library for tests

* Frontend fixes

Add checks for empty/undefined/null values

* Change expires column from datetime to integer

* Restrict api key duration input

It should be interval not number

* AddApiKey must complain if SecondsToLive is negative

* Declare ErrInvalidApiKeyExpiration

* Move configuration to auth section

* Update docs

* Eliminate alias for models in modified files

* Omit expiration from api response if empty

* Eliminate Goconvey from test file

* Fix test

Do not sleep, use mocked timeNow() instead

* Remove index for expires from api_key table

The index should be anyway on both org_id and expires fields.
However this commit eliminates completely the index for now
since not many rows are expected to be in this table.

* Use getTimeZone function

* Minor change in api key listing

The frontend should display a message instead of empty string
if the key does not expire.
2019-06-26 09:47:03 +03:00
fxmiii
19185bd0af 17278 prometheus step align utc (#17477)
* Update datasource.ts

* Update datasource.test.ts

* utcOffset reverse

from moment docs, utcOffset "function returns the real offset from UTC, not the reverse offset"

* add utcOffset() to DateTime interface

method returns the UTC offset as a number of minutes

* Fixed test
2019-06-26 07:55:36 +02:00
Tobias Skarhed
654f1f2eb6 Docs: Update release guide (#17759)
and add comment about Rollup namedExports
2019-06-26 07:35:58 +02:00
Kyle Brandt
5aa13eeb76 release: update latest.json to v6.2.5 (#17767) 2019-06-25 21:16:01 +02:00
Kyle Brandt
b9fda28e27 release: 6.2.5 changelog (#17766) 2019-06-25 15:10:42 -04:00
Alexandre de Verteuil
4f1d495ba1 Fix typo s/Applicaiton/Application/ in error messages (#17765) 2019-06-25 20:59:58 +02:00
Alexander Zobnin
77375f3772 UserAdmin: UI for disabling users (#17333)
* Feat: initial disable user UI

* batch disable users

* batch revoke users tokens

* split batch disable user and revoke token

* API: get users with auth info and isExternal flag

* fix tests for batch disable users

* Disable users: show is user external or not

* Users: refactor /api/users/search endpoint

* Users: use alias for "user" table

* Chore: add BatchDisableUsers() to the bus

* Users: order user list by id explicitly

* Chore: switch back to /api/users/search endpoint

* Users: move disable button to user profile page

* Users: return AuthModule from /api/users/:id endpoint

* Users: do not return unused fields

* Users: mute auth badge for disabled users

* Users: move disable button to the user section

* Users: fix SearchUsers method after last changes

* User: return auth module as array for future purposes

* User: tests for SearchUsers()

* User: return only latest auth module in SearchUsers()

* User: fix JOIN, get only most recent auth module

* Users: fix ldap badge after backed changes

* Users: show tooltip for inactive disable/enable button

* Users: move delete button to edit user view

* Users: put deactivated badge on the user list

* Users: minor refactor

* Users: adjust deactivated badge style

* Minor design changes
2019-06-25 18:49:12 +02:00
Alexander Zobnin
dad894f1cc API: get list of users with additional auth info (#17305)
* batch disable users

* batch revoke users tokens

* split batch disable user and revoke token

* API: get users with auth info and isExternal flag

* fix tests for batch disable users

* Users: refactor /api/users/search endpoint

* Users: use alias for "user" table

* Chore: add BatchDisableUsers() to the bus

* Users: order user list by id explicitly

* Users: return AuthModule from /api/users/:id endpoint

* Users: do not return unused fields

* Users: fix SearchUsers method after last changes

* User: return auth module as array for future purposes

* User: tests for SearchUsers()

* User: return only latest auth module in SearchUsers()

* User: fix JOIN, get only most recent auth module
2019-06-25 18:29:07 +03:00
Torkel Ödegaard
40708bef10 TimePicker: fixed minor issues with new timepicker (#17756) 2019-06-25 16:39:48 +02:00
Hugo Häggmark
2c5400c61e Explore: Parses and updates TimeSrv in one place in Explore (#17677)
* Wip: Adds timeEpic

* Refactor: Introduces absoluteRange in Explore state

* Refactor: Removes changeTime action

* Tests: Adds tests for timeEpic

* Refactor: Spells AbsoluteRange correctly
2019-06-25 13:44:19 +01:00
Tobias Skarhed
6be1606bd8 @grafana/ui: release (#17754)
* Specifying named exports for slate

* Make sure tests are performed at the beginning

* Version bump
2019-06-25 14:13:39 +02:00
Tobias Skarhed
0904607eda Password: Remove PasswordStrength (#17750)
* Closes #17748

* Remove remaining occurences

* And the last one
2019-06-25 13:56:35 +02:00
Oleg Gaidarenko
e83953f24e Devenv:SAML: devenv block with saml test app (#17733)
* Devenv:SAML: devenv block with saml test app

Includes documentation, couple custom users and
actual docker-compose of course :)

Ref: #4780
2019-06-25 13:31:27 +02:00
Oleg Gaidarenko
31d2905490 LDAP:Docs: add information on LDAP sync feature and update LDAP sync default (#17689)
* Docs: for LDAP active sync feature
2019-06-25 12:54:13 +02:00
Torkel Ödegaard
335cec07a5 Graph: Add data links feature (click on graph) (#17267)
* WIP: initial panel links editor

* WIP: Added dashboard migration to new panel drilldown link schema

* Make link_srv interpolate new variables

* Fix failing tests

* Drilldown: Add context menu to graph viz (#17284)

* Add simple context menu for adding graph annotations and showing drilldown links

* Close graph context menu when user start scrolling

* Move context menu component to grafana/ui

* Make graph context menu appear on click, use cmd/ctrl click for quick annotations

* Move graph context menu controller to separate file

* Drilldown: datapoint variables interpolation (#17328)

* Add simple context menu for adding graph annotations and showing drilldown links

* Close graph context menu when user start scrolling

* Move context menu component to grafana/ui

* Make graph context menu appear on click, use cmd/ctrl click for quick annotations

* Add util for absolute time range transformation

* Add series name and datapoint timestamp interpolation

* Rename drilldown link variables tot snake case, use const values instead of strings in tests

* Bring LinkSrv.getPanelLinkAnchorInfo for compatibility reasons and add deprecation warning

* Rename seriesLabel to seriesName

* Drilldown: use separate editors for panel and series links (#17355)

* Use correct target ini context menu links

* Rename PanelLinksEditor to DrilldownLinksEditor and mote it to grafana/ui

* Expose DrilldownLinksEditor as an angular directive

* Enable visualization specifix drilldown links

* Props interfaces rename

* Drilldown: Add variables suggestion and syntax highlighting for drilldown link editor (#17391)

* Add variables suggestion in drilldown link editor

* Enable prism

* Fix backspace not working

* Move slate value helpers to grafana/ui

* Add syntax higlighting for links input

* Rename drilldown link components to data links

* Add template variabe suggestions

* Bugfix

* Fix regexp not working in Firefox

* Display correct links in panel header corner

* bugfix

* bugfix

* Bugfix

* Context menu UI tweaks

* Use data link terminology instead of drilldown

* DataLinks: changed autocomplete syntax

* Use singular form for data link

* Use the same syntax higlighting for built-in and template variables in data links editor

* UI improvements to context menu

* UI review tweaks

* Tweak layout of data link editor

* Fix vertical spacing

* Remove data link header in context menu

* Remove pointer cursor from series label in context menu

* Fix variable selection on click

* DataLinks: migrations for old links

* Update docs about data links

* Use value time instead of time range when interpolating datapoint timestamp

* Remove not used util

* Update docs

* Moved icon a bit more down

* Interpolate value ts only when using __value_time variable

* Bring href property back to LinkModel

* Add any type annotations

* Fix TS error on slate's Value type

* minor changes
2019-06-25 11:38:51 +02:00
kay delaney
cbe057fce8 Explore: Changes LogsContainer from a PureComponent to a Component (#17741) 2019-06-25 09:10:20 +01:00
Dominik Prokop
48570c4286 Chore: Remove tether and tether drop dependency in grafana/ui (#17745) 2019-06-25 09:57:57 +02:00
Tobias Skarhed
1b17b7893f noImplicitAny: time region manager etc. (#17729)
* Fix errors

* Wrong branch

* minor type fix
2019-06-25 09:49:31 +02:00
Tobias Skarhed
75c29566a6 Panel: Fully escape html in drilldown links (was only sanitized before) (#17731)
* Sanitize HTML

* Replace sanitization lib and check for config

* Add htmlToText

* Refactor: Renaming htmlToText to escapeHtml
2019-06-25 09:06:28 +02:00
Marcus Efraimsson
5713048f48 Alerting: Improve alert rule testing (#16286)
* tsdb: add support for setting debug flag of tsdb query

* alerting: adds debug flag in eval context

Debug flag is set when testing an alert rule and this debug
flag is used to return more debug information in test aler rule
response. This debug flag is also provided to tsdb queries so
datasources can optionally add support for returning additional
debug data

* alerting: improve test alert rule ui

Adds buttons for expand/collapse json and copy json to clipboard,
very similar to how the query inspector works.

* elasticsearch: implement support for tsdb query debug flag

* elasticsearch: embedding client response in struct

* alerting: return proper query model when testing rule
2019-06-25 08:52:17 +02:00
Marcus Efraimsson
eecd8d1064 Elasticsearch: Visualize logs in Explore (#17605)
* explore: try to use existing mode when switching datasource

* elasticsearch: initial explore logs support

* Elasticsearch: Adds ElasticsearchOptions type
Updates tests accordingly

* Elasticsearch: Adds typing to query method

* Elasticsearch: Makes maxConcurrentShardRequests optional

* Explore: Allows empty query for elasticsearch datasource

* Elasticsearch: Unifies ElasticsearchQuery interface definition
Removes check for context === 'explore'

* Elasticsearch: Removes context property from ElasticsearchQuery interface
Adds field property
Removes metricAggs property
Adds typing to metrics property

* Elasticsearch: Runs default 'empty' query when 'clear all' button is pressed

* Elasticsearch: Removes index property from ElasticsearchOptions interface

* Elasticsearch: Removes commented code from ElasticsearchQueryField.tsx

* Elasticsearch: Adds comment warning usage of for...in to elastic_response.ts

* Elasticsearch: adds tests related to log queries
2019-06-24 21:15:03 +01:00
gotjosh
2fb45eeec8 Grafana-CLI: Wrapper for grafana-cli within RPM/DEB packages and config/homepath are now global flags (#17695)
* Feature: Introduce a grafana-cli wrapper

When our users install the *nix packed version of grafana, tendency is to use the services and scripts installed as part of the package for grafana-server. These leverage the default configuration options by specifying the several default paths.

This introduces a similar approach for the grafana-cli binary. We exposed it through a wrapper to ensure a proper configuration is in place. To enable that, we add the .real suffix to the original binary (grafana-cli.real) and then use a bash script named grafana-cli as the wrapper.

* Make the config and homepath flags global

* Introduce `configOverrides` as a global flag

This flag allows us to pass configuration overrides as a string.

The string follows the convention of configuration arguments separated by a space e.g. "cfg:default.paths.data=/dev/nullX cfg:default.paths.logs=/dev/nullX"

Also, it is backwards compatible with similar the previous configuration method through tailing arguments. Tailing arguments take presedence over the configuration options string.

* Only log configuration information in debug mode

* Move the grafana-cli binary to $GRAFANA_HOME/bin

As part of the package install process, we copy all the release files and
directories into the grafana home directory. This includes the /bin folder
from where we copied the binaries into their respective destinations.
After that, the /bin folder gets deleted as we don't want to keep
duplicates of the binaries around.

As part of this commit, we moved the re-creation of /bin within
grafana-home and the copy of the original binary (again) after the
folder gets deleted.
2019-06-24 20:20:21 +01:00
Sofia Papagiannaki
e7e9d3619e Add guidelines for SQL date comparisons (#17732) 2019-06-24 20:39:28 +03:00
Leonard Gram
4c97d26102 Docs: clarified usage of go get and go mod (#17637) 2019-06-24 18:29:57 +02:00
Marcus Efraimsson
c41eba92fe Project: Issue triage doc improvement (#17709)
Adds some fixes of types and a new section describing how 
you can help with the Grafana project related to issues.

Ref #17648
2019-06-24 18:00:21 +02:00
gotjosh
bc94f85dee Improvement: Grafana release process minor improvements (#17661)
* Don't display changelog category title when no items

The output of the changelog is meant to be copy/pasted with ease. When a
changelog category does not contain items is better to not display title
at all thus avoiding having the manually modify the output as we include
it in the steps of the process.

* Introduce a CLI task to close milestones whilst doing a Grafana release

As part of a Grafana release, we need to eventually close the GitHub
milestone to indicate is done and remove all the cherry-pick labels from
issues/prs within the milestone to avoid our cherry-pick CLI command to
pick them up on the next release.

* Abstract the GitHub client into a module

* Introduce `GitHubClient` to all CLI tasks
2019-06-24 16:00:01 +01:00
Johannes Schill
0412a28d2e TimePicker: New time picker dropdown & custom range UI (#16811)
* feat: Add new picker to DashNavTimeControls

* chore: noImplicitAny limit reached

* chore: noImplicityAny fix

* chore: Add momentUtc helper to avoid the isUtc conditionals

* chore: Move getRaw from Explore's time picker to grafana/ui utils and rename to getRawRange

* feat: Use helper functions to convert utc to browser time

* fix: Dont Select current value when pressing tab when using Time Picker

* fix: Add tabIndex to time range inputs so tab works smoothly and prevent mouseDown event to propagate to react-select

* fix: Add spacing to custom range labels

* fix: Updated snapshot

* fix: Re-adding getRaw() temporary to fix the build

* fix: Disable scroll event in Popper when we're using the TimePicker so the popup wont "follow" the menu

* fix: Move all "Last xxxx" quick ranges to the menu and show a "UTC" text when applicable

* fix: Add zoom functionality

* feat: Add logic to mark selected option as active

* fix: Add tooltip to zoom button

* fix: lint fix after rebase

* chore: Remove old time picker from DashNav

* TimePicker: minor design update

* chore: Move all time picker quick ranges to the menu

* fix: Remove the popover border-right, since the quick ranges are gone

* chore: Remove function not in use

* Fix: Close time picker on resize event

* Fix: Remove border bottom

* Fix: Use fa icons on prev/next arrows

* Fix: Pass ref from TimePicker to TimePickerOptionGroup so the popover will align as it should

* Fix: time picker ui adjustments to get better touch area on buttons

* Fix: Dont increase line height on large screens

* TimePicker: style updates

* Fix: Add more prominent colors for selected dates and fade out dates in previous/next month

* TimePicker: style updates2

* TimePicker: Big refactorings and style changes

* Removed use of Popper not sure we need that here?
* Made active selected item in the list have the "selected" checkmark
* Changed design of popover
* Changed design of and implementation of the Custom selection in the dropdown it did not feel like a item you
could select like the rest now the list is just a normal list

* TimePicker: Refactoring & style changes

* TimePicker: use same date format everywhere

* TimePicker: Calendar style updates

* TimePicker: fixed unit test

* fixed unit test

* TimeZone: refactoring time zone type

* TimePicker: refactoring

* TimePicker: finally to UTC to work

* TimePicker: better way to handle calendar utc dates

* TimePicker: Fixed tooltip issues

* Updated snapshot

* TimePicker: moved tooltip from DashNavControls into TimePicker
2019-06-24 14:39:59 +02:00
Kyle Brandt
0adbb001db RemoteCache: redis connection string parsing test (#17702) 2019-06-24 11:51:38 +02:00
Sofia Papagiannaki
d0852f0618 Fix link in pkg/README (#17714)
Remove leading backslash from url
2019-06-24 10:34:51 +03:00
David
4ddeb94f52 Dashboard: Use Explore's Prometheus editor in dashboard panel edit (#15364)
* WIP prometheus editor same in panel

* Dont use panel in plugin editors

* prettiered modified files

* Fix step in external link

* Prevent exiting edit mode when slate suggestions are shown

* Blur behavior and $__interval variable

* Remove unused query controller

* Basic render test

* Chore: Fixes blacklisted import

* Refactor: Adds correct start and end time
2019-06-24 08:42:08 +02:00
Sergey Goppikov
dda8b731e8 Settings: Fix typo in defaults.ini (#17707)
`backround` -> `backGround`
2019-06-23 17:38:30 +02:00
Marcus Efraimsson
70b4fc8483 Project: Adds a security policy (#17698)
Adds a security policy document. For reference, https://help.github.com/en/articles/adding-a-security-policy-to-your-repository.

Closes #17649
2019-06-23 00:25:29 +02:00
Marcus Efraimsson
0a74a3329c Project: Adds support resource docs (#17699)
Adds a support resource document. For reference, 
https://help.github.com/en/articles/adding-support-resources-to-your-project.

Closes #17650
2019-06-22 13:51:32 +02:00
Marcus Efraimsson
ec3b91e6b2 Document issue triage process (#17669)
Adds a first version of project documentation/guideline for triaging 
of issues. This adds some additional content and context so that 
the issue triage process can be understood by both maintainers 
and existing/new contributors and other interested parties.

Co-Authored-By: Andrej Ocenas <mr.ocenas@gmail.com>

Closes #17648
2019-06-21 02:20:45 +02:00
Tobias Skarhed
219d711597 noImplicitAny: slate (#17681)
* Update slate types

* Fix noImplicitAny
2019-06-20 20:41:01 +02:00
Kyle Brandt
49f0f0e89e config: fix connstr for remote_cache (#17675)
fixes #17643 and adds test to check for commented out lines (but will only catch `;`, not `#`).
2019-06-20 10:15:21 -04:00
kay delaney
57dadebbd8 Explore: Improves performance of Logs element by limiting re-rendering (#17685)
* Explore: Improves performance of Logs element by limiting re-rendering
Re-renders only when query has finished executing or when deduplication
strategy changes.
Closes #17663

* Explore: Adds logsHighlighterExpressions as prop to consider when re-rendering Logs
2019-06-20 12:56:47 +01:00
Jared Burns
6fd4aa4b46 Docs: Flag serve_from_sub_path as available in 6.3 (#17674)
Follow-up to PR #17048. Flag the new serve_from_sub_path option as available in 6.3.
2019-06-20 07:06:09 +02:00
Ryan McKinley
428134482d @grafana/runtime: expose config and loadPluginCss (#17655)
* move config to grafana runtime

* set defaults

* defaults in constructor

* use @types/systemjs

* rename Settings to GrafanaBootConfig
2019-06-19 11:31:47 -07:00
Tobias Skarhed
c9ad411d8e noImplicitAny: Fix basic errors (#17668)
* Fix basic noImplicitAny errors

* noImplicitAny HeatmapCtrl

* Update error limit
2019-06-19 19:59:03 +02:00
Dominik Prokop
433e5ac049 Docs: Update readme to reference correct repo (#17666) 2019-06-19 16:10:45 +02:00
Oleg Gaidarenko
1c08e58605 LDAP: small improvements to various LDAP parts (#17662)
* Add multildap config example

* Publicize mocks for multildap module
2019-06-19 15:46:04 +02:00
Tobias Skarhed
17826796da Chore: Fix noImplicitAny issues (#17636)
* noImplicitAny: TableRenderer

* noImplicitAny and add types

* HeatmapData interface

* Heatmap rendering

* Fix optional type

* Remove use of lodash
2019-06-19 13:40:42 +02:00
Tobias Skarhed
7eb820081d AddPanel: Fix issue when removing moved add panel widget (#17659)
* Fixes #17592

* Remove console.log
2019-06-19 13:12:04 +02:00
Ryan McKinley
35e1524b02 TablePanel: fix annotations display (#17646) 2019-06-18 11:56:09 -07:00
Kyle Brandt
bd08d8ce8e middleware: fix Strict-Transport-Security header (#17644)
fixes #17641
2019-06-18 14:24:23 -04:00
Ryan McKinley
401615847c Build: add @grafana/data package (#17436)
first step in moving non-ui components to their own package
2019-06-18 08:17:27 -07:00
Josue Abreu
efdfb1fce3 Update latest.json for 6.2.4 2019-06-18 13:36:17 +01:00
Josue Abreu
c784dadafe Update latest.json for 6.2.3 2019-06-18 13:36:17 +01:00
Josue Abreu
b6350fe6fb Update the changelog with v6.2.4 information 2019-06-18 13:20:41 +01:00
Hugo Häggmark
eca706f7c4 Build: Updates node image for e2e job (#17632) 2019-06-18 12:14:59 +02:00
kay delaney
477d5643b6 Explore: Prometheus query errors now show (#17470)
* Explore: Prometheus query errors now show
Fixes: #17435

* Explore: Adds test to ensure prometheus query errors are reported

* Explore: removes implicit anys introduced previously
2019-06-18 11:07:09 +01:00
Hugo Häggmark
12e417f2df Chore: Lowered implicit anys limit to 4599 (#17631)
Progress: #14714
2019-06-18 11:59:38 +02:00
Tobias Skarhed
8b8f2c4540 noImplicitAny: SingleStat panel (#17616)
* noImplicitAny on Singlestat

* Lower threshold

* Fix fixes
2019-06-18 11:44:17 +02:00
Hugo Häggmark
c75d026186 Build: Update node image for test-frontend job step (#17628) 2019-06-18 11:32:11 +02:00
gotjosh
7d68d6ede2 grafana-cli: Fix receiving flags via command line (#17617)
`grafana-cli` uses the third-party library to define the flags and not
the standard library. Using `flag.Parse` conflicts with the defined
flags from our third-party library.

In the case where `flag.Parse` is used, the CLI assumes that definitions
provided are not needed and will not define them; producing errors of
the kind `flag provided but not defined --example-flag`.

Using the context to read any arguments (including flags) is the
recommended approach by the third-party library.
2019-06-18 10:25:37 +01:00
Hugo Häggmark
3424b64299 Typescript: Removes implicit anys (#17625)
* Chore: Remove implicit anys from ResultProcessor and tests

* Chore: Removes implicit anys for /loki/**/*.ts

* Chore: Removes implicit anys for prometheus/**/*
2019-06-18 11:01:12 +02:00
kay delaney
d6ee96ee64 Explore: Removes minus button in adhoc query field (#17573)
Closes #17571
2019-06-18 09:48:32 +01:00
Remi Verchere
4c4c689907 Correct 6.2.3 release date (#17624) 2019-06-18 09:40:08 +02:00
Carl Bergquist
b98bb48d59 codestyle: styleguide and arch for grafanas backend (#17545) 2019-06-18 09:31:51 +02:00
srid12
b950eebf99 JsonTree: fix jsonTree angular binding (#17608)
The API changed so it expects a numeric level rather than a boolean flag.  Since 6.1 plugins using jsonTree just show an empty div
2019-06-17 15:10:56 -07:00
Yann Verry
ed613194ac HTTPServer: Fix X-XSS-Protection header formatting (#17620)
Fixes #17619
2019-06-17 23:46:35 +02:00
Marcus Efraimsson
64841fe417 Changelog: Add known issues for v6.2.3 (#17615) 2019-06-17 17:35:13 +02:00
gotjosh
3563f71ba2 Update the changelog with v6.2.3 information (#17612) 2019-06-17 15:42:11 +01:00
Tobias Skarhed
6de75de755 Refactor buttons (#17611) 2019-06-17 16:15:49 +02:00
Hugo Häggmark
8192fa538e Tests: Replaces e2e tests truth screenshot (#17609) 2019-06-17 13:41:29 +02:00
gotjosh
6fbca90269 cli: grafana-cli should receive flags from the command line (#17606)
grafana-cli should allow configuration overrides to be received from the command line. e.g.

```
grafana-cli admin reset-password cfg:default.paths.logs=custom/log/directory/
```

Seems like we missed the inclusion of `flag.Parse` as we run the command,  to be able to consume them.

Additionally, it'll be useful for the user to know whenever these are being overriden or not - hence the addition of logging the configuration to be used as we run the command.
2019-06-17 11:27:26 +01:00
Martin Brenner
aa1f9cdd40 AppPlugin: Fix load legacy plugin app (#17574)
* first init meta befor set legacy components

* add load legacy app test

* AppPlugin: minor refactor
2019-06-15 08:26:31 +02:00
Tobias Skarhed
8ffef57178 Typescript: A batch of implicit any fixes (#17590)
* Reduce noImplicitAny errors

* Lower err count

* Static version

* Fix noImplicitAny

* Table: moved type file
2019-06-15 08:25:33 +02:00
Tobias Skarhed
2f00087a08 RefreshPicker: Handle empty intervals (#17585)
* Refresh picker empty

* RefreshPicker: refactoring
2019-06-15 08:24:52 +02:00
Carl Bergquist
f9b691bd54 Docker: Switch base to ubuntu:latest (#17066) 2019-06-14 22:57:55 +02:00
Oleg Gaidarenko
c853ef7318 SQLStore: extend user.SearchUsers method (#17514)
* SQLStore: extend `user.SearchUsers` method

Allow `user.SearchUsers` to search users based on their auth type
2019-06-14 09:50:38 +01:00
Hugo Häggmark
51c6b50582 Explore: Tag and Values for Influx are filtered by the selected measurement (#17539)
* Fix: Filters Tags and Values depending on options passed
Fixes: #17507

* Fix: Makes sure options is not undefined

* Fix: Fixes tests and small button refactor

* Chore: PR comments
2019-06-14 10:13:06 +02:00
Leonard Gram
37e9988e95 ldap: makes mocks available for testing. (#17576)
* ldap: makes mocks available for testing.
2019-06-14 09:54:19 +02:00
Andrej Ocenas
97f7c92455 Devenv: Add nginx proxy for mac (#17572) 2019-06-13 21:29:33 +02:00
Torkel Ödegaard
2c5c333858 Graph: Added new fill gradient option (#17528)
* Graph: Added new fill gradient option

* Graph: changed gradient area fill option, added test dashboard
2019-06-13 20:06:04 +02:00
Tobias Skarhed
375dc333f2 Typescript: Reduce implicit any errors (#17550)
* Fix types on linkSrv

* Lower err count, shoot down some errs, add type pkg

* Fix changes and add test

* Update public/app/features/panel/panel_ctrl.ts

Co-Authored-By: Hugo Häggmark <hugo.haggmark@gmail.com>

* Update public/app/features/panel/panel_ctrl.ts

Co-Authored-By: Hugo Häggmark <hugo.haggmark@gmail.com>

* Update public/app/features/panel/panellinks/link_srv.ts

Co-Authored-By: Hugo Häggmark <hugo.haggmark@gmail.com>

* Update public/app/features/panel/panel_ctrl.ts

Co-Authored-By: Hugo Häggmark <hugo.haggmark@gmail.com>

* Fix last types to compile

* Fix formatting issue

* Update public/app/features/panel/panel_ctrl.ts

Co-Authored-By: Hugo Häggmark <hugo.haggmark@gmail.com>
2019-06-13 20:04:15 +02:00
Daniele Ruggieri
74829f4898 SinglestatPanel: Manages when getColorForValue() function returns null value. Closes #9747 (#17552) 2019-06-13 20:00:13 +02:00
Oleg Gaidarenko
1b1d951495 LDAP: refactoring (#17479)
* LDAP: use only one struct

* Use only models.ExternalUserInfo

* Add additional helper method :/

* Move all the helpers to one module

* LDAP: refactoring

* Rename some of the public methods and change their behaviour

* Remove outdated methods

* Simplify logic

* More tests
  There is no and never were tests for settings.go, added tests for helper
  methods (cover is now about 100% for them). Added tests for the main
  LDAP logic, but there is some stuff to add. Dial() is not tested and not
  decoupled. It might be a challenge to do it properly

* Restructure tests:
   * they wouldn't depend on external modules
   * more consistent naming
   * logical division

* More guards for erroneous paths

* Login: make login service an explicit dependency

* LDAP: remove no longer needed test helper fns

* LDAP: remove useless import

* LDAP: Use new interface in multildap module

* LDAP: corrections for the groups of multiple users

* In case there is several users their groups weren't detected correctly

* Simplify helpers module
2019-06-13 16:47:51 +02:00
Dave
c78b6e2a67 Elasticsearch: Fix empty query request to send properly (#17488)
* ensure that empty Elasticsearch queries are properly set to *.  Fixes issue that appears when passing raw data from variables.

* combine null check and empty check into one
2019-06-13 15:45:31 +02:00
☃ pitr
a2370a379d SinglestatPanel: fix min/max config in singlestat sparklines (#17543) 2019-06-13 15:43:42 +02:00
Sofia Papagiannaki
7b70e7db2d AuthProxy: Optimistic lock pattern for remote cache Set (#17485)
* Implementation of optimistic lock pattern

Try to insert the remote cache key and handle integrity error

* Remove transaction

Integrity error inside a transaction results in deadlock

* Remove check for existing remote cache key

Is no longer needed since integrity constrain violations are handled

* Add check for integrity constrain violation

Do not update the row if the insert statement fails
for other than an integrity constrain violation

* Handle failing inserts because of deadlocks

If the insert statement fails because of a deadlock
try to update the row

* Add utility function for returning SQL error code

Useful for debugging

* Add logging for failing expired cache key deletion

Do not shallow it completely

* Revert "Add utility function for returning SQL error code"

This reverts commit 8e0b82c79633e7d8bc350823cbbab2ac7a58c0a5.

* Better log for failing deletion of expired cache key

* Add some comments

* Remove check for existing cache key

Attempt to insert the key without checking if it's already there
and handle the error situations

* Do not propagate deadlocks created during update

Most probably somebody else is trying to insert/update
the key at the same time so it is safe enough to ignore it
2019-06-13 15:36:09 +02:00
kay delaney
e11edf3fc2 Explore: Includes context parameter when invoking getExploreState() from Prometheus datasource (#17569)
Closes #17457
2019-06-13 14:14:09 +01:00
Hugo Häggmark
c59f308414 Tests: Replaces truth image (#17570) 2019-06-13 14:45:15 +02:00
Hugo Häggmark
fabc6f4241 Fix: Fixes merge conflict (#17568) 2019-06-13 12:46:10 +02:00
Hugo Häggmark
9e9fdb9cf1 Build: Fix failing e2e tests and implicit any check (#17567)
* Tests: Updates truth screen shot

* Fix: Fixes an implicit any error
2019-06-13 12:37:18 +02:00
kay delaney
d612beec25 Explore: Fixes implicit any error in AdHocFilterField.test.tsx (#17565) 2019-06-13 11:28:03 +01:00
Marcus Efraimsson
e1df51109e Fix so that correct cache is provided to di registry (#17566)
This fix prevents Grafana from crashing after being logged in.

Ref #17519
2019-06-13 12:15:52 +02:00
Kyle Brandt
073851f9c7 Build: Upgrades to golang 1.12.6 (#17542) 2019-06-13 11:08:48 +02:00
kay delaney
6170a039e5 Explore: Adds ability to remove filter from <AdHocFilterField /> key dropdown (#17553)
Also adds tests to validate behaviour
Query now reruns when filter is removed
Changes <AdHocFilterField /> such that after a measurement and field have been chosen,
just a '+' button is displayed, rather than an empty <AdHocFilter />

Closes #17544
Closes #17497
2019-06-13 10:00:53 +01:00
Carl Bergquist
6809d2bb29 codestyle: moves cache to infra (#17519) 2019-06-13 10:55:38 +02:00
Zayn-ul-Abdin
df917663e6 Docs feedback: installation/debian.md (#17563)
Closes #17129
2019-06-13 09:52:44 +02:00
Hugo Häggmark
8e1dfd32f9 Chore: Lowered implicit anys limit to 5131 (#17562)
Progress: #14714
2019-06-13 08:12:30 +02:00
Marcus Efraimsson
d168057fc6 Influx: Reset logs query field on clear all and clear row in explore (#17549)
Resets influx logs query field when hitting clear all and clear row 
in explore logs mode.

Fixes #17506
2019-06-12 17:27:13 +02:00
Marcus Efraimsson
f41a6c8962 Devenv: Add telegraf with log parsing to influxdb docker block (#17546) 2019-06-12 15:30:33 +02:00
kay delaney
0a3af385e1 Explore: Runs query when measurement/field and pairs are selected in logs mode for influx (#17523)
* Explore: Runs query when measurement/field and pairs are select in logs mode for influx
Closes #17500

* Explore: Modifies logic determining when to auto-run query during influx logs mode
Also adds test to validate this logic
2019-06-12 14:14:39 +01:00
kay delaney
2a47c315df Influx: Adds start page for logs in Explore (#17521)
* Influx: Adds start page for logs in Explore
Closes #17499

* Influx: Rebased with master and removed conditional display of cheat sheet in explore
Cheat sheet now displays during both Metrics and Logs mode, though this is only
temporary.
2019-06-12 14:01:48 +01:00
Maxim Ivanov
151fe240fc OAuth: Fix for wrong user token updated on OAuth refresh in DS proxy (#17541) 2019-06-12 13:47:38 +02:00
Kyle Brandt
599514ad68 middleware: add security related HTTP(S) response headers (#17522)
* x_xss_protection
  * strict_transport_security (HSTS)
  * x_content_type_options

these are currently defaulted to false (off) until the next minor release.

fixes #17509
2019-06-12 13:15:50 +02:00
Hugo Häggmark
41fb38d522 Docs: Clarifies from which version the Patch VERB is available (#17532)
* Docs: Clarifies from which version the Patch VERB is available

Closes: #17508

* Docs: Removes setting after PR comments
2019-06-12 11:14:30 +02:00
Johannes Schill
3da8cff6e9 Chore: Hugo upgrade (#17494)
* Fix: Upgrade hugo wip

* Chore: Rename index to _index for latest hugo

* Chore: Use relative refs, no starting slash

* Feat: Add possibility to mount layouts from grafana.org project
2019-06-12 08:01:44 +02:00
Mario Trangoni
ab4e1526b3 Codestyle: Fix some goconst issues (#17530)
Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
2019-06-12 07:27:47 +02:00
Hugo Häggmark
39e23ba672 Docs: Adds clarification to the provider name for provisioned dashboards (#17524)
Closes: #17516
2019-06-12 06:36:14 +02:00
☃ pitr
3e64214338 Singlestat: Add y min/max config to singlestat sparklines (#17527)
* Add scaling toggle to Singlestat panel

This toggle allows a user to choose between auto scaling or
zero-based scaling.

* Update Singlestat docs to include Zero Scale option

* Add min/max config to Singlestat sparklines y axis
2019-06-11 21:39:09 +02:00
Marcus Efraimsson
fcd2fb8b04 Explore: Clear queries when switching between metrics and logs (#17505)
This will clear the existing queries when switching between metrics and logs. 

Closes #17496
2019-06-11 16:18:33 +02:00
Shavonn Brown
40f95a95c0 16223 user auth token list and revoke (#17434)
* Start user auth token list on user profile (#16223)

* Now session found and first, better os regex (#16223)

* Revoke for user and admin user token manage (#16223)

* Tidying and styling (#16223)

* Tidying and styling (#16223)

* Update to use #16222 (#16223)

* Update for changes to 16222

* update per api issue
2019-06-11 14:23:54 +02:00
Shavonn Brown
a20309d7d2 Feature: Parse user agent string in user auth token api response (#16… (#17504)
* Feature: Parse user agent string in user auth token api response (#16222)

* Adding UA Parser Go modules attempt (#16222)

* Bring user agent vals up per req

* fix tests

* doc update

* update to flatten, no maps

* update doc
2019-06-11 14:12:52 +02:00
Hugo Häggmark
20f81539b8 Tests: Adds better logging to e2e tests (#17511) 2019-06-11 11:41:11 +02:00
Mario Trangoni
756989c10b Codestyle: Add typecheck and unused linters (#17491)
Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
2019-06-11 09:16:41 +02:00
Alexandre de Verteuil
4121b5da6b Docs: Add CircleCI step trigger-docs-update (#17481)
* Add CircleCI step trigger-docs-update

* Check changes to docs/* in CI/CD job trigger-docs-update
2019-06-10 16:23:23 +02:00
Kyle Brandt
c09fe3c3b4 remote_cache: Fix redis (#17483)
* wip: fix remote cache for redis
connstr parsing and non-negative expires for #17377
TODO: finish parse, check zero case, find out why negative duration in the first place

* finish parse.
Still TODO, find out negative value, and decide if would be better to make database specific entries in the .ini file

* update ini files

* remove accidental uncomment in defaults.ini

* auth_proxy: expiration non-negative so expiration is not in the past

* fix test, revert neg in redis

* review: use errutil
2019-06-10 15:27:08 +02:00
Kyle Brandt
826d33ea37 auth_proxy: non-negative cache TTL (#17495)
fixes setex error with redis on #17377
2019-06-10 15:25:23 +02:00
Hugo Häggmark
591ea0bfe3 Explore: Adds LogQueryField for InfluxDb (#17450)
* Wip: Intial commit

* Wip: Adds intial InfluxLogsQueryField

* Refactor: Adds measurements to InfluxLogQueryField

* Style: Tweaks styles and adds chosen measurement to measurements

* Refactor: Adds remove filter row

* refactor: make influx datasource typed

Uses the new api for exporting the plugin.

* adds metricFindQuery to DataSourceApi

metricFindQuery, getTagKeys and getTagValues now returns a promise

* influx: minor improvements

Limits logs result to 1000.
Don't show adhoc filter until measurement have been selected.

* Refactor: Adds fields to Cascader and uses chosen field as log column

Co-authored-by: Marcus <marcus.efraimsson@gmail.com>
2019-06-10 14:39:53 +02:00
Kyle Brandt
a95c7bfa6f sqlstore: clean quota and user_auth_tokens when removing users (#17487)
fixes #17392
2019-06-10 13:35:47 +02:00
Oleg Kovalov
6a76a92aff Prometheus: Preallocate data for Prometheus backend response parsing (#17490) 2019-06-10 08:12:46 +02:00
Qianli Ma
4ddb860727 Docs: Fix a typo in Elasticsearch docs (#17492) 2019-06-10 07:55:49 +02:00
Carl Bergquist
912df2e284 gtime: some code style refactoring (#17369) 2019-06-10 07:38:31 +02:00
Oleg Gaidarenko
bc7c420ee8 Build: make bra a local dependency (#17414)
Same idea as with the `gosec`, `revive` and etc.
Allows you to execute `make bra` as pinned local dependency instead
as global one. And therefore alleviates dependency installation issues.

README also updated - I was thinking to provide verbose installation instructions
for it. Since with that way we assume make is installed on the
developer system.

But it might be premature right now?
2019-06-07 16:42:08 +03:00
Oleg Gaidarenko
2316414786 Add tests for multildap (#17358)
That should get us to 100% coverage
2019-06-07 15:16:00 +03:00
Dominik Prokop
b17967e001 RefreshPicker: SetInterval comments to rxjs code added (#17404) 2019-06-07 11:54:25 +02:00
Carl Bergquist
1aadb4426a metrics: expose stats about roles as metrics (#17469) 2019-06-06 16:39:35 +02:00
rrFeng
c31b939e10 Explore: Handle newlines in LogRow Highlighter (#17425) 2019-06-06 13:55:04 +02:00
Thibault Chataigner
e06abb30aa Alerting: Add tags to alert rules (#10989)
Ref #6552
2019-06-06 13:29:30 +02:00
Tom McClellan
34f314552d Config: Add comment before log_queries in sample ini file (#17462) 2019-06-06 11:13:27 +02:00
Torkel Ödegaard
ad3f9c6663 CLI: Search perf test data (#17422)
* Search perf testdata cli task

* Test index

* REmoved test index
2019-06-06 10:05:08 +02:00
Patrick Hahn
606825703f Prometheus: Use overridden panel range as $_range instead of dashboard range (#17352)
The range variables get filled with the range from the query options,
not with the range in the timeSrv object. This means that panels that
use a relative time override get the correct values from the __range
variables.

Fixes #17102
2019-06-06 10:03:14 +02:00
Andrej Ocenas
0fa60a8450 Update latest (#17456) 2019-06-05 17:35:04 +02:00
Torkel Ödegaard
ad744beb60 NavModel: Fixed page header ui tabs issues for some admin pages (#17444) 2019-06-05 15:18:31 +02:00
Andrej Ocenas
dd52ff5ac5 Update changelog for 6.2.2 (#17452)
* Update changelog

* Fix whitespace
2019-06-05 15:05:44 +02:00
Torkel Ödegaard
de7856cf93 PluginConfig: Fixed plugin config page navigation when using subpath (#17364) 2019-06-05 13:24:48 +02:00
Jonathan Rockway
02975256d1 Tracing: allow propagation with Zipkin headers (#17009)
Closes #17006
2019-06-05 13:12:05 +02:00
Andrej Ocenas
1c3ad78672 Perf: Fix slow dashboards ACL query (#17427)
Fix slow ACL query for dashboards that was used as subquery on multiple places slowing down search and login in instances with many dashboards.
2019-06-05 10:55:50 +02:00
kay delaney
8a602e86f3 Explore: Fixes crash when parsing date math string with whitespace (#17446)
Fixes: #16257
2019-06-05 09:48:28 +01:00
Utkarsh Bhatnagar
a9da7b5f1f Cloudwatch: Add AWS DocDB metrics (#17241)
Closes #16535
2019-06-05 08:49:48 +02:00
Augustin Husson
c8382ba435 Provisioning: Support folder that doesn't exist yet in dashboard provisioning (#17407)
closes #17320
2019-06-04 22:23:08 +02:00
Mario Trangoni
87760d4fde Codestyle: Fix govet issues (#17178)
ref #10381

Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
2019-06-04 22:00:05 +02:00
Ryan McKinley
574a37e46f @grafana/runtime: expose location update (#17428) 2019-06-04 16:20:55 +02:00
Hugo Häggmark
10a4a89902 Fix: Adds context to list of keys that are not part of query (#17423)
Fixes: #17408
2019-06-04 14:07:25 +02:00
Charlie Briggs
8ef961bba5 Prometheus: Correctly escape '|' literals in interpolated PromQL variables (#16932)
This escape is currently not happening which breaks multi-value queries with
'|' characters in the variable value.

Added tests for 'interpolateQueryExpr' which should possibly be private, but is difficult to
test due to TemplateSrv calling it.

Closes #16840
2019-06-04 13:07:39 +02:00
Marcus Efraimsson
d1ab29c36d Explore: Makes it possible to use a different query field per mode (#17395) 2019-06-04 12:35:16 +02:00
Ryan McKinley
1e76f1a728 DataSourceApi: remove ExploreDataSourceApi (#17424) 2019-06-04 10:30:07 +02:00
Ryan McKinley
4066c55298 Fix: change angular loader paths (#17421) 2019-06-04 09:19:55 +02:00
Oleg Gaidarenko
f43af0e644 Build: specify build flag for docker-compose up (#17411)
Otherwise changed data will not get refreshed to the previous
state.

Which I think is not evident (unless you are familar with docker-compose).
and therefore error-prone (at least it did for me)
2019-06-03 21:09:29 +03:00
Ryan McKinley
96ba32d0c8 Add a @grafana/runtime package with backendSrv interface (#16533)
grafana-runtime/tsconfig.json imports query to avoid a build error  ¯\_(ツ)_/¯
2019-06-03 17:55:59 +02:00
Marcus Efraimsson
b7a9533476 Database: Initialize xorm with an empty schema for postgres (#17357)
xorm introduced some changes in
https://github.com/go-xorm/xorm/pull/824 and
https://github.com/go-xorm/xorm/pull/876 which by default will use
public as the postgres schema and this was a breaking change compared
to before. Grafana has implemented a custom postgres dialect so above
changes wasn't a problem here. However, Grafana's custom database
migration was using xorm dialect to check if the migration table exists
or not.
For those using a custom search_path (schema) in postgres configured on
server, database or user level the migration table check would not find
the migration table since it was looking in public schema due to xorm
changes above. This had the consequence that Grafana's database
migration failed the second time since migration had already run
migrations in another schema.
This change will make xorm use an empty default schema for postgres and
by that mimic the functionality of how it was functioning before
xorm's changes above.
Fixes #16720

Co-Authored-By: Carl Bergquist <carl@grafana.com>
2019-06-03 16:45:03 +02:00
Carl Bergquist
fbf37eb402 docs: configuring custom headers in the dataproxy (#17367)
closes #17348
2019-06-03 15:22:59 +02:00
Hugo Häggmark
fb39831df2 Explore: Queries the datasource once per run query and uses DataStreamObserver (#17263)
* Refactor: Removes replaceUrl from actions

* Refactor: Moves saveState thunk to epic

* Refactor: Moves thunks to epics

* Wip: removes resulttype and queries once

* Refactor: LiveTailing uses observer in query

* Refactor: Creates epics folder for epics and move back actioncreators

* Tests: Adds tests for epics and reducer

* Fix: Checks for undefined as well

* Refactor: Cleans up previous live tailing implementation

* Chore: merge with master

* Fix: Fixes url issuses and prom graph in Panels

* Refactor: Removes supportsStreaming and adds sockets to DataSourcePluginMeta instead

* Refactor: Changes the way we create TimeSeries

* Refactor: Renames sockets to streaming

* Refactor: Changes the way Explore does incremental updates

* Refactor: Removes unused method

* Refactor: Adds back Loading indication
2019-06-03 14:54:32 +02:00
Hugo Häggmark
5761179ad9 Feature: Adds redux action logging toggle from url params (#17368)
With live tailing introduced in Explore we now have a lot of actions dispatching and the Redux Dev Tools doesn't cope with the amount and rate of actions and crashes. This PR turns on redux action logging when you add logActions=true in the url and turns it off if you refresh the page or add logActions=false in the url.
2019-06-03 13:40:33 +02:00
Hugo Häggmark
20229a40eb Build: Adds e2e tests back to master workflow with better error messages and with artifacts (#17374)
* Refactor: Adds better error message and removes chromium download progess

* Test: Adds e2e tests to pr builds for testing purpose

* Tests: Changes path to screenshots

* Tests: Adds failing test just to test message and artifacts

* Tests: Removes failing test
2019-06-03 13:39:36 +02:00
Marcus Efraimsson
4fe6eaa0f7 Explore: Handle datasources with long names better in ds picker (#17393) 2019-06-03 11:41:41 +02:00
Dieter Plaetinck
95012271ac Annotations: Improve annotation option tooltips (#17384)
* should be 'Tags' not 'All'
* fix poor wording in 'Match any' tooltip
* add tooltip for 'Tags' input (untested! and can probably be worded
  better, i just don't know enough about the implementation)
2019-06-03 11:32:35 +02:00
Matthias Steffen
936308366e InfluxDB: Fixes single quotes are not escaped (#17398)
Fixes #17397
2019-06-03 11:25:46 +02:00
Johannes Schill
76e5657b47 Chore: Bump axios to 0.19.0 (#17403) 2019-06-03 11:22:54 +02:00
Carl Bergquist
d8736a2547 Alerting: golint fixes for alerting (#17246) 2019-06-03 10:25:58 +02:00
Alexander Zobnin
60ddad8fdb Batch disable users (#17254)
* batch disable users

* batch revoke users tokens

* split batch disable user and revoke token

* fix tests for batch disable users

* Chore: add BatchDisableUsers() to the bus
2019-05-31 13:22:22 +03:00
Marcus Efraimsson
1497f3d79a Chore: Remove unused properties in explore (#17359)
This removes unused properties in explore and datasource 
meta data (tables and explore properties in plugin.json).
2019-05-31 09:45:53 +02:00
Bernard Duggan
a0bb01103e MySQL/Postgres/MSSQL: Add parsing for day, weeks and year intervals in macros (#13086)
closes #11431
2019-05-30 09:58:29 +02:00
Dan Cech
5e7537878e Security: Prevent csv formula injection attack (#17363)
* mitigate https://www.owasp.org/index.php/CSV_Injection

- prepend csv cell values that begin with -, +, = or @ with '
- trim trailing whitespace from all csv values

* test for csv formula injection mitigation
2019-05-30 07:07:19 +02:00
Oleg Gaidarenko
a3092dc57b LDAP: remove unused function (#17351) 2019-05-29 16:12:42 +03:00
Oleg Gaidarenko
d4ef19737e Enterprise: remove gofakeit dep (#17344)
* Enterprise: remove gofakeit dep

Since we decided to use our uuid generation inside util module

* Enterprise: result of execution of `go mod ...`
2019-05-29 15:55:51 +03:00
Marcus Efraimsson
e951e71843 Explore: Update time range before running queries (#17349)
This makes sure that refresh/update/run query are parsing a
relative time range to get proper epoch time range before
running queries.

Fixes #17322
2019-05-29 13:47:05 +02:00
Oleg Gaidarenko
0a92de623d Build(package.json): improve npm commands (#17022)
Remove some of the repetitions in the npm commands
2019-05-29 11:54:07 +03:00
Carl Bergquist
fd741cbea4 Chore: upgrade webpack analyser (#17340)
* webpack: upgrade webpack analyser
* yarn.lock update
2019-05-29 10:27:57 +02:00
Torkel Ödegaard
afbdfe7cb4 NewDataSourcePage: Add Grafana Cloud link (#17324)
* NewDataSource: adding initial grafana cloud link

* Minor update

* Updated
2019-05-29 09:37:29 +02:00
Joshua Piccari
5fa5d4bdd5 CloudWatch: Avoid exception while accessing results (#17283)
When accessing the `series` property of query results, if a query is
hidden, an exception is thrown. This is caused by lack of checks to
verify that the query result exists before accessing the `series`
property.

Closes #17112
2019-05-29 09:10:09 +02:00
Oleg Gaidarenko
a1a498f96c Build: ignore absence of docker-compose (#17331)
If devenv/docker-compose.yaml file is missing, `devenv-down`
and subsequently `devenv` is not going to work
2019-05-28 20:08:27 +03:00
Oleg Gaidarenko
9ff44b5037 Build(makefile): improve error handling (#17281)
* Build(makefile): improve error handling

Ref baa55ab6ae
2019-05-28 19:32:14 +03:00
Marcus Efraimsson
1e508d7288 adds auth example for the cli cherrypick task (#17307) 2019-05-28 16:34:28 +02:00
Carl Bergquist
2dc660d533 docs: remove my email from docs examples (#17325)
I dont want emails from companies who test
alert notifiers :)
2019-05-28 16:02:14 +02:00
Shavonn Brown
27874a1881 16365 change clashing variable names (#17140)
* Fix: change  and  to  and  so not clashing with grafana vars (#16365)

* Fix: change  and  to  and  so not clashing with grafana vars (#16365)

* Fix: update now to datetime (#16365)

* Fix: test should look for datetime instead of now (#16365)

* Fix: _az suffix to datasource convention (#16365)

* Fix: convert vars to macro, update doc (#16365)

* Fix: convert vars to macro, update doc (#16365)

* Fix: remove support for time vars (#16365)

* Fix: confilct from master

* add migration on editor open

* fix migration var name
2019-05-28 15:04:42 +02:00
Ryan McKinley
382ebd6362 Frontend/SeriesData: Fix for convert SeriesData to Table format (#17314) 2019-05-28 10:18:09 +02:00
Šimon Podlipský
4b0ad174ff Frontend/utils: Import has only from lodash (#17311) 2019-05-28 10:17:03 +02:00
Šimon Podlipský
83af1bdff3 Frontend/utils: Add missing type (#17312) 2019-05-28 10:13:49 +02:00
Marcus Efraimsson
83187fd8ea update v6.2-beta1 changelog with missing pr (#17308) 2019-05-28 09:06:30 +02:00
Marcus Efraimsson
a07296bf24 explore: don't parse log levels if provided by field or label (#17180)
If a field or a label named level is returned from datasource that is 
used as log level for the logs result instead of parsing the log level 
from the message.

Closes #17122
2019-05-27 18:43:04 +02:00
Abhilash Gnan
04d473b3e5 HTTP Server: Serve Grafana with a custom URL path prefix (#17048)
Adds a new [server] setting `serve_from_sub_path`. By enabling 
this setting and using a subpath in `root_url` setting, e.g.
`root_url = http://localhost:3000/grafana`, Grafana will be accessible 
on `http://localhost:3000/grafana`. By default it is set to `false` 
for compatibility reasons.

Closes #16623
2019-05-27 17:47:29 +02:00
Marcus Efraimsson
b547a0cb34 update latest.json to latest stable version (#17306) 2019-05-27 16:15:25 +02:00
Marcus Efraimsson
0b3768e551 release: v6.2.1 changelog update (#17303) 2019-05-27 14:59:42 +02:00
Hugo Häggmark
4965e10db1 Build: Removes e2e-tests from Grafana master workflow (#17301) 2019-05-27 13:16:33 +02:00
Oleg Gaidarenko
2146f837cf Build(devenv): correct the context issue (#17291)
With the previous configuration `docker-compose build` was always failing.
This moves the dockerfiles in the parent dir and changes paths as a result.

Ref moby/moby#2745
2019-05-27 14:05:32 +03:00
Hugo Häggmark
db32c7dcf5 Build: Enables end-to-end tests in build-master workflow (#17268)
* Fix: Adds back necessary aria-labels for e2e tests

* Build: Adds end-to-end-tests job to build-master workflow

* Build: Changes grafana image used
2019-05-27 12:22:43 +02:00
Torkel Ödegaard
5358c5fe6b Gauge/BarGauge: font size improvements (#17292) 2019-05-27 12:13:08 +02:00
Torkel Ödegaard
3dda812f12 Chore: Update jquery to 3.4.1 in grafana ui (#17295) 2019-05-27 11:48:17 +02:00
Andrej Ocenas
151b24b95f CLI: Add command to migrate all datasources to use encrypted password fields (#17118)
closes: #17107
2019-05-27 10:47:21 +02:00
Marcus Efraimsson
b9181df212 Auth Proxy: Log any error in middleware (#17275)
Fixes so that errors happening in auth proxy middleware is logged.

Ref #17247
2019-05-27 10:38:17 +02:00
Marcus Efraimsson
1a2841e244 devenv: metricbeat and kibana for elasticsearch 7 block (#17262) 2019-05-27 09:55:58 +02:00
Oleg Gaidarenko
de92c360a1 LDAP: reduce API and allow its extension (#17209)
* Removes Add/Remove methods

* Publicise necessary fields and methods so we could extend it

* Publicise mock API

* More comments and additional simplifications

* Sync with master

Still having low coverage :/ - should be addressed in #17208
2019-05-27 10:36:49 +03:00
Marcus Efraimsson
5884e235fc database: retry transaction if sqlite returns database is locked error (#17276)
Adds an additional sqlite error code 5 (SQLITE_BUSY) to the
transaction retry handler to add retries when sqlite
returns database is locked error.
More info: https://www.sqlite.org/rescode.html#busy

Ref #17247 #16638
2019-05-27 09:24:15 +02:00
Tim Butler
df6a4914c4 Tech: Update jQuery to 3.4.1 (#17290)
Fixes #17289

Special notes for your reviewer:
Updates jQuery to 3.4.1 (from 3.4.0) to fix the jQuery bug: https://blog.jquery.com/2019/05/01/jquery-3-4-1-triggering-focus-events-in-ie-and-finding-root-elements-in-ios-10/
2019-05-27 07:11:30 +02:00
olcbean
07d37b4a92 fix typo in basic_concepts.md (#17285) 2019-05-25 20:41:25 +02:00
Oleg Gaidarenko
baa55ab6ae Feature: do dev environment via makefile (#17136)
Simplifies dev environment creation. I also planing to utilize
this logic for the LDAP benchmarking
2019-05-25 04:38:01 +03:00
Marcus Efraimsson
bc3a718107 devenv: adds auth proxy load test (#17271) 2019-05-24 17:51:10 +02:00
Ryan McKinley
2a52dbfb74 Table: various minor fixes (alpha panel) (#17258) 2019-05-24 08:49:17 -07:00
Torkel Ödegaard
6acc7d37da Singlestat: fixes issue with value placement and line wraps (#17249)
Fixes #17237
2019-05-24 08:52:47 +02:00
Dominik Prokop
a7aaed49b5 Devenv: Update Graphite port in dev datasources (#17255) 2019-05-24 08:09:51 +02:00
Ryan McKinley
b0ea3a8c88 Chore: bump grafana-ui version (#17256) 2019-05-23 11:03:10 -07:00
Torkel Ödegaard
0d6c9d371f Release: Updated latest.json 2019-05-23 19:56:16 +02:00
Alexander Zobnin
a3a7916597 Auth: Logout disabled user (#17166)
* Feature: revoke user token when disabled

* Chore: fix linter error
2019-05-23 15:54:47 +03:00
Carl Bergquist
c87b2c9913 docs: fixes typo in provisioning docs (#17248)
closes #17196
2019-05-23 13:06:34 +02:00
Utkarsh Bhatnagar
8e434ad163 CloudWatch: Made region visible for AWS Cloudwatch Expressions (#17243)
Fixes #14933
2019-05-23 12:02:19 +02:00
Filip Barl
a04bf0cded Panel: Pass transparency prop down to React panels. (#17235) 2019-05-23 11:58:50 +02:00
Brian Gann
972df40af8 Build: Fix filter for building msi during release (#17236) 2019-05-23 11:56:34 +02:00
Ryan McKinley
9e7fa74682 DataSourcePlugin: Avoid anuglar injector if only one parameter (#17239) 2019-05-23 11:56:00 +02:00
Abhilash Gnan
ca6151e23f Alerting: Support for configuring content field for Discord alert notifier (#17017) 2019-05-23 08:31:02 +02:00
Dominik Prokop
a9c94ec93b Explore: Update the way Loki retrieve log context (#17204)
* Move log's typings into grafana/ui
* Update the way context is retrieved for Loki

Major changes:

1. getLogRowContext expects row to be of LogRowModel type
2. getLogRowContext accepts generic options object, specific to a datasource of interest. limit option has been removed, and now it's a part of Loki's context query options (see below)
3. LogRowContextProvider performs two queries now. Before, it was Loki ds that performed queries in both directions when getLogRowContext.
4. Loki's getLogRowContext accepts options object of a type:

interface LokiContextQueryOptions {
    direction?: 'BACKWARD' | 'FORWARD';
    limit?: number;
}

This will enable querying in either direction independently and also slightly simplifies the way query errors are handled.

LogRowContextProvider maps the results to a Loki specific context types, basically string[][], as raw log lines are displayed in first version.
2019-05-22 23:10:05 +02:00
bendem
8749574975 Docs: Fix grammar in docs (#17233)
Use of singular and added an article for consistency with other titles.
2019-05-22 17:54:08 +02:00
Oleg Gaidarenko
9b7f9dd9be LDAP: consistently name the LDAP entities (#17203) 2019-05-22 15:30:03 +03:00
Filip Barl
87688930a2 Panels: Show Drilldown links in top-left corner of custom React panels (#17142) 2019-05-22 14:21:43 +02:00
Dominik Prokop
e9130210cc Build: Fix final prompt for @grafana/ui npm publish confirmation
Fixes issue of the final confirmation prompt (the one to confirm the actual npm publish) being invisible, making it impossible to release by anyone but me.

Also, before the release is created I'm assuring previous release bundle is remove (otherwise tests and checks would fail)
2019-05-22 14:10:13 +02:00
Torkel Ödegaard
c31aaa1a25 Docs: Updated versions selector 2019-05-22 13:55:20 +02:00
Oleg Gaidarenko
23a941e880 Docs: Example for multiple LDAP servers (#17216)
Fixes #16898
2019-05-22 13:53:33 +02:00
Torkel Ödegaard
7df4d635e3 Release: Updated changelog 2019-05-22 13:44:45 +02:00
Torkel Ödegaard
350190e669 Release: updated changelog with v6.2 entries (#17201)
* Release: updated changelog with v6.2 entries

* Release: Updated changelog
2019-05-22 13:40:37 +02:00
Torkel Ödegaard
e421723992 Search: removed old not working search shortcuts (#17226) 2019-05-22 12:23:30 +02:00
Daniel Lee
577beebcca azuremonitor: revert to clearing chained dropdowns (#17212)
* azuremonitor: revert to clearing chained dropdowns

After feedback from users, changing back to clearing
dropdowns to the right in the chain. E.g. if the user
changes the subscription dropdown which is first in
the chain then all the dependent dropdowns to the right
should be cleared (reset to default values).

Also, now triggers getting subscriptions every time the
dropdown menu is shown rather than just the first time.
It is apparently common to add subscriptions while
building queries.
2019-05-22 11:34:54 +02:00
Torkel Ödegaard
a96b522a42 Search: changed how search filter on current folder works (#17219) 2019-05-22 11:28:11 +02:00
Daniel Lee
cd9517c58b AzureMonitor: docs for multiple subscriptions (#17194)
* AzureMonitor: docs for multiple subscriptions

Also, links to images in Grafana.org instead of the images
in the plugin GitHub repo.

* Update docs/sources/features/datasources/azuremonitor.md

Co-Authored-By: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* Update docs/sources/features/datasources/azuremonitor.md

Co-Authored-By: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* docs: fix auto format errors

VS code automatically escapes the dollar sign.
2019-05-22 11:22:55 +02:00
CodeLingo Bot
3ff3e0f2ac Defer closing of files (#17213)
Signed-off-by: CodeLingo Bot <bot@codelingo.io>
2019-05-22 08:48:47 +02:00
Dominik Prokop
9cdf0f4f9c Docs: Add guidelines for PR/commit messages (#17190) 2019-05-21 13:58:14 +02:00
Alexander Zobnin
2d03815770 Users: Disable users removed from LDAP (#16820)
* Users: add is_disabled column

* Users: disable users removed from LDAP

* Auth: return ErrInvalidCredentials for failed LDAP auth

* User: return isDisabled flag in user search api

* User: mark disabled users at the server admin page

* Chore: refactor according to review

* Auth: prevent disabled user from login

* Auth: re-enable user when it found in ldap

* User: add api endpoint for disabling user

* User: use separate endpoints to disable/enable user

* User: disallow disabling external users

* User: able do disable users from admin UI

* Chore: refactor based on review

* Chore: use more clear error check when disabling user

* Fix login tests

* Tests for disabling user during the LDAP login

* Tests for disable user API

* Tests for login with disabled user

* Remove disable user UI stub

* Sync with latest LDAP refactoring
2019-05-21 14:52:49 +03:00
Marcus Efraimsson
8d1909c56d docs: what's new in v6.2 fixes (#17193) 2019-05-21 13:50:57 +02:00
Ryan McKinley
1033f0f905 DataSourceMeta: add an option to get hidden queries (#17124)
* add an option to get hidden queries

* make sure you have meta

* supportsHiddenQueries

* remove spaces

* DataSources: hidden queries flag
2019-05-21 13:46:19 +02:00
Dominik Prokop
73e4178aef Panel: Apply option defaults on panel init and on save model retrieval (#17174)
* Apply panel options defaults on panel init and on save model retrieval

* Remove unnecessary argument, added tests

* Make FieldPropertiesEditor statefull to enable onBlur changes

* Remove unnecessary import

* Post-review updates

Fixes #17154
2019-05-21 13:19:19 +02:00
Torkel Ödegaard
874039992f BarGauge: Fix for negative min values (#17192) 2019-05-21 13:10:23 +02:00
Daniel Lee
fa9ffe38d2 Azuremonitor: multiple subscription support for alerting (#17195)
* fix: azuremonitor adds multi-sub support to alerting

* fix: AzureMonitor missing parameter in metadata func

getMetricMetadata function when called in the query ctrl
was missing a parameter for Subscription Id.

Also, made some tweaks to what happens when a chained
dropdown is changed to not reset all the fields that
are dependent on it.
2019-05-21 12:28:30 +02:00
Ryan McKinley
744682e648 AppPlugin: add types for jsonData (#17177)
* add types for App jsonData

* add types for App jsonData

* add value as possible type

* make it extend {}
2019-05-21 10:39:29 +02:00
Brian Gann
f98095d629 MSI: Generate sha256sum during MSI build process in circleci (#17120)
* build: generate sha256 during msi build
2019-05-21 09:58:07 +02:00
Marcus Efraimsson
5414a31101 explore: fix null checks (#17191) 2019-05-21 09:37:31 +02:00
Hugo Häggmark
3b35e9d5e8 Fix: Fixes so new data is pushed during live tailing (#17189)
Fixes: #17188
2019-05-21 09:34:41 +02:00
Marcus Efraimsson
3b008d06b4 testdata: logs scenario (#17182)
Adds logs scenario which is quite basic and not that smart 
to begin with. This will hopefully ease development of 
Explore and support for logs in Grafana.
2019-05-21 09:21:59 +02:00
Marcus Efraimsson
c82df97bb2 testdata: scenarios returned are now sorted in a consistent way (#17181)
This makes sure the scenarios returned from API are sorted in a consistent
way and by that makes the values in scenario drop down always presented
ordered instead of jumping around.
2019-05-21 09:20:57 +02:00
Shavonn Brown
b695dcd0eb TablePanel: Check for table using keys (#17185)
* Fix: the type is not set so can check for columns and rows to validate is table (#16996)

* Fix: the type is not set so can check for columns and rows to validate is table (#16996)

* Fix: fix no table check and tests (#16996)
2019-05-21 08:56:34 +02:00
Mario Trangoni
66ba2aa524 Fix gosimple issues (#17179)
Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
2019-05-21 07:50:44 +02:00
Ryan McKinley
7e3ac4ebde AppPlugin: add an init function (#17150) 2019-05-20 13:05:23 -07:00
Hugo Häggmark
458bb3b0e3 Fix: Changes WebSocket protocol to wss:// for https (#17173) 2019-05-20 15:24:48 +02:00
Carl Bergquist
bfa7c3d963 alerting: golint fixes for alert notifiers. (#17167) 2019-05-20 15:23:06 +02:00
Oleg Gaidarenko
a0f5923b95 LDAP: add tests for initialBind (#17132)
* LDAP: add tests for initialBind

* LDAP: clarify comment for Login()
2019-05-20 15:57:52 +03:00
Hugo Häggmark
db48ec1f08 Explore: Adds Live option for supported datasources (#17062)
* Wip: Initial commit

* Refactor: Adds support in Loki datasource for streaming

* Refactor: Adds Live option to RefreshInterval

* Refactor: Adds styles to logrows

* Style: Reverses the order of Explore layout on Live

* Refactor: Adds LiveLogs component

* Tests: Adds tests for epics

* Style: Adds animation to Live in RefreshPicker

* Refactor: Adds ElapsedTime and progress line to LiveLogs

* Style: Adds specific colors to each theme

* Refactor: Adds support for Lokis new API

* Fix: Adds null to resulting empty array

* Refactor: Limits the rate of incoming messages from websockets

* Refactor: Throttles messages instead for simplicity

* Refactor: Optimizes row processing performance

* Refactor: Adds stop live button

* Fix: Fixes so that RefreshPicker shows the correct value when called programmatically

* Refactor: Merges with master and removes a console.log

* Refactor: Sorts rows in correct order and fixes minor UI issues

* Refactor: Adds minor improvments to sorting and container size
2019-05-20 13:28:23 +02:00
Carl Bergquist
bd5bcea5d0 alerting: fix a bunch of lint issues. (#17128) 2019-05-20 12:13:32 +02:00
Marcus Efraimsson
a564a54b13 chore: mocks plugin loader for DataSourceSettingsPage tests (#17157)
Properly mocks the plugin loader in DataSourceSettingsPage tests 
and by that removes console logs.
2019-05-20 11:41:22 +02:00
Torkel Ödegaard
058f5a1682 Release: Improved cherry pick task (#17087)
* Release: Improved cherry pick task

* Minor tweak to formatting
2019-05-20 11:18:56 +02:00
Marcus Efraimsson
0e210dc271 Explore: Fix selection/copy of log lines (#17121)
This adds some logic to identify if the user is selecting 
text and if so disables parsing of log messages on hover. 
This should resolve the issue of selecting log lines to be 
copied and the selection is truncated.

Fixes #17072
2019-05-20 09:51:57 +02:00
Marcus Efraimsson
2b32e768bd Explore: Fix empty space in toolbar on smaller devices (#17110)
Removes the empty space in Explore toolbar when on mobile/tablet.

Co-Authored-By: Hugo Häggmark <hugo.haggmark@gmail.com>
2019-05-20 09:38:41 +02:00
Dominik Prokop
12e0616413 Explore: display log line context (#17097)
* Extend DataSourceAPI to enable log row context retrieval

* Add react-use package

* Display log row context in UI

* Make Loki datasource return "after" log context in correct order

* Don't show Load more context links  when there are no more new results

* Update getLogRowContext to return DataQueryResponse

* Use DataQueryResponse in log row context provider, filter out original row  being duplicated in context
2019-05-20 08:44:37 +02:00
Ryan McKinley
ae1df1cf89 Plugins: expose rxjs matching 6.4.0 (#17148)
* expose rxjs

* remove super old observable export
2019-05-18 08:31:25 -07:00
Ryan McKinley
0d34dfc775 Chore: fix codespell issue with build (#17144) 2019-05-17 13:14:01 -07:00
Oleg Gaidarenko
35f227de11 Feature: LDAP refactoring (#16950)
* incapsulates multipleldap logic under one module

* abstracts users upsert and get logic

* changes some of the text error messages and import sort sequence

* heavily refactors the LDAP module – LDAP module now only deals with LDAP related behaviour

* integrates affected auth_proxy module and their tests

* refactoring of the auth_proxy logic
2019-05-17 14:57:26 +03:00
Marcus Efraimsson
1a80885180 explore: fix issues when loading and both graph/table are collapsed (#17113)
Removes the functionality of being able to collapse/expand the logs 
container.
When both graph and table are collapsed and you reload the page 
then the start page should not be displayed.
When both graph and table are collapsed and you reload the page 
then the graph and table panels should be displayed.
Fix so that reducer tests are run. On of the test used fit() instead of 
it() which had the consequence of only 1 reducer test was executed 
and the rest skipped. There was some failing tests that now is 
updated and now passes.

Fixes #17098
2019-05-17 12:45:11 +02:00
Marcus Efraimsson
32cdab4cbf explore: make sure datasource is added to target (#17116)
Fixes a regression introduced in #16959 which removed datasource 
property from changed query for angular query editors having the 
result of loading explore URL's without datasource loaded the 
default query in query editor and Explore.

Ref #16808
2019-05-17 10:11:55 +02:00
Oleg Gaidarenko
756da8a134 Fix: tighten revive exit code & make it happy (#17127)
* Revive should fail the build

* Fix the associated errors
2019-05-17 08:35:37 +03:00
Shavonn Brown
0a9863a8b4 GraphPanel: Don't sort series when legend table & sort column is not visible (#17095)
* Fix: if current sort key is not active column, do not use for sort and select next available active (#16980)

* Fix: only sort if sortkey is active column and table is active (#16980)

* Fix: sorting stacked series as legend. current descending order test (#16980)

* Fix: existing sort tests and added additional to prevent bug from resurfacing (#16980)
2019-05-16 21:16:05 +02:00
Dominik Prokop
9bf577d125 Chore: Update grafana-ui version to 6.2.0-alpha.0 (#17109) 2019-05-16 16:39:50 +02:00
Tom Petr
73e405978b add support for periodically reloading mysql client certs (#14892) 2019-05-16 13:45:22 +02:00
Andrej Ocenas
3dbc3251d1 Chore: Deduplicate sqlstore transaction code (#17069)
* Deduplicate transaction code

* More deduplication
2019-05-16 12:39:59 +02:00
Carl Bergquist
2904e2d9fe Alertmanager: Replace illegal chars with underscore in label names (#17002)
closes #16624
2019-05-16 11:41:57 +02:00
Jannik F
8196642f25 Adjusted documentation for gcs to reflect the code (#16947)
The key name for the bucket in GCS configuration is called bucket, not bucket name or bucket_name.
2019-05-16 11:11:08 +02:00
Johannes Schill
b11eeadbd9 fix: Initial url update in Explore should replace existing url history #17030 (#17061) 2019-05-16 11:02:21 +02:00
Marcus Efraimsson
e6001f57a2 Explore: Allow switching between metrics and logs (#16959)
Adds basic support for switching between Metrics and Logs in Explore. 
Currently only test datasource that supports both Metrics and Logs.
Summary of changes:
* Moves mode (Metric, Logs) selection to the left of datasource 
picker and add some quick styling.
* Only trigger change in ToggleButton if not selected
* Set correct mode if datasource only supports logs

Closes #16808
2019-05-16 09:52:22 +02:00
Oleg Gaidarenko
be66ed9dab Chore: explore possibilities of using makefile (#17039)
* Chore: explore possibilities of using makefile

This is an exploratory commit - I wanted to see how
revive/gosec linters could be integrated with makefile and our build scripts.

Looks better then I expected :)

* Chore: make revive happy

Revive execution was not supplied with path, if you restore there is couple
errors that were popping up - so I fixed them

* Chore: make revive happy
2019-05-16 00:29:26 +03:00
Johannes Schill
8483a8366f Chore: Bump jest to 24.8.0 (#17094) 2019-05-15 14:41:31 +02:00
Johannes Schill
f30e5cce59 Chore: Bump ts-node to 8.1.0 (#17093) 2019-05-15 14:40:53 +02:00
Torkel Ödegaard
b8e67a2a4c Release: Updated changelog 2019-05-15 13:54:36 +02:00
Carl Bergquist
c55e6016bf backend: replace /pkg/errors with errutil (#17065) 2019-05-15 12:20:17 +02:00
Hugo Häggmark
fdd421e24c Explore: Fixes filtering in Prometheus queries when clicking in Table (#17083)
Fixes: #17071
2019-05-15 11:43:27 +02:00
Carl Bergquist
aed3d0d3ad Remotecache: Avoid race condition in Set causing error on insert. (#17082)
* remotecache: avoid race condition in set

since set called the database twice without transactions another
operation could insert a value before the first operation completed.
which would raise an error on insert since the data have been inserted
by the other request.

closes #17079
2019-05-15 11:24:04 +02:00
Brian Gann
d0ea98f6bd Build: Support publishing MSI to grafana.com (#17073)
* add test for msi, and support for publishing msi
* update arch and os in test
* Build: Fixed issues with os naming
2019-05-15 10:58:25 +02:00
Ryan McKinley
d8280b895d InputDataSource: better empty value support (#17075) 2019-05-15 07:20:27 +02:00
Torkel Ödegaard
238a929262 Panels: Fixed alert icon position in panel header (#17070) 2019-05-14 18:47:35 +02:00
Ryan McKinley
a0b6ef4d01 GraphPanel: use SeriesData directly (skip legacy transformation) (#17037)
* support streaming in angular panels

* keep the same dashboard number

* skip the legacy data conversion

* fix tests
2019-05-14 18:43:26 +02:00
Ryan McKinley
7333f7ca17 Streaming: support streaming in MetricsPanelCtrl (#17034)
* support streaming in angular panels

* keep the same dashboard number
2019-05-14 17:47:41 +02:00
Torkel Ödegaard
68ad93f410 Gauge: Fix switching orientation issue when switching from BarGauge to Gauge (#17064) 2019-05-14 16:33:47 +02:00
Carl Bergquist
3df94c6f27 serverlock: run tests async should be more linear time wise (#17059) 2019-05-14 15:38:18 +02:00
Torkel Ödegaard
6c7224c74d InfoPopover: Fixes transclude undefined error (#17063) 2019-05-14 15:28:09 +02:00
Torkel Ödegaard
74a31bd9b4 Dashboard: Fixes lazy loading & expanding collapsed rows on mobile (#17055)
* Dashboard: Fixes lazy loading & expanding collapsing rows on mobile

Fixes #16978

* Updated dashboard tags
2019-05-14 14:41:24 +02:00
Daniel Lee
4bc1a66fe4 fix: Azure Monitor adds missing closing div tag to query editor (#17057) 2019-05-14 14:27:47 +02:00
Andrej Ocenas
fd10aa902d Chore: Use executable dir instead of pwd in CLI for isDev check (#16974)
* Use executable dir for the dev check

* Handle executable in bin and platform dirs

* Remove commented code

* Rename variable
2019-05-14 14:13:41 +02:00
Johannes Schill
ceb21bd653 Search: Set element height to 100% to avoid Chrome 74's overflow (#17054)
Fixes #16981
2019-05-14 11:08:36 +02:00
Carl Bergquist
51c99fc68d Docs: adds note about removing session storage (#17003)
closes #17000
2019-05-14 10:30:05 +02:00
Oleg Gaidarenko
79ac3fd699 Chore: remove use of == false (#17036)
Interestingly enough, golint or revive doesn't not prohibit
the use that construction :)

Ref #17035
2019-05-14 10:18:28 +03:00
Dominik Prokop
34f9b3ff2b Explore: use @grafana/ui legend (#17027) 2019-05-14 08:46:35 +02:00
Carl Bergquist
13f137a17d tech: avoid alias for importing models in alerting (#17041)
ref #14679
2019-05-14 08:15:05 +02:00
Ryan McKinley
a87a763d83 DataSourcePlugin: support custom tabs (#16859)
* use ConfigEditor

* add tabs

* add tabs

* set the nav in state

* remove actions

* reorder imports

* catch plugin loading errors

* better text

* keep props

* fix typo

* update snapshot

* rename tab to page

* add missing pages
2019-05-14 07:55:49 +02:00
Johannes Schill
1001cd7ac3 Dashboard: Fixes scrolling issues for Edge browser (#17033)
* Fix: Only set scrollTop on CustomScroll element when it's needed and move arrow functions out of the props

* Fix: Update snapshots

* Minor refactoring to reuse same functions when rendering custom scrollbar

Fixes #16796
2019-05-14 07:36:19 +02:00
Ryan McKinley
bbb1427f46 SeriesData: remove color from Field (#17044) 2019-05-14 07:26:55 +02:00
Marcus Efraimsson
01a7c1f098 chore: remove x character in explore 2019-05-13 16:33:27 +02:00
Torkel Ödegaard
3ce2f3b58d Dashboard: show refresh button in kiosk mode (#17032)
Fixes #16945
2019-05-13 15:49:54 +02:00
Torkel Ödegaard
719c1c277f Devenv: Updated gauge test dashboard 2019-05-13 14:09:25 +02:00
Oleg Gaidarenko
29ad72f048 Chore: reintroduce gosec (#17021)
It seems gosec memory issue was recently fixed.
We should be good to go again

Ref securego/gosec#307
2019-05-13 14:56:36 +03:00
Torkel Ödegaard
597c380ead Gauge: tweaks to background color and height usage (#17019) 2019-05-13 13:18:14 +02:00
Oleg Gaidarenko
db95414d02 Feature: provide multildap server configuration (#16914)
* Feature: provide multildap server configuration

* Add multildap server configuration for devenv

* Change some of the notes for openldap devenv configuration

* Change the maintainer label for *main* dockerfile and of the devenv one

Re-checked the multildap logic - everything seems to be working fine
2019-05-13 11:51:16 +03:00
David
927e1cbd27 (feat/explore): Support for new LogQL filtering syntax (#16674)
* (feat/explore): Support for new LogQL filtering syntax

Loki is adding syntax to support chained filtering.
This PR adapts Grafana to support this.

- Send only `query` parameter in loki request
- Automatically wrap search text in simple syntax, e.g., `{} foo` is
sent as `{} |~ "foo"`.


* Adapted to regexp parameter staying on in Loki

* Dont wrap single regexp in new filter syntax

* Fix datasource test

* Fallback regexp parameter for legacy queries

* Fix search highlighting

* Make highlighting work for filter chains

* Fix datasource test
2019-05-13 09:58:26 +02:00
David
bf5b60f74a fix(explore): Prevent double querying for Prometheus and Loki (#17004)
* fix(explore): Prevent double querying for Prometheus and Loki

- queries were triggered twice because two Enter handlers existed
- removed runner plugin from Loki and Prom query fields (runner plugin
is still being used in azure)

Part of #16995

* Set loki's mtrics capability to false

Loki is not a metrics store. Explore was using the `metrics` field in
the plugin definition to issue a second query run. But Loki shows only
one result viewer.

Fixes #16995
2019-05-13 09:55:20 +02:00
Torkel Ödegaard
e0b760e08e Chore: No implict any fixes (#17020) 2019-05-13 09:38:19 +02:00
zhulongcheng
2fff8f77dc move log package to /infra (#17023)
ref #14679

Signed-off-by: zhulongcheng <zhulongcheng.me@gmail.com>
2019-05-13 08:45:54 +02:00
Hugo Häggmark
0efb8821f9 Chore: Lowered implicit anys limit to 5386
Progress: #14714
2019-05-13 07:47:07 +02:00
Torkel Ödegaard
ce38de4ad7 Chore: Updated snapshot 2019-05-12 20:18:58 +02:00
Torkel Ödegaard
aa400d54e1 Select: Fixed isOpen issue 2019-05-12 20:03:44 +02:00
Torkel Ödegaard
f12d47ef52 Chore: Typescript no-implicit any fixes progress (#17018)
* Chore: Typescript no-implicit any fixes progress

* Fixed tests

* Updated snapshot
2019-05-12 14:15:23 +02:00
Ryan McKinley
813e3ffc15 GraphPanel: show results for all SeriesData (#16966)
* Graph panel should support SeriesData

* Graph panel should support SeriesData

* same path for all series

* merge master

* support docs

* add test for processor

* Graph: removed old unused data processing logic

* Graph: minor refactoring data processing

* fix histogram

* set Count as title
2019-05-11 07:41:32 +02:00
Andrej Ocenas
cf39a264ca Fix: Wrap value of multi variable in array when coming from URL (#16992)
*  Wrap variable value in array if multi

* Fix typo

* Fix case with multiple custom values
2019-05-10 22:19:46 +02:00
Ryan McKinley
37011dd8f3 GettingStarted: add key and remove ng-class (#17007) 2019-05-10 11:48:27 -07:00
Marcus Efraimsson
e7930a27b5 explore: add some extra time for angular query editors to update query (#16955)
Now when loading a query editor which changes the default query in the
constructor this will result in the actual updated query is used in
explore when running the query. Without this, the query used is sort
of out of sync between query editor and executed query.
2019-05-10 14:09:07 +02:00
Hugo Häggmark
6dbaa704bc Explore: Align Explore with Dashboards and Panels (#16823)
* Wip: Removes queryTransactions from state

* Refactor: Adds back query failures

* Refactor: Moves error parsing to datasources

* Refactor: Adds back hinting for Prometheus

* Refactor: removed commented out code

* Refactor: Adds back QueryStatus

* Refactor: Adds scanning back to Explore

* Fix: Fixes prettier error

* Fix: Makes sure there is an error

* Merge: Merges with master

* Fix: Adds safeStringifyValue to error parsing

* Fix: Fixes table result calculations

* Refactor: Adds ErrorContainer and generic error handling in Explore

* Fix: Fixes so refIds remain consistent

* Refactor: Makes it possible to return result even when there are errors

* Fix: Fixes digest issue with Angular editors

* Refactor: Adds tests for explore utils

* Refactor: Breakes current behaviour of always returning a result even if Query fails

* Fix: Fixes Prettier error

* Fix: Adds back console.log for erroneous querys

* Refactor: Changes console.log to console.error
2019-05-10 14:00:39 +02:00
Marcus Efraimsson
8eb78ea931 Explore: Fix empty result from datasource should render logs container (#16999)
Make sure to return an empty logs model instead of undefined so that 
the logs container renders an empty graph and log result in Explore.

Fixes #16997
2019-05-10 12:45:26 +02:00
Hugo Häggmark
d5a35f3631 Explore: Fixes zoom exception in Loki/Graph (#16991)
Fixes: #16986
2019-05-10 12:10:32 +02:00
Torkel Ödegaard
675d43c753 PanelEditor: Fix queries tab now showing, wrong skipDataQuery logic (#16994) 2019-05-10 11:38:18 +02:00
Ryan McKinley
1d7bb2a763 DataSourceApi: convert interface to abstract class (#16979)
* DataSourceApi as class

* add diff signature

* Prometheus: moved directUrl to jsonData
2019-05-10 11:37:43 +02:00
Torkel Ödegaard
5573d28582 Panels: Fixed error panel tooltip (#16993)
Fixes #16989
2019-05-10 11:35:55 +02:00
Will Medlar
5e44f001fb Docker: Prevent a permission denied error when writing files to the default provisioning directory (#16831)
* build: Grant ownership of provisioning directory to runtime user
2019-05-10 09:03:17 +02:00
zhulongcheng
34f6dda6e6 Notification: attempt to send notifications to all given email addresses (#16881)
Signed-off-by: zhulongcheng <zhulongcheng.me@gmail.com>
2019-05-10 08:39:51 +02:00
Ryan McKinley
f617cd8975 GettingStarted: convert to react panel plugin (#16985)
* getting started

* getting started
2019-05-10 07:48:31 +02:00
Ryan McKinley
56702902a1 Plugins: Remove dataFormats key and add skipDataQuery (#16984) 2019-05-10 07:46:14 +02:00
Torkel Ödegaard
4a9aff0b00 AlertList: removed icon 2019-05-10 07:33:33 +02:00
Ryan McKinley
3c733638ee MetricsPanelCtrl: use shared queryRunner to support query execution (#16659)
* move queryRunner to panelModel

* remove isEditing from PanelChrome

* move listener to QueriesTab

* use queryRunner on MetricsPanelCtrl

* Added interval back as prop, not used yet

* QueryRunner: worked on tests

* PanelQueryRunner: Refactoring, added getQueryRunner to PanelModel

* PanelQueryRunner: interpolatel min interval

* merge master and remove grafana-live
2019-05-10 07:09:48 +02:00
Ryan McKinley
30bf9bf00f TableData: support name (#16983) 2019-05-09 10:29:24 -07:00
Julien Pivotto
d4a35213e1 Changelog: Typo guage -> gauge (#16982) 2019-05-09 19:06:28 +02:00
Ryan McKinley
edcbc11774 TestData: stream via fetch (#16963)
Stream from fetch CSV
2019-05-09 09:42:35 -07:00
Marcus Efraimsson
0c1530c7a8 plugins: fix how datemath utils are exposed to plugins (#16976)
Fixes a regression accidentally introduced by #16890 so that datemath 
utils are exposed to plugins in a backward-compatible way.

Fixes #16962
2019-05-09 15:27:52 +02:00
Torkel Ödegaard
10098082b5 NewDataSource: Updated page header title 2019-05-09 14:21:02 +02:00
tolwi
f0109be2bc fix(prometheus): issue with click label to filter for recording rules in Explore 2019-05-09 13:54:48 +02:00
Hugo Häggmark
a04b3a13e0 Explore: Removes Promise.All from runQueries thunk (#16957) 2019-05-09 12:24:48 +02:00
Andrej Ocenas
2abb009d68 Chore: Add prometheus basic auth proxy (#16882) 2019-05-09 12:08:27 +02:00
zhulongcheng
7ebbeb09cb Snapshot: use given key and deleteKey (#16876)
Signed-off-by: zhulongcheng <zhulongcheng.me@gmail.com>
2019-05-09 11:53:04 +02:00
Ryan McKinley
7b92c56055 DataSourcePlugins: more generics improvements (#16965)
* more types for query editor

* generic datasources

* update

* change ComponentClass to ComponentType

* more types

* remove input
2019-05-09 11:48:13 +02:00
Torkel Ödegaard
e1d408a66f AddDataSource: Updated page design & categories (#16971)
* minor refactoring

* Added category

* Minor progress

* Progres

* Updated descriptions

* Added custom sort

* NewDataSource: progress

* Updated design

* NewDataSource: Updated design

* Updated link

* Feedback changes
2019-05-09 11:45:39 +02:00
r66ad
99c754c4a5 Templating: Support selecting all filtered values of multi-value variable (#16873)
* Closes #15821

* sorry, now prettier

* select and deselect on filtered values works with Selected option now. Should the clearSelections function rather be renamed to selectOrClearValues? Selected should have another name too.
2019-05-09 07:51:14 +02:00
Andrej Ocenas
568d7373f7 Chore: Add Input stories (#16897) 2019-05-09 07:45:57 +02:00
Dominik Prokop
1ef15283a4 FieldDisplay: Don't use group ui elements in field editors (#16953)
* FieldDisplay editor - minor refactor not to use panel group ui elements
* FieldPropertiesEditor - minor refactor not to use panel group ui elements
2019-05-08 17:25:41 +02:00
Torkel Ödegaard
a9e01d8b04 GettingStarted: Fixes layout issues, fixes #16926 (#16941) 2019-05-08 17:22:25 +02:00
Torkel Ödegaard
f58ab7945b PanelModel: Fix crash after window resize, fixes #16933 (#16942) 2019-05-08 17:21:46 +02:00
Torkel Ödegaard
e97853abc9 Singlestat: fixed centering issue for very small panels (#16944) 2019-05-08 17:21:17 +02:00
Hugo Häggmark
a4d287d2e1 Tests: Adds end-to-end tests skeleton and basic smoke test scenario (#16901)
* Chore: Adds neccessary packages

* Wip: Initial dummy test in place

* Feature: Downloads Chromium if needed

* Fix: Adds global config object

* Refactor: Adds basic e2eScenario

* Build: Adds end to end tests to config

* Build: Changes end to end job

* Build: Adds browsers to image

* Build: Adds failing test

* Refactor: Adds first e2e-test scenario

* Fix: Ignores test output in gitignore

* Refactor: Adds compare screenshots ability

* Refactor: Removes unnecessary code

* Build: Removes jest-puppeteer

* Fix: Replaces test snapshots

* Refactor: Creates output dir if missing

* Refactor: Changes aria-labels to be more consistent

* Docs: Adds section about end to end tests

* Fix: Fixes snapshots

* Docs: Adds information about ENV variables
2019-05-08 16:50:21 +02:00
Hugo Häggmark
ceb9f0855b Chore: Replaces moment with Grafanas DateTime (#16919)
* Wip: Initial commit

* Refactor: Replaces moment.utc(

* Refactor: replaces the last isMoment statements

* Refactor: Removes almost all moment imports

* Refactor: Moves moment_wrapper to grafana/ui

* Refactor: Renames momentWrapper

* Refactor: Removes one more moment import

* Refactor: Removes unitOfTime import

* Fix: Fixes Prettier error

* Refactor: Renames DateTimeType to DateTime

* Refactor: Renames isDateTimeType to isDateTime

* Refactor: Renames dateTime to dateTime

* Feature: Bans moment imports and types
2019-05-08 13:51:44 +02:00
Stephen SORRIAUX
e7a9afe983 InfluxDB: Fix HTTP method should default to GET (#16949)
Fixes #16929
2019-05-08 13:02:39 +02:00
Dominik Prokop
4762cd671a Chore: Skip unnecessary checks on pre commit (#16946)
* Skip unnecessary checks on pre commit

* Remove grunt precommit task

* Separate go and fe tesrt lint
2019-05-08 11:43:37 +02:00
Carl Bergquist
a86b8c8a04 http: remove dualstack since its deprecated (#16940)
Deprecated: Fast Fallback is enabled by default. To
disable, set FallbackDelay to a negative value.

https://golang.org/src/net/dial.go
2019-05-08 10:37:48 +02:00
Carl Bergquist
b426ff5292 devenv: add slow reverse proxy (#16943)
this can be useful when testing timeouts etc
in the dataproxy

ref #16923
2019-05-08 10:09:48 +02:00
Ryan McKinley
17ce1273ca AppPlugin: Menu Edit Url Fix (#16934) 2019-05-08 09:38:40 +02:00
Ryan McKinley
1d8786e3a6 DataSource Plugins: consistent generics order <TQuery,TOptions> (#16936)
* consistent TQuery,TOptions

* add json for azure

* cloudwatch
2019-05-08 09:37:50 +02:00
Ryan McKinley
b08cf1e7ac Plugins: update beta notice style (#16928) 2019-05-07 15:58:03 -07:00
Ryan McKinley
b24358aaba Chore: update version number for 6.3 (#16927) 2019-05-07 15:02:05 -07:00
Brian Gann
b07d0b1026 Plugins: Support templated urls in routes (#16599)
This adds support for using templated/dynamic urls in routes.
* refactor interpolateString into utils and add interpolation support for app plugin routes.
* cleanup and add error check for url parse failure
* add docs for interpolated route urls

Closes #16835
2019-05-07 18:55:39 +02:00
Marcus Efraimsson
336655a46a changelog: add 5.4.4 release 2019-05-07 18:41:08 +02:00
Marcus Efraimsson
08cdeb0eb1 docs: add download link to what's new in v6.2 2019-05-07 18:16:59 +02:00
Marcus Efraimsson
b1fb113648 update changelog 2019-05-07 18:06:15 +02:00
1478 changed files with 60254 additions and 26353 deletions

View File

@@ -1,6 +1,7 @@
[run]
init_cmds = [
["go", "run", "build.go", "-dev", "build-server"],
["go", "run", "build.go", "-dev", "build-cli"],
["go", "run", "build.go", "-dev", "build-server"],
["./bin/grafana-server", "-packaging=dev", "cfg:app_mode=development"]
]
watch_all = true

View File

@@ -19,7 +19,7 @@ version: 2
jobs:
mysql-integration-test:
docker:
- image: circleci/golang:1.12.4
- image: circleci/golang:1.12.6
- image: circleci/mysql:5.6-ram
environment:
MYSQL_ROOT_PASSWORD: rootpass
@@ -39,7 +39,7 @@ jobs:
postgres-integration-test:
docker:
- image: circleci/golang:1.12.4
- image: circleci/golang:1.12.6
- image: circleci/postgres:9.3-ram
environment:
POSTGRES_USER: grafanatest
@@ -58,7 +58,7 @@ jobs:
cache-server-test:
docker:
- image: circleci/golang:1.12.4
- image: circleci/golang:1.12.6
- image: circleci/redis:4-alpine
- image: memcached
working_directory: /go/src/github.com/grafana/grafana
@@ -70,6 +70,62 @@ jobs:
name: cache server tests
command: './scripts/circle-test-cache-servers.sh'
end-to-end-test:
docker:
- image: circleci/node:10-browsers
- image: grafana/grafana-dev:master-$CIRCLE_SHA1
steps:
- run: dockerize -wait tcp://127.0.0.1:3000 -timeout 120s
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
- run:
name: yarn install
command: 'yarn install --pure-lockfile --no-progress'
no_output_timeout: 5m
- save_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
paths:
- node_modules
- run:
name: run end-to-end tests
command: 'env BASE_URL=http://127.0.0.1:3000 yarn e2e-tests'
no_output_timeout: 5m
- store_artifacts:
path: public/e2e-test/screenShots/theTruth
destination: expected-screenshots
- store_artifacts:
path: public/e2e-test/screenShots/theOutput
destination: output-screenshots
end-to-end-test-release:
docker:
- image: circleci/node:10-browsers
- image: grafana/grafana-dev:$CIRCLE_TAG
steps:
- run: dockerize -wait tcp://127.0.0.1:3000 -timeout 120s
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
- run:
name: yarn install
command: 'yarn install --pure-lockfile --no-progress'
no_output_timeout: 5m
- save_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
paths:
- node_modules
- run:
name: run end-to-end tests
command: 'env BASE_URL=http://127.0.0.1:3000 yarn e2e-tests'
no_output_timeout: 5m
- store_artifacts:
path: public/e2e-test/screenShots/theTruth
destination: expected-screenshots
- store_artifacts:
path: public/e2e-test/screenShots/theOutput
destination: output-screenshots
codespell:
docker:
- image: circleci/python
@@ -86,9 +142,9 @@ jobs:
name: check documentation spelling errors
command: 'codespell -I ./words_to_ignore.txt docs/'
backend-lint:
lint-go:
docker:
- image: circleci/golang:1.12.4
- image: circleci/golang:1.12.6
environment:
# we need CGO because of go-sqlite3
CGO_ENABLED: 1
@@ -96,12 +152,21 @@ jobs:
steps:
- checkout
- run:
name: backend lint
command: './scripts/backend-lint.sh'
name: Lint Go
command: 'make lint-go'
shellcheck:
machine: true
working_directory: ~/go/src/github.com/grafana/grafana
steps:
- checkout
- run:
name: ShellCheck
command: 'make shellcheck'
test-frontend:
docker:
- image: circleci/node:8
- image: circleci/node:10
steps:
- checkout
- restore_cache:
@@ -120,7 +185,7 @@ jobs:
test-backend:
docker:
- image: circleci/golang:1.12.4
- image: circleci/golang:1.12.6
working_directory: /go/src/github.com/grafana/grafana
steps:
- checkout
@@ -130,7 +195,7 @@ jobs:
build-all:
docker:
- image: grafana/build-container:1.2.6
- image: grafana/build-container:1.2.7
working_directory: /go/src/github.com/grafana/grafana
steps:
- checkout
@@ -174,7 +239,7 @@ jobs:
build:
docker:
- image: grafana/build-container:1.2.6
- image: grafana/build-container:1.2.7
working_directory: /go/src/github.com/grafana/grafana
steps:
- checkout
@@ -200,7 +265,7 @@ jobs:
build-fast-backend:
docker:
- image: grafana/build-container:1.2.6
- image: grafana/build-container:1.2.7
working_directory: /go/src/github.com/grafana/grafana
steps:
- checkout
@@ -217,7 +282,7 @@ jobs:
build-fast-frontend:
docker:
- image: grafana/build-container:1.2.6
- image: grafana/build-container:1.2.7
working_directory: /go/src/github.com/grafana/grafana
steps:
- checkout
@@ -241,7 +306,7 @@ jobs:
build-fast-package:
docker:
- image: grafana/build-container:1.2.6
- image: grafana/build-container:1.2.7
working_directory: /go/src/github.com/grafana/grafana
steps:
- checkout
@@ -268,7 +333,7 @@ jobs:
build-fast-save:
docker:
- image: grafana/build-container:1.2.6
- image: grafana/build-container:1.2.7
working_directory: /go/src/github.com/grafana/grafana
steps:
- checkout
@@ -354,7 +419,7 @@ jobs:
build-enterprise:
docker:
- image: grafana/build-container:1.2.6
- image: grafana/build-container:1.2.7
working_directory: /go/src/github.com/grafana/grafana
steps:
- checkout
@@ -386,7 +451,7 @@ jobs:
build-all-enterprise:
docker:
- image: grafana/build-container:1.2.6
- image: grafana/build-container:1.2.7
working_directory: /go/src/github.com/grafana/grafana
steps:
- checkout
@@ -570,13 +635,31 @@ jobs:
store-build-artifacts:
docker:
- image: circleci/node:8
- image: circleci/node:10
steps:
- attach_workspace:
at: .
- store_artifacts:
path: ./dist
trigger-docs-update:
docker:
- image: circleci/python:3.6.8
steps:
- checkout
- run:
name: Trigger Docs update
command: |
if git diff --name-only HEAD^ | grep -q "^docs"; then
echo "Build URL:"
curl -s -u "$DOCS_CIRCLE_TOKEN:" \
-d build_parameters[CIRCLE_JOB]=pull-submodule-changes \
https://circleci.com/api/v1.1/project/github/grafana/docs.grafana.com/tree/staging \
| jq .build_url
else
echo "-- no changes to docs files --"
fi
workflows:
version: 2
build-master:
@@ -587,7 +670,9 @@ workflows:
filters: *filter-only-master
- codespell:
filters: *filter-only-master
- backend-lint:
- lint-go:
filters: *filter-only-master
- shellcheck:
filters: *filter-only-master
- test-frontend:
filters: *filter-only-master
@@ -603,7 +688,8 @@ workflows:
- test-backend
- test-frontend
- codespell
- backend-lint
- lint-go
- shellcheck
- mysql-integration-test
- postgres-integration-test
- build-oss-msi
@@ -615,7 +701,8 @@ workflows:
- test-backend
- test-frontend
- codespell
- backend-lint
- lint-go
- shellcheck
- mysql-integration-test
- postgres-integration-test
filters: *filter-only-master
@@ -625,7 +712,8 @@ workflows:
- test-backend
- test-frontend
- codespell
- backend-lint
- lint-go
- shellcheck
- mysql-integration-test
- postgres-integration-test
- build-all-enterprise
@@ -636,11 +724,19 @@ workflows:
- test-backend
- test-frontend
- codespell
- backend-lint
- lint-go
- shellcheck
- mysql-integration-test
- postgres-integration-test
filters: *filter-only-master
- end-to-end-test:
requires:
- grafana-docker-master
filters: *filter-only-master
- trigger-docs-update:
requires:
- end-to-end-test
filters: *filter-only-master
release:
jobs:
- build-all:
@@ -649,7 +745,9 @@ workflows:
filters: *filter-only-release
- codespell:
filters: *filter-only-release
- backend-lint:
- lint-go:
filters: *filter-only-release
- shellcheck:
filters: *filter-only-release
- test-frontend:
filters: *filter-only-release
@@ -665,7 +763,8 @@ workflows:
- test-backend
- test-frontend
- codespell
- backend-lint
- lint-go
- shellcheck
- mysql-integration-test
- postgres-integration-test
- build-oss-msi
@@ -677,7 +776,8 @@ workflows:
- test-backend
- test-frontend
- codespell
- backend-lint
- lint-go
- shellcheck
- mysql-integration-test
- postgres-integration-test
filters: *filter-only-release
@@ -688,7 +788,8 @@ workflows:
- test-backend
- test-frontend
- codespell
- backend-lint
- lint-go
- shellcheck
- mysql-integration-test
- postgres-integration-test
filters: *filter-only-release
@@ -698,10 +799,15 @@ workflows:
- test-backend
- test-frontend
- codespell
- backend-lint
- lint-go
- shellcheck
- mysql-integration-test
- postgres-integration-test
filters: *filter-only-release
- end-to-end-test-release:
requires:
- grafana-docker-release
filters: *filter-only-release
build-branches-and-prs:
jobs:
@@ -716,7 +822,11 @@ workflows:
- build-fast-frontend
- codespell:
filters: *filter-not-release-or-master
- backend-lint:
- lint-go:
filters: *filter-not-release-or-master
- lint-go:
filters: *filter-not-release-or-master
- shellcheck:
filters: *filter-not-release-or-master
- test-frontend:
filters: *filter-not-release-or-master
@@ -734,7 +844,8 @@ workflows:
- test-backend
- test-frontend
- codespell
- backend-lint
- lint-go
- shellcheck
- mysql-integration-test
- postgres-integration-test
- cache-server-test
@@ -745,7 +856,8 @@ workflows:
- test-backend
- test-frontend
- codespell
- backend-lint
- lint-go
- shellcheck
- mysql-integration-test
- postgres-integration-test
- cache-server-test

6
.gitignore vendored
View File

@@ -79,8 +79,12 @@ debug.test
/scripts/build/release_publisher/release_publisher
*.patch
# Ignoring frontend packages specifics
/packages/**/dist
/packages/**/compiled
/packages/**/.rpt2_cache
theOutput/
# Ignore go local build dependencies
/scripts/go/bin/**

View File

@@ -1,4 +1,106 @@
# 6.2.0 (unreleased)
# 6.3.0 (unreleased)
# 6.2.5 (2019-06-25)
### Features / Enhancements
* **Grafana-CLI**: Wrapper for `grafana-cli` within RPM/DEB packages and config/homepath are now global flags. [#17695](https://github.com/grafana/grafana/pull/17695), [@gotjosh](https://github.com/gotjosh)
* **Panel**: Fully escape html in drilldown links (was only sanitized before) . [#17731](https://github.com/grafana/grafana/pull/17731), [@dehrax](https://github.com/dehrax)
### Bug Fixes
* **Config**: Fix connectionstring for remote_cache in defaults.ini. [#17675](https://github.com/grafana/grafana/pull/17675), [@kylebrandt](https://github.com/kylebrandt)
* **Elasticsearch**: Fix empty query (via template variable) should be sent as wildcard. [#17488](https://github.com/grafana/grafana/pull/17488), [@davewat](https://github.com/davewat)
* **HTTP-Server**: Fix Strict-Transport-Security header. [#17644](https://github.com/grafana/grafana/pull/17644), [@kylebrandt](https://github.com/kylebrandt)
* **TablePanel**: fix annotations display. [#17646](https://github.com/grafana/grafana/pull/17646), [@ryantxu](https://github.com/ryantxu)
# 6.2.4 (2019-06-18)
### Bug Fixes
* **Grafana-CLI**: Fix receiving flags via command line . [#17617](https://github.com/grafana/grafana/pull/17617), [@gotjosh](https://github.com/gotjosh)
* **HTTPServer**: Fix X-XSS-Protection header formatting. [#17620](https://github.com/grafana/grafana/pull/17620), [@yverry](https://github.com/yverry)
# 6.2.3 (2019-06-17)
### Known issues
* **grafana-cli**: The argument `--pluginsDir` is not working.
* **docker**: Due to above problem with grafana-cli the docker run will fail to start the container if you're installing plugins using the `GF_INSTALL_PLUGINS` environment variable. We have removed 6.2.3 tag from docker hub and latest tag now points to 6.2.2.
More details in bug report: https://github.com/grafana/grafana/issues/17613
### Features / Enhancements
* **AuthProxy**: Optimistic lock pattern for remote cache Set. [#17485](https://github.com/grafana/grafana/pull/17485), [@papagian](https://github.com/papagian)
* **HTTPServer**: Options for returning new headers X-Content-Type-Options, X-XSS-Protection and Strict-Transport-Security. [#17522](https://github.com/grafana/grafana/pull/17522), [@kylebrandt](https://github.com/kylebrandt)
### Bug Fixes
* **Auth Proxy**: Fix non-negative cache TTL. [#17495](https://github.com/grafana/grafana/pull/17495), [@kylebrandt](https://github.com/kylebrandt)
* **Grafana-CLI**: Fix receiving configuration flags from the command line. [#17606](https://github.com/grafana/grafana/pull/17606), [@gotjosh](https://github.com/gotjosh)
* **OAuth**: Fix for wrong user token updated on OAuth refresh in DS proxy. [#17541](https://github.com/grafana/grafana/pull/17541), [@redbaron](https://github.com/redbaron)
* **remote_cache**: Fix redis. [#17483](https://github.com/grafana/grafana/pull/17483), [@kylebrandt](https://github.com/kylebrandt)
# 6.2.2 (2019-06-05)
### Features / Enhancements
* **Security**: Prevent CSV formula injection attack when exporting data. [#17363](https://github.com/grafana/grafana/pull/17363), [@DanCech](https://github.com/DanCech)
### Bug Fixes
* **CloudWatch**: Fixes error when hiding/disabling queries . [#17283](https://github.com/grafana/grafana/pull/17283), [@jpiccari](https://github.com/jpiccari)
* **Database**: Fixed slow permission query in folder/dashboard search. [#17427](https://github.com/grafana/grafana/pull/17427), [@aocenas](https://github.com/aocenas)
* **Explore**: Fixed updating time range before running queries. [#17349](https://github.com/grafana/grafana/pull/17349), [@marefr](https://github.com/marefr)
* **Plugins**: Fixed plugin config page navigation when using subpath. [#17364](https://github.com/grafana/grafana/pull/17364), [@torkelo](https://github.com/torkelo)
# 6.2.1 (2019-05-27)
### Features / Enhancements
* **CLI**: Add command to migrate all datasources to use encrypted password fields . [#17118](https://github.com/grafana/grafana/pull/17118), [@aocenas](https://github.com/aocenas)
* **Gauge/BarGauge**: Improvements to auto value font size . [#17292](https://github.com/grafana/grafana/pull/17292), [@torkelo](https://github.com/torkelo)
### Bug Fixes
* **Auth Proxy**: Resolve database is locked errors. [#17274](https://github.com/grafana/grafana/pull/17274), [@marefr](https://github.com/marefr)
* **Database**: Retry transaction if sqlite returns database is locked error. [#17276](https://github.com/grafana/grafana/pull/17276), [@marefr](https://github.com/marefr)
* **Explore**: Fixes so clicking in a Prometheus Table the query is filtered by clicked value. [#17083](https://github.com/grafana/grafana/pull/17083), [@hugohaggmark](https://github.com/hugohaggmark)
* **Singlestat**: Fixes issue with value placement and line wraps. [#17249](https://github.com/grafana/grafana/pull/17249), [@torkelo](https://github.com/torkelo)
* **Tech**: Update jQuery to 3.4.1 to fix issue on iOS 10 based browers as well as Chrome 53.x . [#17290](https://github.com/grafana/grafana/pull/17290), [@timbutler](https://github.com/timbutler)
# 6.2.0 (2019-05-22)
### Bug Fixes
* **BarGauge**: Fix for negative min values. [#17192](https://github.com/grafana/grafana/pull/17192), [@torkelo](https://github.com/torkelo)
* **Gauge/BarGauge**: Fix for issues editing min & max options. [#17174](https://github.com/grafana/grafana/pull/17174)
* **Search**: Make only folder name only open search with current folder filter. [#17226](https://github.com/grafana/grafana/pull/17226)
* **AzureMonitor**: Revert to clearing chained dropdowns. [#17212](https://github.com/grafana/grafana/pull/17212)
### Breaking Changes
* **Plugins**: Data source plugins that process hidden queries need to add a "hiddenQueries: true" attribute in plugin.json. [#17124](https://github.com/grafana/grafana/pull/17124), [@ryantxu](https://github.com/ryantxu)
### Removal of old deprecated package repository
5 months ago we deprecated our old package cloud repository and [replaced it](https://grafana.com/blog/2019/01/05/moving-to-packages.grafana.com/) with our own. We will remove the old depreciated
repo on July 1st. Make sure you have switched to the new repo by then. The new repository has all our old releases so you are not required to upgrade just to switch package repository.
# 6.2.0-beta2 (2019-05-15)
### Features / Enhancements
* **Plugins**: Support templated urls in plugin routes. [#16599](https://github.com/grafana/grafana/pull/16599), [@briangann](https://github.com/briangann)
* **Packaging**: New MSI windows installer package**. [#17073](https://github.com/grafana/grafana/pull/17073), [@briangann](https://github.com/briangann)
### Bug Fixes
* **Dashboard**: Fixes blank dashboard after window resize with panel without title. [#16942](https://github.com/grafana/grafana/pull/16942), [@torkelo](https://github.com/torkelo)
* **Dashboard**: Fixes lazy loading & expanding collapsed rows on mobile. [#17055](https://github.com/grafana/grafana/pull/17055), [@torkelo](https://github.com/torkelo)
* **Dashboard**: Fixes scrolling issues for Edge browser. [#17033](https://github.com/grafana/grafana/pull/17033), [@jschill](https://github.com/jschill)
* **Dashboard**: Show refresh button in first kiosk(tv) mode. [#17032](https://github.com/grafana/grafana/pull/17032), [@torkelo](https://github.com/torkelo)
* **Explore**: Fix empty result from datasource should render logs container. [#16999](https://github.com/grafana/grafana/pull/16999), [@marefr](https://github.com/marefr)
* **Explore**: Fixes so clicking in a Prometheus Table the query is filtered by clicked value. [#17083](https://github.com/grafana/grafana/pull/17083), [@hugohaggmark](https://github.com/hugohaggmark)
* **Explore**: Makes it possible to zoom in Explore/Loki/Graph without exception. [#16991](https://github.com/grafana/grafana/pull/16991), [@hugohaggmark](https://github.com/hugohaggmark)
* **Gauge**: Fixes orientation issue after switching from BarGauge to Gauge. [#17064](https://github.com/grafana/grafana/pull/17064), [@torkelo](https://github.com/torkelo)
* **GettingStarted**: Fixes layout issues in getting started panel. [#16941](https://github.com/grafana/grafana/pull/16941), [@torkelo](https://github.com/torkelo)
* **InfluxDB**: Fix HTTP method should default to GET. [#16949](https://github.com/grafana/grafana/pull/16949), [@StephenSorriaux](https://github.com/StephenSorriaux)
* **Panels**: Fixed alert icon position in panel header. [#17070](https://github.com/grafana/grafana/pull/17070), [@torkelo](https://github.com/torkelo)
* **Panels**: Fixes panel error tooltip not showing. [#16993](https://github.com/grafana/grafana/pull/16993), [@torkelo](https://github.com/torkelo)
* **Plugins**: Fix how datemath utils are exposed to plugins. [#16976](https://github.com/grafana/grafana/pull/16976), [@marefr](https://github.com/marefr)
* **Singlestat**: fixed centering issue for very small panels. [#16944](https://github.com/grafana/grafana/pull/16944), [@torkelo](https://github.com/torkelo)
* **Search**: Scroll issue in dashboard search in latest Chrome. [#17054](https://github.com/grafana/grafana/pull/17054), [@jschill](https://github.com/jschill)
* **Docker**: Prevent a permission denied error when writing files to the default provisioning directory. [#16831](https://github.com/grafana/grafana/pull/16831), [@wmedlar](https://github.com/wmedlar)
* **Gauge**: Adds background shade to gauge track and improves height usage. [#17019](https://github.com/grafana/grafana/pull/17019), [@torkelo](https://github.com/torkelo)
* **RemoteCache**: Avoid race condition in Set causing error on insert. . [#17082](https://github.com/grafana/grafana/pull/17082), [@bergquist](https://github.com/bergquist)
# 6.2.0-beta1 (2019-05-07)
@@ -8,6 +110,7 @@
* **Alerting**: Adjust label for send on all alerts to default . [#16554](https://github.com/grafana/grafana/pull/16554), [@simPod](https://github.com/simPod)
* **Alerting**: Makes timeouts and retries configurable. [#16259](https://github.com/grafana/grafana/pull/16259), [@kobehaha](https://github.com/kobehaha)
* **Alerting**: No notification when going from no data to pending. [#16905](https://github.com/grafana/grafana/pull/16905), [@bergquist](https://github.com/bergquist)
* **Alerting**: Pushover alert, support for different sound for OK. [#16525](https://github.com/grafana/grafana/pull/16525), [@Hofls](https://github.com/Hofls)
* **Auth**: Enable retries and transaction for some db calls for auth tokens . [#16785](https://github.com/grafana/grafana/pull/16785), [@bergquist](https://github.com/bergquist)
* **AzureMonitor**: Adds support for multiple subscriptions per datasource. [#16922](https://github.com/grafana/grafana/pull/16922), [@daniellee](https://github.com/daniellee)
* **Bar Gauge**: New multi series enabled gauge like panel with horizontal and vertical layouts and 3 display modes. [#16918](https://github.com/grafana/grafana/pull/16918), [@torkelo](https://github.com/torkelo)
@@ -22,19 +125,23 @@
* **Explore**: Adds reconnect for failing datasource. [#16226](https://github.com/grafana/grafana/pull/16226), [@hugohaggmark](https://github.com/hugohaggmark)
* **Explore**: Support user timezone. [#16469](https://github.com/grafana/grafana/pull/16469), [@marefr](https://github.com/marefr)
* **InfluxDB**: Add support for POST HTTP verb. [#16690](https://github.com/grafana/grafana/pull/16690), [@StephenSorriaux](https://github.com/StephenSorriaux)
* **Loki**: Search is now case insensitive. [#15948](https://github.com/grafana/grafana/pull/15948), [@steven-sheehy](https://github.com/steven-sheehy)
* **OAuth**: Update jwt regexp to include `=`. [#16521](https://github.com/grafana/grafana/pull/16521), [@DanCech](https://github.com/DanCech)
* **Panels**: No title will no longer make panel header take up space. [#16884](https://github.com/grafana/grafana/pull/16884), [@torkelo](https://github.com/torkelo)
* **Prometheus**: Adds tracing headers for Prometheus datasource. [#16724](https://github.com/grafana/grafana/pull/16724), [@svagner](https://github.com/svagner)
* **Provisioning**: Add API endpoint to reload provisioning configs. [#16579](https://github.com/grafana/grafana/pull/16579), [@aocenas](https://github.com/aocenas)
* **Provisioning**: Do not allow deletion of provisioned dashboards. [#16211](https://github.com/grafana/grafana/pull/16211), [@aocenas](https://github.com/aocenas)
* **Provisioning**: Interpolate env vars in provisioning files. [#16499](https://github.com/grafana/grafana/pull/16499), [@aocenas](https://github.com/aocenas)
* **Provisioning**: Support FolderUid in Dashboard Provisioning Config. [#16559](https://github.com/grafana/grafana/pull/16559), [@swtch1](https://github.com/swtch1)
* **Security**: Add new setting allow_embedding. [#16853](https://github.com/grafana/grafana/pull/16853), [@marefr](https://github.com/marefr)
* **Security**: Store datasource passwords encrypted in secureJsonData. [#16175](https://github.com/grafana/grafana/pull/16175), [@aocenas](https://github.com/aocenas)
* **UX**: Improve Grafana usage for smaller screens . [#16783](https://github.com/grafana/grafana/pull/16783), [@torkelo](https://github.com/torkelo)
* **UX**: Improve Grafana usage for smaller screens. [#16783](https://github.com/grafana/grafana/pull/16783), [@torkelo](https://github.com/torkelo)
* **Units**: Add angle units, Arc Minutes and Seconds. [#16271](https://github.com/grafana/grafana/pull/16271), [@Dripoul](https://github.com/Dripoul)
### Bug Fixes
### Bug Fixes
* **Build**: Fix bug where grafana didn't start after mysql on rpm packages. [#16917](https://github.com/grafana/grafana/pull/16917), [@bergquist](https://github.com/bergquist)
* **CloudWatch**: Fixes query order not affecting series ordering & color. [#16408](https://github.com/grafana/grafana/pull/16408), [@mtanda](https://github.com/mtanda)
* **CloudWatch**: Use default alias if there is no alias for metrics . [#16732](https://github.com/grafana/grafana/pull/16732), [@utkarshcmu](https://github.com/utkarshcmu)
* **CloudWatch**: Use default alias if there is no alias for metrics. [#16732](https://github.com/grafana/grafana/pull/16732), [@utkarshcmu](https://github.com/utkarshcmu)
* **Config**: Fixes bug where timeouts for alerting was not parsed correctly. [#16784](https://github.com/grafana/grafana/pull/16784), [@aocenas](https://github.com/aocenas)
* **Elasticsearch**: Fix view percentiles metric in table without date histogram. [#15686](https://github.com/grafana/grafana/pull/15686), [@Igor-Ratsuk](https://github.com/Igor-Ratsuk)
* **Explore**: Prevents histogram loading from killing Prometheus instance. [#16768](https://github.com/grafana/grafana/pull/16768), [@hugohaggmark](https://github.com/hugohaggmark)
@@ -45,7 +152,7 @@
### Breaking changes
* **Gauge Panel**: The suffix / prefix options have been removed from the new Guage Panel (introduced in v6.0). [#16870](https://github.com/grafana/grafana/issues/16870).
* **Gauge Panel**: The suffix / prefix options have been removed from the new Gauge Panel (introduced in v6.0). [#16870](https://github.com/grafana/grafana/issues/16870).
# 6.1.6 (2019-04-29)
@@ -302,6 +409,10 @@
* **Text Panel**: The text panel does no longer by default allow unsantizied HTML. [#4117](https://github.com/grafana/grafana/issues/4117). This means that if you have text panels with scripts tags they will no longer work as before. To enable unsafe javascript execution in text panels enable the settings `disable_sanitize_html` under the section `[panels]` in your Grafana ini file, or set env variable `GF_PANELS_DISABLE_SANITIZE_HTML=true`.
* **Dashboard**: Panel property `minSpan` replaced by `maxPerRow`. Dashboard migration will automatically migrate all dashboard panels using the `minSpan` property to the new `maxPerRow` property [#12991](https://github.com/grafana/grafana/pull/12991)
# 5.4.4 (2019-04-29)
* **Security**: Urgent security patch release. Please read more in our [blog](https://grafana.com/blog/2019/04/29/grafana-5.4.4-and-6.1.6-released-with-important-security-fix/)
# 5.4.3 (2019-01-14)
### Tech

View File

@@ -1,18 +1,19 @@
# Contributing
Grafana uses GitHub to manage contributions.
Contributions take the form of pull requests that will be reviewed by the core team.
* If you are a new contributor see: [Steps to Contribute](#steps-to-contribute)
- If you are a new contributor see: [Steps to Contribute](#steps-to-contribute)
* If you have a trivial fix or improvement, go ahead and create a pull request.
- If you have a trivial fix or improvement, go ahead and create a pull request.
* If you plan to do something more involved, discuss your idea on the respective [issue](https://github.com/grafana/grafana/issues) or create a [new issue](https://github.com/grafana/grafana/issues/new) if it does not exist. This will avoid unnecessary work and surely give you and us a good deal of inspiration.
- If you plan to do something more involved, discuss your idea on the respective [issue](https://github.com/grafana/grafana/issues) or create a [new issue](https://github.com/grafana/grafana/issues/new) if it does not exist. This will avoid unnecessary work and surely give you and us a good deal of inspiration.
* Sign our [CLA](http://docs.grafana.org/contribute/cla/).
- Sign our [CLA](http://docs.grafana.org/contribute/cla/).
* For changes in the backend, follow the style guides used in Go [Code Review Comments](https://code.google.com/p/go-wiki/wiki/CodeReviewComments) and Peter Bourgon's [Go: Best Practices for Production Environments](http://peter.bourgon.org/go-in-production/#formatting-and-style)
- Make sure to follow the code style guides
- [Backend](https://github.com/grafana/grafana/tree/master/pkg)
- [Frontend](https://github.com/grafana/grafana/tree/master/style_guides)
## Steps to Contribute
@@ -22,61 +23,40 @@ Please check the [`beginner friendly`](https://github.com/grafana/grafana/issues
To setup a local development environment we recommend reading [Building Grafana from source](http://docs.grafana.org/project/building_from_source/)
## Pull Request Checklist
* Branch from the master branch and, if needed, rebase to the current master branch before submitting your pull request. If it doesn't merge cleanly with master you may be asked to rebase your changes.
- Branch from the master branch and, if needed, rebase to the current master branch before submitting your pull request. If it doesn't merge cleanly with master you may be asked to rebase your changes.
* If your patch is not getting reviewed or you need a specific person to review it, you can @-reply a reviewer asking for a review in the pull request or a comment.
- If your patch is not getting reviewed or you need a specific person to review it, you can @-reply a reviewer asking for a review in the pull request or a comment.
* Add tests relevant to the fixed bug or new feature.
- Add tests relevant to the fixed bug or new feature.
### Pull requests with new features
Commits should be as small as possible, while ensuring that each commit is correct independently (i.e., each commit should compile and pass tests).
- Follow [PR and commit messages guidelines](#PR-and-commit-messages-guidelines)
Make sure to include `Closes #<issue number>` or `Fixes #<issue number>` in the pull request description.
### Pull Requests titles and message
### Pull requests with bug fixes
Please make all changes in one commit if possible. Include `Closes #<issue number>` in bottom of the commit message.
A commit message for a bug fix should look something like this.
Pull request titles should follow this format: `Area: Name of the change`.
Titles are used to generate the changelog so they should be as descriptive as possible in one line.
```
avoid infinite loop in the dashboard provisioner
Good Examples
if one dashboard with an uid is refered to by two
provsioners each provisioner overwrite each other.
filling up dashboard_versions quite fast if using
default settings.
- `Explore: Adds Live option for supported datasources`
- `GraphPanel: Don't sort series when legend table & sort column is not visible`
- `Build: Support publishing MSI to grafana.com`
Closes #12864
```
The message in the Pull requests should contain a reference so the issue if there is one. Ex `Closes #<issue number>`, `Fixes #<issue number>`, or `Ref #<issue number>` if the change is related to an issue but does not close it. Make sure to explain what problem the pull request is solving and why its implemented this way. As a new contributor its often better to overcommunicate to avoid back and forth communication, as it consumes time and energy.
If the pull request needs changes before its merged the new commits should be rebased into one commit before its merged.
### GIT commit formating.
## Backend dependency management
Grafana Squash Pull requests when merging them into master. This means the maintainer will be responsible for the title in the git commit message.
The commit message of the commits in the Pull Request can still be part of the git commit body. So it's always encouraged to write informative commit messages.
The Grafana project uses [Go modules](https://golang.org/cmd/go/#hdr-Modules__module_versions__and_more) to manage dependencies on external packages. This requires a working Go environment with version 1.11 or greater installed.
The Git commit title should be short, descriptive and include the Pull Request ID.
All dependencies are vendored in the `vendor/` directory.
Good Examples
To add or update a new dependency, use the `go get` command:
- `Explore: Live supprt in datasources (#12345)`
- `GraphPanel: Fix legend sorting issues (#12345)`
- `Build: Support publishing MSI to grafana.com (#12345)`
```bash
# Pick the latest tagged release.
go get example.com/some/module/pkg
# Pick a specific version.
go get example.com/some/module/pkg@vX.Y.Z
```
Tidy up the `go.mod` and `go.sum` files and copy the new/updated dependency to the `vendor/` directory:
```bash
# The GO111MODULE variable can be omitted when the code isn't located in GOPATH.
GO111MODULE=on go mod tidy
GO111MODULE=on go mod vendor
```
You have to commit the changes to `go.mod`, `go.sum` and the `vendor/` directory before submitting the pull request.
Its also good practice to include a reference to the issue in the git commit body when possible.

View File

@@ -33,7 +33,9 @@ ENV NODE_ENV production
RUN ./node_modules/.bin/grunt build
# Final container
FROM debian:stretch-slim
FROM ubuntu:18.04
LABEL maintainer="Grafana team <hello@grafana.com>"
ARG GF_UID="472"
ARG GF_GID="472"

384
ISSUE_TRIAGE.md Normal file
View File

@@ -0,0 +1,384 @@
Triaging of issues
------------------
Grafana being a popular open source project there are a lot of incoming issues. The main goal of issue triage is to categorize all incoming issues and make sure it has all basic information needed for anyone else to understand and/or being able to start working with it.
The core maintainers of the Grafana project is responsible for categorizing all incoming issues and delegate any critical and/or important issue to other maintainers. Currently there's one maintainer each week responsible. Besides that part, triage provides an important way to contribute to an open source project. Triage helps ensure issues resolve quickly by:
* Describing the issue's intent and purpose is conveyed precisely. This is necessary because it can be difficult for an issue to explain how an end user experiences a problem and what actions they took.
* Giving a contributor the information they need before they commit to resolving an issue.
* Lowering the issue count by preventing duplicate issues.
* Streamlining the development process by preventing duplicate discussions.
* If you don't have the knowledge or time to code, consider helping with triage. The community will thank you for saving them time by spending some of yours.
**Simplified flowchart diagram of the issue triage process:**
<!-- https://textik.com/#610afa78553def29 -->
```
+--------------------------+
+----------------+ New issue opened/ |
| | more information added |
| +-------------+------------+
| Ask for more |
| information +-------------+------------+
| | All information needed |
| +--------+ to categorize the issue? +--------+
| | | | |
| | NO +--------------------------+ YES |
| | |
+------+-------+-------------+ +------------+---------+ +----------------------------+
| | | | | |
| label: needs more details | | Needs investigation? +--YES---+ label: needs investigation |
| | | | | |
+----------------------------+ +----------------+-----+ +--------------+-------------+
NO | |
| Investigate |
+-----------+----------+ |
| label: type/* | |
| label: area/* +------------------+
| label: datasource/* |
+-----|----------+-----+
| |
| |
| +--+--------------------+ +--------------------+
| | | | label: priority/* |
| | Needs priority? +--YES---+| milestone? |
| | | | |
| +--------------------+--+ +----+---------------+
| NO | |
| | |
+----+-------------+ +---+----------+ |
| | | | |
| Close issue +----------+ Done +------+
| | | |
+------------------+ +--------------+
```
## How you can help
There are multiple ways that you can help with the Grafana project, especially without writing a single line of code. Everyone in the Grafana community will be greatly thankful you for helping out with any of the below tasks.
### Answer/ask questions
The [community site](https://community.grafana.com/) is the main channel to be used for asking and answering questions related to the Grafana project. This may be the first place a new or existing Grafana user look/ask for help after they found that the [documentation](https://grafana.com/docs) wasn't answering their questions. It's very important to help new and existing users so that these new users can find proper answers and eventually help out other users and by that keep growing the Grafana community.
Please signup to the Grafana [community site](https://community.grafana.com/) and start help other Grafana users by answering their questions and/or ask for help.
### Report documentation enhancements
If you visit the [documentation site](https://grafana.com/docs) and find typos/error/lack of information please report these by clicking on the `Request doc changes` link found on every page and/or contribute the changes yourself by clicking on `Edit this page` and open a pull request. Everyone in the community will greatly thank you for.
Please read about how documentation issues is triaged [below](#documentation-issue) to understand what kind of documentation may be suitable to request/add.
### Report a security vulnerability
Please review the [security policy](https://github.com/grafana/grafana/security/policy) for more details.
### Report bugs
Report a bug you found when using Grafana by [opening a new bug report](https://github.com/grafana/grafana/issues/new?labels=type%3A+bug&template=1-bug_report.md).
### Request enhancements/new features
Suggest an enhancement or new feature for the Grafana project by [opening a new enhancement issue](https://github.com/grafana/grafana/issues/new?labels=type%3A+feature+request&template=2-feature_request.md).
Alternatively, help make Grafana be better at being accessible to all by [opening a new accessibility issue](https://github.com/grafana/grafana/issues/new?labels=type%3A+accessibility&template=3-accessibility.md).
### Report inaccurate issue information
If you find an issue that have a badly formatted title and/or description, bad language/grammar and/or wrong labels it's important to let the issue author or maintainers know so it can be fixed. See [good practices](#good-practices) regarding basic information for issues below.
### Request closing of issues
The Grafana project have a lot of open issues and the main goal is to only have issues open if their still relevant. If you find an issue that you think already have been resolved or no longer is relevant please report by adding a comment and explain why you think it should be closed including related issues (`#<issue number>`), if applicable, and optionally mention one of the maintainers.
### Investigate issues
See [investigation of issues](#investigation-of-issues).
### Vote on enhancements/bugs
Helping the Grafana project to know which issues are most important by users and the community is crucial for the success of the project. Read more about [prioritizing issues](#4-prioritization-of-issues) for details about how issues are being prioritized. The Grafana project use GitGub issues and reactions for collecting votes on enhancement and bugs.
**Please don't add `+1` issue comments or similar since that will notify everyone that have subscribed to an issue and it doesn't add any useful update, rather it creates a bad .**
If you want to show your interest or importance of an issue, please use [GitHub's reactions](https://help.github.com/en/articles/about-conversations-on-github#reacting-to-ideas-in-comments).
### Report duplicates
If you find two issues describing the same bug/enhancement/feature please add a comment in one of the issue and explain which issues (`#<issue number>`) you think is a duplicate of another issue (`#<issue number>`).
### Suggest ideas for resolving bugs/enhancements
Related to how [issues are being prioritized](#4-prioritization-of-issues) it's important to help anyone that's interested in contributing code for resolving a bug or enhancement. This can be anything from getting started and setup the development environment to reference code and files where changes probably needs to be made and/or suggest ideas on how enhancements may function/be implemented.
Please read about how [help from the community](#5-requesting-help-from-the-community) may be requested when issues being triaged.
## 1. Find uncategorized issues
To get started with issue triage and finding issues that haven't been triaged you have two alternatives.
### Browse unlabeled issues
The easiest and straigt forward way of getting started and finding issues that haven't been triaged is to browse [unlabeled issues](https://github.com/grafana/grafana/issues?q=is%3Aopen+is%3Aissue+no%3Alabel) and starting from the bottom and working yourself to the top.
### Subscribe to all notifications
The more advanced, but recommended way is to subscribe to all notifications from this repository which means that all new issues, pull requests, comments and important status changes are sent to your configured email address. Read this [guide](https://help.github.com/en/articles/watching-and-unwatching-repositories#watching-a-single-repository) for help with setting this up.
It's highly recommended that you setup filters to automatically remove emails from the inbox and label/categorize them accordingly to make it easy for you to understand when you need to act upon a notification or where to look for finding issues that haven't been triaged etc.
Instructions for setting up filters in Gmail can be found [here](#setting-up-gmail-filters). Another alternative is to use [Trailer](https://github.com/ptsochantaris/trailer) or similar software.
## 2. Ensure the issue contains basic information
Before triaging an issue very far, make sure that the issue's author provided the standard issue information. This will help you make an educated recommendation on how to categorize the issue. The Grafana project utilizes [GitHub issue templates](https://help.github.com/en/articles/creating-issue-templates-for-your-repository) to guide contributors to provide standard information that must be included for each type of template or type of issue.
### Standard issue information that must be included
Given a certain [issue template]([template](https://github.com/grafana/grafana/issues/new/choose)) have been used by the issue author or depending how the issue is perceived by the issue triage responsible, the following should help you understand what standard issue information that must be included.
#### Bug report?
Should explain what happened, what was expected and how to reproduce it together with any additional information that may help giving a complete picture of what happened such as screenshots, [query inspector](https://community.grafana.com/t/using-grafanas-query-inspector-to-troubleshoot-issues/2630) output and any environment related information that's applicable and/or maybe related to the reported problem:
- Grafana version
- Data source type & version
- Platform & OS Grafana is installed on
- User OS & Browser + versions
- Using docker + what environment
- Which plugins
- Configuration database in use (sqlite, mysql, postgres)
- Reverse proxy in front of Grafana, what version and configuration
- Non-default configuration settings
- Development environment like Go and Node versions, if applicable
#### Enhancement request?
Should explain what enhancement or feature that the author wants to be added and why that is needed.
#### Accessibility issue?
This is a mix between a bug report and enhancement request but focused on accessibility issues to help make Grafana improve keyboard navigation, screen-reader support and being accessible to everyone. The report should include relevant WCAG criteria, if applicable.
#### Support request?
In general, if the issue description and title is perceived as a question no more information is needed.
### Good practices
To make it easier for everyone to understand and find issues they're searching for it's suggested as a general rule of thumbs to:
* Make sure that issue titles are named to explain the subject of the issue, has a correct spelling and doesn't include irrelevant information and/or sensitive information.
* Make sure that issue descriptions doesn't include irrelevant information, information from template that haven't been filled out and/or sensitive information.
* Do your best effort to change title and description or request suggested changes by adding a comment.
Note: Above rules is applicable to both new and existing issues of the Grafana project.
### Do you have all the information needed to categorize an issue?
Depending on the issue, you might not feel all this information is needed. Use your best judgement. If you cannot triage an issue using what its author provided, explain kindly to the author that they must provide the above information to clarify the problem. Label issue with `needs more detail` and add any related `area/*` or `datasource/*` labels.
If the author provides the standard information but you are still unable to triage the issue, request additional information. Do this kindly and politely because you are asking for more of the author's time.
If the author does not respond requested information within the timespan of a week, close the issue with a kind note stating that the author can request for the issue to be reopened when the necessary information is provided.
When you feel you have all the information needed you're ready to [categorizing the issue](#3-categorizing-an-issue).
## 3. Categorizing an issue
An issue can have multiple of the following labels. Typically, a properly categorized issue should at least have:
- One label identifying its type (`type/*`).
- One or multiple labels identifying the functional areas of interest or component (`area/*`) and/or datasource (`datasource/*`), if applicable.
Label | Description
------- | --------
`type/bug` | A feature isn't working as expected given design or documentation.
`type/feature-request` | Request for a new feature or enhancement.
`type/docs` | Documentation problem or enhancement.
`type/accessibility` | Accessibility problem or enhancement.
`type/question` | Issue is or perceived as a question.
`type/duplicate` | An existing issue of the same subject/request have already been reported.
`type/works-as-intended` | A reported bug works as intended/by design.
`type/build-packaging` | Build or packaging problem or enhancement.
`area/*` | Subject is related to a functional area of interest or component.
`datasource/*` | Subject is related to a core datasource plugin.
### Duplicate issue?
Make sure that it's not a duplicate by searching existing issues using related terms from the issue title and description. If you think you know there are an existing issue, but can't find it please reach out to one of the maintainers and ask for help. If you identify that the issue is a duplicate of an existing issue:
1. Add a comment `Duplicate of #<issue number>`. GitHub will recognize this and add some additional context to the issue activity.
2. Close the issue and label it with `type/duplicate`.
3. Optionally add any related `area/*` or `datasource/*` labels.
4. If applicable, add a comment with additional information.
### Bug report?
If it's not perfectly clear that it's an actual bug, quickly try to reproduce it.
**It's a bug/it can be reproduced:**
1. Add a comment describing detailed steps for how to reproduce it, if applicable.
2. Label the issue `type/bug` and at least one `area/*` or `datasource/*` label.
3. If you know that maintainers wont be able to put any resources into it for some time then label the issue with `help wanted` and optionally `beginner friendly` together with pointers on which code to update to fix the bug. This should signal to the community that we would appreciate any help we can get to resolve this.
4. Move on to [prioritizing the issue](#4-prioritization-of-issues).
**It can't be reproduced:**
1. Either [ask for more information](#2-ensure-the-issue-contains-basic-information) needed to investigate it more thoroughly.
2. Either [delegate further investigations](#investigation-of-issues) to someone else.
**It works as intended/by design:**
1. Kindly and politely add a comment explaining briefly why we think it works as intended and close the issue.
2. Label the issue `type/works-as-intended`.
### Enhancement/feature?
1. Label the issue `type/feature-request` and at least one `area/*` or `datasource/*` label.
2. Move on to [prioritizing the issue](#4-prioritization-of-issues).
### Documentation issue?
First, evaluate if the documentation makes sense to be included in the Grafana project:
- Is this something we want/can maintain as a project?
- Is this referring to usage of some specific integration/tool and in that case are those a popular use case in combination with Grafana?
- If unsure, kindly and politely add a comment explaining that we would need [upvotes](https://help.github.com/en/articles/about-conversations-on-github#reacting-to-ideas-in-comments) to identify that lots of other users wants/needs this.
Second, label the issue `type/docs` and at least one `area/*` or `datasource/*` label.
**Minor typo/error/lack of information:**
There's a minor typo/error/lack of information that adds a lot of confusion for users and given the amount of work is a big win to make sure fixing it:
1. Either update the documentation yourself and open a pull request.
2. Either delegate the work to someone else by assigning that person to the issue and add the issue to next major/minor milestone.
**Major error/lack of information:**
1. Label the issue with `help wanted` and `beginner friendly`, if applicable, to signal that we find this important to fix and we would appreciate any help we can get from the community.
2. Move on to [prioritizing the issue](#4-prioritization-of-issues).
### Accessibility issue?
1. Label the issue `type/accessibility` and at least one `area/*` or `datasource/*` label.
### Support request?
1. Kindly and politely direct the issue author to the [community site](https://community.grafana.com/) and explain that GitHub is mainly used for tracking bugs and feature requests. If possible, it's usually a good idea to add some pointers to the issue author's question.
2. Close the issue and label it with `type/question`.
## 4. Prioritization of issues
In general bugs and enhancement issues should be labeled with a priority.
This is the most difficult thing with triaging issues since it requires a lot of knowledge, context and experience before being able to think of and start feel comfortable adding a certain priority label.
The key here is asking for help and discuss issues to understand how more experienced project members thinks and reason. By doing that you learn more and eventually be more and more comfortable with prioritizing issues.
In any case there are uncertainty around the priorization of an issue, please ask the maintainers for help.
Label | Description
------- | --------
`priority/critical` | Highest priority. Must be actively worked on as someone's top priority right now.
`priority/support-subscription` | This is important for one or several customers having a paid Grafana support subscription.
`priority/important-soon` | Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
`priority/important-longterm` | Important over the long term, but may not be staffed and/or may need multiple releases to complete.
`priority/nice-to-have` | It's a good idea, but not scheduled for any release.
`priority/awaiting-more-evidence` | Lowest priority. Possibly useful, but not yet enough interest in it.
`priority/unscheduled` | Something to look into before and to be discussed during the planning of the next (upcoming) major/minor stable release.
**Critical bug?**
1. If a bug have been categorized and any of the following problems applies the bug should be labeled as critical and must be actively worked on as someone's top priority right now.
- Results in any data loss
- Critical security or performance issues
- Problem that makes a feature unusable
- Multiple users experience a severe problem affecting their business, users etc.
2. Label the issue `priority/critical`.
3. If applicable, label the issue `priority/support-subscription`.
4. Add the issue to the next upcoming patch release milestone. Create a new milestone if there are none.
5. Escalate the problem to the maintainers.
6. Assign or ask a maintainer for help assigning someone to make this issue their top priority right now.
**Important short-term?**
1. Label the issue `priority/important-soon`.
2. If applicable, label the issue `priority/support-subscription`.
3. Add the issue to the next upcoming patch or major/minor stable release milestone. Ask maintainers for help if unsure if it's a patch or not. Create a new milestone if there are none.
4. Make sure to add the issue to a suitable backlog of a GitHub project and prioritize it or assign someone to work on it now or very soon.
5. Consider requesting [help from the community](#5-requesting-help-from-the-community), even though it may be problematic given a short amount of time until it should be released.
**Important long-term?**
1. Label the issue `priority/important-longterm`.
2. Consider requesting [help from the community](#5-requesting-help-from-the-community).
**Nice to have?**
1. Label the issue `priority/nice-to-have`.
2. Consider requesting [help from the community](#5-requesting-help-from-the-community).
**Not critical, but unsure?**
1. Label the issue `priority/unscheduled`.
2. Consider requesting [help from the community](#5-requesting-help-from-the-community).
## 5. Requesting help from the community
Depending on the issue and/or priority, it's always a good idea to consider signalling to the community that help from community is appreciated and needed in case an issue is not prioritized to be worked on by maintainers. Use your best judgement. In general, when requesting help from the community it means a contribution has a good chance of getting accepted and merged.
In many cases the issue author or community as a whole is more suitable to contribute changes since they're experts in their domain. It's also quite common that someone has tried to get something to work using the documentation without success and made an effort to get it to work and/or reached out to the [community site](https://community.grafana.com/) to get the missing information. In especially these areas it's more likely that there exists experts in their own domain and usually a good idea to request help from contributors:
- Database setups
- Authentication like OAuth providers and LDAP setups
- Platform specific things
- Reverse proxy setups
- Alert notifiers
1. Kindly and politely add a comment to signal to users subscribed to updates of the issue.
- Explain that the issue would be nice to get resolved, but it isn't prioritized to work on by maintainers for an unforseen future.
- If possible or applicable, try to help contributors getting starting by adding pointers and references to what code/files need to be changed and/or ideas of a good way to solve/implement the issue.
2. Label the issue with `help wanted`.
3. If applicable, label the issue with `beginner friendly` to denote that the issue is suitable for a beginner to work on.
4. If possible, try to estimate the amount of work by adding `effort/small`, `effort/medium` or `effort/large`.
## Investigation of issues
When an issue has all basic information provided, but the triage responsible haven't been able to reproduce the reported problem at a first glance, the issue is labeled [Needs investigation](https://github.com/grafana/grafana/labels/needs%20investigation). Depending of the perceived severity and/or number of [upvotes](https://help.github.com/en/articles/about-conversations-on-github#reacting-to-ideas-in-comments), the investigation will either be delegated to another maintainer for further investigation or either put on hold until someone else (maintainer or contributor) picks it up and eventually start investigating it.
Investigating issues can be a very time consuming task, especially for the maintainers given the huge number of combinations of plugins, datasources, platforms, databases, browsers, tools, hardware, integrations, versions and cloud services etc that are being used with Grafana. There are a certain amount of combinations that are more common than others and these are in general easier for maintainers to investigate.
For some other combinations there may not be possible at all for a maintainer to setup a proper test environment for being able to investigate. In these cases we really appreciate any help we can get from the community. Otherwise the issue is highly likely to be closed.
Even if you don't have the time or knowledge to investigate an issue we highly recommend that you [upvote](https://help.github.com/en/articles/about-conversations-on-github#reacting-to-ideas-in-comments) the issue if you happen to have the same problem. If you have further details that may help investigating the issue please provide as much information as possible.
## Appendix
### Setting up Gmail filters
If you're using Gmail it's highly recommened that you setup filters to automatically remove email from the inbox and label them accordingly to make it easy for you to understand when you need to act upon a notification or process all incoming issues that haven't been triaged.
This may be setup by personal preference, but here's a working configuration for reference.
1. Follow instructions in [gist](https://gist.github.com/marefr/9167c2e31466f6316c1cba118874e74f)
2. In Gmail, go to Settings -> Filters and Blocked Addresses
3. Import filters -> select xml file -> Open file
4. Review filters
5. Optional, Check Apply new filters to existing email
6. Create filters
This will give you a structure of labels in the sidebar similar to the following:
```
- Inbox
...
- Github (mine)
- activity
- assigned
- mentions
- Github (other)
- Grafana
```
* All notifications youll need to read/take action on shows up as unread in Github (mine) and its sub-labels.
* All other notifications you dont need to take action on shows up as unread in Github (other) and its sub-labels
* This is convenient for issue triage and to follow the activity in the Grafana project.

View File

@@ -1,6 +1,10 @@
-include local/Makefile
.PHONY: all deps-go deps-js deps build-go build-server build-cli build-js build build-docker-dev build-docker-full lint-go test-go test-js test run clean
.PHONY: all deps-go deps-js deps build-go build-server build-cli build-js build build-docker-dev build-docker-full lint-go gosec revive golangci-lint go-vet test-go test-js test run clean devenv devenv-down revive-alerting
GO = GO111MODULE=on go
GO_FILES ?= ./pkg/...
SH_FILES ?= $(shell find ./scripts -name *.sh)
all: deps build
@@ -40,10 +44,6 @@ build-docker-full:
@echo "build docker container"
docker build --tag grafana/grafana:dev .
lint-go:
@echo "lint go source"
scripts/backend-lint.sh
test-go:
@echo "test backend"
GO111MODULE=on go test -v ./pkg/...
@@ -54,10 +54,6 @@ test-js:
test: test-go test-js
run:
@echo "start a server"
./bin/grafana-server
clean:
@echo "cleaning"
rm -rf node_modules
@@ -66,3 +62,83 @@ clean:
node_modules: package.json yarn.lock
@echo "install frontend dependencies"
yarn install --pure-lockfile --no-progress
scripts/go/bin/revive: scripts/go/go.mod
@cd scripts/go; \
$(GO) build -o ./bin/revive github.com/mgechev/revive
scripts/go/bin/gosec: scripts/go/go.mod
@cd scripts/go; \
$(GO) build -o ./bin/gosec github.com/securego/gosec/cmd/gosec
scripts/go/bin/bra: scripts/go/go.mod
@cd scripts/go; \
$(GO) build -o ./bin/bra github.com/Unknwon/bra
scripts/go/bin/golangci-lint: scripts/go/go.mod
@cd scripts/go; \
$(GO) build -o ./bin/golangci-lint github.com/golangci/golangci-lint/cmd/golangci-lint
revive: scripts/go/bin/revive
@echo "lint via revive"
@scripts/go/bin/revive \
-formatter stylish \
-config ./scripts/go/configs/revive.toml \
$(GO_FILES)
revive-alerting: scripts/go/bin/revive
@echo "lint alerting via revive"
@scripts/go/bin/revive \
-formatter stylish \
./pkg/services/alerting/...
# TODO recheck the rules and leave only necessary exclusions
gosec: scripts/go/bin/gosec
@echo "lint via gosec"
@scripts/go/bin/gosec -quiet \
-exclude=G104,G107,G201,G202,G204,G301,G304,G401,G402,G501 \
-conf=./scripts/go/configs/gosec.json \
$(GO_FILES)
golangci-lint: scripts/go/bin/golangci-lint
@echo "lint via golangci-lint"
@scripts/go/bin/golangci-lint run \
--config ./scripts/go/configs/.golangci.yml \
$(GO_FILES)
go-vet:
@echo "lint via go vet"
@go vet $(GO_FILES)
lint-go: go-vet golangci-lint revive revive-alerting gosec
# with disabled SC1071 we are ignored some TCL,Expect `/usr/bin/env expect` scripts
shellcheck: $(SH_FILES)
@docker run --rm -v "$$PWD:/mnt" koalaman/shellcheck:stable \
$(SH_FILES) -e SC1071
run: scripts/go/bin/bra
@scripts/go/bin/bra run
# create docker-compose file with provided sources and start them
# example: make devenv sources=postgres,openldap
ifeq ($(sources),)
devenv:
@printf 'You have to define sources for this command \nexample: make devenv sources=postgres,openldap\n'
else
devenv: devenv-down
$(eval targets := $(shell echo '$(sources)' | tr "," " "))
@cd devenv; \
./create_docker_compose.sh $(targets) || \
(rm -rf docker-compose.yaml; exit 1)
@cd devenv; \
docker-compose up -d --build
endif
# drop down the envs
devenv-down:
@cd devenv; \
test -f docker-compose.yaml && \
docker-compose down || exit 0;

View File

@@ -1,5 +1,5 @@
[Grafana](https://grafana.com) [![Circle CI](https://circleci.com/gh/grafana/grafana.svg?style=svg)](https://circleci.com/gh/grafana/grafana) [![Go Report Card](https://goreportcard.com/badge/github.com/grafana/grafana)](https://goreportcard.com/report/github.com/grafana/grafana) [![codecov](https://codecov.io/gh/grafana/grafana/branch/master/graph/badge.svg)](https://codecov.io/gh/grafana/grafana)
================
# [Grafana](https://grafana.com) [![Circle CI](https://circleci.com/gh/grafana/grafana.svg?style=svg)](https://circleci.com/gh/grafana/grafana) [![Go Report Card](https://goreportcard.com/badge/github.com/grafana/grafana)](https://goreportcard.com/report/github.com/grafana/grafana) [![codecov](https://codecov.io/gh/grafana/grafana/branch/master/graph/badge.svg)](https://codecov.io/gh/grafana/grafana)
[Website](https://grafana.com) |
[Twitter](https://twitter.com/grafana) |
[Community & Forum](https://community.grafana.com)
@@ -12,19 +12,21 @@ Graphite, Elasticsearch, OpenTSDB, Prometheus and InfluxDB.
-->
## Installation
Head to [docs.grafana.org](http://docs.grafana.org/installation/) for documentation or [download](https://grafana.com/get) to get the latest release.
## Documentation & Support
Be sure to read the [getting started guide](http://docs.grafana.org/guides/gettingstarted/) and the other feature guides.
## Run from master
If you want to build a package yourself, or contribute - here is a guide for how to do that. You can always find
the latest master builds [here](https://grafana.com/grafana/download)
### Dependencies
- Go (Latest Stable)
- bra [`go get github.com/Unknwon/bra`]
- Node.js LTS
- yarn [`npm install -g yarn`]
@@ -37,23 +39,6 @@ go get github.com/grafana/grafana
cd $GOPATH/src/github.com/grafana/grafana
```
### Building
#### The backend
```bash
go run build.go setup
go run build.go build
```
#### Frontend assets
*For this you need Node.js (LTS version).*
```bash
yarn install --pure-lockfile
```
### Run and rebuild on source change
#### Backend
@@ -61,7 +46,7 @@ yarn install --pure-lockfile
To run the backend and rebuild on source change:
```bash
$GOPATH/bin/bra run
make run
```
#### Frontend
@@ -80,7 +65,7 @@ yarn start:hot
env GRAFANA_THEME=light yarn start:hot
```
*Note: HMR for Angular is not supported. If you edit files in the Angular part of the app, the whole page will reload.*
_Note: HMR for Angular is not supported. If you edit files in the Angular part of the app, the whole page will reload._
Run tests and rebuild on source change:
@@ -90,6 +75,23 @@ yarn jest
**Open grafana in your browser (default: e.g. `http://localhost:3000`) and login with admin user (default: `user/pass = admin/admin`).**
### Building
#### The backend
```bash
go run build.go setup
go run build.go build
```
#### Frontend assets
_For this you need Node.js (LTS version)._
```bash
yarn install --pure-lockfile
```
### Building a Docker image
There are two different ways to build a Grafana docker image. If your machine is setup for Grafana development and you run linux/amd64 you can build just the image. Otherwise, there is the option to build Grafana completely within Docker.
@@ -128,7 +130,9 @@ In your custom.ini uncomment (remove the leading `;`) sign. And set `app_mode =
### Running tests
#### Frontend
Execute all frontend tests
```bash
yarn test
```
@@ -139,6 +143,7 @@ Writing & watching frontend tests
- Jest will run all test files that end with the name ".test.ts"
#### Backend
```bash
# Run Golang tests using sqlite3 as database (default)
go test ./pkg/...
@@ -150,6 +155,26 @@ GRAFANA_TEST_DB=mysql go test ./pkg/...
GRAFANA_TEST_DB=postgres go test ./pkg/...
```
#### End-to-end
Execute all end-to-end tests
```bash
yarn e2e-tests
```
Execute all end-to-end tests using using a specific url
```bash
ENV BASE_URL=http://localhost:3333 yarn e2e-tests
```
Debugging all end-to-end tests (BROWSER=1 will start the browser and SLOWMO=1 will delay each puppeteer operation by 100ms)
```bash
ENV BROWSER=1 SLOWMO=1 yarn e2e-tests
```
### Datasource and dashboard provisioning
[Here](https://github.com/grafana/grafana/tree/master/devenv) you can find helpful scripts and docker-compose setup
@@ -171,4 +196,3 @@ plugin development.
## License
Grafana is distributed under [Apache 2.0 License](https://github.com/grafana/grafana/blob/master/LICENSE).

17
SECURITY.md Normal file
View File

@@ -0,0 +1,17 @@
Reporting Security Issues
------------------
If you think you have found a security vulnerability, please send a report to [security@grafana.com](mailto:security@grafana.com). This address can be used for all of Grafana Labs's open source and commercial products (including but not limited to Grafana, Grafana Cloud, Grafana Enterprise, and grafana.com). We can accept only vulnerability reports at this address. We would prefer that you encrypt your message to us; please use our PGP key. The key fingerprint is:
F988 7BEA 027A 049F AE8E 5CAA D125 8932 BE24 C5CA
The key is available from [pgp.mit.edu](https://pgp.mit.edu/pks/lookup?op=get&search=0xF9887BEA027A049FAE8E5CAAD1258932BE24C5CA) by searching for [grafana](https://pgp.mit.edu/pks/lookup?search=grafana&op=index).
Grafana Labs will send you a response indicating the next steps in handling your report. After the initial reply to your report, the security team will keep you informed of the progress towards a fix and full announcement, and may ask for additional information or guidance.
**Important:** We ask you to not disclose the vulnerability before it have been fixed and announced, unless you have got a response from the Grafana Labs security team that you can do that.
### Security Announcements
We maintain a category on the community site called [Security Announcements](https://community.grafana.com/c/security-announcements),
where we will post a summary, remediation, and mitigation details for any patch containing security fixes. You can also subscribe to email updates to this category if you have a grafana.com account and sign on to the community site or track updates via an [RSS feed](https://community.grafana.com/c/security-announcements.rss).

9
SUPPORT.md Normal file
View File

@@ -0,0 +1,9 @@
Need help or support?
------------------
**Please note:**
- Only submit issues for bug reports, feature requests or enhancements.
- Grafana project uses GitHub mainly for tracking bugs and feature requests.
- Asking a question by opening an issue will directly result in issue being closed.
If you require help or support then ask a question and/or find existing questions/answers in the [Grafana community site](https://community.grafana.com/).

View File

@@ -22,18 +22,30 @@ The Grafana project uses [Go modules](https://golang.org/cmd/go/#hdr-Modules__mo
All dependencies are vendored in the `vendor/` directory.
_Note:_ Since most developers of Grafana still use the `GOPATH` we need to specify `GO111MODULE=on` to make `go mod` and `got get` work as intended. If you have setup Grafana outside of the `GOPATH` on your machine you can skip `GO111MODULE=on` when running the commands below.
To add or update a new dependency, use the `go get` command:
```bash
# The GO111MODULE variable can be omitted when the code isn't located in GOPATH.
# Pick the latest tagged release.
go get example.com/some/module/pkg
GO111MODULE=on go get example.com/some/module/pkg
# Pick a specific version.
go get example.com/some/module/pkg@vX.Y.Z
GO111MODULE=on go get example.com/some/module/pkg@vX.Y.Z
```
Tidy up the `go.mod` and `go.sum` files and copy the new/updated dependency to the `vendor/` directory:
```bash
# The GO111MODULE variable can be omitted when the code isn't located in GOPATH.
GO111MODULE=on go mod tidy
GO111MODULE=on go mod vendor
```
You have to commit the changes to `go.mod`, `go.sum` and the `vendor/` directory before submitting the pull request.
## Node.js Dependencies
Updated using `yarn`.
@@ -60,7 +72,7 @@ Our builds run on CircleCI through our build script.
The main build step (in CircleCI) is built using a custom build container that comes pre-baked with some of the necessary dependencies.
Link: [grafana-build-container](https://github.com/grafana/grafana-build-container)
Link: [grafana/build-container](https://github.com/grafana/grafana/tree/master/scripts/build/ci-build)
#### Dependencies

View File

@@ -43,7 +43,9 @@ var (
workingDir string
includeBuildId bool = true
buildId string = "0"
binaries []string = []string{"grafana-server", "grafana-cli"}
serverBinary string = "grafana-server"
cliBinary string = "grafana-cli"
binaries []string = []string{serverBinary, cliBinary}
isDev bool = false
enterprise bool = false
skipRpmGen bool = false
@@ -230,6 +232,7 @@ type linuxPackageOptions struct {
packageType string
packageArch string
homeDir string
homeBinDir string
binPath string
serverBinPath string
cliBinPath string
@@ -240,10 +243,11 @@ type linuxPackageOptions struct {
initdScriptFilePath string
systemdServiceFilePath string
postinstSrc string
initdScriptSrc string
defaultFileSrc string
systemdFileSrc string
postinstSrc string
initdScriptSrc string
defaultFileSrc string
systemdFileSrc string
cliBinaryWrapperSrc string
depends []string
}
@@ -258,6 +262,7 @@ func createDebPackages() {
packageType: "deb",
packageArch: debPkgArch,
homeDir: "/usr/share/grafana",
homeBinDir: "/usr/share/grafana/bin",
binPath: "/usr/sbin",
configDir: "/etc/grafana",
etcDefaultPath: "/etc/default",
@@ -265,10 +270,11 @@ func createDebPackages() {
initdScriptFilePath: "/etc/init.d/grafana-server",
systemdServiceFilePath: "/usr/lib/systemd/system/grafana-server.service",
postinstSrc: "packaging/deb/control/postinst",
initdScriptSrc: "packaging/deb/init.d/grafana-server",
defaultFileSrc: "packaging/deb/default/grafana-server",
systemdFileSrc: "packaging/deb/systemd/grafana-server.service",
postinstSrc: "packaging/deb/control/postinst",
initdScriptSrc: "packaging/deb/init.d/grafana-server",
defaultFileSrc: "packaging/deb/default/grafana-server",
systemdFileSrc: "packaging/deb/systemd/grafana-server.service",
cliBinaryWrapperSrc: "packaging/wrappers/grafana-cli",
depends: []string{"adduser", "libfontconfig1"},
})
@@ -286,6 +292,7 @@ func createRpmPackages() {
packageType: "rpm",
packageArch: rpmPkgArch,
homeDir: "/usr/share/grafana",
homeBinDir: "/usr/share/grafana/bin",
binPath: "/usr/sbin",
configDir: "/etc/grafana",
etcDefaultPath: "/etc/sysconfig",
@@ -293,10 +300,11 @@ func createRpmPackages() {
initdScriptFilePath: "/etc/init.d/grafana-server",
systemdServiceFilePath: "/usr/lib/systemd/system/grafana-server.service",
postinstSrc: "packaging/rpm/control/postinst",
initdScriptSrc: "packaging/rpm/init.d/grafana-server",
defaultFileSrc: "packaging/rpm/sysconfig/grafana-server",
systemdFileSrc: "packaging/rpm/systemd/grafana-server.service",
postinstSrc: "packaging/rpm/control/postinst",
initdScriptSrc: "packaging/rpm/init.d/grafana-server",
defaultFileSrc: "packaging/rpm/sysconfig/grafana-server",
systemdFileSrc: "packaging/rpm/systemd/grafana-server.service",
cliBinaryWrapperSrc: "packaging/wrappers/grafana-cli",
depends: []string{"/sbin/service", "fontconfig", "freetype", "urw-fonts"},
})
@@ -323,10 +331,12 @@ func createPackage(options linuxPackageOptions) {
runPrint("mkdir", "-p", filepath.Join(packageRoot, "/usr/lib/systemd/system"))
runPrint("mkdir", "-p", filepath.Join(packageRoot, "/usr/sbin"))
// copy binary
for _, binary := range binaries {
runPrint("cp", "-p", filepath.Join(workingDir, "tmp/bin/"+binary), filepath.Join(packageRoot, "/usr/sbin/"+binary))
}
// copy grafana-cli wrapper
runPrint("cp", "-p", options.cliBinaryWrapperSrc, filepath.Join(packageRoot, "/usr/sbin/"+cliBinary))
// copy grafana-server binary
runPrint("cp", "-p", filepath.Join(workingDir, "tmp/bin/"+serverBinary), filepath.Join(packageRoot, "/usr/sbin/"+serverBinary))
// copy init.d script
runPrint("cp", "-p", options.initdScriptSrc, filepath.Join(packageRoot, options.initdScriptFilePath))
// copy environment var file
@@ -338,6 +348,13 @@ func createPackage(options linuxPackageOptions) {
// remove bin path
runPrint("rm", "-rf", filepath.Join(packageRoot, options.homeDir, "bin"))
// create /bin within home
runPrint("mkdir", "-p", filepath.Join(packageRoot, options.homeBinDir))
// The grafana-cli binary is exposed through a wrapper to ensure a proper
// configuration is in place. To enable that, we need to store the original
// binary in a separate location to avoid conflicts.
runPrint("cp", "-p", filepath.Join(workingDir, "tmp/bin/"+cliBinary), filepath.Join(packageRoot, options.homeBinDir, cliBinary))
args := []string{
"-s", "dir",
"--description", "Grafana",
@@ -391,7 +408,7 @@ func createPackage(options linuxPackageOptions) {
args = append(args, "--iteration", linuxPackageIteration)
}
// add dependenciesj
// add dependencies
for _, dep := range options.depends {
args = append(args, "--depends", dep)
}

View File

@@ -47,6 +47,9 @@ enforce_domain = false
# The full public facing url
root_url = %(protocol)s://%(domain)s:%(http_port)s/
# Serve Grafana from subpath specified in `root_url` setting. By default it is set to `false` for compatibility reasons.
serve_from_sub_path = false
# Log web requests
router_logging = false
@@ -113,7 +116,7 @@ type = database
# cache connectionstring options
# database: will use Grafana primary database.
# redis: config like redis server e.g. `addr=127.0.0.1:6379,pool_size=100,db=grafana`
# redis: config like redis server e.g. `addr=127.0.0.1:6379,pool_size=100,db=0`. Only addr is required.
# memcache: 127.0.0.1:11211
connstr =
@@ -179,6 +182,31 @@ 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.
allow_embedding = false
# Set to true if you want to enable http strict transport security (HSTS) response header.
# This is only sent when HTTPS is enabled in this configuration.
# HSTS tells browsers that the site should only be accessed using HTTPS.
# The default will change to true in the next minor release, 6.3.
strict_transport_security = false
# Sets how long a browser should cache HSTS. Only applied if strict_transport_security is enabled.
strict_transport_security_max_age_seconds = 86400
# Set to true if to enable HSTS preloading option. Only applied if strict_transport_security is enabled.
strict_transport_security_preload = false
# Set to true if to enable the HSTS includeSubDomains option. Only applied if strict_transport_security is enabled.
strict_transport_security_subdomains = false
# Set to true to enable the X-Content-Type-Options response header.
# The X-Content-Type-Options response HTTP header is a marker used by the server to indicate that the MIME types advertised
# in the Content-Type headers should not be changed and be followed. The default will change to true in the next minor release, 6.3.
x_content_type_options = false
# Set to true to enable the X-XSS-Protection header, which tells browsers to stop pages from loading
# when they detect reflected cross-site scripting (XSS) attacks. The default will change to true in the next minor release, 6.3.
x_xss_protection = false
#################################### Snapshots ###########################
[snapshots]
# snapshot sharing options
@@ -259,6 +287,9 @@ signout_redirect_url =
# This setting is ignored if multiple OAuth providers are configured.
oauth_auto_login = false
# limit of api_key seconds to live before expiration
api_key_max_seconds_to_live = -1
#################################### Anonymous Auth ######################
[auth.anonymous]
# enable anonymous access
@@ -346,6 +377,47 @@ tls_client_key =
tls_client_ca =
send_client_credentials_via_post = false
#################################### SAML Auth ###########################
[auth.saml] # Enterprise only
# Defaults to false. If true, the feature is enabled
enabled = false
# 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 = 90s
# Duration, for how long the SP's metadata should be valid. Defaults to 48 hours
metadata_valid_duration = 48h
# 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
#################################### Basic Auth ##########################
[auth.basic]
enabled = true
@@ -367,8 +439,9 @@ config_file = /etc/grafana/ldap.toml
allow_sign_up = true
# LDAP backround sync (Enterprise only)
sync_cron = @hourly
active_sync_enabled = false
# At 1 am every day
sync_cron = "0 0 1 * * *"
active_sync_enabled = true
#################################### SMTP / Emailing #####################
[smtp]
@@ -550,6 +623,11 @@ sampler_type = const
# and indicates the initial sampling rate before the actual one
# is received from the mothership
sampler_param = 1
# Whether or not to use Zipkin span propagation (x-b3- HTTP headers).
zipkin_propagation = false
# Setting this to true disables shared RPC spans.
# Not disabling is the most common setting when using Zipkin elsewhere in your infrastructure.
disable_shared_zipkin_spans = false
#################################### External Image Storage ##############
[external_image_storage]

53
conf/ldap_multiple.toml Normal file
View File

@@ -0,0 +1,53 @@
# --- First LDAP Server ---
[[servers]]
host = "10.0.0.1"
port = 389
use_ssl = false
start_tls = false
ssl_skip_verify = false
bind_dn = "cn=admin,dc=grafana,dc=org"
bind_password = 'grafana'
search_filter = "(cn=%s)"
search_base_dns = ["ou=users,dc=grafana,dc=org"]
[servers.attributes]
name = "givenName"
surname = "sn"
username = "cn"
member_of = "memberOf"
email = "email"
[[servers.group_mappings]]
group_dn = "cn=admins,ou=groups,dc=grafana,dc=org"
org_role = "Admin"
grafana_admin = true
# --- Second LDAP Server ---
[[servers]]
host = "10.0.0.2"
port = 389
use_ssl = false
start_tls = false
ssl_skip_verify = false
bind_dn = "cn=admin,dc=grafana,dc=org"
bind_password = 'grafana'
search_filter = "(cn=%s)"
search_base_dns = ["ou=users,dc=grafana,dc=org"]
[servers.attributes]
name = "givenName"
surname = "sn"
username = "cn"
member_of = "memberOf"
email = "email"
[[servers.group_mappings]]
group_dn = "cn=editors,ou=groups,dc=grafana,dc=org"
org_role = "Editor"
[[servers.group_mappings]]
group_dn = "*"
org_role = "Viewer"

View File

@@ -48,6 +48,9 @@
# If you use reverse proxy and sub path specify full url (with sub path)
;root_url = http://localhost:3000
# Serve Grafana from subpath specified in `root_url` setting. By default it is set to `false` for compatibility reasons.
;serve_from_sub_path = false
# Log web requests
;router_logging = false
@@ -97,7 +100,7 @@
;conn_max_lifetime = 14400
# Set to true to log the sql calls and execution times.
log_queries =
;log_queries =
# For "sqlite3" only. cache mode setting used for connecting to the database. (private, shared)
;cache_mode = private
@@ -109,7 +112,7 @@ log_queries =
# cache connectionstring options
# database: will use Grafana primary database.
# redis: config like redis server e.g. `addr=127.0.0.1:6379,pool_size=100,db=grafana`
# redis: config like redis server e.g. `addr=127.0.0.1:6379,pool_size=100,db=0`. Only addr is required.
# memcache: 127.0.0.1:11211
;connstr =
@@ -175,6 +178,30 @@ log_queries =
# set to true if you want to allow browsers to render Grafana in a <frame>, <iframe>, <embed> or <object>. default is false.
;allow_embedding = false
# Set to true if you want to enable http strict transport security (HSTS) response header.
# This is only sent when HTTPS is enabled in this configuration.
# HSTS tells browsers that the site should only be accessed using HTTPS.
# The default version will change to true in the next minor release, 6.3.
;strict_transport_security = false
# Sets how long a browser should cache HSTS. Only applied if strict_transport_security is enabled.
;strict_transport_security_max_age_seconds = 86400
# Set to true if to enable HSTS preloading option. Only applied if strict_transport_security is enabled.
;strict_transport_security_preload = false
# Set to true if to enable the HSTS includeSubDomains option. Only applied if strict_transport_security is enabled.
;strict_transport_security_subdomains = false
# Set to true to enable the X-Content-Type-Options response header.
# The X-Content-Type-Options response HTTP header is a marker used by the server to indicate that the MIME types advertised
# in the Content-Type headers should not be changed and be followed. The default will change to true in the next minor release, 6.3.
;x_content_type_options = false
# Set to true to enable the X-XSS-Protection header, which tells browsers to stop pages from loading
# when they detect reflected cross-site scripting (XSS) attacks. The default will change to true in the next minor release, 6.3.
;x_xss_protection = false
#################################### Snapshots ###########################
[snapshots]
# snapshot sharing options
@@ -306,6 +333,47 @@ log_queries =
; This might be required if the OAuth provider is not RFC6749 compliant, only supporting credentials passed via POST payload
;send_client_credentials_via_post = false
#################################### SAML Auth ###########################
[auth.saml] # Enterprise only
# Defaults to false. If true, the feature is enabled.
;enabled = false
# 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 = 90s
# Duration, for how long the SP's metadata should be valid. Defaults to 48 hours.
;metadata_valid_duration = 48h
# 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
#################################### Grafana.com Auth ####################
[auth.grafana_com]
;enabled = false
@@ -335,6 +403,11 @@ log_queries =
;config_file = /etc/grafana/ldap.toml
;allow_sign_up = true
# LDAP backround sync (Enterprise only)
# At 1 am every day
;sync_cron = "0 0 1 * * *"
;active_sync_enabled = true
#################################### SMTP / Emailing ##########################
[smtp]
;enabled = false
@@ -473,6 +546,11 @@ log_queries =
# and indicates the initial sampling rate before the actual one
# is received from the mothership
;sampler_param = 1
# Whether or not to use Zipkin propagation (x-b3- HTTP headers).
;zipkin_propagation = false
# Setting this to true disables shared RPC spans.
# Not disabling is the most common setting when using Zipkin elsewhere in your infrastructure.
;disable_shared_zipkin_spans = false
#################################### Grafana.com integration ##########################
# Url used to import dashboards directly from Grafana.com
@@ -527,4 +605,3 @@ log_queries =
[plugins]
;enable_alpha = false
;app_tls_skip_verify_insecure = false

View File

@@ -1,10 +1,11 @@
apiVersion: 1
datasources:
- name: gdev-graphite
type: graphite
access: proxy
url: http://localhost:8080
url: http://localhost:8180
jsonData:
graphiteVersion: "1.1"
@@ -13,6 +14,11 @@ datasources:
access: proxy
url: http://localhost:9090
- name: gdev-slow-prometheus
type: prometheus
access: proxy
url: http://localhost:3011
- name: gdev-testdata
type: testdata
isDefault: true
@@ -28,6 +34,17 @@ datasources:
secureJsonData:
password: grafana
- name: gdev-influxdb-telegraf
type: influxdb
access: proxy
database: telegraf
user: grafana
url: http://localhost:8086
jsonData:
timeInterval: "10s"
secureJsonData:
password: grafana
- name: gdev-opentsdb
type: opentsdb
access: proxy
@@ -136,6 +153,20 @@ datasources:
interval: Daily
timeField: "@timestamp"
esVersion: 70
timeInterval: "10s"
logMessageField: message
logLevelField: fields.level
- name: gdev-elasticsearch-v7-metricbeat
type: elasticsearch
access: proxy
database: "[metricbeat-]YYYY.MM.DD"
url: http://localhost:12200
jsonData:
interval: Daily
timeField: "@timestamp"
esVersion: 70
timeInterval: "10s"
- name: gdev-mysql
type: mysql

File diff suppressed because it is too large Load Diff

View File

@@ -21,79 +21,62 @@
"datasource": "gdev-testdata",
"gridPos": {
"h": 8,
"w": 24,
"w": 20,
"x": 0,
"y": 0
},
"id": 6,
"links": [],
"options-gauge": {
"decimals": 0,
"maxValue": 100,
"minValue": 0,
"options": {
"decimals": 0,
"maxValue": 100,
"minValue": 0,
"prefix": "",
"showThresholdLabels": false,
"showThresholdMarkers": true,
"stat": "avg",
"suffix": "",
"thresholds": [],
"unit": "none",
"valueMappings": []
"options": {
"fieldOptions": {
"calcs": ["mean"],
"defaults": {
"decimals": 0,
"max": 100,
"min": 0,
"unit": "none"
},
"mappings": [],
"override": {},
"thresholds": [
{
"color": "#7EB26D",
"index": 0,
"value": null
},
{
"color": "#EAB839",
"index": 1,
"value": 50
},
{
"color": "#6ED0E0",
"index": 2,
"value": 75
},
{
"color": "#EF843C",
"index": 3,
"value": 87.5
},
{
"color": "#E24D42",
"index": 4,
"value": 93.75
},
{
"color": "#1F78C1",
"index": 5,
"value": 96.875
}
],
"values": false
},
"prefix": "",
"orientation": "auto",
"showThresholdLabels": false,
"showThresholdMarkers": true,
"stat": "avg",
"suffix": "",
"thresholds": [
{
"color": "#1F78C1",
"index": 5,
"value": 96.875
},
{
"color": "#E24D42",
"index": 4,
"value": 93.75
},
{
"color": "#EF843C",
"index": 3,
"value": 87.5
},
{
"color": "#6ED0E0",
"index": 2,
"value": 75
},
{
"color": "#EAB839",
"index": 1,
"value": 50
},
{
"color": "#7EB26D",
"index": 0,
"value": null
}
],
"unit": "none",
"valueMappings": [
{
"from": "50",
"id": 1,
"operator": "",
"text": "Hello :) ",
"to": "90",
"type": 2,
"value": ""
}
]
"showThresholdMarkers": true
},
"pluginVersion": "6.3.0-pre",
"targets": [
{
"refId": "A",
@@ -124,129 +107,48 @@
{
"datasource": "gdev-testdata",
"gridPos": {
"h": 8,
"w": 24,
"x": 0,
"y": 8
},
"id": 2,
"links": [],
"options-gauge": {
"decimals": 0,
"maxValue": 100,
"minValue": 0,
"options": {
"decimals": 0,
"maxValue": 100,
"minValue": 0,
"prefix": "",
"showThresholdLabels": false,
"showThresholdMarkers": true,
"stat": "avg",
"suffix": "",
"thresholds": [],
"unit": "none",
"valueMappings": []
},
"prefix": "",
"showThresholdLabels": false,
"showThresholdMarkers": true,
"stat": "avg",
"suffix": "",
"thresholds": [
{
"color": "#EAB839",
"index": 1,
"value": 50
},
{
"color": "#7EB26D",
"index": 0,
"value": null
}
],
"unit": "none",
"valueMappings": []
},
"targets": [
{
"refId": "A",
"scenarioId": "random_walk"
},
{
"refId": "B",
"scenarioId": "random_walk"
},
{
"refId": "C",
"scenarioId": "random_walk"
},
{
"refId": "D",
"scenarioId": "random_walk"
},
{
"refId": "E",
"scenarioId": "random_walk"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Repeat horizontal",
"type": "gauge"
},
{
"datasource": "gdev-testdata",
"gridPos": {
"h": 14,
"w": 5,
"x": 0,
"y": 16
"h": 28,
"w": 4,
"x": 20,
"y": 0
},
"id": 4,
"links": [],
"options-gauge": {
"decimals": 0,
"maxValue": "200",
"minValue": 0,
"options": {
"decimals": 0,
"maxValue": 100,
"minValue": 0,
"prefix": "",
"showThresholdLabels": false,
"showThresholdMarkers": true,
"stat": "avg",
"suffix": "",
"thresholds": [],
"unit": "none",
"valueMappings": []
"options": {
"fieldOptions": {
"calcs": ["max"],
"defaults": {
"decimals": 0,
"max": "200",
"min": 0,
"unit": "none"
},
"mappings": [],
"override": {},
"thresholds": [
{
"color": "#7EB26D",
"index": 0,
"value": null
},
{
"color": "#EAB839",
"index": 1,
"value": 50
},
{
"color": "#6ED0E0",
"index": 2,
"value": 75
}
],
"values": false
},
"prefix": "",
"orientation": "auto",
"showThresholdLabels": false,
"showThresholdMarkers": true,
"stat": "max",
"suffix": "",
"thresholds": [
{
"color": "#6ED0E0",
"index": 2,
"value": 75
},
{
"color": "#EAB839",
"index": 1,
"value": 50
},
{
"color": "#7EB26D",
"index": 0,
"value": null
}
],
"unit": "none",
"valueMappings": []
"showThresholdMarkers": true
},
"pluginVersion": "6.3.0-pre",
"targets": [
{
"refId": "A",
@@ -273,9 +175,76 @@
"timeShift": null,
"title": "Vertical",
"type": "gauge"
},
{
"datasource": "gdev-testdata",
"gridPos": {
"h": 20,
"w": 20,
"x": 0,
"y": 8
},
"id": 2,
"links": [],
"options": {
"fieldOptions": {
"calcs": ["mean"],
"defaults": {
"decimals": 0,
"max": 100,
"min": 0,
"unit": "none"
},
"mappings": [],
"override": {},
"thresholds": [
{
"color": "#7EB26D",
"index": 0,
"value": null
},
{
"color": "#EAB839",
"index": 1,
"value": 50
}
],
"values": false
},
"orientation": "auto",
"showThresholdLabels": false,
"showThresholdMarkers": true
},
"pluginVersion": "6.3.0-pre",
"targets": [
{
"refId": "A",
"scenarioId": "random_walk"
},
{
"refId": "B",
"scenarioId": "random_walk"
},
{
"refId": "C",
"scenarioId": "random_walk"
},
{
"refId": "D",
"scenarioId": "random_walk"
},
{
"refId": "E",
"scenarioId": "random_walk"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Repeat horizontal",
"type": "gauge"
}
],
"schemaVersion": 17,
"schemaVersion": 18,
"style": "dark",
"tags": ["panel-tests", "gdev", "gauge"],
"templating": {
@@ -292,5 +261,5 @@
"timezone": "",
"title": "Panel Tests - Gauge Multi Series",
"uid": "szkuR1umk",
"version": 7
"version": 2
}

View File

@@ -0,0 +1,383 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"links": [],
"panels": [
{
"aliasColors": {
"A-series": "rgb(48, 139, 237)"
},
"bars": false,
"dashLength": 10,
"dashes": false,
"fill": 1,
"fillGradient": 5,
"gridPos": {
"h": 8,
"w": 11,
"x": 0,
"y": 0
},
"id": 2,
"interval": "1m",
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": false,
"total": false,
"values": false
},
"lines": true,
"linewidth": 2,
"links": [],
"nullPointMode": "null",
"options": {},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"refId": "A",
"scenarioId": "random_walk"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Req/s",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {
"A-series": "rgb(87, 186, 242)"
},
"bars": false,
"dashLength": 10,
"dashes": false,
"fill": 4,
"fillGradient": 4,
"gridPos": {
"h": 15,
"w": 13,
"x": 11,
"y": 0
},
"id": 11,
"interval": "1m",
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"options": {},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"refId": "A",
"scenarioId": "random_walk"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Req/s",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {
"A-series": "red"
},
"bars": false,
"dashLength": 10,
"dashes": false,
"fill": 1,
"fillGradient": 5,
"gridPos": {
"h": 7,
"w": 11,
"x": 0,
"y": 8
},
"id": 7,
"interval": "1m",
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": false,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"options": {},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"refId": "A",
"scenarioId": "random_walk"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Memory",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "decgbytes",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {
"A-series": "green"
},
"bars": false,
"dashLength": 10,
"dashes": false,
"fill": 2,
"fillGradient": 10,
"gridPos": {
"h": 8,
"w": 24,
"x": 0,
"y": 15
},
"id": 10,
"interval": "1m",
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": false,
"total": false,
"values": false
},
"lines": true,
"linewidth": 0,
"links": [],
"nullPointMode": "null",
"options": {},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"refId": "A",
"scenarioId": "random_walk"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Req/s",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
}
],
"schemaVersion": 18,
"style": "dark",
"tags": ["gdev", "panel-tests", "graph"],
"templating": {
"list": []
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {
"refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"],
"time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"]
},
"timezone": "",
"title": "Panel Tests - Graph - Gradient Area Fills",
"uid": "37Dq903mk",
"version": 25
}

View File

@@ -21,3 +21,19 @@
- ./docker/blocks/elastic7/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro
- /var/log:/var/log:ro
- ../data/log:/var/log/grafana:ro
metricbeat7:
image: docker.elastic.co/beats/metricbeat-oss:7.0.0
network_mode: host
command: metricbeat -e -strict.perms=false
user: root
volumes:
- ./docker/blocks/elastic7/metricbeat.yml:/usr/share/metricbeat/metricbeat.yml:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
kibana7:
image: docker.elastic.co/kibana/kibana-oss:7.0.0
ports:
- "5601:5601"
environment:
ELASTICSEARCH_HOSTS: http://elasticsearch7:9200

View File

@@ -0,0 +1,38 @@
metricbeat.config:
modules:
path: ${path.config}/modules.d/*.yml
# Reload module configs as they change:
reload.enabled: false
metricbeat.autodiscover:
providers:
- type: docker
hints.enabled: true
metricbeat.modules:
- module: docker
metricsets:
- "container"
- "cpu"
- "diskio"
- "healthcheck"
- "info"
#- "image"
- "memory"
- "network"
hosts: ["unix:///var/run/docker.sock"]
period: 10s
enabled: true
processors:
- add_cloud_metadata: ~
output.elasticsearch:
hosts: ["localhost:12200"]
index: "metricbeat-%{+yyyy.MM.dd}"
setup.template.name: "metricbeat"
setup.template.pattern: "metricbeat-*"
setup.template.settings:
index.number_of_shards: 1
index.number_of_replicas: 1

View File

@@ -1,5 +1,5 @@
influxdb:
image: influxdb:latest
image: influxdb:1.7.6
container_name: influxdb
ports:
- '2004:2004'
@@ -15,3 +15,13 @@
environment:
FD_DATASOURCE: influxdb
FD_PORT: 8086
telegraf:
image: telegraf:1.10.4
links:
- influxdb
volumes:
- ./docker/blocks/influxdb/telegraf.conf:/etc/telegraf/telegraf.conf:ro
- /var/log:/var/log
- ../data/log:/var/log/grafana

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,30 @@
# Fork of https://github.com/dinkel/docker-openldap
FROM debian:jessie
LABEL maintainer="Grafana team <hello@grafana.com>"
ENV OPENLDAP_VERSION 2.4.40
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
slapd=${OPENLDAP_VERSION}* \
ldap-utils && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN mv /etc/ldap /etc/ldap.dist
EXPOSE 389
VOLUME ["/etc/ldap", "/var/lib/ldap"]
COPY admins-ldap-server/modules/ /etc/ldap.dist/modules
COPY admins-ldap-server/prepopulate/ /etc/ldap.dist/prepopulate
COPY ./entrypoint.sh /entrypoint.sh
COPY ./prepopulate.sh /prepopulate.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["slapd", "-d", "32768", "-u", "openldap", "-g", "openldap"]

View File

@@ -0,0 +1,33 @@
dn: cn=module,cn=config
cn: module
objectClass: olcModuleList
objectClass: top
olcModulePath: /usr/lib/ldap
olcModuleLoad: memberof.la
dn: olcOverlay={0}memberof,olcDatabase={1}hdb,cn=config
objectClass: olcConfig
objectClass: olcMemberOf
objectClass: olcOverlayConfig
objectClass: top
olcOverlay: memberof
olcMemberOfDangling: ignore
olcMemberOfRefInt: TRUE
olcMemberOfGroupOC: groupOfNames
olcMemberOfMemberAD: member
olcMemberOfMemberOfAD: memberOf
dn: cn=module,cn=config
cn: module
objectClass: olcModuleList
objectClass: top
olcModulePath: /usr/lib/ldap
olcModuleLoad: refint.la
dn: olcOverlay={1}refint,olcDatabase={1}hdb,cn=config
objectClass: olcConfig
objectClass: olcOverlayConfig
objectClass: olcRefintConfig
objectClass: top
olcOverlay: {1}refint
olcRefintAttribute: memberof member manager owner

View File

@@ -0,0 +1,9 @@
dn: ou=groups,dc=grafana,dc=org
ou: Groups
objectclass: top
objectclass: organizationalUnit
dn: ou=users,dc=grafana,dc=org
ou: Users
objectclass: top
objectclass: organizationalUnit

View File

@@ -0,0 +1,20 @@
# ldap-admin
dn: cn=ldap-admin,ou=users,dc=grafana,dc=org
mail: ldap-admin@grafana.com
userPassword: grafana
objectClass: person
objectClass: top
objectClass: inetOrgPerson
objectClass: organizationalPerson
sn: ldap-admin
cn: ldap-admin
dn: cn=ldap-torkel,ou=users,dc=grafana,dc=org
mail: ldap-torkel@grafana.com
userPassword: grafana
objectClass: person
objectClass: top
objectClass: inetOrgPerson
objectClass: organizationalPerson
sn: ldap-torkel
cn: ldap-torkel

View File

@@ -0,0 +1,6 @@
dn: cn=admins,ou=groups,dc=grafana,dc=org
cn: admins
objectClass: groupOfNames
objectClass: top
member: cn=ldap-admin,ou=users,dc=grafana,dc=org
member: cn=ldap-torkel,ou=users,dc=grafana,dc=org

View File

@@ -0,0 +1,23 @@
admins-openldap:
build:
context: docker/blocks/multiple-openldap
dockerfile: ./admins-ldap-server.Dockerfile
environment:
SLAPD_PASSWORD: grafana
SLAPD_DOMAIN: grafana.org
SLAPD_ADDITIONAL_MODULES: memberof
ports:
- "389:389"
openldap:
build:
context: docker/blocks/multiple-openldap
dockerfile: ./ldap-server.Dockerfile
environment:
SLAPD_PASSWORD: grafana
SLAPD_DOMAIN: grafana.org
SLAPD_ADDITIONAL_MODULES: memberof
ports:
- "388:389"

View File

@@ -0,0 +1,98 @@
#!/bin/bash
# When not limiting the open file descritors limit, the memory consumption of
# slapd is absurdly high. See https://github.com/docker/docker/issues/8231
ulimit -n 8192
set -e
chown -R openldap:openldap /var/lib/ldap/
if [[ ! -d /etc/ldap/slapd.d ]]; then
if [[ -z "$SLAPD_PASSWORD" ]]; then
echo -n >&2 "Error: Container not configured and SLAPD_PASSWORD not set. "
echo >&2 "Did you forget to add -e SLAPD_PASSWORD=... ?"
exit 1
fi
if [[ -z "$SLAPD_DOMAIN" ]]; then
echo -n >&2 "Error: Container not configured and SLAPD_DOMAIN not set. "
echo >&2 "Did you forget to add -e SLAPD_DOMAIN=... ?"
exit 1
fi
SLAPD_ORGANIZATION="${SLAPD_ORGANIZATION:-${SLAPD_DOMAIN}}"
cp -a /etc/ldap.dist/* /etc/ldap
cat <<-EOF | debconf-set-selections
slapd slapd/no_configuration boolean false
slapd slapd/password1 password $SLAPD_PASSWORD
slapd slapd/password2 password $SLAPD_PASSWORD
slapd shared/organization string $SLAPD_ORGANIZATION
slapd slapd/domain string $SLAPD_DOMAIN
slapd slapd/backend select HDB
slapd slapd/allow_ldap_v2 boolean false
slapd slapd/purge_database boolean false
slapd slapd/move_old_database boolean true
EOF
dpkg-reconfigure -f noninteractive slapd >/dev/null 2>&1
dc_string=""
IFS="."; declare -a dc_parts=($SLAPD_DOMAIN)
for dc_part in "${dc_parts[@]}"; do
dc_string="$dc_string,dc=$dc_part"
done
base_string="BASE ${dc_string:1}"
sed -i "s/^#BASE.*/${base_string}/g" /etc/ldap/ldap.conf
if [[ -n "$SLAPD_CONFIG_PASSWORD" ]]; then
password_hash=`slappasswd -s "${SLAPD_CONFIG_PASSWORD}"`
sed_safe_password_hash=${password_hash//\//\\\/}
slapcat -n0 -F /etc/ldap/slapd.d -l /tmp/config.ldif
sed -i "s/\(olcRootDN: cn=admin,cn=config\)/\1\nolcRootPW: ${sed_safe_password_hash}/g" /tmp/config.ldif
rm -rf /etc/ldap/slapd.d/*
slapadd -n0 -F /etc/ldap/slapd.d -l /tmp/config.ldif >/dev/null 2>&1
fi
if [[ -n "$SLAPD_ADDITIONAL_SCHEMAS" ]]; then
IFS=","; declare -a schemas=($SLAPD_ADDITIONAL_SCHEMAS); unset IFS
for schema in "${schemas[@]}"; do
slapadd -n0 -F /etc/ldap/slapd.d -l "/etc/ldap/schema/${schema}.ldif" >/dev/null 2>&1
done
fi
if [[ -n "$SLAPD_ADDITIONAL_MODULES" ]]; then
IFS=","; declare -a modules=($SLAPD_ADDITIONAL_MODULES); unset IFS
for module in "${modules[@]}"; do
echo "Adding module ${module}"
slapadd -n0 -F /etc/ldap/slapd.d -l "/etc/ldap/modules/${module}.ldif" >/dev/null 2>&1
done
fi
# This needs to run in background
# Will prepopulate entries after ldap daemon has started
./prepopulate.sh &
chown -R openldap:openldap /etc/ldap/slapd.d/ /var/lib/ldap/ /var/run/slapd/
else
slapd_configs_in_env=`env | grep 'SLAPD_'`
if [ -n "${slapd_configs_in_env:+x}" ]; then
echo "Info: Container already configured, therefore ignoring SLAPD_xxx environment variables"
fi
fi
exec "$@"

View File

@@ -0,0 +1,30 @@
# Fork of https://github.com/dinkel/docker-openldap
FROM debian:jessie
LABEL maintainer="Grafana team <hello@grafana.com>"
ENV OPENLDAP_VERSION 2.4.40
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
slapd=${OPENLDAP_VERSION}* \
ldap-utils && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN mv /etc/ldap /etc/ldap.dist
EXPOSE 389
VOLUME ["/etc/ldap", "/var/lib/ldap"]
COPY ldap-server/modules/ /etc/ldap.dist/modules
COPY ldap-server/prepopulate/ /etc/ldap.dist/prepopulate
COPY ./entrypoint.sh /entrypoint.sh
COPY ./prepopulate.sh /prepopulate.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["slapd", "-d", "32768", "-u", "openldap", "-g", "openldap"]

View File

@@ -0,0 +1,33 @@
dn: cn=module,cn=config
cn: module
objectClass: olcModuleList
objectClass: top
olcModulePath: /usr/lib/ldap
olcModuleLoad: memberof.la
dn: olcOverlay={0}memberof,olcDatabase={1}hdb,cn=config
objectClass: olcConfig
objectClass: olcMemberOf
objectClass: olcOverlayConfig
objectClass: top
olcOverlay: memberof
olcMemberOfDangling: ignore
olcMemberOfRefInt: TRUE
olcMemberOfGroupOC: groupOfNames
olcMemberOfMemberAD: member
olcMemberOfMemberOfAD: memberOf
dn: cn=module,cn=config
cn: module
objectClass: olcModuleList
objectClass: top
olcModulePath: /usr/lib/ldap
olcModuleLoad: refint.la
dn: olcOverlay={1}refint,olcDatabase={1}hdb,cn=config
objectClass: olcConfig
objectClass: olcOverlayConfig
objectClass: olcRefintConfig
objectClass: top
olcOverlay: {1}refint
olcRefintAttribute: memberof member manager owner

View File

@@ -0,0 +1,9 @@
dn: ou=groups,dc=grafana,dc=org
ou: Groups
objectclass: top
objectclass: organizationalUnit
dn: ou=users,dc=grafana,dc=org
ou: Users
objectclass: top
objectclass: organizationalUnit

View File

@@ -0,0 +1,59 @@
dn: cn=ldap-editor,ou=users,dc=grafana,dc=org
mail: ldap-editor@grafana.com
userPassword: grafana
objectClass: person
objectClass: top
objectClass: inetOrgPerson
objectClass: organizationalPerson
sn: ldap-editor
cn: ldap-editor
dn: cn=ldap-viewer,ou=users,dc=grafana,dc=org
mail: ldap-viewer@grafana.com
userPassword: grafana
objectClass: person
objectClass: top
objectClass: inetOrgPerson
objectClass: organizationalPerson
sn: ldap-viewer
cn: ldap-viewer
dn: cn=ldap-carl,ou=users,dc=grafana,dc=org
mail: ldap-carl@grafana.com
userPassword: grafana
objectClass: person
objectClass: top
objectClass: inetOrgPerson
objectClass: organizationalPerson
sn: ldap-carl
cn: ldap-carl
dn: cn=ldap-daniel,ou=users,dc=grafana,dc=org
mail: ldap-daniel@grafana.com
userPassword: grafana
objectClass: person
objectClass: top
objectClass: inetOrgPerson
objectClass: organizationalPerson
sn: ldap-daniel
cn: ldap-daniel
dn: cn=ldap-leo,ou=users,dc=grafana,dc=org
mail: ldap-leo@grafana.com
userPassword: grafana
objectClass: person
objectClass: top
objectClass: inetOrgPerson
objectClass: organizationalPerson
sn: ldap-leo
cn: ldap-leo
dn: cn=ldap-tobias,ou=users,dc=grafana,dc=org
mail: ldap-tobias@grafana.com
userPassword: grafana
objectClass: person
objectClass: top
objectClass: inetOrgPerson
objectClass: organizationalPerson
sn: ldap-tobias
cn: ldap-tobias

View File

@@ -0,0 +1,23 @@
dn: cn=admins,ou=groups,dc=grafana,dc=org
cn: admins
objectClass: groupOfNames
objectClass: top
dn: cn=editors,ou=groups,dc=grafana,dc=org
cn: editors
objectClass: groupOfNames
member: cn=ldap-editor,ou=users,dc=grafana,dc=org
dn: cn=backend,ou=groups,dc=grafana,dc=org
cn: backend
objectClass: groupOfNames
member: cn=ldap-carl,ou=users,dc=grafana,dc=org
member: cn=ldap-leo,ou=users,dc=grafana,dc=org
member: cn=ldap-torkel,ou=users,dc=grafana,dc=org
dn: cn=frontend,ou=groups,dc=grafana,dc=org
cn: frontend
objectClass: groupOfNames
member: cn=ldap-torkel,ou=users,dc=grafana,dc=org
member: cn=ldap-daniel,ou=users,dc=grafana,dc=org
member: cn=ldap-leo,ou=users,dc=grafana,dc=org

View File

@@ -0,0 +1,59 @@
# To troubleshoot and get more log info enable ldap debug logging in grafana.ini
# [log]
# filters = ldap:debug
# For the verbose comments options see "openldap" env block
# --- First LDAP Server (only admins) ---
[[servers]]
host = "127.0.0.1"
port = 389
use_ssl = false
start_tls = false
ssl_skip_verify = false
bind_dn = "cn=admin,dc=grafana,dc=org"
bind_password = 'grafana'
search_filter = "(cn=%s)"
search_base_dns = ["ou=users,dc=grafana,dc=org"]
[servers.attributes]
name = "givenName"
surname = "sn"
username = "cn"
member_of = "memberOf"
email = "email"
[[servers.group_mappings]]
group_dn = "cn=admins,ou=groups,dc=grafana,dc=org"
org_role = "Admin"
grafana_admin = true
# --- Second LDAP Server (rest of the users) ---
[[servers]]
host = "127.0.0.1"
port = 388
use_ssl = false
start_tls = false
ssl_skip_verify = false
bind_dn = "cn=admin,dc=grafana,dc=org"
bind_password = 'grafana'
search_filter = "(cn=%s)"
search_base_dns = ["ou=users,dc=grafana,dc=org"]
[servers.attributes]
name = "givenName"
surname = "sn"
username = "cn"
member_of = "memberOf"
email = "email"
[[servers.group_mappings]]
group_dn = "cn=editors,ou=groups,dc=grafana,dc=org"
org_role = "Editor"
[[servers.group_mappings]]
group_dn = "*"
org_role = "Viewer"

View File

@@ -0,0 +1,38 @@
# Notes on Multiple OpenLdap Docker Block
This is very similar to openldap docker block, but it creates multiple ldap servers instead of one.
Any ldif files added to the prepopulate subdirectory will be automatically imported into the OpenLdap database.
"admins-ldap-server" block contains admin group and admin users. The "ldap-server" block has all the rest of the users. See below for the full list of users.
This blocks are here to help with testing multiple LDAP servers, for any other LDAP related development and testing "openldap" block should be used.
## Enabling LDAP in Grafana
Copy the ldap_dev.toml file in this folder into your `conf` folder (it is gitignored already). To enable it in the .ini file to get Grafana to use this block:
```ini
[auth.ldap]
enabled = true
config_file = conf/ldap_dev.toml
; allow_sign_up = true
```
## Groups & Users
admins
ldap-admin
ldap-torkel
backend
ldap-carl
ldap-torkel
ldap-leo
frontend
ldap-torkel
ldap-tobias
ldap-daniel
editors
ldap-editor
no groups
ldap-viewer

View File

@@ -0,0 +1,14 @@
#!/bin/bash
echo "Pre-populating ldap entries, first waiting for ldap to start"
sleep 3
adminUserDn="cn=admin,dc=grafana,dc=org"
adminPassword="grafana"
for file in `ls /etc/ldap/prepopulate/*.ldif`; do
ldapadd -x -D $adminUserDn -w $adminPassword -f "$file"
done

View File

@@ -0,0 +1,4 @@
FROM nginx:alpine
COPY nginx.conf /etc/nginx/nginx.conf
COPY htpasswd /etc/nginx/htpasswd

View File

@@ -0,0 +1,11 @@
# This will proxy all requests for http://localhost:10080/grafana/ to
# http://localhost:3000 (Grafana running locally)
#
# Please note that you'll need to change the root_url in the Grafana configuration:
# root_url = %(protocol)s://%(domain)s:10080/grafana/
nginxproxy:
build: docker/blocks/nginx_proxy
ports:
- "10080:10080"

View File

@@ -0,0 +1,3 @@
user1:$apr1$1odeeQb.$kwV8D/VAAGUDU7pnHuKoV0
user2:$apr1$A2kf25r.$6S0kp3C7vIuixS5CL0XA9.
admin:$apr1$IWn4DoRR$E2ol7fS/dkI18eU4bXnBO1

View File

@@ -0,0 +1,39 @@
events { worker_connections 1024; }
http {
sendfile on;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
server {
listen 10080;
location /grafana/ {
################################################################
# Enable these settings to test with basic auth and an auth proxy header
# the htpasswd file contains an admin user with password admin and
# user1: grafana and user2: grafana
################################################################
# auth_basic "Restricted Content";
# auth_basic_user_file /etc/nginx/htpasswd;
################################################################
# To use the auth proxy header, set the following in custom.ini:
# [auth.proxy]
# enabled = true
# header_name = X-WEBAUTH-USER
# header_property = username
################################################################
# proxy_set_header X-WEBAUTH-USER $remote_user;
# this url works only on mac
proxy_pass http://host.docker.internal:3000/;
}
}
}

View File

@@ -2,7 +2,7 @@
FROM debian:jessie
LABEL maintainer="Christian Luginbühl <dinke@pimprecords.com>"
LABEL maintainer="Grafana team <hello@grafana.com>"
ENV OPENLDAP_VERSION 2.4.40
@@ -19,6 +19,8 @@ EXPOSE 389
VOLUME ["/etc/ldap", "/var/lib/ldap"]
COPY ldap.conf /etc/ldap.dist/ldap.conf
COPY modules/ /etc/ldap.dist/modules
COPY prepopulate/ /etc/ldap.dist/prepopulate

View File

@@ -1,4 +1,5 @@
openldap:
container_name: ldap
build: docker/blocks/openldap
environment:
SLAPD_PASSWORD: grafana

View File

@@ -49,10 +49,6 @@ EOF
dc_string="$dc_string,dc=$dc_part"
done
base_string="BASE ${dc_string:1}"
sed -i "s/^#BASE.*/${base_string}/g" /etc/ldap/ldap.conf
if [[ -n "$SLAPD_CONFIG_PASSWORD" ]]; then
password_hash=`slappasswd -s "${SLAPD_CONFIG_PASSWORD}"`

View File

@@ -0,0 +1,16 @@
#
# LDAP Defaults
#
# See ldap.conf(5) for details
# This file should be world readable but not world writable.
BASE dc=grafana,dc=org
#URI ldap://ldap.example.com ldap://ldap-master.example.com:666
SIZELIMIT 1000
#TIMELIMIT 15
#DEREF never
# TLS certificates (needed for GnuTLS)
TLS_CACERT /etc/ssl/certs/ca-certificates.crt

View File

@@ -28,38 +28,6 @@ search_filter = "(cn=%s)"
# An array of base dns to search through
search_base_dns = ["dc=grafana,dc=org"]
# In POSIX LDAP schemas, without memberOf attribute a secondary query must be made for groups.
# This is done by enabling group_search_filter below. You must also set member_of= "cn"
# in [servers.attributes] below.
# Users with nested/recursive group membership and an LDAP server that supports LDAP_MATCHING_RULE_IN_CHAIN
# can set group_search_filter, group_search_filter_user_attribute, group_search_base_dns and member_of
# below in such a way that the user's recursive group membership is considered.
#
# Nested Groups + Active Directory (AD) Example:
#
# AD groups store the Distinguished Names (DNs) of members, so your filter must
# recursively search your groups for the authenticating user's DN. For example:
#
# group_search_filter = "(member:1.2.840.113556.1.4.1941:=%s)"
# group_search_filter_user_attribute = "distinguishedName"
# group_search_base_dns = ["ou=groups,dc=grafana,dc=org"]
#
# [servers.attributes]
# ...
# member_of = "distinguishedName"
## Group search filter, to retrieve the groups of which the user is a member (only set if memberOf attribute is not available)
# group_search_filter = "(&(objectClass=posixGroup)(memberUid=%s))"
## Group search filter user attribute defines what user attribute gets substituted for %s in group_search_filter.
## Defaults to the value of username in [server.attributes]
## Valid options are any of your values in [servers.attributes]
## If you are using nested groups you probably want to set this and member_of in
## [servers.attributes] to "distinguishedName"
# group_search_filter_user_attribute = "distinguishedName"
## An array of the base DNs to search through for groups. Typically uses ou=groups
# group_search_base_dns = ["ou=groups,dc=grafana,dc=org"]
# Specify names of the ldap attributes your ldap uses
[servers.attributes]
name = "givenName"

View File

@@ -0,0 +1,57 @@
# To troubleshoot and get more log info enable ldap debug logging in grafana.ini
# [log]
# filters = ldap:debug
[[servers]]
# Ldap server host (specify multiple hosts space separated)
host = "127.0.0.1"
# Default port is 389 or 636 if use_ssl = true
port = 389
# Set to true if ldap server supports TLS
use_ssl = false
# Set to true if connect ldap server with STARTTLS pattern (create connection in insecure, then upgrade to secure connection with TLS)
start_tls = false
# set to true if you want to skip ssl cert validation
ssl_skip_verify = false
# set to the path to your root CA certificate or leave unset to use system defaults
# root_ca_cert = "/path/to/certificate.crt"
# Search user bind dn
bind_dn = "cn=admin,dc=grafana,dc=org"
# Search user bind password
# If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;"""
bind_password = 'grafana'
# An array of base dns to search through
search_base_dns = ["dc=grafana,dc=org"]
search_filter = "(uid=%s)"
group_search_filter = "(&(objectClass=posixGroup)(memberUid=%s))"
group_search_filter_user_attribute = "uid"
group_search_base_dns = ["ou=groups,dc=grafana,dc=org"]
[servers.attributes]
name = "givenName"
surname = "sn"
username = "cn"
member_of = "memberOf"
email = "email"
# Map ldap groups to grafana org roles
[[servers.group_mappings]]
group_dn = "cn=posix-admins,ou=groups,dc=grafana,dc=org"
org_role = "Admin"
grafana_admin = true
# The Grafana organization database id, optional, if left out the default org (id 1) will be used
# org_id = 1
[[servers.group_mappings]]
group_dn = "cn=editors,ou=groups,dc=grafana,dc=org"
org_role = "Editor"
[[servers.group_mappings]]
# If you want to match all (or no ldap groups) then you can use wildcard
group_dn = "*"
org_role = "Viewer"

View File

@@ -2,8 +2,6 @@
Any ldif files added to the prepopulate subdirectory will be automatically imported into the OpenLdap database.
The ldif files add eight users, `ldap-admin`, `ldap-editor`, `ldap-viewer`, `ldap-carl`, `ldap-daniel`, `ldap-leo`, `ldap-tobias` and `ldap-torkel`. Two groups, `admins` and `users`, are added that correspond with the group mappings in the default conf/ldap.toml. `ldap-admin` is a member of `admins` and `ldap-editor` is a member of `users`.
Note that users that are added here need to specify a `memberOf` attribute manually as well as the `member` attribute for the group. The `memberOf` module usually does this automatically (if you add a group in Apache Directory Studio for example) but this does not work in the entrypoint script as it uses the `slapadd` command to add entries before the server has started and before the `memberOf` module is loaded.
After adding ldif files to `prepopulate`:
@@ -14,7 +12,7 @@ After adding ldif files to `prepopulate`:
## Enabling LDAP in Grafana
Copy the ldap_dev.toml file in this folder into your `conf` folder (it is gitignored already). To enable it in the .ini file to get Grafana to use this block:
If you want to use users/groups with `memberOf` support Copy the ldap_dev.toml file in this folder into your `conf` folder (it is gitignored already). To enable it in the .ini file to get Grafana to use this block:
```ini
[auth.ldap]
@@ -23,12 +21,13 @@ config_file = conf/ldap_dev.toml
; allow_sign_up = true
```
Test groups & users
Otherwise perform same actions for `ldap_dev_posix.toml` config.
## Groups & Users
admins
ldap-admin
ldap-torkel
ldap-daniel
backend
ldap-carl
ldap-torkel
@@ -41,3 +40,11 @@ editors
ldap-editors
no groups
ldap-viewer
## Groups & Users (POSIX)
admins
ldap-posix-admin
no groups
ldap-posix

View File

@@ -78,3 +78,31 @@ objectClass: inetOrgPerson
objectClass: organizationalPerson
sn: ldap-torkel
cn: ldap-torkel
# admin for posix group (without support for memberOf attribute)
dn: uid=ldap-posix-admin,ou=users,dc=grafana,dc=org
mail: ldap-posix-admin@grafana.com
userPassword: grafana
objectclass: top
objectclass: posixAccount
objectclass: inetOrgPerson
homedirectory: /home/ldap-posix-admin
sn: ldap-posix-admin
cn: ldap-posix-admin
uid: ldap-posix-admin
uidnumber: 1
gidnumber: 1
# user for posix group (without support for memberOf attribute)
dn: uid=ldap-posix,ou=users,dc=grafana,dc=org
mail: ldap-posix@grafana.com
userPassword: grafana
objectclass: top
objectclass: posixAccount
objectclass: inetOrgPerson
homedirectory: /home/ldap-posix
sn: ldap-posix
cn: ldap-posix
uid: ldap-posix
uidnumber: 2
gidnumber: 2

View File

@@ -23,3 +23,21 @@ objectClass: groupOfNames
member: cn=ldap-torkel,ou=users,dc=grafana,dc=org
member: cn=ldap-daniel,ou=users,dc=grafana,dc=org
member: cn=ldap-leo,ou=users,dc=grafana,dc=org
# -- POSIX --
# posix admin group (without support for memberOf attribute)
dn: cn=posix-admins,ou=groups,dc=grafana,dc=org
cn: admins
objectClass: top
objectClass: posixGroup
gidNumber: 1
memberUid: ldap-posix-admin
# posix group (without support for memberOf attribute)
dn: cn=posix,ou=groups,dc=grafana,dc=org
cn: viewers
objectClass: top
objectClass: posixGroup
gidNumber: 2
memberUid: ldap-posix

View File

@@ -1,5 +1,5 @@
opentsdb:
image: opower/opentsdb:latest
image: petergrace/opentsdb-docker:latest
ports:
- "4242:4242"

View File

@@ -0,0 +1,4 @@
FROM nginx:alpine
COPY nginx.conf /etc/nginx/nginx.conf
COPY htpasswd /etc/nginx/htpasswd

View File

@@ -0,0 +1,6 @@
# This will proxy all requests for http://localhost:10090 to
# http://prometheus:9090 (Prometheus inside the docker compose)
nginxproxy:
build: docker/blocks/nginx_proxy
network_mode: host

View File

@@ -0,0 +1 @@
prom:$apr1$bfu32njz$HHDDTjaeWHDzQs2UMXP.C1

View File

@@ -0,0 +1,34 @@
events { }
http {
server {
listen 10090;
location / {
# Removes any Access-Control-Allow-Origin from Prometheus itself. When accessing from browser, having * or
# multiple values is not allowed in some cases
proxy_hide_header Access-Control-Allow-Origin;
# Allow the origin access. This is kinda wildcard but for browser it seems more strict and is needed for
# withCredentials requests.
add_header Access-Control-Allow-Origin $http_origin;
# When using withCredentials requests this must be true.
add_header Access-Control-Allow-Credentials true;
# Ask for basic auth except for pre flight OPTIONS request.
limit_except OPTIONS {
################################################################
# The htpasswd file contains user:
# prom: test
################################################################
auth_basic "prom";
auth_basic_user_file /etc/nginx/htpasswd;
}
proxy_pass http://prometheus:9090/;
}
}
}

View File

@@ -0,0 +1,16 @@
saml:
container_name: saml
image: kristophjunge/test-saml-idp
environment:
SIMPLESAMLPHP_SP_ENTITY_ID: http://grafana.com
SIMPLESAMLPHP_SP_ASSERTION_CONSUMER_SERVICE: http://localhost/simplesaml/module.php/saml/sp/saml2-acs.php/test-sp
SIMPLESAMLPHP_SP_SINGLE_LOGOUT_SERVICE: http://localhost/simplesaml/module.php/saml/sp/saml2-logout.php/test-sp
SIMPLESAMLPHP_ADMIN_PASSWORD: grafana
SIMPLESAMLPHP_SECRET_SALT: salt
ports:
- "8080:8080"
- "8443:8443"
volumes:
- ./docker/blocks/saml/users.php:/var/www/simplesamlphp/config/authsources.php

View File

@@ -0,0 +1,16 @@
# Notes on Saml Docker Block
Uses https://github.com/kristophjunge/docker-test-saml-idp as a docker container for saml example.
## Use
See docker container docs on how to use this service - https://github.com/kristophjunge/docker-test-saml-idp#test-the-identity-provider-idp
## Groups & Users
admins
saml-admin (saml-admin@grafana.com)
editors
saml-editor (saml-editor@grafana.com)
no groups
saml-viewer (saml-viewer@grafana.com)

View File

@@ -0,0 +1,21 @@
<?php
$config = array(
'admin' => array(
'core:AdminPassword',
),
'example-userpass' => array(
'exampleauth:UserPass',
'saml-admin:grafana' => array(
'groups' => array('admins'),
'email' => 'saml-admin@grafana.com',
),
'saml-editor:grafana' => array(
'groups' => array('editors'),
'email' => 'saml-editor@grafana.com',
),
'saml-viewer:grafana' => array(
'groups' => array(),
'email' => 'saml-viewer@grafana.com',
),
),
);

View File

@@ -0,0 +1,7 @@
FROM golang:latest
ADD main.go /
WORKDIR /
RUN go build -o main .
EXPOSE 3011
ENTRYPOINT ["/main"]

View File

@@ -0,0 +1,7 @@
slow_proxy:
build: docker/blocks/slow_proxy
network_mode: host
ports:
- "3011:3011"
environment:
ORIGIN_SERVER: "http://localhost:9090/"

View File

@@ -0,0 +1,31 @@
package main
import (
"fmt"
"log"
"net/http"
"net/http/httputil"
"net/url"
"os"
"time"
)
func main() {
origin := os.Getenv("ORIGIN_SERVER")
if origin == "" {
origin = "http://localhost:9090/"
}
sleep := time.Minute
originURL, _ := url.Parse(origin)
proxy := httputil.NewSingleHostReverseProxy(originURL)
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Printf("sleeping for %s then proxying request: %s", sleep.String(), r.RequestURI)
<-time.After(sleep)
proxy.ServeHTTP(w, r)
})
log.Fatal(http.ListenAndServe(":3011", nil))
}

View File

@@ -6,6 +6,9 @@ Runs load tests and checks using [k6](https://k6.io/).
Docker
To run the auth proxy test you'll need to setup nginx proxy from docker block and
enable auth proxy together with configuring Grafana for auth proxy.
## Run
Run load test for 15 minutes using 2 virtual users and targeting http://localhost:3000.
@@ -32,6 +35,13 @@ Run load test for 10 virtual users:
$ ./run.sh -v 10
```
Run auth proxy test:
```bash
$ ./run.sh -c auth_proxy_test
```
Example output:
```bash

View File

@@ -0,0 +1,56 @@
import { sleep, check, group } from 'k6';
import { createBasicAuthClient } from './modules/client.js';
export let options = {
noCookiesReset: true
};
let endpoint = __ENV.URL || 'http://localhost:10080/grafana';
const client = createBasicAuthClient(endpoint, 'user1', 'grafana');
client.withOrgId(1);
export const setup = () => {
const adminClient = createBasicAuthClient(endpoint, 'admin', 'admin');
let res = adminClient.datasources.getByName('gdev-prometheus');
if (res.status !== 200) {
throw new Error('Expected 200 response status when creating datasource');
}
return {
datasourceId: res.json().id,
};
}
export default (data) => {
group("auth proxy test", () => {
group("batch proxy requests", () => {
const d = new Date();
const batchCount = 300;
const requests = [];
const query = encodeURI('topk(5, max(scrape_duration_seconds) by (job))');
const start = (d.getTime() / 1000) - 3600;
const end = (d.getTime() / 1000);
const step = 20;
requests.push({ method: 'GET', url: '/api/annotations?dashboardId=8&from=1558670300607&to=1558691900607' });
for (let n = 0; n < batchCount; n++) {
requests.push({
method: 'GET',
url: `/api/datasources/proxy/${data.datasourceId}/api/v1/query_range?query=${query}&start=${start}&end=${end}&step=${step}`,
});
}
let responses = client.batch(requests);
for (let n = 0; n < batchCount; n++) {
check(responses[n], {
'response status is 200': (r) => r.status === 200,
});
}
});
});
sleep(5)
}
export const teardown = (data) => {}

View File

@@ -6,8 +6,9 @@ run() {
duration='15m'
url='http://localhost:3000'
vus='2'
testcase='auth_token_test'
while getopts ":d:u:v:" o; do
while getopts ":d:u:v:c:" o; do
case "${o}" in
d)
duration=${OPTARG}
@@ -18,11 +19,14 @@ run() {
v)
vus=${OPTARG}
;;
c)
testcase=${OPTARG}
;;
esac
done
shift $((OPTIND-1))
docker run -t --network=host -v $PWD:/src -e URL=$url --rm -i loadimpact/k6:master run --vus $vus --duration $duration src/auth_token_test.js
docker run -t --network=host -v $PWD:/src -e URL=$url --rm -i loadimpact/k6:master run --vus $vus --duration $duration src/$testcase.js
}
run "$@"

View File

@@ -4,12 +4,16 @@
DOCSPORT := 3004
DOCKER_DOCS_IMAGE := grafana/grafana-docs
SOURCES_HOST_DIR := "$(shell pwd)/sources"
# assuming grafana and grafana.org-repo to be checked out in the same folder
DEFAULT_LAYOUTS_DIR := "$(shell pwd)/../../../../../../grafana.org/layouts"
# to allow `make DOCSDIR=docs docs-shell` (to create a bind mount in docs)
LAYOUTS_MOUNT := $(if $(LAYOUTS),-v $(DEFAULT_LAYOUTS_DIR):/site/layouts)
DOCS_MOUNT := -v $(SOURCES_HOST_DIR):/site/content
DOCKER_RUN_DOCS := docker run --rm -it $(DOCS_MOUNT) -e NOCACHE -p 3004:3004 -p 3005:3005
DOCKER_RUN_DOCS := docker run --rm -it $(DOCS_MOUNT) $(LAYOUTS_MOUNT) -e NOCACHE -p 3004:3004 -p 3005:3005
VERSION := $(shell head -n 1 VERSION)
@@ -24,7 +28,7 @@ docs: docs-build
$(DOCKER_RUN_DOCS) $(DOCS_MOUNT) -e DOCKERHOST "$(DOCKER_DOCS_IMAGE)" /bin/bash -c "grunt --env=dev-docs && grunt connect --port=3004"
watch: docs-build
$(DOCKER_RUN_DOCS) $(DOCS_MOUNT) -e DOCKERHOST "$(DOCKER_DOCS_IMAGE)" /bin/bash -c "grunt --env=dev-docs && grunt connect --port=3004 & grunt watch --port=3004 --env=dev-docs"
$(DOCKER_RUN_DOCS) $(DOCS_MOUNT) $(LAYOUTS_MOUNT) -e DOCKERHOST "$(DOCKER_DOCS_IMAGE)" /bin/bash -c "grunt --env=dev-docs && grunt connect --port=3004 & grunt watch --port=3004 --env=dev-docs"
publish: checkvars docs-build
$(info Publishing ENV=${ENV} and VERSION=${VERSION})

View File

@@ -5,20 +5,20 @@ docs are built using [Hugo](http://gohugo.io/) - a static site generator.
**Prepare the Docker Image**:
Git clone `grafana/grafana.org` repo. Run these commands in the root of that repo. **Note** that you may require ``sudo``
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):
```
git clone https://github.com/grafana/grafana.org
cd grafana.org
git clone https://github.com/grafana/website
cd website
make docs-build
```
**Build the Documentation**:
Now that the docker image has been prepared we can build the
grafana docs and start a docs server.
grafana docs and start a docs server.
If you have not cloned the Grafana repository already then:
@@ -54,19 +54,19 @@ Open [localhost:3004](http://localhost:3004) to view the docs.
### Images & Content
All markdown files are located in this repo (main grafana repo). But all images are added to the https://github.com/grafana/grafana.org repo. So the process of adding images is a bit complicated.
All markdown files are located in this repo (main grafana repo). But all images are added to the https://github.com/grafana/website repo. So the process of adding images is a bit complicated.
First you need create a feature (PR) branch of https://github.com/grafana/grafana.org so you can make change. Then add the image to the `/static/img/docs` directory. Then make a commit that adds the image.
First you need create a feature (PR) branch of https://github.com/grafana/website so you can make change. Then add the image to the `/static/img/docs` directory. Then make a commit that adds the image.
Then run:
```
make docs-build
```
This will rebuild the docs docker container.
This will rebuild the docs docker container.
To be able to use the image 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.
To be able to use the image 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.
### Editing content
Changes to the markdown files should automatically cause a docs rebuild and live reload should reload the page in your browser.
Changes to the markdown files should automatically cause a docs rebuild and live reload should reload the page in your browser.

View File

@@ -3,7 +3,7 @@ title = "Grafana documentation"
description = "Guides, Installation & Feature Documentation"
keywords = ["grafana", "installation", "documentation"]
type = "docs"
aliases = ["v1.1", "guides/reference/admin", "v3.1"]
aliases = ["/v1.1", "/guides/reference/admin", "/v3.1"]
+++
# Grafana Documentation
@@ -60,9 +60,9 @@ aliases = ["v1.1", "guides/reference/admin", "v3.1"]
<h4>Provisioning</h4>
<p>A guide to help you automate your Grafana setup & configuration.</p>
</a>
<a href="{{< relref "guides/whats-new-in-v6-2.md" >}}" class="nav-cards__item nav-cards__item--guide">
<h4>What's new in v6.2</h4>
<p>Article on all the new cool features and enhancements in v6.2</p>
<a href="{{< relref "guides/whats-new-in-v6-3.md" >}}" class="nav-cards__item nav-cards__item--guide">
<h4>What's new in v6.3</h4>
<p>Article on all the new cool features and enhancements in v6.3</p>
</a>
<a href="{{< relref "tutorials/screencasts.md" >}}" class="nav-cards__item nav-cards__item--guide">
<h4>Screencasts</h4>

View File

@@ -16,7 +16,7 @@ Grafana cli is a small executable that is bundled with Grafana-server and is sup
The CLI allows you to install, upgrade and manage your plugins on the machine it is running on.
You can find more information about how to install and manage your plugins in the
[plugins page]({{< relref "plugins/installation.md" >}}).
[plugins page]({{< relref "../plugins/installation.md" >}}).
## Admin
@@ -37,7 +37,7 @@ If running the command returns this error:
then there are two flags that can be used to set homepath and the config file path.
`grafana-cli admin reset-admin-password --homepath "/usr/share/grafana" newpass`
`grafana-cli --homepath "/usr/share/grafana" admin reset-admin-password newpass`
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:

View File

@@ -149,6 +149,8 @@ Since not all datasources have the same configuration settings we only have the
| esVersion | number | Elasticsearch | Elasticsearch version as a number (2/5/56/60/70) |
| timeField | string | Elasticsearch | Which field that should be used as timestamp |
| interval | string | Elasticsearch | Index date time format. nil(No Pattern), 'Hourly', 'Daily', 'Weekly', 'Monthly' or 'Yearly' |
| logMessageField | string | Elasticsearch | Which field should be used as the log message |
| logLevelField | string | Elasticsearch | Which field should be used to indicate the priority of the log message |
| authType | string | Cloudwatch | Auth provider. keys/credentials/arn |
| assumeRoleArn | string | Cloudwatch | ARN of Assume Role |
| defaultRegion | string | Cloudwatch | AWS region |
@@ -179,6 +181,24 @@ Secure json data is a map of settings that will be encrypted with [secret key](/
| accessKey | string | Cloudwatch | Access key for connecting to Cloudwatch |
| secretKey | string | Cloudwatch | Secret key for connecting to Cloudwatch |
#### Custom HTTP headers for datasources
Datasources managed by Grafanas provisioning can be configured to add HTTP headers to all requests
going to that datasource. The header name is configured in the `jsonData` field and the header value should be
configured in `secureJsonData`.
```yaml
apiVersion: 1
datasources:
- name: Graphite
jsonData:
httpHeaderName1: "HeaderName"
httpHeaderName2: "Authorization"
secureJsonData:
httpHeaderValue1: "HeaderValue"
httpHeaderValue2: "Bearer XXXXXXXXX"
```
### Dashboards
It's possible to manage dashboards in Grafana by adding one or more yaml config files in the [`provisioning/dashboards`](/installation/configuration/#provisioning) directory. Each config file can contain a list of `dashboards providers` that will load dashboards into Grafana from the local filesystem.
@@ -189,8 +209,8 @@ The dashboard provider config file looks somewhat like this:
apiVersion: 1
providers:
# <string> provider name
- name: 'default'
# <string> an unique provider name
- name: 'a unique provider name'
# <int> org id. will default to orgId 1 if not specified
orgId: 1
# <string, required> name of the dashboard folder. Required
@@ -204,7 +224,7 @@ providers:
# <bool> enable dashboard editing
editable: true
# <int> how often Grafana will scan for changed dashboards
updateIntervalSeconds: 10
updateIntervalSeconds: 10
options:
# <string, required> path to dashboard files on disk. Required
path: /var/lib/grafana/dashboards
@@ -274,7 +294,7 @@ notifiers:
# or
org_name: Main Org.
is_default: true
send_reminders: true
send_reminder: true
frequency: 1h
disable_resolve_message: false
# See `Supported Settings` section for settings supporter for each

View File

@@ -167,26 +167,26 @@ Notifications can be sent by setting up an incoming webhook in Google Hangouts c
### All supported notifiers
Name | Type | Supports images
-----|------------ | ------
DingDing | `dingding` | yes, external only
Discord | `discord` | yes
Email | `email` | yes
Google Hangouts Chat | `googlechat` | yes, external only
Hipchat | `hipchat` | yes, external only
Kafka | `kafka` | yes, external only
Line | `line` | yes, external only
Microsoft Teams | `teams` | yes, external only
OpsGenie | `opsgenie` | yes, external only
Pagerduty | `pagerduty` | yes, external only
Prometheus Alertmanager | `prometheus-alertmanager` | yes, external only
Pushover | `pushover` | yes
Sensu | `sensu` | yes, external only
Slack | `slack` | yes
Telegram | `telegram` | yes
Threema | `threema` | yes, external only
VictorOps | `victorops` | yes, external only
Webhook | `webhook` | yes, external only
Name | Type | Supports images | Support alert rule tags
-----|------|---------------- | -----------------------
DingDing | `dingding` | yes, external only | no
Discord | `discord` | yes | no
Email | `email` | yes | no
Google Hangouts Chat | `googlechat` | yes, external only | no
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
Prometheus Alertmanager | `prometheus-alertmanager` | yes, external only | yes
Pushover | `pushover` | yes | no
Sensu | `sensu` | yes, external only | no
Slack | `slack` | yes | no
Telegram | `telegram` | yes | no
Threema | `threema` | yes, external only | no
VictorOps | `victorops` | yes, external only | no
Webhook | `webhook` | yes, external only | no
# Enable images in notifications {#external-image-store}
@@ -197,6 +197,16 @@ Be aware that some notifiers requires public access to the image to be able to i
Notification services which need public image access are marked as 'external only'.
# Use alert rule tags in notifications {#alert-rule-tags}
> Only available in Grafana v6.3+.
Grafana can include a list of tags (key/value) in the notification.
It's called alert rule tags to contrast with tags parsed from timeseries.
It currently supports only the Prometheus Alertmanager notifier.
This is an optional feature. You can get notifications without using alert rule tags.
# Configure the link back to Grafana from alert notifications
All alert notifications contain a link back to the triggered alert in the Grafana instance.

View File

@@ -34,7 +34,7 @@ ldap_sync_ttl = 60
# Example `whitelist = 192.168.1.1, 192.168.1.0/24, 2001::23, 2001::0/120`
whitelist =
# Optionally define more headers to sync other user attributes
# Example `headers = Name:X-WEBAUTH-NAME Email:X-WEBAUTH-EMAIL`
# Example `headers = Name:X-WEBAUTH-NAME Email:X-WEBAUTH-EMAIL Groups:X-WEBAUTH-GROUPS`
headers =
```

View File

@@ -12,7 +12,7 @@ weight = 3
# Enhanced LDAP Integration
> Enhanced LDAP Integration is only available in Grafana Enterprise. Read more about [Grafana Enterprise]({{< relref "enterprise/index.md" >}}).
> Enhanced LDAP Integration is only available in Grafana Enterprise. Read more about [Grafana Enterprise]({{< relref "enterprise" >}}).
The enhanced LDAP integration adds additional functionality on top of the [existing LDAP integration]({{< relref "auth/ldap.md" >}}).
@@ -41,3 +41,30 @@ a user as member of a team and it will not be removed when the user signs in. Th
5. Click on `Add group` button to save.
<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
```

View File

@@ -99,3 +99,18 @@ allow_sign_up = true
allowed_organizations = github google
```
### Team Sync (Enterprise only)
> Only available in Grafana Enterprise v6.3+
With Team Sync you can map your GitHub org teams to teams in Grafana so that your users will automatically be added to
the correct teams.
Your GitHub teams can be referenced in two ways:
- `https://github.com/orgs/<org>/teams/<team name>`
- `@<org>/<team name>`
Example: `@grafana/developers`
[Learn more about Team Sync]({{< relref "auth/enhanced_ldap.md" >}})

View File

@@ -126,8 +126,6 @@ group_search_base_dns = ["ou=groups,dc=grafana,dc=org"]
group_search_filter_user_attribute = "uid"
```
Also set `member_of = "dn"` in the `[servers.attributes]` section.
### Group Mappings
In `[[servers.group_mappings]]` you can map an LDAP group to a Grafana organization and role. These will be synced every time the user logs in, with LDAP being
@@ -215,6 +213,67 @@ email = "email"
# [[servers.group_mappings]] omitted for clarity
```
### Multiple LDAP servers
Grafana does support receiving information from multiple LDAP servers.
**LDAP specific configuration file (ldap.toml):**
```bash
# --- First LDAP Server ---
[[servers]]
host = "10.0.0.1"
port = 389
use_ssl = false
start_tls = false
ssl_skip_verify = false
bind_dn = "cn=admin,dc=grafana,dc=org"
bind_password = 'grafana'
search_filter = "(cn=%s)"
search_base_dns = ["ou=users,dc=grafana,dc=org"]
[servers.attributes]
name = "givenName"
surname = "sn"
username = "cn"
member_of = "memberOf"
email = "email"
[[servers.group_mappings]]
group_dn = "cn=admins,ou=groups,dc=grafana,dc=org"
org_role = "Admin"
grafana_admin = true
# --- Second LDAP Server ---
[[servers]]
host = "10.0.0.2"
port = 389
use_ssl = false
start_tls = false
ssl_skip_verify = false
bind_dn = "cn=admin,dc=grafana,dc=org"
bind_password = 'grafana'
search_filter = "(cn=%s)"
search_base_dns = ["ou=users,dc=grafana,dc=org"]
[servers.attributes]
name = "givenName"
surname = "sn"
username = "cn"
member_of = "memberOf"
email = "email"
[[servers.group_mappings]]
group_dn = "cn=editors,ou=groups,dc=grafana,dc=org"
org_role = "Editor"
[[servers.group_mappings]]
group_dn = "*"
org_role = "Viewer"
```
### Active Directory
[Active Directory](https://technet.microsoft.com/en-us/library/hh831484(v=ws.11).aspx) is a directory service which is commonly used in Windows environments.
@@ -247,6 +306,8 @@ email = "mail"
# [[servers.group_mappings]] omitted for clarity
```
#### Port requirements
In above example SSL is enabled and an encrypted port have been configured. If your Active Directory don't support SSL please change `enable_ssl = false` and `port = 389`.

View File

@@ -47,6 +47,13 @@ An active authenticated user that gets it token rotated will extend the `login_m
This means that a user can close its browser and come back before `now + login_maximum_inactive_lifetime_days` and still being authenticated.
This is true as long as the time since user login is less than `login_maximum_lifetime_days`.
#### Remote logout
You can logout from other devices by removing login sessions from the bottom of your profile page. If you are
a Grafana admin user you can also do the same for any user from the Server Admin / Edit User view.
## Settings
Example:
```bash
@@ -63,6 +70,9 @@ login_maximum_lifetime_days = 30
# How often should auth tokens be rotated for authenticated users when being active. The default is each 10 minutes.
token_rotation_interval_minutes = 10
# The maximum lifetime (seconds) an api key can be used. If it is set all the api keys should have limited lifetime that is lower than this value.
api_key_max_seconds_to_live = -1
```
### Anonymous authentication

178
docs/sources/auth/saml.md Normal file
View File

@@ -0,0 +1,178 @@
+++
title = "SAML Authentication"
description = "Grafana SAML Authentication"
keywords = ["grafana", "saml", "documentation", "saml-auth"]
aliases = ["/auth/saml/"]
type = "docs"
[menu.docs]
name = "SAML"
parent = "authentication"
weight = 5
+++
# SAML Authentication
> SAML Authentication integration is only available in Grafana Enterprise. Read more about [Grafana Enterprise]({{< relref "enterprise" >}}).
> 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:
```bash
[auth.saml]
enabled = true
certificate_path = "/path/to/certificate.cert"
private_key_path = "/path/to/private_key.pem"
metadata_path = "/my/metadata.xml"
max_issue_delay = 90s
metadata_valid_duration = 48h
assertion_attribute_name = displayName
assertion_attribute_login = mail
assertion_attribute_email = mail
```
And here is a comprehensive list of the options:
| Setting | Required | Description | Default |
| ----------------------------------------------------------- | -------- | -------------------------------------------------------------------------------------------------- | ------------- |
| `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
```

View File

@@ -29,6 +29,10 @@ With Grafana Enterprise you can set up synchronization between LDAP Groups and T
Datasource permissions allow you to restrict query access to only specific Teams and Users. [Learn More]({{< relref "permissions/datasource_permissions.md" >}}).
### SAML Authentication
Enables your Grafana Enterprise users to authenticate with SAML. [Learn More]({{< relref "auth/saml.md" >}}).
### Premium Plugins
With a Grafana Enterprise license you will get access to premium plugins, including:

View File

@@ -31,34 +31,37 @@ The datasource can access metrics from four different services. You can configur
- [Guide to setting up an Azure Active Directory Application for Azure Log Analytics.](https://dev.loganalytics.io/documentation/Authorization/AAD-Setup)
- [Quickstart Guide for Application Insights.](https://dev.applicationinsights.io/quickstart/)
1. Accessed from the Grafana main menu, newly installed data sources can be added immediately within the Data Sources section. Next, click the "Add data source" button in the upper right. The data source will be available for selection in the Type select box.
1. Accessed from the Grafana main menu, newly installed data sources can be added immediately within the Data Sources section. Next, click the "Add data source" button in the upper right. The Azure Monitor data source will be available for selection in the Cloud section in the list of data sources.
2. Select Azure Monitor from the Type dropdown:<br/>
![Data Source Type](https://raw.githubusercontent.com/grafana/azure-monitor-datasource/master/src/img/config_1_select_type.png)
3. In the name field, fill in a name for the data source. It can be anything. Some suggestions are Azure Monitor or App Insights.
2. In the name field, Grafana will automatically fill in a name for the data source - `Azure Monitor` or something like `Azure Monitor - 3`. If you are going to configure multiple data sources then change the name to something more informative.
4. If you are using Azure Monitor, then you need 4 pieces of information from the Azure portal (see link above for detailed instructions):
- **Tenant Id** (Azure Active Directory -> Properties -> Directory ID)
- **Subscription Id** (Subscriptions -> Choose subscription -> Overview -> Subscription ID)
- **Client Id** (Azure Active Directory -> App Registrations -> Choose your app -> Application ID)
- **Client Secret** ( Azure Active Directory -> App Registrations -> Choose your app -> Keys)
3. If you are using Azure Monitor, you need 4 pieces of information from the Azure portal (see link above for detailed instructions):
5. Paste these four items into the fields in the Azure Monitor API Details section:<br/>
![Azure Monitor API Details](https://raw.githubusercontent.com/grafana/azure-monitor-datasource/master/src/img/config_2_azure_monitor_api_details.png)
- **Tenant Id** (Azure Active Directory -> Properties -> Directory ID)
- **Client Id** (Azure Active Directory -> App Registrations -> Choose your app -> Application ID)
- **Client Secret** ( Azure Active Directory -> App Registrations -> Choose your app -> Keys)
- **Default Subscription Id** (Subscriptions -> Choose subscription -> Overview -> Subscription ID)
6. If you are also using the Azure Log Analytics service, then you need to specify these two config values (or you can reuse the Client Id and Secret from the previous step).
- Client Id (Azure Active Directory -> App Registrations -> Choose your app -> Application ID)
- Client Secret ( Azure Active Directory -> App Registrations -> Choose your app -> Keys -> Create a key -> Use client secret)
4. Paste these four items into the fields in the Azure Monitor API Details section:
{{< docs-imagebox img="/img/docs/v62/config_1_azure_monitor_details.png" class="docs-image--no-shadow" caption="Azure Monitor Configuration Details" >}}
7. If you are are using Application Insights, then you need two pieces of information from the Azure Portal (see link above for detailed instructions):
- Application ID
- API Key
- The Subscription Id can be changed per query. Save the datasource and refresh the page to see the list of subscriptions available for the specified Client Id.
8. Paste these two items into the appropriate fields in the Application Insights API Details section:<br/>
![Application Insights API Details](https://raw.githubusercontent.com/grafana/azure-monitor-datasource/master/src/img/config_3_app_insights_api_details.png)
5. If you are also using the Azure Log Analytics service, then you need to specify these two config values (or you can reuse the Client Id and Secret from the previous step).
9. Test that the configuration details are correct by clicking on the "Save & Test" button:<br/>
![Azure Monitor API Details](https://raw.githubusercontent.com/grafana/azure-monitor-datasource/master/src/img/config_4_save_and_test.png)
- Client Id (Azure Active Directory -> App Registrations -> Choose your app -> Application ID)
- Client Secret (Azure Active Directory -> App Registrations -> Choose your app -> Keys -> Create a key -> Use client secret)
6. If you are using Application Insights, then you need two pieces of information from the Azure Portal (see link above for detailed instructions):
- Application ID
- API Key
7. Paste these two items into the appropriate fields in the Application Insights API Details section:
{{< docs-imagebox img="/img/docs/v62/config_2_app_insights_api_details.png" class="docs-image--no-shadow" caption="Application Insights Configuration Details" >}}
8. Test that the configuration details are correct by clicking on the "Save & Test" button:
{{< docs-imagebox img="/img/docs/v62/config_3_save_and_test.png" class="docs-image--no-shadow" caption="Save and Test" >}}
Alternatively on step 4 if creating a new Azure Active Directory App, use the [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/?view=azure-cli-latest):
@@ -68,17 +71,25 @@ az ad sp create-for-rbac -n "http://localhost:3000"
## Choose a Service
In the query editor for a panel, after choosing your Azure Monitor datasource, the first option is to choose a service. There are three options here: Azure Monitor, Application Insights and Azure Log Analytics. The query editor will change depending on which one you pick. Azure Monitor is the default.
In the query editor for a panel, after choosing your Azure Monitor datasource, the first option is to choose a service. There are three options here:
- `Azure Monitor`
- `Application Insights`
- `Azure Log Analytics`
The query editor will change depending on which one you pick. Azure Monitor is the default.
## Querying the Azure Monitor Service
The Azure Monitor service provides metrics for all the Azure services that you have running. It helps you understand how your applications on Azure are performing and to proactively find issues affecting your applications.
If your Azure Monitor credentials give you access to multiple subscriptions then choose the appropriate subscription first.
Examples of metrics that you can get from the service are:
- Microsoft.Compute/virtualMachines - Percentage CPU
- Microsoft.Network/networkInterfaces - Bytes sent
- Microsoft.Storage/storageAccounts - Used Capacity
- `Microsoft.Compute/virtualMachines - Percentage CPU`
- `Microsoft.Network/networkInterfaces - Bytes sent`
- `Microsoft.Storage/storageAccounts - Used Capacity`
{{< docs-imagebox img="/img/docs/v60/azuremonitor-service-query-editor.png" class="docs-image--no-shadow" caption="Azure Monitor Query Editor" >}}
@@ -112,12 +123,17 @@ Note that the Azure Monitor service does not support multiple values yet. If you
The Azure Monitor Datasource Plugin provides the following queries you can specify in the `Query` field in the Variable edit view. They allow you to fill a variable's options list.
| Name | Description |
| -------------------------------------------------------- | -------------------------------------------------------------- |
| *ResourceGroups()* | Returns a list of resource groups. |
| *Namespaces(aResourceGroup)* | Returns a list of namespaces for the specified resource group. |
| *ResourceNames(aResourceGroup, aNamespace)* | Returns a list of resource names. |
| *MetricNames(aResourceGroup, aNamespace, aResourceName)* | Returns a list of metric names. |
| Name | Description |
| -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| _Subscriptions()_ | Returns a list of subscriptions. |
| _ResourceGroups()_ | Returns a list of resource groups. |
| _ResourceGroups(12345678-aaaa-bbbb-cccc-123456789aaa)_ | Returns a list of resource groups for a specified subscription. |
| _Namespaces(aResourceGroup)_ | Returns a list of namespaces for the specified resource group. |
| _Namespaces(12345678-aaaa-bbbb-cccc-123456789aaa, aResourceGroup)_ | Returns a list of namespaces for the specified resource group and subscription. |
| _ResourceNames(aResourceGroup, aNamespace)_ | Returns a list of resource names. |
| _ResourceNames(12345678-aaaa-bbbb-cccc-123456789aaaaResourceGroup, aNamespace)_ | Returns a list of resource names for a specified subscription. |
| _MetricNames(aResourceGroup, aNamespace, aResourceName)_ | Returns a list of metric names. |
| _MetricNames(12345678-aaaa-bbbb-cccc-123456789aaaaResourceGroup, aNamespace, aResourceName)_ | Returns a list of metric names for a specified subscription. |
Examples:
@@ -128,7 +144,7 @@ Examples:
{{< docs-imagebox img="/img/docs/v60/azuremonitor-service-variables.png" class="docs-image--no-shadow" caption="Nested Azure Monitor Template Variables" >}}
Checkout the [Templating]({{< relref "reference/templating.md" >}}) documentation for an introduction to the templating feature and the different
Checkout the [Templating]({{< relref "../../reference/templating.md" >}}) documentation for an introduction to the templating feature and the different
types of template variables.
### Azure Monitor Metrics Whitelist
@@ -180,13 +196,13 @@ Examples:
Use the one of the following queries in the `Query` field in the Variable edit view.
Checkout the [Templating]({{< relref "reference/templating.md" >}}) documentation for an introduction to the templating feature and the different
Checkout the [Templating]({{< relref "../../reference/templating.md" >}}) documentation for an introduction to the templating feature and the different
types of template variables.
| Name | Description |
| ---------------------------------- | ---------------------------------------------------------- |
| *AppInsightsMetricNames()* | Returns a list of metric names. |
| *AppInsightsGroupBys(aMetricName)* | Returns a list of group bys for the specified metric name. |
| _AppInsightsMetricNames()_ | Returns a list of metric names. |
| _AppInsightsGroupBys(aMetricName)_ | Returns a list of group bys for the specified metric name. |
Examples:
@@ -222,6 +238,8 @@ AzureActivity
| order by TimeGenerated desc
```
If your credentials give you access to multiple subscriptions then choose the appropriate subscription first.
{{< docs-imagebox img="/img/docs/v60/azureloganalytics-service-query-editor.png" class="docs-image--no-shadow" caption="Azure Log Analytics Query Editor" >}}
### Azure Log Analytics Macros
@@ -229,26 +247,28 @@ AzureActivity
To make writing queries easier there are several Grafana macros that can be used in the where clause of a query:
- `$__timeFilter()` - Expands to
`TimeGenerated ≥ datetime(2018-06-05T18:09:58.907Z) and`
`TimeGenerated ≤ datetime(2018-06-05T20:09:58.907Z)` where the from and to datetimes are from the Grafana time picker.
`TimeGenerated ≥ datetime(2018-06-05T18:09:58.907Z) and`
`TimeGenerated ≤ datetime(2018-06-05T20:09:58.907Z)` where the from and to datetimes are from the Grafana time picker.
- `$__timeFilter(datetimeColumn)` - Expands to
`datetimeColumn ≥ datetime(2018-06-05T18:09:58.907Z) and`
`datetimeColumn ≤ datetime(2018-06-05T20:09:58.907Z)` where the from and to datetimes are from the Grafana time picker.
`datetimeColumn ≥ datetime(2018-06-05T18:09:58.907Z) and`
`datetimeColumn ≤ datetime(2018-06-05T20:09:58.907Z)` where the from and to datetimes are from the Grafana time picker.
- `$__escapeMulti($myVar)` - is to be used with multi-value template variables that contains illegal characters. If $myVar has the value `'\\grafana-vm\Network(eth0)\Total','\\hello!'`, it expands to: `@'\\grafana-vm\Network(eth0)\Total', @'\\hello!'`. If using single value variables there no need for this macro, simply escape the variable inline instead - `@'\$myVar'`
- `$__timeFrom()` - Returns the From datetime from the Grafana picker. Example: `datetime(2018-06-05T18:09:58.907Z)`.
- `$__contains(colName, $myVar)` - is to be used with multi-value template variables. If $myVar has the value `'value1','value2'`, it expands to: `colName in ('value1','value2')`.
- `$__timeTo()` - Returns the From datetime from the Grafana picker. Example: `datetime(2018-06-05T20:09:58.907Z)`.
If using the `All` option, then check the `Include All Option` checkbox and in the `Custom all value` field type in the following value: `all`. If $myVar has value `all` then the macro will instead expand to `1 == 1`. For template variables with a lot of options, this will increase the query performance by not building a large where..in clause.
- `$__escapeMulti($myVar)` - is to be used with multi-value template variables that contain illegal characters. If `$myVar` has the following two values as a string `'\\grafana-vm\Network(eth0)\Total','\\hello!'`, then it expands to: `@'\\grafana-vm\Network(eth0)\Total', @'\\hello!'`. If using single value variables there is no need for this macro, simply escape the variable inline instead - `@'\$myVar'`.
- `$__contains(colName, $myVar)` - is to be used with multi-value template variables. If `$myVar` has the value `'value1','value2'`, it expands to: `colName in ('value1','value2')`.
If using the `All` option, then check the `Include All Option` checkbox and in the `Custom all value` field type in the following value: `all`. If `$myVar` has value `all` then the macro will instead expand to `1 == 1`. For template variables with a lot of options, this will increase the query performance by not building a large where..in clause.
### Azure Log Analytics Builtin Variables
There are also some Grafana variables that can be used in Azure Log Analytics queries:
- `$__from` - Returns the From datetime from the Grafana picker. Example: `datetime(2018-06-05T18:09:58.907Z)`.
- `$__to` - Returns the From datetime from the Grafana picker. Example: `datetime(2018-06-05T20:09:58.907Z)`.
- `$__interval` - Grafana calculates the minimum time grain that can be used to group by time in queries. More details on how it works [here]({{< relref "reference/templating.md#interval-variables" >}}). It returns a time grain like `5m` or `1h` that can be used in the bin function. E.g. `summarize count() by bin(TimeGenerated, $__interval)`
- `$__interval` - Grafana calculates the minimum time grain that can be used to group by time in queries. More details on how it works [here]({{< relref "../../reference/templating.md#interval-variables" >}}). It returns a time grain like `5m` or `1h` that can be used in the bin function. E.g. `summarize count() by bin(TimeGenerated, $__interval)`
### Azure Log Analytics Alerting

View File

@@ -130,7 +130,7 @@ Instead of hard-coding things like server, application and sensor name in you me
Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns makes it easy to change the data
being displayed in your dashboard.
Checkout the [Templating]({{< relref "reference/templating.md" >}}) documentation for an introduction to the templating feature and the different
Checkout the [Templating]({{< relref "../../reference/templating.md" >}}) documentation for an introduction to the templating feature and the different
types of template variables.
### Query variable

View File

@@ -79,6 +79,18 @@ Identifier | Description
`s` | second
`ms` | millisecond
### Logs (BETA)
> Only available in Grafana v6.3+.
There are two parameters, `Message field name` and `Level field name`, that can optionally be configured from the data source settings page that determine
which fields will be used for log messages and log levels when visualizing logs in [Explore](/features/explore).
For example, if you're using a default setup of Filebeat for shipping logs to Elasticsearch the following configuration should work:
- **Message field name:** message
- **Level field name:** fields.level
## Metric Query editor
![Elasticsearch Query Editor](/img/docs/elasticsearch/query_editor.png)
@@ -108,7 +120,7 @@ Instead of hard-coding things like server, application and sensor name in you me
Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns makes it easy to change the data
being displayed in your dashboard.
Checkout the [Templating]({{< relref "reference/templating.md" >}}) documentation for an introduction to the templating feature and the different
Checkout the [Templating]({{< relref "../../reference/templating.md" >}}) documentation for an introduction to the templating feature and the different
types of template variables.
### Query variable
@@ -118,7 +130,7 @@ The Elasticsearch data source supports two types of queries you can use in the *
Query | Description
------------ | -------------
*{"find": "fields", "type": "keyword"}* | Returns a list of field names with the index type `keyword`.
*{"find": "terms", "field": "@hostname", "size": 1000}* | Returns a list of values for a field using term aggregation. Query will user current dashboard time range as time range for query.
*{"find": "terms", "field": "@hostname", "size": 1000}* | Returns a list of values for a field using term aggregation. Query will use current dashboard time range as time range for query.
*{"find": "terms", "field": "@hostname", "query": '<lucene query>'}* | Returns a list of values for a field using term aggregation & and a specified lucene query filter. Query will use current dashboard time range as time range for query.
There is a default size limit of 500 on terms queries. Set the size property in your query to set a custom limit.
@@ -162,6 +174,28 @@ Time | The name of the time field, needs to be date field.
Text | Event description field.
Tags | Optional field name to use for event tags (can be an array or a CSV string).
## Querying Logs (BETA)
> Only available in Grafana v6.3+.
Querying and displaying log data from Elasticsearch is available via [Explore](/features/explore).
![](/img/docs/v63/elasticsearch_explore_logs.png)
Select the Elasticsearch data source, change to Logs using the Metrics/Logs switcher, and then optionally enter a lucene query into the query field to filter the log messages.
Finally, press the `Enter` key or the `Run Query` button to display your logs.
### Log Queries
Once the result is returned, the log panel shows a list of log rows and a bar chart where the x-axis shows the time and the y-axis shows the frequency/count.
Note that the fields used for log message and level is based on an [optional datasource configuration](#logs-beta).
### Filter Log Messages
Optionally enter a lucene query into the query field to filter the log messages. For example, using a default Filebeat setup you should be able to use `fields.level:error` to only show error log messages.
## Configure the Datasource with Provisioning
It's now possible to configure datasources using config files with Grafana's provisioning system. You can read more about how it works and all the settings you can set for datasources on the [provisioning docs page](/administration/provisioning/#datasources)
@@ -181,3 +215,22 @@ datasources:
interval: Daily
timeField: "@timestamp"
```
or, for logs:
```yaml
apiVersion: 1
datasources:
- name: elasticsearch-v7-filebeat
type: elasticsearch
access: proxy
database: "[filebeat-]YYYY.MM.DD"
url: http://localhost:9200
jsonData:
interval: Daily
timeField: "@timestamp"
esVersion: 70
logMessageField: message
logLevelField: fields.level
```

View File

@@ -91,7 +91,7 @@ Instead of hard-coding things like server, application and sensor name in you me
Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns makes it easy to change the data
being displayed in your dashboard.
Checkout the [Templating]({{< relref "reference/templating.md" >}}) documentation for an introduction to the templating feature and the different
Checkout the [Templating]({{< relref "../../reference/templating.md" >}}) documentation for an introduction to the templating feature and the different
types of template variables.
Graphite 1.1 introduced tags and Grafana added support for Graphite queries with tags in version 5.0. To create a variable using tag values, then you need to use the Grafana functions `tags` and `tag_values`.
@@ -140,7 +140,7 @@ Example of a tag expression with regex formatting and using the Equal Tilde oper
server=~${servers:regex}
```
Checkout the [Advanced Formatting Options section in the Variables]({{< relref "reference/templating.md#advanced-formatting-options" >}}) documentation for examples and details.
Checkout the [Advanced Formatting Options section in the Variables]({{< relref "../../reference/templating.md#advanced-formatting-options" >}}) documentation for examples and details.
## Annotations

View File

@@ -117,6 +117,26 @@ You can switch to raw query mode by clicking hamburger icon and then `Switch edi
You can remove the group by time by clicking on the `time` part and then the `x` icon. You can
change the option `Format As` to `Table` if you want to show raw data in the `Table` panel.
## Querying Logs (BETA)
> Only available in Grafana v6.3+.
Querying and displaying log data from InfluxDB is available via [Explore](/features/explore).
![](/img/docs/v63/influxdb_explore_logs.png)
Select the InfluxDB data source, change to Logs using the Metrics/Logs switcher,
and then use the `Measurements/Fields` button to display your logs.
### Log Queries
The Logs Explorer (the `Measurements/Fields` button) next to the query field shows a list of measurements and fields. Choose the desired measurement that contains your log data and then choose which field Explore should use to display the log message.
Once the result is returned, the log panel shows a list of log rows and a bar chart where the x-axis shows the time and the y-axis shows the frequency/count.
### Filter search
To add a filter click the plus icon to the right of the `Measurements/Fields` button or a condition. You can remove tag filters by clicking on the first select and choosing `--remove filter--`.
## Templating
@@ -124,7 +144,7 @@ Instead of hard-coding things like server, application and sensor name in you me
Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns makes it easy to change the data
being displayed in your dashboard.
Checkout the [Templating]({{< relref "reference/templating.md" >}}) documentation for an introduction to the templating feature and the different
Checkout the [Templating]({{< relref "../../reference/templating.md" >}}) documentation for an introduction to the templating feature and the different
types of template variables.
### Query variable

View File

@@ -92,6 +92,23 @@ Example queries:
* `{name="kafka"} tsdb-ops.*io:2003`
* `{instance=~"kafka-[23]",name="kafka"} kafka.server:type=ReplicaManager`
## Live Tailing
To view your logs live as they are added, choose `Live` from the refresh dropdown, and you should see your logs be displayed in real time.
Note that Live Tailing relies on two Websocket connections: one between the browser and the Grafana server, and another between the Grafana server and the Loki server. If you run any reverse proxies, please configure them accordingly.
> Note: This feature is only available in Grafana v6.3+
## Log Context
When using a search expression as detailed above, you now have the ability to retrieve the context surrounding your filtered results.
By clicking the `Show Context` link on the filtered rows, you'll be able to investigate the log messages that came before and after the
log message you're interested in.
> Note: This feature is only available in Grafana v6.3+
## Templating
Template variables are not yet supported by Loki.

View File

@@ -300,7 +300,7 @@ Any series lacking a value in a 3 minute window will have a value of zero which
Instead of hard-coding things like server, application and sensor name in you metric queries you can use variables in their place. Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns makes it easy to change the data being displayed in your dashboard.
Checkout the [Templating]({{< relref "reference/templating.md" >}}) documentation for an introduction to the templating feature and the different types of template variables.
Checkout the [Templating]({{< relref "../../reference/templating.md" >}}) documentation for an introduction to the templating feature and the different types of template variables.
### Query Variable
@@ -370,7 +370,7 @@ Grafana automatically creates a quoted, comma-separated string for multi-value v
`${servers:csv}`
Read more about variable formatting options in the [Variables]({{< relref "reference/templating.md#advanced-formatting-options" >}}) documentation.
Read more about variable formatting options in the [Variables]({{< relref "../../reference/templating.md#advanced-formatting-options" >}}) documentation.
## Annotations

View File

@@ -238,7 +238,7 @@ This feature is currently available in the nightly builds and will be included i
Instead of hard-coding things like server, application and sensor name in you metric queries you can use variables in their place. Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns makes it easy to change the data being displayed in your dashboard.
Checkout the [Templating]({{< relref "reference/templating.md" >}}) documentation for an introduction to the templating feature and the different types of template variables.
Checkout the [Templating]({{< relref "../../reference/templating.md" >}}) documentation for an introduction to the templating feature and the different types of template variables.
### Query Variable
@@ -316,7 +316,7 @@ Grafana automatically creates a quoted, comma-separated string for multi-value v
`${servers:csv}`
Read more about variable formatting options in the [Variables]({{< relref "reference/templating.md#advanced-formatting-options" >}}) documentation.
Read more about variable formatting options in the [Variables]({{< relref "../../reference/templating.md#advanced-formatting-options" >}}) documentation.
## Annotations

View File

@@ -53,7 +53,7 @@ Instead of hard-coding things like server, application and sensor name in you me
Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns makes it easy to change the data
being displayed in your dashboard.
Checkout the [Templating]({{< relref "reference/templating.md" >}}) documentation for an introduction to the templating feature and the different
Checkout the [Templating]({{< relref "../../reference/templating.md" >}}) documentation for an introduction to the templating feature and the different
types of template variables.
### Query variable

View File

@@ -242,7 +242,7 @@ ORDER BY time
Instead of hard-coding things like server, application and sensor name in you metric queries you can use variables in their place. Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns makes it easy to change the data being displayed in your dashboard.
Checkout the [Templating]({{< relref "reference/templating.md" >}}) documentation for an introduction to the templating feature and the different types of template variables.
Checkout the [Templating]({{< relref "../../reference/templating.md" >}}) documentation for an introduction to the templating feature and the different types of template variables.
### Query Variable
@@ -318,7 +318,7 @@ Grafana automatically creates a quoted, comma-separated string for multi-value v
`${servers:csv}`
Read more about variable formatting options in the [Variables]({{< relref "reference/templating.md#advanced-formatting-options" >}}) documentation.
Read more about variable formatting options in the [Variables]({{< relref "../../reference/templating.md#advanced-formatting-options" >}}) documentation.
## Annotations

View File

@@ -61,7 +61,7 @@ Instead of hard-coding things like server, application and sensor name in your m
Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns makes it easy to change the data
being displayed in your dashboard.
Checkout the [Templating]({{< relref "reference/templating.md" >}}) documentation for an introduction to the templating feature and the different
Checkout the [Templating]({{< relref "../../reference/templating.md" >}}) documentation for an introduction to the templating feature and the different
types of template variables.
### Query variable

View File

@@ -172,7 +172,7 @@ Instead of hard-coding things like server, application and sensor name in you me
Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns makes it easy to change the data
being displayed in your dashboard.
Checkout the [Templating]({{< relref "reference/templating.md" >}}) documentation for an introduction to the templating feature and the different
Checkout the [Templating]({{< relref "../../reference/templating.md" >}}) documentation for an introduction to the templating feature and the different
types of template variables.
### Query Variable

View File

@@ -75,23 +75,12 @@ Suggestions can appear under the query field - click on them to update your quer
Click on the filter button <span title="Filter for label" class="logs-label__icon fa fa-search-plus"></span> in a labels column in the Table panel to add filters to the query expression. This works with multiple queries too - the filter will be added for all the queries.
## Logs Integration - Loki-specific Features
## Logs Integration
For Grafana 6.0, the first log integration is for the new open source log aggregation system from Grafana Labs - [Loki](https://github.com/grafana/loki). Loki is designed to be very cost effective, as it does not index the contents of the logs, but rather a set of labels for each log stream. The logs from Loki are queried in a similar way to querying with label selectors in Prometheus. It uses labels to group log streams which can be made to match up with your Prometheus labels. Read more about Grafana Loki [here](https://github.com/grafana/loki) or the Grafana Labs hosted variant: [Grafana Cloud Logs](https://grafana.com/loki).
See the [Loki's data source documentation](../datasources/loki) on how to query for log data.
### Switching from Metrics to Logs
If you switch from a Prometheus query to a logs query (you can do a split first to have your metrics and logs side by side) then it will keep the labels from your query that exist in the logs and use those to query the log streams. For example, the following Prometheus query:
`grafana_alerting_active_alerts{job="grafana"}`
after switching to the Logs datasource, the query changes to:
`{job="grafana"}`
This will return a chunk of logs in the selected time range that can be grepped/text searched.
Along with metrics, Explore allows you to investigate your logs with the following data sources:
- [Loki](../datasources/loki)
- [InfluxDB](../datasources/influxdb)
- [Elasticsearch](../datasources/elasticsearch)
### Deduping
@@ -108,3 +97,21 @@ There are some other check boxes under the logging graph apart from the Deduping
* Timestamp: shows/hides the Timestamp column
* Local time: shows/hides the Local time column
* Labels: shows/hides the label filters column
### Loki-specific Features
As mentioned, one of the log integrations is for the new open source log aggregation system from Grafana Labs - [Loki](https://github.com/grafana/loki). Loki is designed to be very cost effective, as it does not index the contents of the logs, but rather a set of labels for each log stream. The logs from Loki are queried in a similar way to querying with label selectors in Prometheus. It uses labels to group log streams which can be made to match up with your Prometheus labels. Read more about Grafana Loki [here](https://github.com/grafana/loki) or the Grafana Labs hosted variant: [Grafana Cloud Logs](https://grafana.com/loki).
See [Loki's data source documentation](../datasources/loki) on how to query for log data.
#### Switching from Metrics to Logs
If you switch from a Prometheus query to a logs query (you can do a split first to have your metrics and logs side by side) then it will keep the labels from your query that exist in the logs and use those to query the log streams. For example, the following Prometheus query:
`grafana_alerting_active_alerts{job="grafana"}`
after switching to the Logs datasource, the query changes to:
`{job="grafana"}`
This will return a chunk of logs in the selected time range that can be grepped/text searched.

View File

@@ -33,22 +33,39 @@ The general tab allows customization of a panel's appearance and menu options.
- **Transparent** - If checked, removes the solid background of the panel (default not checked).
### Repeat
Repeat a panel for each value of a variable. Repeating panels are described in more detail [here]({{< relref "reference/templating.md#repeating-panels" >}}).
Repeat a panel for each value of a variable. Repeating panels are described in more detail [here]({{< relref "../../reference/templating.md#repeating-panels" >}}).
### Drilldown / detail link
### Data link
The drilldown section allows adding dynamic links to the panel that can link to other dashboards
or URLs.
> Only available in Grafana v6.3+.
Each link has a title, a type and params. A link can be either a ``dashboard`` or ``absolute`` links.
If it is a dashboard link, the `dashboard` value must be the name of a dashboard. If it is an
`absolute` link, the URL is the URL to the link.
Data link in graph settings allows adding dynamic links to the visualization. Those links can link to either other dashboard or to an external URL.
``params`` allows adding additional URL params to the links. The format is the ``name=value`` with
multiple params separated by ``&``. Template variables can be added as values using ``$myvar``.
{{< docs-imagebox img="/img/docs/data_link.png" max-width= "800px" >}}
When linking to another dashboard that uses template variables, you can use ``var-myvar=value`` to
populate the template variable to a desired value from the link.
Data link is defined by title, url and a setting whether or not it should be opened in a new window.
**Title** is a human readable label for the link that will be displayed in the UI. The link itself is accessible in the graph's context menu when user **clicks on a single data point**:
{{< docs-imagebox img="/img/docs/data_link_tooltip.png" max-width= "800px" >}}
**URL** field allows the URL configuration for a given link. Apart from regular query params it also supports built-in variables and dashboard variables that you can choose from
available suggestions:
{{< docs-imagebox img="/img/docs/data_link_typeahead.png" max-width= "800px" >}}
Available built-in variables are:
1. ``__all_variables`` - will add all current dashboard's variables to the URL
2. ``__url_time_range`` - will add current dashboard's time range to the URL (i.e. ``?from=now-6h&to=now``)
3. ``__series_name`` - will add series name as a query param in the URL (i.e. ``?series=B-series``)
4. ``__value_time`` - will add datapoint's timestamp (Unix ms epoch) to the URL (i.e. ``?time=1560268814105``)
#### Template variables in data links
When linking to another dashboard that uses template variables, you can use ``var-myvar=${myvar}`` syntax (where ``myvar`` is a name of template variable)
to use current dashboard's variable value.
## Metrics

Some files were not shown because too many files have changed in this diff Show More