Skip to content

Commit

Permalink
Merge remote-tracking branch 'grafana/master' into move-threshold-and…
Browse files Browse the repository at this point in the history
…-mapping-to-field

* grafana/master: (35 commits)
  noImplicitAny: Lower count to about 3450 (grafana#17799)
  Graphite: Fixes issue with seriesByTag & function with variable param (grafana#17795)
  noImplicitAny: Reduce errors to 3800-ish (grafana#17781)
  Graphite: remove feature that moves alias function last (grafana#17791)
  Explore: Adds URL support for select mode (grafana#17755)
  TestData: add option to increase the number of test streams (grafana#17789)
  Usage Stats: Update known datasource plugins (grafana#17787)
  Docs: Adds section on Querying Logs for Elasticsearch (grafana#17730)
  Docs: Adds section on Querying Logs for InfluxDB (grafana#17726)
  Devenv: makes the grafana users default for saml. (grafana#17782)
  Explore: Displays only one Time column as configured in TimeZone settings (grafana#17775)
  Markdown: Replace rendering library (grafana#17686)
  ApiKeys: Fix check for UTC timezone (grafana#17776)
  Prometheus: Minor style fix (grafana#17773)
  Docs: fixed notifications table
  Auth: Allow expiration of API keys (grafana#17678)
  17278 prometheus step align utc (grafana#17477)
  Docs: Update release guide  (grafana#17759)
  release: update latest.json to v6.2.5 (grafana#17767)
  release: 6.2.5 changelog (grafana#17766)
  ...
  • Loading branch information
ryantxu committed Jun 27, 2019
2 parents 8dadad1 + 0b9de3f commit 6b08472
Show file tree
Hide file tree
Showing 209 changed files with 4,056 additions and 1,427 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# 6.3.0 (unreleased)

# 6.2.5 (2019-06-25)

### Features / Enhancements
* **Grafana-CLI**: Wrapper for `grafana-cli` within RPM/DEB packages and config/homepath are now global flags. [#17695](https://github.com/grafana/grafana/pull/17695), [@gotjosh](https://github.com/gotjosh)
* **Panel**: Fully escape html in drilldown links (was only sanitized before) . [#17731](https://github.com/grafana/grafana/pull/17731), [@dehrax](https://github.com/dehrax)

### Bug Fixes
* **Config**: Fix connectionstring for remote_cache in defaults.ini. [#17675](https://github.com/grafana/grafana/pull/17675), [@kylebrandt](https://github.com/kylebrandt)
* **Elasticsearch**: Fix empty query (via template variable) should be sent as wildcard. [#17488](https://github.com/grafana/grafana/pull/17488), [@davewat](https://github.com/davewat)
* **HTTP-Server**: Fix Strict-Transport-Security header. [#17644](https://github.com/grafana/grafana/pull/17644), [@kylebrandt](https://github.com/kylebrandt)
* **TablePanel**: fix annotations display. [#17646](https://github.com/grafana/grafana/pull/17646), [@ryantxu](https://github.com/ryantxu)

# 6.2.4 (2019-06-18)

### Bug Fixes
Expand Down
8 changes: 6 additions & 2 deletions conf/defaults.ini
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,9 @@ signout_redirect_url =
# This setting is ignored if multiple OAuth providers are configured.
oauth_auto_login = false

# limit of api_key seconds to live before expiration
api_key_max_seconds_to_live = -1

#################################### Anonymous Auth ######################
[auth.anonymous]
# enable anonymous access
Expand Down Expand Up @@ -394,8 +397,9 @@ enabled = false
config_file = /etc/grafana/ldap.toml
allow_sign_up = true

# LDAP background sync (Enterprise only)
sync_cron = @hourly
# LDAP backround sync (Enterprise only)
# At 1 am every day
sync_cron = "0 0 1 * * *"
active_sync_enabled = false

#################################### SMTP / Emailing #####################
Expand Down
16 changes: 16 additions & 0 deletions devenv/docker/blocks/saml/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
saml:
container_name: saml
image: kristophjunge/test-saml-idp
environment:
SIMPLESAMLPHP_SP_ENTITY_ID: http://grafana.com
SIMPLESAMLPHP_SP_ASSERTION_CONSUMER_SERVICE: http://localhost/simplesaml/module.php/saml/sp/saml2-acs.php/test-sp
SIMPLESAMLPHP_SP_SINGLE_LOGOUT_SERVICE: http://localhost/simplesaml/module.php/saml/sp/saml2-logout.php/test-sp
SIMPLESAMLPHP_ADMIN_PASSWORD: grafana
SIMPLESAMLPHP_SECRET_SALT: salt
ports:
- "8080:8080"
- "8443:8443"
volumes:
- ./docker/blocks/saml/users.php:/var/www/simplesamlphp/config/authsources.php


16 changes: 16 additions & 0 deletions devenv/docker/blocks/saml/notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Notes on Saml Docker Block

Uses https://github.com/kristophjunge/docker-test-saml-idp as a docker container for saml example.

## Use

See docker container docs on how to use this service - https://github.com/kristophjunge/docker-test-saml-idp#test-the-identity-provider-idp

## Groups & Users

admins
saml-admin ([email protected])
editors
saml-editor ([email protected])
no groups
saml-viewer ([email protected])
21 changes: 21 additions & 0 deletions devenv/docker/blocks/saml/users.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
$config = array(
'admin' => array(
'core:AdminPassword',
),
'example-userpass' => array(
'exampleauth:UserPass',
'saml-admin:grafana' => array(
'groups' => array('admins'),
'email' => '[email protected]',
),
'saml-editor:grafana' => array(
'groups' => array('editors'),
'email' => '[email protected]',
),
'saml-viewer:grafana' => array(
'groups' => array(),
'email' => '[email protected]',
),
),
);
2 changes: 2 additions & 0 deletions docs/sources/administration/provisioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ Since not all datasources have the same configuration settings we only have the
| esVersion | number | Elasticsearch | Elasticsearch version as a number (2/5/56/60/70) |
| timeField | string | Elasticsearch | Which field that should be used as timestamp |
| interval | string | Elasticsearch | Index date time format. nil(No Pattern), 'Hourly', 'Daily', 'Weekly', 'Monthly' or 'Yearly' |
| logMessageField | string | Elasticsearch | Which field should be used as the log message |
| logLevelField | string | Elasticsearch | Which field should be used to indicate the priority of the log message |
| authType | string | Cloudwatch | Auth provider. keys/credentials/arn |
| assumeRoleArn | string | Cloudwatch | ARN of Assume Role |
| defaultRegion | string | Cloudwatch | AWS region |
Expand Down
4 changes: 2 additions & 2 deletions docs/sources/alerting/notifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ Notifications can be sent by setting up an incoming webhook in Google Hangouts c

### All supported notifiers

Name | Type | Supports images |Support alert rule tags
-----|------------ | ------
Name | Type | Supports images | Support alert rule tags
-----|------|---------------- | -----------------------
DingDing | `dingding` | yes, external only | no
Discord | `discord` | yes | no
Email | `email` | yes | no
Expand Down
22 changes: 22 additions & 0 deletions docs/sources/auth/enhanced_ldap.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,25 @@ a user as member of a team and it will not be removed when the user signs in. Th
5. Click on `Add group` button to save.

<div class="clearfix"></div>

## Active LDAP Synchronization

In the open source version of Grafana, user data from LDAP will be synchronized only during the login process when authenticating using LDAP.

With this feature you can configure Grafana to actively sync users with LDAP server(s) in the background. Role and team membership will be updated, removed users will be disabled and logged out. Only users that have logged into Grafana at least once will be synchronized.```

```bash
[auth.ldap]
...

# You can use the Cron syntax or several predefined schedulers -
# @yearly (or @annually) | Run once a year, midnight, Jan. 1st | 0 0 0 1 1 *
# @monthly | Run once a month, midnight, first of month | 0 0 0 1 * *
# @weekly | Run once a week, midnight between Sat/Sun | 0 0 0 * * 0
# @daily (or @midnight) | Run once a day, midnight | 0 0 0 * * *
# @hourly | Run once an hour, beginning of hour | 0 0 * * * *
sync_cron = "@hourly"
# This cron expression format uses 6 space-separated fields (including seconds), for example
# sync_cron = "* */10 * * * *"
# This will run the LDAP Synchronization every 10th minute, which is also the minimal interval between the grafana sync times i.e. you cannot set it for every 9th minute
```
3 changes: 3 additions & 0 deletions docs/sources/auth/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ login_maximum_lifetime_days = 30

# How often should auth tokens be rotated for authenticated users when being active. The default is each 10 minutes.
token_rotation_interval_minutes = 10

# The maximum lifetime (seconds) an api key can be used. If it is set all the api keys should have limited lifetime that is lower than this value.
api_key_max_seconds_to_live = -1
```

### Anonymous authentication
Expand Down
53 changes: 53 additions & 0 deletions docs/sources/features/datasources/elasticsearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,18 @@ Identifier | Description
`s` | second
`ms` | millisecond

### Logs (BETA)

> Only available in Grafana v6.3+.
There are two parameters, `Message field name` and `Level field name`, that can optionally be configured from the data source settings page that determine
which fields will be used for log messages and log levels when visualizing logs in [Explore](/features/explore).

For example, if you're using a default setup of Filebeat for shipping logs to Elasticsearch the following configuration should work:

- **Message field name:** message
- **Level field name:** fields.level

## Metric Query editor

![Elasticsearch Query Editor](/img/docs/elasticsearch/query_editor.png)
Expand Down Expand Up @@ -162,6 +174,28 @@ Time | The name of the time field, needs to be date field.
Text | Event description field.
Tags | Optional field name to use for event tags (can be an array or a CSV string).

## Querying Logs (BETA)

> Only available in Grafana v6.3+.
Querying and displaying log data from Elasticsearch is available via [Explore](/features/explore).

![](/img/docs/v63/elasticsearch_explore_logs.png)

Select the Elasticsearch data source, change to Logs using the Metrics/Logs switcher, and then optionally enter a lucene query into the query field to filter the log messages.

Finally, press the `Enter` key or the `Run Query` button to display your logs.

### Log Queries

Once the result is returned, the log panel shows a list of log rows and a bar chart where the x-axis shows the time and the y-axis shows the frequency/count.

Note that the fields used for log message and level is based on an [optional datasource configuration](#logs-beta).

### Filter Log Messages

Optionally enter a lucene query into the query field to filter the log messages. For example, using a default Filebeat setup you should be able to use `fields.level:error` to only show error log messages.

## Configure the Datasource with Provisioning

It's now possible to configure datasources using config files with Grafana's provisioning system. You can read more about how it works and all the settings you can set for datasources on the [provisioning docs page](/administration/provisioning/#datasources)
Expand All @@ -181,3 +215,22 @@ datasources:
interval: Daily
timeField: "@timestamp"
```
or, for logs:
```yaml
apiVersion: 1

datasources:
- name: elasticsearch-v7-filebeat
type: elasticsearch
access: proxy
database: "[filebeat-]YYYY.MM.DD"
url: http://localhost:9200
jsonData:
interval: Daily
timeField: "@timestamp"
esVersion: 70
logMessageField: message
logLevelField: fields.level
```
20 changes: 20 additions & 0 deletions docs/sources/features/datasources/influxdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,26 @@ You can switch to raw query mode by clicking hamburger icon and then `Switch edi
You can remove the group by time by clicking on the `time` part and then the `x` icon. You can
change the option `Format As` to `Table` if you want to show raw data in the `Table` panel.

## Querying Logs (BETA)

> Only available in Grafana v6.3+.
Querying and displaying log data from InfluxDB is available via [Explore](/features/explore).

![](/img/docs/v63/influxdb_explore_logs.png)

Select the InfluxDB data source, change to Logs using the Metrics/Logs switcher,
and then use the `Measurements/Fields` button to display your logs.

### Log Queries

The Logs Explorer (the `Measurements/Fields` button) next to the query field shows a list of measurements and fields. Choose the desired measurement that contains your log data and then choose which field Explore should use to display the log message.

Once the result is returned, the log panel shows a list of log rows and a bar chart where the x-axis shows the time and the y-axis shows the frequency/count.

### Filter search

To add a filter click the plus icon to the right of the `Measurements/Fields` button or a condition. You can remove tag filters by clicking on the first select and choosing `--remove filter--`.

## Templating

Expand Down
35 changes: 25 additions & 10 deletions docs/sources/features/panels/graph.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,35 @@ The general tab allows customization of a panel's appearance and menu options.
### Repeat
Repeat a panel for each value of a variable. Repeating panels are described in more detail [here]({{< relref "../../reference/templating.md#repeating-panels" >}}).

### Drilldown / detail link
### Data link

The drilldown section allows adding dynamic links to the panel that can link to other dashboards
or URLs.
Data link in graph settings allows adding dynamic links to the visualization. Those links can link to either other dashboard or to an external URL.

Each link has a title, a type and params. A link can be either a ``dashboard`` or ``absolute`` links.
If it is a dashboard link, the `dashboard` value must be the name of a dashboard. If it is an
`absolute` link, the URL is the URL to the link.
{{< docs-imagebox img="/img/docs/data_link.png" max-width= "800px" >}}

``params`` allows adding additional URL params to the links. The format is the ``name=value`` with
multiple params separated by ``&``. Template variables can be added as values using ``$myvar``.
Data link is defined by title, url and a setting whether or not it should be opened in a new window.

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.
**Title** is a human readable label for the link that will be displayed in the UI. The link itself is accessible in the graph's context menu when user **clicks on a single data point**:

{{< docs-imagebox img="/img/docs/data_link_tooltip.png" max-width= "800px" >}}

**URL** field allows the URL configuration for a given link. Apart from regular query params it also supports built-in variables and dashboard variables that you can choose from
available suggestions:

{{< docs-imagebox img="/img/docs/data_link_typeahead.png" max-width= "800px" >}}


Available built-in variables are:

1. ``__all_variables`` - will add all current dashboard's variables to the URL
2. ``__url_time_range`` - will add current dashboard's time range to the URL (i.e. ``?from=now-6h&to=now``)
3. ``__series_name`` - will add series name as a query param in the URL (i.e. ``?series=B-series``)
4. ``__value_time`` - will add datapoint's timestamp (Unix ms epoch) to the URL (i.e. ``?time=1560268814105``)


#### Template variables in data links
When linking to another dashboard that uses template variables, you can use ``var-myvar=${myvar}`` syntax (where ``myvar`` is a name of template variable)
to use current dashboard's variable value.

## Metrics

Expand Down
12 changes: 10 additions & 2 deletions docs/sources/http_api/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ Content-Type: application/json
{
"id": 1,
"name": "TestAdmin",
"role": "Admin"
"role": "Admin",
"expiration": "2019-06-26T10:52:03+03:00"
}
]
```
Expand All @@ -101,14 +102,21 @@ Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
{
"name": "mykey",
"role": "Admin"
"role": "Admin",
"secondsToLive": 86400
}
```

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` or `Admin`.
- **secondsToLive** – Sets the key expiration in seconds. It is optional. If it is a positive number an expiration date for the key is set. If it is null, zero or is omitted completely (unless `api_key_max_seconds_to_live` configuration option is set) the key will never expire.

Error statuses:

- **400**`api_key_max_seconds_to_live` is set but no `secondsToLive` is specified or `secondsToLive` is greater than this value.
- **500** – The key was unable to be stored in the database.

**Example Response**:

Expand Down
4 changes: 2 additions & 2 deletions latest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"stable": "6.2.4",
"testing": "6.2.4"
"stable": "6.2.5",
"testing": "6.2.5"
}
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"@types/react-transition-group": "2.0.16",
"@types/react-virtualized": "9.18.12",
"@types/react-window": "1.7.0",
"@types/remarkable": "1.7.4",
"angular-mocks": "1.6.6",
"autoprefixer": "9.5.0",
"axios": "0.19.0",
Expand Down Expand Up @@ -192,10 +191,13 @@
"@types/angular-route": "1.7.0",
"@types/d3-scale-chromatic": "1.3.1",
"@types/enzyme-adapter-react-16": "1.0.5",
"@types/marked": "0.6.5",
"@types/react-redux": "^7.0.8",
"@types/react-test-renderer": "16.8.2",
"@types/redux-logger": "3.0.7",
"@types/reselect": "2.2.0",
"@types/slate": "0.44.11",
"@types/tinycolor2": "1.4.2",
"angular": "1.6.6",
"angular-bindonce": "0.3.1",
"angular-native-dragdrop": "1.2.2",
Expand All @@ -214,6 +216,7 @@
"immutable": "3.8.2",
"jquery": "3.4.1",
"lodash": "4.17.11",
"marked": "0.6.2",
"moment": "2.24.0",
"mousetrap": "1.6.3",
"mousetrap-global-bind": "1.1.0",
Expand All @@ -238,7 +241,6 @@
"redux-logger": "3.0.6",
"redux-observable": "1.1.0",
"redux-thunk": "2.3.0",
"remarkable": "1.7.1",
"reselect": "4.0.0",
"rst2html": "github:thoward/rst2html#990cb89",
"rxjs": "6.4.0",
Expand Down
1 change: 1 addition & 0 deletions packages/grafana-data/src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './string';
export * from './markdown';
20 changes: 20 additions & 0 deletions packages/grafana-data/src/utils/markdown.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import marked, { MarkedOptions } from 'marked';

const defaultMarkedOptions: MarkedOptions = {
renderer: new marked.Renderer(),
pedantic: false,
gfm: true,
tables: true,
sanitize: true,
smartLists: true,
smartypants: false,
xhtml: false,
};

export function setMarkdownOptions(optionsOverride?: MarkedOptions) {
marked.setOptions({ ...defaultMarkedOptions, ...optionsOverride });
}

export function renderMarkdown(str: string): string {
return marked(str);
}
Loading

0 comments on commit 6b08472

Please sign in to comment.