Merge branch 'master' into metric-segment-remake

This commit is contained in:
Torkel Ödegaard
2017-06-14 16:17:13 -04:00
2322 changed files with 136596 additions and 793115 deletions

View File

@@ -3,7 +3,7 @@ root = true
[*.go]
indent_style = tab
indent_size = 2
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

View File

@@ -1,7 +1,10 @@
* **I'm submitting a ...**
- [ ] Bug report
- [ ] Feature request
- [ ] Question / Support request: **Please do not** open a github issue. [Support Options](http://grafana.org/support/)
Read before posting:
- Questions should be posted to https://community.grafana.com. Please search there and here on GitHub for similar issues before creating a new issue.
- Checkout FAQ: https://community.grafana.com/c/howto/faq
- Checkout How to troubleshoot metric query issues: https://community.grafana.com/t/how-to-troubleshoot-metric-query-issues/50
Please prefix your title with [Bug] or [Feature request].
Please include this information:
- What Grafana version are you using?
@@ -10,8 +13,6 @@ Please include this information:
- What did you do?
- What was the expected result?
- What happened instead?
**IMPORTANT** If it relates to metric data viz:
- An image or text representation of your metric query
- The raw query and response for the network request (check this in chrome dev tools network tab, here you can see metric requests and other request, please include the request body and request response)
- If related to metric query / data viz:
- Include raw network request & response: get by opening Chrome Dev Tools (F12, Ctrl+Shift+I on windows, Cmd+Opt+I on Mac), go the network tab.

View File

@@ -1,2 +1,4 @@
* Link the PR to an issue for new features
* Rebase your PR if it gets out of sync with master
* Rebase your PR if it gets out of sync with master
**REMOVE THE TEXT ABOVE BEFORE CREATING THE PULL REQUEST**

1
.gitignore vendored
View File

@@ -25,6 +25,7 @@ public/css/*.min.css
*.swp
.idea/
*.iml
*.tmp
.vscode/
/data/*

View File

@@ -1,4 +1,302 @@
# 4.0-pre (unreleased)
# 4.4.0 (unreleased)
## New Features
**Dashboard History**: View dashboard version history, compare any two versions (summary & json diffs), restore to old version. This big feature
was contributed by **Walmart Labs**. Big thanks to them for this massive contribution!
Initial feature request: [#4638](https://github.com/grafana/grafana/issues/4638)
Pull Request: [#8472](https://github.com/grafana/grafana/pull/8472)
## Enhancements
* **Elasticsearch**: Added filter aggregation label [#8420](https://github.com/grafana/grafana/pull/8420), thx [@tianzk](github.com/tianzk)
* **Sensu**: Added option for source and handler [#8405](https://github.com/grafana/grafana/pull/8405), thx [@joemiller](github.com/joemiller)
* **CSV**: Configurable csv export datetime format [#8058](https://github.com/grafana/grafana/issues/8058), thx [@cederigo](github.com/cederigo)
# 4.3.2 (2017-05-31)
## Bug fixes
* **InfluxDB**: Fixed issue with query editor not showing ALIAS BY input field when in text editor mode [#8459](https://github.com/grafana/grafana/issues/8459)
* **Graph Log Scale**: Fixed issue with log scale going below x-axis [#8244](https://github.com/grafana/grafana/issues/8244)
* **Playlist**: Fixed dashboard play order issue [#7688](https://github.com/grafana/grafana/issues/7688)
* **Elasticsearch**: Fixed table query issue with ES 2.x [#8467](https://github.com/grafana/grafana/issues/8467), thx [@goldeelox](https://github.com/goldeelox)
## Changes
* **Lazy Loading Of Panels**: Panels are no longer loaded as they are scrolled into view, this was reverted due to Chrome bug, might be reintroduced when Chrome fixes it's JS blocking behavior on scroll. [#8500](https://github.com/grafana/grafana/issues/8500)
# 4.3.1 (2017-05-23)
## Bug fixes
* **S3 image upload**: Fixed image url issue for us-east-1 (us standard) region. If you were missing slack images for alert notifications this should fix it. [#8444](https://github.com/grafana/grafana/issues/8444)
# 4.3.0-stable (2017-05-23)
## Bug fixes
* **Gzip**: Fixed crash when gzip was enabled [#8380](https://github.com/grafana/grafana/issues/8380)
* **Graphite**: Fixed issue with Toggle edit mode did in query editor [#8377](https://github.com/grafana/grafana/issues/8377)
* **Alerting**: Fixed issue with state history not showing query execution errors [#8412](https://github.com/grafana/grafana/issues/8412)
* **Alerting**: Fixed issue with missing state history events/annotations when using sqlite3 database [#7992](https://github.com/grafana/grafana/issues/7992)
* **Sqlite**: Fixed with database table locked and using sqlite3 database [#7992](https://github.com/grafana/grafana/issues/7992)
* **Alerting**: Fixed issue with annotations showing up in unsaved dashboards, new graph & alert panel. [#8361](https://github.com/grafana/grafana/issues/8361)
* **webdav**: Fixed http proxy env variable support for webdav image upload [#7922](https://github.com/grafana/grafana/issues/79222), thx [@berghauz](https://github.com/berghauz)
* **Prometheus**: Fixed issue with hiding query [#8413](https://github.com/grafana/grafana/issues/8413)
## Enhancements
* **VictorOps**: Now supports panel image & auto resolve [#8431](https://github.com/grafana/grafana/pull/8431), thx [@davidmscott](https://github.com/davidmscott)
* **Alerting**: Alert annotations now provide more info [#8421](https://github.com/grafana/grafana/pull/8421)
# 4.3.0-beta1 (2017-05-12)
## Enhancements
* **InfluxDB**: influxdb query builder support for ORDER BY and LIMIT (allows TOPN queries) [#6065](https://github.com/grafana/grafana/issues/6065) Support influxdb's SLIMIT Feature [#7232](https://github.com/grafana/grafana/issues/7232) thx [@thuck](https://github.com/thuck)
* **Panels**: Delay loading & Lazy load panels as they become visible (scrolled into view) [#5216](https://github.com/grafana/grafana/issues/5216) thx [@jifwin](https://github.com/jifwin)
* **Graph**: Support auto grid min/max when using log scale [#3090](https://github.com/grafana/grafana/issues/3090), thx [@bigbenhur](https://github.com/bigbenhur)
* **Graph**: Support for histograms [#600](https://github.com/grafana/grafana/issues/600)
* **Prometheus**: Support table response formats (column per label) [#6140](https://github.com/grafana/grafana/issues/6140), thx [@mtanda](https://github.com/mtanda)
* **Single Stat Panel**: support for non time series data [#6564](https://github.com/grafana/grafana/issues/6564)
* **Server**: Monitoring Grafana (health check endpoint) [#3302](https://github.com/grafana/grafana/issues/3302)
* **Heatmap**: Heatmap Panel [#7934](https://github.com/grafana/grafana/pull/7934)
* **Elasticsearch**: histogram aggregation [#3164](https://github.com/grafana/grafana/issues/3164)
## Minor Enhancements
* **InfluxDB**: Small fix for the "glow" when focus the field for LIMIT and SLIMIT [#7799](https://github.com/grafana/grafana/pull/7799) thx [@thuck](https://github.com/thuck)
* **Prometheus**: Make Prometheus query field a textarea [#7663](https://github.com/grafana/grafana/issues/7663), thx [@hagen1778](https://github.com/hagen1778)
* **Prometheus**: Step parameter changed semantics to min step to reduce the load on Prometheus and rendering in browser [#8073](https://github.com/grafana/grafana/pull/8073), thx [@bobrik](https://github.com/bobrik)
* **Templating**: Should not be possible to create self-referencing (recursive) template variable definitions [#7614](https://github.com/grafana/grafana/issues/7614) thx [@thuck](https://github.com/thuck)
* **Cloudwatch**: Correctly obtain IAM roles within ECS container tasks [#7892](https://github.com/grafana/grafana/issues/7892) thx [@gomlgs](https://github.com/gomlgs)
* **Units**: New number format: Scientific notation [#7781](https://github.com/grafana/grafana/issues/7781) thx [@cadnce](https://github.com/cadnce)
* **Oauth**: Add common type for oauth authorization errors [#6428](https://github.com/grafana/grafana/issues/6428) thx [@amenzhinsky](https://github.com/amenzhinsky)
* **Templating**: Data source variable now supports multi value and panel repeats [#7030](https://github.com/grafana/grafana/issues/7030) thx [@mtanda](https://github.com/mtanda)
* **Telegram**: Telegram alert is not sending metric and legend. [#8110](https://github.com/grafana/grafana/issues/8110), thx [@bashgeek](https://github.com/bashgeek)
* **Graph**: Support dashed lines [#514](https://github.com/grafana/grafana/issues/514), thx [@smalik03](https://github.com/smalik03)
* **Table**: Support to change column header text [#3551](https://github.com/grafana/grafana/issues/3551)
* **Alerting**: Better error when SMTP is not configured [#8093](https://github.com/grafana/grafana/issues/8093)
* **Pushover**: Add an option to attach graph image link in Pushover notification [#8043](https://github.com/grafana/grafana/issues/8043) thx [@devkid](https://github.com/devkid)
* **WebDAV**: Allow to set different ImageBaseUrl for WebDAV upload and image link [#7914](https://github.com/grafana/grafana/issues/7914)
* **Panels**: type-ahead mixed datasource selection [#7697](https://github.com/grafana/grafana/issues/7697) thx [@mtanda](https://github.com/mtanda)
* **Security**:User enumeration problem [#7619](https://github.com/grafana/grafana/issues/7619)
* **InfluxDB**: Register new queries available in InfluxDB - Holt Winters [#5619](https://github.com/grafana/grafana/issues/5619) thx [@rikkuness](https://github.com/rikkuness)
* **Server**: Support listening on a UNIX socket [#4030](https://github.com/grafana/grafana/issues/4030), thx [@mitjaziv](https://github.com/mitjaziv)
* **Graph**: Support log scaling for values smaller 1 [#5278](https://github.com/grafana/grafana/issues/5278)
* **InfluxDB**: Slow 'select measurement' rendering for InfluxDB [#2524](https://github.com/grafana/grafana/issues/2524), thx [@sbhenderson](https://github.com/sbhenderson)
* **Config**: Configurable signout menu activation [#7968](https://github.com/grafana/grafana/pull/7968), thx [@seuf](https://github.com/seuf)
## Fixes
* **Table Panel**: Fixed annotation display in table panel, [#8023](https://github.com/grafana/grafana/issues/8023)
* **Dashboard**: If refresh is blocked due to tab not visible, then refresh when it becomes visible [#8076](https://github.com/grafana/grafana/issues/8076) thanks [@SimenB](https://github.com/SimenB)
* **Snapshots**: Fixed problem with annotations & snapshots [#7659](https://github.com/grafana/grafana/issues/7659)
* **Graph**: MetricSegment loses type when value is an asterisk [#8277](https://github.com/grafana/grafana/issues/8277), thx [@Gordiychuk](https://github.com/Gordiychuk)
* **Alerting**: Alert notifications do not show charts when using a non public S3 bucket [#8250](https://github.com/grafana/grafana/issues/8250) thx [@rogerswingle](https://github.com/rogerswingle)
* **Graph**: 100% client CPU usage on red alert glow animation [#8222](https://github.com/grafana/grafana/issues/8222)
* **InfluxDB**: Templating: "All" query does match too much [#8165](https://github.com/grafana/grafana/issues/8165)
* **Dashboard**: Description tooltip is not fully displayed [#7970](https://github.com/grafana/grafana/issues/7970)
* **Proxy**: Redirect after switching Org does not obey sub path in root_url (using reverse proxy) [#8089](https://github.com/grafana/grafana/issues/8089)
* **Templating**: Restoration of ad-hoc variable from URL does not work correctly [#8056](https://github.com/grafana/grafana/issues/8056) thx [@tamayika](https://github.com/tamayika)
* **InfluxDB**: timeFilter cannot be used twice in alerts [#7969](https://github.com/grafana/grafana/issues/7969)
* **MySQL**: 4-byte UTF8 not supported when using MySQL database (allows Emojis) [#7958](https://github.com/grafana/grafana/issues/7958)
* **Alerting**: api/alerts and api/alert/:id hold previous data for "message" and "Message" field when field value is changed from "some string" to empty string. [#7927](https://github.com/grafana/grafana/issues/7927)
* **Graph**: Cannot add fill below to series override [#7916](https://github.com/grafana/grafana/issues/7916)
* **InfluxDB**: Influxb Datasource test passes even if the Database doesn't exist [#7864](https://github.com/grafana/grafana/issues/7864)
* **Prometheus**: Displaying Prometheus annotations is incredibly slow [#7750](https://github.com/grafana/grafana/issues/7750), thx [@mtanda](https://github.com/mtanda)
* **Graphite**: grafana generates empty find query to graphite -> 422 Unprocessable Entity [#7740](https://github.com/grafana/grafana/issues/7740)
* **Admin**: make organisation filter case insensitive [#8194](https://github.com/grafana/grafana/issues/8194), thx [@Alexander-N](https://github.com/Alexander-N)
## Changes
* **Elasticsearch**: Changed elasticsearch Terms aggregation to default to Min Doc Count to 1, and sort order to Top [#8321](https://github.com/grafana/grafana/issues/8321)
## Tech
* **Library Upgrade**: inconshreveable/log15 outdated - no support for solaris [#8262](https://github.com/grafana/grafana/issues/8262)
* **Library Upgrade**: Upgrade Macaron [#7600](https://github.com/grafana/grafana/issues/7600)
# 4.2.0 (2017-03-22)
## Minor Enhancements
* **Templates**: Prevent use of the prefix `__` for templates in web UI [#7678](https://github.com/grafana/grafana/issues/7678)
* **Threema**: Add emoji to Threema alert notifications [#7676](https://github.com/grafana/grafana/pull/7676) thx [@dbrgn](https://github.com/dbrgn)
* **Panels**: Support dm3 unit [#7695](https://github.com/grafana/grafana/issues/7695) thx [@mitjaziv](https://github.com/mitjaziv)
* **Docs**: Added some details about Sessions in Postgres [#7694](https://github.com/grafana/grafana/pull/7694) thx [@rickard-von-essen](https://github.com/rickard-von-essen)
* **Influxdb**: Allow commas in template variables [#7681](https://github.com/grafana/grafana/issues/7681) thx [@thuck](https://github.com/thuck)
* **Cloudwatch**: stop using deprecated session.New() [#7736](https://github.com/grafana/grafana/issues/7736) thx [@mtanda](https://github.com/mtanda)
* **OpenTSDB**: Pass dropcounter rate option if no max counter and no reset value or reset value as 0 is specified [#7743](https://github.com/grafana/grafana/pull/7743) thx [@r4um](https://github.com/r4um)
* **Templating**: support full resolution for $interval variable [#7696](https://github.com/grafana/grafana/pull/7696) thx [@mtanda](https://github.com/mtanda)
* **Elasticsearch**: Unique Count on string fields in ElasticSearch [#3536](https://github.com/grafana/grafana/issues/3536), thx [@pyro2927](https://github.com/pyro2927)
* **Templating**: Data source template variable that refers to other variable in regex filter [#6365](https://github.com/grafana/grafana/issues/6365) thx [@rlodge](https://github.com/rlodge)
* **Admin**: Global User List: add search and pagination [#7469](https://github.com/grafana/grafana/issues/7469)
* **User Management**: Invite UI is now disabled when login form is disabled [#7875](https://github.com/grafana/grafana/issues/7875)
## Bugfixes
* **Webhook**: Use proxy settings from environment variables [#7710](https://github.com/grafana/grafana/issues/7710)
* **Panels**: Deleting a dashboard with unsaved changes raises an error message [#7591](https://github.com/grafana/grafana/issues/7591) thx [@thuck](https://github.com/thuck)
* **Influxdb**: Query builder detects regex to easily for measurement [#7276](https://github.com/grafana/grafana/issues/7276) thx [@thuck](https://github.com/thuck)
* **Docs**: router_logging not documented [#7723](https://github.com/grafana/grafana/issues/7723)
* **Alerting**: Spelling mistake [#7739](https://github.com/grafana/grafana/pull/7739) thx [@woutersmit](https://github.com/woutersmit)
* **Alerting**: Graph legend scrolls to top when an alias is toggled/clicked [#7680](https://github.com/grafana/grafana/issues/7680) thx [@p4ddy1](https://github.com/p4ddy1)
* **Panels**: Fixed panel tooltip description after scrolling down [#7708](https://github.com/grafana/grafana/issues/7708) thx [@askomorokhov](https://github.com/askomorokhov)
# 4.2.0-beta1 (2017-02-27)
## Enhancements
* **Telegram**: Added Telegram alert notifier [#7098](https://github.com/grafana/grafana/pull/7098), thx [@leonoff](https://github.com/leonoff)
* **Templating**: Make $__interval and $__interval_ms global built in variables that can be used in by any datasource (in panel queries), closes [#7190](https://github.com/grafana/grafana/issues/7190), closes [#6582](https://github.com/grafana/grafana/issues/6582)
* **S3 Image Store**: External s3 image store (used in alert notifications) now support AWS IAM Roles, closes [#6985](https://github.com/grafana/grafana/issues/6985), [#7058](https://github.com/grafana/grafana/issues/7058) thx [@mtanda](https://github.com/mtanda)
* **SingleStat**: Implements diff aggregation method for singlestat [#7234](https://github.com/grafana/grafana/issues/7234), thx [@oliverpool](https://github.com/oliverpool)
* **Dataproxy**: Added setting to enable more verbose logging in dataproxy [#7209](https://github.com/grafana/grafana/pull/7209), thx [@Ricky-N](https://github.com/Ricky-N)
* **Alerting**: Better information about why an alert triggered [#7035](https://github.com/grafana/grafana/issues/7035)
* **LINE**: Add LINE as alerting notification channel [#7301](https://github.com/grafana/grafana/pull/7301), thx [@huydx](https://github.com/huydx)
* **LINE**: Adds image to notification message [#7417](https://github.com/grafana/grafana/pull/7417), thx [@Erliz](https://github.com/Erliz)
* **Hipchat**: Adds support for sending alert notifications to hipchat [#6451](https://github.com/grafana/grafana/issues/6451), thx [@jregovic](https://github.com/jregovic)
* **Alerting**: Uploading images for alert notifications is now optional [#7419](https://github.com/grafana/grafana/issues/7419)
* **Dashboard**: Adds shortcut for collapsing/expanding all rows [#552](https://github.com/grafana/grafana/issues/552), thx [@mtanda](https://github.com/mtanda)
* **Alerting**: Adds de duping of alert notifications [#7632](https://github.com/grafana/grafana/pull/7632)
* **Orgs**: Sharing dashboards using Grafana share feature will now redirect to correct org. [#1613](https://github.com/grafana/grafana/issues/1613)
* **Pushover**: Add Pushover alert notifications [#7526](https://github.com/grafana/grafana/pull/7526) thx [@devkid](https://github.com/devkid)
* **Threema**: Add Threema Gateway alert notification integration [#7482](https://github.com/grafana/grafana/pull/7482) thx [@dbrgn](https://github.com/dbrgn)
## Minor Enhancements
* **Optimzation**: Never issue refresh event when Grafana tab is not visible [#7218](https://github.com/grafana/grafana/issues/7218), thx [@mtanda](https://github.com/mtanda)
* **Browser History**: Browser back/forward now works time ranges / zoom, [#7259](https://github.com/grafana/grafana/issues/7259)
* **Elasticsearch**: Support for Min Doc Count options in Terms aggregation [#7324](https://github.com/grafana/grafana/pull/7324), thx [@lpic10](https://github.com/lpic10)
* **Elasticsearch**: Term aggregation limit can now be changed in template queries [#7112](https://github.com/grafana/grafana/issues/7112), thx [@FFalcon](https://github.com/FFalcon)
* **Elasticsearch**: Ad-hoc filters now support all operators [#7612](https://github.com/grafana/grafana/issues/7612), thx [@tamayika](https://github.com/tamayika)
* **Graph**: Add full series name as title for legends. [#7493](https://github.com/grafana/grafana/pull/7493), thx [@kolobaev](https://github.com/kolobaev)
* **Table**: Add a message when queries returns no data. [#6109](https://github.com/grafana/grafana/issues/6109), thx [@xginn8](https://github.com/xginn8)
* **Graph**: Set max width for series names in legend tables. [#2385](https://github.com/grafana/grafana/issues/2385), thx [@kolobaev](https://github.com/kolobaev)
* **Database**: Allow max db connection pool configuration [#7427](https://github.com/grafana/grafana/issues/7427), thx [@huydx](https://github.com/huydx)
* **Datasources** Delete datsource by name [#7476](https://github.com/grafana/grafana/issues/7476), thx [@huydx](https://github.com/huydx)
* **Dataproxy**: Only allow get that begins with api/ to access Prometheus [#7459](https://github.com/grafana/grafana/pull/7459), thx [@mtanda](https://github.com/mtanda)
* **Snapshot**: Make timeout for snapshot creation configurable [#7449](https://github.com/grafana/grafana/pull/7449) thx [@ryu1-sakai](https://github.com/ryu1-sakai)
* **Panels**: Add more physics units [#7554](https://github.com/grafana/grafana/pull/7554) thx [@ryantxu](https://github.com/ryantxu)
* **Email**: Add sender's name on email [#2131](https://github.com/grafana/grafana/issues/2131) thx [@jacobbednarz](https://github.com/jacobbednarz)
* **HTTPS**: Set tls 1.2 as lowest tls version. [#7347](https://github.com/grafana/grafana/pull/7347) thx [@roman-vynar](https://github.com/roman-vynar)
* **Table**: Added suppressing of empty results to table plugin. [#7602](https://github.com/grafana/grafana/pull/7602) thx [@LLIyRiK](https://github.com/LLIyRiK)
## Tech
* **Library Upgrade**: Upgraded angularjs from 1.5.8 to 1.6.1 [#7274](https://github.com/grafana/grafana/issues/7274)
* **Backend**: Grafana is now built using golang 1.8
## Bugfixes
* **Alerting**: Fixes missing support for no_data and execution error when testing alerts [#7149](https://github.com/grafana/grafana/issues/7149)
* **Dashboard**: Avoid duplicate data in dashboard json for panels with alerts [#7256](https://github.com/grafana/grafana/pull/7256)
* **Alertlist**: Only show scrollbar when required [#7269](https://github.com/grafana/grafana/issues/7269)
* **SMTP**: Set LocalName to hostname [#7223](https://github.com/grafana/grafana/issues/7223)
* **Sidemenu**: Disable sign out in sidemenu for AuthProxyEnabled [#7377](https://github.com/grafana/grafana/pull/7377), thx [@solugebefola](https://github.com/solugebefola)
* **Prometheus**: Add support for basic auth in Prometheus tsdb package [#6799](https://github.com/grafana/grafana/issues/6799), thx [@hagen1778](https://github.com/hagen1778)
* **OAuth**: Redirect to original page when logging in with OAuth [#7513](https://github.com/grafana/grafana/issues/7513)
* **Annotations**: Wrap text in annotations tooltip [#7542](https://github.com/grafana/grafana/pull/7542), thx [@xginn8](https://github.com/xginn8)
* **Templating**: Fixes error when using numeric sort on empty strings [#7382](https://github.com/grafana/grafana/issues/7382)
* **Templating**: Fixed issue detecting template variable dependency [#7354](https://github.com/grafana/grafana/issues/7354)
# 4.1.2 (2017-02-13)
### Bugfixes
* **Table**: Fixes broken annotation rendering mode in the table panel [#7268](https://github.com/grafana/grafana/issues/7268)
* **Data Sources**: Sorting for lists of data sources in UI is now case insensitive [#7491](https://github.com/grafana/grafana/issues/7491)
* **Admin**: Support more then 1000 users in global users list [#7469](https://github.com/grafana/grafana/issues/7469)
# 4.1.1 (2017-01-11)
### Bugfixes
* **Graph Panel**: Fixed issue with legend height in table mode [#7221](https://github.com/grafana/grafana/issues/7221)
# 4.1.0 (2017-01-11)
### Bugfixes
* **Server side PNG rendering**: Fixed issue with y-axis label rotation in phantomjs rendered images [#6924](https://github.com/grafana/grafana/issues/6924)
* **Graph**: Fixed centering of y-axis label [#7099](https://github.com/grafana/grafana/issues/7099)
* **Graph**: Fixed graph legend table mode and always visible scrollbar [#6828](https://github.com/grafana/grafana/issues/6828)
* **Templating**: Fixed template variable value groups/tags feature [#6752](https://github.com/grafana/grafana/issues/6752)
* **Webhook**: Fixed webhook username mismatch [#7195](https://github.com/grafana/grafana/pull/7195), thx [@theisenmark](https://github.com/theisenmark)
* **Influxdb**: Handles time(auto) the same way as time($interval) [#6997](https://github.com/grafana/grafana/issues/6997)
## Enhancements
* **Elasticsearch**: Added support for all moving average options [#7154](https://github.com/grafana/grafana/pull/7154), thx [@vaibhavinbayarea](https://github.com/vaibhavinbayarea)
# 4.1-beta1 (2016-12-21)
### Enhancements
* **Postgres**: Add support for Certs for Postgres database [#6655](https://github.com/grafana/grafana/issues/6655)
* **Victorops**: Add VictorOps notification integration [#6411](https://github.com/grafana/grafana/issues/6411), thx [@ichekrygin](https://github.com/ichekrygin)
* **Opsgenie**: Add OpsGenie notification integratiion [#6687](https://github.com/grafana/grafana/issues/6687), thx [@kylemcc](https://github.com/kylemcc)
* **Singlestat**: New aggregation on singlestat panel [#6740](https://github.com/grafana/grafana/pull/6740), thx [@dirk-leroux](https://github.com/dirk-leroux)
* **Cloudwatch**: Make it possible to specify access and secret key on the data source config page [#6697](https://github.com/grafana/grafana/issues/6697)
* **Table**: Added Hidden Column Style for Table Panel [#5677](https://github.com/grafana/grafana/pull/5677), thx [@bmundt](https://github.com/bmundt)
* **Graph**: Shared crosshair option renamed to shared tooltip, shows tooltip on all graphs as you hover over one graph. [#1578](https://github.com/grafana/grafana/pull/1578), [#6274](https://github.com/grafana/grafana/pull/6274)
* **Elasticsearch**: Added support for Missing option (bucket) for terms aggregation [#4244](https://github.com/grafana/grafana/pull/4244), thx [@shanielh](https://github.com/shanielh)
* **Elasticsearch**: Added support for Elasticsearch 5.x [#5740](https://github.com/grafana/grafana/issues/5740), thx [@lpic10](https://github.com/lpic10)
* **CLI**: Make it possible to reset the admin password using the grafana-cli. [#5479](https://github.com/grafana/grafana/issues/5479)
* **Influxdb**: Support multiple tags in InfluxDB annotations. [#4550](https://github.com/grafana/grafana/pull/4550), thx [@adrianlzt](https://github.com/adrianlzt)
* **LDAP**: Basic Auth now supports LDAP username and password, [#6940](https://github.com/grafana/grafana/pull/6940), thx [@utkarshcmu](https://github.com/utkarshcmu)
* **LDAP**: Now works with Auth Proxy, role and organisation mapping & sync will regularly be performed. [#6895](https://github.com/grafana/grafana/pull/6895), thx [@Seuf](https://github.com/seuf)
* **Alerting**: Adds OK as no data option. [#6866](https://github.com/grafana/grafana/issues/6866)
* **Alert list**: Order alerts based on state. [#6676](https://github.com/grafana/grafana/issues/6676)
* **Alerting**: Add api endpoint for pausing all alerts. [#6589](https://github.com/grafana/grafana/issues/6589)
* **Panel**: Added help text for panels. [#4079](https://github.com/grafana/grafana/issues/4079), thx [@utkarshcmu](https://github.com/utkarshcmu)
### Bugfixes
* **API**: HTTP API for deleting org returning incorrect message for a non-existing org [#6679](https://github.com/grafana/grafana/issues/6679)
* **Dashboard**: Posting empty dashboard result in corrupted dashboard [#5443](https://github.com/grafana/grafana/issues/5443)
* **Logging**: Fixed logging level confing issue [#6978](https://github.com/grafana/grafana/issues/6978)
* **Notifications**: Remove html escaping the email subject. [#6905](https://github.com/grafana/grafana/issues/6905)
* **Influxdb**: Fixes broken field dropdown when using template vars as measurement. [#6473](https://github.com/grafana/grafana/issues/6473)
# 4.0.2 (2016-12-08)
### Enhancements
* **Playlist**: Add support for kiosk mode [#6727](https://github.com/grafana/grafana/issues/6727)
### Bugfixes
* **Alerting**: Add alert message to webhook notifications [#6807](https://github.com/grafana/grafana/issues/6807)
* **Alerting**: Fixes a bug where avg() reducer treated null as zero. [#6879](https://github.com/grafana/grafana/issues/6879)
* **PNG Rendering**: Fix for server side rendering when using non default http addr bind and domain setting [#6813](https://github.com/grafana/grafana/issues/6813)
* **PNG Rendering**: Fix for server side rendering when setting enforce_domain to true [#6769](https://github.com/grafana/grafana/issues/6769)
* **Webhooks**: Add content type json to outgoing webhooks [#6822](https://github.com/grafana/grafana/issues/6822)
* **Keyboard shortcut**: Fixed zoom out shortcut [#6837](https://github.com/grafana/grafana/issues/6837)
* **Webdav**: Adds basic auth headers to webdav uploader [#6779](https://github.com/grafana/grafana/issues/6779)
# 4.0.1 (2016-12-02)
> **Notice**
4.0.0 had serious connection pooling issue when using a data source in proxy access. This bug caused lots of resource issues
due to too many connections/file handles on the data source backend. This problem is fixed in this release.
### Bugfixes
* **Metrics**: Fixes nil pointer dereference on my arm build [#6749](https://github.com/grafana/grafana/issues/6749)
* **Data proxy**: Fixes a tcp pooling issue in the datasource reverse proxy [#6759](https://github.com/grafana/grafana/issues/6759)
# 4.0-stable (2016-11-29)
### Bugfixes
* **Server-side rendering**: Fixed address used when rendering panel via phantomjs and using non default http_addr config [#6660](https://github.com/grafana/grafana/issues/6660)
* **Graph panel**: Fixed graph panel tooltip sort order issue [#6648](https://github.com/grafana/grafana/issues/6648)
* **Unsaved changes**: You now navigate to the intended page after saving in the unsaved changes dialog [#6675](https://github.com/grafana/grafana/issues/6675)
* **TLS Client Auth**: Support for TLS client authentication for datasource proxies [#2316](https://github.com/grafana/grafana/issues/2316)
* **Alerts out of sync**: Saving dashboards with broken alerts causes sync problem[#6576](https://github.com/grafana/grafana/issues/6576)
* **Alerting**: Saving an alert with condition "HAS NO DATA" throws an error[#6701](https://github.com/grafana/grafana/issues/6701)
* **Config**: Improve error message when parsing broken config file [#6731](https://github.com/grafana/grafana/issues/6731)
* **Table**: Render empty dates as - instead of current date [#6728](https://github.com/grafana/grafana/issues/6728)
# 4.0-beta2 (2016-11-21)
### Bugfixes
* **Graph Panel**: Log base scale on right Y-axis had no effect, max value calc was not applied, [#6534](https://github.com/grafana/grafana/issues/6534)
* **Graph Panel**: Bar width if bars was only used in series override, [#6528](https://github.com/grafana/grafana/issues/6528)
* **UI/Browser**: Fixed issue with page/view header gradient border not showing in Safari, [#6530](https://github.com/grafana/grafana/issues/6530)
* **Cloudwatch**: Fixed cloudwatch datasource requesting to many datapoints, [#6544](https://github.com/grafana/grafana/issues/6544)
* **UX**: Panel Drop zone visible after duplicating panel, and when entering fullscreen/edit view, [#6598](https://github.com/grafana/grafana/issues/6598)
* **Templating**: Newly added variable was not visible directly only after dashboard reload, [#6622](https://github.com/grafana/grafana/issues/6622)
### Enhancements
* **Singlestat**: Support repeated template variables in prefix/postfix [#6595](https://github.com/grafana/grafana/issues/6595)
* **Templating**: Don't persist variable options with refresh option [#6586](https://github.com/grafana/grafana/issues/6586)
* **Alerting**: Add ability to have OR conditions (and mixing AND & OR) [#6579](https://github.com/grafana/grafana/issues/6579)
* **InfluxDB**: Fix for Ad-Hoc Filters variable & changing dashboards [#6821](https://github.com/grafana/grafana/issues/6821)
# 4.0-beta1 (2016-11-09)
### Enhancements
* **Login**: Adds option to disable username/password logins, closes [#4674](https://github.com/grafana/grafana/issues/4674)
@@ -9,25 +307,31 @@
* **Elasticsearch**: Support to set Precision Threshold for Unique Count metric, closes [#4689](https://github.com/grafana/grafana/issues/4689)
* **Navigation**: Add search to org swithcer, closes [#2609](https://github.com/grafana/grafana/issues/2609)
* **Database**: Allow database config using one propertie, closes [#5456](https://github.com/grafana/grafana/pull/5456)
* **Graphite**: Add support for groupByNode, closes [#5613](https://github.com/grafana/grafana/pull/5613)
* **Graphite**: Add support for groupByNodes, closes [#5613](https://github.com/grafana/grafana/pull/5613)
* **Influxdb**: Add support for elapsed(), closes [#5827](https://github.com/grafana/grafana/pull/5827)
* **OpenTSDB**: Add support for explicitTags for OpenTSDB>=2.3, closes [#6360](https://github.com/grafana/grafana/pull/6361)
* **OAuth**: Add support for generic oauth, closes [#4718](https://github.com/grafana/grafana/pull/4718)
* **Cloudwatch**: Add support to expand multi select template variable, closes [#5003](https://github.com/grafana/grafana/pull/5003)
* **Graph Panel**: Now supports flexible lower/upper bounds on Y-Max and Y-Min, PR [#5720](https://github.com/grafana/grafana/pull/5720)
* **Background Tasks**: Now support automatic purging of old snapshots, closes [#4087](https://github.com/grafana/grafana/issues/4087)
* **Background Tasks**: Now support automatic purging of old rendered images, closes [#2172](https://github.com/grafana/grafana/issues/2172)
* **Dashboard**: After inactivity hide nav/row actions, fade to nice clean view, can be toggled with `d v`, also added kiosk mode, toggled via `d k` [#6476](https://github.com/grafana/grafana/issues/6476)
* **Dashboard**: Improved dashboard row menu & add panel UX [#6442](https://github.com/grafana/grafana/issues/6442)
* **Graph Panel**: Support for stacking null values [#2912](https://github.com/grafana/grafana/issues/2912), [#6287](https://github.com/grafana/grafana/issues/6287), thanks @benrubson!
### Breaking changes
* **SystemD**: Change systemd description, closes [#5971](https://github.com/grafana/grafana/pull/5971)
* **lodash upgrade**: Upgraded lodash from 2.4.2 to 4.15.0, this contains a number of breaking changes that could effect plugins. closes [#6021](https://github.com/grafana/grafana/pull/6021)
### Bugfixes
### Bug fixes
* **Table Panel**: Fixed problem when switching to Mixed datasource in metrics tab, fixes [#5999](https://github.com/grafana/grafana/pull/5999)
* **Playlist**: Fixed problem with play order not matching order defined in playlist, fixes [#5467](https://github.com/grafana/grafana/pull/5467)
* **Graph panel**: Fixed problem with auto decimals on y axis when datamin=datamax, fixes [#6070](https://github.com/grafana/grafana/pull/6070)
* **Snapshot**: Can view embedded panels/png rendered panels in snapshots without login, fixes [#3769](https://github.com/grafana/grafana/pull/3769)
* **Elasticsearch**: Fix for query template variable when looking up terms without query, no longer relies on elasticsearch default field, fixes [#3887](https://github.com/grafana/grafana/pull/3887)
* **Elasticsearch**: Fix for displaying IP address used in terms aggregations, fixes [#4393](https://github.com/grafana/grafana/pull/4393)
* **PNG Rendering**: Fix for server side rendering when using auth proxy, fixes [#5906](https://github.com/grafana/grafana/pull/5906)
* **OpenTSDB**: Fixed multi-value nested templating for opentsdb, fixes [#6455](https://github.com/grafana/grafana/pull/6455)
* **Playlist**: Remove playlist items when dashboard is removed, fixes [#6292](https://github.com/grafana/grafana/issues/6292)
# 3.1.2 (unreleased)
* **Templating**: Fixed issue when combining row & panel repeats, fixes [#5790](https://github.com/grafana/grafana/issues/5790)
@@ -595,7 +899,7 @@ Grafana 2.x is fundamentally different from 1.x; it now ships with an integrated
# 1.8.0 (2014-09-22)
Read this [blog post](http://grafana.org/blog/2014/09/11/grafana-1-8-0-rc1-released.html) for an overview of all improvements.
Read this [blog post](https://grafana.com/blog/2014/09/11/grafana-1.8.0-rc1-released) for an overview of all improvements.
**Fixes**
- [Issue #802](https://github.com/grafana/grafana/issues/802). Annotations: Fix when using InfluxDB datasource

View File

@@ -12,11 +12,15 @@ module.exports = function (grunt) {
platform: process.platform.replace('win32', 'windows'),
};
if (process.platform.match(/^win/)) {
config.arch = process.env.hasOwnProperty('ProgramFiles(x86)') ? 'x64' : 'x86';
}
if (grunt.option('arch')) {
config.arch = grunt.option('arch');
} else {
config.arch = os.arch();
config.arch = grunt.option('arch') || os.arch();
if (process.platform.match(/^win/)) {
config.arch = process.env.hasOwnProperty('ProgramFiles(x86)') ? 'x64' : 'x86';
}
}
config.phjs = grunt.option('phjsToRelease');

View File

@@ -1,4 +1,4 @@
Copyright 2014-2016 Torkel Ödegaard, Raintank Inc.
Copyright 2014-2017 Torkel Ödegaard, Raintank Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you
may not use this file except in compliance with the License. You may

View File

@@ -1,16 +1,28 @@
all: deps build
deps:
deps-go:
go run build.go setup
npm install
build:
deps-js:
yarn install --pure-lockfile --no-progress
deps: deps-js
build-go:
go run build.go build
build-js:
npm run build
test:
build: build-go build-js
test-go:
go test -v ./pkg/...
test-js:
npm test
test: test-go test-js
run:
./bin/grafana-server

View File

@@ -1,30 +1,25 @@
[Grafana](http://grafana.org) [![Circle CI](https://circleci.com/gh/grafana/grafana.svg?style=svg)](https://circleci.com/gh/grafana/grafana) [![Coverage Status](https://coveralls.io/repos/grafana/grafana/badge.png)](https://coveralls.io/r/grafana/grafana)
[Grafana](https://grafana.com) [![Circle CI](https://circleci.com/gh/grafana/grafana.svg?style=svg)](https://circleci.com/gh/grafana/grafana)
================
[Website](http://grafana.org) |
[Website](https://grafana.com) |
[Twitter](https://twitter.com/grafana) |
[IRC](https://webchat.freenode.net/?channels=grafana) |
[![Slack](https://brandfolder.com/api/favicon/icon?size=16&domain=www.slack.com)](http://slack.raintank.io)
[Slack](http://slack.raintank.io) |
[Email](mailto:contact@grafana.org)
[Community & Forum](https://community.grafana.com)
Grafana is an open source, feature rich metrics dashboard and graph editor for
Graphite, Elasticsearch, OpenTSDB, Prometheus and InfluxDB.
![](http://grafana.org/assets/img/start_page_bg.png)
![](http://docs.grafana.org/assets/img/features/dashboard_ex1.png)
- [Install instructions](http://docs.grafana.org/installation/)
- [What's New in Grafana 2.0](http://docs.grafana.org/guides/whats-new-in-v2/)
- [What's New in Grafana 2.1](http://docs.grafana.org/guides/whats-new-in-v2-1/)
- [What's New in Grafana 2.5](http://docs.grafana.org/guides/whats-new-in-v2-5/)
- [What's New in Grafana 3.0](http://docs.grafana.org/guides/whats-new-in-v3/)
- [What's New in Grafana 4.0](http://docs.grafana.org/guides/whats-new-in-v4/)
- [What's New in Grafana 4.1](http://docs.grafana.org/guides/whats-new-in-v4-1/)
- [What's New in Grafana 4.2](http://docs.grafana.org/guides/whats-new-in-v4-2/)
- [What's New in Grafana 4.3](http://docs.grafana.org/guides/whats-new-in-v4-3/)
## Features
### Graphite Target Editor
- Graphite target expression parser
- Feature rich query composer
- Quickly add and edit functions & parameters
- Templated queries
- [See it in action](http://docs.grafana.org/datasources/graphite/)
### Graphing
- Fast rendering, even over large timespans
@@ -48,23 +43,30 @@ Graphite, Elasticsearch, OpenTSDB, Prometheus and InfluxDB.
- [Time range controls](http://docs.grafana.org/reference/timerange/)
- [Share snapshots publicly](http://docs.grafana.org/v2.0/reference/sharing/)
### Elasticsearch
- Feature rich query editor UI
### InfluxDB
- Use InfluxDB as a metric data source, annotation source
- Query editor with series and column typeahead, easy group by and function selection
- Query editor with field and tag typeahead, easy group by and function selection
### OpenTSDB
- Use as metric data source
- Query editor with metric name typeahead and tag filtering
### Graphite
- Graphite target expression parser
- Feature rich query composer
- Quickly add and edit functions & parameters
- Templated queries
- [See it in action](http://docs.grafana.org/datasources/graphite/)
### Elasticsearch, Prometheus & OpenTSDB
- Feature rich query editor UI
### Alerting
- Define alert rules using graphs & query conditions
- Schedule & evalute alert rules, send notifications to Slack, Hipchat, Email, PagerDuty, etc.
## Requirements
There are no dependencies except an external time series data store. For dashboards and user accounts Grafana can use an embedded
database (sqlite3) or you can use an external SQL data base like MySQL or Postgres.
## Installation
Head to [grafana.org](http://docs.grafana.org/installation/) and [download](http://grafana.org/download/)
Head to [grafana.org](http://docs.grafana.org/installation/) and [download](https://grafana.com/get)
the latest release.
If you have any problems please read the [troubleshooting guide](http://docs.grafana.org/installation/troubleshooting/).
@@ -74,12 +76,12 @@ Be sure to read the [getting started guide](http://docs.grafana.org/guides/getti
## 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](http://grafana.org/download/builds)
the latest master builds [here](https://grafana.com/grafana/download)
### Dependencies
- Go 1.7
- NodeJS v4+
- Go 1.8.1
- NodeJS LTS
### Get Code
@@ -87,11 +89,11 @@ the latest master builds [here](http://grafana.org/download/builds)
go get github.com/grafana/grafana
```
Since imports of dependencies use the absolute path github.com/grafana/grafana within the $GOPATH,
you will need to put your version of the code in $GOPATH/src/github.com/grafana/grafana to be able
Since imports of dependencies use the absolute path `github.com/grafana/grafana` within the `$GOPATH`,
you will need to put your version of the code in `$GOPATH/src/github.com/grafana/grafana` to be able
to develop and build grafana on a cloned repository. To do so, you can clone your forked repository
directly to $GOPATH/src/github.com/grafana or you can create a symbolic link from your version
of the code to $GOPATH/src/github.com/grafana/grafana. The last options makes it possible to change
directly to `$GOPATH/src/github.com/grafana` or you can create a symbolic link from your version
of the code to `$GOPATH/src/github.com/grafana/grafana`. The last options makes it possible to change
easily the grafana repository you want to build.
```bash
go get github.com/*your_account*/grafana
@@ -108,11 +110,12 @@ go run build.go build
### Building frontend assets
To build less to css for the frontend you will need a recent version of of **node (v4+)**,
To build less to css for the frontend you will need a recent version of **node (v6+)**,
npm (v2.5.0) and grunt (v0.4.5). Run the following:
```bash
npm install
npm install -g yarn
yarn install --pure-lockfile
npm run build
```
@@ -135,7 +138,7 @@ bra run
./bin/grafana-server
```
Open grafana in your browser (default http://localhost:3000) and login with admin user (default user/pass = admin/admin).
Open grafana in your browser (default: `http://localhost:3000`) and login with admin user (default: `user/pass = admin/admin`).
### Dev config
@@ -143,21 +146,16 @@ Create a custom.ini in the conf directory to override default configuration opti
You only need to add the options you want to override. Config files are applied in the order of:
1. grafana.ini
2. dev.ini (if found)
3. custom.ini
1. custom.ini
## Create a pull request
Before or after you create a pull request, sign the [contributor license agreement](http://grafana.org/docs/contributing/cla.html).
Before or after you create a pull request, sign the [contributor license agreement](http://docs.grafana.org/project/cla/).
## Contribute
If you have any idea for an improvement or found a bug do not hesitate to open an issue.
And if you have time clone this repo and submit a pull request and help me make Grafana
the kickass metrics & devops dashboard we all dream about!
Before creating a pull request be sure that "grunt test" runs without any style or unit test errors, also
please [sign the CLA](http://docs.grafana.org/project/cla/)
## License
Grafana is distributed under Apache 2.0 License.
Work in progress Grafana 2.0 (with included Grafana backend)

31
ROADMAP.md Normal file
View File

@@ -0,0 +1,31 @@
# Roadmap (2017-04-23)
This roadmap is a tentative plan for the core development team. Things change constantly as PRs come in and priorities change.
But it will give you an idea of our current vision and plan.
### Short term (1-4 months)
- New Heatmap Panel (Implemented and available in master)
- Support for MySQL & Postgres as data sources (Work started and a alpha version for MySQL is available in master)
- User Groups & Dashboard folders with ACLs (work started, not yet completed, https://github.com/grafana/grafana/issues/1611#issuecomment-287742633)
- Improve new user UX
- Improve docs
- Support for alerting for Elasticsearch (can be tested in [branch](https://github.com/grafana/grafana/tree/alerting-elasticsearch) but needs more work)
- Graph annotations (create from grafana, region annotations, better annotation viz)
- Improve alerting (clustering, silence rules)
### Long term
- Improved dashboard panel layout engine (to make it easier and enable more flexible layouts)
- Backend plugins to support more Auth options, Alerting data sources & notifications
- Universial time series transformations for any data source (meta queries)
- Reporting
- Web socket & live data streams
- Migrate to Angular2
### Outside contributions
We know this is being worked on right now by contributors (and we hope to merge it when it's ready).
- Dashboard revisions (be able to revert dashboard changes)
- Clustering for alert engine (load distribution)

View File

@@ -5,14 +5,19 @@ os: Windows Server 2012 R2
clone_folder: c:\gopath\src\github.com\grafana\grafana
environment:
nodejs_version: "5"
nodejs_version: "6"
GOPATH: c:\gopath
GOVERSION: 1.8
install:
- rmdir c:\go /s /q
# install nodejs and npm
- ps: Install-Product node $env:nodejs_version
- npm install
- npm install -g yarn --silent
- yarn install --pure-lockfile --no-progress
- npm install -g grunt-cli
- appveyor DownloadFile https://storage.googleapis.com/golang/go%GOVERSION%.windows-amd64.zip
- 7z x go%GOVERSION%.windows-amd64.zip -y -oC:\ > NUL
# install gcc (needed for sqlite3)
- choco install -y --limit-output mingw
- set PATH=C:\tools\mingw64\bin;%PATH%
@@ -20,12 +25,28 @@ install:
- echo %GOPATH%
- go version
- go env
- go run build.go setup
# - go run build.go setup
build_script:
- go run build.go build
- grunt release
- go run build.go sha-dist
- cp dist/* .
artifacts:
- path: dist/*
- path: grafana-*windows-*.*
name: binzip
type: zip
deploy:
- provider: Environment
name: GrafanaReleaseMaster
on:
buildType: master
- provider: Environment
name: GrafanaReleaseRelease
on:
buildType: release

View File

@@ -15,11 +15,12 @@
"dependencies": {
"jquery": "3.1.0",
"lodash": "4.15.0",
"angular": "1.5.8",
"angular-route": "1.5.8",
"angular-mocks": "1.5.8",
"angular-sanitize": "1.5.8",
"angular": "1.6.1",
"angular-route": "1.6.1",
"angular-mocks": "1.6.1",
"angular-sanitize": "1.6.1",
"angular-native-dragdrop": "1.2.2",
"angular-bindonce": "0.3.3"
"angular-bindonce": "0.3.3",
"clipboard": "^1.5.16"
}
}

114
build.go
View File

@@ -5,7 +5,7 @@ package main
import (
"bytes"
"crypto/md5"
"crypto/sha1"
"crypto/sha256"
"encoding/json"
"flag"
"fmt"
@@ -14,6 +14,7 @@ import (
"log"
"os"
"os/exec"
"path"
"path/filepath"
"regexp"
"runtime"
@@ -37,19 +38,18 @@ var (
race bool
phjsToRelease string
workingDir string
includeBuildNumber bool = true
buildNumber int = 0
binaries []string = []string{"grafana-server", "grafana-cli"}
)
const minGoVersion = 1.7
const minGoVersion = 1.8
func main() {
log.SetOutput(os.Stdout)
log.SetFlags(0)
ensureGoPath()
readVersionFromPackageJson()
log.Printf("Version: %s, Linux Version: %s, Package Iteration: %s\n", version, linuxPackageVersion, linuxPackageIteration)
flag.StringVar(&goarch, "goarch", runtime.GOARCH, "GOARCH")
flag.StringVar(&goos, "goos", runtime.GOOS, "GOOS")
@@ -59,8 +59,14 @@ func main() {
flag.StringVar(&pkgArch, "pkg-arch", "", "PKG ARCH")
flag.StringVar(&phjsToRelease, "phjs", "", "PhantomJS binary")
flag.BoolVar(&race, "race", race, "Use race detector")
flag.BoolVar(&includeBuildNumber, "includeBuildNumber", includeBuildNumber, "IncludeBuildNumber in package name")
flag.IntVar(&buildNumber, "buildNumber", 0, "Build number from CI system")
flag.Parse()
readVersionFromPackageJson()
log.Printf("Version: %s, Linux Version: %s, Package Iteration: %s\n", version, linuxPackageVersion, linuxPackageIteration)
if flag.NArg() == 0 {
log.Println("Usage: go run build.go build")
return
@@ -73,6 +79,10 @@ func main() {
case "setup":
setup()
case "build-cli":
clean()
build("grafana-cli", "./pkg/cmd/grafana-cli", []string{})
case "build":
clean()
for _, binary := range binaries {
@@ -86,21 +96,20 @@ func main() {
case "package":
grunt(gruntBuildArg("release")...)
createLinuxPackages()
sha1FilesInDist()
case "pkg-rpm":
grunt(gruntBuildArg("release")...)
createRpmPackages()
sha1FilesInDist()
case "pkg-deb":
grunt(gruntBuildArg("release")...)
createDebPackages()
sha1FilesInDist()
case "sha-dist":
shaFilesInDist()
case "latest":
makeLatestDistCopies()
sha1FilesInDist()
case "clean":
clean()
@@ -112,14 +121,24 @@ func main() {
}
func makeLatestDistCopies() {
rpmIteration := "-1"
if linuxPackageIteration != "" {
rpmIteration = linuxPackageIteration
files, err := ioutil.ReadDir("dist")
if err != nil {
log.Fatalf("failed to create latest copies. Cannot read from /dist")
}
runError("cp", fmt.Sprintf("dist/grafana_%v-%v_amd64.deb", linuxPackageVersion, linuxPackageIteration), "dist/grafana_latest_amd64.deb")
runError("cp", fmt.Sprintf("dist/grafana-%v-%v.x86_64.rpm", linuxPackageVersion, rpmIteration), "dist/grafana-latest-1.x86_64.rpm")
runError("cp", fmt.Sprintf("dist/grafana-%v-%v.linux-x64.tar.gz", linuxPackageVersion, linuxPackageIteration), "dist/grafana-latest.linux-x64.tar.gz")
latestMapping := map[string]string{
".deb": "dist/grafana_latest_amd64.deb",
".rpm": "dist/grafana-latest-1.x86_64.rpm",
".tar.gz": "dist/grafana-latest.linux-x64.tar.gz",
}
for _, file := range files {
for extension, fullName := range latestMapping {
if strings.HasSuffix(file.Name(), extension) {
runError("cp", path.Join("dist", file.Name()), fullName)
}
}
}
}
func readVersionFromPackageJson() {
@@ -150,7 +169,13 @@ func readVersionFromPackageJson() {
}
// add timestamp to iteration
linuxPackageIteration = fmt.Sprintf("%d%s", time.Now().Unix(), linuxPackageIteration)
if includeBuildNumber {
if buildNumber != 0 {
linuxPackageIteration = fmt.Sprintf("%d%s", buildNumber, linuxPackageIteration)
} else {
linuxPackageIteration = fmt.Sprintf("%d%s", time.Now().Unix(), linuxPackageIteration)
}
}
}
type linuxPackageOptions struct {
@@ -160,7 +185,6 @@ type linuxPackageOptions struct {
serverBinPath string
cliBinPath string
configDir string
configFilePath string
ldapFilePath string
etcDefaultPath string
etcDefaultFilePath string
@@ -181,8 +205,6 @@ func createDebPackages() {
homeDir: "/usr/share/grafana",
binPath: "/usr/sbin",
configDir: "/etc/grafana",
configFilePath: "/etc/grafana/grafana.ini",
ldapFilePath: "/etc/grafana/ldap.toml",
etcDefaultPath: "/etc/default",
etcDefaultFilePath: "/etc/default/grafana-server",
initdScriptFilePath: "/etc/init.d/grafana-server",
@@ -203,8 +225,6 @@ func createRpmPackages() {
homeDir: "/usr/share/grafana",
binPath: "/usr/sbin",
configDir: "/etc/grafana",
configFilePath: "/etc/grafana/grafana.ini",
ldapFilePath: "/etc/grafana/ldap.toml",
etcDefaultPath: "/etc/sysconfig",
etcDefaultFilePath: "/etc/sysconfig/grafana-server",
initdScriptFilePath: "/etc/init.d/grafana-server",
@@ -215,7 +235,7 @@ func createRpmPackages() {
defaultFileSrc: "packaging/rpm/sysconfig/grafana-server",
systemdFileSrc: "packaging/rpm/systemd/grafana-server.service",
depends: []string{"initscripts", "fontconfig"},
depends: []string{"/sbin/service", "fontconfig", "freetype", "urw-fonts"},
})
}
@@ -249,21 +269,15 @@ func createPackage(options linuxPackageOptions) {
runPrint("cp", "-a", filepath.Join(workingDir, "tmp")+"/.", filepath.Join(packageRoot, options.homeDir))
// remove bin path
runPrint("rm", "-rf", filepath.Join(packageRoot, options.homeDir, "bin"))
// copy sample ini file to /etc/grafana
runPrint("cp", "conf/sample.ini", filepath.Join(packageRoot, options.configFilePath))
// copy sample ldap toml config file to /etc/grafana/ldap.toml
runPrint("cp", "conf/ldap.toml", filepath.Join(packageRoot, options.ldapFilePath))
args := []string{
"-s", "dir",
"--description", "Grafana",
"-C", packageRoot,
"--vendor", "Grafana",
"--url", "http://grafana.org",
"--url", "https://grafana.com",
"--license", "\"Apache 2.0\"",
"--maintainer", "contact@grafana.org",
"--config-files", options.configFilePath,
"--config-files", options.ldapFilePath,
"--maintainer", "contact@grafana.com",
"--config-files", options.initdScriptFilePath,
"--config-files", options.etcDefaultFilePath,
"--config-files", options.systemdServiceFilePath,
@@ -273,6 +287,14 @@ func createPackage(options linuxPackageOptions) {
"-p", "./dist",
}
if options.packageType == "rpm" {
args = append(args, "--rpm-posttrans", "packaging/rpm/control/posttrans")
}
if options.packageType == "deb" {
args = append(args, "--deb-no-default-config-files")
}
if pkgArch != "" {
args = append(args, "-a", pkgArch)
}
@@ -327,7 +349,12 @@ func grunt(params ...string) {
}
func gruntBuildArg(task string) []string {
args := []string{task, fmt.Sprintf("--pkgVer=%v-%v", linuxPackageVersion, linuxPackageIteration)}
args := []string{task}
if includeBuildNumber {
args = append(args, fmt.Sprintf("--pkgVer=%v-%v", linuxPackageVersion, linuxPackageIteration))
} else {
args = append(args, fmt.Sprintf("--pkgVer=%v", version))
}
if pkgArch != "" {
args = append(args, fmt.Sprintf("--arch=%v", pkgArch))
}
@@ -422,14 +449,10 @@ func setBuildEnv() {
}
func getGitSha() string {
v, err := runError("git", "describe", "--always", "--dirty")
v, err := runError("git", "rev-parse", "--short", "HEAD")
if err != nil {
return "unknown-dev"
}
v = versionRe.ReplaceAllFunc(v, func(s []byte) []byte {
s[0] = '+'
return s
})
return string(v)
}
@@ -507,29 +530,36 @@ func md5File(file string) error {
return out.Close()
}
func sha1FilesInDist() {
func shaFilesInDist() {
filepath.Walk("./dist", func(path string, f os.FileInfo, err error) error {
if strings.Contains(path, ".sha1") == false {
sha1File(path)
if path == "./dist" {
return nil
}
if strings.Contains(path, ".sha256") == false {
err := shaFile(path)
if err != nil {
log.Printf("Failed to create sha file. error: %v\n", err)
}
}
return nil
})
}
func sha1File(file string) error {
func shaFile(file string) error {
fd, err := os.Open(file)
if err != nil {
return err
}
defer fd.Close()
h := sha1.New()
h := sha256.New()
_, err = io.Copy(h, fd)
if err != nil {
return err
}
out, err := os.Create(file + ".sha1")
out, err := os.Create(file + ".sha256")
if err != nil {
return err
}

View File

@@ -1,30 +1,57 @@
machine:
node:
version: 5.11.1
version: 6.9.2
python:
version: 2.7.3
services:
- docker
environment:
GOPATH: "/home/ubuntu/.go_workspace"
ORG_PATH: "github.com/grafana"
REPO_PATH: "${ORG_PATH}/grafana"
GODIST: "go1.7.1.linux-amd64.tar.gz"
GODIST: "go1.8.linux-amd64.tar.gz"
post:
- mkdir -p download
- mkdir -p ~/download
- mkdir -p ~/docker
- test -e download/$GODIST || curl -o download/$GODIST https://storage.googleapis.com/golang/$GODIST
- sudo rm -rf /usr/local/go
- sudo tar -C /usr/local -xzf download/$GODIST
dependencies:
cache_directories:
- "~/docker"
- "~/download"
override:
- rm -rf ${GOPATH}/src/${REPO_PATH}
- mkdir -p ${GOPATH}/src/${ORG_PATH}
- cp -r ~/grafana ${GOPATH}/src/${ORG_PATH}
pre:
- pip install awscli
- sudo apt-get update; sudo apt-get install rpm; sudo apt-get install expect
- ./scripts/build/build_container.sh
test:
override:
- bash scripts/circle-test.sh
- bash scripts/circle-test.sh
deployment:
master:
gh_branch:
branch: master
owner: grafana
commands:
- ./scripts/trigger_grafana_packer.sh ${TRIGGER_GRAFANA_PACKER_CIRCLECI_TOKEN}
- ./scripts/build/deploy.sh
- ./scripts/build/sign_packages.sh
- go run build.go sha-dist
- aws s3 sync ./dist s3://$BUCKET_NAME/master
- ./scripts/trigger_windows_build.sh ${APPVEYOR_TOKEN} ${CIRCLE_SHA1} master
- ./scripts/trigger_docker_build.sh ${TRIGGER_GRAFANA_PACKER_CIRCLECI_TOKEN}
- go run ./scripts/build/publish.go -apiKey ${GRAFANA_COM_API_KEY}
gh_tag:
tag: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
commands:
- ./scripts/build/deploy.sh
- ./scripts/build/sign_packages.sh
- go run build.go sha-dist
- aws s3 sync ./dist s3://$BUCKET_NAME/release
- ./scripts/trigger_windows_build.sh ${APPVEYOR_TOKEN} ${CIRCLE_SHA1} release
- ./scripts/trigger_docker_build.sh ${TRIGGER_GRAFANA_PACKER_CIRCLECI_TOKEN} ${CIRCLE_TAG}

View File

@@ -25,7 +25,7 @@ plugins = data/plugins
#################################### Server ##############################
[server]
# Protocol (http or https)
# Protocol (http, https, socket)
protocol = http
# The ip address to bind to, empty will bind to all interfaces
@@ -57,21 +57,29 @@ enable_gzip = false
cert_file =
cert_key =
# Unix socket path
socket = /tmp/grafana.sock
#################################### Database ############################
[database]
# You can configure the database connection by specifying type, host, name, user and password
# as seperate properties or as on string using the url propertie.
# as separate properties or as on string using the url property.
# Either "mysql", "postgres" or "sqlite3", it's your choice
type = sqlite3
host = 127.0.0.1:3306
name = grafana
user = root
# If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;"""
password =
# Use either URL or the previous fields to configure the database
# Example: mysql://user:secret@host:port/database
url =
# Max conn setting default is 0 (mean not set)
max_idle_conn =
max_open_conn =
# For "postgres", use either "disable", "require" or "verify-full"
# For "mysql", use either "true", "false", or "skip-verify".
ssl_mode = disable
@@ -112,6 +120,12 @@ cookie_secure = false
session_life_time = 86400
gc_interval_time = 86400
#################################### Data proxy ###########################
[dataproxy]
# This enables data proxy logging, default is false
logging = false
#################################### Analytics ###########################
[analytics]
# Server reporting, sends usage counters to stats.grafana.org every 24 hours.
@@ -120,11 +134,11 @@ gc_interval_time = 86400
# Change this option to false to disable reporting.
reporting_enabled = true
# Set to false to disable all checks to https://grafana.net
# for new vesions (grafana itself and plugins), check is used
# Set to false to disable all checks to https://grafana.com
# for new versions (grafana itself and plugins), check is used
# in some UI views to notify that grafana or plugin update exists
# This option does not cause any auto updates, nor send any information
# only a GET request to http://grafana.net to get latest versions
# only a GET request to https://grafana.com to get latest versions
check_for_updates = true
# Google Analytics universal tracking code, only enabled if you specify an id here
@@ -194,6 +208,9 @@ default_theme = dark
# Set to true to disable (hide) the login form, useful if you use OAuth
disable_login_form = false
# Set to true to disable the signout link in the side menu. useful if you use auth.proxy
disable_signout_menu = false
#################################### Anonymous Auth ######################
[auth.anonymous]
# enable anonymous access
@@ -208,7 +225,7 @@ org_role = Viewer
#################################### Github Auth #########################
[auth.github]
enabled = false
allow_sign_up = false
allow_sign_up = true
client_id = some_id
client_secret = some_secret
scopes = user:email
@@ -221,7 +238,7 @@ allowed_organizations =
#################################### Google Auth #########################
[auth.google]
enabled = false
allow_sign_up = false
allow_sign_up = true
client_id = some_client_id
client_secret = some_client_secret
scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
@@ -229,11 +246,21 @@ auth_url = https://accounts.google.com/o/oauth2/auth
token_url = https://accounts.google.com/o/oauth2/token
api_url = https://www.googleapis.com/oauth2/v1/userinfo
allowed_domains =
hosted_domain =
#################################### Grafana.net Auth ####################
#################################### Grafana.com Auth ####################
# legacy key names (so they work in env variables)
[auth.grafananet]
enabled = false
allow_sign_up = false
allow_sign_up = true
client_id = some_id
client_secret = some_secret
scopes = user:email
allowed_organizations =
[auth.grafana_com]
enabled = false
allow_sign_up = true
client_id = some_id
client_secret = some_secret
scopes = user:email
@@ -241,8 +268,9 @@ allowed_organizations =
#################################### Generic OAuth #######################
[auth.generic_oauth]
name = OAuth
enabled = false
allow_sign_up = false
allow_sign_up = true
client_id = some_id
client_secret = some_secret
scopes = user:email
@@ -262,6 +290,8 @@ enabled = false
header_name = X-WEBAUTH-USER
header_property = username
auto_sign_up = true
ldap_sync_ttl = 60
whitelist =
#################################### Auth LDAP ###########################
[auth.ldap]
@@ -274,11 +304,13 @@ allow_sign_up = true
enabled = false
host = localhost:25
user =
# If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;"""
password =
cert_file =
key_file =
skip_verify = false
from_address = admin@grafana.localhost
from_name = Grafana
[emails]
welcome_email_on_sign_up = false
@@ -288,7 +320,7 @@ templates_pattern = emails/*.html
[log]
# Either "console", "file", "syslog". Default is console and file
# Use space to separate multiple modes, e.g. "console file"
mode = console, file
mode = console file
# Either "debug", "info", "warn", "error", "critical", default is "info"
level = info
@@ -389,23 +421,11 @@ global_api_key = -1
global_session = -1
#################################### Alerting ############################
# docs about alerting can be found in /docs/sources/alerting/
# __.-/|
# \`o_O'
# =( )= +----------------------------+
# U| | Alerting is still in alpha |
# /\ /\ / | +----------------------------+
# ) /^\) ^\/ _)\ |
# ) /^\/ _) \ |
# ) _ / / _) \___|_
# /\ )/\/ || | )_)\___,|))
# < > |(,,) )__) |
# || / \)___)\
# | \____( )___) )____
# \______(_______;;;)__;;;)
[alerting]
# Disable alerting engine & UI features
enabled = true
# Makes it possible to turn off alert rule execution but alerting UI is visible
execute_alerts = true
#################################### Internal Grafana Metrics ############
# Metrics available at HTTP API Url /api/metrics
@@ -420,7 +440,10 @@ address =
prefix = prod.grafana.%(instance_name)s.
[grafana_net]
url = https://grafana.net
url = https://grafana.com
[grafana_com]
url = https://grafana.com
#################################### External Image Storage ##############
[external_image_storage]
@@ -436,3 +459,4 @@ secret_key =
url =
username =
password =
public_url =

View File

@@ -1,5 +1,6 @@
# Set to true to log user information returned from LDAP
verbose_logging = false
# 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)
@@ -13,11 +14,12 @@ 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
# 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 trippel quotes. Ex """#password;"""
bind_password = 'grafana'
# User search filter, for example "(cn=%s)" or "(sAMAccountName=%s)" or "(uid=%s)"

View File

@@ -26,7 +26,7 @@
#
#################################### Server ####################################
[server]
# Protocol (http or https)
# Protocol (http, https, socket)
;protocol = http
# The ip address to bind to, empty will bind to all interfaces
@@ -59,6 +59,9 @@
;cert_file =
;cert_key =
# Unix socket path
;socket =
#################################### Database ####################################
[database]
# You can configure the database connection by specifying type, host, name, user and password
@@ -69,6 +72,7 @@
;host = 127.0.0.1:3306
;name = grafana
;user = root
# If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;"""
;password =
# Use either URL or the previous fields to configure the database
@@ -81,6 +85,11 @@
# For "sqlite3" only, path relative to data_path setting
;path = grafana.db
# Max conn setting default is 0 (mean not set)
;max_idle_conn =
;max_open_conn =
#################################### Session ####################################
[session]
# Either "memory", "file", "redis", "mysql", "postgres", default is "file"
@@ -103,6 +112,13 @@
# Session life time, default is 86400
;session_life_time = 86400
#################################### Data proxy ###########################
[dataproxy]
# This enables data proxy logging, default is false
;logging = false
#################################### Analytics ####################################
[analytics]
# Server reporting, sends usage counters to stats.grafana.org every 24 hours.
@@ -115,7 +131,7 @@
# for new vesions (grafana itself and plugins), check is used
# in some UI views to notify that grafana or plugin update exists
# This option does not cause any auto updates, nor send any information
# only a GET request to http://grafana.net to get latest versions
# only a GET request to http://grafana.com to get latest versions
;check_for_updates = true
# Google Analytics universal tracking code, only enabled if you specify an id here
@@ -179,6 +195,9 @@
# Set to true to disable (hide) the login form, useful if you use OAuth, defaults to false
;disable_login_form = false
# Set to true to disable the signout link in the side menu. useful if you use auth.proxy, defaults to false
;disable_signout_menu = false
#################################### Anonymous Auth ##########################
[auth.anonymous]
# enable anonymous access
@@ -193,7 +212,7 @@
#################################### Github Auth ##########################
[auth.github]
;enabled = false
;allow_sign_up = false
;allow_sign_up = true
;client_id = some_id
;client_secret = some_secret
;scopes = user:email,read:org
@@ -206,7 +225,7 @@
#################################### Google Auth ##########################
[auth.google]
;enabled = false
;allow_sign_up = false
;allow_sign_up = true
;client_id = some_client_id
;client_secret = some_client_secret
;scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
@@ -218,7 +237,8 @@
#################################### Generic OAuth ##########################
[auth.generic_oauth]
;enabled = false
;allow_sign_up = false
;name = OAuth
;allow_sign_up = true
;client_id = some_id
;client_secret = some_secret
;scopes = user:email,read:org
@@ -228,10 +248,10 @@
;team_ids =
;allowed_organizations =
#################################### Grafana.net Auth ####################
[auth.grafananet]
#################################### Grafana.com Auth ####################
[auth.grafana_com]
;enabled = false
;allow_sign_up = false
;allow_sign_up = true
;client_id = some_id
;client_secret = some_secret
;scopes = user:email
@@ -243,6 +263,8 @@
;header_name = X-WEBAUTH-USER
;header_property = username
;auto_sign_up = true
;ldap_sync_ttl = 60
;whitelist = 192.168.1.1, 192.168.2.1
#################################### Basic Auth ##########################
[auth.basic]
@@ -259,11 +281,13 @@
;enabled = false
;host = localhost:25
;user =
# If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;"""
;password =
;cert_file =
;key_file =
;skip_verify = false
;from_address = admin@grafana.localhost
;from_name = Grafana
[emails]
;welcome_email_on_sign_up = false
@@ -272,9 +296,9 @@
[log]
# Either "console", "file", "syslog". Default is console and file
# Use space to separate multiple modes, e.g. "console file"
;mode = console, file
;mode = console file
# Either "trace", "debug", "info", "warn", "error", "critical", default is "info"
# Either "debug", "info", "warn", "error", "critical", default is "info"
;level = info
# optional settings to set different levels for specific loggers. Ex filters = sqlstore:debug
@@ -338,24 +362,12 @@
;enabled = false
;path = /var/lib/grafana/dashboards
#################################### Alerting ######################################
# docs about alerting can be found in /docs/sources/alerting/
# __.-/|
# \`o_O'
# =( )= +----------------------------+
# U| | Alerting is still in alpha |
# /\ /\ / | +----------------------------+
# ) /^\) ^\/ _)\ |
# ) /^\/ _) \ |
# ) _ / / _) \___|_
# /\ )/\/ || | )_)\___,|))
# < > |(,,) )__) |
# || / \)___)\
# | \____( )___) )____
# \______(_______;;;)__;;;)
#################################### Alerting ############################
[alerting]
;enabled = false
# Disable alerting engine & UI features
;enabled = true
# Makes it possible to turn off alert rule execution but alerting UI is visible
;execute_alerts = true
#################################### Internal Grafana Metrics ##########################
# Metrics available at HTTP API Url /api/metrics
@@ -372,10 +384,10 @@
;address =
;prefix = prod.grafana.%(instance_name)s.
#################################### Internal Grafana Metrics ##########################
# Url used to to import dashboards directly from Grafana.net
[grafana_net]
;url = https://grafana.net
#################################### Grafana.com integration ##########################
# Url used to to import dashboards directly from Grafana.com
[grafana_com]
;url = https://grafana.com
#################################### External image storage ##########################
[external_image_storage]
@@ -390,5 +402,6 @@
[external_image_storage.webdav]
;url =
;public_url =
;username =
;password =

View File

@@ -1,5 +1,5 @@
elasticsearch:
image: elasticsearch:latest
image: elasticsearch:2.4.1
command: elasticsearch -Des.network.host=0.0.0.0
ports:
- "9200:9200"

View File

@@ -0,0 +1,2 @@
script.inline: on
script.indexed: on

View File

@@ -0,0 +1,8 @@
elasticsearch1:
image: elasticsearch:1.7.6
command: elasticsearch -Des.network.host=0.0.0.0
ports:
- "11200:9200"
- "11300:9300"
volumes:
- ./blocks/elastic/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml

View File

@@ -0,0 +1,2 @@
script.inline: on
script.indexed: on

View File

@@ -0,0 +1,8 @@
# You need to run 'sysctl -w vm.max_map_count=262144' on the host machine
elasticsearch5:
image: elasticsearch:5
command: elasticsearch
ports:
- "10200:9200"
- "10300:9300"

View File

@@ -4,7 +4,6 @@ graphite:
- "8080:80"
- "2003:2003"
volumes:
- /var/docker/gfdev/graphite:/opt/graphite/storage/whisper
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro

View File

@@ -1,75 +0,0 @@
bind-address = "0.0.0.0"
[logging]
level = "debug"
file = "/opt/influxdb/shared/data/influxdb.log" # stdout to log to standard out
[admin]
port = 8083 # binding is disabled if the port isn't set
assets = "/opt/influxdb/current/admin"
[api]
port = 8086 # binding is disabled if the port isn't set
read-timeout = "5s"
[input_plugins]
[input_plugins.graphite]
enabled = true
port = 2004
database = "graphite" # store graphite data in this database
[raft]
port = 8090
dir = "/opt/influxdb/shared/data/raft"
[storage]
dir = "/opt/influxdb/shared/data/db"
# How many requests to potentially buffer in memory. If the buffer gets filled then writes
# will still be logged and once the local storage has caught up (or compacted) the writes
# will be replayed from the WAL
write-buffer-size = 10000
default-engine = "rocksdb"
max-open-shards = 0
point-batch-size = 100
write-batch-size = 5000000
retention-sweep-period = "10m"
[storage.engines.rocksdb]
max-open-files = 1000
lru-cache-size = "200m"
[storage.engines.leveldb]
max-open-files = 1000
lru-cache-size = "200m"
[cluster]
protobuf_port = 8099
protobuf_timeout = "2s" # the write timeout on the protobuf conn any duration parseable by time.ParseDuration
protobuf_heartbeat = "200ms" # the heartbeat interval between the servers. must be parseable by time.ParseDuration
protobuf_min_backoff = "1s" # the minimum backoff after a failed heartbeat attempt
protobuf_max_backoff = "10s" # the maxmimum backoff after a failed heartbeat attempt
write-buffer-size = 10000
ax-response-buffer-size = 100000
oncurrent-shard-query-limit = 10
[sharding]
replication-factor = 1
[sharding.short-term]
duration = "7d"
split = 1
[sharding.long-term]
duration = "30d"
split = 1
# split-random = "/^Hf.*/"
[wal]
dir = "/opt/influxdb/shared/data/wal"
flush-after = 1000 # the number of writes after which wal will be flushed, 0 for flushing on every write
bookmark-after = 1000 # the number of writes after which a bookmark will be created
index-after = 1000
requests-per-logfile = 10000

View File

@@ -1,9 +1,12 @@
influxdb:
image: tutum/influxdb:0.12
image: influxdb:latest
container_name: influxdb
ports:
- "2004:2004"
- "8083:8083"
- "8086:8086"
volumes:
- ./blocks/influxdb/influxdb.conf:/etc/influxdb/influxdb.conf
fake-influxdb-data:
image: grafana/fake-data-gen

View File

@@ -0,0 +1,92 @@
reporting-disabled = false
[meta]
# Where the metadata/raft database is stored
dir = "/var/lib/influxdb/meta"
retention-autocreate = true
# If log messages are printed for the meta service
logging-enabled = true
pprof-enabled = false
# The default duration for leases.
lease-duration = "1m0s"
[data]
# Controls if this node holds time series data shards in the cluster
enabled = true
dir = "/var/lib/influxdb/data"
# These are the WAL settings for the storage engine >= 0.9.3
wal-dir = "/var/lib/influxdb/wal"
wal-logging-enabled = true
[coordinator]
write-timeout = "10s"
max-concurrent-queries = 0
query-timeout = "0"
log-queries-after = "0"
max-select-point = 0
max-select-series = 0
max-select-buckets = 0
[retention]
enabled = true
check-interval = "30m"
[shard-precreation]
enabled = true
check-interval = "10m"
advance-period = "30m"
[monitor]
store-enabled = true # Whether to record statistics internally.
store-database = "_internal" # The destination database for recorded statistics
store-interval = "10s" # The interval at which to record statistics
[admin]
enabled = true
bind-address = ":8083"
https-enabled = false
https-certificate = "/etc/ssl/influxdb.pem"
[http]
enabled = true
bind-address = ":8086"
auth-enabled = true
log-enabled = true
write-tracing = false
pprof-enabled = false
https-enabled = false
https-certificate = "/etc/ssl/influxdb.pem"
### Use a separate private key location.
# https-private-key = ""
max-row-limit = 10000
realm = "InfluxDB"
unix-socket-enabled = false # enable http service over unix domain socket
# bind-socket = "/var/run/influxdb.sock"
[subscriber]
enabled = true
[[graphite]]
enabled = false
[[collectd]]
enabled = false
[[opentsdb]]
enabled = false
[[udp]]
enabled = false
[continuous_queries]
log-enabled = true
enabled = true
# run-interval = "1s" # interval for how often continuous queries will be checked if they need to run

View File

@@ -7,3 +7,8 @@ mysql:
MYSQL_PASSWORD: password
ports:
- "3306:3306"
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
command: [mysqld, --character-set-server=utf8mb4, --collation-server=utf8mb4_unicode_ci, --innodb_monitor_enable=all]

View File

@@ -0,0 +1,20 @@
## MySQL with Open Data Set from NYC Open Data (https://data.cityofnewyork.us)
FROM mysql:latest
ENV MYSQL_DATABASE="testdata" \
MYSQL_ROOT_PASSWORD="rootpass" \
MYSQL_USER="grafana" \
MYSQL_PASSWORD="password"
# Install requirement (wget)
RUN apt-get update && apt-get install -y wget && apt-get install unzip
# Fetch NYC Data Set
RUN wget https://data.cityofnewyork.us/download/57g5-etyj/application%2Fzip -O /tmp/data.zip && \
unzip -j /tmp/data.zip 311_Service_Requests_from_2015.csv -d /var/lib/mysql-files && \
rm /tmp/data.zip
ADD import_csv.sql /docker-entrypoint-initdb.d/
EXPOSE 3306

View File

@@ -0,0 +1,9 @@
mysql_opendata:
build: blocks/mysql_opendata
environment:
MYSQL_ROOT_PASSWORD: rootpass
MYSQL_DATABASE: testdata
MYSQL_USER: grafana
MYSQL_PASSWORD: password
ports:
- "3307:3306"

View File

@@ -0,0 +1,80 @@
use testdata;
DROP TABLE IF EXISTS `nyc_open_data`;
CREATE TABLE IF NOT EXISTS `nyc_open_data` (
UniqueKey bigint(255),
`CreatedDate` varchar(255),
`ClosedDate` varchar(255),
Agency varchar(255),
AgencyName varchar(255),
ComplaintType varchar(255),
Descriptor varchar(255),
LocationType varchar(255),
IncidentZip varchar(255),
IncidentAddress varchar(255),
StreetName varchar(255),
CrossStreet1 varchar(255),
CrossStreet2 varchar(255),
IntersectionStreet1 varchar(255),
IntersectionStreet2 varchar(255),
AddressType varchar(255),
City varchar(255),
Landmark varchar(255),
FacilityType varchar(255),
Status varchar(255),
`DueDate` varchar(255),
ResolutionDescription varchar(2048),
`ResolutionActionUpdatedDate` varchar(255),
CommunityBoard varchar(255),
Borough varchar(255),
XCoordinateStatePlane varchar(255),
YCoordinateStatePlane varchar(255),
ParkFacilityName varchar(255),
ParkBorough varchar(255),
SchoolName varchar(255),
SchoolNumber varchar(255),
SchoolRegion varchar(255),
SchoolCode varchar(255),
SchoolPhoneNumber varchar(255),
SchoolAddress varchar(255),
SchoolCity varchar(255),
SchoolState varchar(255),
SchoolZip varchar(255),
SchoolNotFound varchar(255),
SchoolOrCitywideComplaint varchar(255),
VehicleType varchar(255),
TaxiCompanyBorough varchar(255),
TaxiPickUpLocation varchar(255),
BridgeHighwayName varchar(255),
BridgeHighwayDirection varchar(255),
RoadRamp varchar(255),
BridgeHighwaySegment varchar(255),
GarageLotName varchar(255),
FerryDirection varchar(255),
FerryTerminalName varchar(255),
Latitude varchar(255),
Longitude varchar(255),
Location varchar(255)
);
LOAD DATA INFILE '/var/lib/mysql-files/311_Service_Requests_from_2015.csv' INTO TABLE nyc_open_data FIELDS OPTIONALLY ENCLOSED BY '"' TERMINATED BY ',' IGNORE 1 LINES;
UPDATE nyc_open_data SET CreatedDate = STR_TO_DATE(CreatedDate, '%m/%d/%Y %r') WHERE CreatedDate <> '';
UPDATE nyc_open_data SET ClosedDate = STR_TO_DATE(ClosedDate, '%m/%d/%Y %r') WHERE ClosedDate <> '';
UPDATE nyc_open_data SET DueDate = STR_TO_DATE(DueDate, '%m/%d/%Y %r') WHERE DueDate <> '';
UPDATE nyc_open_data SET ResolutionActionUpdatedDate = STR_TO_DATE(ResolutionActionUpdatedDate, '%m/%d/%Y %r') WHERE ResolutionActionUpdatedDate <> '';
UPDATE nyc_open_data SET CreatedDate=null WHERE CreatedDate = '';
UPDATE nyc_open_data SET ClosedDate=null WHERE ClosedDate = '';
UPDATE nyc_open_data SET DueDate=null WHERE DueDate = '';
UPDATE nyc_open_data SET ResolutionActionUpdatedDate=null WHERE ResolutionActionUpdatedDate = '';
ALTER TABLE nyc_open_data modify CreatedDate datetime NULL;
ALTER TABLE nyc_open_data modify ClosedDate datetime NULL;
ALTER TABLE nyc_open_data modify DueDate datetime NULL;
ALTER TABLE nyc_open_data modify ResolutionActionUpdatedDate datetime NULL;
ALTER TABLE `nyc_open_data` ADD INDEX `IX_ComplaintType` (`ComplaintType`);
ALTER TABLE `nyc_open_data` ADD INDEX `IX_CreatedDate` (`CreatedDate`);
ALTER TABLE `nyc_open_data` ADD INDEX `IX_LocationType` (`LocationType`);
ALTER TABLE `nyc_open_data` ADD INDEX `IX_AgencyName` (`AgencyName`);
ALTER TABLE `nyc_open_data` ADD INDEX `IX_City` (`City`);
SYSTEM rm /var/lib/mysql-files/311_Service_Requests_from_2015.csv

View File

@@ -3,8 +3,6 @@ prometheus:
net: host
ports:
- "9090:9090"
volumes:
- /var/docker/prometheus:/prometheus-data
node_exporter:
image: prom/node-exporter

View File

@@ -1,4 +1,4 @@
snmpd:
build: blocks/snmpd
image: namshi/smtp
ports:
- "161:161"
- "25:25"

View File

@@ -1,16 +0,0 @@
FROM debian:jessie
RUN apt-get -y update
RUN apt-get -y install libfontconfig
RUN mkdir -p /opt/grafana
ADD tmp/ /opt/grafana/
EXPOSE 3000
VOLUME ["/opt/grafana/data"]
VOLUME ["/opt/grafana/conf"]
WORKDIR /opt/grafana/
ENTRYPOINT ["./grafana", "web"]

View File

@@ -1,31 +0,0 @@
# Grafana docker image
This container currently only contains the in development alpha of Grafana 2.0 (ie non production use). The
`#develop` tag is constantly updated as we make progress towards a beta release.
## Running your Grafana image
--------------------------
Start your image binding the external port `3000`.
docker run -i -p 3000:3000 grafana/grafana
Try it out, default admin user is admin/admin.
## Configuring your Grafana container
All options defined in conf/grafana.ini can be overridden using environment variables, for example:
```
docker run -i -p 3000:3000 \
-e "GF_SERVER_ROOT_URL=http://grafana.server.name" \
-e "GF_SECURITY_ADMIN_PASSWORD=secret \
grafana/grafana:develop
```

View File

@@ -1,15 +0,0 @@
#!/bin/bash
cp Dockerfile ../../
cd ../../
go run build.go build
grunt release
docker build --tag "grafana/grafana:develop" .
rm Dockerfile
cd docker/production

View File

@@ -1,5 +0,0 @@
#!/bin/bash
docker run -i -p 3001:3000 \
-e "GF_SERVER_ROOT_URL=http://grafana.server.name" \
grafana/grafana:develop

View File

@@ -1,25 +1,13 @@
FROM grafana/docs-base:latest
# TODO: need the full repo source to get the git version info
COPY . /src
# to get the git info for this repo
# COPY config.toml /site
# Reset the /docs dir so we can replace the theme meta with the new repo's git info
RUN git reset --hard
# RUN rm -rf /site/content/*
# Then copy the desired docs into the /docs/sources/ dir
COPY ./sources/ /docs/sources
# COPY ./sources /site/content/docs/
COPY ./VERSION /docs/VERSION
COPY config.toml /site
COPY awsconfig /site
COPY ./changed-files /docs/changed-files
# adding the image spec will require Docker 1.5 and `docker build -f docs/Dockerfile .`
#COPY ./image/spec/v1.md /docs/sources/reference/image-spec-v1.md
# TODO: don't do this - look at merging the yml file in build.sh
COPY ./mkdocs.yml /docs/mkdocs.yml
COPY ./s3_website.json /docs/s3_website.json
# Then build everything together, ready for mkdocs
RUN /docs/build.sh
VOLUME ["/site/content"]

View File

@@ -1,50 +1,34 @@
.PHONY: all binary build cross default docs docs-build docs-shell shell test test-unit test-integration test-integration-cli test-docker-py validate
# env vars passed through directly to Docker's build scripts
# to allow things like `make DOCKER_CLIENTONLY=1 binary` easily
# `docs/sources/contributing/devenvironment.md ` and `project/PACKAGERS.md` have some limited documentation of some of these
DOCKER_ENVS := \
-e BUILDFLAGS \
-e DOCKER_CLIENTONLY \
-e DOCKER_EXECDRIVER \
-e DOCKER_GRAPHDRIVER \
-e TESTDIRS \
-e TESTFLAGS \
-e TIMEOUT
# note: we _cannot_ add "-e DOCKER_BUILDTAGS" here because even if it's unset in the shell, that would shadow the "ENV DOCKER_BUILDTAGS" set in our Dockerfile, which is very important for our official builds
# to allow `make DOCSDIR=docs docs-shell` (to create a bind mount in docs)
DOCS_MOUNT := $(if $(DOCSDIR),-v $(CURDIR)/$(DOCSDIR):/$(DOCSDIR))
.PHONY: all default docs docs-build docs-shell shell checkvars
# to allow `make DOCSPORT=9000 docs`
DOCSPORT := 8180
DOCSPORT := 3004
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
DOCKER_DOCS_IMAGE := grafana-docs-base$(if $(GIT_BRANCH),:$(GIT_BRANCH))
DOCKER_DOCS_IMAGE := grafana/grafana-docs
DOCKER_RUN_DOCS := docker run --rm -it $(DOCS_MOUNT) -e AWS_S3_BUCKET -e NOCACHE
SOURCES_HOST_DIR := "$(shell pwd)/sources"
# for some docs workarounds (see below in "docs-build" target)
GITCOMMIT := $(shell git rev-parse --short HEAD 2>/dev/null)
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
VERSION := $(shell head -n 1 VERSION)
default: docs
checkvars:
ifndef ENV
$(error ENV is undefined set via ENV=staging or ENV=prod as argument to make)
endif
docs: docs-build
$(DOCKER_RUN_DOCS) -p $(if $(DOCSPORT),$(DOCSPORT):)8000 "$(DOCKER_DOCS_IMAGE)" mkdocs serve
$(DOCKER_RUN_DOCS) $(DOCS_MOUNT) -e DOCKERHOST "$(DOCKER_DOCS_IMAGE)" /bin/bash -c "grunt --env=dev-docs && grunt connect --port=3004"
docs-shell: docs-build
$(DOCKER_RUN_DOCS) -p $(if $(DOCSPORT),$(DOCSPORT):)8000 "$(DOCKER_DOCS_IMAGE)" bash
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"
docs-release: docs-build
$(DOCKER_RUN_DOCS) -e OPTIONS -e BUILD_ROOT -e DISTRIBUTION_ID \
-v $(CURDIR)/awsconfig:/docs/awsconfig \
"$(DOCKER_DOCS_IMAGE)" ./release.sh
docs-test: docs-build
$(DOCKER_RUN_DOCS) "$(DOCKER_DOCS_IMAGE)" ./test.sh
publish: checkvars docs-build
$(info Publishing ENV=${ENV} and VERSION=${VERSION})
$(DOCKER_RUN_DOCS) $(DOCS_MOUNT) -e DOCKERHOST "$(DOCKER_DOCS_IMAGE)" /bin/bash -c "./publish.sh ${ENV}-docs ${VERSION}"
docs-build:
git fetch https://github.com/grafana/grafana.git docs-2.6 && git diff --name-status FETCH_HEAD...HEAD -- . > changed-files
echo "$(GIT_BRANCH)" > GIT_BRANCH
echo "$(GITCOMMIT)" > GITCOMMIT
docker build -t "$(DOCKER_DOCS_IMAGE)" .
docker build -t "$(DOCKER_DOCS_IMAGE)" --no-cache .

View File

@@ -1,61 +1,72 @@
# Building The Docs
To build the docs locally, you need to have docker installed. The
docs are built using a custom [docker](https://www.docker.com/) image
and the [mkdocs](http://www.mkdocs.org/) tool.
docs are built using [Hugo](http://gohugo.io/) - a static site generator.
**Prepare the Docker Image**:
Build the `grafana/docs-base:latest` image. Run these commands in the
same directory this file is in. **Note** that you may require ``sudo``
Git clone `grafana/grafana.org` 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/docs-base
$ cd docs-base
$ make docs-build
git clone https://github.com/grafana/grafana.org
cd grafana.org
make docs-build
```
**Build the Documentation**:
Now that the docker image has been prepared we can build the
docs. Switch your working directory back to the directory this file
(README.md) is in and run (possibly with ``sudo``):
grafana docs and start a docs server.
If you have not cloned the Grafana repository already then:
```
$ make docs
cd ..
git clone https://github.com/grafana/grafana
```
Switch your working directory to the directory this file
(README.md) is in.
```
cd grafana/docs
```
An AWS config file is required to build the docs Docker image and to publish the site to AWS. If you are building locally only and do not have any AWS credentials for docs.grafana.org then create an empty file named `awsconfig` in the current directory.
```
touch awsconfig
```
Then run (possibly with ``sudo``):
```
make watch
```
This command will not return control of the shell to the user. Instead
the command is now running a new docker container built from the image
we created in the previous step.
Open [localhost:8180](http://localhost:8180) to view the docs.
Open [localhost:3004](http://localhost:3004) to view the docs.
**Note** that after running ``make docs`` you may notice a message
like this in the console output
### Images & Content
> Running at: http://0.0.0.0:8000/
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.
This is misleading. That is **not** the port the documentation is
served from. You must browse to port **8180** to view the new
documentation.
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.
# Adding a New Page
Adding a new page requires updating the ``mkdocs.yml`` file which is
located in this directory.
For example, if you are adding documentation for a new HTTP API called
``preferences`` you would:
1. Create the file ``docs/sources/http_api/preferences.md``
1. Add a reference to it in ``docs/sources/http_api/overview.md``
1. Update the list under the **pages** key in the ``docs/mkdocs.yml`` file with a reference to your new page:
```yaml
- ['http_api/preferences.md', 'API', 'Preferences API']
Then run:
```
make docs-build
```
This will rebuild the docs docker container.
To be able to use the image your 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.

View File

@@ -1 +1 @@
3.1.0
v4.2

20
docs/config.toml Normal file
View File

@@ -0,0 +1,20 @@
baseurl = "http://localhost:3002/"
languageCode = "en-us"
title = "Grafana Documentation"
canonifyurls = true
relativeURLs = false
verbose = true
enableRobotsTXT = true
disableSitemap = false
disableRSS = false
preservetaxonomynames = true
metaDataFormat = "yaml"
[taxonomies]
tag = "tags"
category = "categories"
[permalinks]
blog = ":year/:month/:day/:title/"

View File

@@ -1,102 +0,0 @@
site_name: Grafana Documentation
site_url: /
site_description: Documentation for Grafana, The Graphite and Influxdb dashboard and graph composer
site_favicon: img/fav32.png
dev_addr: '0.0.0.0:8000'
repo_url: https://github.com/grafana/grafana/
docs_dir: sources
include_search: true
use_absolute_urls: true
# theme: docker
theme_dir: ./theme/mkdocs/
theme_center_lead: false
copyright: Copyright &copy; 2014-2015, Coding Instinct AB.
google_analytics: ['UA-47280256-1', 'grafana.org']
pages:
# Introduction:
# - ['index.md', 'Project', 'About Grafana']
# - ['project/cla.md', 'Project', 'Contributor License Agreement']
- ['index.md', '**HIDDEN**']
- ['installation/index.md', 'Installation', 'Installation']
- ['installation/debian.md', 'Installation', 'Installing on Debian / Ubuntu']
- ['installation/rpm.md', 'Installation', 'Installing on RPM-based Linux']
- ['installation/mac.md', 'Installation', 'Installing on Mac OS X']
- ['installation/windows.md', 'Installation', 'Installing on Windows']
- ['installation/docker.md', 'Installation', 'Installing on Docker']
- ['project/building_from_source.md', 'Installation', 'Building from Source']
- ['installation/configuration.md', 'Installation', 'Configuration']
- ['installation/ldap.md', 'Installation', 'LDAP Integration']
- ['installation/provisioning.md', 'Installation', 'Provisioning']
- ['installation/performance.md', 'Installation', 'Performance Tips']
- ['installation/troubleshooting.md', 'Installation', 'Troubleshooting']
- ['installation/migrating_to2.md', 'Installation', 'Migrating from v1.x to v2.x']
- ['installation/behind_proxy.md', 'Installation', 'Grafana behind reverse proxy']
- ['guides/basic_concepts.md', 'User Guides', 'Basic Concepts']
- ['guides/gettingstarted.md', 'User Guides', 'Getting Started']
- ['guides/whats-new-in-v3-1.md', 'User Guides', "What's New in Grafana v3.1"]
- ['guides/whats-new-in-v3.md', 'User Guides', "What's New in Grafana v3.0"]
- ['guides/whats-new-in-v2-6.md', 'User Guides', "What's New in Grafana v2.6"]
- ['guides/whats-new-in-v2-5.md', 'User Guides', "What's New in Grafana v2.5"]
- ['guides/whats-new-in-v2-1.md', 'User Guides', "What's New in Grafana v2.1"]
- ['guides/whats-new-in-v2.md', 'User Guides', "What's New in Grafana v2.0"]
- ['guides/screencasts.md', 'User Guides', 'Screencasts']
- ['reference/graph.md', 'Reference', 'Graph Panel']
- ['reference/singlestat.md', 'Reference', 'Singlestat Panel']
- ['reference/table_panel.md', 'Reference', 'Table Panel']
- ['reference/dashlist.md', 'Reference', 'Dashboard List Panel']
- ['reference/sharing.md', 'Reference', 'Sharing']
- ['reference/annotations.md', 'Reference', 'Annotations']
- ['reference/timerange.md', 'Reference', 'Time Range']
- ['reference/search.md', 'Reference', 'Search']
- ['reference/templating.md', 'Reference', 'Templating']
- ['reference/scripting.md', 'Reference', 'Scripting']
- ['reference/playlist.md', 'Reference', 'Playlist']
- ['reference/export_import.md', 'Reference', 'Import & Export']
- ['reference/admin.md', 'Reference', 'Administration']
- ['reference/keyboard_shortcuts.md', 'Reference', 'Keyboard Shortcuts']
- ['datasources/overview.md', 'Data Sources', 'Overview']
- ['datasources/graphite.md', 'Data Sources', 'Graphite']
- ['datasources/elasticsearch.md', 'Data Sources', 'Elasticsearch']
- ['datasources/cloudwatch.md', 'Data Sources', 'CloudWatch']
- ['datasources/influxdb.md', 'Data Sources', 'InfluxDB']
- ['datasources/opentsdb.md', 'Data Sources', 'OpenTSDB']
- ['datasources/kairosdb.md', 'Data Sources', 'KairosDB']
- ['datasources/prometheus.md', 'Data Sources', 'Prometheus']
- ['http_api/overview.md', 'API', 'Overview']
- ['http_api/auth.md', 'API', 'Authentication API']
- ['http_api/dashboard.md', 'API', 'Dashboard API']
- ['http_api/data_source.md', 'API', 'Data Source API']
- ['http_api/org.md', 'API', 'Organisation API']
- ['http_api/user.md', 'API', 'User API']
- ['http_api/admin.md', 'API', 'Admin API']
- ['http_api/snapshot.md', 'API', 'Snapshot API']
- ['http_api/preferences.md', 'API', 'Preferences API']
- ['http_api/other.md', 'API', 'Other API']
- ['plugins/index.md', 'Plugins', 'Overview']
- ['plugins/installation.md', 'Plugins', 'Installation']
- ['plugins/development.md', 'Plugins', 'Development']
- ['plugins/apps.md', 'Plugins', 'Apps']
- ['plugins/datasources.md', 'Plugins', 'Datasources']
- ['plugins/panels.md', 'Plugins', 'Panels']
- ['tutorials/index.md', 'Tutorials', 'Tutorials']
- ['tutorials/hubot_howto.md', 'Tutorials', 'How To integrate Hubot and Grafana']
- ['jsearch.md', '**HIDDEN**']

3
docs/publish.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
make publish ENV=prod VERSION=root

View File

@@ -0,0 +1,50 @@
+++
title = "Grafana CLI"
description = "Guide to using grafana-cli"
keywords = ["grafana", "cli", "grafana-cli", "command line interface"]
type = "docs"
[menu.docs]
parent = "admin"
weight = 8
+++
# Grafana CLI
Grafana cli is a small executable that is bundled with grafana server and is suppose to be executed on the same machine as grafana runs.
## Plugins
The CLI helps you install, upgrade and manage your plugins on the same machine it CLI is running.
You can find more information about how to install and manage your plugins at the
[plugin page]({{< relref "plugins/installation.md" >}}).
## Admin
> This feature is only available in grafana 4.1 and above.
To show all admin commands:
`grafana-cli admin`
### Reset admin password
You can reset the password for the admin user using the CLI. The use case for this command is when you have lost the admin password.
`grafana-cli admin reset-admin-password ...`
If running the command returns this error:
> Could not find config defaults, make sure homepath command line parameter is set or working directory is homepath
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`
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 with curl using basic auth:
```
curl -X PUT -H "Content-Type: application/json" -d '{
"oldPassword": "admin",
"newPassword": "newpass",
"confirmNew": "newpass"
}' http://admin:admin@<your_grafana_host>:3000/api/user/password
```

View File

@@ -0,0 +1,11 @@
+++
title = "Administration"
description = "Administration"
type = "docs"
[menu.docs]
name = "Administration"
identifier = "admin"
weight = 2
+++

View File

@@ -1,28 +0,0 @@
---
page_title: Alerting
page_description: Alerting for Grafana
page_keywords: alerting, grafana, plugins, documentation
---
# Alerting
> Alerting is still in very early development. Please be aware.
The roadmap for alerting in Grafana have been changing rapidly during last 2-3 months. So make sure you follow the disucssion in the [alerting issue](https://github.com/grafana/grafana/issues/2209).
## Introduction
> Alerting is turned off by default and have to be enabled in the config file.
Grafana lets you define alert rules based on metrics queries on dashboards. Every alert is connected to a panel and when ever the query for the panel is updated the alerting rule is also updated.
So far only the graph panel supports alerting. To enable alerting for a panel go to the alerting tab and press 'Create alert' button.
## Alert status page
You can overview all your current alerts on the alert stats page at /alerting
## Alert notifications
When an alert is triggered it goes to the notification handler who takes care of sending emails or push data as webhooks.
The alert notifications can be configured on /alerting/notifications

View File

@@ -0,0 +1,9 @@
+++
title = "Alerting"
type = "docs"
[menu.docs]
identifier = "alerting"
parent = "features"
weight = 6
+++

View File

@@ -0,0 +1,23 @@
+++
title = "Alerting Metrics"
description = "Alerting Metrics Guide"
keywords = ["Grafana", "alerting", "guide", "metrics"]
type = "docs"
[menu.docs]
name = "Metrics"
parent = "alerting"
weight = 2
+++
# Metrics from the alert engine
> Alerting is only available in Grafana v4.0 and above.
The alert engine publishes some internal metrics about itself. You can read more about how Grafana published [internal metrics](/installation/configuration/#metrics).
Description | Type | Metric name
---------- | ----------- | ----------
Total number of alerts | counter | `alerting.active_alerts`
Alert execution result | counter | `alerting.result`
Notifications sent counter | counter | `alerting.notifications_sent`
Alert execution timer | timer | `alerting.execution_time`

View File

@@ -0,0 +1,127 @@
+++
title = "Alerting Notifications"
description = "Alerting Notifications Guide"
keywords = ["Grafana", "alerting", "guide", "notifications"]
type = "docs"
[menu.docs]
name = "Notifications"
parent = "alerting"
weight = 2
+++
# Alert Notifications
> Alerting is only available in Grafana v4.0 and above.
When an alert changes state it sends out notifications. Each alert rule can have
multiple notifications. But in order to add a notification to an alert rule you first need
to add and configure a `notification` channel (can be email, Pagerduty or other integration). This is done from the Notification Channels page.
## Notification Channel Setup
{{< imgbox max-width="40%" img="/img/docs/v43/alert_notifications_menu.png" caption="Alerting Notification Channels" >}}
On the Notification Channels page hit the `New Channel` button to go the the page where you
can configure and setup a new Notification Channel.
You specify name and type, and type specific options. You can also test the notification to make
sure it's working and setup correctly.
### Send on all alerts
When checked this option will make this notification used for all alert rules, existing and new.
## Supported Notification Types
Grafana ships with the following set of notification types:
### Email
To enable email notification you have to setup [SMTP settings](/installation/configuration/#smtp)
in the Grafana config. Email notification will upload an image of the alert graph to an
external image destination if available or fallback to attaching the image in the email.
### Slack
{{< imgbox max-width="40%" img="/img/docs/v4/slack_notification.png" caption="Alerting Slack Notification" >}}
To set up slack you need to configure an incoming webhook url at slack. You can follow their guide for how
to do that https://api.slack.com/incoming-webhooks If you want to include screenshots of the firing alerts
in the slack messages you have to configure the [external image destination](#external-image-store) in Grafana.
Setting | Description
---------- | -----------
Recipient | allows you to override the slack recipient.
Mention | make it possible to include a mention in the slack notification sent by Grafana. Ex @here or @channel
### PagerDuty
To set up PagerDuty, all you have to do is to provide an api key.
Setting | Description
---------- | -----------
Integration Key | Integration key for pagerduty.
Auto resolve incidents | Resolve incidents in pagerduty once the alert goes back to ok
### Webhook
The webhook notification is a simple way to send information about an state change over HTTP to a custom endpoint.
Using this notification you could integrate Grafana into any system you choose, by yourself.
Example json body:
```json
{
"title": "My alert",
"ruleId": 1,
"ruleName": "Load peaking!",
"ruleUrl": "http://url.to.grafana/db/dashboard/my_dashboard?panelId=2",
"state": "alerting",
"imageUrl": "http://s3.image.url",
"message": "Load is peaking. Make sure the traffic is real and spin up more webfronts",
"evalMatches": [
{
"metric": "requests",
"tags": {},
"value": 122
}
]
}
```
- **state** - The possible values for alert state are: `ok`, `paused`, `alerting`, `pending`, `no_data`.
### Other Supported Notification Channels
Grafana also supports the following Notification Channels:
- HipChat
- VictorOps
- Sensu
- OpsGenie
- Threema
- Pushover
- Telegram
- LINE
# Enable images in notifications {#external-image-store}
Grafana can render the panel associated with the alert rule and include that in the notification. Most Notification Channels require that this image be publicly accessable (Slack and PagerDuty for example). In order to include images in alert notifications, Grafana can upload the image to an image store. It currently supports
Amazon S3 and Webdav for this. So to set that up you need to configure the [external image uploader](/installation/configuration/#external-image-storage) in your grafana-server ini config file.
Currently only the Email Channels attaches images if no external image store is specified. To include images in alert notifications for other channels then you need to set up an external image store.
This is an optional requirement, you can get Slack and email notifications without setting this up.
# Configure the link back to Grafana from alert notifications
All alert notifications contains a link back to the triggered alert in the Grafana instance.
This url is based on the [domain](/installation/configuration/#domain) setting in Grafana.

View File

@@ -0,0 +1,162 @@
+++
title = "Alerting Engine & Rules Guide"
description = "Configuring Alert Rules"
keywords = ["grafana", "alerting", "guide", "rules"]
type = "docs"
[menu.docs]
name = "Engine & Rules"
parent = "alerting"
weight = 1
+++
# Alerting Engine & Rules Guide
> Alerting is only available in Grafana v4.0 and above.
## Introduction
{{< imgbox max-width="40%" img="/img/docs/v4/drag_handles_gif.gif" caption="Alerting overview" >}}
Alerting in Grafana allows you to attach rules to your dashboard panels. When you save the dashboard
Grafana will extract the alert rules into a separate alert rule storage and schedule them for evaluation.
In the alert tab of the graph panel you can configure how often the alert rule should be evaluated
and the conditions that need to be met for the alert to change state and trigger its
[notifications]({{< relref "notifications.md" >}}).
## Execution
The alert rules are evaluated in the Grafana backend in a scheduler and query execution engine that is part
of core Grafana. Only some data soures are supported right now. They include `Graphite`, `Prometheus`,
`InfluxDB` and `OpenTSDB`.
### Clustering
We have not implemented clustering yet. So if you run multiple instances of grafana-server
you have to make sure [execute_alerts]({{< relref "installation/configuration.md#alerting" >}})
is true on only one instance or otherwise you will get duplicated notifications.
<div class="clearfix"></div>
## Rule Config
{{< imgbox max-width="40%" img="/img/docs/v4/alerting_conditions.png" caption="Alerting Conditions" >}}
Currently only the graph panel supports alert rules but this will be added to the **Singlestat** and **Table**
panels as well in a future release.
### Name & Evaluation interval
Here you can specify the name of the alert rule and how often the scheduler should evaluate the alert rule.
### Conditions
Currently the only condition type that exists is a `Query` condition that allows you to
specify a query letter, time range and an aggregation function.
### Query condition example
```sql
avg() OF query(A, 5m, now) IS BELOW 14
```
- `avg()` Controls how the values for **each** serie should be reduced to a value that can be compared against the threshold. Click on the function to change it to another aggregation function.
- `query(A, 5m, now)` The letter defines what query to execute from the **Metrics** tab. The second two parameters defines the time range, `5m, now` means 5 minutes from now to now. You can also do `10m, now-2m` to define a time range that will be 10 minutes from now to 2 minutes from now. This is useful if you want to ignore the last 2 minutes of data.
- `IS BELOW 14` Defines the type of threshold and the threshold value. You can click on `IS BELOW` to change the type of threshold.
The query used in an alert rule cannot contain any template variables. Currently we only support `AND` and `OR` operators between conditions and they are executed serially.
For example, we have 3 conditions in the following order:
*condition:A(evaluates to: TRUE) OR condition:B(evaluates to: FALSE) AND condition:C(evaluates to: TRUE)*
so the result will be calculated as ((TRUE OR FALSE) AND TRUE) = TRUE.
We plan to add other condition types in the future, like `Other Alert`, where you can include the state
of another alert in your conditions, and `Time Of Day`.
#### Multiple Series
If a query returns multiple series then the aggregation function and threshold check will be evaluated for each series.
What Grafana does not do currently is track alert rule state **per series**. This has implications that is exemplified
in the scenario below.
- Alert condition with query that returns 2 series: **server1** and **server2**
- **server1** series cause the alert rule to fire and switch to state `Alerting`
- Notifications are sent out with message: _load peaking (server1)_
- In a subsequence evaluation of the same alert rule the **server2** series also cause the alert rule to fire
- No new notifications are sent as the alert rule is already in state `Alerting`.
So as you can see from the above scenario Grafana will not send out notifications when other series cause the alert
to fire if the rule already is in state `Alerting`. To improve support for queries that return multiple series
we plan to track state **per series** in a future release.
### No Data / Null values
Below you condition you can configure how the rule evaluation engine should handle queries that return no data or only null valued
data.
No Data Option | Description
------------ | -------------
NoData | Set alert rule state to `NoData`
Alerting | Set alert rule state to `Alerting`
Keep Last State | Keep the current alert rule state, what ever it is.
### Execution errors or timeouts
The last option is how to handle execution or timeout errors.
Error or timeout option | Description
------------ | -------------
Alerting | Set alert rule state to `Alerting`
Keep Last State | Keep the current alert rule state, what ever it is.
If you an unreliable time series store that where queries sometime timeout or fail randomly you can set this option
t `Keep Last State` to basically ignore them.
## Notifications
In alert tab you can also specify alert rule notifications along with a detailed messsage about the alert rule.
The message can contain anything, information about how you might solve the issue, link to runbook etc.
The actual notifications are configured and shared between multiple alerts. Read the
[Notifications]({{< relref "notifications.md" >}}) guide for how to configure and setup notifications.
## Alert State History & Annotations
Alert state changes are recorded in the internal annotation table in Grafana's database. The state changes
are visualized as annotations in the alert rule's graph panel. You can also go into the `State history`
submenu in the alert tab to view & clear state history.
## Troubleshooting
{{< imgbox max-width="40%" img="/img/docs/v4/alert_test_rule.png" caption="Test Rule" >}}
First level of troubleshooting you can do is hit the **Test Rule** button. You will get result back that you can expand
to the point where you can see the raw data that was returned form your query.
Further troubleshooting can also be done by inspecting the grafana-server log. If it's not an error or for some reason
the log does not say anything you can enable debug logging for some relevant components. This is done
in Grafana's ini config file.
Example showing loggers that could be relevant when troubleshooting alerting.
```ini
[log]
filters = alerting.scheduler:debug \
alerting.engine:debug \
alerting.resultHandler:debug \
alerting.evalHandler:debug \
alerting.evalContext:debug \
alerting.extractor:debug \
alerting.notifier:debug \
alerting.notifier.slack:debug \
alerting.notifier.pagerduty:debug \
alerting.notifier.email:debug \
alerting.notifier.webhook:debug \
tsdb.graphite:debug \
tsdb.prometheus:debug \
tsdb.opentsdb:debug \
tsdb.influxdb:debug \
```
If you want to log raw query sent to your TSDB and raw response in log you also have to set grafana.ini option `app_mode` to
`development`.

18
docs/sources/archive.md Normal file
View File

@@ -0,0 +1,18 @@
+++
title = "Docs Archive"
keywords = ["grafana", "archive", "documentation", "guide"]
type = "docs"
[menu.docs]
name = "Docs Archive"
weight = 200
+++
# Docs Archive
Here you can find links to older versions of the documentation that might be better suited for your version
of Grafana.
- [Latest](http://docs.grafana.org)
- [Version 4.2](http://docs.grafana.org/v4.2)
- [Version 3.1](http://docs.grafana.org/v3.1)
- [Version 3.0](http://docs.grafana.org/v3.0)

View File

@@ -0,0 +1,104 @@
+++
title = "Contributor Licence Agreement (CLA)"
description = "Contributer Licence Agreement (CLA)"
type = "docs"
aliases = ["/project/cla", "docs/contributing/cla.html"]
[menu.docs]
parent = "contribute"
weight = 1
+++
# Grafana Labs Contributor License Agreement
Thank you for your interest in contributing to Grafana Labs ("We" or "Us").
This contributor agreement ("Agreement") documents the rights granted by contributors to Us.
To make this document effective, please sign it following the instructions at
[cla-assistant](https://cla-assistant.io/grafana/grafana). This is a legally binding document,
so please read it carefully before agreeing to it. The Agreement may cover more than
one software project managed by Us.
## 1. Definitions
"You" (Individual) means the individual who Submits a Contribution to Us.
"You" (Entity) means any Legal Entity on behalf of whom a Contribution has been received by Us. "Legal Entity" means an entity which is not a natural person. "Affiliates" means other Legal Entities that control, are controlled by, or under common control with that Legal Entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such Legal Entity, whether by contract or otherwise, (ii) ownership of fifty percent (50%) or more of the outstanding shares or securities which vote to elect the management or other persons who direct such Legal Entity or (iii) beneficial ownership of such entity.
"Contribution" means any work of authorship that is Submitted by You to Us in which You own or assert ownership of the Copyright. If You do not own the Copyright in the entire work of authorship, you must notify us at contact@grafana.com before Submitting such a Contribution.
"Copyright" means all rights protecting works of authorship owned or controlled by You [or Your Affiliates], including copyright, moral and neighboring rights, as appropriate, for the full term of their existence including any extensions by You.
"Material" means the work of authorship which is made available by Us to third parties. When this Agreement covers more than one software project, the Material means the work of authorship to which the Contribution was Submitted. After You Submit the Contribution, it may be included in the Material.
"Submit" means any form of electronic, verbal, or written communication sent to Us or our representatives, including but not limited to electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, Us for the purpose of discussing and improving the Material, but excluding communication that is conspicuously marked or otherwise designated in writing by You as "Not a Contribution."
"Submission Date" means the date on which You Submit a Contribution to Us.
"Effective Date" means the date You execute this Agreement or the date You first Submit a Contribution to Us, whichever is earlier.
"Media" means any portion of a Contribution which is not software.
## 2. Grant of Rights
### 2.1 Copyright License
(a) You retain ownership of the Copyright in Your Contribution and have the same rights to use or license the Contribution which You would have had without entering into the Agreement.
(b) To the maximum extent permitted by the relevant law, You grant to Us a perpetual, worldwide, non-exclusive, transferable, royalty-free, irrevocable license under the Copyright covering the Contribution, with the right to sublicense such rights through multiple tiers of sublicensees, to reproduce, modify, display, perform and distribute the Contribution as part of the Material; provided that this license is conditioned upon compliance with Section 2.3.
### 2.2 Patent License
For patent claims including, without limitation, method, process, and apparatus claims which You [or Your Affiliates] own, control or have the right to grant, now or in the future, You grant to Us a perpetual, worldwide, non-exclusive, transferable, royalty-free, irrevocable patent license, with the right to sublicense these rights to multiple tiers of sublicensees, to make, have made, use, sell, offer for sale, import and otherwise transfer the Contribution and the Contribution in combination with the Material (and portions of such combination). This license is granted only to the extent that the exercise of the licensed rights infringes such patent claims; and provided that this license is conditioned upon compliance with Section 2.3.
### 2.3 Outbound License
As a condition on the grant of rights in Sections 2.1 and 2.2, We agree to license the Contribution only under the terms of the license or licenses which We are using on the Submission Date for the Material or any licenses which are approved by the Open Source Initiative on or after the Effective Date, including both permissive and copyleft licenses, whether or not such licenses are subsequently disapproved (including any right to adopt any future version of a license if permitted).
In addition, We may use the following licenses for Media in the Contribution: GNU Free Documentation License v1.3, Creative Commons Attribution 3.0, or Creative Commons Attribution No Derivatives 3.0 (including any right to adopt any future version of a license if permitted).
2.4 Moral Rights. If moral rights apply to the Contribution, to the maximum extent permitted by law, You waive and agree not to assert such moral rights against Us or our successors in interest, or any of our licensees, either direct or indirect.
2.5 Our Rights. You acknowledge that We are not obligated to use Your Contribution as part of the Material and may decide to include any Contribution We consider appropriate.
2.6 Reservation of Rights. Any rights not expressly [assigned or] licensed under this section are expressly reserved by You.
## 3. Agreement
You confirm that:
(a) You have the legal authority to enter into this Agreement.
(b) You [or Your Affiliates] own the Copyright and patent claims covering the Contribution which are required to grant the rights under Section 2.
\(c)(Individual) The grant of rights under Section 2 does not violate any grant of rights which You have made to third parties, including Your employer. If You are an employee, You have had Your employer approve this Agreement or sign the Entity version of this document. If You are less than eighteen years old, please have Your parents or guardian sign the Agreement.
\(c)(Entity) The grant of rights under Section 2 does not violate any grant of rights which You or Your Affiliates have made to third parties.
## 4. Disclaimer
EXCEPT FOR THE EXPRESS WARRANTIES IN SECTION 3, THE CONTRIBUTION IS PROVIDED "AS IS". MORE PARTICULARLY, ALL EXPRESS OR IMPLIED WARRANTIES INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE EXPRESSLY DISCLAIMED BY YOU TO US [AND BY US TO YOU]. TO THE EXTENT THAT ANY SUCH WARRANTIES CANNOT BE DISCLAIMED, SUCH WARRANTY IS LIMITED IN DURATION TO THE MINIMUM PERIOD PERMITTED BY LAW.
## 5. Consequential Damage Waiver
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT WILL YOU [OR US] BE LIABLE FOR ANY LOSS OF PROFITS, LOSS OF ANTICIPATED SAVINGS, LOSS OF DATA, INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL AND EXEMPLARY DAMAGES ARISING OUT OF THIS AGREEMENT REGARDLESS OF THE LEGAL OR EQUITABLE THEORY (CONTRACT, TORT OR OTHERWISE) UPON WHICH THE CLAIM IS BASED.
## 6. Miscellaneous
6.1 This Agreement will be governed by and construed in accordance with the laws of New York State, United States excluding its conflicts of law provisions. Under certain circumstances, the governing law in this section might be superseded by the United Nations Convention on Contracts for the International Sale of Goods ("UN Convention") and the parties intend to avoid the application of the UN Convention to this Agreement and, thus, exclude the application of the UN Convention in its entirety to this Agreement.
6.2 This Agreement sets out the entire agreement between You and Us for Your Contributions to Us and overrides all other agreements or understandings.
6.3 If You or We assign the rights or obligations received through this Agreement to a third party, as a condition of the assignment, that third party must agree in writing to abide by all the rights and obligations in the Agreement.
6.4 The failure of either party to require performance by the other party of any provision of this Agreement in one situation shall not affect the right of a party to require such performance at any time in the future. A waiver of performance under a provision in one situation shall not be considered a waiver of the performance of the provision in the future or a waiver of the provision in its entirety.
6.5 If any provision of this Agreement is found void and unenforceable, such provision will be replaced to the extent possible with a provision that comes closest to the meaning of the original provision and which is enforceable. The terms and conditions set forth in this Agreement shall apply notwithstanding any failure of essential purpose of this Agreement or any limited remedy to the maximum extent possible under law.
### Sign using CLA-Assistant
[https://cla-assistant.io/grafana/grafana](https://cla-assistant.io/grafana/grafana)
<br>
<br>
<br>
This CLA aggreement is based on the [Harmony Contributor Aggrement Template (combined)](http://www.harmonyagreements.org/agreements.html), [Creative Commons Attribution 3.0 Unported License](https://creativecommons.org/licenses/by/3.0/)

View File

@@ -0,0 +1,12 @@
+++
title = "Contribute"
description = "Contribute"
type = "docs"
[menu.docs]
name = "Contribute"
identifier = "contribute"
weight = 20
+++
### Contribute info

View File

@@ -1,105 +0,0 @@
----
page_title: Cloudwatch
page_description: Cloudwatch grafana datasource documentation
page_keywords: Cloudwatch, grafana, documentation, datasource, docs
---
# CloudWatch
Grafana ships with built in support for CloudWatch. You just have to add it as a data source and you will
be ready to build dashboards for you CloudWatch metrics.
## Adding the data source
![](/img/cloudwatch/cloudwatch_add.png)
1. Open the side menu by clicking the the Grafana icon in the top header.
2. In the side menu under the `Dashboards` link you should find a link named `Data Sources`.
> NOTE: If this link is missing in the side menu it means that your current user does not have the `Admin` role for the current organization.
3. Click the `Add new` link in the top header.
4. Select `CloudWatch` from the dropdown.
Name | Description
------------ | -------------
Name | The data source name, important that this is the same as in Grafana v1.x if you plan to import old dashboards.
Default | Default data source means that it will be pre-selected for new panels.
Credentials profile name | Specify the name of the profile to use (if you use `~/aws/credentials` file), leave blank for default. This option was introduced in Grafana 2.5.1
Default Region | Used in query editor to set region (can be changed on per query basis)
Custom Metrics namespace | Specify the CloudWatch namespace of Custom metrics
Assume Role Arn | Specify the ARN of the role to assume
## Authentication
### IAM Roles
Currently all access to CloudWatch is done server side by the Grafana backend using the official AWS SDK. If you grafana
server is running on AWS you can use IAM Roles and authentication will be handled automatically.
Checkout AWS docs on [IAM Roles](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html)
### AWS credentials file
Create a file at `~/.aws/credentials`. That is the `HOME` path for user running grafana-server.
Example content:
[default]
aws_access_key_id = asdsadasdasdasd
aws_secret_access_key = dasdasdsadasdasdasdsa
region = us-west-2
## Metric Query Editor
![](/img/cloudwatch/query_editor.png)
You need to specify a namespace, metric, at least one stat, and at least one dimension.
## Templated queries
CloudWatch Datasource Plugin provides the following functions in `Variables values query` field in Templating Editor to query `region`, `namespaces`, `metric names` and `dimension keys/values` on the CloudWatch.
Name | Description
------- | --------
`regions()` | Returns a list of regions AWS provides their service.
`namespaces()` | Returns a list of namespaces CloudWatch support.
`metrics(namespace)` | Returns a list of metrics in the namespace.
`dimension_keys(namespace)` | Returns a list of dimension keys in the namespace.
`dimension_values(region, namespace, metric, dimension_key)` | Returns a list of dimension values matching the specified `region`, `namespace`, `metric` and `dimension_key`.
`ebs_volume_ids(region, instance_id)` | Returns a list of volume id matching the specified `region`, `instance_id`.
`ec2_instance_attribute(region, attribute_name, filters)` | Returns a list of attribute matching the specified `region`, `attribute_name`, `filters`.
For details about the metrics CloudWatch provides, please refer to the [CloudWatch documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CW_Support_For_AWS.html).
## Example templated Queries
Example dimension queries which will return list of resources for individual AWS Services:
Service | Query
------- | -----
ELB | `dimension_values(us-east-1,AWS/ELB,RequestCount,LoadBalancerName)`
ElastiCache | `dimension_values(us-east-1,AWS/ElastiCache,CPUUtilization,CacheClusterId)`
RedShift | `dimension_values(us-east-1,AWS/Redshift,CPUUtilization,ClusterIdentifier)`
RDS | `dimension_values(us-east-1,AWS/RDS,CPUUtilization,DBInstanceIdentifier)`
S3 | `dimension_values(us-east-1,AWS/S3,BucketSizeBytes,BucketName)`
## ec2_instance_attribute JSON filters
The `ec2_instance_attribute` query take `filters` in JSON format.
You can specify [pre-defined filters of ec2:DescribeInstances](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html).
Specify like `{ filter_name1: [ filter_value1 ], filter_name2: [ filter_value2 ] }`
Example `ec2_instance_attribute()` query
ec2_instance_attribute(us-east-1, InstanceId, { "tag:Environment": [ "production" ] })
![](/img/v2/cloudwatch_templating.png)
## Cost
Amazon provides 1 million CloudWatch API requests each month at no additional charge. Past this,
it costs $0.01 per 1,000 GetMetricStatistics or ListMetrics requests. For each query Grafana will
issue a GetMetricStatistics request and every time you pick a dimension in the query editor
Grafana will issue a ListMetrics request.

View File

@@ -1,92 +0,0 @@
----
page_title: Elasticsearch
page_description: Elasticsearch grafana datasource documentation
page_keywords: Elasticsearch, grafana, kibana, documentation, datasource, docs
---
# Elasticsearch
Grafana ships with advanced support for Elasticsearch. You can do many types of
simple or complex elasticsearch queries to visualize logs or metrics stored in elasticsearch. You can
also annotate your graphs with log events stored in elasticsearch.
## Adding the data source
![](/img/v2/add_Graphite.jpg)
1. Open the side menu by clicking the the Grafana icon in the top header.
2. In the side menu under the `Dashboards` link you should find a link named `Data Sources`.
> NOTE: If this link is missing in the side menu it means that your current user does not have the `Admin` role for the current organization.
3. Click the `Add new` link in the top header.
4. Select `Elasticsearch` from the dropdown.
Name | Description
------------ | -------------
Name | The data source name, important that this is the same as in Grafana v1.x if you plan to import old dashboards.
Default | Default data source means that it will be pre-selected for new panels.
Url | The http protocol, ip and port of you elasticsearch server.
Access | Proxy = access via Grafana backend, Direct = access directly from browser.
Proxy access means that the Grafana backend will proxy all requests from the browser, and send them on to the Data Source. This is useful because it can eliminate CORS (Cross Origin Site Resource) issues, as well as eliminate the need to disseminate authentication details to the Data Source to the browser.
Direct access is still supported because in some cases it may be useful to access a Data Source directly depending on the use case and topology of Grafana, the user, and the Data Source.
### Direct access
If you select direct access you must update your Elasticsearch configuration to allow other domains to access
Elasticsearch from the browser. You do this by specifying these to options in your **elasticsearch.yml** config file.
http.cors.enabled: true
http.cors.allow-origin: "*"
### Index settings
![](/img/elasticsearch/elasticsearch_ds_details.png)
Here you can specify a default for the `time field` and specify the name of your elasticsearch index. You can use
a time pattern for the index name or a wildcard.
## Metric Query editor
![](/img/elasticsearch/query_editor.png)
The Elasticsearch query editor allows you to select multiple metrics and group by multiple terms or filters. Use the plus and minus icons to the right to add / remove
metrics or group bys. Some metrics and group by have options, click the option text to expand the the row to view and edit metric or group by options.
## Pipeline metrics
If you have Elasticsearch 2.x and Grafana 2.6 or above then you can use pipeline metric aggregations like
**Moving Average** and **Derivative**. Elasticsearch pipeline metrics require another metric to be based on. Use the eye icon next to the metric
to hide metrics from appearing in the graph. This is useful for metrics you only have in the query to be used
in a pipeline metric.
![](/img/elasticsearch/pipeline_metrics_editor.png)
## Templating
The Elasticsearch datasource supports two types of queries you can use to fill template variables with values.
### Possible values for a field
```json
{"find": "terms", "field": "@hostname"}
```
### Fields filtered by type
```json
{"find": "fields", "type": "string"}
```
### Fields filtered by type, with filter
```json
{"find": "fields", "type": "string", "query": <lucene query>}
```
### Multi format / All format
Use lucene format.
## Annotations
TODO

View File

@@ -1,81 +0,0 @@
----
page_title: Graphite query guide
page_description: Graphite query guide
page_keywords: grafana, graphite, metrics, query, documentation
---
# Graphite
Grafana has an advanced Graphite query editor that lets you quickly navigate the metric space, add functions,
change function parameters and much more. The editor can handle all types of graphite queries. It can even handle complex nested
queries through the use of query references.
## Adding the data source
![](/img/v2/add_Graphite.jpg)
1. Open the side menu by clicking the the Grafana icon in the top header.
2. In the side menu under the `Dashboards` link you should find a link named `Data Sources`.
> NOTE: If this link is missing in the side menu it means that your current user does not have the `Admin` role for the current organization.
3. Click the `Add new` link in the top header.
4. Select `Graphite` from the dropdown.
Name | Description
------------ | -------------
Name | The data source name, important that this is the same as in Grafana v1.x if you plan to import old dashboards.
Default | Default data source means that it will be pre-selected for new panels.
Url | The http protocol, ip and port of your graphite-web or graphite-api install.
Access | Proxy = access via Grafana backend, Direct = access directly from browser.
Proxy access means that the Grafana backend will proxy all requests from the browser, and send them on to the Data Source. This is useful because it can eliminate CORS (Cross Origin Site Resource) issues, as well as eliminate the need to disseminate authentication details to the Data Source to the browser.
Direct access is still supported because in some cases it may be useful to access a Data Source directly depending on the use case and topology of Grafana, the user, and the Data Source.
## Metric editor
### Navigate metric segments
Click the ``Select metric`` link to start navigating the metric space. One you start you can continue using the mouse
or keyboard arrow keys. You can select a wildcard and still continue.
![](/img/animated_gifs/graphite_query1.gif)
### Functions
Click the plus icon to the right to add a function. You can search for the function or select it from the menu. Once
a function is selected it will be added and your focus will be in the text box of the first parameter. To later change
a parameter just click on it and it will turn into a text box. To delete a function click the function name followed
by the x icon.
![](/img/animated_gifs/graphite_query2.gif)
### Optional parameters
Some functions like aliasByNode support an optional second argument. To add this parameter specify for example 3,-2 as the first parameter and the function editor will adapt and move the -2 to a second parameter. To remove the second optional parameter just click on it and leave it blank and the editor will remove it.
![](/img/animated_gifs/func_editor_optional_params.gif)
## Point consolidation
All Graphite metrics are consolidated so that Graphite doesn't return more data points than there are pixels in the graph. By default
this consolidation is done using `avg` function. You can how Graphite consolidates metrics by adding the Graphite consolidateBy function.
> *Notice* This means that legend summary values (max, min, total) cannot be all correct at the same time. They are calculated
> client side by Grafana. And depending on your consolidation function only one or two can be correct at the same time.
## Templating
You can create a template variable in Grafana and have that variable filled with values from any Graphite metric exploration query.
You can then use this variable in your Graphite queries, either as part of a metric path or as arguments to functions.
For example a query like `prod.servers.*` will fill the variable with all possible
values that exists in the wildcard position.
You can also create nested variables that use other variables in their definition. For example
`apps.$app.servers.*` uses the variable `$app` in its query definition.
![](/img/v2/templated_variable_parameter.png)
## Query Reference
You can reference queries by the row “letter” that theyre on (similar to Microsoft Excel). If you add a second query to graph, you can reference the first query simply by typing in #A. This provides an easy and convenient way to build compounded queries.

View File

@@ -1,127 +0,0 @@
----
page_title: InfluxDB query guide
page_description: InfluxDB query guide
page_keywords: grafana, influxdb, metrics, query, documentation
---
# InfluxDB
Grafana ships with very a feature data source plugin for InfluxDB. Supporting a feature rich query editor, annotation and templating queries.
## Adding the data source
![](/img/v2/add_Influx.jpg)
1. Open the side menu by clicking the the Grafana icon in the top header.
2. In the side menu under the `Dashboards` link you should find a link named `Data Sources`.
> NOTE: If this link is missing in the side menu it means that your current user does not have the `Admin` role for the current organization.
3. Click the `Add new` link in the top header.
4. Select `InfluxDB 0.9.x` or `InfluxDB 0.8.x` from the dropdown.
Name | Description
------------ | -------------
Name | The data source name, important that this is the same as in Grafana v1.x if you plan to import old dashboards.
Default | Default data source means that it will be pre-selected for new panels.
Url | The http protocol, ip and port of you influxdb api (influxdb api port is by default 8086)
Access | Proxy = access via Grafana backend, Direct = access directly from browser.
Database | Name of your influxdb database
User | Name of your database user
Password | Database user's password
> Proxy access means that the Grafana backend will proxy all requests from the browser, and send them on to the Data Source. This is useful because it can eliminate CORS (Cross Origin Site Resource) issues, as well as eliminate the need to disseminate authentication details to the Data Source to the browser.
> Direct access is still supported because in some cases it may be useful to access a Data Source directly depending on the use case and topology of Grafana, the user, and the Data Source.
## Query Editor
![](/img/influxdb/editor_v3.png)
You find the InfluxDB editor in the metrics tab in Graph or Singlestat panel's edit mode. You enter edit mode by clicking the
panel title, then edit. The editor allows you to select metrics and tags.
### Filter data (WHERE)
To add a tag filter click the plus icon to the right of the `WHERE` condition. You can remove tag filters by clicking on
the tag key and select `--remove tag filter--`.
**Regex matching**
You can type in regex patterns for metric names or tag filter values, be sure to wrap the regex pattern in forward slashes (`/`). Grafana
will automatically adjust the filter tag condition to use the InfluxDB regex match condition operator (`=~`).
### Field & Aggregation functions
In the `SELECT` row you can specify what fields and functions you want to use. If you have a
group by time you need an aggregation function. Some functions like derivative require an aggregation function.
The editor tries simplify and unify this part of the query. For example:
![](/img/influxdb/select_editor.png)
The above will generate the following InfluxDB `SELECT` clause:
```sql
SELECT derivative(mean("value"), 10s) /10 AS "REQ/s" FROM ....
```
#### Select multiple fields
Use the plus button and select Field > field to add another SELECT clause. You can also
specify an asterix `*` to select all fields.
### Group By
To group by a tag click the plus icon at the end of the GROUP BY row. Pick a tag from the dropdown that appears.
You can remove the group by by clicking on the `tag` and then click on the x icon.
### Text Editor Mode (RAW)
You can switch to raw query mode by clicking hamburger icon and then `Switch editor mode`.
> If you use Raw Query be sure your query at minimum have `WHERE $timeFilter`
> Also please always have a group by time and an aggregation function, otherwise InfluxDB can easily return hundreds of thousands
> of data points that will hang the browser.
### Alias patterns
- $m = replaced with measurement name
- $measurement = replaced with measurement name
- $col = replaced with column name
- $tag_hostname = replaced with the value of the hostname tag
- You can also use [[tag_hostname]] pattern replacement syntax
### Table query / raw data
![](/img/influxdb/raw_data.png)
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.
## Templating
You can create a template variable in Grafana and have that variable filled with values from any InfluxDB metric exploration query.
You can then use this variable in your InfluxDB metric queries.
For example you can have a variable that contains all values for tag `hostname` if you specify a query like this
in the templating edit view.
```sql
SHOW TAG VALUES WITH KEY = "hostname"
```
You can also create nested variables. For example if you had another variable, for example `region`. Then you could have
the hosts variable only show hosts from the current selected region with a query like this:
```sql
SHOW TAG VALUES WITH KEY = "hostname" WHERE region =~ /$region/
```
> Always you `regex values` or `regex wildcard` for All format or multi select format.
![](/img/influxdb/templating_simple_ex1.png)
## Annotations
Annotations allows you to overlay rich event information on top of graphs.
An example query:
```SQL
SELECT title, description from events WHERE $timeFilter order asc
```

View File

@@ -1,52 +0,0 @@
---
page_title: KairosDB Guide
page_description: KairosDB guide for Grafana
page_keywords: grafana, kairosdb, documentation
---
# KairosDB Guide
Grafana v2.1 brings initial support for KairosDB Datasources. While the process of adding the datasource is similar to adding a Graphite or OpenTSDB datasource type, Kairos DB does have a few different options for building queries.
## Adding the data source to Grafana
![](/img/v2/add_KairosDB.jpg)
1. Open the side menu by clicking the the Grafana icon in the top header.
2. In the side menu under the `Dashboards` link you should find a link named `Data Sources`.
> NOTE: If this link is missing in the side menu it means that your current user does not have the `Admin` role for the current organization.
3. Click the `Add new` link in the top header.
4. Select `KairosDB` from the dropdown.
Name | Description
------------ | -------------
Name | The data source name, important that this is the same as in Grafana v1.x if you plan to import old dashboards.
Default | Default data source means that it will be pre-selected for new panels.
Url | The http protocol, ip and port of your kairosdb server (default port is usually 8080)
Access | Proxy = access via Grafana backend, Direct = access directly from browser.
## Query editor
Open a graph in edit mode by click the title.
![](/img/v2/kairos_query_editor.jpg)
For details on KairosDB metric queries checkout the official.
- [Query Metrics - KairosDB 0.9.4 documentation](http://kairosdb.github.io/kairosdocs/restapi/QueryMetrics.html).
## Templated queries
KairosDB Datasource Plugin provides following functions in `Variables values query` field in Templating Editor to query `metric names`, `tag names`, and `tag values` to kairosdb server.
Name | Description
| ------- | --------|
`metrics(query)` | Returns a list of metric names matching `query`. If nothing is given, returns a list of all metric names.
`tag_names(query)` | Returns a list of tag names matching `query`. If nothing is given, returns a list of all tag names.
`tag_values(metric,tag)` | Returns a list of values for `tag` from the given `metric`.
For details of `metric names`, `tag names`, and `tag values`, please refer to the KairosDB documentations.
- [List Metric Names - KairosDB 0.9.4 documentation](http://kairosdb.github.io/kairosdocs/restapi/ListMetricNames.html)
- [List Tag Names - KairosDB 0.9.4 documentation](http://kairosdb.github.io/kairosdocs/restapi/ListTagNames.html)
- [List Tag Values - KairosDB 0.9.4 documentation](http://kairosdb.github.io/kairosdocs/restapi/ListTagValues.html)
- [Query Metrics - KairosDB 0.9.4 documentation](http://kairosdb.github.io/kairosdocs/restapi/QueryMetrics.html).

View File

@@ -1,63 +0,0 @@
---
page_title: OpenTSDB Guide
page_description: OpenTSDB guide for Grafana
page_keywords: grafana, opentsdb, documentation
---
# OpenTSDB Guide
The newest release of Grafana adds additional functionality when using an OpenTSDB Data source.
![](/img/v2/add_OpenTSDB.png)
1. Open the side menu by clicking the the Grafana icon in the top header.
2. In the side menu under the `Dashboards` link you should find a link named `Data Sources`.
> NOTE: If this link is missing in the side menu it means that your current user does not have the `Admin` role for the current organization.
3. Click the `Add new` link in the top header.
4. Select `OpenTSDB` from the dropdown.
Name | Description
------------ | -------------
Name | The data source name, important that this is the same as in Grafana v1.x if you plan to import old dashboards.
Default | Default data source means that it will be pre-selected for new panels.
Url | The http protocol, ip and port of you opentsdb server (default port is usually 4242)
Access | Proxy = access via Grafana backend, Direct = access directly from browser.
Version | Version = opentsdb version, either <=2.1 or 2.2
Resolution | Metrics from opentsdb may have datapoints with either second or millisecond resolution.
## Query editor
Open a graph in edit mode by click the title. Query editor will differ if the datasource has version <=2.1 or = 2.2. In the former version, only tags can be used to query opentsdb. But in the latter version, filters as well as tags can be used to query opentsdb. Fill Policy is also introduced in opentsdb 2.2.
> Note: While using Opentsdb 2.2 datasource, make sure you use either Filters or Tags as they are mutually exclusive. If used together, might give you weird results.
![](/img/v2/opentsdb_query_editor.png)
### Auto complete suggestions
As soon as you start typing metric names, tag names and tag values , you should see highlighted auto complete suggestions for them.
> Note: This is required for the OpenTSDB `suggest` api to work.
## Templating queries
Grafana's OpenTSDB data source now supports template variable values queries. This means you can create template variables that fetch the values from OpenTSDB (for example metric names, tag names, or tag values). The query editor is also enhanced to limiting tags by metric.
When using OpenTSDB with a template variable of `query` type you can use following syntax for lookup.
metrics(prefix) // returns metric names with specific prefix (can be empty)
tag_names(cpu) // return tag names (i.e. keys) for a specific cpu metric
tag_values(cpu, hostname) // return tag values for metric cpu and tag key hostname
suggest_tagk(prefix) // return tag names (i.e. keys) for all metrics with specific prefix (can be empty)
suggest_tagv(prefix) // return tag values for all metrics with specific prefix (can be empty)
If you do not see template variables being populated in `Preview of values` section, you need to enable `tsd.core.meta.enable_realtime_ts` in the OpenTSDB server settings. Also, to populate metadata of the existing time series data in OpenTSDB, you need to run `tsdb uid metasync` on the OpenTSDB server.
### Nested Templating
One template variable can be used to filter tag values for another template varible. Very importantly, the order of the parameters matter in tag_values function. First parameter is the metric name, second parameter is the tag key for which you need to find tag values, and after that all other dependent template variables. Some examples are mentioned below to make nested template queries work successfully.
tag_values(cpu, hostname, env=$env) // return tag values for cpu metric, selected env tag value and tag key hostname
tag_values(cpu, hostanme, env=$env, region=$region) // return tag values for cpu metric, selected env tag value, selected region tag value and tag key hostname
> Note: This is required for the OpenTSDB `lookup` api to work.
For details on opentsdb metric queries checkout the official [OpenTSDB documentation](http://opentsdb.net/docs/build/html/index.html)

View File

@@ -1,25 +0,0 @@
----
page_title: Data Source Overview
page_description: Data Source Overview
page_keywords: grafana, graphite, influxDB, KairosDB, OpenTSDB, Prometheus, documentation
---
# Data Source Overview
Grafana supports many different storage backends for your time series data (Data Source). Each Data Source has a specific Query Editor that is customized for the features and capabilities that the particular Data Source exposes.
## Querying
The query language and capabilities of each Data Source are obviously very different. You can combine data from multiple Data Sources onto a single Dashboard, but each Panel is tied to a specific Data Source that belongs to a particular Organization.
## Supported Data Sources
The following datasources are officially supported:
* [Graphite](/datasources/graphite/)
* [Elasticsearch](/datasources/elasticsearch/)
* [CloudWatch](/datasources/cloudwatch/)
* [InfluxDB](/datasources/influxdb/)
* [OpenTSDB](/datasources/opentsdb/)
* [KairosDB](/datasources/kairosdb)
* [Prometheus](/datasources/prometheus)
Grafana can query any Elasticsearch index for annotation events, but at this time, it's not supported for metric queries. Learn more about [annotations](/reference/annotations/#elasticsearch-annotations)

View File

@@ -1,40 +0,0 @@
----
page_title: Data source Plugin API
page_description: Data Source Plugin Description
page_keywords: grafana, data source, plugin, api, docs
---
# Data source plugin API
All data sources in Grafana are implemented as plugins.
## Breaking change in 2.2
In Grafana 2.2 a breaking change was introduced for how data source query editors
are structured, defined and loaded. This was in order to support mixing multiple data sources
in the same panel.
In Grafana 2.2, the query editor is no longer defined using the partials section in
`plugin.json`, but defined via an angular directive named using convention naming
scheme like `metricQueryEditor<data source type name>`. For example
Graphite defines a directive like this:
```javascript
module.directive('metricQueryEditorGraphite', function() {
return {controller: 'GraphiteQueryCtrl', templateUrl: 'app/plugins/datasource/graphite/partials/query.editor.html'};
});
```
Even though the data source type name is with lowercase `g`, the directive uses capital `G` in `Graphite` because
that is how angular directives needs to be named in order to match an element with name `<metric-query-editor-graphite />`.
You also specify the query controller here instead of in the query.editor.html partial like before.
### query.editor.html
This partial needs to be updated, remove the `np-repeat` this is done in the outer partial now,m the query.editor.html
should only render a single query. Take a look at the Graphite or InfluxDB partials for `query.editor.html` for reference.
You should also add a `tight-form-item` with `{{target.refId}}`, all queries needs to be assigned a letter (`refId`).
These query reference letters are going to be utilized in a later feature.

View File

@@ -1,68 +0,0 @@
----
page_title: Prometheus query guide
page_description: Prometheus query guide
page_keywords: grafana, prometheus, metrics, query, documentation
---
# Prometheus
Grafana includes support for Prometheus Datasources. While the process of adding the datasource is similar to adding a Graphite or OpenTSDB datasource type, Prometheus does have a few different options for building queries.
## Adding the data source to Grafana
![](/img/v2/add_Prometheus.png)
1. Open the side menu by clicking the the Grafana icon in the top header.
2. In the side menu under the `Dashboards` link you should find a link named `Data Sources`.
> NOTE: If this link is missing in the side menu it means that your current user does not have the `Admin` role for the current organization.
3. Click the `Add new` link in the top header.
4. Select `Prometheus` from the dropdown.
Name | Description
------------ | -------------
Name | The data source name, important that this is the same as in Grafana v1.x if you plan to import old dashboards.
Default | Default data source means that it will be pre-selected for new panels.
Url | The http protocol, ip and port of you Prometheus server (default port is usually 9090)
Access | Proxy = access via Grafana backend, Direct = access directly from browser.
Basic Auth | Enable basic authentication to the Prometheus datasource.
User | Name of your Prometheus user
Password | Database user's password
> Proxy access means that the Grafana backend will proxy all requests from the browser, and send them on to the Data Source. This is useful because it can eliminate CORS (Cross Origin Site Resource) issues, as well as eliminate the need to disseminate authentication details to the Data Source to the browser.
> Direct access is still supported because in some cases it may be useful to access a Data Source directly depending on the use case and topology of Grafana, the user, and the Data Source.
## Query editor
Open a graph in edit mode by click the title.
![](/img/v2/prometheus_editor.png)
For details on Prometheus metric queries check out the Prometheus documentation
- [Query Metrics - Prometheus documentation](http://prometheus.io/docs/querying/basics/).
## Templated queries
Prometheus Datasource Plugin provides the following functions in `Variables values query` field in Templating Editor to query `metric names` and `labels names` on the Prometheus server.
Name | Description
------- | --------
`label_values(label)` | Returns a list of label values for the `label` in every metric.
`label_values(metric, label)` | Returns a list of label values for the `label` in the specified metric.
`metrics(metric)` | Returns a list of metrics matching the specified `metric` regex.
`query_result(query)` | Returns a list of Prometheus query result for the `query`.
For details of `metric names` & `label names`, and `label values`, please refer to the [Prometheus documentation](http://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
> Note: The part of queries is incompatible with the version before 2.6, if you specify like `foo.*`, please change like `metrics(foo.*)`.
You can create a template variable in Grafana and have that variable filled with values from any Prometheus metric exploration query.
You can then use this variable in your Prometheus metric queries.
For example you can have a variable that contains all values for label `hostname` if you specify a query like this
in the templating edit view.
```sql
label_values(hostname)
```
You can also use raw queries & regular expressions to extract anything you might need.
![](/img/v2/prometheus_templating.png)

View File

@@ -0,0 +1,8 @@
+++
title = "Dashboard Features"
type = "docs"
[menu.docs]
identifier = "dashboard_features"
parent = "features"
weight = 4
+++

View File

@@ -0,0 +1,126 @@
+++
title = "AWS CloudWatch"
description = "Guide for using CloudWatch in Grafana"
keywords = ["grafana", "cloudwatch", "guide"]
type = "docs"
aliases = ["/datasources/cloudwatch"]
[menu.docs]
name = "AWS Cloudwatch"
identifier = "cloudwatch"
parent = "datasources"
weight = 10
+++
# Using AWS CloudWatch in Grafana
Grafana ships with built in support for CloudWatch. You just have to add it as a data source and you will be ready to build dashboards for you CloudWatch metrics.
## Adding the data source to Grafana
1. Open the side menu by clicking the Grafana icon in the top header.
2. In the side menu under the `Dashboards` link you should find a link named `Data Sources`.
3. Click the `+ Add data source` button in the top header.
4. Select `Cloudwatch` from the *Type* dropdown.
> NOTE: If at any moment you have issues with getting this datasource to work and Grafana is giving you undescriptive errors then don't
forget to check your log file (try looking in /var/log/grafana/grafana.log).
Name | Description
------------ | -------------
*Name* | The data source name. This is how you refer to the data source in panels & queries.
*Default* | Default data source means that it will be pre-selected for new panels.
*Credentials* profile name | Specify the name of the profile to use (if you use `~/aws/credentials` file), leave blank for default.
*Default Region* | Used in query editor to set region (can be changed on per query basis)
*Custom Metrics namespace* | Specify the CloudWatch namespace of Custom metrics
*Assume Role Arn* | Specify the ARN of the role to assume
## Authentication
### IAM Roles
Currently all access to CloudWatch is done server side by the Grafana backend using the official AWS SDK. If you grafana
server is running on AWS you can use IAM Roles and authentication will be handled automatically.
Checkout AWS docs on [IAM Roles](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html)
### AWS credentials file
Create a file at `~/.aws/credentials`. That is the `HOME` path for user running grafana-server.
> NOTE: If you think you have the credentials file in the right place but it is still not working then you might try moving your .aws file to '/usr/share/grafana/' and make sure your credentials file has at most 0644 permissions.
Example content:
[default]
aws_access_key_id = asdsadasdasdasd
aws_secret_access_key = dasdasdsadasdasdasdsa
region = us-west-2
## Metric Query Editor
![](/img/docs/v43/cloudwatch_editor.png)
You need to specify a namespace, metric, at least one stat, and at least one dimension.
## Templated queries
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.
### Query variable
CloudWatch 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 with things like `region`, `namespaces`, `metric names`
and `dimension keys/values`.
Name | Description
------- | --------
*regions()* | Returns a list of regions AWS provides their service.
*namespaces()* | Returns a list of namespaces CloudWatch support.
*metrics(namespace, [region])* | Returns a list of metrics in the namespace. (specify region for custom metrics)
*dimension_keys(namespace)* | Returns a list of dimension keys in the namespace.
*dimension_values(region, namespace, metric, dimension_key)* | Returns a list of dimension values matching the specified `region`, `namespace`, `metric` and `dimension_key`.
*ebs_volume_ids(region, instance_id)* | Returns a list of volume id matching the specified `region`, `instance_id`.
*ec2_instance_attribute(region, attribute_name, filters)* | Returns a list of attribute matching the specified `region`, `attribute_name`, `filters`.
For details about the metrics CloudWatch provides, please refer to the [CloudWatch documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CW_Support_For_AWS.html).
#### Examples templated Queries
Example dimension queries which will return list of resources for individual AWS Services:
Query | Service
------- | -----
*dimension_values(us-east-1,AWS/ELB,RequestCount,LoadBalancerName)* | ELB
*dimension_values(us-east-1,AWS/ElastiCache,CPUUtilization,CacheClusterId)* | ElastiCache
*dimension_values(us-east-1,AWS/Redshift,CPUUtilization,ClusterIdentifier)* | RedShift
*dimension_values(us-east-1,AWS/RDS,CPUUtilization,DBInstanceIdentifier)* | RDS
*dimension_values(us-east-1,AWS/S3,BucketSizeBytes,BucketName)* | S3
#### ec2_instance_attribute JSON filters
The `ec2_instance_attribute` query take `filters` in JSON format.
You can specify [pre-defined filters of ec2:DescribeInstances](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html).
Filters syntax:
```javascript
{ filter_name1: [ filter_value1 ], filter_name2: [ filter_value2 ] }
```
Example `ec2_instance_attribute()` query
ec2_instance_attribute(us-east-1, InstanceId, { "tag:Environment": [ "production" ] })
## Cost
Amazon provides 1 million CloudWatch API requests each month at no additional charge. Past this,
it costs $0.01 per 1,000 GetMetricStatistics or ListMetrics requests. For each query Grafana will
issue a GetMetricStatistics request and every time you pick a dimension in the query editor
Grafana will issue a ListMetrics request.

View File

@@ -0,0 +1,138 @@
+++
title = "Using Elasticsearch in Grafana"
description = "Guide for using Elasticsearch in Grafana"
keywords = ["grafana", "elasticsearch", "guide"]
type = "docs"
aliases = ["/datasources/elasticsearch"]
[menu.docs]
name = "Elasticsearch"
parent = "datasources"
weight = 3
+++
# Using Elasticsearch in Grafana
Grafana ships with advanced support for Elasticsearch. You can do many types of simple or complex Elasticsearch queries to
visualize logs or metrics stored in Elasticsearch. You can also annotate your graphs with log events stored in Elasticsearch.
## Adding the data source
1. Open the side menu by clicking the Grafana icon in the top header.
2. In the side menu under the `Dashboards` link you should find a link named `Data Sources`.
3. Click the `+ Add data source` button in the top header.
4. Select *Elasticsearch* from the *Type* dropdown.
> NOTE: If you're not seeing the `Data Sources` link in your side menu it means that your current user does not have the `Admin` role for the current organization.
Name | Description
------------ | -------------
*Name* | The data source name. This is how you refer to the data source in panels & queries.
*Default* | Default data source means that it will be pre-selected for new panels.
*Url* | The HTTP protocol, IP, and port of your Elasticsearch server.
*Access* | Proxy = access via Grafana backend, Direct = access directly from browser.
Proxy access means that the Grafana backend will proxy all requests from the browser, and send them on to the Data Source. This is useful because it can eliminate CORS (Cross Origin Site Resource) issues, as well as eliminate the need to disseminate authentication to the browser.
### Direct access
If you select direct access you must update your Elasticsearch configuration to allow other domains to access
Elasticsearch from the browser. You do this by specifying these to options in your **elasticsearch.yml** config file.
http.cors.enabled: true
http.cors.allow-origin: "*"
### Index settings
![](/img/docs/elasticsearch/elasticsearch_ds_details.png)
Here you can specify a default for the `time field` and specify the name of your Elasticsearch index. You can use
a time pattern for the index name or a wildcard.
### Elasticsearch version
Be sure to specify your Elasticsearch version in the version selection dropdown. This is very important as there are differences how queries are composed. Currently only 2.x and 5.x
are supported.
## Metric Query editor
![](/img/docs/elasticsearch/query_editor.png)
The Elasticsearch query editor allows you to select multiple metrics and group by multiple terms or filters. Use the plus and minus icons to the right to add/remove
metrics or group by clauses. Some metrics and group by clauses haves options, click the option text to expand the row to view and edit metric or group by options.
## Series naming & alias patterns
You can control the name for time series via the `Alias` input field.
Pattern | Description
------------ | -------------
*{{term fieldname}}* | replaced with value of a term group by
*{{metric}}* | replaced with metric name (ex. Average, Min, Max)
*{{field}}* | replaced with the metric field name
## Pipeline metrics
Some metric aggregations are called Pipeline aggregations, for example, *Moving Average* and *Derivative*. Elasticsearch pipeline metrics require another metric to be based on. Use the eye icon next to the metric to hide metrics from appearing in the graph. This is useful for metrics you only have in the query for use in a pipeline metric.
![](/img/docs/elasticsearch/pipeline_metrics_editor.png)
## Templating
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.
### Query variable
The Elasticsearch data source supports two types of queries you can use in the *Query* field of *Query* variables. The query is written using a custom JSON string.
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", "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.
You can use other variables inside the query. Example query definition for a variable named `$host`.
```
{"find": "terms", "field": "@hostname", "query": "@source:$source"}
```
In the above example, we use another variable named `$source` inside the query definition. Whenever you change, via the dropdown, the current value of the ` $source` variable, it will trigger an update of the `$host` variable so it now only contains hostnames filtered by in this case the
`@source` document property.
### Using variables in queries
There are two syntaxes:
- `$<varname>` Example: @hostname:$hostname
- `[[varname]]` Example: @hostname:[[hostname]]
Why two ways? The first syntax is easier to read and write but does not allow you to use a variable in the middle of a word. When the *Multi-value* or *Include all value*
options are enabled, Grafana converts the labels from plain text to a lucene compatible condition.
![](/img/docs/v43/elastic_templating_query.png)
In the above example, we have a lucene query that filters documents based on the `@hostname` property using a variable named `$hostname`. It is also using
a variable in the *Terms* group by field input box. This allows you to use a variable to quickly change how the data is grouped.
Example dashboard:
[Elasticsearch Templated Dashboard](http://play.grafana.org/dashboard/db/elasticsearch-templated)
## Annotations
[Annotations]({{< relref "reference/annotations.md" >}}) allows you to overlay rich event information on top of graphs. You add annotation
queries via the Dashboard menu / Annotations view. Grafana can query any Elasticsearch index
for annotation events.
Name | Description
------------ | -------------
Query | You can leave the search query blank or specify a lucene query
Time | The name of the time field, needs to be date field.
Title | The name of the field to use for the event title.
Tags | Optional field name to use for event tags (can be an array or a CSV string).
Text | Optional field name to use event text body.

View File

@@ -0,0 +1,112 @@
+++
title = "Using Graphite in Grafana"
description = "Guide for using graphite in Grafana"
keywords = ["grafana", "graphite", "guide"]
type = "docs"
aliases = ["/datasources/graphite"]
[menu.docs]
name = "Graphite"
identifier = "graphite"
parent = "datasources"
weight = 1
+++
# Using Graphite in Grafana
Grafana has an advanced Graphite query editor that lets you quickly navigate the metric space, add functions,
change function parameters and much more. The editor can handle all types of graphite queries. It can even handle complex nested
queries through the use of query references.
## Adding the data source
1. Open the side menu by clicking the Grafana icon in the top header.
2. In the side menu under the `Dashboards` link you should find a link named `Data Sources`.
3. Click the `+ Add data source` button in the top header.
4. Select `Graphite` from the *Type* dropdown.
> NOTE: If you're not seeing the `Data Sources` link in your side menu it means that your current user does not have the `Admin` role for the current organization.
Name | Description
------------ | -------------
*Name* | The data source name. This is how you refer to the data source in panels & queries.
*Default* | Default data source means that it will be pre-selected for new panels.
*Url* | The HTTP protocol, IP, and port of your graphite-web or graphite-api install.
*Access* | Proxy = access via Grafana backend, Direct = access directly from browser.
Proxy access means that the Grafana backend will proxy all requests from the browser, and send them on to the Data Source. This is useful because it can eliminate CORS (Cross Origin Site Resource) issues, as well as eliminate the need to disseminate authentication details to the browser.
## Metric editor
### Navigate metric segments
Click the ``Select metric`` link to start navigating the metric space. One you start you can continue using the mouse
or keyboard arrow keys. You can select a wildcard and still continue.
![](/img/docs/animated_gifs/graphite_query1.gif)
### Functions
Click the plus icon to the right to add a function. You can search for the function or select it from the menu. Once
a function is selected it will be added and your focus will be in the text box of the first parameter. To later change
a parameter just click on it and it will turn into a text box. To delete a function click the function name followed
by the x icon.
![](/img/docs/animated_gifs/graphite_query2.gif)
### Optional parameters
Some functions like aliasByNode support an optional second argument. To add this parameter specify for example 3,-2 as the first parameter and the function editor will adapt and move the -2 to a second parameter. To remove the second optional parameter just click on it and leave it blank and the editor will remove it.
![](/img/docs/animated_gifs/func_editor_optional_params.gif)
### Nested Queries
You can reference queries by the row “letter” that theyre on (similar to Microsoft Excel). If you add a second query to a graph, you can reference the first query simply by typing in #A. This provides an easy and convenient way to build compounded queries.
## Point consolidation
All Graphite metrics are consolidated so that Graphite doesn't return more data points than there are pixels in the graph. By default,
this consolidation is done using `avg` function. You can how Graphite consolidates metrics by adding the Graphite consolidateBy function.
> *Notice* This means that legend summary values (max, min, total) cannot be all correct at the same time. They are calculated
> client side by Grafana. And depending on your consolidation function only one or two can be correct at the same time.
## Templating
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.
### Query variable
The query you specify in the query field should be a metric find type of query. For example, a query like `prod.servers.*` will fill the
variable with all possible values that exist in the wildcard position.
You can also create nested variables that use other variables in their definition. For example
`apps.$app.servers.*` uses the variable `$app` in its query definition.
### Variable usage
You can use a variable in a metric node path or as a parameter to a function.
![](/img/docs/v2/templated_variable_parameter.png)
There are two syntaxes:
- `$<varname>` Example: apps.frontend.$server.requests.count
- `[[varname]]` Example: apps.frontend.[[server]].requests.count
Why two ways? The first syntax is easier to read and write but does not allow you to use a variable in the middle of a word. Use
the second syntax in expressions like `my.server[[serverNumber]].count`.
Example:
[Graphite Templated Dashboard](http://play.grafana.org/dashboard/db/graphite-templated-nested)
## Annotations
[Annotations]({{< relref "reference/annotations.md" >}}) allows you to overlay rich event information on top of graphs. You add annotation
queries via the Dashboard menu / Annotations view.
Graphite supports two ways to query annotations. A regular metric query, for this you use the `Graphite query` textbox. A Graphite events query, use the `Graphite event tags` textbox,
specify a tag or wildcard (leave empty should also work)

View File

@@ -0,0 +1,34 @@
+++
title = "Data Sources"
type = "docs"
[menu.docs]
name = "Data Sources"
identifier = "datasources"
parent = "features"
weight = 5
+++
# Data Source Overview
Grafana supports many different storage backends for your time series data (Data Source). Each Data Source has a specific Query Editor that is customized for the features and capabilities that the particular Data Source exposes.
## Querying
The query language and capabilities of each Data Source are obviously very different. You can combine data from multiple Data Sources onto a single Dashboard, but each Panel is tied to a specific Data Source that belongs to a particular Organization.
## Supported Data Sources
The following datasources are officially supported:
* [Graphite]({{< relref "graphite.md" >}})
* [Elasticsearch]({{< relref "elasticsearch.md" >}})
* [CloudWatch]({{< relref "cloudwatch.md" >}})
* [InfluxDB]({{< relref "influxdb.md" >}})
* [OpenTSDB]({{< relref "opentsdb.md" >}})
* [Prometheus]({{< relref "prometheus.md" >}})
## Data source plugins
Since grafana 3.0 you can install data sources as plugins. Checkout [Grafana.net](https://grafana.com/plugins) for more data sources.

View File

@@ -0,0 +1,180 @@
+++
title = "Using InfluxDB in Grafana"
description = "Guide for using InfluxDB in Grafana"
keywords = ["grafana", "influxdb", "guide"]
type = "docs"
aliases = ["/datasources/influxdb"]
[menu.docs]
name = "InfluxDB"
parent = "datasources"
weight = 3
+++
# Using InfluxDB in Grafana
Grafana ships with very feature rich data source plugin for InfluxDB. Supporting a feature rich query editor, annotation and templating queries.
## Adding the data source
1. Open the side menu by clicking the Grafana icon in the top header.
2. In the side menu under the `Dashboards` link you should find a link named `Data Sources`.
3. Click the `+ Add data source` button in the top header.
4. Select *InfluxDB* from the *Type* dropdown.
> NOTE: If you're not seeing the `Data Sources` link in your side menu it means that your current user does not have the `Admin` role for the current organization.
Name | Description
------------ | -------------
*Name* | The data source name. This is how you refer to the data source in panels & queries.
*Default* | Default data source means that it will be pre-selected for new panels.
*Url* | The http protocol, ip and port of you influxdb api (influxdb api port is by default 8086)
*Access* | Proxy = access via Grafana backend, Direct = access directly from browser.
*Database* | Name of your influxdb database
*User* | Name of your database user
*Password* | Database user's password
### Proxy vs Direct access
Proxy access means that the Grafana backend will proxy all requests from the browser. So requests to InfluxDB will be channeled through
`grafana-server`. This means that the URL you specify needs to be accessable from the server you are running Grafana on. Proxy access
mode is also more secure as the username & password will never reach the browser.
## Query Editor
![](/assets/img/blog/v2.6/influxdb_editor_v3.gif)
You find the InfluxDB editor in the metrics tab in Graph or Singlestat panel's edit mode. You enter edit mode by clicking the
panel title, then edit. The editor allows you to select metrics and tags.
### Filter data (WHERE)
To add a tag filter click the plus icon to the right of the `WHERE` condition. You can remove tag filters by clicking on
the tag key and select `--remove tag filter--`.
**Regex matching**
You can type in regex patterns for metric names or tag filter values, be sure to wrap the regex pattern in forward slashes (`/`). Grafana
will automatically adjust the filter tag condition to use the InfluxDB regex match condition operator (`=~`).
### Field & Aggregation functions
In the `SELECT` row you can specify what fields and functions you want to use. If you have a
group by time you need an aggregation function. Some functions like derivative require an aggregation function.
The editor tries simplify and unify this part of the query. For example:
![](/img/docs/influxdb/select_editor.png)
The above will generate the following InfluxDB `SELECT` clause:
```sql
SELECT derivative(mean("value"), 10s) /10 AS "REQ/s" FROM ....
```
#### Select multiple fields
Use the plus button and select Field > field to add another SELECT clause. You can also
specify an asterix `*` to select all fields.
### Group By
To group by a tag click the plus icon at the end of the GROUP BY row. Pick a tag from the dropdown that appears.
You can remove the group by by clicking on the `tag` and then click on the x icon.
### Text Editor Mode (RAW)
You can switch to raw query mode by clicking hamburger icon and then `Switch editor mode`.
> If you use Raw Query be sure your query at minimum have `WHERE $timeFilter`
> Also please always have a group by time and an aggregation function, otherwise InfluxDB can easily return hundreds of thousands
> of data points that will hang the browser.
### Alias patterns
- $m = replaced with measurement name
- $measurement = replaced with measurement name
- $col = replaced with column name
- $tag_hostname = replaced with the value of the hostname tag
- You can also use [[tag_hostname]] pattern replacement syntax
### Table query / raw data
![](/assets/img/blog/v2.6/table_influxdb_logs.png)
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.
## Templating
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.
### Query variable
If you add a template variable of the type `Query` you can write a InfluxDB exploration (meta data) query. These queries can
return things like measurement names, key names or key values.
For example you can have a variable that contains all values for tag `hostname` if you specify a query like this in the templating variable *Query* setting.
```sql
SHOW TAG VALUES WITH KEY = "hostname"
```
You can also create nested variables. For example if you had another variable, for example `region`. Then you could have
the hosts variable only show hosts from the current selected region with a query like this:
```sql
SHOW TAG VALUES WITH KEY = "hostname" WHERE region =~ /$region/
```
You can fetch key names for a given measurement.
```sql
SHOW TAG KEYS [FROM <measurement_name>]
```
If you have a variable with key names you can use this variable in a group by clause. This will allow you to change group by using the variable dropdown a the top
of the dashboard.
### Using variables in queries
There are two syntaxes:
`$<varname>` Example:
```sql
SELECT mean("value") FROM "logins" WHERE "hostname" =~ /^$host$/ AND $timeFilter GROUP BY time($__interval), "hostname"
```
`[[varname]]` Example:
```sql
SELECT mean("value") FROM "logins" WHERE "hostname" =~ /^[[host]]$/ AND $timeFilter GROUP BY time($__interval), "hostname"
```
Why two ways? The first syntax is easier to read and write but does not allow you to use a variable in the middle of a word. When the *Multi-value* or *Include all value*
options are enabled, Grafana converts the labels from plain text to a regex compatible string. Which means you have to use `=~` instead of `=`.
Example Dashboard:
[InfluxDB Templated Dashboard](http://play.grafana.org/dashboard/db/influxdb-templated-queries)
### Ad hoc filters variable
InfluxDB supports the special `Ad hoc filters` variable type. This variable allows you to specify any number of key/value filters on the fly. These filters will automatically
be applied to all your InfluxDB queries.
## Annotations
[Annotations]({{< relref "reference/annotations.md" >}}) allows you to overlay rich event information on top of graphs. You add annotation
queries via the Dashboard menu / Annotations view.
An example query:
```SQL
SELECT title, description from events WHERE $timeFilter order asc
```
For InfluxDB you need to enter a query like in the above example. You need to have the ```where $timeFilter```
part. If you only select one column you will not need to enter anything in the column mapping fields. The
Tags field can be a comma seperated string.

View File

@@ -0,0 +1,118 @@
+++
title = "Using MySQL in Grafana"
description = "Guide for using MySQL in Grafana"
keywords = ["grafana", "mysql", "guide"]
type = "docs"
[menu.docs]
name = "MySQL"
parent = "datasources"
weight = 7
+++
# Using MySQL in Grafana
> Only available in Grafana v4.3+. This data source is not ready for
> production use, currently in development (alpha state).
Grafana ships with a built-in MySQL data source plugin that allow you to query any visualize
data from a MySQL compatible database.
## Adding the data source
1. Open the side menu by clicking the Grafana icon in the top header.
2. In the side menu under the `Dashboards` link you should find a link named `Data Sources`.
3. Click the `+ Add data source` button in the top header.
4. Select *MySQL* from the *Type* dropdown.
### Database User Permissions (Important!)
The database user you specify when you add the data source should only be granted SELECT permissions on
the specified database & tables you want to query. Grafana does not validate that the query is safe. The query
could include any SQL statement. For example, statements like `USE otherdb;` and `DROP TABLE user;` would be
executed. To protect against this we **Highly** recommmend you create a specific mysql user with
restricted permissions.
Example:
```sql
CREATE USER 'grafanaReader' IDENTIFIED BY 'password';
GRANT SELECT ON mydatabase.mytable TO 'grafanaReader';
```
You can use wildcards (`*`) in place of database or table if you want to grant access to more databases and tables.
## Macros
To simplify syntax and to allow for dynamic parts, like date range filters, the query can contain macros.
Macro example | Description
------------ | -------------
*$__timeFilter(dateColumn)* | Will be replaced by a time range filter using the specified column name. For example, *dateColumn > FROM_UNIXTIME(1494410783) AND dateColumn < FROM_UNIXTIME(1494497183)*
We plan to add many more macros. If you have suggestions for what macros you would like to see, please
[open an issue](https://github.com/grafana/grafana) in our GitHub repo.
The query editor has a link named `Generated SQL` that show up after a query as been executed, while in panel edit mode. Click
on it and it will expand and show the raw interpolated SQL string that was executed.
## Table queries
If the `Format as` query option is set to `Table` then you can basically do any type of SQL query. The table panel will automatically show the results of whatever columns & rows your query returns.
Query editor with example query:
![](/img/docs/v43/mysql_table_query.png)
The query:
```sql
SELECT
title as 'Title',
user.login as 'Created By' ,
dashboard.created as 'Created On'
FROM dashboard
INNER JOIN user on user.id = dashboard.created_by
WHERE $__timeFilter(dashboard.created)
```
You can control the name of the Table panel columns by using regular `as ` SQL column selection syntax.
The resulting table panel:
![](/img/docs/v43/mysql_table.png)
### Time series queries
If you set `Format as` to `Time series`, for use in Graph panel for example, then there are some requirements for
what your query returns.
- Must be a column named `time_sec` representing a unix epoch in seconds.
- Must be a column named `value` representing the time series value.
- Must be a column named `metric` representing the time series name.
Example:
```sql
SELECT
min(UNIX_TIMESTAMP(time_date_time)) as time_sec,
max(value_double) as value,
metric1 as metric
FROM test_data
WHERE $__timeFilter(time_date_time)
GROUP BY metric1, UNIX_TIMESTAMP(time_date_time) DIV 300
ORDER BY time_sec asc
```
Currently, there is no support for a dynamic group by time based on time range & panel width.
This is something we plan to add.
## Templating
You can use variables in your queries but there are currently no support for defining `Query` variables
that target a MySQL data source.
## Alerting
Time series queries should work in alerting conditions. Table formatted queries is not yet supported in alert rule
conditions.

View File

@@ -0,0 +1,90 @@
+++
title = "Using OpenTSDB in Grafana"
description = "Guide for using OpenTSDB in Grafana"
keywords = ["grafana", "opentsdb", "guide"]
type = "docs"
aliases = ["/datasources/opentsdb", "docs/features/opentsdb"]
[menu.docs]
name = "OpenTSDB"
parent = "datasources"
weight = 5
+++
# Using OpenTSDB in Grafana
Grafana ships with advanced support for OpenTSDB.
## Adding the data source
1. Open the side menu by clicking the Grafana icon in the top header.
2. In the side menu under the `Dashboards` link you should find a link named `Data Sources`.
3. Click the `+ Add data source` button in the top header.
4. Select *OpenTSDB* from the *Type* dropdown.
> NOTE: If you're not seeing the `Data Sources` link in your side menu it means that your current user does not have the `Admin` role for the current organization.
Name | Description
------------ | -------------
*Name* | The data source name. This is how you refer to the data source in panels & queries.
*Default* | Default data source means that it will be pre-selected for new panels.
*Url* | The http protocol, ip and port of you opentsdb server (default port is usually 4242)
*Access* | Proxy = access via Grafana backend, Direct = access directly from browser.
*Version* | Version = opentsdb version, either <=2.1 or 2.2
*Resolution* | Metrics from opentsdb may have datapoints with either second or millisecond resolution.
## Query editor
Open a graph in edit mode by click the title. Query editor will differ if the datasource has version <=2.1 or = 2.2.
In the former version, only tags can be used to query OpenTSDB. But in the latter version, filters as well as tags
can be used to query opentsdb. Fill Policy is also introduced in OpenTSDB 2.2.
![](/img/docs/v43/opentsdb_query_editor.png)
> Note: While using OpenTSDB 2.2 datasource, make sure you use either Filters or Tags as they are mutually exclusive. If used together, might give you weird results.
### Auto complete suggestions
As soon as you start typing metric names, tag names and tag values , you should see highlighted auto complete suggestions for them.
The autocomplete only works if the OpenTSDB suggest api is enabled.
## Templating queries
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.
### Query variable
Grafana's OpenTSDB data source supports template variable queries. This means you can create template variables
that fetch the values from OpenTSDB. For example, metric names, tag names, or tag values.
When using OpenTSDB with a template variable of `query` type you can use following syntax for lookup.
Query | Description
------------ | -------------
*metrics(prefix)* | Returns metric names with specific prefix (can be empty)
*tag_names(cpu)* | Return tag names (i.e. keys) for a specific cpu metric
*tag_values(cpu, hostname)* | Return tag values for metric cpu and tag key hostname
*suggest_tagk(prefix)* | Return tag names (i.e. keys) for all metrics with specific prefix (can be empty)
*suggest_tagv(prefix)* | Return tag values for all metrics with specific prefix (can be empty)
If you do not see template variables being populated in `Preview of values` section, you need to enable
`tsd.core.meta.enable_realtime_ts` in the OpenTSDB server settings. Also, to populate metadata of
the existing time series data in OpenTSDB, you need to run `tsdb uid metasync` on the OpenTSDB server.
### Nested Templating
One template variable can be used to filter tag values for another template varible. First parameter is the metric name,
second parameter is the tag key for which you need to find tag values, and after that all other dependent template variables.
Some examples are mentioned below to make nested template queries work successfully.
Query | Description
------------ | -------------
*tag_values(cpu, hostname, env=$env)* | Return tag values for cpu metric, selected env tag value and tag key hostname
*tag_values(cpu, hostanme, env=$env, region=$region)* | Return tag values for cpu metric, selected env tag value, selected region tag value and tag key hostname
For details on OpenTSDB metric queries checkout the official [OpenTSDB documentation](http://opentsdb.net/docs/build/html/index.html)

View File

@@ -0,0 +1,95 @@
+++
title = "Using Prometheus in Grafana"
description = "Guide for using Prometheus in Grafana"
keywords = ["grafana", "prometheus", "guide"]
type = "docs"
aliases = ["/datasources/prometheus"]
[menu.docs]
name = "Prometheus"
parent = "datasources"
weight = 2
+++
# Using Prometheus in Grafana
Grafana includes built-in support for Prometheus.
## Adding the data source to Grafana
1. Open the side menu by clicking the Grafana icon in the top header.
2. In the side menu under the `Dashboards` link you should find a link named `Data Sources`.
3. Click the `+ Add data source` button in the top header.
4. Select `Prometheus` from the *Type* dropdown.
> NOTE: If you're not seeing the `Data Sources` link in your side menu it means that your current user does not have the `Admin` role for the current organization.
## Data source options
Name | Description
------------ | -------------
*Name* | The data source name. This is how you refer to the data source in panels & queries.
*Default* | Default data source means that it will be pre-selected for new panels.
*Url* | The http protocol, ip and port of you Prometheus server (default port is usually 9090)
*Access* | Proxy = access via Grafana backend, Direct = access directly from browser.
*Basic Auth* | Enable basic authentication to the Prometheus data source.
*User* | Name of your Prometheus user
*Password* | Database user's password
## Query editor
Open a graph in edit mode by click the title > Edit (or by pressing `e` key while hovering over panel).
![](/img/docs/v43/prometheus_query_editor.png)
Name | Description
------- | --------
*Query expression* | Prometheus query expression, check out the [Prometheus documentation](http://prometheus.io/docs/querying/basics/).
*Legend format* | Controls the name of the time series, using name or pattern. For example `{{hostname}}` will be replaced with label value for the label `hostname`.
*Min step* | Set a lower limit for the Prometheus step option. Step controls how big the jumps are when the Prometheus query engine performs range queries. Sadly there is no official prometheus documentation to link to for this very important option.
*Resolution* | Controls the step option. Small steps create high-resolution graphs but can be slow over larger time ranges, lowering the resolution can speed things up. `1/2` will try to set step option to generate 1 data point for every other pixel. A value of `1/10` will try to set step option so there is a data point every 10 pixels.*Metric lookup* | Search for metric names in this input field.
*Format as* | **(New in v4.3)** Switch between Table & Time series. Table format will only work in the Table panel.
## Templating
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.
### Query variable
Variable of the type *Query* allows you to query Prometheus for a list of metrics, labels or label values. The Prometheus data source plugin
provides the following functions you can use in the `Query` input field.
Name | Description
---- | --------
*label_values(label)* | Returns a list of label values for the `label` in every metric.
*label_values(metric, label)* | Returns a list of label values for the `label` in the specified metric.
*metrics(metric)* | Returns a list of metrics matching the specified `metric` regex.
*query_result(query)* | Returns a list of Prometheus query result for the `query`.
For details of *metric names*, *label names* and *label values* are please refer to the [Prometheus documentation](http://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
### Using variables in queries
There are two syntaxes:
- `$<varname>` Example: rate(http_requests_total{job=~"$job"}[5m])
- `[[varname]]` Example: rate(http_requests_total{job="my[[job]]"}[5m])
Why two ways? The first syntax is easier to read and write but does not allow you to use a variable in the middle of a word. When the *Multi-value* or *Include all value*
options are enabled, Grafana converts the labels from plain text to a regex compatible string. Which means you have to use `=~` instead of `=`.
## Annotations
[Annotations]({{< relref "reference/annotations.md" >}}) allows you to overlay rich event information on top of graphs. You add annotation
queries via the Dashboard menu / Annotations view.
Prometheus supports two ways to query annotations.
- A regular metric query
- A Prometheus query for pending and firing alerts (for details see [Inspecting alerts during runtime](https://prometheus.io/docs/alerting/rules/#inspecting-alerts-during-runtime))
The step option is useful to limit the number of events returned from your query.

View File

@@ -0,0 +1,47 @@
+++
title = "TestData"
keywords = ["grafana", "dashboard", "documentation", "panels", "testdata"]
type = "docs"
[menu.docs]
name = "TestData"
parent = "datasources"
weight = 20
+++
# Grafana TestData
The purpose of this data sources is to make it easier to create fake data for any panel.
Using `Grafana TestData` you can build your own time series and have any panel render it.
This make is much easier to verify functionally since the data can be shared very
## Enable
`Grafana TestData` is not enabled by default. To enable it you have to go to `/plugins/testdata/edit` and click the enable button to enable.
## Create mock data.
Once `Grafana TestData` is enabled you can use it as a data source in any metric panel.
![](/img/docs/v41/test_data_add.png)
## CSV
The comma separated values scenario is the most powerful one since it lets you create any kind of graph you like.
Once you provided the numbers `Grafana TestData` will distribute them evenly based on the time range of your query.
![](/img/docs/v41/test_data_csv_example.png)
## Dashboards
`Grafana TestData` also contains some dashboards with example. `/plugins/testdata/edit`
### Commit updates to the dashboards
If you want to submit a change to one of the current dashboards bundled with `Grafana TestData` you have to update the revision property.
Otherwise the dashboard will not be updated automatically for other Grafana users.
## Using test data in issues
If you post an issue on github regarding time series data or rendering of time series data we strongly advice you to use this data source to replicate the data.
That makes it much easier for the developers to replicate and solve the issue you have.

View File

@@ -0,0 +1,11 @@
+++
title = "Beginner Guides"
description = "Beginner guides"
type = "docs"
[menu.docs]
name = "Features"
identifier = "features"
weight = 3
+++

View File

@@ -1,29 +1,33 @@
----
page_title: Dashlist Panel
page_description: Dashlist Panel Reference
page_keywords: grafana, dashlist, panel, documentation
---
+++
title = "Dashboard List"
keywords = ["grafana", "dashboard list", "documentation", "panel", "dashlist"]
type = "docs"
aliases = ["/reference/dashlist/"]
[menu.docs]
name = "Dashboard list"
parent = "panels"
weight = 4
+++
# Dashlist Panel
## Overview
# Dashboard List Panel
The dashboard list panel allows you to display dynamic links to other dashboards. The list can be configured to use starred dashboards, a search query and/or dashboard tags.
The dashboard list panel allows you to display dynamic links to other dashboards. The list can be configured to use starred dashboards, a search query and/or dashboard tags.
<img class="no-shadow" src="/img/v2/dashboard_list_panels.png">
<img class="no-shadow" src="/img/docs/v2/dashboard_list_panels.png">
> On each dashboard load, the dashlist panel will re-query the dashboard list, always providing the most up to date results.
## Mode: Starred Dashboards
The `starred` dashboard selection displays starred dashboards, up to the number specified in the `Limit Number to` field, in alphabetical order. On dashboard load, the dashlist panel will re-query the favorites to appear in dashboard list panel, always providing the most up to date results.
The `starred` dashboard selection displays starred dashboards, up to the number specified in the `Limit Number to` field, in alphabetical order. On dashboard load, the dashlist panel will re-query the favorites to appear in dashboard list panel, always providing the most up to date results.
<img class="no-shadow" src="/img/v2/dashboard_list_config_starred.png">
<img class="no-shadow" src="/img/docs/v2/dashboard_list_config_starred.png">
## Mode: Search Dashboards
The panel may be configured to search by either string query or tag(s). On dashboard load, the dashlist panel will re-query the dashboard list, always providing the most up to date results.
The panel may be configured to search by either string query or tag(s). On dashboard load, the dashlist panel will re-query the dashboard list, always providing the most up to date results.
To configure dashboard list in this manner, select `search` from the Mode select box. When selected, the Search Options section will appear.
@@ -38,14 +42,14 @@ Limit number to | Specify the maximum number of dashboards
### Search by string
To search by a string, enter a search query in the `Search Options: Query` field. Queries are case-insensitive, and partial values are accepted.
<img class="no-shadow" src="/img/v2/dashboard_list_config_string.png">
To search by a string, enter a search query in the `Search Options: Query` field. Queries are case-insensitive, and partial values are accepted.
<img class="no-shadow" src="/img/docs/v2/dashboard_list_config_string.png">
### Search by tag
To search by one or more tags, enter your selection in the `Search Options: Tags:` field. Note that existing tags will not appear as you type, and *are* case sensitive. To see a list of existing tags, you can always return to the dashboard, open the Dashboard Picker at the top and click `tags` link in the search bar.
<img class="no-shadow" src="/img/v2/dashboard_list_config_tags.png">
To search by one or more tags, enter your selection in the `Search Options: Tags:` field. Note that existing tags will not appear as you type, and *are* case sensitive. To see a list of existing tags, you can always return to the dashboard, open the Dashboard Picker at the top and click `tags` link in the search bar.
<img class="no-shadow" src="/img/docs/v2/dashboard_list_config_tags.png">
> When multiple tags and strings appear, the dashboard list will display those matching ALL conditions.
> When multiple tags and strings appear, the dashboard list will display those matching ALL conditions.

View File

@@ -1,20 +1,26 @@
----
page_title: Graph Panel
page_description: Graph Panel Reference
page_keywords: grafana, graph, panel, documentation
---
+++
title = "Graph Panel"
keywords = ["grafana", "graph panel", "documentation", "guide", "graph"]
type = "docs"
aliases = ["/reference/graph/"]
[menu.docs]
name = "Graph"
parent = "panels"
weight = 1
+++
# Graph Panel
The main panel in Grafana is simply named Graph. It provides a very rich set of graphing options.
<img src="/img/v1/graph_overview.png" class="no-shadow">
<img src="/img/docs/v1/graph_overview.png" class="no-shadow">
Clicking the title for a panel exposes a menu. The `edit` option opens additional configuration
options for the panel.
## General
![](/img/v2/graph_general.png)
![](/img/docs/v43/graph_general.png)
The general tab allows customization of a panel's appearance and menu options.
@@ -27,14 +33,14 @@ The general tab allows customization of a panel's appearance and menu options.
### Drilldown / detail link
The drilldown section allows adding dynamic links to the panel that can link to other dashboards
or URLs
or URLs.
Each link has a title, a type and params. A link can be either a ``dashboard`` or ``absolute`` links.
If it is a dashboard links, the `dashboard` value must be the name of a dashboard. If it's an
`absolute` link, the URL is the URL to link.
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.
``params`` allows adding additional URL params to the links. The format is the ``name=value`` with
multiple params separate by ``&``. Template variables can be added as values using ``$myvar``.
multiple params separated by ``&``. Template variables can be added as values using ``$myvar``.
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.
@@ -44,15 +50,9 @@ populate the template variable to a desired value from the link.
The metrics tab defines what series data and sources to render. Each datasource provides different
options.
### Graphite
### InfluxDB
### OpenTSDB
## Axes & Grid
![](/img/v2/graph_axes_grid_options.png)
![](/img/docs/v43/graph_axes_grid_options.png)
The Axes & Grid tab controls the display of axes, grids and legend.
@@ -67,9 +67,6 @@ The ``Left Y`` and ``Right Y`` can be customized using:
Axes can also be hidden by unchecking the appropriate box from `Show Axis`.
Thresholds allow you to add arbitrary lines or sections to the graph to make it easier to see when
the graph crosses a particular threshold.
### Legend
The legend hand be hidden by checking the ``Show`` checkbox. If it's shown, it can be
@@ -79,7 +76,6 @@ values can be hidden from the legend using the ``Hide empty`` checkbox.
### Legend Values
Additional values can be shown along-side the legend names:
- ``Total`` - Sum of all values returned from metric query
- ``Current`` - Last value returned from the metric query
- ``Min`` - Minimum of all values returned from metric query
@@ -88,16 +84,22 @@ Additional values can be shown along-side the legend names:
- ``Decimals`` - Controls how many decimals are displayed for legend values (and graph hover tooltips)
The legend values are calculated client side by Grafana and depend on what type of
aggregation or point consolidation you metric query is using. All the above legend values cannot
aggregation or point consolidation your metric query is using. All the above legend values cannot
be correct at the same time. For example if you plot a rate like requests/second, this is probably
using average as aggregator, then the Total in the legend will not represent the total number of requests.
It is just the sum of all data data points received by Grafana.
It is just the sum of all data points received by Grafana.
## Display styles
![](/img/v2/graph_display_styles.png)
![](/img/docs/v43/graph_display_styles.png)
Display styles control visual properties of the graph.
### Thresholds
Thresholds allow you to add arbitrary lines or sections to the graph to make it easier to see when
the graph crosses a particular threshold.
Display styles controls properties of the graph.
### Chart Options
@@ -107,19 +109,19 @@ Display styles controls properties of the graph.
### Line Options
- ``Line Fill`` - Amount of color fill for a series. 0 is none.
- ``Line Fill`` - Amount of color fill for a series. 0 is none.
- ``Line Width`` - The width of the line for a series.
- ``Null point mode`` - How null values are displayed
- ``Staircase line`` - Draws adjacent points as staircase
### Multiple Series
If there are multiple series, they can be display as a group.
If there are multiple series, they can be displayed as a group.
- ``Stack`` - Each series is stacked on top of another
- ``Percent`` - Each series is draw as a percent of the total of all series
- ``Percent`` - Each series is drawn as a percentage of the total of all series
If you have stack enabled you can select what the mouse hover feature should show.
If you have stack enabled, you can select what the mouse hover feature should show.
- Cumulative - Sum of series below plus the series you hover over
- Individual - Just the value for the series you hover over
@@ -133,11 +135,15 @@ If you have stack enabled you can select what the mouse hover feature should sho
- ``All series`` - Show all series on the same tooltip and a x crosshairs to help follow all series
### Series specific overrides
### Series Specific Overrides
The section allows a series to be render different from the rest. For example, one series can be given
a thicker line width to make it standout.
The section allows a series to be rendered differently from the others. For example, one series can be given
a thicker line width to make it stand out.
## Time range
#### Dashes Drawing Style
![](/img/v2/graph_time_range.png)
There is an option under Series overrides to draw lines as dashes. Set Dashes to the value True to override the line draw setting for a specific series.
## Time Range
![](/img/docs/v2/graph_time_range.png)

View File

@@ -0,0 +1,108 @@
+++
title = "Heatmap Panel"
description = "Heatmap panel documentation"
keywords = ["grafana", "heatmap", "panel", "documentation"]
type = "docs"
[menu.docs]
name = "Heatmap"
parent = "panels"
weight = 3
+++
# Heatmap Panel
![](/img/docs/v43/heatmap_panel_cover.jpg)
> New panel only available in Grafana v4.3+
The Heatmap panel allows you to view histograms over time. To fully understand and use this panel you need
understand what Histograms are and how they are created. Read on below to for a quick introduction to the
term Histogram.
## Histograms and buckets
A histogram is a graphical representation of the distribution of numerical data. You group values into buckets
(some times also called bins) and then count how many values fall into each bucket. Instead
of graphing the actual values you then graph the buckets. Each bar represents a bucket
and the bar height represents the frequency (i.e. count) of values that fell into that bucket's interval.
Example Histogram:
![](/img/docs/v43/heatmap_histogram.png)
The above histogram shows us that most value distribution of a couple of time series. We can easily see that
most values land between 240-300 with a peak between 260-280. Histograms just look at value distributions
over specific time range. So you cannot see any trend or changes in the distribution over time,
this is where heatmaps become useful.
## Heatmap
A Heatmap is like a histogram but over time where each time slice represents its own
histogram. Instead of using bar height as a representation of frequency you use cells and color
the cell proportional to the number of values in the bucket.
Example:
![](/img/docs/v43/heatmap_histogram_over_time.png)
Here we can clearly see what values are more common and how they trend over time.
## Data Options
Data and bucket options can be found in the `Axes` tab.
### Data Formats
Data format | Description
------------ | -------------
*Time series* | Grafana does the bucketing by going through all time series values. The bucket sizes & intervals will be determined using the Buckets options.
*Time series buckets* | Each time series already represents a Y-Axis bucket. The time series name (alias) needs to be a numeric value representing the upper interval for the bucket. Grafana does no bucketing so the bucket size options are hidden.
### Bucket Size
The Bucket count & size options are used by Grafana to calculate how big each cell in the heatmap is. You can
define the bucket size either by count (the first input box) or by specifying a size interval. For the Y-Axis
the size interval is just a value but for the X-bucket you can specify a time range in the *Size* input, for example,
the time range `1h`. This will make the cells 1h wide on the X-axis.
### Pre-bucketed data
If you have a data that is already organized into buckets you can use the `Time series buckets` data format. This format requires that your metric query return regular time series and that each time series has a numeric name
that represent the upper or lower bound of the interval.
The only data source that supports histograms over time is Elasticsearch. You do this by adding a *Histogram*
bucket aggregation before the *Date Histogram*.
![](/img/docs/v43/elastic_histogram.png)
You control the size of the buckets using the Histogram interval (Y-Axis) and the Date Histogram interval (X-axis).
## Display Options
In the heatmap *Display* tab you define how the cells are rendered and what color they are assigned.
### Color Mode & Spectrum
{{< imgbox max-width="40%" img="/img/docs/v43/heatmap_scheme.png" caption="Color spectrum" >}}
The color spectrum controls the mapping between value count (in each bucket) and the color assigned to each bucket.
The left most color on the spectrum represents the minimum count and the color on the right most side represents the
maximum count. Some color schemes are automatically inverted when using the light theme.
You can also change the color mode to `Opacity`. In this case, the color will not change but the amount of opacity will
change with the bucket count.
## Raw data vs aggregated
If you use the heatmap with regular time series data (not pre-bucketed). Then it's important to keep in mind that your data
is often already by aggregated by your time series backend. Most time series queries do not return raw sample data
but include a group by time interval or maxDataPoints limit coupled with an aggregation function (usually average).
This all depends on the time range of your query of course. But the important point is to know that the Histogram bucketing
that Grafana performs may be done on already aggregated and averaged data. To get more accurate heatmaps it is better
to do the bucketing during metric collection or store the data in Elasticsearch, which currently is the only data source
data supports doing Histogram bucketing on the raw data.
If you remove or lower the group by time (or raise maxDataPoints) in your query to return more data points your heatmap will be
more accurate but this can also be very CPU & Memory taxing for your browser and could cause hangs and crashes if the number of
data points becomes unreasonably large.

View File

@@ -0,0 +1,8 @@
+++
title = "Panels"
type = "docs"
[menu.docs]
parent = "features"
identifier = "panels"
weight = 3
+++

View File

@@ -1,12 +1,18 @@
----
page_title: Singlestat Panel
page_description: Singlestat Panel Reference
page_keywords: grafana, singlestat, panel, documentation
---
+++
title = "Singlestat Panel"
keywords = ["grafana", "dashboard", "documentation", "panels", "singlestat"]
type = "docs"
aliases = ["/reference/singlestat/"]
[menu.docs]
name = "Singlestat"
parent = "panels"
weight = 2
+++
# Singlestat Panel
![](/img/v1/singlestat_panel2.png)
![](/img/docs/v1/singlestat_panel2.png)
The Singlestat Panel allows you to show the one main summary stat of a SINGLE series. It reduces the series into a single number (by looking at the max, min, average, or sum of values in the series). Singlestat also provides thresholds to color the stat or the Panel background. It can also translate the single number into a text value, and show a sparkline summary of the series.
@@ -14,11 +20,20 @@ The Singlestat Panel allows you to show the one main summary stat of a SINGLE se
The singlestat panel has a normal query editor to allow you define your exact metric queries like many other Panels. Through the Options tab, you can access the Singlestat-specific functionality.
<img class="no-shadow" src="/img/v1/Singlestat-BaseSettings.png">
<img class="no-shadow" src="/img/docs/v1/Singlestat-BaseSettings.png">
1. `Big Value`: Big Value refers to how we display the main stat for the Singlestat Panel. This is always a single value that is displayed in the Panel in between two strings, `Prefix` and `Suffix`. The single number is calculated by choosing a function (min,max,average,current,total) of your metric query. This functions reduces your query into a single numeric value.
2. `Font Size`: You can use this section to select the font size of the different texts in the Singlestat Panel, i.e. prefix, value and postfix.
3. `Values`: The Value fields let you set the function (min, max, average, current, total) that your entire query is reduced into a single value with. You can also set the font size of the Value field and font-size (as a %) of the metric query that the Panel is configured with. This reduces the entire query into a single summary value that is displayed.
3. `Values`: The Value fields let you set the function (min, max, average, current, total, first, delta, range) that your entire query is reduced into a single value with. You can also set the font size of the Value field and font-size (as a %) of the metric query that the Panel is configured with. This reduces the entire query into a single summary value that is displayed.
* `min` - The smallest value in the series
* `max` - The largest value in the series
* `avg` - The average of all the non-null values in the series
* `current` - The last value in the series. If the series ends on null the previous value will be used.
* `total` - The sum of all the non-null values in the series
* `first` - The first value in the series
* `delta` - The total incremental increase (of a counter) in the series. An attempt is made to account for counter resets, but this will only be accurate for single instance metrics. Used to show total counter increase in time series.
* `diff` - The difference betwen 'current' (last value) and 'first'.
* `range` - The difference between 'min' and 'max'. Useful the show the range of change for a gauge.
4. `Postfixes`: The Postfix fields let you define a custom label and font-size (as a %) to appear *after* the value
5. `Units`: Units are appended to the the Singlestat within the panel, and will respect the color and threshold settings for the value.
6. `Decimals`: The Decimal field allows you to override the automatic decimal precision, and set it explicitly.
@@ -27,19 +42,19 @@ The singlestat panel has a normal query editor to allow you define your exact me
The coloring options of the Singlestat Panel config allow you to dynamically change the colors based on the Singlestat value.
<img class="no-shadow" src="/img/v1/Singlestat-Coloring.png">
<img class="no-shadow" src="/img/docs/v1/Singlestat-Coloring.png">
1. `Background`: This checkbox applies the configured thresholds and colors to the entirety of the Singlestat Panel background.
2. `Value`: This checkbox applies the configured thresholds and colors to the summary stat.
3. `Thresholds`: Change the background and value colors dynamically within the panel, depending on the Singlestat value. The threshold field accepts **2 comma-separated** values which represent 3 ranges that correspond to the three colors directly to the right. For example: if the thresholds are 70, 90 then the first color represents < 70, the second color represents between 70 and 90 and the third color represents > 90.
4. `Colors`: Select a color and opacity
5. `Invert order`: This link toggles the threshold color order.</br>For example: Green, Orange, Red (<img class="no-shadow" src="/img/v1/gyr.png">) will become Red, Orange, Green (<img class="no-shadow" src="/img/v1/ryg.png">).
5. `Invert order`: This link toggles the threshold color order.</br>For example: Green, Orange, Red (<img class="no-shadow" src="/img/docs(v1/gyr.png">) will become Red, Orange, Green (<img class="no-shadow" src="/img/docs/v1/ryg.png">).
### Spark Lines
Sparklines are a great way of seeing the historical data related to the summary stat, providing valuable context at a glance. Sparklines act differently than traditional Graph Panels and do not include x or y axis, coordinates, a legend, or ability to interact with the graph.
<img class="no-shadow" src="/img/v1/Singlestat-Sparklines.png">
<img class="no-shadow" src="/img/docs/v1/Singlestat-Sparklines.png">
1. `Show`: The show checkbox will toggle whether the spark line is shown in the Panel. When unselected, only the Singlestat value will appear.
2. `Background`: Check if you want the sparklines to take up the full panel width, or uncheck if they should be below the main Singlestat value.
@@ -52,13 +67,13 @@ Sparklines are a great way of seeing the historical data related to the summary
Value to text mapping allows you to translate the value of the summary stat into explicit text. The text will respect all styling, thresholds and customization defined for the value. This can be useful to translate the number of the main Singlestat value into a context-specific human-readable word or message.
<img class="no-shadow" src="/img/v1/Singlestat-ValueMapping.png">
<img class="no-shadow" src="/img/docs/v1/Singlestat-ValueMapping.png">
## Troubleshooting
### Multiple Series Error
<img class="no-shadow" src="/img/v2/Singlestat-MultiSeriesError.png">
<img class="no-shadow" src="/img/docs/v2/Singlestat-MultiSeriesError.png">
Grafana 2.5 introduced stricter checking for multiple-series on singlestat panels. In previous versions, the panel logic did not verify that only a single series was used, and instead, displayed the first series encountered. Depending on your data source, this could have lead to inconsistent data being shown and/or a general confusion about which metric was being displayed.

View File

@@ -1,12 +1,18 @@
----
page_title: Table Panel
page_description: Table Panel Reference
page_keywords: grafana, table, panel, documentation
---
+++
title = "Table Panel"
keywords = ["grafana", "dashboard", "documentation", "panels", "table panel"]
type = "docs"
aliases = ["/reference/table/"]
[menu.docs]
name = "Table"
parent = "panels"
weight = 2
+++
# Table Panel
<img src="/img/v2/table-panel.png">
<img src="/assets/img/features/table-panel.png">
The new table panel is very flexible, supporting both multiple modes for time series as well as for
table, annotation and raw JSON data. It also provides date formatting and value formatting and coloring options.
@@ -17,7 +23,7 @@ To view table panels in action and test different configurations with sample dat
The table panel has many ways to manipulate your data for optimal presentation.
<img class="no-shadow" src="/img/v2/table-config2.png">
<img class="no-shadow" src="/img/docs/v2/table-config2.png">
1. `Data`: Control how your query is transformed into a table.
2. `Table Display`: Table display options.
@@ -25,7 +31,7 @@ The table panel has many ways to manipulate your data for optimal presentation.
## Data to Table
<img class="no-shadow" src="/img/v2/table-data-options.png">
<img class="no-shadow" src="/img/docs/v2/table-data-options.png">
The data section contains the **To Table Transform (1)**. This is the primary option for how your data/metric
query should be transformed into a table format. The **Columns (2)** option allows you to select what columns
@@ -33,38 +39,38 @@ you want in the table. Only applicable for some transforms.
### Time series to rows
<img src="/img/v2/table_ts_to_rows2.png">
<img src="/img/docs/v2/table_ts_to_rows2.png">
In the most simple mode you can turn time series to rows. This means you get a `Time`, `Metric` and a `Value` column. Where `Metric` is the name of the time series.
### Time series to columns
![](/img/v2/table_ts_to_columns2.png)
![](/img/docs/v2/table_ts_to_columns2.png)
This transform allows you to take multiple time series and group them by time. Which will result in the primary column being `Time` and a column for each time series.
### Time series aggregations
![](/img/v2/table_ts_to_aggregations2.png)
![](/img/docs/v2/table_ts_to_aggregations2.png)
This table transformation will lay out your table into rows by metric, allowing columns of `Avg`, `Min`, `Max`, `Total`, `Current` and `Count`. More than one column can be added.
### Annotations
![](/img/v2/table_annotations.png)
![](/img/docs/v2/table_annotations.png)
If you have annotations enabled in the dashboard you can have the table show them. If you configure this
mode then any queries you have in the metrics tab will be ignored.
### JSON Data
![](/img/v2/table_json_data.png)
![](/img/docs/v2/table_json_data.png)
If you have an Elasticsearch **Raw Document** query or an Elasticsearch query without a `date histogram` use this
transform mode and pick the columns using the **Columns** section.
![](/img/v2/elastic_raw_doc.png)
![](/img/docs/v2/elastic_raw_doc.png)
## Table Display
<img class="no-shadow" src="/img/v2/table-display.png">
<img class="no-shadow" src="/img/docs/v2/table-display.png">
1. `Pagination (Page Size)`: The table display fields allow you to control The `Pagination` (page size) is the threshold at which the table rows will be broken into pages. For example, if your table had 95 records with a pagination value of 10, your table would be split across 9 pages.
2. `Scroll`: The `scroll bar` checkbox toggles the ability to scroll within the panel, when unchecked, the panel height will grow to display all rows.
@@ -75,12 +81,13 @@ transform mode and pick the columns using the **Columns** section.
The column styles allow you control how dates and numbers are formatted.
<img class="no-shadow" src="/img/v2/Column-Options.png">
<img class="no-shadow" src="/img/docs/v2/Column-Options.png">
1. `Name or regex`: The Name or Regex field controls what columns the rule should be applied to. The regex or name filter will be matched against the column name not against column values.
2. `Type`: The three supported types of types are `Number`, `String` and `Date`.
3. `Format`: Specify date format. Only available when `Type` is set to `Date`.
4. `Coloring` and `Thresholds`: Specify color mode and thresholds limits.
5. `Unit` and `Decimals`: Specify unit and decimal precision for numbers.
6. `Add column style rule`: Add new column rule.
3. `Title`: Title for the column, when using a Regex the title can include replacement strings like `$1`.
4. `Format`: Specify date format. Only available when `Type` is set to `Date`.
5. `Coloring` and `Thresholds`: Specify color mode and thresholds limits.
6. `Unit` and `Decimals`: Specify unit and decimal precision for numbers.
7. `Add column style rule`: Add new column rule.

View File

@@ -0,0 +1,53 @@
+++
title = "Keyboard Shortcuts"
type = "docs"
[menu.docs]
parent = "features"
weight = 7
+++
# Keyboard shortcuts
{{< docs-imagebox img="/img/docs/v4/shortcuts.png" max-width="20rem" >}}
Grafana v4 introduces a number of really powerful keyboard shortcuts. You can now focus a panel
by hovering over it with your mouse. With a panel focused you can simple hit `e` to toggle panel
edit mode, or `v` to toggle fullscreen mode. `p` `r` removes the panel. `p` `s` opens share
modal.
Hit `?` on your keyboard to open the shortcuts help modal.
### Global
- `g` `h` Go to Home Dashboard
- `g` `p` Go to Profile
- `s` `o` Open search
- `s` `s` Open search with starred filter
- `s` `t` Open search in tags view
- `esc` Exit edit/setting views
### Dashboard
- `mod+s` Save dashboard
- `mod+h` Hide row controls
- `d` `r` Refresh all panels
- `d` `s` Dashboard settings
- `d` `v` Toggle in-active / view mode
- `d` `k` Toggle kiosk mode (hides top nav)
- `mod+o` Toggle shared graph crosshair
### Focused Panel
- `e` Toggle panel edit view
- `v` Toggle panel fullscreen view
- `p` `s` Open Panel Share Modal
- `p` `r` Remove Panel
### Focused Row
- `r` `c` Collapse Row
- `r` `r` Remove Row
### Time Range
- `t` `z` Zoom out time range
- `t` Move time range back
- `t` Move time range forward

View File

@@ -0,0 +1,9 @@
+++
title = "What's New in Grafana"
[menu.docs]
name = "What's New In Grafana"
identifier = "whatsnew"
weight = 2
+++

View File

@@ -1,48 +1,55 @@
----
page_title: Graphite query guide
page_description: Graphite query guide
page_keywords: grafana, graphite, metrics, query, documentation
---
+++
title = "Basic Concepts"
description = "Grafana intro and concept guide"
keywords = ["grafana", "intro", "guide", "concepts"]
type = "docs"
[menu.docs]
name = "Basic Concepts"
identifier = "basic_concepts"
parent = "guides"
+++
# Basic Concepts
This document is a “bottom up” introduction to basic concepts in Grafana, and can be used as a starting point to get familiar with core features.
### Data Source
### ** Data Source **
Grafana supports many different storage backends for your time series data (Data Source). Each Data Source has a specific Query Editor that is customized for the features and capabilities that the particular Data Source exposes.
Grafana supports many different storage backends for your time series data (Data Source). Each Data Source has a specific Query Editor that is customized for the features and capabilities that the particular Data Source exposes.
The following datasources are officially supported: [Graphite](/datasources/graphite/), [InfluxDB](/datasources/influxdb/), [OpenTSDB](/datasources/opentsdb/), [Prometheus](/datasources/prometheus/), [Elasticsearch](/datasources/elasticsearch/), [CloudWatch](/datasources/cloudwatch/), and [KairosDB](/datasources/kairosdb)
The following datasources are officially supported: [Graphite]({{< relref "features/datasources/graphite.md" >}}), [InfluxDB]({{< relref "features/datasources/influxdb.md" >}}), [OpenTSDB]({{< relref "features/datasources/opentsdb.md" >}}), [Prometheus]({{< relref "features/datasources/prometheus.md" >}}), [Elasticsearch]({{< relref "features/datasources/elasticsearch.md" >}}), [CloudWatch]({{< relref "features/datasources/cloudwatch.md" >}}).
The query language and capabilities of each Data Source are obviously very different. You can combine data from multiple Data Sources onto a single Dashboard, but each Panel is tied to a specific Data Source that belongs to a particular Organization.
### ** Organization **
### Organization
Grafana supports multiple organizations in order to support a wide variety of deployment models, including using a single Grafana instance to provide service to multiple potentially untrusted Organizations.
In many cases, Grafana will be deployed with a single Organization.
Each Organization can have one or more Data Sources.
Each Organization can have one or more Data Sources.
All Dashboards are owned by a particular Organization.
> Note: It is important to remember that most metric databases to not provide any sort of per-user series authentication. Therefore, in Grafana, Data Sources and Dashboards are available to all Users in a particular Organization.
> Note: It is important to remember that most metric databases do not provide any sort of per-user series authentication. Therefore, in Grafana, Data Sources and Dashboards are available to all Users in a particular Organization.
For more details on the user model for Grafana, please refer to [Admin](/reference/admin/)
### ** User **
A User is a named account in Grafana. A user can belong to one or more Organizations, and can be assigned different levels of privileges through roles.
### User
Grafana supports a wide variety of internal and external ways for Users to authenticate themselves. These include from its own integrated database, from an external SQL server, or from an external LDAP server.
A User is a named account in Grafana. A user can belong to one or more Organizations, and can be assigned different levels of privileges through roles.
Grafana supports a wide variety of internal and external ways for Users to authenticate themselves. These include from its own integrated database, from an external SQL server, or from an external LDAP server.
For more details please refer to [User Auth](/reference/http_api/#users)
### ** Row **
### Row
A Row is a logical divider within a Dashboard, and is used to group Panels together.
Rows are always 12 “units” wide. These units are automatically scaled dependent on the horizontal resolution of your browser. You can control the relative width of Panels within a row by setting their own width.
We utilize a unit abstraction so that Grafana looks great on all screens both small and huge.
We utilize a unit abstraction so that Grafana looks great on all screens both small and huge.
> Note: With MaxDataPoint functionality, Grafana can show you the perfect amount of datapoints no matter your resolution or time-range.
@@ -50,7 +57,7 @@ Utilize the [Repeating Row functionality](/reference/templating/#utilizing-templ
Rows can be collapsed by clicking on the Row Title. If you save a Dashboard with a Row collapsed, it will save in that state and will not preload those graphs until the row is expanded.
### ** Panel **
### Panel
The Panel is the basic visualization building block in Grafana. Each Panel provides a Query Editor (dependent on the Data Source selected in the panel) that allows you to extract the perfect visualization to display on the Panel by utilizing the Query Editor
@@ -71,9 +78,9 @@ The time range on Panels is normally what is set in the [Dashboard time picker](
Panels (or an entire Dashboard) can be [Shared](/reference/sharing/) easily in a variety of ways. You can send a link to someone who has a login to your Grafana. You can use the [Snapshot](/reference/sharing/#snapshots) feature to encode all the data currently being viewed into a static and interactive JSON document; it's so much better than emailing a screenshot!
### ** Query Editor **
### Query Editor
The Query Editor exposes capabilities of your Data Source and allows you to query the metrics that it contains.
The Query Editor exposes capabilities of your Data Source and allows you to query the metrics that it contains.
Use the Query Editor to build one or more queries (for one or more series) in your time series database. The panel will instantly update allowing you to effectively explore your data in real time and build a perfect query for that particular Panel.
@@ -81,13 +88,13 @@ You can utilize [Template variables](/reference/templating/) in the Query Editor
Grafana allows you to reference queries in the Query Editor by the row that theyre on. If you add a second query to graph, you can reference the first query simply by typing in #A. This provides an easy and convenient way to build compounded queries.
### ** Dashboard **
### Dashboard
The Dashboard is where it all comes together. Dashboards can be thought of as of a set of one or more Panels organized and arranged into one or more Rows.
The time period for the Dashboard can be controlled by the [Dashboard time picker](/reference/timerange/) in the upper right of the Dashboard.
Dashboards can utilize [Templating](/reference/templating/) to make them more dynamic and interactive.
Dashboards can utilize [Templating](/reference/templating/) to make them more dynamic and interactive.
Dashboards can utilize [Annotations](/reference/annotations/) to display event data across Panels. This can help correlate the time series data in the Panel with other events.

View File

@@ -1,23 +1,32 @@
---
page_title: Getting started
page_description: Getting started
page_keywords: grafana, guide, documentation
---
+++
title = "Getting Started"
description = "Getting started with Grafana guide"
keywords = ["grafana", "intro", "guide", "started"]
type = "docs"
aliases = ["/guides/gettingstarted"]
[menu.docs]
name = "Getting Started"
identifier = "getting_started_guide"
parent = "guides"
+++
# Getting started
This guide will help you get started and acquainted with Grafana. It assumes you have a working Grafana server up and running and have added at least one [Data Source](/datasources/overview).
This guide will help you get started and acquainted with Grafana. It assumes you have a working Grafana server up and running and have added at least one [Data Source](/features/datasources/).
## Beginner guides
Watch the 10min [beginners guide to building dashboards](https://www.youtube.com/watch?v=sKNZMtoSHN4&index=7&list=PLDGkOdUX1Ujo3wHw9-z5Vo12YLqXRjzg2) to get a quick intro to setting up Dashboards and Panels.
##Basic Concepts
## Basic Concepts
Read the [Basic Concepts](/guides/basic_concepts) document to get a crash course in key Grafana concepts.
### Top header
Let's start with creating a new Dashboard. You can find the new Dashboard link at the bottom of the Dashboard picker. You now have a blank Dashboard.
<img class="no-shadow" src="/img/v2/v2_top_nav_annotated.png">
<img class="no-shadow" src="/img/docs/v2/v2_top_nav_annotated.png">
The image above shows you the top header for a Dashboard.
@@ -29,12 +38,13 @@ The image above shows you the top header for a Dashboard.
6. Settings: Manage Dashboard settings and features such as Templating and Annotations.
## Dashboards, Panels, Rows, the building blocks of Grafana...
Dashboards are at the core of what Grafana is all about. Dashboards are composed of individual Panels arranged on a number of Rows. Grafana ships with a variety of Panels. Grafana makes it easy to construct the right queries, and customize the display properties so that you can create the perfect Dashboard for your need. Each Panel can interact with data from any configured Grafana Data Source (currently InfluxDB, Graphite, OpenTSDB, and KairosDB). The [Basic Concepts](/guides/basic_concepts) guide explores these key ideas in detail.
Dashboards are at the core of what Grafana is all about. Dashboards are composed of individual Panels arranged on a number of Rows. Grafana ships with a variety of Panels. Grafana makes it easy to construct the right queries, and customize the display properties so that you can create the perfect Dashboard for your need. Each Panel can interact with data from any configured Grafana Data Source (currently InfluxDB, Graphite, OpenTSDB, Prometheus and Cloudwatch). The [Basic Concepts](/guides/basic_concepts) guide explores these key ideas in detail.
## Adding & Editing Graphs and Panels
![](/img/v2/graph_metrics_tab_graphite.png)
![](/img/docs/v2/graph_metrics_tab_graphite.png)
1. You add panels via row menu. The row menu is the green icon to the left of each row.
2. To edit the graph you click on the graph title to open the panel menu, then `Edit`.
@@ -43,8 +53,7 @@ Dashboards are at the core of what Grafana is all about. Dashboards are composed
When you click the `Metrics` tab, you are presented with a Query Editor that is specific to the Panel Data Source. Use the Query Editor to build your queries and Grafana will visualize them in real time.
<img src="/img/v2/dashboard_annotated.png" class="no-shadow">
<img src="/img/docs/v2/dashboard_annotated.png" class="no-shadow">
1. Zoom out time range
2. Time picker dropdown. Here you can access relative time range options, auto refresh options and set custom absolute time ranges.
@@ -57,7 +66,7 @@ When you click the `Metrics` tab, you are presented with a Query Editor that is
You can Drag-and-Drop Panels within and between Rows. Click and hold the Panel title, and drag it to its new location. You can also easily resize panels by clicking the (-) and (+) icons.
![](/img/animated_gifs/drag_drop.gif)
![](/img/docs/animated_gifs/drag_drop.gif)
## Tips and shortcuts
@@ -75,15 +84,3 @@ You can Drag-and-Drop Panels within and between Rows. Click and hold the Panel t
* Ctrl+H Hides all controls (good for tv displays)
* Hit Escape to exit graph when in fullscreen or edit mode

View File

@@ -0,0 +1,9 @@
+++
title = "Guides"
type = "docs"
[menu.docs]
name = "Getting Started"
identifier = "guides"
weight = 2
+++

View File

@@ -1,69 +0,0 @@
page_title: Screencasts
page_description: Grafana screencasts
page_keywords: grafana, screencasts, documentation, guides
no_toc: true
# Screencasts
<div class="row">
<div class="columns medium-6">
<h3><strong>Episode 1</strong> - Building Graphite Queries</h3>
Learn how the Graphite Query Editor works, and how to use different graphing functions. There's also an introduction to graph display settings.
<div class="video-container" style="margin-top:10px;">
<iframe height="215" src="//www.youtube.com/embed/mgcJPREl3CU?list=PLDGkOdUX1Ujo3wHw9-z5Vo12YLqXRjzg2" frameborder="0" allowfullscreen></iframe>
</div>
</div>
<div class="columns medium-6">
<h3><strong>Episode 2</strong> - Templated Graphite Queries</h3>
The screencast focuses on Templating with the Graphite Data Source. Learn how to make dynamic and adaptable Dashboards for your Graphite metrics.
<div class="video-container" style="margin-top:10px;">
<iframe height="215" src="//www.youtube.com/embed/FhNUrueWwOk?list=PLDGkOdUX1Ujo3wHw9-z5Vo12YLqXRjzg2" frameborder="0" allowfullscreen></iframe>
</div>
</div>
</div>
<br/>
<div class="row">
<div class="columns medium-6">
<h3><strong>Episode 3</strong> - Whats New In Grafana 2.0</h3>
This screencast highlights many of the great new features that were included in the Grafana 2.0 release.
<div class="video-container" style="margin-top:10px;">
<iframe height="215" src="https://www.youtube.com/embed/FC13uhFRsVw?list=PLDGkOdUX1Ujo3wHw9-z5Vo12YLqXRjzg2" frameborder="0" allowfullscreen></iframe>
</div>
</div>
<div class="columns medium-6">
<h3><strong>Episode 4</strong> - Installation & Configuration on Ubuntu / Debian</h3>
Learn how to easily install the dependencies and packages to get Grafana 2.0 up and running on Ubuntu or Debian in just a few minutes.
<div class="video-container" style="margin-top:10px;">
<iframe height="215" src="https://www.youtube.com/embed/JY22EBOR9hQ?list=PLDGkOdUX1Ujo3wHw9-z5Vo12YLqXRjzg2" frameborder="0" allowfullscreen></iframe>
</div>
</div>
</div>
<br/>
<div class="row">
<div class="columns medium-6">
<h3><strong>Episode 5</strong> - Installation & Configuration on Red Hat / CentOS</h3>
This screencasts shows how to get Grafana 2.0 installed and configured quickly on RPM-based Linux operating systems.
<div class="video-container" style="margin-top:10px;">
<iframe height="215" src="https://www.youtube.com/embed/E-gMFv84FE8?list=PLDGkOdUX1Ujo3wHw9-z5Vo12YLqXRjzg2" frameborder="0" allowfullscreen></iframe>
</div>
</div>
<div class="columns medium-6">
<h3><strong>Episode 6</strong> - Adding data sources, users & organizations</h3>
Now that Grafana has been installed, learn about adding data sources and get a closer look at adding and managing Users and Organizations.
<div class="video-container" style="margin-top:10px;">
<iframe height="215" src="https://www.youtube.com/embed/9ZCMVNxUf6s?list=PLDGkOdUX1Ujo3wHw9-z5Vo12YLqXRjzg2" frameborder="0" allowfullscreen></iframe>
</div>
</div>
</div>
<br/>
<div class="row">
<div class="columns medium-6">
<h3><strong>Episode 7</strong> - Beginners guide to building dashboards</h3>
For newer users of Grafana, this screencast will familiarize you with the general UI and teach you how to build your first Dashboard.
<div class="video-container" style="margin-top:10px;">
<iframe height="215" src="https://www.youtube.com/embed/sKNZMtoSHN4?list=PLDGkOdUX1Ujo3wHw9-z5Vo12YLqXRjzg2" frameborder="0" allowfullscreen></iframe>
</div>
</div>
<div class="columns medium-6">
</div>
</div>

View File

@@ -1,8 +1,14 @@
---
page_title: What's New in Grafana v2.1
page_description: What's new in Grafana v2.1
page_keywords: grafana, new, changes, features, documentation
---
+++
title = "What's New in Grafana v2.1"
description = "Feature & improvement highlights for Grafana v2.1"
keywords = ["grafana", "new", "documentation", "2.1"]
type = "docs"
[menu.docs]
name = "Version 2.1"
identifier = "v2.1"
parent = "whatsnew"
weight = 10
+++
# What's new in Grafana v2.1
Grafana 2.1 brings improvements in three core areas: dashboarding, authentication, and data sources.
@@ -17,7 +23,7 @@ A template variable with Multi-Value enabled allows for the selection of multipl
These variables can then be used in any Panel to make them more dynamic, and to give you the perfect view of your data.
Multi-Value variables is also enabling the new `row repeat` and `panel repeat` feature described below.
![Multi-Value Select](/img/v2/multi-select.gif "Multi-Value Select")
![Multi-Value Select](/img/docs/v2/multi-select.gif "Multi-Value Select")
<br/><br/>
### Repeating Rows and Panels
@@ -25,7 +31,7 @@ Its now possible to create a dashboard that automatically adds (or removes) b
on selected variable values. Any row or any panel can be configured to repeat (duplicate itself) based
on a multi-value template variable.</p>
![Repeating Rows and Panels](/img/v2/panel-row-repeat.gif "Repeating Rows and Panels")
![Repeating Rows and Panels](/img/docs/v2/panel-row-repeat.gif "Repeating Rows and Panels")
<br/><br/>
### Dashboard Links & Navigation
@@ -33,7 +39,7 @@ To support better navigation between dashboards, it's now possible to create cus
panels to appropriate Dashboards. You also have the ability to create flexible top-level links on any
given dashboard thanks to the new dashboard navigation bar feature.
![Dashboard Links](/img/v2/dash_links.png "Dashboard Links")
![Dashboard Links](/img/docs/v2/dash_links.png "Dashboard Links")
Dashboard links can be added under dashboard settings. Either defined as static URLs with a custom icon or as dynamic
dashboard links or dropdowns based on custom dashboard search query. These links appear in the same
@@ -82,7 +88,7 @@ The Viewer role has been modified in Grafana 2.1 so that users assigned this rol
Grafana 2.1 now comes with full support for InfluxDB 0.9. There is a new query editor designed from scratch
for the new features InfluxDB 0.9 enables.
![InfluxDB Editor](/img/v2/influx_09_editor_anim.gif "InfluxDB Editor")
![InfluxDB Editor](/img/docs/v2/influx_09_editor_anim.gif "InfluxDB Editor")
<br/>
@@ -110,15 +116,15 @@ Define series color using regex rule. This is useful when you have templated gra
that change depending selected template variables. Using a regex style override rule you could
for example make all series that contain the word **CPU** `red` and assigned to the second y axis.
![Define series color using regex rule](/img/v2/regex_color_override.png "Define series color using regex rule")
![Define series color using regex rule](/img/docs/v2/regex_color_override.png "Define series color using regex rule")
New series style override, negative-y transform and stack groups. Negative y transform is
very useful if you want to plot a series on the negative y scale without affecting the legend values like min or max or
the values shown in the hover tooltip.
![Negative-y Transform](/img/v2/negative-y.png "Negative-y Transform")
![Negative-y Transform](/img/docs/v2/negative-y.png "Negative-y Transform")
![Negative-y Transform](/img/v2/negative-y-form.png "Negative-y Transform")
![Negative-y Transform](/img/docs/v2/negative-y-form.png "Negative-y Transform")
### Singlestat Panel
Now support string values. Useful for time series database like InfluxDB that supports

View File

@@ -1,8 +1,14 @@
---
page_title: What's New in Grafana v2.5
page_description: What's new in Grafana v2.5
page_keywords: grafana, new, changes, features, documentation
---
+++
title = "What's New in Grafana v2.5"
description = "Feature & improvement highlights for Grafana v2.5"
keywords = ["grafana", "new", "documentation", "2.5"]
type = "docs"
[menu.docs]
name = "Version 2.5"
identifier = "v2.5"
parent = "whatsnew"
weight = 9
+++
# What's new in Grafana v2.5
@@ -12,7 +18,7 @@ fixes and enhancements to all areas of Grafana, like new Data Sources, a new and
resize handles and improved InfluxDB and OpenTSDB support.
### New time range controls
<img src="/img/whatsnew_2_5/timepicker.png" alt="New Time picker">
<img src="/img/docs/whatsnew_2_5/timepicker.png" alt="New Time picker">
A new timepicker with room for more quick ranges as well as new types of relative ranges, like `Today`,
`The day so far` and `This day last week`. Also an improved time & calendar picker that now works
@@ -20,7 +26,7 @@ correctly in UTC mode.
### Elasticsearch
<img src="/img/whatsnew_2_5/elasticsearch_metrics_ex1.png" alt="Elasticsearch example">
<img src="/img/docs/whatsnew_2_5/elasticsearch_metrics_ex1.png" alt="Elasticsearch example">
<br>
This release brings a fully featured query editor for Elasticsearch. You will now be able to visualize
@@ -40,7 +46,7 @@ Try the new Elasticsearch query editor on the [play.grafana.org](http://play.gra
### CloudWatch
<img src="/img/whatsnew_2_5/cloudwatch.png" alt="Cloudwatch editor">
<img src="/img/docs/whatsnew_2_5/cloudwatch.png" alt="Cloudwatch editor">
Grafana 2.5 ships with a new CloudWatch datasource that will allow you to query and visualize CloudWatch
metrics directly from Grafana.
@@ -51,14 +57,14 @@ metrics directly from Grafana.
### Prometheus
<img src="/img/whatsnew_2_5/prometheus_editor.png" alt="Prometheus editor">
<img src="/img/docs/whatsnew_2_5/prometheus_editor.png" alt="Prometheus editor">
Grafana 2.5 ships with a new Prometheus datasource that will allow you to query and visualize data
stored in Prometheus.
### Mix different data sources
<img src="/img/whatsnew_2_5/mixed_data.png" alt="Mix data sources in the same dashboard or in the same graph!">
<img src="/img/docs/whatsnew_2_5/mixed_data.png" alt="Mix data sources in the same dashboard or in the same graph!">
In previous releases you have been able to mix different data sources on the same dashboard. In v2.5 you
will be able to mix then on the same graph! You can enable this by selecting the built in `-- Mixed --` data source.
@@ -67,12 +73,12 @@ to plot metrics from different Graphite servers on the same Graph or plot data f
data from Prometheus. Mixing different data sources on the same graph works for any data source, even custom ones.
### Panel Resize handles
<img src="/img/whatsnew_2_5/panel_resize.gif" alt="">
<img src="/img/docs/whatsnew_2_5/panel_resize.gif" alt="">
This release adds resize handles to the the bottom right corners of panels making is easy to resize both width and height.
### User invites
<img src="/img/whatsnew_2_5/org_invite.png" alt="">
<img src="/img/docs/whatsnew_2_5/org_invite.png" alt="">
This version also brings some new features for user management.
@@ -101,5 +107,5 @@ view the [CHANGELOG.md](https://github.com/grafana/grafana/blob/master/CHANGELOG
- - -
### <a href="http://grafana.org/download">Download Grafana 2.5 now</a>
### <a href="https://grafana.com/get">Download Grafana 2.5 now</a>

View File

@@ -1,8 +1,14 @@
---
page_title: What's New in Grafana v2.6
page_description: What's new in Grafana v2.6
page_keywords: grafana, new, changes, features, documentation, table
---
+++
title = "What's New in Grafana v2.6"
description = "Feature & improvement highlights for Grafana v2.6"
keywords = ["grafana", "new", "documentation", "2.6"]
type = "docs"
[menu.docs]
name = "Version 2.6"
identifier = "v2.6"
parent = "whatsnew"
weight = 7
+++
# What's new in Grafana v2.6
@@ -11,7 +17,7 @@ The release includes a new Table panel, a new InfluxDB query editor, support for
support for multiple Cloudwatch credentials.
## Table Panel
<img src="/img/v2/table-panel.png">
<img src="/assets/img/features/table-panel.png">
The new table panel is very flexible, supporting both multiple modes for time series as well as for
table, annotation and raw JSON data. It also provides date formating and value formating and coloring options.
@@ -21,7 +27,7 @@ table, annotation and raw JSON data. It also provides date formating and value f
In the most simple mode you can turn time series to rows. This means you get a `Time`, `Metric` and a `Value` column.
Where `Metric` is the name of the time series.
<img src="/img/v2.6/table_ts_to_rows.png">
<img src="/img/docs/v2/table_ts_to_rows.png">
### Table Transform
Above you see the options tab for the **Table Panel**. The most important option is the `To Table Transform`.
@@ -34,7 +40,7 @@ The column styles allow you control how dates and numbers are formatted.
This transform allows you to take multiple time series and group them by time. Which will result in a `Time` column
and a column for each time series.
<img src="/img/v2.6/table_ts_to_columns.png">
<img src="/img/docs/v2/table_ts_to_columns.png">
In the screenshot above you can see how the same time series query as in the previous example can be transformed into
a different table by changing the `To Table Transform` to `Time series to columns`.
@@ -43,7 +49,7 @@ a different table by changing the `To Table Transform` to `Time series to colum
This transform works very similar to the legend values in the Graph panel. Each series gets its own row. In the Options
tab you can select which aggregations you want using the plus button the Columns section.
<img src="/img/v2.6/table_ts_to_aggregations.png">
<img src="/img/docs/v2/table_ts_to_aggregations.png">
You have to think about how accurate the aggregations will be. It depends on what aggregation is used in the time series query,
how many data points are fetched, etc. The time series aggregations are calculated by Grafana after aggregation is performed
@@ -53,38 +59,39 @@ by the time series database.
If you want to show documents from Elasticsearch pick `Raw Document` as the first metric.
<img src="/img/v2.6/elastic_raw_doc.png">
<img src="/img/docs/v2/elastic_raw_doc.png">
This in combination with the `JSON Data` table transform will allow you to pick which fields in the document
you want to show in the table.
<img src="/img/v2.6/table_json_data.png">
<img src="/img/docs/v2/table_json_data.png">
### Elasticsearch aggregations
You can also make Elasticsearch aggregation queries without a `Date Histogram`. This allows you to
use Elasticsearch metric aggregations to get accurate aggregations for the selected time range.
<img src="/img/v2.6/elastic_aggregations.png">
<img src="/img/docs/v2/elastic_aggregations.png">
### Annotations
The table can also show any annotations you have enabled in the dashboard.
<img src="/img/v2.6/table_annotations.png">
<img src="/img/docs/v2/table_annotations.png">
## The New InfluxDB Editor
The new InfluxDB editor is a lot more flexible and powerful. It supports nested functions, like `derivative`.
It also uses the same technique as the Graphite query editor in that it presents nested functions as chain of function
transformations. It tries to simplify and unify the complicated nature of InfluxDB's query language.
<img src="/img/v2.6/influxdb_editor_v3.gif">
<img src="/assets/img/blog/v2.6/influxdb_editor_v3.gif">
In the `SELECT` row you can specify what fields and functions you want to use. If you have a
group by time you need an aggregation function. Some functions like derivative require an aggregation function.
The editor tries simplify and unify this part of the query. For example:
![](/img/influxdb/select_editor.png)
![](/img/docs/influxdb/select_editor.png)
The above will generate the following InfluxDB `SELECT` clause:
@@ -103,7 +110,7 @@ You can remove the group by by clicking on the `tag` and then click on the x ico
The new editor also allows you to remove group by time and select `raw` table data. Which is very useful
in combination with the new Table panel to show raw log data stored in InfluxDB.
<img src="/img/v2.6/table_influxdb_logs.png">
<img src="/assets/img/blog/v2.6/table_influxdb_logs.png">
## Pipeline metrics
@@ -111,7 +118,7 @@ If you have Elasticsearch 2.x and Grafana 2.6 or above then you can use pipeline
**Moving Average** and **Derivative**. Elasticsearch pipeline metrics require another metric to be based on. Use the eye icon next to the metric
to hide metrics from appearing in the graph.
![](/img/elasticsearch/pipeline_metrics_editor.png)
![](/img/docs/elasticsearch/pipeline_metrics_editor.png)
## Changelog
For a detailed list and link to github issues for everything included in the 2.6 release please

View File

@@ -1,8 +1,14 @@
---
page_title: What's New in Grafana v2.0
page_description: What's new in Grafana v2.0
page_keywords: grafana, new, changes, features, documentation
---
+++
title = "What's New in Grafana v2.0"
description = "Feature & improvement highlights for Grafana v2.0"
keywords = ["grafana", "new", "documentation", "2.0"]
type = "docs"
[menu.docs]
name = "Version 2.0"
identifier = "v2.0"
parent = "whatsnew"
weight = 11
+++
# What's New in Grafana v2.0
@@ -49,7 +55,7 @@ even zoom in). Also they are fast to load as they aren't actually connected to a
They're a great way to communicate about a particular incident with specific people who aren't Users of your Grafana instance. You can also use them to show off your dashboards over the Internet.
![](/img/v2/dashboard_snapshot_dialog.png)
![](/img/docs/v2/dashboard_snapshot_dialog.png)
### Publish snapshots
@@ -61,11 +67,11 @@ Either way, anyone with the link (and access to your Grafana instance for local
In Grafana v2.x you can now override the relative time range for individual panels, causing them to be different than what is selected in the Dashboard time picker in the upper right. You can also add a time shift to individual panels. This allows you to show metrics from different time periods or days at the same time.
![](/img/v2/panel_time_override.jpg)
![](/img/docs/v2/panel_time_override.jpg)
You control these overrides in panel editor mode and the new tab `Time Range`.
![](/img/v2/time_range_tab.jpg)
![](/img/docs/v2/time_range_tab.jpg)
When you zoom or change the Dashboard time to a custom absolute time range, all panel overrides will be disabled. The panel relative time override is only active when the dashboard time is also relative. The panel timeshift override however is always active, even when the dashboard time is absolute.
@@ -90,7 +96,7 @@ This feature makes it easy to include interactive visualizations from your Grafa
The top header has gotten a major streamlining in Grafana V2.0.
<img class="no-shadow" src="/img/v2/v2_top_nav_annotated.png">
<img class="no-shadow" src="/img/docs/v2/v2_top_nav_annotated.png">
1. `Side menubar toggle` Toggle the side menubar on or off. This allows you to focus on the data presented on the Dashboard. The side menubar provides access to features unrelated to a Dashboard such as Users, Organizations, and Data Sources.
2. `Dashboard dropdown` The main dropdown shows you which Dashboard you are currently viewing, and allows you to easily switch to a new Dashboard. From here you can also create a new Dashboard, Import existing Dashboards, and manage the Playlist.
@@ -115,7 +121,7 @@ You can easily collapse or re-open the side menubar at any time by clicking the
## New search view & starring dashboards
![](/img/v2/dashboard_search.jpg)
![](/img/docs/v2/dashboard_search.jpg)
The dashboard search view has gotten a big overhaul. You can now see and filter by which dashboard you have personally starred.
@@ -124,11 +130,11 @@ The dashboard search view has gotten a big overhaul. You can now see and filter
The Graph panel now supports 3 logarithmic scales, `log base 10`, `log base 32`, `log base 1024`. Logarithmic y-axis scales are very useful when rendering many series of different order of magnitude on the same scale (eg.
latency, network traffic, and storage)
![](/img/v2/graph_logbase10_ms.png)
![](/img/docs/v2/graph_logbase10_ms.png)
## Dashlist panel
![](/img/v2/dashlist_starred.png)
![](/img/docs/v2/dashlist_starred.png)
The dashlist is a new panel in Grafana v2.0. It allows you to show your personal starred dashboards, as well as do custom searches based on search strings or tags.
@@ -147,7 +153,7 @@ In addition, connections to Data Sources can be better controlled and secured, a
A commonly reported problem has been graphs dipping to zero at the the end, because metric data for the last interval has yet to be written to the Data Source. These graphs then "self correct" once the data comes in, but can look deceiving or alarming at times.
You can avoid this problem by adding a `now delay` in `Dashboard Settings` > `Time Picker` tab. This new feature will cause Grafana to ignore the most recent data up to the set delay.
![](/img/v2/timepicker_now_delay.jpg)
![](/img/docs/v2/timepicker_now_delay.jpg)
The delay that may be necessary depends on how much latency you have in your collection pipeline.
@@ -155,7 +161,7 @@ The delay that may be necessary depends on how much latency you have in your col
Grafana v2.0 protects Users from accidentally overwriting each others Dashboard changes. Similar protections are in place if you try to create a new Dashboard with the same name as an existing one.
![](/img/v2/overwrite_protection.jpg)
![](/img/docs/v2/overwrite_protection.jpg)
These protections are only the first step; we will be building out additional capabilities around dashboard versioning and management in future versions of Grafana.
@@ -171,6 +177,6 @@ Grafana now supports server-side PNG rendering. From the Panel share dialog you
> **Note** This requires that your Data Source is accessible from your Grafana instance.
![](/img/v2/share_dialog_image_highlight.jpg)
![](/img/docs/v2/share_dialog_image_highlight.jpg)

View File

@@ -1,8 +1,14 @@
---
page_title: What's New in Grafana v3.1
page_description: What's new in Grafana v3.1
page_keywords: grafana, new, changes, features, documentation
---
+++
title = "What's New in Grafana v3.1"
description = "Feature & improvement highlights for Grafana v3.1"
keywords = ["grafana", "new", "documentation", "3.1"]
type = "docs"
[menu.docs]
name = "Version 3.1"
identifier = "v3.1"
parent = "whatsnew"
weight = 5
+++
# What's New in Grafana v3.1
@@ -10,32 +16,32 @@ page_keywords: grafana, new, changes, features, documentation
The export feature is now accessed from the share menu.
<img src="/img/v31/export_menu.png">
<img src="/img/docs/v31/export_menu.png">
Dashboards exported from Grafana 3.1 are now more portable and easier for others to import than before.
The export process extracts information data source types used by panels and adds these to a new `inputs`
section in the dashboard json. So when you or another person tries to import the dashboard they will be asked to
select data source and optional metrix prefix options.
<img src="/img/v31/import_step1.png">
<img src="/img/docs/v31/import_step1.png">
The above screenshot shows the new import modal that gives you 3 options for how to import a dashboard.
One notable new addition here is the ability to import directly from Dashboards shared on [Grafana.net](https://grafana.net).
One notable new addition here is the ability to import directly from Dashboards shared on [Grafana.com](https://grafana.com).
The next step in the import process:
<img src="/img/v31/import_step2.png">
<img src="/img/docs/v31/import_step2.png">
Here you can change the name of the dashboard and also pick what data sources you want the dashboard to use. The above screenshot
shows a CollectD dashboard for Graphite that requires a metric prefix be specified.
## Discover Dashboards
On [Grafana.net](https://grafana.net) you can now browse & search for dashboards. We have already added a few but
On [Grafana.com](https://grafana.com) you can now browse & search for dashboards. We have already added a few but
more are being uploaded every day. To import a dashboard just copy the dashboard url and head back to Grafana,
then Dashboard Search -> Import -> Paste Grafana.net Dashboard URL.
then Dashboard Search -> Import -> Paste Grafana.com Dashboard URL.
<img src="/img/v31/gnet_dashboards_list.png">
<img src="/img/docs/v31/gnet_dashboards_list.png">
## Constant template variables
@@ -63,6 +69,5 @@ Its now possible to configure different log levels for different modules.
## CHANGELOG
For a detailed list and link to github issues for everything included
in the 3.1 release please view the
[CHANGELOG.md](https://github.com/grafana/grafana/blob/master/CHANGELOG.md)
in the 3.1 release please view the [CHANGELOG.md](https://github.com/grafana/grafana/blob/master/CHANGELOG.md)
file.

View File

@@ -1,14 +1,20 @@
---
page_title: What's New in Grafana v3.0
page_description: What's new in Grafana v3.0
page_keywords: grafana, new, changes, features, documentation
---
+++
title = "What's New in Grafana v3.0"
description = "Feature & improvement highlights for Grafana v3.0"
keywords = ["grafana", "new", "documentation", "3.0"]
type = "docs"
[menu.docs]
name = "Version 3.0"
identifier = "v3.0"
parent = "whatsnew"
weight = 6
+++
# What's New in Grafana v3.0
## Commercial Support
Commercial Support subscriptions for Grafana are now [generally available](https://grafana.net/support/plans/).
Commercial Support subscriptions for Grafana are now [generally available](https://grafana.com/support/plans/).
Raintank is committed to a 100% open-source strategy for Grafana. We
do not want to go down the “open core” route. If your organization
@@ -35,15 +41,15 @@ two new plugin types:
Dashboards, and Grafana **Pages**. Apps are a great way to provide an
entire experience right within Grafana.
## Grafana.net
## Grafana.com
<img src="/img/v3/grafana_net_tour.png">
<img src="/img/docs/v3/grafana_net_tour.png">
[Grafana.net](https://grafana.net) offers a central repository where the community can come together to discover, create and
[Grafana.com](https://grafana.com) offers a central repository where the community can come together to discover, create and
share plugins (data sources, panels, apps) and dashboards.
We are also working on a hosted Graphite-compatible data source that will be optimized for use with Grafana.
Itll be easy to combine your existing data source(s) with this OpenSaaS option. Finally, Grafana.net can
Itll be easy to combine your existing data source(s) with this OpenSaaS option. Finally, Grafana.com can
also be a hub to manage all your Grafana instances. Youll be able to monitor their health and availability,
perform dashboard backups, and more.
@@ -51,12 +57,12 @@ We are also working on a hosted Graphite-compatible Data Source that
will be optimized for use with Grafana. Itll be easy to combine your
existing Data Source(s) with this OpenSaaS option.
Finally, Grafana.net will also be a hub to manage all your Grafana
Finally, Grafana.com will also be a hub to manage all your Grafana
instances. Youll be able to monitor their health and availability,
perform Dashboard backups, and more.
Grafana.net will officially launch along with the stable version of
Grafana 3.0, but <a href=http://www.grafana.net>check out the preview
Grafana 3.0, but go to <a href=https://grafana.com> and check out the preview
and sign up for an account</a> in the meantime.
@@ -96,7 +102,7 @@ periodically and remotely.
You can also make Playlists dynamic by using Dashboard **tags** to
define the Playlist.
<img src="/img/v3/playlist.png">
<img src="/img/docs/v3/playlist.png">
## Improved UI
@@ -116,11 +122,11 @@ are literally hundreds of UI improvements and refinements.
Heres the new side menu in action:
<img src="/img/v3/menu.gif">
<img src="/img/docs/v3/menu.gif">
And here's the new look for Dashboard settings:
<img src="/img/v3/dashboard_settings.png">
<img src="/img/docs/v3/dashboard_settings.png">
Check out the <a href="http://play.grafana.org" target="_blank">Play
Site</a> to get a feel for some of the UI changes.
@@ -132,7 +138,7 @@ over the link and click the annotation text. This feature is very
useful for linking to particular commits or tickets where more
detailed information can be presented to the user.
<img src="/img/v3/annotation_links.gif">
<img src="/img/docs/v3/annotation_links.gif">
## Data source variables
@@ -140,11 +146,11 @@ This has been a top requested feature for very long we are exited to finally pro
this feature. You can now add a new `Data source` type variable. That will
automatically be filled with instance names of your data sources.
<img src="/img/v3/data_source_variable.png">
<img src="/img/docs/v3/data_source_variable.png">
You can then use this variable as the panel data source:
<img src="/img/v3/data_source_variable_use.png">
<img src="/img/docs/v3/data_source_variable_use.png">
This will allow you to quickly change data source server and reuse the
same dashboard for different instances of your metrics backend. For example
@@ -162,7 +168,7 @@ The Prometheus Data Source now supports annotations.
### InfluxDB
You can now select the InfluxDB policy from the query editor.
<img src="/img/v3/influxdb_policy.png">
<img src="/img/docs/v3/influxdb_policy.png">
Grafana 3.0 also comes with support for InfluxDB 0.11 and InfluxDB 0.12.
@@ -183,37 +189,37 @@ variable is interpolated.
data source (or panel) they need to be updated as well.
* InfluxDB 0.8: This data source is no longer included in releases,
you can still install manually from [Grafana.net](http://grafana.net)
you can still install manually from [Grafana.com](https://grafana.com)
* KairosDB: This data source has also no longer shipped with Grafana,
you can install it manually from [Grafana.net](http://grafana.net)
you can install it manually from [Grafana.com](https://grafana.com)
## Plugin showcase
Discovering and installing plugins is very quick and easy with Grafana 3.0 and [Grafana.net](https://grafana.net). Here
Discovering and installing plugins is very quick and easy with Grafana 3.0 and [Grafana.com](https://grafana.com). Here
are a couple that I incurage you try!
#### [Clock Panel](https://grafana.net/plugins/grafana-clock-panel)
#### [Clock Panel](https://grafana.com/plugins/grafana-clock-panel)
Support's both current time and count down mode.
<img src="/img/v3/clock_panel.png">
<img src="/img/docs/v3/clock_panel.png">
#### [Pie Chart Panel](https://grafana.net/plugins/grafana-piechart-panel)
#### [Pie Chart Panel](https://grafana.com/plugins/grafana-piechart-panel)
A simple pie chart panel is now available as an external plugin.
<img src="/img/v3/pie_chart_panel.png">
<img src="/img/docs/v3/pie_chart_panel.png">
#### [WorldPing App](https://grafana.net/plugins/raintank-worldping-app)
#### [WorldPing App](https://grafana.com/plugins/raintank-worldping-app)
This is full blown Grafana App that adds new panels, data sources and pages to give
feature rich global performance monitoring directly from your on-prem Grafana.
<img src="/img/v3/wP-Screenshot-dash-web.png">
<img src="/img/docs/v3/wP-Screenshot-dash-web.png">
#### [Zabbix App](https://grafana.net/plugins/alexanderzobnin-zabbix-app)
#### [Zabbix App](https://grafana.com/plugins/alexanderzobnin-zabbix-app)
This app contains the already very pouplar Zabbix data source plugin, 2 dashboards and a triggers panel. It is
created and maintained by [Alexander Zobnin](https://github.com/alexanderzobnin/grafana-zabbix).
<img src="/img/v3/zabbix_app.png">
<img src="/img/docs/v3/zabbix_app.png">
Checkout the full list of plugins on [Grafana.net](https://grafana.net/plugins)
Checkout the full list of plugins on [Grafana.com](https://grafana.com/plugins)
## CHANGELOG

View File

@@ -0,0 +1,70 @@
+++
title = "What's New in Grafana v4.1"
description = "Feature & improvement highlights for Grafana v4.1"
keywords = ["grafana", "new", "documentation", "4.1.0"]
type = "docs"
[menu.docs]
name = "Version 4.1"
identifier = "v4.1"
parent = "whatsnew"
weight = 3
+++
## Whats new in Grafana v4.1
- **Graph**: Support for shared tooltip on all graphs as you hover over one graph. [#1578](https://github.com/grafana/grafana/pull/1578), [#6274](https://github.com/grafana/grafana/pull/6274)
- **Victorops**: Add VictorOps notification integration [#6411](https://github.com/grafana/grafana/issues/6411), thx [@ichekrygin](https://github.com/ichekrygin)
- **Opsgenie**: Add OpsGenie notification integratiion [#6687](https://github.com/grafana/grafana/issues/6687), thx [@kylemcc](https://github.com/kylemcc)
- **Cloudwatch**: Make it possible to specify access and secret key on the data source config page [#6697](https://github.com/grafana/grafana/issues/6697)
- **Elasticsearch**: Added support for Elasticsearch 5.x [#5740](https://github.com/grafana/grafana/issues/5740), thx [@lpic10](https://github.com/lpic10)
- **Panel**: Added help text for panels. [#4079](https://github.com/grafana/grafana/issues/4079), thx [@utkarshcmu](https://github.com/utkarshcmu)
- [Full changelog](https://github.com/grafana/grafana/blob/master/CHANGELOG.md)
### Shared tooltip
{{< imgbox max-width="60%" img="/img/docs/v41/shared_tooltip.gif" caption="Shared tooltip" >}}
Showing the tooltip on all panels at the same time has been a long standing request in Grafana and we are really happy to finally be able to release it.
You can enable/disable the shared tooltip from the dashboard settings menu or cycle between default, shared tooltip and shared crosshair by pressing `CTRL + O` or `CMD + O`.
<div class="clearfix"></div>
### Help text for panel
{{< imgbox max-width="60%" img="/img/docs/v41/helptext_for_panel_settings.png" caption="Hovering help text" >}}
You can set a help text in the general tab on any panel. The help text is using Markdown to enable better formating and linking to other sites that can provide more information.
<div class="clearfix"></div>
{{< imgbox max-width="60%" img="/img/docs/v41/helptext_hover.png" caption="Hovering help text" >}}
Panels with a help text available have a little indicator in the top left corner. You can show the help text by hovering the icon.
<div class="clearfix"></div>
### Easier Cloudwatch configuration
{{< imgbox max-width="60%" img="/img/docs/v41/cloudwatch_settings.png" caption="Cloudwatch configuration" >}}
In Grafana 4.1.0 you can configure your Cloudwatch data source with `access key` and `secret key` directly in the data source configuration page.
This enables people to use the Cloudwatch data source without having access to the filesystem where Grafana is running.
Once the `access key` and `secret key` have been saved the user will no longer be able to view them.
<div class="clearfix"></div>
## Upgrade & Breaking changes
Elasticsearch 1.x is no longer supported. Please upgrade to Elasticsearch 2.x or 5.x. Otherwise Grafana 4.1.0 contains no breaking changes.
## Changelog
Checkout the [CHANGELOG.md](https://github.com/grafana/grafana/blob/master/CHANGELOG.md) file for a complete list
of new features, changes, and bug fixes.
## Download
Head to [v4.1 download page](/download/4_1_0/) for download links & instructions.
## Thanks
A big thanks to all the Grafana users who contribute by submitting PRs, bug reports & feedback!

View File

@@ -0,0 +1,88 @@
+++
title = "What's New in Grafana v4.2"
description = "Feature & improvement highlights for Grafana v4.2"
keywords = ["grafana", "new", "documentation", "4.2.0"]
type = "docs"
[menu.docs]
name = "Version 4.2"
identifier = "v4.2"
parent = "whatsnew"
weight = -1
+++
## Whats new in Grafana v4.2
Grafana v4.2 Beta is now [available for download](https://grafana.com/grafana/download/4.2.0).
Just like the last release this one contains lots bug fixes and minor improvements.
We are very happy to say that 27 of 40 issues was closed by pull requests from the community.
Big thumbs up!
## Release Highlights
- **Hipchat**: Adds support for sending alert notifications to hipchat [#6451](https://github.com/grafana/grafana/issues/6451), thx [@jregovic](https://github.com/jregovic)
- **Telegram**: Added Telegram alert notifier [#7098](https://github.com/grafana/grafana/pull/7098), thx [@leonoff](https://github.com/leonoff)
- **LINE**: Add LINE as alerting notification channel [#7301](https://github.com/grafana/grafana/pull/7301), thx [@huydx](https://github.com/huydx)
- **Templating**: Make $__interval and $__interval_ms global built in variables that can be used in by any datasource (in panel queries), closes [#7190](https://github.com/grafana/grafana/issues/7190), closes [#6582](https://github.com/grafana/grafana/issues/6582)
- **Alerting**: Adds deduping of alert notifications [#7632](https://github.com/grafana/grafana/pull/7632)
- **Alerting**: Better information about why an alert triggered [#7035](https://github.com/grafana/grafana/issues/7035)
- **Orgs**: Sharing dashboards using Grafana share feature will now redirect to correct org. [#6948](https://github.com/grafana/grafana/issues/6948)
- [Full changelog](https://github.com/grafana/grafana/blob/master/CHANGELOG.md)
### New alert notification channels
This release adds **five** new alert notifications channels, all of them contributed by the community.
* Hipchat
* Telegram
* LINE
* Pushover
* Threema
### Templating
We added two new global built in variables in grafana. `$__interval` and `$__interval_ms` are now reserved template names in grafana and can be used by any datasource.
We might add more global built in variables in the future and if we do we will prefix them with `$__`. So please avoid using that in your template variables.
### Dedupe alert notifications when running multiple servers
In this release we will dedupe alert notificiations when you are running multiple servers.
This makes it possible to run alerting on multiple servers and only get one notification.
We currently solve this with sql transactions which puts some limitations for how many servers you can use to execute the same rules.
3-5 servers should not be a problem but as always, it depends on how many alerts you have and how frequently they execute.
Next up for a better HA situation is to add support for workload balancing between Grafana servers.
### Alerting more info
You can now see the reason why an alert triggered in the alert history. Its also easier to detect when an alert is set to `alerting` due to the `no_data` option.
### Improved support for multi-org setup
When loading dashboards we now set an query parameter called orgId. So we can detect from which org an user shared a dashboard.
This makes it possible for users to share dashboards between orgs without changing org first.
We aim to introduce [dashboard groups](https://github.com/grafana/grafana/issues/1611) sometime in the future which will introduce access control and user groups within one org.
Making it possible to have users in multiple groups and have detailed access control.
## Upgrade & Breaking changes
If your using https in grafana we now force you to use tls 1.2 and the most secure ciphers.
We think its better to be secure by default rather then making it configurable.
If you want to run https with lower versions of tls we suggest you put a reserve proxy in front of grafana.
If you have template variables name `$__interval` or `$__interval_ms` they will no longer work since these keywords
are reserved as global built in variables. We might add more global built in variables in the future and if we do, we will prefix them with `$__`. So please avoid using that in your template variables.
## Changelog
Checkout the [CHANGELOG.md](https://github.com/grafana/grafana/blob/master/CHANGELOG.md) file for a complete list
of new features, changes, and bug fixes.
## Download
Head to [v4.2-beta download page](/download/4_2_0/) for download links & instructions.
## Thanks
A big thanks to all the Grafana users who contribute by submitting PRs, bug reports & feedback!

View File

@@ -0,0 +1,105 @@
+++
title = "What's New in Grafana v4.3"
description = "Feature & improvement highlights for Grafana v4.3"
keywords = ["grafana", "new", "documentation", "4.3.0"]
type = "docs"
[menu.docs]
name = "Version 4.3"
identifier = "v4.3"
parent = "whatsnew"
weight = -2
+++
## What's New in Grafana v4.3
Grafana v4.3 Beta is now [available for download](https://grafana.com/grafana/download/4.3.0-beta1).
## Release Highlights
- New [Heatmap Panel](http://docs.grafana.org/features/panels/heatmap/)
- Graph Panel Histogram Mode
- Elasticsearch Histogram Aggregation
- Prometheus Table data format
- New [MySQL Data Source](http://docs.grafana.org/features/datasources/mysql/) (alpha version to get some early feedback)
- 60+ small fixes and improvements, most of them contributed by our fantastic community!
Check out the [New Features in v4.3 Dashboard](http://play.grafana.org/dashboard/db/new-features-in-v4-3?orgId=1) on the Grafana Play site for a showcase of these new features.
## Histogram Support
A Histogram is a kind of bar chart that groups numbers into ranges, often called buckets or bins. Taller bars show that more data falls in that range.
The Graph Panel now supports Histograms.
![](/img/docs/v43/heatmap_histogram.png)
## Histogram Aggregation Support for Elasticsearch
Elasticsearch is the only supported data source that can return pre-bucketed data (data that is already grouped into ranges). With other data sources there is a risk of returning inaccurate data in a histogram due to using already aggregated data rather than raw data. This release adds support for Elasticsearch pre-bucketed data that can be visualized with the new [Heatmap Panel](http://docs.grafana.org/features/panels/heatmap/).
## Heatmap Panel
The Histogram support in the Graph Panel does not show changes over time - it aggregates all the data together for the chosen time range. To visualize a histogram over time, we have built a new [Heatmap Panel](http://docs.grafana.org/features/panels/heatmap/).
Every column in a Heatmap is a histogram snapshot. Instead of visualizing higher values with higher bars, a heatmap visualizes higher values with color. The histogram shown above is equivalent to one column in the heatmap shown below.
![](/img/docs/v43/heatmap_histogram_over_time.png)
The Heatmap panel also works with Elasticsearch Histogram Aggregations for more accurate server side bucketing.
![](/assets/img/blog/v4/elastic_heatmap.jpg)
## MySQL Data Source (alpha)
This release includes a [new core data source for MySQL](http://docs.grafana.org/features/datasources/mysql/). You can write any possible MySQL query and format it as either Time Series or Table Data allowing it be used with the Graph Panel, Table Panel and SingleStat Panel.
We are still working on the MySQL data source. As it's missing some important features, like templating and macros and future changes could be breaking, we are
labeling the state of the data source as Alpha. Instead of holding up the release of v4.3 we are including it in its current shape to get some early feedback. So please try it out and let us know what you think on [twitter](https://twitter.com/intent/tweet?text=.%40grafana&source=4_3_beta_blog&related=blog) or on our [community forum](https://community.grafana.com/c/releases). Is this a feature that you would use? How can we make it better?
**The query editor can show the generated and interpolated SQL that is sent to the MySQL server.**
![](/img/docs/v43/mysql_table_query.png)
**The query editor will also show any errors that resulted from running the query (very useful when you have a syntax error!).**
![](/img/docs/v43/mysql_query_error.png)
## Health Check Endpoint
Now you can monitor the monitoring with the Health Check Endpoint! The new `/api/health` endpoint returns HTTP 200 OK if everything is up and HTTP 503 Error if the Grafana database cannot be pinged.
## Lazy Load Panels
Grafana now delays loading panels until they become visible (scrolled into view). This means panels out of view are not sending requests thereby reducing the load on your time series database.
## Prometheus - Table Data (column per label)
The Prometheus data source now supports the Table Data format by automatically assigning a column to a label. This makes it really easy to browse data in the table panel.
![](/img/docs/v43/prom_table_cols_as_labels.png)
## Other Highlights From The Changelog
Changes:
- **Table**: Support to change column header text [#3551](https://github.com/grafana/grafana/issues/3551)
- **InfluxDB**: influxdb query builder support for ORDER BY and LIMIT (allows TOPN queries) [#6065](https://github.com/grafana/grafana/issues/6065) Support influxdb's SLIMIT Feature [#7232](https://github.com/grafana/grafana/issues/7232) thx [@thuck](https://github.com/thuck)
- **Graph**: Support auto grid min/max when using log scale [#3090](https://github.com/grafana/grafana/issues/3090), thx [@bigbenhur](https://github.com/bigbenhur)
- **Prometheus**: Make Prometheus query field a textarea [#7663](https://github.com/grafana/grafana/issues/7663), thx [@hagen1778](https://github.com/hagen1778)
- **Server**: Support listening on a UNIX socket [#4030](https://github.com/grafana/grafana/issues/4030), thx [@mitjaziv](https://github.com/mitjaziv)
Fixes:
- **MySQL**: 4-byte UTF8 not supported when using MySQL database (allows Emojis in Dashboard Names) [#7958](https://github.com/grafana/grafana/issues/7958)
- **Dashboard**: Description tooltip is not fully displayed [#7970](https://github.com/grafana/grafana/issues/7970)
Lots more enhancements and fixes can be found in the [Changelog](https://github.com/grafana/grafana/blob/master/CHANGELOG.md).
## Download
Head to the [v4.3 download page](https://grafana.com/grafana/download) for download links & instructions.
## Thanks
A big thanks to all the Grafana users who contribute by submitting PRs, bug reports, helping out on our [community site](https://community.grafana.com/) and providing feedback!

View File

@@ -0,0 +1,180 @@
+++
title = "What's New in Grafana v4.0"
description = "Feature & improvement highlights for Grafana v4.0"
keywords = ["grafana", "new", "documentation", "4.0"]
type = "docs"
[menu.docs]
name = "Version 4.0"
identifier = "v4.0"
parent = "whatsnew"
weight = 4
+++
# What's New in Grafana v4.0
As usual this release contains a ton of minor new features, fixes and improved UX. But on top of the usual new goodies
is a core new feature: Alerting! Read on below for a detailed description of what's new in v4.0.
## Alerting
{{< imgbox max-width="40%" img="/img/docs/v4/drag_handles_gif.gif" caption="Alerting overview" >}}
Alerting is a really revolutionary feature for Grafana. It transforms Grafana from a
visualization tool into a truly mission critical monitoring tool. The alert rules are very easy to
configure using your existing graph panels and threshold levels can be set simply by dragging handles to
the right side of the graph. The rules will continually be evaluated by grafana-server and
notifications will be sent out when the rule conditions are met.
This feature has been worked on for over a year with many iterations and rewrites
just to make sure the foundations are really solid. We are really proud to finally release it!
Since the alerting execution is processed in the backend not all data source plugins are supported.
Right now Graphite, Prometheus, InfluxDB and OpenTSDB are supported. Elasticsearch is being worked
on but will be not ready for v4 release.
<div class="clearfix"></div>
### Rules
{{< imgbox max-width="40%" img="/img/docs/v4/alerting_conditions.png" caption="Alerting Conditions" >}}
The rule config allows you to specify a name, how often the rule should be evaluated and a series
of conditions that all need to be true for the alert to fire.
Currently the only condition type that exists is a `Query` condition that allows you to
specify a query letter, time range and an aggregation function. The letter refers to
a query you already have added in the **Metrics** tab. The result from the
query and the aggregation function is a single value that is then used in the threshold check.
We plan to add other condition types in the future, like `Other Alert`, where you can include the state
of another alert in your conditions, and `Time Of Day`.
### Notifications
{{< imgbox max-width="40%" img="/img/docs/v4/slack_notification.png" caption="Alerting Slack Notification" >}}
Alerting would not be very useful if there was no way to send notifications when rules trigger and change state. You
can setup notifications of different types. We currently have `Slack`, `PagerDuty`, `Email` and `Webhook` with more in the
pipe that will be added during beta period. The notifications can then be added to your alert rules.
If you have configured an external image store in the grafana.ini config file (s3 and webdav options available)
you can get very rich notifications with an image of the graph and the metric
values all included in the notification.
### Annotations
Alert state changes are recorded in a new annotation store that is built into Grafana. This store
currently only supports storing annotations in Grafana's own internal database (mysql, postgres or sqlite).
The Grafana annotation storage is currently only used for alert state changes but we hope to add the ability for users
to add graph comments in the form of annotations directly from within Grafana in a future release.
### Alert List Panel
{{< imgbox max-width="30%" img="/img/docs/v4/alert_list_panel.png" caption="Alert List Panel" >}}
This new panel allows you to show alert rules or a history of alert rule state changes. You can filter based on states you are
interested in. This panel is very useful for overview style dashboards.
<div class="clearfix"></div>
## Ad-hoc filter variable
{{< imgbox max-width="30%" img="/img/docs/v4/adhoc_filters.gif" caption="Ad-hoc filters variable" >}}
This is a new and very different type of template variable. It will allow you to create new key/value filters on the fly
with autocomplete for both key and values. The filter condition will be automatically applied to all
queries that use that data source. This feature opens up more exploratory dashboards. In the gif animation to the right
you have a dashboard for Elasticsearch log data. It uses one query variable that allow you to quickly change how the data
is grouped, and an interval variable for controlling the granularity of the time buckets. What was missing
was a way to dynamically apply filters to the log query. With the `Ad-Hoc Filters` variable you can
dynamically add filters to any log property!
## UX Improvements
We always try to bring some UX/UI refinements & polish in every release.
### TV-mode & Kiosk mode
<div class="row">
<div class="medium-6 columns">
<p>
Grafana is so often used on wall mounted TVs that we figured a clean TV mode would be
really nice. In TV mode the top navbar, row & panel controls will all fade to transparent.
</p>
<p>
This happens automatically after one minute of user inactivity but can also be toggled manually
with the <code>d v</code> sequence shortcut. Any mouse movement or keyboard action will
restore navbar & controls.
</p>
<p>
Another feature is the kiosk mode. This can be enabled with <code>d k</code>
shortcut or by adding <code>&kiosk</code> to the URL when you load a dashboard.
In kiosk mode the navbar is completely hidden/removed from view.
</p>
</div>
<div class="medium-6 columns">
{{< lightboxhelper max-width="100%" img="/img/docs/v4/tvmode.png" caption="TV mode" >}}
<video width="320" height="240" controls>
<source src="/assets/videos/tvmode.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
</div>
</div>
### New row menu & add panel experience
{{< imgbox max-width="50%" img="/img/docs/v4/add_panel.gif" caption="Add Panel flow" >}}
We spent a lot of time improving the dashboard building experience to make it both
more efficient and easier for beginners. After many good but not great experiments
with a `build mode` we eventually decided to just improve the green row menu and
continue work on a `build mode` for a future release.
The new row menu automatically slides out when you mouse over the edge of the row. You no longer need
to hover over the small green icon and then click it to expand the row menu.
There are some minor improvements to drag and drop behaviour. Now when dragging a panel from one row
to another you will insert the panel and Grafana will automatically make room for it.
When you drag a panel within a row you will simply reorder the panels.
If you look at the animation to the right you can see that you can drag and drop a new panel. This is not
required, you can also just click the panel type and it will be inserted at the end of the row
automatically. Dragging a new panel has an advantage in that you can insert a new panel where ever you want
not just at the end of the row.
We plan to further improve dashboard building in the future with a more rich grid & layout system.
### Keyboard shortcuts
{{< imgbox max-width="40%" img="/img/docs/v4/shortcuts.png" caption="Shortcuts" >}}
Grafana v4 introduces a number of really powerful keyboard shortcuts. You can now focus a panel
by hovering over it with your mouse. With a panel focused you can simply hit `e` to toggle panel
edit mode, or `v` to toggle fullscreen mode. `p r` removes the panel. `p s` opens share
modal.
Some nice navigation shortcuts are:
- `g h` for go to home dashboard
- `s s` open search with starred pre-selected
- `s t` open search in tags list view
<div class="clearfix"></div>
## Upgrade & Breaking changes
There are no breaking changes. Old dashboards and features should work the same. Grafana-server will automatically upgrade its db
schema on restart. It's advisable to do a backup of Grafana's database before updating.
If you are using plugins make sure to update your plugins as some might not work perfectly v4.
You can update plugins using grafana-cli
grafana-cli plugins update-all
## Changelog
Checkout the [CHANGELOG.md](https://github.com/grafana/grafana/blob/master/CHANGELOG.md) file for a complete list
of new features, changes, and bug fixes.

View File

@@ -1,8 +1,13 @@
----
page_title: Admin APIs
page_description: Grafana Admin API Reference
page_keywords: grafana, admin, http, api, documentation
---
+++
title = "Admin HTTP API "
description = "Grafana Admin HTTP API"
keywords = ["grafana", "http", "documentation", "api", "admin"]
aliases = ["/http_api/admin/"]
type = "docs"
[menu.docs]
name = "Admin"
parent = "http_api"
+++
# Admin API
@@ -138,6 +143,7 @@ with Grafana admin permission.
"protocol":"http",
"root_url":"%(protocol)s://%(domain)s:%(http_port)s/",
"router_logging":"true",
"data_proxy_logging":"true",
"static_root_path":"public"
},
"session":{
@@ -152,6 +158,7 @@ with Grafana admin permission.
"cert_file":"",
"enabled":"false",
"from_address":"admin@grafana.localhost",
"from_name":"Grafana",
"host":"localhost:25",
"key_file":"",
"password":"************",
@@ -230,12 +237,14 @@ Change password for specific user
Accept: application/json
Content-Type: application/json
{"password":"userpassword"}
**Example Response**:
HTTP/1.1 200
Content-Type: application/json
{"password":"userpassword"}
{"message": "User password updated"}
## Permissions
@@ -247,6 +256,8 @@ Change password for specific user
Accept: application/json
Content-Type: application/json
{"isGrafanaAdmin": true}
**Example Response**:
HTTP/1.1 200
@@ -270,3 +281,28 @@ Change password for specific user
Content-Type: application/json
{message: "User deleted"}
## Pause all alerts
`POST /api/admin/pause-all-alerts`
**Example Request**:
POST /api/admin/pause-all-alerts HTTP/1.1
Accept: application/json
Content-Type: application/json
{
"paused": true
}
JSON Body schema:
- **paused** If true then all alerts are to be paused, false unpauses all alerts.
**Example Response**:
HTTP/1.1 200
Content-Type: application/json
{state: "new state", message: "alerts pause/un paused", "alertsAffected": 100}

View File

@@ -0,0 +1,240 @@
+++
title = "Alerting HTTP API "
description = "Grafana Alerting HTTP API"
keywords = ["grafana", "http", "documentation", "api", "alerting"]
aliases = ["/http_api/alerting/"]
type = "docs"
[menu.docs]
name = "Alerting"
parent = "http_api"
+++
# Alerting API
You can use the Alerting API to get information about alerts and their states but this API cannot be used to modify the alert.
To create new alerts or modify them you need to update the dashboard json that contains the alerts.
This API can also be used to create, update and delete alert notifications.
## Get alerts
`GET /api/alerts/`
**Example Request**:
GET /api/alerts HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
Querystring Parameters:
These parameters are used as querystring parameters. For example:
`/api/alerts?dashboardId=1`
- **dashboardId** Return alerts for a specified dashboard.
- **panelId** Return alerts for a specified panel on a dashboard.
- **limit** - Limit response to x number of alerts.
- **state** - Return alerts with one or more of the following alert states: `ALL`,`no_data`, `paused`, `alerting`, `ok`, `pending`. To specify multiple states use the following format: `?state=paused&state=alerting`
**Example Response**:
HTTP/1.1 200
Content-Type: application/json
[
{
"id": 1,
"dashboardId": 1,
"panelId": 1,
"name": "fire place sensor",
"message": "Someone is trying to break in through the fire place",
"state": "alerting",
"evalDate": "0001-01-01T00:00:00Z",
"evalData": [
{
"metric": "fire",
"tags": null,
"value": 5.349999999999999
}
"newStateDate": "2016-12-25",
"executionError": "",
"dashboardUri": "http://grafana.com/dashboard/db/sensors"
}
]
## Get one alert
`GET /api/alerts/:id`
**Example Request**:
GET /api/alerts/1 HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
**Example Response**:
HTTP/1.1 200
Content-Type: application/json
{
"id": 1,
"dashboardId": 1,
"panelId": 1,
"name": "fire place sensor",
"message": "Someone is trying to break in through the fire place",
"state": "alerting",
"newStateDate": "2016-12-25",
"executionError": "",
"dashboardUri": "http://grafana.com/dashboard/db/sensors"
}
## Pause alert
`POST /api/alerts/:id/pause`
**Example Request**:
POST /api/alerts/1/pause HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
{
"paused": true
}
The :id query parameter is the id of the alert to be paused or unpaused.
JSON Body Schema:
- **paused** Can be `true` or `false`. True to pause an alert. False to unpause an alert.
**Example Response**:
HTTP/1.1 200
Content-Type: application/json
{
"alertId": 1,
"state": "Paused",
"message": "alert paused"
}
## Get alert notifications
`GET /api/alert-notifications`
**Example Request**:
GET /api/alert-notifications HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
**Example Response**:
HTTP/1.1 200
Content-Type: application/json
{
"id": 1,
"name": "Team A",
"type": "email",
"isDefault": true,
"created": "2017-01-01 12:45",
"updated": "2017-01-01 12:45"
}
## Create alert notification
`POST /api/alert-notifications`
**Example Request**:
POST /api/alert-notifications HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
{
"name": "new alert notification", //Required
"type": "email", //Required
"isDefault": false,
"settings": {
"addresses": "carl@grafana.com;dev@grafana.com"
}
}
**Example Response**:
HTTP/1.1 200
Content-Type: application/json
{
"id": 1,
"name": "new alert notification",
"type": "email",
"isDefault": false,
"settings": { addresses: "carl@grafana.com;dev@grafana.com"} }
"created": "2017-01-01 12:34",
"updated": "2017-01-01 12:34"
}
## Update alert notification
`PUT /api/alert-notifications/1`
**Example Request**:
PUT /api/alert-notifications/1 HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
{
"id": 1,
"name": "new alert notification", //Required
"type": "email", //Required
"isDefault": false,
"settings": {
"addresses: "carl@grafana.com;dev@grafana.com"
}
}
**Example Response**:
HTTP/1.1 200
Content-Type: application/json
{
"id": 1,
"name": "new alert notification",
"type": "email",
"isDefault": false,
"settings": { addresses: "carl@grafana.com;dev@grafana.com"} }
"created": "2017-01-01 12:34",
"updated": "2017-01-01 12:34"
}
## Delete alert notification
`DELETE /api/alert-notifications/:notificationId`
**Example Request**:
DELETE /api/alert-notifications/1 HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
**Example Response**:
HTTP/1.1 200
Content-Type: application/json
{
"message": "Notification deleted"
}

View File

@@ -1,8 +1,13 @@
----
page_title: Authentication API
page_description: Grafana HTTP API Reference
page_keywords: grafana, admin, http, api, documentation
---
+++
title = "Authentication HTTP API "
description = "Grafana Authentication HTTP API"
keywords = ["grafana", "http", "documentation", "api", "authentication"]
aliases = ["/http_api/authentication/"]
type = "docs"
[menu.docs]
name = "Authentication"
parent = "http_api"
+++
# Authentication API
@@ -13,7 +18,7 @@ Currently you can authenticate via an `API Token` or via a `Session cookie` (acq
## Basic Auth
If basic auth is enabled (it is enabled by default) you can authenticate your HTTP request via
standard basic auth.
standard basic auth. Basic auth will also authenticate LDAP users.
curl example:
```
@@ -25,7 +30,7 @@ curl example:
Open the sidemenu and click the organization dropdown and select the `API Keys` option.
![](/img/v2/orgdropdown_api_keys.png)
![](/img/docs/v2/orgdropdown_api_keys.png)
You use the token in all requests in the `Authorization` header, like this:
@@ -36,3 +41,80 @@ You use the token in all requests in the `Authorization` header, like this:
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
The `Authorization` header value should be `Bearer <your api key>`.
# Auth HTTP resources / actions
## Api Keys
`GET /api/auth/keys`
**Example Request**:
GET /api/auth/keys HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
**Example Response**:
HTTP/1.1 200
Content-Type: application/json
[
{
"id": 3,
"name": "API",
"role": "Admin"
},
{
"id": 1,
"name": "TestAdmin",
"role": "Admin"
}
]
## Create API Key
`POST /api/auth/keys`
**Example Request**:
POST /api/auth/keys HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
{
"name": "mykey",
"role": "Admin"
}
JSON Body schema:
- **name** The key name
- **role** Sets the access level/Grafana Role for the key. Can be one of the following values: `Viewer`, `Editor`, `Read Only Editor` or `Admin`.
**Example Response**:
HTTP/1.1 200
Content-Type: application/json
{"name":"mykey","key":"eyJrIjoiWHZiSWd3NzdCYUZnNUtibE9obUpESmE3bzJYNDRIc0UiLCJuIjoibXlrZXkiLCJpZCI6MX1="}
## Delete API Key
`DELETE /api/auth/keys/:id`
**Example Request**:
DELETE /api/auth/keys/3 HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
**Example Response**:
HTTP/1.1 200
Content-Type: application/json
{"message":"API key deleted"}

View File

@@ -1,8 +1,13 @@
----
page_title: Dashboard API
page_description: Grafana Dashboard API Reference
page_keywords: grafana, admin, http, api, documentation, dashboard
---
+++
title = "Dashboard HTTP API "
description = "Grafana Dashboard HTTP API"
keywords = ["grafana", "http", "documentation", "api", "dashboard"]
aliases = ["/http_api/dashboard/"]
type = "docs"
[menu.docs]
name = "Dashboard"
parent = "http_api"
+++
# Dashboard API
@@ -14,26 +19,28 @@ Creates a new dashboard or updates an existing dashboard.
**Example Request for new dashboard**:
POST /api/dashboards/db HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
```http
POST /api/dashboards/db HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
{
"dashboard": {
"id": null,
"title": "Production Overview",
"tags": [ "templated" ],
"timezone": "browser",
"rows": [
{
}
],
"schemaVersion": 6,
"version": 0
},
"overwrite": false
}
```
JSON Body schema:
- **dashboard** The complete dashboard model, id = null to create a new dashboard
- **overwrite** Set to true if you want to overwrite existing dashboard with newer version or with same dashboard title.
**Example Response**:
```http
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Content-Length: 78
```
Status Codes:
- **200** Created
@@ -42,15 +49,17 @@ JSON Body schema:
- **412** Precondition failed
The **412** status code is used when a newer dashboard already exists (newer, its version is greater than the version that was sent). The
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Content-Length: 78
same status code is also used if another dashboard exists with the same title. The response body will look like this:
```http
HTTP/1.1 412 Precondition Failed
Content-Type: application/json; charset=UTF-8
{
"slug": "production-overview",
"status": "success",
"version": 1
}
Content-Length: 97
```
In in case of title already exists the `status` property will be `name-exists`.
## Get dashboard
`GET /api/dashboards/db/:slug`
@@ -62,14 +71,16 @@ Status Codes:
```http
GET /api/dashboards/db/production-overview HTTP/1.1
Accept: application/json
HTTP/1.1 412 Precondition Failed
Content-Type: application/json; charset=UTF-8
Content-Length: 97
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
```
**Example Response**:
{
"message": "The dashboard has been changed by someone else",
"status": "version-mismatch"
}
```http
HTTP/1.1 200
Content-Type: application/json
```
## Delete dashboard
@@ -81,34 +92,38 @@ Will return the dashboard given the dashboard slug. Slug is the url friendly ver
**Example Request**:
```http
GET /api/dashboards/db/production-overview HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
DELETE /api/dashboards/db/test HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
```
**Example Response**:
```http
HTTP/1.1 200
Content-Type: application/json
HTTP/1.1 200
Content-Type: application/json
```
{
"meta": {
"isStarred": false,
"slug": "production-overview"
},
"dashboard": {
"id": null,
"title": "Production Overview",
"tags": [ "templated" ],
"timezone": "browser",
"rows": [
{
}
],
"schemaVersion": 6,
"version": 0
## Gets the home dashboard
`GET /api/dashboards/home`
Will return the home dashboard.
**Example Request**:
GET /api/dashboards/home HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
}
**Example Response**:
HTTP/1.1 200
Content-Type: application/json
{
"meta": {
"isHome":true,
@@ -118,17 +133,21 @@ The above will delete the dashboard with the specified slug. The slug is the url
"slug":"",
"expires":"0001-01-01T00:00:00Z",
"created":"0001-01-01T00:00:00Z"
DELETE /api/dashboards/db/test HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
},
"dashboard": {
"editable":false,
"hideControls":true,
"nav":[
{
"enable":false,
"type":"timepicker"
}
HTTP/1.1 200
Content-Type: application/json
],
"rows": [
{
{"title": "Test"}
}
],
"style":"dark",
"tags":[],
"templating":{
@@ -195,7 +214,7 @@ Get all tags of dashboards
HTTP/1.1 200
Content-Type: application/json
GET /api/dashboards/home HTTP/1.1
[
{
"id":1,
@@ -216,10 +235,6 @@ Get all tags of dashboards
}
]
## Dashboard from JSON file
`GET /file/:file`
## Search Dashboards
`GET /api/search/`
@@ -227,7 +242,7 @@ Get all tags of dashboards
Status Codes:
- **query** Search Query
- **tags** Tags to use
- **tag** Tag to use
- **starred** Flag indicating if only starred Dashboards should be returned
- **tagcloud** - Flag indicating if a tagcloud should be returned

View File

@@ -1,8 +1,14 @@
----
page_title: Data source API
page_description: Grafana Data source API Reference
page_keywords: grafana, admin, http, api, documentation, datasource
---
+++
title = "Data source HTTP API "
description = "Grafana Data source HTTP API"
keywords = ["grafana", "http", "documentation", "api", "data source"]
aliases = ["/http_api/datasource/"]
type = "docs"
[menu.docs]
name = "Data source"
parent = "http_api"
+++
# Data source API
@@ -152,7 +158,7 @@ page_keywords: grafana, admin, http, api, documentation, datasource
HTTP/1.1 200
Content-Type: application/json
{"id":1,"message":"Datasource added"}
{"id":1,"message":"Datasource added", "name": "test_datasource"}
## Update an existing data source
@@ -187,9 +193,9 @@ page_keywords: grafana, admin, http, api, documentation, datasource
HTTP/1.1 200
Content-Type: application/json
{"message":"Datasource updated"}
{"message":"Datasource updated", "id": 1, "name": "test_datasource"}
## Delete an existing data source
## Delete an existing data source by id
`DELETE /api/datasources/:datasourceId`
@@ -207,6 +213,24 @@ page_keywords: grafana, admin, http, api, documentation, datasource
{"message":"Data source deleted"}
## Delete an existing data source by name
`DELETE /api/datasources/name/:datasourceName`
**Example Request**:
DELETE /api/datasources/name/test_datasource HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
**Example Response**:
HTTP/1.1 200
Content-Type: application/json
{"message":"Data source deleted"}
## Data source proxy calls
`GET /api/datasources/proxy/:datasourceId/*`

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