Skip to content

Commit

Permalink
Merge remote-tracking branch 'grafana/master' into series-facade
Browse files Browse the repository at this point in the history
* grafana/master: (49 commits)
  Build: specify build flag for `docker-compose up` (grafana#17411)
  Add a @grafana/runtime package with backendSrv interface (grafana#16533)
  Database: Initialize xorm with an empty schema for postgres (grafana#17357)
  docs: configuring custom headers in the dataproxy (grafana#17367)
  Explore: Queries the datasource once per run query and uses DataStreamObserver (grafana#17263)
  Feature: Adds redux action logging toggle from url params (grafana#17368)
  Build: Adds e2e tests back to master workflow with better error messages and with artifacts (grafana#17374)
  Explore: Handle datasources with long names better in ds picker (grafana#17393)
  Annotations: Improve annotation option tooltips (grafana#17384)
  InfluxDB: Fixes single quotes are not escaped (grafana#17398)
  Chore: Bump axios to 0.19.0 (grafana#17403)
  Alerting: golint fixes for alerting (grafana#17246)
  Batch disable users (grafana#17254)
  Chore: Remove unused properties in explore (grafana#17359)
  MySQL/Postgres/MSSQL: Add parsing for day, weeks and year intervals in macros (grafana#13086)
  Security: Prevent csv formula injection attack  (grafana#17363)
  LDAP: remove unused function (grafana#17351)
  Enterprise: remove gofakeit dep (grafana#17344)
  Explore: Update time range before running queries (grafana#17349)
  Build(package.json): improve npm commands (grafana#17022)
  ...
  • Loading branch information
ryantxu committed Jun 4, 2019
2 parents 4bef7c0 + f43af0e commit 6d70a0b
Show file tree
Hide file tree
Showing 289 changed files with 4,239 additions and 4,481 deletions.
15 changes: 12 additions & 3 deletions .circleci/config.yml
Expand Up @@ -73,7 +73,7 @@ jobs:
end-to-end-test:
docker:
- image: circleci/node:8-browsers
- image: grafana/grafana:master
- image: grafana/grafana-dev:master-$CIRCLE_SHA1
steps:
- run: dockerize -wait tcp://127.0.0.1:3000 -timeout 120s
- checkout
Expand All @@ -91,6 +91,12 @@ jobs:
name: run end-to-end tests
command: 'env BASE_URL=http://127.0.0.1:3000 yarn e2e-tests'
no_output_timeout: 5m
- store_artifacts:
path: public/e2e-test/screenShots/theTruth
destination: expected-screenshots
- store_artifacts:
path: public/e2e-test/screenShots/theOutput
destination: output-screenshots

codespell:
docker:
Expand Down Expand Up @@ -629,7 +635,7 @@ workflows:
- mysql-integration-test
- postgres-integration-test
- build-oss-msi
filters: *filter-only-master
filters: *filter-only-master
- grafana-docker-master:
requires:
- build-all
Expand Down Expand Up @@ -662,7 +668,10 @@ workflows:
- mysql-integration-test
- postgres-integration-test
filters: *filter-only-master

- end-to-end-test:
requires:
- grafana-docker-master
filters: *filter-only-master
release:
jobs:
- build-all:
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,18 @@
# 6.3.0 (unreleased)

# 6.2.1 (2019-05-27)

### Features / Enhancements
* **CLI**: Add command to migrate all datasources to use encrypted password fields . [#17118](https://github.com/grafana/grafana/pull/17118), [@aocenas](https://github.com/aocenas)
* **Gauge/BarGauge**: Improvements to auto value font size . [#17292](https://github.com/grafana/grafana/pull/17292), [@torkelo](https://github.com/torkelo)

### Bug Fixes
* **Auth Proxy**: Resolve database is locked errors. [#17274](https://github.com/grafana/grafana/pull/17274), [@marefr](https://github.com/marefr)
* **Database**: Retry transaction if sqlite returns database is locked error. [#17276](https://github.com/grafana/grafana/pull/17276), [@marefr](https://github.com/marefr)
* **Explore**: Fixes so clicking in a Prometheus Table the query is filtered by clicked value. [#17083](https://github.com/grafana/grafana/pull/17083), [@hugohaggmark](https://github.com/hugohaggmark)
* **Singlestat**: Fixes issue with value placement and line wraps. [#17249](https://github.com/grafana/grafana/pull/17249), [@torkelo](https://github.com/torkelo)
* **Tech**: Update jQuery to 3.4.1 to fix issue on iOS 10 based browers as well as Chrome 53.x . [#17290](https://github.com/grafana/grafana/pull/17290), [@timbutler](https://github.com/timbutler)

# 6.2.0 (2019-05-22)

### Bug Fixes
Expand Down Expand Up @@ -70,6 +85,7 @@ repo on July 1st. Make sure you have switched to the new repo by then. The new r
* **Provisioning**: Add API endpoint to reload provisioning configs. [#16579](https://github.com/grafana/grafana/pull/16579), [@aocenas](https://github.com/aocenas)
* **Provisioning**: Do not allow deletion of provisioned dashboards. [#16211](https://github.com/grafana/grafana/pull/16211), [@aocenas](https://github.com/aocenas)
* **Provisioning**: Interpolate env vars in provisioning files. [#16499](https://github.com/grafana/grafana/pull/16499), [@aocenas](https://github.com/aocenas)
* **Provisioning**: Support FolderUid in Dashboard Provisioning Config. [#16559](https://github.com/grafana/grafana/pull/16559), [@swtch1](https://github.com/swtch1)
* **Security**: Add new setting allow_embedding. [#16853](https://github.com/grafana/grafana/pull/16853), [@marefr](https://github.com/marefr)
* **Security**: Store datasource passwords encrypted in secureJsonData. [#16175](https://github.com/grafana/grafana/pull/16175), [@aocenas](https://github.com/aocenas)
* **UX**: Improve Grafana usage for smaller screens. [#16783](https://github.com/grafana/grafana/pull/16783), [@torkelo](https://github.com/torkelo)
Expand Down
30 changes: 29 additions & 1 deletion Makefile
@@ -1,6 +1,6 @@
-include local/Makefile

.PHONY: all deps-go deps-js deps build-go build-server build-cli build-js build build-docker-dev build-docker-full lint-go test-go test-js test run clean gosec revive
.PHONY: all deps-go deps-js deps build-go build-server build-cli build-js build build-docker-dev build-docker-full lint-go test-go test-js test run clean gosec revive devenv devenv-down revive-alerting

GO := GO111MODULE=on go
GO_FILES := ./pkg/...
Expand Down Expand Up @@ -84,6 +84,34 @@ revive: scripts/go/bin/revive
-config ./scripts/go/configs/revive.toml \
$(GO_FILES)

revive-alerting: scripts/go/bin/revive
@scripts/go/bin/revive \
-formatter stylish \
./pkg/services/alerting/...

# create docker-compose file with provided sources and start them
# example: make devenv sources=postgres,openldap
ifeq ($(sources),)
devenv:
@printf 'You have to define sources for this command \nexample: make devenv sources=postgres,openldap\n'
else
devenv: devenv-down
$(eval targets := $(shell echo '$(sources)' | tr "," " "))

@cd devenv; \
./create_docker_compose.sh $(targets) || \
(rm -rf docker-compose.yaml; exit 1)

@cd devenv; \
docker-compose up -d --build
endif

# drop down the envs
devenv-down:
@cd devenv; \
test -f docker-compose.yaml && \
docker-compose down || exit 0;

# TODO recheck the rules and leave only necessary exclusions
gosec: scripts/go/bin/gosec
@scripts/go/bin/gosec -quiet \
Expand Down
3 changes: 3 additions & 0 deletions conf/defaults.ini
Expand Up @@ -47,6 +47,9 @@ enforce_domain = false
# The full public facing url
root_url = %(protocol)s://%(domain)s:%(http_port)s/

# Serve Grafana from subpath specified in `root_url` setting. By default it is set to `false` for compatibility reasons.
serve_from_sub_path = false

# Log web requests
router_logging = false

Expand Down
3 changes: 3 additions & 0 deletions conf/sample.ini
Expand Up @@ -48,6 +48,9 @@
# If you use reverse proxy and sub path specify full url (with sub path)
;root_url = http://localhost:3000

# Serve Grafana from subpath specified in `root_url` setting. By default it is set to `false` for compatibility reasons.
;serve_from_sub_path = false

# Log web requests
;router_logging = false

Expand Down
11 changes: 11 additions & 0 deletions devenv/datasources.yaml
Expand Up @@ -143,6 +143,17 @@ datasources:
timeField: "@timestamp"
esVersion: 70

- name: gdev-elasticsearch-v7-metricbeat
type: elasticsearch
access: proxy
database: "[metricbeat-]YYYY.MM.DD"
url: http://localhost:12200
jsonData:
interval: Daily
timeField: "@timestamp"
esVersion: 70
timeInterval: "10s"

- name: gdev-mysql
type: mysql
url: localhost:3306
Expand Down
16 changes: 16 additions & 0 deletions devenv/docker/blocks/elastic7/docker-compose.yaml
Expand Up @@ -21,3 +21,19 @@
- ./docker/blocks/elastic7/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro
- /var/log:/var/log:ro
- ../data/log:/var/log/grafana:ro

metricbeat7:
image: docker.elastic.co/beats/metricbeat-oss:7.0.0
network_mode: host
command: metricbeat -e -strict.perms=false
user: root
volumes:
- ./docker/blocks/elastic7/metricbeat.yml:/usr/share/metricbeat/metricbeat.yml:ro
- /var/run/docker.sock:/var/run/docker.sock:ro

kibana7:
image: docker.elastic.co/kibana/kibana-oss:7.0.0
ports:
- "5601:5601"
environment:
ELASTICSEARCH_HOSTS: http://elasticsearch7:9200
38 changes: 38 additions & 0 deletions devenv/docker/blocks/elastic7/metricbeat.yml
@@ -0,0 +1,38 @@
metricbeat.config:
modules:
path: ${path.config}/modules.d/*.yml
# Reload module configs as they change:
reload.enabled: false

metricbeat.autodiscover:
providers:
- type: docker
hints.enabled: true

metricbeat.modules:
- module: docker
metricsets:
- "container"
- "cpu"
- "diskio"
- "healthcheck"
- "info"
#- "image"
- "memory"
- "network"
hosts: ["unix:///var/run/docker.sock"]
period: 10s
enabled: true

processors:
- add_cloud_metadata: ~

output.elasticsearch:
hosts: ["localhost:12200"]
index: "metricbeat-%{+yyyy.MM.dd}"

setup.template.name: "metricbeat"
setup.template.pattern: "metricbeat-*"
setup.template.settings:
index.number_of_shards: 1
index.number_of_replicas: 1
Expand Up @@ -19,11 +19,11 @@ EXPOSE 389

VOLUME ["/etc/ldap", "/var/lib/ldap"]

COPY modules/ /etc/ldap.dist/modules
COPY prepopulate/ /etc/ldap.dist/prepopulate
COPY admins-ldap-server/modules/ /etc/ldap.dist/modules
COPY admins-ldap-server/prepopulate/ /etc/ldap.dist/prepopulate

COPY ../entrypoint.sh /entrypoint.sh
COPY ../prepopulate.sh /prepopulate.sh
COPY ./entrypoint.sh /entrypoint.sh
COPY ./prepopulate.sh /prepopulate.sh

ENTRYPOINT ["/entrypoint.sh"]

Expand Down
8 changes: 6 additions & 2 deletions devenv/docker/blocks/multiple-openldap/docker-compose.yaml
@@ -1,5 +1,7 @@
admins-openldap:
build: docker/blocks/multiple-openldap/admins-ldap-server
build:
context: docker/blocks/multiple-openldap
dockerfile: ./admins-ldap-server.Dockerfile
environment:
SLAPD_PASSWORD: grafana
SLAPD_DOMAIN: grafana.org
Expand All @@ -8,7 +10,9 @@
- "389:389"

openldap:
build: docker/blocks/multiple-openldap/ldap-server
build:
context: docker/blocks/multiple-openldap
dockerfile: ./ldap-server.Dockerfile
environment:
SLAPD_PASSWORD: grafana
SLAPD_DOMAIN: grafana.org
Expand Down
Expand Up @@ -19,11 +19,11 @@ EXPOSE 389

VOLUME ["/etc/ldap", "/var/lib/ldap"]

COPY modules/ /etc/ldap.dist/modules
COPY prepopulate/ /etc/ldap.dist/prepopulate
COPY ldap-server/modules/ /etc/ldap.dist/modules
COPY ldap-server/prepopulate/ /etc/ldap.dist/prepopulate

COPY ../entrypoint.sh /entrypoint.sh
COPY ../prepopulate.sh /prepopulate.sh
COPY ./entrypoint.sh /entrypoint.sh
COPY ./prepopulate.sh /prepopulate.sh

ENTRYPOINT ["/entrypoint.sh"]

Expand Down
20 changes: 19 additions & 1 deletion docs/sources/administration/provisioning.md
Expand Up @@ -179,6 +179,24 @@ Secure json data is a map of settings that will be encrypted with [secret key](/
| accessKey | string | Cloudwatch | Access key for connecting to Cloudwatch |
| secretKey | string | Cloudwatch | Secret key for connecting to Cloudwatch |

#### Custom HTTP headers for datasources
Datasources managed by Grafanas provisioning can be configured to add HTTP headers to all requests
going to that datasource. The header name is configured in the `jsonData` field and the header value should be
configured in `secureJsonData`.

```yaml
apiVersion: 1

datasources:
- name: Graphite
jsonData:
httpHeaderName1: "HeaderName"
httpHeaderName2: "Authorization"
secureJsonData:
httpHeaderValue1: "HeaderValue"
httpHeaderValue2: "Bearer XXXXXXXXX"
```

### Dashboards

It's possible to manage dashboards in Grafana by adding one or more yaml config files in the [`provisioning/dashboards`](/installation/configuration/#provisioning) directory. Each config file can contain a list of `dashboards providers` that will load dashboards into Grafana from the local filesystem.
Expand All @@ -204,7 +222,7 @@ providers:
# <bool> enable dashboard editing
editable: true
# <int> how often Grafana will scan for changed dashboards
updateIntervalSeconds: 10
updateIntervalSeconds: 10
options:
# <string, required> path to dashboard files on disk. Required
path: /var/lib/grafana/dashboards
Expand Down
6 changes: 4 additions & 2 deletions docs/sources/features/datasources/azuremonitor.md
Expand Up @@ -254,6 +254,10 @@ To make writing queries easier there are several Grafana macros that can be used
`datetimeColumn ≥ datetime(2018-06-05T18:09:58.907Z) and`
`datetimeColumn ≤ datetime(2018-06-05T20:09:58.907Z)` where the from and to datetimes are from the Grafana time picker.

- `$__timeFrom()` - Returns the From datetime from the Grafana picker. Example: `datetime(2018-06-05T18:09:58.907Z)`.

- `$__timeTo()` - Returns the From datetime from the Grafana picker. Example: `datetime(2018-06-05T20:09:58.907Z)`.

- `$__escapeMulti($myVar)` - is to be used with multi-value template variables that contain illegal characters. If `$myVar` has the following two values as a string `'\\grafana-vm\Network(eth0)\Total','\\hello!'`, then it expands to: `@'\\grafana-vm\Network(eth0)\Total', @'\\hello!'`. If using single value variables there is no need for this macro, simply escape the variable inline instead - `@'\$myVar'`.

- `$__contains(colName, $myVar)` - is to be used with multi-value template variables. If `$myVar` has the value `'value1','value2'`, it expands to: `colName in ('value1','value2')`.
Expand All @@ -264,8 +268,6 @@ To make writing queries easier there are several Grafana macros that can be used

There are also some Grafana variables that can be used in Azure Log Analytics queries:

- `$__from` - Returns the From datetime from the Grafana picker. Example: `datetime(2018-06-05T18:09:58.907Z)`.
- `$__to` - Returns the From datetime from the Grafana picker. Example: `datetime(2018-06-05T20:09:58.907Z)`.
- `$__interval` - Grafana calculates the minimum time grain that can be used to group by time in queries. More details on how it works [here]({{< relref "reference/templating.md#interval-variables" >}}). It returns a time grain like `5m` or `1h` that can be used in the bin function. E.g. `summarize count() by bin(TimeGenerated, $__interval)`

### Azure Log Analytics Alerting
Expand Down
2 changes: 1 addition & 1 deletion docs/sources/guides/basic_concepts.md
Expand Up @@ -66,7 +66,7 @@ There are a wide variety of styling and formatting options that each Panel expos

Panels can be dragged and dropped and rearranged on the Dashboard. They can also be resized.

There are currently four Panel types: [Graph](/reference/graph/), [Singlestat](/reference/singlestat/), [Dashlist](/reference/dashlist/), [Table](/reference/table_panel/),and [Text](/reference/text/).
There are currently five Panel types: [Graph](/reference/graph/), [Singlestat](/reference/singlestat/), [Dashlist](/reference/dashlist/), [Table](/reference/table_panel/), and [Text](/reference/text/).

Panels like the [Graph](/reference/graph/) panel allow you to graph as many metrics and series as you want. Other panels like [Singlestat](/reference/singlestat/) require a reduction of a single query into a single number. [Dashlist](/reference/dashlist/) and [Text](/reference/text/) are special panels that do not connect to any Data Source.

Expand Down

0 comments on commit 6d70a0b

Please sign in to comment.