diff --git a/.editorconfig b/.editorconfig
index 386c27fceb8..146224e7330 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,13 +1,6 @@
# http://editorconfig.org
root = true
-[*.go]
-indent_style = tab
-indent_size = 4
-charset = utf-8
-trim_trailing_whitespace = true
-insert_final_newline = true
-
[*]
indent_style = space
indent_size = 2
@@ -15,5 +8,12 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
+[*.go]
+indent_style = tab
+indent_size = 4
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+
[*.md]
trim_trailing_whitespace = false
diff --git a/.gitignore b/.gitignore
index 3d3b621fa3c..7c956af621f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -41,9 +41,17 @@ profile.cov
.notouch
/pkg/cmd/grafana-cli/grafana-cli
/pkg/cmd/grafana-server/grafana-server
+/pkg/cmd/grafana-server/debug
/examples/*/dist
/packaging/**/*.rpm
/packaging/**/*.deb
# Ignore OSX indexing
.DS_Store
+
+/vendor/**/*.py
+/vendor/**/*.xml
+/vendor/**/*.yml
+/vendor/**/*_test.go
+/vendor/**/.editorconfig
+/vendor/**/appengine*
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2deafc59207..938c46dd13b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,19 +19,26 @@
* **Prometheus**: Add support for instant queries [#5765](https://github.com/grafana/grafana/issues/5765), thx [@mtanda](https://github.com/mtanda)
* **Cloudwatch**: Add support for alerting using the cloudwatch datasource [#8050](https://github.com/grafana/grafana/pull/8050), thx [@mtanda](https://github.com/mtanda)
* **Pagerduty**: Include triggering series in pagerduty notification [#8479](https://github.com/grafana/grafana/issues/8479), thx [@rickymoorhouse](https://github.com/rickymoorhouse)
+* **Timezone**: Time ranges like Today & Yesterday now work correctly when timezone setting is set to UTC [#8916](https://github.com/grafana/grafana/issues/8916), thx [@ctide](https://github.com/ctide)
+* **Prometheus**: Align $__interval with the step parameters. [#9226](https://github.com/grafana/grafana/pull/9226), thx [@alin-amana](https://github.com/alin-amana)
+* **Prometheus**: Autocomplete for label name and label value [#9208](https://github.com/grafana/grafana/pull/9208), thx [@mtanda](https://github.com/mtanda)
## Minor
* **SMTP**: Make it possible to set specific EHLO for smtp client. [#9319](https://github.com/grafana/grafana/issues/9319)
* **Dataproxy**: Allow grafan to renegotiate tls connection [#9250](https://github.com/grafana/grafana/issues/9250)
* **HTTP**: set net.Dialer.DualStack to true for all http clients [#9367](https://github.com/grafana/grafana/pull/9367)
* **Alerting**: Add diff and percent diff as series reducers [#9386](https://github.com/grafana/grafana/pull/9386), thx [@shanhuhai5739](https://github.com/shanhuhai5739)
+* **Slack**: Allow images to be uploaded to slack when Token is precent [#7175](https://github.com/grafana/grafana/issues/7175), thx [@xginn8](https://github.com/xginn8)
+* **Opsgenie**: Use their latest API instead of old version [#9399](https://github.com/grafana/grafana/pull/9399), thx [@cglrkn](https://github.com/cglrkn)
+* **Table**: Add support for displaying the timestamp with milliseconds [#9429](https://github.com/grafana/grafana/pull/9429), thx [@s1061123](https://github.com/s1061123)
+* **Hipchat**: Add metrics, message and image to hipchat notifications [#9110](https://github.com/grafana/grafana/issues/9110), thx [@eloo](https://github.com/eloo)
## Tech
* **Go**: Grafana is now built using golang 1.9
# 4.5.2 (2017-09-22)
-## Fixes
+## Fixes
* **Graphite**: Fix for issues with jsonData & graphiteVersion null errors [#9258](https://github.com/grafana/grafana/issues/9258)
* **Graphite**: Fix for Grafana internal metrics to Graphite sending NaN values [#9279](https://github.com/grafana/grafana/issues/9279)
* **HTTP API**: Fix for HEAD method requests [#9307](https://github.com/grafana/grafana/issues/9307)
@@ -44,7 +51,7 @@
* **MySQL**: Fixed issue with query editor not showing [#9247](https://github.com/grafana/grafana/issues/9247)
## Breaking changes
-* **Metrics**: The metric structure for internal metrics about Grafana published to graphite has changed. This might break dashboards for internal metrics.
+* **Metrics**: The metric structure for internal metrics about Grafana published to graphite has changed. This might break dashboards for internal metrics.
# 4.5.0 (2017-09-14)
@@ -73,7 +80,7 @@
### Breaking change
* **InfluxDB/Elasticsearch**: The panel & data source option named "Group by time interval" is now named "Min time interval" and does now always define a lower limit for the auto group by time. Without having to use `>` prefix (that prefix still works). This should in theory have close to zero actual impact on existing dashboards. It does mean that if you used this setting to define a hard group by time interval of, say "1d", if you zoomed to a time range wide enough the time range could increase above the "1d" range as the setting is now always considered a lower limit.
-* **Elasticsearch**: Elasticsearch metric queries without date histogram now return table formated data making table panel much easier to use for this use case. Should not break/change existing dashboards with stock panels but external panel plugins can be affected.
+* **Elasticsearch**: Elasticsearch metric queries without date histogram now return table formated data making table panel much easier to use for this use case. Should not break/change existing dashboards with stock panels but external panel plugins can be affected.
## Changes
diff --git a/README.md b/README.md
index 44bf4398fc2..40ec43e1c16 100644
--- a/README.md
+++ b/README.md
@@ -45,7 +45,7 @@ yarn install --pure-lockfile
npm run build
```
-To rebuild frontend assets (typesript, sass etc) as you change them start the watcher via.
+To rebuild frontend assets (typescript, sass etc) as you change them start the watcher via.
```bash
npm run watch
diff --git a/ROADMAP.md b/ROADMAP.md
index 62e6719c4f0..3ce0c33f088 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -17,7 +17,7 @@ But it will give you an idea of our current vision and plan.
### Long term
- Backend plugins to support more Auth options, Alerting data sources & notifications
-- Universial time series transformations for any data source (meta queries)
+- Universal time series transformations for any data source (meta queries)
- Reporting
- Web socket & live data streams
- Migrate to Angular2 or react
diff --git a/appveyor.yml b/appveyor.yml
index d626f6bd93f..19de1d3a793 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -7,7 +7,7 @@ clone_folder: c:\gopath\src\github.com\grafana\grafana
environment:
nodejs_version: "6"
GOPATH: c:\gopath
- GOVERSION: 1.9
+ GOVERSION: 1.9.1
install:
- rmdir c:\go /s /q
diff --git a/circle.yml b/circle.yml
index 0d535a9c1c2..ba44172ddf3 100644
--- a/circle.yml
+++ b/circle.yml
@@ -9,7 +9,7 @@ machine:
GOPATH: "/home/ubuntu/.go_workspace"
ORG_PATH: "github.com/grafana"
REPO_PATH: "${ORG_PATH}/grafana"
- GODIST: "go1.9.linux-amd64.tar.gz"
+ GODIST: "go1.9.1.linux-amd64.tar.gz"
post:
- mkdir -p ~/download
- mkdir -p ~/docker
diff --git a/conf/defaults.ini b/conf/defaults.ini
index dfa6bf99017..14e77449241 100644
--- a/conf/defaults.ini
+++ b/conf/defaults.ini
@@ -479,6 +479,7 @@ provider =
bucket_url =
bucket =
region =
+path =
access_key =
secret_key =
diff --git a/conf/sample.ini b/conf/sample.ini
index 89170000df6..1aedfbf6532 100644
--- a/conf/sample.ini
+++ b/conf/sample.ini
@@ -424,6 +424,7 @@
[external_image_storage.s3]
;bucket =
;region =
+;path =
;access_key =
;secret_key =
diff --git a/docs/sources/administration/cli.md b/docs/sources/administration/cli.md
index 645f75ab412..2be1881cfab 100644
--- a/docs/sources/administration/cli.md
+++ b/docs/sources/administration/cli.md
@@ -41,7 +41,7 @@ then there are two flags that can be used to set homepath and the config file pa
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:
-```
+```bash
curl -X PUT -H "Content-Type: application/json" -d '{
"oldPassword": "admin",
"newPassword": "newpass",
diff --git a/docs/sources/alerting/notifications.md b/docs/sources/alerting/notifications.md
index 359315650d9..de9e5abd472 100644
--- a/docs/sources/alerting/notifications.md
+++ b/docs/sources/alerting/notifications.md
@@ -48,12 +48,15 @@ external image destination if available or fallback to attaching the image in th
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.
+in the slack messages you have to configure either the [external image destination](#external-image-store) in Grafana,
+or a bot integration via Slack Apps. Follow Slack's guide to set up a bot integration and use the token provided
+https://api.slack.com/bot-users, which starts with "xoxb".
Setting | Description
---------- | -----------
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
+Token | If provided, Grafana will upload the generated image via Slack's file.upload API method, not the external image destination.
### PagerDuty
diff --git a/docs/sources/features/datasources/cloudwatch.md b/docs/sources/features/datasources/cloudwatch.md
index 61dd90d2881..29da06bfb1e 100644
--- a/docs/sources/features/datasources/cloudwatch.md
+++ b/docs/sources/features/datasources/cloudwatch.md
@@ -50,11 +50,12 @@ Create a file at `~/.aws/credentials`. That is the `HOME` path for user running
Example content:
- [default]
- aws_access_key_id = asdsadasdasdasd
- aws_secret_access_key = dasdasdsadasdasdasdsa
- region = us-west-2
-
+```bash
+[default]
+aws_access_key_id = asdsadasdasdasd
+aws_secret_access_key = dasdasdsadasdasdasdsa
+region = us-west-2
+```
## Metric Query Editor
@@ -117,7 +118,9 @@ Filters syntax:
Example `ec2_instance_attribute()` query
- ec2_instance_attribute(us-east-1, InstanceId, { "tag:Environment": [ "production" ] })
+```javascript
+ec2_instance_attribute(us-east-1, InstanceId, { "tag:Environment": [ "production" ] })
+```
### Selecting Attributes
@@ -156,7 +159,9 @@ Tags can be selected by prepending the tag name with `Tags.`
Example `ec2_instance_attribute()` query
- ec2_instance_attribute(us-east-1, Tags.Name, { "tag:Team": [ "sysops" ] })
+```javascript
+ec2_instance_attribute(us-east-1, Tags.Name, { "tag:Team": [ "sysops" ] })
+```
## Cost
diff --git a/docs/sources/features/datasources/elasticsearch.md b/docs/sources/features/datasources/elasticsearch.md
index 25cdb98c8c5..be4e3e78e49 100644
--- a/docs/sources/features/datasources/elasticsearch.md
+++ b/docs/sources/features/datasources/elasticsearch.md
@@ -38,8 +38,10 @@ Proxy access means that the Grafana backend will proxy all requests from the bro
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: "*"
+```bash
+http.cors.enabled: true
+http.cors.allow-origin: "*"
+```
### Index settings
diff --git a/docs/sources/features/panels/graph.md b/docs/sources/features/panels/graph.md
index 8933864d2d9..c3b0260c98b 100644
--- a/docs/sources/features/panels/graph.md
+++ b/docs/sources/features/panels/graph.md
@@ -56,44 +56,46 @@ options.
{{< docs-imagebox img="/img/docs/v43/graph_axes_grid_options.png" max-width= "900px" >}}
-The Axes tab controls the display of axes, grids and legend. The ``Left Y`` and ``Right Y`` can be customized using:
+The Axes tab controls the display of axes, grids and legend. The **Left Y** and **Right Y** can be customized using:
-- ``Unit`` - The display unit for the Y value
-- ``Grid Max`` - The maximum Y value. (default auto)
-- ``Grid Min`` - The minimum Y value. (default auto)
-- ``Label`` - The Y axis label (default "")
+- **Unit** - The display unit for the Y value
+- **Scale** -
+- **Y-Min** - The minimum Y value. (default auto)
+- **Y-Max** - The maximum Y value. (default auto)
+- **Label** - The Y axis label (default "")
-Axes can also be hidden by unchecking the appropriate box from `Show Axis`.
+Axes can also be hidden by unchecking the appropriate box from **Show**.
### X-Axis Mode
There are three options:
-- The default option is `Time` and means the x-axis represents time and that the data is grouped by time (for example, by hour or by minute).
+- The default option is **Time** and means the x-axis represents time and that the data is grouped by time (for example, by hour or by minute).
-- The `Series` option means that the data is grouped by series and not by time. The y-axis still represents the value.
+- The **Series** option means that the data is grouped by series and not by time. The y-axis still represents the value.
{{< docs-imagebox img="/img/docs/v45/graph-x-axis-mode-series.png" max-width="700px">}}
-- The `Histogram` option converts the graph into a histogram. 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. Histograms and buckets are described in more detail [here](http://docs.grafana.org/features/panels/heatmap/#histograms-and-buckets).
+- The **Histogram** option converts the graph into a histogram. 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. Histograms and buckets are described in more detail [here](http://docs.grafana.org/features/panels/heatmap/#histograms-and-buckets).
### Legend
-The legend hand be hidden by checking the ``Show`` checkbox. If it's shown, it can be
-displayed as a table of values by checking the ``Table`` checkbox. Series with no
-values can be hidden from the legend using the ``Hide empty`` checkbox.
+The legend hand be hidden by checking the **Show** checkbox. If it's shown, it can be
+displayed as a table of values by checking the **Table** checkbox. Series with no
+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
-- ``Max`` - Maximum of all values returned from the metric query
-- ``Avg`` - Average of all values returned from metric query
-- ``Decimals`` - Controls how many decimals are displayed for legend values (and graph hover tooltips)
+
+- **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
+- **Max** - Maximum of all values returned from the metric query
+- **Avg** - Average of all values returned from metric query
+- **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 your metric query is using. All the above legend values cannot
@@ -115,23 +117,23 @@ the graph crosses a particular threshold.
### Chart Options
-- ``Bar`` - Display values as a bar chart
-- ``Lines`` - Display values as a line graph
-- ``Points`` - Display points for values
+- **Bar** - Display values as a bar chart
+- **Lines** - Display values as a line graph
+- **Points** - Display points for values
### Line Options
-- ``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
+- **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 displayed as a group.
-- ``Stack`` - Each series is stacked on top of another
-- ``Percent`` - Each series is drawn as a percentage of the total of all series
+- **Stack** - Each series is stacked on top of another
+- **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.
@@ -140,12 +142,12 @@ If you have stack enabled, you can select what the mouse hover feature should sh
### Rendering
-- ``Flot`` - Render the graphs in the browser using Flot (default)
-- ``Graphite PNG`` - Render the graph on the server using graphite's render API.
+- **Flot** - Render the graphs in the browser using Flot (default)
+- **Graphite PNG** - Render the graph on the server using graphite's render API.
### Tooltip
-- ``All series`` - Show all series on the same tooltip and a x crosshairs to help follow all series
+- **All series** - Show all series on the same tooltip and a x crosshairs to help follow all series
### Series Specific Overrides
@@ -158,12 +160,6 @@ There is an option under Series overrides to draw lines as dashes. Set Dashes to
## Time Range
-<<<<<<< HEAD
The time range tab allows you to override the dashboard time range and specify a panel specific time. Either through a relative from now time option or through a timeshift.
{{< docs-imagebox img="/img/docs/v45/graph-time-range.png" max-width= "900px" >}}
-||||||| merged common ancestors
-
-=======
-
->>>>>>> 0a65100eaf64cd57b38110001bf614630821610c
diff --git a/docs/sources/features/panels/singlestat.md b/docs/sources/features/panels/singlestat.md
index cf04419dbc5..5e2cb36600b 100644
--- a/docs/sources/features/panels/singlestat.md
+++ b/docs/sources/features/panels/singlestat.md
@@ -22,20 +22,20 @@ The singlestat panel has a normal query editor to allow you define your exact me
{{< docs-imagebox img="/img/docs/v45/singlestat-value-options.png" class="docs-image--no-shadow" max-width="900px" >}}
-1. `Stats`: The Stats field let you set the function (min, max, average, current, total, first, delta, range) that your entire query is reduced into a single value 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.
-2. `Prefix/Postfix`: The Prefix/Postfix fields let you define a custom label to appear *before/after* the value. The `$__name` variable can be used here to use the series name or alias from the metric query.
-3. `Units`: Units are appended to the the Singlestat within the panel, and will respect the color and threshold settings for the value.
-4. `Decimals`: The Decimal field allows you to override the automatic decimal precision, and set it explicitly.
-5. `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.
+1. **Stats**: The Stats field let you set the function (min, max, average, current, total, first, delta, range) that your entire query is reduced into a single value 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.
+2. **Prefix/Postfix**: The Prefix/Postfix fields let you define a custom label to appear *before/after* the value. The `$__name` variable can be used here to use the series name or alias from the metric query.
+3. **Units**: Units are appended to the the Singlestat within the panel, and will respect the color and threshold settings for the value.
+4. **Decimals**: The Decimal field allows you to override the automatic decimal precision, and set it explicitly.
+5. **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.
### Coloring
@@ -43,11 +43,11 @@ The coloring options of the Singlestat Panel config allow you to dynamically cha
{{< docs-imagebox img="/img/docs/v45/singlestat-color-options.png" max-width="500px" class="docs-image--right docs-image--no-shadow">}}
-1. `Background`: This checkbox applies the configured thresholds and colors to the entirety of the Singlestat Panel background.
-2. `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.
-3. `Colors`: Select a color and opacity
-4. `Value`: This checkbox applies the configured thresholds and colors to the summary stat.
-5. `Invert order`: This link toggles the threshold color order.For example: Green, Orange, Red (
) will become Red, Orange, Green (
).
+1. **Background**: This checkbox applies the configured thresholds and colors to the entirety of the Singlestat Panel background.
+2. **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.
+3. **Colors**: Select a color and opacity
+4. **Value**: This checkbox applies the configured thresholds and colors to the summary stat.
+5. **Invert order**: This link toggles the threshold color order.For example: Green, Orange, Red (
) will become Red, Orange, Green (
).
### Spark Lines
@@ -55,62 +55,35 @@ Sparklines are a great way of seeing the historical data related to the summary
{{< docs-imagebox img="/img/docs/v45/singlestat-spark-options.png" max-width="500px" class="docs-image--right docs-image--no-shadow">}}
-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. `Full Height`: Check if you want the sparklines to take up the full panel height, or uncheck if they should be below the main Singlestat value.
-3. `Line Color`: This color selection applies to the color of the sparkline itself.
-4. `Fill Color`: This color selection applies to the area below the sparkline.
+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. **Full Height**: Check if you want the sparklines to take up the full panel height, or uncheck if they should be below the main Singlestat value.
+3. **Line Color**: This color selection applies to the color of the sparkline itself.
+4. **Fill Color**: This color selection applies to the area below the sparkline.
-=======
-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.
->>>>>>> 0a65100eaf64cd57b38110001bf614630821610c
## Troubleshooting
diff --git a/docs/sources/features/panels/table_panel.md b/docs/sources/features/panels/table_panel.md
index 9c112c81265..a3e56c72960 100644
--- a/docs/sources/features/panels/table_panel.md
+++ b/docs/sources/features/panels/table_panel.md
@@ -25,8 +25,8 @@ The table panel has many ways to manipulate your data for optimal presentation.
{{< docs-imagebox img="/img/docs/v45/table_options.png" class="docs-image--no-shadow" max-width= "500px" >}}
-1. `Data`: Control how your query is transformed into a table.
-2. `Paging`: Table display options.
+1. **Data**: Control how your query is transformed into a table.
+2. **Paging**: Table display options.
## Data to Table
@@ -43,20 +43,20 @@ you want in the table. Only applicable for some transforms.
{{< docs-imagebox img="/img/docs/v45/table_ts_to_rows.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.
+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
{{< docs-imagebox img="/img/docs/v45/table_ts_to_columns.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.
+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
{{< docs-imagebox img="/img/docs/v45/table_ts_to_aggregations.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.
+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
@@ -70,7 +70,7 @@ mode then any queries you have in the metrics tab will be ignored.
{{< docs-imagebox img="/img/docs/v45/table_json_data.png" max-width="500px" >}}
-If you have an Elasticsearch **Raw Document** query or an Elasticsearch query without a `date histogram` use this
+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.
@@ -80,9 +80,9 @@ transform mode and pick the columns using the **Columns** section.
{{< docs-imagebox img="/img/docs/v45/table_paging.png" class="docs-image--no-shadow docs-image--right" max-width="350px" >}}
-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.
-3. `Font Size`: The `font size` field allows you to increase or decrease the size for the panel, relative to the default font size.
+1. **Rows Per Page**: The table display fields allow you to control how many rows per page there should be. For example, if your table had 95 records with a rows per page value of 10, your table would be split across 10 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.
+3. **Font Size**: The font size field allows you to increase or decrease the size for the panel, relative to the default font size.
## Column Styles
@@ -91,9 +91,9 @@ The column styles allow you control how dates and numbers are formatted.
{{< docs-imagebox img="/img/docs/v45/table_column_styles.png" class="docs-image--no-shadow" >}}
-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. `Column Header`: Title for the column, when using a Regex the title can include replacement strings like `$1`.
-3. `Add column style rule`: Add new column rule.
-4. `Thresholds` and `Coloring`: Specify color mode and thresholds limits.
-5. `Type`: The three supported types of types are `Number`, `String` and `Date`. `Unit` and `Decimals`: Specify unit and decimal precision for numbers.`Format`: Specify date format for dates.
+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. **Column Header**: Title for the column, when using a Regex the title can include replacement strings like `$1`.
+3. **Add column style rule**: Add new column rule.
+4. **Thresholds and Coloring**: Specify color mode and thresholds limits.
+5. **Type**: The three supported types of types are **Number**, **String** and **Date**. **Unit** and **Decimals**: Specify unit and decimal precision for numbers. **Format**: Specify date format for dates.
diff --git a/docs/sources/features/panels/text.md b/docs/sources/features/panels/text.md
index ae37df16b9e..cc8269793bd 100644
--- a/docs/sources/features/panels/text.md
+++ b/docs/sources/features/panels/text.md
@@ -18,6 +18,6 @@ The text panel lets you make information and description panels etc. for your da
{{< docs-imagebox img="/img/docs/v45/text-options.png" max-width="600px" class="docs-image--no-shadow">}}
-1. `Mode`: Here you can choose between markdown, HTML or text.
-2. `Content`: Here you write your content.
+1. **Mode**: Here you can choose between markdown, HTML or text.
+2. **Content**: Here you write your content.
diff --git a/docs/sources/http_api/admin.md b/docs/sources/http_api/admin.md
index 55bec79c7f8..3ef5fb1136a 100644
--- a/docs/sources/http_api/admin.md
+++ b/docs/sources/http_api/admin.md
@@ -23,158 +23,162 @@ Only works with Basic Authentication (username and password). See [introduction]
**Example Request**:
- GET /api/admin/settings
- Accept: application/json
- Content-Type: application/json
+```bash
+GET /api/admin/settings
+Accept: application/json
+Content-Type: application/json
+```
**Example Response**:
- HTTP/1.1 200
- Content-Type: application/json
-
- {
- "DEFAULT":
- {
- "app_mode":"production"},
- "analytics":
- {
- "google_analytics_ua_id":"",
- "reporting_enabled":"false"
- },
- "auth.anonymous":{
- "enabled":"true",
- "org_name":"Main Org.",
- "org_role":"Viewer"
- },
- "auth.basic":{
- "enabled":"false"
- },
- "auth.github":{
- "allow_sign_up":"false",
- "allowed_domains":"",
- "allowed_organizations":"",
- "api_url":"https://api.github.com/user",
- "auth_url":"https://github.com/login/oauth/authorize",
- "client_id":"some_id",
- "client_secret":"************",
- "enabled":"false",
- "scopes":"user:email",
- "team_ids":"",
- "token_url":"https://github.com/login/oauth/access_token"
- },
- "auth.google":{
- "allow_sign_up":"false","allowed_domains":"",
- "api_url":"https://www.googleapis.com/oauth2/v1/userinfo",
- "auth_url":"https://accounts.google.com/o/oauth2/auth",
- "client_id":"some_client_id",
- "client_secret":"************",
- "enabled":"false",
- "scopes":"https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email",
- "token_url":"https://accounts.google.com/o/oauth2/token"
- },
- "auth.ldap":{
- "config_file":"/etc/grafana/ldap.toml",
- "enabled":"false"
- },
- "auth.proxy":{
- "auto_sign_up":"true",
- "enabled":"false",
- "header_name":"X-WEBAUTH-USER",
- "header_property":"username"
- },
- "dashboards.json":{
- "enabled":"false",
- "path":"/var/lib/grafana/dashboards"
- },
- "database":{
- "host":"127.0.0.1:0000",
- "name":"grafana",
- "password":"************",
- "path":"grafana.db",
- "ssl_mode":"disable",
- "type":"sqlite3",
- "user":"root"
- },
- "emails":{
- "templates_pattern":"emails/*.html",
- "welcome_email_on_sign_up":"false"
- },
- "event_publisher":{
- "enabled":"false",
- "exchange":"grafana_events",
- "rabbitmq_url":"amqp://localhost/"
- },
- "log":{
- "buffer_len":"10000",
- "level":"Info",
- "mode":"file"
- },
- "log.console":{
- "level":""
- },
- "log.file":{
- "daily_rotate":"true",
- "file_name":"",
- "level":"",
- "log_rotate":"true",
- "max_days":"7",
- "max_lines":"1000000",
- "max_lines_shift":"28",
- "max_size_shift":""
- },
- "paths":{
- "data":"/tsdb/grafana",
- "logs":"/logs/apps/grafana"},
- "security":{
- "admin_password":"************",
- "admin_user":"admin",
- "cookie_remember_name":"grafana_remember",
- "cookie_username":"grafana_user",
- "disable_gravatar":"false",
- "login_remember_days":"7",
- "secret_key":"************"
- },
- "server":{
- "cert_file":"",
- "cert_key":"",
- "domain":"mygraf.com",
- "enable_gzip":"false",
- "enforce_domain":"false",
- "http_addr":"127.0.0.1",
- "http_port":"0000",
- "protocol":"http",
- "root_url":"%(protocol)s://%(domain)s:%(http_port)s/",
- "router_logging":"true",
- "data_proxy_logging":"true",
- "static_root_path":"public"
- },
- "session":{
- "cookie_name":"grafana_sess",
- "cookie_secure":"false",
- "gc_interval_time":"",
- "provider":"file",
- "provider_config":"sessions",
- "session_life_time":"86400"
- },
- "smtp":{
- "cert_file":"",
- "enabled":"false",
- "from_address":"admin@grafana.localhost",
- "from_name":"Grafana",
- "ehlo_identity":"dashboard.example.com",
- "host":"localhost:25",
- "key_file":"",
- "password":"************",
- "skip_verify":"false",
- "user":""},
- "users":{
- "allow_org_create":"true",
- "allow_sign_up":"false",
- "auto_assign_org":"true",
- "auto_assign_org_role":"Viewer"
- }
- }
+```bash
+HTTP/1.1 200
+Content-Type: application/json
+{
+"DEFAULT":
+{
+ "app_mode":"production"},
+ "analytics":
+ {
+ "google_analytics_ua_id":"",
+ "reporting_enabled":"false"
+ },
+ "auth.anonymous":{
+ "enabled":"true",
+ "org_name":"Main Org.",
+ "org_role":"Viewer"
+ },
+ "auth.basic":{
+ "enabled":"false"
+ },
+ "auth.github":{
+ "allow_sign_up":"false",
+ "allowed_domains":"",
+ "allowed_organizations":"",
+ "api_url":"https://api.github.com/user",
+ "auth_url":"https://github.com/login/oauth/authorize",
+ "client_id":"some_id",
+ "client_secret":"************",
+ "enabled":"false",
+ "scopes":"user:email",
+ "team_ids":"",
+ "token_url":"https://github.com/login/oauth/access_token"
+ },
+ "auth.google":{
+ "allow_sign_up":"false","allowed_domains":"",
+ "api_url":"https://www.googleapis.com/oauth2/v1/userinfo",
+ "auth_url":"https://accounts.google.com/o/oauth2/auth",
+ "client_id":"some_client_id",
+ "client_secret":"************",
+ "enabled":"false",
+ "scopes":"https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email",
+ "token_url":"https://accounts.google.com/o/oauth2/token"
+ },
+ "auth.ldap":{
+ "config_file":"/etc/grafana/ldap.toml",
+ "enabled":"false"
+ },
+ "auth.proxy":{
+ "auto_sign_up":"true",
+ "enabled":"false",
+ "header_name":"X-WEBAUTH-USER",
+ "header_property":"username"
+ },
+ "dashboards.json":{
+ "enabled":"false",
+ "path":"/var/lib/grafana/dashboards"
+ },
+ "database":{
+ "host":"127.0.0.1:0000",
+ "name":"grafana",
+ "password":"************",
+ "path":"grafana.db",
+ "ssl_mode":"disable",
+ "type":"sqlite3",
+ "user":"root"
+ },
+ "emails":{
+ "templates_pattern":"emails/*.html",
+ "welcome_email_on_sign_up":"false"
+ },
+ "event_publisher":{
+ "enabled":"false",
+ "exchange":"grafana_events",
+ "rabbitmq_url":"amqp://localhost/"
+ },
+ "log":{
+ "buffer_len":"10000",
+ "level":"Info",
+ "mode":"file"
+ },
+ "log.console":{
+ "level":""
+ },
+ "log.file":{
+ "daily_rotate":"true",
+ "file_name":"",
+ "level":"",
+ "log_rotate":"true",
+ "max_days":"7",
+ "max_lines":"1000000",
+ "max_lines_shift":"28",
+ "max_size_shift":""
+ },
+ "paths":{
+ "data":"/tsdb/grafana",
+ "logs":"/logs/apps/grafana"},
+ "security":{
+ "admin_password":"************",
+ "admin_user":"admin",
+ "cookie_remember_name":"grafana_remember",
+ "cookie_username":"grafana_user",
+ "disable_gravatar":"false",
+ "login_remember_days":"7",
+ "secret_key":"************"
+ },
+ "server":{
+ "cert_file":"",
+ "cert_key":"",
+ "domain":"mygraf.com",
+ "enable_gzip":"false",
+ "enforce_domain":"false",
+ "http_addr":"127.0.0.1",
+ "http_port":"0000",
+ "protocol":"http",
+ "root_url":"%(protocol)s://%(domain)s:%(http_port)s/",
+ "router_logging":"true",
+ "data_proxy_logging":"true",
+ "static_root_path":"public"
+ },
+ "session":{
+ "cookie_name":"grafana_sess",
+ "cookie_secure":"false",
+ "gc_interval_time":"",
+ "provider":"file",
+ "provider_config":"sessions",
+ "session_life_time":"86400"
+ },
+ "smtp":{
+ "cert_file":"",
+ "enabled":"false",
+ "from_address":"admin@grafana.localhost",
+ "from_name":"Grafana",
+ "ehlo_identity":"dashboard.example.com",
+ "host":"localhost:25",
+ "key_file":"",
+ "password":"************",
+ "skip_verify":"false",
+ "user":""
+ },
+ "users":{
+ "allow_org_create":"true",
+ "allow_sign_up":"false",
+ "auto_assign_org":"true",
+ "auto_assign_org_role":"Viewer"
+ }
+}
+```
## Grafana Stats
`GET /api/admin/stats`
@@ -183,26 +187,30 @@ Only works with Basic Authentication (username and password). See [introduction]
**Example Request**:
- GET /api/admin/stats
- Accept: application/json
- Content-Type: application/json
+```bash
+GET /api/admin/stats
+Accept: application/json
+Content-Type: application/json
+```
**Example Response**:
- HTTP/1.1 200
- Content-Type: application/json
+```json
+HTTP/1.1 200
+Content-Type: application/json
- {
- "user_count":2,
- "org_count":1,
- "dashboard_count":4,
- "db_snapshot_count":2,
- "db_tag_count":6,
- "data_source_count":1,
- "playlist_count":1,
- "starred_db_count":2,
- "grafana_admin_count":2
- }
+{
+ "user_count":2,
+ "org_count":1,
+ "dashboard_count":4,
+ "db_snapshot_count":2,
+ "db_tag_count":6,
+ "data_source_count":1,
+ "playlist_count":1,
+ "starred_db_count":2,
+ "grafana_admin_count":2
+}
+```
## Global Users
@@ -211,24 +219,28 @@ Only works with Basic Authentication (username and password). See [introduction]
Create new user. Only works with Basic Authentication (username and password). See [introduction](http://docs.grafana.org/http_api/admin/#admin-api) for an explanation.
**Example Request**:
+```json
- POST /api/admin/users HTTP/1.1
- Accept: application/json
- Content-Type: application/json
+POST /api/admin/users HTTP/1.1
+Accept: application/json
+Content-Type: application/json
- {
- "name":"User",
- "email":"user@graf.com",
- "login":"user",
- "password":"userpassword"
- }
+{
+ "name":"User",
+ "email":"user@graf.com",
+ "login":"user",
+ "password":"userpassword"
+}
+```
**Example Response**:
- HTTP/1.1 200
- Content-Type: application/json
+```json
+HTTP/1.1 200
+Content-Type: application/json
- {"id":5,"message":"User created"}
+{"id":5,"message":"User created"}
+```
## Password for User
@@ -239,18 +251,22 @@ Change password for a specific user.
**Example Request**:
- PUT /api/admin/users/2/password HTTP/1.1
- Accept: application/json
- Content-Type: application/json
+```json
+PUT /api/admin/users/2/password HTTP/1.1
+Accept: application/json
+Content-Type: application/json
- {"password":"userpassword"}
+{"password":"userpassword"}
+```
**Example Response**:
- HTTP/1.1 200
- Content-Type: application/json
+```json
+HTTP/1.1 200
+Content-Type: application/json
- {"message": "User password updated"}
+{"message": "User password updated"}
+```
## Permissions
@@ -260,18 +276,22 @@ Only works with Basic Authentication (username and password). See [introduction]
**Example Request**:
- PUT /api/admin/users/2/permissions HTTP/1.1
- Accept: application/json
- Content-Type: application/json
+```json
+PUT /api/admin/users/2/permissions HTTP/1.1
+Accept: application/json
+Content-Type: application/json
- {"isGrafanaAdmin": true}
+{"isGrafanaAdmin": true}
+```
**Example Response**:
- HTTP/1.1 200
- Content-Type: application/json
+```json
+HTTP/1.1 200
+Content-Type: application/json
- {message: "User permissions updated"}
+{message: "User permissions updated"}
+```
## Delete global User
@@ -281,16 +301,20 @@ Only works with Basic Authentication (username and password). See [introduction]
**Example Request**:
- DELETE /api/admin/users/2 HTTP/1.1
- Accept: application/json
- Content-Type: application/json
+```json
+DELETE /api/admin/users/2 HTTP/1.1
+Accept: application/json
+Content-Type: application/json
+```
**Example Response**:
- HTTP/1.1 200
- Content-Type: application/json
+```json
+HTTP/1.1 200
+Content-Type: application/json
- {message: "User deleted"}
+{message: "User deleted"}
+```
## Pause all alerts
@@ -300,13 +324,15 @@ Only works with Basic Authentication (username and password). See [introduction]
**Example Request**:
- POST /api/admin/pause-all-alerts HTTP/1.1
- Accept: application/json
- Content-Type: application/json
+```json
+POST /api/admin/pause-all-alerts HTTP/1.1
+Accept: application/json
+Content-Type: application/json
- {
- "paused": true
- }
+{
+ "paused": true
+}
+```
JSON Body schema:
@@ -314,7 +340,9 @@ JSON Body schema:
**Example Response**:
- HTTP/1.1 200
- Content-Type: application/json
+```json
+HTTP/1.1 200
+Content-Type: application/json
- {state: "new state", message: "alerts pause/un paused", "alertsAffected": 100}
+{state: "new state", message: "alerts pause/un paused", "alertsAffected": 100}
+```
\ No newline at end of file
diff --git a/docs/sources/http_api/alerting.md b/docs/sources/http_api/alerting.md
index 1aab7253373..c5172c64203 100644
--- a/docs/sources/http_api/alerting.md
+++ b/docs/sources/http_api/alerting.md
@@ -23,11 +23,12 @@ This API can also be used to create, update and delete alert notifications.
**Example Request**:
- GET /api/alerts HTTP/1.1
- Accept: application/json
- Content-Type: application/json
- Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
-
+```http
+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:
@@ -41,28 +42,30 @@ This API can also be used to create, update and delete alert notifications.
**Example Response**:
- HTTP/1.1 200
- Content-Type: application/json
- [
+```http
+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": [
{
- "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"
+ "metric": "fire",
+ "tags": null,
+ "value": 5.349999999999999
}
- ]
+ "newStateDate": "2016-12-25",
+ "executionError": "",
+ "dashboardUri": "http://grafana.com/dashboard/db/sensors"
+ }
+]
+```
## Get one alert
@@ -70,26 +73,30 @@ This API can also be used to create, update and delete alert notifications.
**Example Request**:
- GET /api/alerts/1 HTTP/1.1
- Accept: application/json
- Content-Type: application/json
- Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
+```http
+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"
- }
+```http
+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
@@ -97,14 +104,16 @@ This API can also be used to create, update and delete alert notifications.
**Example Request**:
- POST /api/alerts/1/pause HTTP/1.1
- Accept: application/json
- Content-Type: application/json
- Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
+```http
+POST /api/alerts/1/pause HTTP/1.1
+Accept: application/json
+Content-Type: application/json
+Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
- {
- "paused": true
- }
+{
+ "paused": true
+}
+```
The :id query parameter is the id of the alert to be paused or unpaused.
@@ -114,13 +123,15 @@ JSON Body Schema:
**Example Response**:
- HTTP/1.1 200
- Content-Type: application/json
- {
- "alertId": 1,
- "state": "Paused",
- "message": "alert paused"
- }
+```http
+HTTP/1.1 200
+Content-Type: application/json
+{
+ "alertId": 1,
+ "state": "Paused",
+ "message": "alert paused"
+}
+```
## Get alert notifications
@@ -128,26 +139,29 @@ JSON Body Schema:
**Example Request**:
- GET /api/alert-notifications HTTP/1.1
- Accept: application/json
- Content-Type: application/json
- Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
-
+```http
+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
+```http
+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"
- }
+{
+ "id": 1,
+ "name": "Team A",
+ "type": "email",
+ "isDefault": true,
+ "created": "2017-01-01 12:45",
+ "updated": "2017-01-01 12:45"
+}
+```
## Create alert notification
@@ -155,34 +169,37 @@ JSON Body Schema:
**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"
- }
- }
+```http
+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"
- }
+```http
+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
@@ -190,35 +207,38 @@ JSON Body Schema:
**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"
- }
- }
+```http
+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"
- }
+```http
+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
@@ -226,15 +246,19 @@ JSON Body Schema:
**Example Request**:
- DELETE /api/alert-notifications/1 HTTP/1.1
- Accept: application/json
- Content-Type: application/json
- Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
+```http
+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"
- }
+```http
+HTTP/1.1 200
+Content-Type: application/json
+{
+ "message": "Notification deleted"
+}
+```
\ No newline at end of file
diff --git a/docs/sources/http_api/annotations.md b/docs/sources/http_api/annotations.md
new file mode 100644
index 00000000000..2f148e9aded
--- /dev/null
+++ b/docs/sources/http_api/annotations.md
@@ -0,0 +1,189 @@
++++
+title = "Annotations HTTP API "
+description = "Grafana Annotations HTTP API"
+keywords = ["grafana", "http", "documentation", "api", "annotation", "annotations", "comment"]
+aliases = ["/http_api/annotations/"]
+type = "docs"
+[menu.docs]
+name = "Annotations"
+identifier = "annotationshttp"
+parent = "http_api"
++++
+
+# Annotations resources / actions
+
+This is the API documentation for the new Grafana Annotations feature released in Grafana 4.6. Annotations are saved in the Grafana database (sqlite, mysql or postgres). Annotations can be global annotations that can be shown on any dashboard by configuring an annotation data source - they are filtered by tags. Or they can be tied to a panel on a dashboard and are then only shown on that panel.
+
+## Find Annotations
+
+`GET /api/annotations?from=1506676478816&to=1507281278816&tags=tag1&tags=tag2&limit=100`
+
+**Example Request**:
+
+```http
+GET /api/annotations?from=1506676478816&to=1507281278816&tags=tag1&tags=tag2&limit=100 HTTP/1.1
+Accept: application/json
+Content-Type: application/json
+Authorization: Basic YWRtaW46YWRtaW4=
+```
+
+
+Query Parameters:
+
+- `from`: epoch datetime in milliseconds. Optional.
+- `to`: epoch datetime in milliseconds. Optional.
+- `limit`: number. Optional - default is 10. Max limit for results returned.
+- `alertId`: number. Optional. Find annotations for a specified alert.
+- `dashboardId`: number. Optional. Find annotations that are scoped to a specific dashboard
+- `panelId`: number. Optional. Find annotations that are scoped to a specific panel
+- `tags`: string. Optional. Use this to filter global annotations. Global annotations are annotations from an annotation data source that are not connected specifically to a dashboard or panel. To do an "AND" filtering with multiple tags, specify the tags parameter multiple times e.g. `tags=tag1&tags=tag2`.
+
+**Example Response**:
+
+```http
+HTTP/1.1 200
+Content-Type: application/json
+[
+ {
+ "id": 1124,
+ "alertId": 0,
+ "dashboardId": 468,
+ "panelId": 2,
+ "userId": 1,
+ "userName": "",
+ "newState": "",
+ "prevState": "",
+ "time": 1507266395000,
+ "text": "test",
+ "metric": "",
+ "regionId": 1123,
+ "type": "event",
+ "tags": [
+ "tag1",
+ "tag2"
+ ],
+ "data": {}
+ },
+ {
+ "id": 1123,
+ "alertId": 0,
+ "dashboardId": 468,
+ "panelId": 2,
+ "userId": 1,
+ "userName": "",
+ "newState": "",
+ "prevState": "",
+ "time": 1507265111000,
+ "text": "test",
+ "metric": "",
+ "regionId": 1123,
+ "type": "event",
+ "tags": [
+ "tag1",
+ "tag2"
+ ],
+ "data": {}
+ }
+]
+```
+
+## Create Annotation
+
+Creates an annotation in the Grafana database. The `dashboardId` and `panelId` fields are optional. If they are not specified then a global annotation is created and can be queried in any dashboard that adds the Grafana annotations data source.
+
+`POST /api/annotations`
+
+**Example Request**:
+
+```json
+POST /api/annotations HTTP/1.1
+Accept: application/json
+Content-Type: application/json
+
+{
+ "dashboardId":468,
+ "panelId":1,
+ "time":1507037197339,
+ "isRegion":true,
+ "timeEnd":1507180805056,
+ "tags":["tag1","tag2"],
+ "text":"Annotation Description"
+}
+```
+
+**Example Response**:
+
+```json
+HTTP/1.1 200
+Content-Type: application/json
+
+{"message":"Annotation added"}
+```
+
+## Update Annotation
+
+`PUT /api/annotations/:id`
+
+**Example Request**:
+
+```json
+PUT /api/annotations/1141 HTTP/1.1
+Accept: application/json
+Content-Type: application/json
+
+{
+ "time":1507037197339,
+ "isRegion":true,
+ "timeEnd":1507180805056,
+ "text":"Annotation Description",
+ "tags":["tag3","tag4","tag5"]
+}
+```
+
+## Delete Annotation By Id
+
+`DELETE /api/annotation/:id`
+
+Deletes the annotation that matches the specified id.
+
+**Example Request**:
+
+```http
+DELETE /api/annotation/1 HTTP/1.1
+Accept: application/json
+Content-Type: application/json
+Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
+```
+
+**Example Response**:
+
+```http
+HTTP/1.1 200
+Content-Type: application/json
+
+{"message":"Annotation deleted"}
+```
+
+## Delete Annotation By RegionId
+
+`DELETE /api/annotation/region/:id`
+
+Deletes the annotation that matches the specified region id. A region is an annotation that covers a timerange and has a start and end time. In the Grafana database, this is a stored as two annotations connected by a region id.
+
+**Example Request**:
+
+```http
+DELETE /api/annotation/region/1 HTTP/1.1
+Accept: application/json
+Content-Type: application/json
+Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
+```
+
+**Example Response**:
+
+```http
+HTTP/1.1 200
+Content-Type: application/json
+
+{"message":"Annotation region deleted"}
+```
diff --git a/docs/sources/http_api/auth.md b/docs/sources/http_api/auth.md
index d8ded124ac5..b526031fdeb 100644
--- a/docs/sources/http_api/auth.md
+++ b/docs/sources/http_api/auth.md
@@ -21,7 +21,7 @@ If basic auth is enabled (it is enabled by default) you can authenticate your HT
standard basic auth. Basic auth will also authenticate LDAP users.
curl example:
-```
+```bash
?curl http://admin:admin@localhost:3000/api/org
{"id":1,"name":"Main Org."}
```
@@ -36,9 +36,11 @@ You use the token in all requests in the `Authorization` header, like this:
**Example**:
- GET http://your.grafana.com/api/dashboards/db/mydash HTTP/1.1
- Accept: application/json
- Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
+```http
+GET http://your.grafana.com/api/dashboards/db/mydash HTTP/1.1
+Accept: application/json
+Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
+```
The `Authorization` header value should be `Bearer - -
-{colorPaletteItems}
+