Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| eaaca91f25 | |||
| a551cd2470 |
@@ -1,19 +1,19 @@
|
||||
[run]
|
||||
init_cmds = [
|
||||
["go", "run", "build.go", "-dev", "build-cli"],
|
||||
["go", "run", "build.go", "-dev", "build-server"],
|
||||
["./bin/grafana-server", "-packaging=dev", "cfg:app_mode=development"]
|
||||
["go", "run", "-mod=vendor", "build.go", "-dev", "build-cli"],
|
||||
["go", "run", "-mod=vendor", "build.go", "-dev", "build-server"],
|
||||
["./bin/grafana-server", "-packaging=dev", "cfg:app_mode=development"]
|
||||
]
|
||||
watch_all = true
|
||||
follow_symlinks = true
|
||||
watch_dirs = [
|
||||
"$WORKDIR/pkg",
|
||||
"$WORKDIR/public/views",
|
||||
"$WORKDIR/conf",
|
||||
"$WORKDIR/pkg",
|
||||
"$WORKDIR/public/views",
|
||||
"$WORKDIR/conf",
|
||||
]
|
||||
watch_exts = [".go", ".ini", ".toml", ".template.html"]
|
||||
build_delay = 1500
|
||||
cmds = [
|
||||
["go", "run", "build.go", "-dev", "build-server"],
|
||||
["./bin/grafana-server", "-packaging=dev", "cfg:app_mode=development"]
|
||||
["go", "run", "-mod=vendor", "build.go", "-dev", "build-server"],
|
||||
["./bin/grafana-server", "-packaging=dev", "cfg:app_mode=development"]
|
||||
]
|
||||
|
||||
+728
-565
File diff suppressed because it is too large
Load Diff
+1
-3
@@ -14,10 +14,8 @@
|
||||
# Documentation owner: Diana Payton
|
||||
/docs/ @oddlittlebird
|
||||
/contribute/ @oddlittlebird @marcusolsson
|
||||
# @grafana/ui component documentation
|
||||
*.mdx @marcusolsson @jessover9000
|
||||
|
||||
# Backend code
|
||||
*.go @grafana/backend-platform
|
||||
go.mod @grafana/backend-platform
|
||||
go.sum @grafana/backend-platform
|
||||
go.sum @grafana/backend-platform
|
||||
+3
-11
@@ -11,10 +11,8 @@ awsconfig
|
||||
/public/views/error.html
|
||||
/emails/dist
|
||||
/reports
|
||||
/e2e/tmp
|
||||
.yarnrc
|
||||
.yarn/
|
||||
vendor/
|
||||
|
||||
# Enterprise emails
|
||||
/emails/templates/enterprise_*
|
||||
@@ -85,8 +83,6 @@ debug.test
|
||||
|
||||
/devenv/bulk-dashboards/*.json
|
||||
/devenv/bulk_alerting_dashboards/*.json
|
||||
/devenv/datasources_bulk.yaml
|
||||
/devenv/bulk_alerting_dashboards/bulk_alerting_datasources.yaml
|
||||
|
||||
/scripts/build/release_publisher/release_publisher
|
||||
*.patch
|
||||
@@ -107,10 +103,6 @@ compilation-stats.json
|
||||
/packages/grafana-e2e/cypress/screenshots
|
||||
/packages/grafana-e2e/cypress/videos
|
||||
/packages/grafana-e2e/cypress/logs
|
||||
/e2e/server.log
|
||||
/e2e/suite1/screenshots
|
||||
!/e2e/suite1/screenshots/expeced/*
|
||||
/e2e/suite1/videos/*
|
||||
|
||||
# report dumping the whole system env
|
||||
/report.*.json
|
||||
/public/e2e-test/screenShots/theOutput
|
||||
/public/e2e-tests/screenShots/theOutput/*.png
|
||||
/public/e2e-tests/videos
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
module.exports = {
|
||||
...require('@grafana/toolkit/src/config/prettier.plugin.config.json'),
|
||||
};
|
||||
+1619
-2083
File diff suppressed because it is too large
Load Diff
+22
-3
@@ -1,11 +1,12 @@
|
||||
# Golang build container
|
||||
FROM golang:1.14.1-alpine
|
||||
FROM golang:1.13.4-alpine
|
||||
|
||||
RUN apk add --no-cache gcc g++
|
||||
|
||||
WORKDIR $GOPATH/src/github.com/grafana/grafana
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
COPY vendor vendor
|
||||
|
||||
RUN go mod verify
|
||||
|
||||
@@ -17,6 +18,16 @@ RUN go run build.go build
|
||||
# Node build container
|
||||
FROM node:12.13.0-alpine
|
||||
|
||||
# PhantomJS
|
||||
RUN apk add --no-cache curl &&\
|
||||
cd /tmp && curl -Ls https://github.com/dustinblackman/phantomized/releases/download/2.1.1/dockerized-phantomjs.tar.gz | tar xz &&\
|
||||
cp -R lib lib64 / &&\
|
||||
cp -R usr/lib/x86_64-linux-gnu /usr/lib &&\
|
||||
cp -R usr/share /usr/share &&\
|
||||
cp -R etc/fonts /etc &&\
|
||||
curl -k -Ls https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 | tar -jxf - &&\
|
||||
cp phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs
|
||||
|
||||
WORKDIR /usr/src/app/
|
||||
|
||||
COPY package.json yarn.lock ./
|
||||
@@ -24,9 +35,8 @@ COPY packages packages
|
||||
|
||||
RUN yarn install --pure-lockfile --no-progress
|
||||
|
||||
COPY Gruntfile.js tsconfig.json .eslintrc .editorconfig .browserslistrc .prettierrc.js ./
|
||||
COPY Gruntfile.js tsconfig.json .eslintrc .editorconfig .browserslistrc ./
|
||||
COPY public public
|
||||
COPY tools tools
|
||||
COPY scripts scripts
|
||||
COPY emails emails
|
||||
|
||||
@@ -70,9 +80,18 @@ RUN mkdir -p "$GF_PATHS_HOME/.aws" && \
|
||||
chown -R grafana:grafana "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING" && \
|
||||
chmod -R 777 "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING"
|
||||
|
||||
# PhantomJS
|
||||
COPY --from=1 /tmp/lib /lib
|
||||
COPY --from=1 /tmp/lib64 /lib64
|
||||
COPY --from=1 /tmp/usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu
|
||||
COPY --from=1 /tmp/usr/share /usr/share
|
||||
COPY --from=1 /tmp/etc/fonts /etc/fonts
|
||||
COPY --from=1 /usr/local/bin/phantomjs /usr/local/bin
|
||||
|
||||
COPY --from=0 /go/src/github.com/grafana/grafana/bin/linux-amd64/grafana-server /go/src/github.com/grafana/grafana/bin/linux-amd64/grafana-cli ./bin/
|
||||
COPY --from=1 /usr/src/app/public ./public
|
||||
COPY --from=1 /usr/src/app/tools ./tools
|
||||
COPY tools/phantomjs/render.js ./tools/phantomjs/render.js
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
|
||||
+14
-6
@@ -1,8 +1,9 @@
|
||||
FROM golang:1.14.1 AS go-builder
|
||||
FROM golang:1.13.4 AS go-builder
|
||||
|
||||
WORKDIR /src/grafana
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
COPY vendor vendor/
|
||||
|
||||
RUN go mod verify
|
||||
|
||||
@@ -13,6 +14,11 @@ RUN go run build.go build
|
||||
|
||||
FROM node:12.13 AS js-builder
|
||||
|
||||
# PhantomJS
|
||||
RUN apt-get update && apt-get install -y curl &&\
|
||||
curl -L https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 | tar xj &&\
|
||||
cp phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs
|
||||
|
||||
WORKDIR /usr/src/app/
|
||||
|
||||
COPY package.json yarn.lock ./
|
||||
@@ -20,16 +26,15 @@ COPY packages packages
|
||||
|
||||
RUN yarn install --pure-lockfile
|
||||
|
||||
COPY Gruntfile.js tsconfig.json .eslintrc .editorconfig .browserslistrc .prettierrc.js ./
|
||||
COPY Gruntfile.js tsconfig.json .eslintrc .editorconfig .browserslistrc ./
|
||||
COPY public public
|
||||
COPY tools tools
|
||||
COPY scripts scripts
|
||||
COPY emails emails
|
||||
|
||||
ENV NODE_ENV production
|
||||
RUN ./node_modules/.bin/grunt build
|
||||
|
||||
FROM ubuntu:20.04
|
||||
FROM ubuntu:19.10
|
||||
|
||||
LABEL maintainer="Grafana team <hello@grafana.com>"
|
||||
EXPOSE 3000
|
||||
@@ -49,8 +54,8 @@ WORKDIR $GF_PATHS_HOME
|
||||
|
||||
COPY conf conf
|
||||
|
||||
# curl should be part of the image
|
||||
RUN apt-get update && apt-get upgrade -y && apt-get install -y ca-certificates curl
|
||||
# We need font libs for phantomjs, and curl should be part of the image
|
||||
RUN apt-get update && apt-get upgrade -y && apt-get install -y ca-certificates libfontconfig1 curl
|
||||
|
||||
RUN mkdir -p "$GF_PATHS_HOME/.aws" && \
|
||||
addgroup --system --gid $GF_GID grafana && \
|
||||
@@ -66,11 +71,14 @@ RUN mkdir -p "$GF_PATHS_HOME/.aws" && \
|
||||
chown -R grafana:grafana "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING" && \
|
||||
chmod -R 777 "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING"
|
||||
|
||||
# PhantomJS
|
||||
COPY --from=js-builder /usr/local/bin/phantomjs /usr/local/bin/
|
||||
|
||||
COPY --from=go-builder /src/grafana/bin/linux-amd64/grafana-server /src/grafana/bin/linux-amd64/grafana-cli bin/
|
||||
COPY --from=js-builder /usr/src/app/public public
|
||||
COPY --from=js-builder /usr/src/app/tools tools
|
||||
|
||||
COPY tools/phantomjs/render.js tools/phantomjs/
|
||||
COPY packaging/docker/run.sh /
|
||||
|
||||
USER grafana
|
||||
|
||||
@@ -35,6 +35,7 @@ module.exports = function (grunt) {
|
||||
config.libc = grunt.option('libc');
|
||||
}
|
||||
|
||||
config.phjs = grunt.option('phjsToRelease');
|
||||
config.pkg.version = grunt.option('pkgVer') || config.pkg.version;
|
||||
|
||||
console.log('Version', config.pkg.version);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
-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 gosec revive golangci-lint go-vet test-go test-js test run run-frontend clean devenv devenv-down revive-alerting protobuf help
|
||||
.PHONY: all deps-go deps-js deps build-go build-server build-cli build-js build build-docker-dev build-docker-full lint-go gosec revive golangci-lint go-vet test-go test-js test run run-frontend clean devenv devenv-down revive-alerting help
|
||||
|
||||
GO = GO111MODULE=on go
|
||||
GO_FILES ?= ./pkg/...
|
||||
@@ -84,10 +84,7 @@ revive-alerting: scripts/go/bin/revive
|
||||
@echo "lint alerting via revive"
|
||||
@scripts/go/bin/revive \
|
||||
-formatter stylish \
|
||||
-config ./scripts/go/configs/revive-strict.toml \
|
||||
./pkg/services/alerting/... \
|
||||
./pkg/services/provisioning/datasources/... \
|
||||
./pkg/services/provisioning/dashboards/...
|
||||
./pkg/services/alerting/...
|
||||
|
||||
scripts/go/bin/golangci-lint: scripts/go/go.mod
|
||||
@cd scripts/go; \
|
||||
@@ -161,16 +158,6 @@ devenv-down: ## Stop optional services.
|
||||
|
||||
##@ Helpers
|
||||
|
||||
# We separate the protobuf generation because most development tasks on
|
||||
# Grafana do not involve changing protobuf files and protoc is not a
|
||||
# go-gettable dependency and so getting it installed can be inconvenient.
|
||||
#
|
||||
# If you are working on changes to protobuf interfaces you may either use
|
||||
# this target or run the individual scripts below directly.
|
||||
protobuf: ## Compile protobuf definitions
|
||||
bash scripts/protobuf-check.sh
|
||||
bash pkg/plugins/backendplugin/pluginextensionv2/generate.sh
|
||||
|
||||
clean: ## Clean up intermediate build artifacts.
|
||||
@echo "cleaning"
|
||||
rm -rf node_modules
|
||||
|
||||
@@ -20,6 +20,8 @@ Upgrading Go or Node.js requires making changes in many different files. See bel
|
||||
|
||||
The Grafana project uses [Go modules](https://golang.org/cmd/go/#hdr-Modules__module_versions__and_more) to manage dependencies on external packages. This requires a working Go environment with version 1.11 or greater installed.
|
||||
|
||||
All dependencies are vendored in the `vendor/` directory.
|
||||
|
||||
_Note:_ Since most developers of Grafana still use the `GOPATH` we need to specify `GO111MODULE=on` to make `go mod` and `got get` work as intended. If you have setup Grafana outside of the `GOPATH` on your machine you can skip `GO111MODULE=on` when running the commands below.
|
||||
|
||||
To add or update a new dependency, use the `go get` command:
|
||||
@@ -33,14 +35,16 @@ GO111MODULE=on go get example.com/some/module/pkg
|
||||
GO111MODULE=on go get example.com/some/module/pkg@vX.Y.Z
|
||||
```
|
||||
|
||||
Tidy up the `go.mod` and `go.sum` files:
|
||||
Tidy up the `go.mod` and `go.sum` files and copy the new/updated dependency to the `vendor/` directory:
|
||||
|
||||
```bash
|
||||
# The GO111MODULE variable can be omitted when the code isn't located in GOPATH.
|
||||
GO111MODULE=on go mod tidy
|
||||
|
||||
GO111MODULE=on go mod vendor
|
||||
```
|
||||
|
||||
You have to commit the changes to `go.mod` and `go.sum` before submitting the pull request.
|
||||
You have to commit the changes to `go.mod`, `go.sum` and the `vendor/` directory before submitting the pull request.
|
||||
|
||||
## Node.js dependencies
|
||||
|
||||
|
||||
@@ -23,10 +23,6 @@
|
||||
"extractorMessageReporting": {
|
||||
"default": {
|
||||
"logLevel": "warning"
|
||||
},
|
||||
"ae-internal-missing-underscore": {
|
||||
"logLevel": "none",
|
||||
"addToApiReportFile": false
|
||||
}
|
||||
},
|
||||
"tsdocMessageReporting": {
|
||||
|
||||
@@ -40,6 +40,7 @@ var (
|
||||
linuxPackageVersion string = "v1"
|
||||
linuxPackageIteration string = ""
|
||||
race bool
|
||||
phjsToRelease string
|
||||
workingDir string
|
||||
includeBuildId bool = true
|
||||
buildId string = "0"
|
||||
@@ -51,6 +52,7 @@ var (
|
||||
skipRpmGen bool = false
|
||||
skipDebGen bool = false
|
||||
printGenVersion bool = false
|
||||
modVendor bool = true
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -67,7 +69,9 @@ func main() {
|
||||
flag.StringVar(&libc, "libc", "", "LIBC")
|
||||
flag.BoolVar(&cgo, "cgo-enabled", cgo, "Enable cgo")
|
||||
flag.StringVar(&pkgArch, "pkg-arch", "", "PKG ARCH")
|
||||
flag.StringVar(&phjsToRelease, "phjs", "", "PhantomJS binary")
|
||||
flag.BoolVar(&race, "race", race, "Use race detector")
|
||||
flag.BoolVar(&modVendor, "modVendor", modVendor, "Go modules use vendor folder")
|
||||
flag.BoolVar(&includeBuildId, "includeBuildId", includeBuildId, "IncludeBuildId in package name")
|
||||
flag.BoolVar(&enterprise, "enterprise", enterprise, "Build enterprise version of Grafana")
|
||||
flag.StringVar(&buildIdRaw, "buildId", "0", "Build ID from CI system")
|
||||
@@ -385,6 +389,7 @@ func createPackage(options linuxPackageOptions) {
|
||||
if enterprise {
|
||||
description += " Enterprise"
|
||||
}
|
||||
args = append(args, "--vendor", description)
|
||||
|
||||
if !enterprise {
|
||||
args = append(args, "--license", "\"Apache 2.0\"")
|
||||
@@ -454,6 +459,9 @@ func gruntBuildArg(task string) []string {
|
||||
if libc != "" {
|
||||
args = append(args, fmt.Sprintf("--libc=%s", libc))
|
||||
}
|
||||
if phjsToRelease != "" {
|
||||
args = append(args, fmt.Sprintf("--phjsToRelease=%v", phjsToRelease))
|
||||
}
|
||||
if enterprise {
|
||||
args = append(args, "--enterprise")
|
||||
}
|
||||
@@ -501,6 +509,9 @@ func build(binaryName, pkg string, tags []string) {
|
||||
if race {
|
||||
args = append(args, "-race")
|
||||
}
|
||||
if modVendor {
|
||||
args = append(args, "-mod=vendor")
|
||||
}
|
||||
|
||||
args = append(args, "-o", binary)
|
||||
args = append(args, pkg)
|
||||
|
||||
+43
-85
@@ -230,9 +230,9 @@ snapshot_remove_expired = true
|
||||
# Number dashboard versions to keep (per dashboard). Default: 20, Minimum: 1
|
||||
versions_to_keep = 20
|
||||
|
||||
# Minimum dashboard refresh interval. When set, this will restrict users to set the refresh interval of a dashboard lower than given interval. Per default this is 5 seconds.
|
||||
# Minimum dashboard refresh interval. When set, this will restrict users to set the refresh interval of a dashboard lower than given interval. Per default this is not set/unrestricted.
|
||||
# The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
|
||||
min_refresh_interval = 5s
|
||||
min_refresh_interval =
|
||||
|
||||
#################################### Users ###############################
|
||||
[users]
|
||||
@@ -298,9 +298,6 @@ signout_redirect_url =
|
||||
# This setting is ignored if multiple OAuth providers are configured.
|
||||
oauth_auto_login = false
|
||||
|
||||
# OAuth state max age cookie duration. Defaults to 60 seconds.
|
||||
oauth_state_cookie_max_age = 60
|
||||
|
||||
# limit of api_key seconds to live before expiration
|
||||
api_key_max_seconds_to_live = -1
|
||||
|
||||
@@ -386,21 +383,6 @@ token_url = https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token
|
||||
allowed_domains =
|
||||
allowed_groups =
|
||||
|
||||
#################################### Okta OAuth #######################
|
||||
[auth.okta]
|
||||
name = Okta
|
||||
enabled = false
|
||||
allow_sign_up = true
|
||||
client_id = some_id
|
||||
client_secret = some_secret
|
||||
scopes = openid profile email groups
|
||||
auth_url = https://<tenant-id>.okta.com/oauth2/v1/authorize
|
||||
token_url = https://<tenant-id>.okta.com/oauth2/v1/token
|
||||
api_url = https://<tenant-id>.okta.com/oauth2/v1/userinfo
|
||||
allowed_domains =
|
||||
allowed_groups =
|
||||
role_attribute_path =
|
||||
|
||||
#################################### Generic OAuth #######################
|
||||
[auth.generic_oauth]
|
||||
name = OAuth
|
||||
@@ -423,6 +405,47 @@ tls_client_cert =
|
||||
tls_client_key =
|
||||
tls_client_ca =
|
||||
|
||||
#################################### SAML Auth ###########################
|
||||
[auth.saml] # Enterprise only
|
||||
# Defaults to false. If true, the feature is enabled
|
||||
enabled = false
|
||||
|
||||
# Base64-encoded public X.509 certificate. Used to sign requests to the IdP
|
||||
certificate =
|
||||
|
||||
# Path to the public X.509 certificate. Used to sign requests to the IdP
|
||||
certificate_path =
|
||||
|
||||
# Base64-encoded private key. Used to decrypt assertions from the IdP
|
||||
private_key =
|
||||
|
||||
# Path to the private key. Used to decrypt assertions from the IdP
|
||||
private_key_path =
|
||||
|
||||
# Base64-encoded IdP SAML metadata XML. Used to verify and obtain binding locations from the IdP
|
||||
idp_metadata =
|
||||
|
||||
# Path to the SAML metadata XML. Used to verify and obtain binding locations from the IdP
|
||||
idp_metadata_path =
|
||||
|
||||
# URL to fetch SAML IdP metadata. Used to verify and obtain binding locations from the IdP
|
||||
idp_metadata_url =
|
||||
|
||||
# Duration, since the IdP issued a response and the SP is allowed to process it. Defaults to 90 seconds
|
||||
max_issue_delay = 90s
|
||||
|
||||
# Duration, for how long the SP's metadata should be valid. Defaults to 48 hours
|
||||
metadata_valid_duration = 48h
|
||||
|
||||
# Friendly name or name of the attribute within the SAML assertion to use as the user's name
|
||||
assertion_attribute_name = displayName
|
||||
|
||||
# Friendly name or name of the attribute within the SAML assertion to use as the user's login handle
|
||||
assertion_attribute_login = mail
|
||||
|
||||
# Friendly name or name of the attribute within the SAML assertion to use as the user's email
|
||||
assertion_attribute_email = mail
|
||||
|
||||
#################################### Basic Auth ##########################
|
||||
[auth.basic]
|
||||
enabled = true
|
||||
@@ -683,9 +706,6 @@ container_name =
|
||||
server_url =
|
||||
# If the remote HTTP image renderer service runs on a different server than the Grafana server you may have to configure this to a URL where Grafana is reachable, e.g. http://grafana.domain/.
|
||||
callback_url =
|
||||
# Concurrent render request limit affects when the /render HTTP endpoint is used. Rendering many images at the same time can overload the server,
|
||||
# which this setting can help protect against by only allowing a certain amount of concurrent requests.
|
||||
concurrent_render_request_limit = 30
|
||||
|
||||
[panels]
|
||||
# here for to support old env variables, can remove after a few months
|
||||
@@ -695,68 +715,6 @@ disable_sanitize_html = false
|
||||
[plugins]
|
||||
enable_alpha = false
|
||||
app_tls_skip_verify_insecure = false
|
||||
# Enter a comma-separated list of plugin identifiers to identify plugins that are allowed to be loaded even if they lack a valid signature.
|
||||
allow_loading_unsigned_plugins =
|
||||
|
||||
#################################### Grafana Image Renderer Plugin ##########################
|
||||
[plugin.grafana-image-renderer]
|
||||
# Instruct headless browser instance to use a default timezone when not provided by Grafana, e.g. when rendering panel image of alert.
|
||||
# See ICU’s metaZones.txt (https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt) for a list of supported
|
||||
# timezone IDs. Fallbacks to TZ environment variable if not set.
|
||||
rendering_timezone =
|
||||
|
||||
# Instruct headless browser instance to use a default language when not provided by Grafana, e.g. when rendering panel image of alert.
|
||||
# Please refer to the HTTP header Accept-Language to understand how to format this value, e.g. 'fr-CH, fr;q=0.9, en;q=0.8, de;q=0.7, *;q=0.5'.
|
||||
rendering_language =
|
||||
|
||||
# Instruct headless browser instance to use a default device scale factor when not provided by Grafana, e.g. when rendering panel image of alert.
|
||||
# Default is 1. Using a higher value will produce more detailed images (higher DPI), but will require more disk space to store an image.
|
||||
rendering_viewport_device_scale_factor =
|
||||
|
||||
# Instruct headless browser instance whether to ignore HTTPS errors during navigation. Per default HTTPS errors are not ignored. Due to
|
||||
# the security risk it's not recommended to ignore HTTPS errors.
|
||||
rendering_ignore_https_errors =
|
||||
|
||||
# Instruct headless browser instance whether to capture and log verbose information when rendering an image. Default is false and will
|
||||
# only capture and log error messages. When enabled, debug messages are captured and logged as well.
|
||||
# For the verbose information to be included in the Grafana server log you have to adjust the rendering log level to debug, configure
|
||||
# [log].filter = rendering:debug.
|
||||
rendering_verbose_logging =
|
||||
|
||||
# Instruct headless browser instance whether to output its debug and error messages into running process of remote rendering service.
|
||||
# Default is false. This can be useful to enable (true) when troubleshooting.
|
||||
rendering_dumpio =
|
||||
|
||||
# Additional arguments to pass to the headless browser instance. Default is --no-sandbox. The list of Chromium flags can be found
|
||||
# here (https://peter.sh/experiments/chromium-command-line-switches/). Multiple arguments is separated with comma-character.
|
||||
rendering_args =
|
||||
|
||||
# You can configure the plugin to use a different browser binary instead of the pre-packaged version of Chromium.
|
||||
# Please note that this is not recommended, since you may encounter problems if the installed version of Chrome/Chromium is not
|
||||
# compatible with the plugin.
|
||||
rendering_chrome_bin =
|
||||
|
||||
# Instruct how headless browser instances are created. Default is 'default' and will create a new browser instance on each request.
|
||||
# Mode 'clustered' will make sure that only a maximum of browsers/incognito pages can execute concurrently.
|
||||
# Mode 'reusable' will have one browser instance and will create a new incognito page on each request.
|
||||
rendering_mode =
|
||||
|
||||
# When rendering_mode = clustered you can instruct how many browsers or incognito pages can execute concurrently. Default is 'browser'
|
||||
# and will cluster using browser instances.
|
||||
# Mode 'context' will cluster using incognito pages.
|
||||
rendering_clustering_mode =
|
||||
# When rendering_mode = clustered you can define maximum number of browser instances/incognito pages that can execute concurrently..
|
||||
rendering_clustering_max_concurrency =
|
||||
|
||||
# Limit the maxiumum viewport width, height and device scale factor that can be requested.
|
||||
rendering_viewport_max_width =
|
||||
rendering_viewport_max_height =
|
||||
rendering_viewport_max_device_scale_factor =
|
||||
|
||||
# Change the listening host and port of the gRPC server. Default host is 127.0.0.1 and default port is 0 and will automatically assign
|
||||
# a port not in use.
|
||||
grpc_host =
|
||||
grpc_port =
|
||||
|
||||
[enterprise]
|
||||
license_path =
|
||||
|
||||
+43
-85
@@ -229,9 +229,9 @@
|
||||
# Number dashboard versions to keep (per dashboard). Default: 20, Minimum: 1
|
||||
;versions_to_keep = 20
|
||||
|
||||
# Minimum dashboard refresh interval. When set, this will restrict users to set the refresh interval of a dashboard lower than given interval. Per default this is 5 seconds.
|
||||
# Minimum dashboard refresh interval. When set, this will restrict users to set the refresh interval of a dashboard lower than given interval. Per default this is not set/unrestricted.
|
||||
# The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
|
||||
;min_refresh_interval = 5s
|
||||
;min_refresh_interval =
|
||||
|
||||
#################################### Users ###############################
|
||||
[users]
|
||||
@@ -297,9 +297,6 @@
|
||||
# This setting is ignored if multiple OAuth providers are configured.
|
||||
;oauth_auto_login = false
|
||||
|
||||
# OAuth state max age cookie duration. Defaults to 60 seconds.
|
||||
;oauth_state_cookie_max_age = 60
|
||||
|
||||
# limit of api_key seconds to live before expiration
|
||||
;api_key_max_seconds_to_live = -1
|
||||
|
||||
@@ -376,21 +373,6 @@
|
||||
;allowed_domains =
|
||||
;allowed_groups =
|
||||
|
||||
#################################### Okta OAuth #######################
|
||||
[auth.okta]
|
||||
;name = Okta
|
||||
;enabled = false
|
||||
;allow_sign_up = true
|
||||
;client_id = some_id
|
||||
;client_secret = some_secret
|
||||
;scopes = openid profile email groups
|
||||
;auth_url = https://<tenant-id>.okta.com/oauth2/v1/authorize
|
||||
;token_url = https://<tenant-id>.okta.com/oauth2/v1/token
|
||||
;api_url = https://<tenant-id>.okta.com/oauth2/v1/userinfo
|
||||
;allowed_domains =
|
||||
;allowed_groups =
|
||||
;role_attribute_path =
|
||||
|
||||
#################################### Generic OAuth ##########################
|
||||
[auth.generic_oauth]
|
||||
;enabled = false
|
||||
@@ -413,6 +395,47 @@
|
||||
;tls_client_key =
|
||||
;tls_client_ca =
|
||||
|
||||
#################################### SAML Auth ###########################
|
||||
[auth.saml] # Enterprise only
|
||||
# Defaults to false. If true, the feature is enabled.
|
||||
;enabled = false
|
||||
|
||||
# Base64-encoded public X.509 certificate. Used to sign requests to the IdP
|
||||
;certificate =
|
||||
|
||||
# Path to the public X.509 certificate. Used to sign requests to the IdP
|
||||
;certificate_path =
|
||||
|
||||
# Base64-encoded private key. Used to decrypt assertions from the IdP
|
||||
;private_key =
|
||||
|
||||
;# Path to the private key. Used to decrypt assertions from the IdP
|
||||
;private_key_path =
|
||||
|
||||
# Base64-encoded IdP SAML metadata XML. Used to verify and obtain binding locations from the IdP
|
||||
;idp_metadata =
|
||||
|
||||
# Path to the SAML metadata XML. Used to verify and obtain binding locations from the IdP
|
||||
;idp_metadata_path =
|
||||
|
||||
# URL to fetch SAML IdP metadata. Used to verify and obtain binding locations from the IdP
|
||||
;idp_metadata_url =
|
||||
|
||||
# Duration, since the IdP issued a response and the SP is allowed to process it. Defaults to 90 seconds.
|
||||
;max_issue_delay = 90s
|
||||
|
||||
# Duration, for how long the SP's metadata should be valid. Defaults to 48 hours.
|
||||
;metadata_valid_duration = 48h
|
||||
|
||||
# Friendly name or name of the attribute within the SAML assertion to use as the user's name
|
||||
;assertion_attribute_name = displayName
|
||||
|
||||
# Friendly name or name of the attribute within the SAML assertion to use as the user's login handle
|
||||
;assertion_attribute_login = mail
|
||||
|
||||
# Friendly name or name of the attribute within the SAML assertion to use as the user's email
|
||||
;assertion_attribute_email = mail
|
||||
|
||||
#################################### Basic Auth ##########################
|
||||
[auth.basic]
|
||||
;enabled = true
|
||||
@@ -673,9 +696,6 @@
|
||||
;server_url =
|
||||
# If the remote HTTP image renderer service runs on a different server than the Grafana server you may have to configure this to a URL where Grafana is reachable, e.g. http://grafana.domain/.
|
||||
;callback_url =
|
||||
# Concurrent render request limit affects when the /render HTTP endpoint is used. Rendering many images at the same time can overload the server,
|
||||
# which this setting can help protect against by only allowing a certain amount of concurrent requests.
|
||||
;concurrent_render_request_limit = 30
|
||||
|
||||
[panels]
|
||||
# If set to true Grafana will allow script tags in text panels. Not recommended as it enable XSS vulnerabilities.
|
||||
@@ -684,68 +704,6 @@
|
||||
[plugins]
|
||||
;enable_alpha = false
|
||||
;app_tls_skip_verify_insecure = false
|
||||
# Enter a comma-separated list of plugin identifiers to identify plugins that are allowed to be loaded even if they lack a valid signature.
|
||||
;allow_loading_unsigned_plugins =
|
||||
|
||||
#################################### Grafana Image Renderer Plugin ##########################
|
||||
[plugin.grafana-image-renderer]
|
||||
# Instruct headless browser instance to use a default timezone when not provided by Grafana, e.g. when rendering panel image of alert.
|
||||
# See ICU’s metaZones.txt (https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt) for a list of supported
|
||||
# timezone IDs. Fallbacks to TZ environment variable if not set.
|
||||
;rendering_timezone =
|
||||
|
||||
# Instruct headless browser instance to use a default language when not provided by Grafana, e.g. when rendering panel image of alert.
|
||||
# Please refer to the HTTP header Accept-Language to understand how to format this value, e.g. 'fr-CH, fr;q=0.9, en;q=0.8, de;q=0.7, *;q=0.5'.
|
||||
;rendering_language =
|
||||
|
||||
# Instruct headless browser instance to use a default device scale factor when not provided by Grafana, e.g. when rendering panel image of alert.
|
||||
# Default is 1. Using a higher value will produce more detailed images (higher DPI), but will require more disk space to store an image.
|
||||
;rendering_viewport_device_scale_factor =
|
||||
|
||||
# Instruct headless browser instance whether to ignore HTTPS errors during navigation. Per default HTTPS errors are not ignored. Due to
|
||||
# the security risk it's not recommended to ignore HTTPS errors.
|
||||
;rendering_ignore_https_errors =
|
||||
|
||||
# Instruct headless browser instance whether to capture and log verbose information when rendering an image. Default is false and will
|
||||
# only capture and log error messages. When enabled, debug messages are captured and logged as well.
|
||||
# For the verbose information to be included in the Grafana server log you have to adjust the rendering log level to debug, configure
|
||||
# [log].filter = rendering:debug.
|
||||
;rendering_verbose_logging =
|
||||
|
||||
# Instruct headless browser instance whether to output its debug and error messages into running process of remote rendering service.
|
||||
# Default is false. This can be useful to enable (true) when troubleshooting.
|
||||
;rendering_dumpio =
|
||||
|
||||
# Additional arguments to pass to the headless browser instance. Default is --no-sandbox. The list of Chromium flags can be found
|
||||
# here (https://peter.sh/experiments/chromium-command-line-switches/). Multiple arguments is separated with comma-character.
|
||||
;rendering_args =
|
||||
|
||||
# You can configure the plugin to use a different browser binary instead of the pre-packaged version of Chromium.
|
||||
# Please note that this is not recommended, since you may encounter problems if the installed version of Chrome/Chromium is not
|
||||
# compatible with the plugin.
|
||||
;rendering_chrome_bin =
|
||||
|
||||
# Instruct how headless browser instances are created. Default is 'default' and will create a new browser instance on each request.
|
||||
# Mode 'clustered' will make sure that only a maximum of browsers/incognito pages can execute concurrently.
|
||||
# Mode 'reusable' will have one browser instance and will create a new incognito page on each request.
|
||||
;rendering_mode =
|
||||
|
||||
# When rendering_mode = clustered you can instruct how many browsers or incognito pages can execute concurrently. Default is 'browser'
|
||||
# and will cluster using browser instances.
|
||||
# Mode 'context' will cluster using incognito pages.
|
||||
;rendering_clustering_mode =
|
||||
# When rendering_mode = clustered you can define maximum number of browser instances/incognito pages that can execute concurrently..
|
||||
;rendering_clustering_max_concurrency =
|
||||
|
||||
# Limit the maxiumum viewport width, height and device scale factor that can be requested.
|
||||
;rendering_viewport_max_width =
|
||||
;rendering_viewport_max_height =
|
||||
;rendering_viewport_max_device_scale_factor =
|
||||
|
||||
# Change the listening host and port of the gRPC server. Default host is 127.0.0.1 and default port is 0 and will automatically assign
|
||||
# a port not in use.
|
||||
;grpc_host =
|
||||
;grpc_port =
|
||||
|
||||
[enterprise]
|
||||
# Path to a valid Grafana Enterprise license.jwt file
|
||||
|
||||
@@ -4,6 +4,7 @@ This guide helps you get started developing Grafana.
|
||||
|
||||
Before you begin, you might want to read [How to contribute to Grafana as a junior dev](https://medium.com/@ivanahuckova/how-to-contribute-to-grafana-as-junior-dev-c01fe3064502) by [Ivana Huckova](https://medium.com/@ivanahuckova).
|
||||
|
||||
|
||||
## Dependencies
|
||||
|
||||
Make sure you have the following dependencies installed before setting up your developer environment:
|
||||
@@ -20,7 +21,7 @@ We recommend using [Homebrew](https://brew.sh/) for installing any missing depen
|
||||
```
|
||||
brew install git
|
||||
brew install go
|
||||
brew install node@12
|
||||
brew install node
|
||||
|
||||
npm install -g yarn
|
||||
```
|
||||
@@ -51,7 +52,7 @@ After the command has finished, we can start building our source code:
|
||||
yarn start
|
||||
```
|
||||
|
||||
Once `yarn start` has built the assets, it will continue to do so whenever any of the files change. This means you don't have to manually build the assets every time you change the code.
|
||||
Once `yarn start` has built the assets, it will continue to do so whenever any of the files change. This means you don't have to manually build the assets whenever every time you change the code.
|
||||
|
||||
Next, we'll build the web server that will serve the frontend assets we just built.
|
||||
|
||||
@@ -97,35 +98,29 @@ go test -v ./pkg/...
|
||||
|
||||
### Run end-to-end tests
|
||||
|
||||
The end to end tests in Grafana use [Cypress](https://www.cypress.io/) to run automated scripts in a headless Chromium browser. Read more about our [e2e framework](/contribute/style-guides/e2e.md).
|
||||
The end to end tests in Grafana use [Cypress](https://www.cypress.io/) to run automated scripts in a headless Chromium browser. Read more about our [e2e framework](/contribute/style-guides/e2e.md).
|
||||
|
||||
To run the tests:
|
||||
|
||||
```
|
||||
yarn e2e
|
||||
yarn e2e-tests
|
||||
```
|
||||
|
||||
By default, the end-to-end tests starts a Grafana instance listening on `localhost:3001`. To use a specific URL, set the `BASE_URL` environment variable:
|
||||
By default, the end-to-end tests assumes Grafana is available on `localhost:3000`. To use a specific URL, set the `BASE_URL` environment variable:
|
||||
|
||||
```
|
||||
BASE_URL=http://localhost:3333 yarn e2e
|
||||
BASE_URL=http://localhost:3333 yarn e2e-tests
|
||||
```
|
||||
|
||||
To follow the tests in the browser while they're running, use the `yarn e2e:debug`.
|
||||
To follow the tests in the browser while they're running, use the `yarn e2e-tests:debug` instead.
|
||||
|
||||
```
|
||||
yarn e2e:debug
|
||||
```
|
||||
|
||||
If you want to pick a test first, use the `yarn e2e:dev`, to pick a test and follow the test in the browser while it runs.
|
||||
|
||||
```
|
||||
yarn e2e:dev
|
||||
yarn e2e-tests:debug
|
||||
```
|
||||
|
||||
## Configure Grafana for development
|
||||
|
||||
The default configuration, `grafana.ini`, is located in the `conf` directory.
|
||||
The default configuration, `grafana.ini`, is located in the `conf` directory.
|
||||
|
||||
To override the default configuration, create a `custom.ini` file in the `conf` directory. You only need to add the options you wish to override.
|
||||
|
||||
@@ -135,6 +130,7 @@ Enable the development mode, by adding the following line in your `custom.ini`:
|
||||
app_mode = development
|
||||
```
|
||||
|
||||
|
||||
### Add data sources
|
||||
|
||||
By now, you should be able to build and test a change you've made to the Grafana source code. In most cases, you need to add at least one data source to verify the change.
|
||||
@@ -176,7 +172,7 @@ The resulting image will be tagged as grafana/grafana:dev.
|
||||
1. Build the frontend: `go run build.go build-frontend`.
|
||||
1. Build the Docker image: `make build-docker-dev`.
|
||||
|
||||
**Note:** If you are using Docker for macOS, be sure to set the memory limit to be larger than 2 GiB. Otherwise, `grunt build` may fail. The memory limit settings are available under **Docker Desktop** -> **Preferences** -> **Advanced**.
|
||||
**Note:** If you are using Docker for macOS, be sure to set the memory limit to be larger than 2 GiB. Otherwise `grunt build` may fail. The memory limit settings are available under **Docker Desktop** -> **Preferences** -> **Advanced**.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
@@ -184,7 +180,7 @@ Are you having issues with setting up your environment? Here are some tips that
|
||||
|
||||
### Too many open files when running `make run`
|
||||
|
||||
Depending on your environment, you may have to increase the maximum number of open files allowed. For the rest of this section, we will assume you are on a Unix like OS (e.g. Linux/MacOS), where you can control the maximum number of open files through the [ulimit](https://ss64.com/bash/ulimit.html) shell command.
|
||||
Depending on your environment, you may have to increase the maximum number of open files allowed.
|
||||
|
||||
To see how many open files are allowed, run:
|
||||
|
||||
@@ -204,28 +200,7 @@ The number of files needed may be different on your environment. To determine th
|
||||
find ./conf ./pkg ./public/views | wc -l
|
||||
```
|
||||
|
||||
Another alternative is to limit the files being watched. The directories that are watched for changes are listed in the `.bra.toml` file in the root directory.
|
||||
|
||||
To retain your `ulimit` configuration, i.e. so it will be remembered for future sessions, you need to commit it to your command line shell initialization file. Which file this will be depends on the shell you are using, here are some examples:
|
||||
|
||||
* zsh -> ~/.zshrc
|
||||
* bash -> ~/.bashrc
|
||||
|
||||
Commit your ulimit configuration to your shell initialization file as follows ($LIMIT being your chosen limit and $INIT_FILE being the initialization file for your shell):
|
||||
|
||||
```
|
||||
echo ulimit -S -n $LIMIT >> $INIT_FILE
|
||||
```
|
||||
|
||||
Your command shell should read the initialization file in question every time it gets started, and apply your `ulimit` command.
|
||||
|
||||
For some people, typically using the bash shell, ulimit fails with an error similar to the following:
|
||||
|
||||
```
|
||||
ulimit: open files: cannot modify limit: Operation not permitted
|
||||
```
|
||||
|
||||
If that happens to you, chances are you've already set a lower limit and your shell won't let you set a higher one. Try looking in your shell initalization files (~/.bashrc typically), if there's already a ulimit command that you can tweak.
|
||||
Another alternative is to limit the files being watched. The directories that are watched for changes are listed in the `.bra.toml` file in the root directory.
|
||||
|
||||
## Next steps
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@ This style guide applies to all documentation created for Grafana products.
|
||||
|
||||
For information about how to write technical documentation, we suggest reviewing the content of the [Google Technical Writing courses](https://developers.google.com/tech-writing).
|
||||
|
||||
The [Divio documentation system](https://documentation.divio.com/) site is also a good resource.
|
||||
|
||||
## Contributing
|
||||
|
||||
The *Documentation style guide* is a living document. Add to it whenever a style decision is made or a question is answered regarding style, grammar, or word choice.
|
||||
@@ -141,10 +139,6 @@ Two words, not one
|
||||
* Correct, but passive voice: Your list of active alarms is displayed.
|
||||
* Incorrect: The list of active alarms displays.
|
||||
|
||||
#### intro, introduction
|
||||
|
||||
"Introduction" is the preferred word. Use "intro" if there are space constraints (like on the side menu) or you are specifically trying for a less formal, more conversational tone.
|
||||
|
||||
#### metadata
|
||||
|
||||
One word, not two.
|
||||
|
||||
@@ -1,51 +1,19 @@
|
||||
# End to end test framework
|
||||
|
||||
Grafana Labs uses a minimal home grown solution built on top of Cypress for our end to end (e2e) tests.
|
||||
|
||||
## Commands
|
||||
|
||||
- `yarn e2e` Creates an isolated grafana-server home under `<repo-root>/e2e/tmp` with provisioned data sources and dashboards. This
|
||||
copies locally build binary and frontend assets from your repo root so you need to have a built backend and frontend
|
||||
for this to run locally. The server starts on port 3001 so it does not conflict with your normal dev server.
|
||||
- `yarn e2e:debug` Same as above but runs the tests in chrome and does not shutdown after completion.
|
||||
- `yarn e2e:dev` Same as above but does not run any tests on startup. It lets you pick a test first.
|
||||
|
||||
If you already have a Grafana instance running, you can provide a specific URL by setting the `BASE_URL` environment variable:
|
||||
|
||||
```
|
||||
BASE_URL=http://172.0.10.2:3333 yarn e2e
|
||||
```
|
||||
|
||||
The above commands use some utils scripts under `<repo-root>/e2e` that can also be used for more control.
|
||||
|
||||
- `./e2e/start-server` This creates a fresh new grafana server working dir, setup's config and starts the server. It
|
||||
will also kill any previously started server that is still running using pid file at `<repo-root>/e2e/tmp/pid`.
|
||||
- `./e2e/wait-for-grafana` waits for `$HOST` and `$PORT` to be available. Per default localhost and 3001.
|
||||
- `./e2e/run-suite <debug|dev|noarg>` Starts cypress in different modes.
|
||||
|
||||
## Test Suites
|
||||
|
||||
All the integration tests are located at `e2e/suite<x>/specs`. The page objects and reusable flows are in the
|
||||
`packages/grafana-e2e` package.
|
||||
|
||||
## Basic concepts
|
||||
|
||||
Here is a good introduction to e2e best practices: https://martinfowler.com/bliki/PageObject.html.
|
||||
|
||||
- `Selector`: A unique identifier that is used from the e2e framework to retrieve an element from the Browser
|
||||
- `Page`: An abstraction for an object that contains one or more `Selectors` with `visit` function to navigate to the page.
|
||||
- `Component`: An abstraction for an object that contains one or more `Selectors` but without `visit` function
|
||||
- `Page`: An abstraction for an object that contains one or more `Selectors`
|
||||
- `Flow`: An abstraction that contains a sequence of actions on one or more `Pages` that can be reused and shared between tests
|
||||
|
||||
## Basic example
|
||||
|
||||
Let's start with a simple example with a single selector. For simplicity, all examples are in JSX.
|
||||
|
||||
In our example app, we have an input that we want to type some text into during our e2e test.
|
||||
|
||||
```jsx harmony
|
||||
<div>
|
||||
<input type="text" className="gf-form-input login-form-input" />
|
||||
<input type="text" className="gf-form-input login-form-input"/>
|
||||
</div>
|
||||
```
|
||||
|
||||
@@ -53,26 +21,25 @@ We could define a selector using `JQuery` [type selectors](https://api.jquery.co
|
||||
|
||||
At Grafana, we use `aria-label` as our preferred way of defining selectors instead of `data-*` attributes. This also aids in accessibility.
|
||||
Let's add a descriptive `aria-label` to our simple example.
|
||||
|
||||
```jsx harmony
|
||||
<div>
|
||||
<input type="text" className="gf-form-input login-form-input" aria-label="Username input field" />
|
||||
<input type="text" className="gf-form-input login-form-input" aria-label="Username input field"/>
|
||||
</div>
|
||||
```
|
||||
|
||||
Now that we added the `aria-label` we suddenly get more information about this particular field. It's an input field that represents a username, but there it's still not really signaling that it's part of an e2e test.
|
||||
|
||||
The next step is to create a `Page` representation in our e2e test framework to glue the test with the real implementation using the `pageFactory` function. For that function we can supply a `url` and `selectors` like in the example below:
|
||||
|
||||
```typescript
|
||||
export const Login = {
|
||||
url: "/login", // used when called from Login.visit()
|
||||
username: "Username input field", // used when called from Login.username().type('Hello World')
|
||||
};
|
||||
export const Login = pageFactory({
|
||||
url: '/login', // used when called from Login.visit()
|
||||
selectors: {
|
||||
username: 'Username input field', // used when called from Login.username().type('Hello World')
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
The next step is to add the `Login` page to the exported const `Pages` in `packages/grafana-e2e-selectors/src/selectors/pages.ts` so that it appears when we type `e2e.pages` in our IDE.
|
||||
|
||||
The next step is to add the `Login` page to the exported const `Pages` in `packages/grafana-e2e/src/pages/index.ts` so that it appears when we type `e2e.pages` in our IDE.
|
||||
```ecmascript 6
|
||||
export const Pages = {
|
||||
Login,
|
||||
@@ -82,21 +49,17 @@ export const Pages = {
|
||||
};
|
||||
|
||||
```
|
||||
|
||||
Now that we have a `Page` called `Login` in our `Pages` const we can use that to add a selector in our html like shown below and now this really signals to future developers that it is part of an e2e test.
|
||||
|
||||
```jsx harmony
|
||||
<div>
|
||||
<input type="text" className="gf-form-input login-form-input" aria-label={selectors.pages.Login.username} />
|
||||
<input type="text" className="gf-form-input login-form-input" aria-label={e2e.pages.Login.selectors.username}/>
|
||||
</div>
|
||||
```
|
||||
|
||||
The last step in our example is to use our `Login` page as part of a test.
|
||||
|
||||
The last step in our example is to use our `Login` page as part of a test. The `pageFactory` function we used before gives us two things:
|
||||
- The `url` property is used whenever we call the `visit` function and is equivalent to the Cypress function [cy.visit()](https://docs.cypress.io/api/commands/visit.html#Syntax).
|
||||
> Best practice after calling `visit` is to always call `should` on a selector to prevent flaky tests when you try to access an element that isn't ready. For more information, refer to [Commands vs. assertions](https://docs.cypress.io/guides/core-concepts/retry-ability.html#Commands-vs-assertions).
|
||||
- Any defined selector can be accessed from the `Login` page by invoking it. This is equivalent to the result of the Cypress function [cy.get(...)](https://docs.cypress.io/api/commands/get.html#Syntax).
|
||||
|
||||
> Best practice after calling `visit` is to always call `should` on a selector to prevent flaky tests when you try to access an element that isn't ready. For more information, refer to [Commands vs. assertions](https://docs.cypress.io/guides/core-concepts/retry-ability.html#Commands-vs-assertions).
|
||||
- Any defined selector in the `selectors` property can be accessed from the `Login` page by invoking it. This is equivalent to the result of the Cypress function [cy.get(...)](https://docs.cypress.io/api/commands/get.html#Syntax).
|
||||
```ecmascript 6
|
||||
describe('Login test', () => {
|
||||
it('Should pass', () => {
|
||||
@@ -110,7 +73,6 @@ describe('Login test', () => {
|
||||
```
|
||||
|
||||
## Advanced example
|
||||
|
||||
Let's take a look at an example that uses the same `selector` for multiple items in a list for instance. In this example app we have a list of data sources that we want to click on during an e2e test.
|
||||
|
||||
```jsx harmony
|
||||
@@ -118,35 +80,36 @@ Let's take a look at an example that uses the same `selector` for multiple items
|
||||
{dataSources.map(dataSource => (
|
||||
<li className="card-item-wrapper" key={dataSource.id}>
|
||||
<a className="card-item" href={`datasources/edit/${dataSource.id}`}>
|
||||
<div className="card-item-name">{dataSource.name}</div>
|
||||
<div className="card-item-name">
|
||||
{dataSource.name}
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
```
|
||||
|
||||
````
|
||||
```
|
||||
|
||||
Just as before in the basic example we'll start by creating a page abstraction using the `pageFactory` function:
|
||||
```typescript
|
||||
export const DataSources = {
|
||||
export const DataSources = pageFactory({
|
||||
url: '/datasources',
|
||||
dataSources: (dataSourceName: string) => `Data source list item ${dataSourceName}`,
|
||||
};
|
||||
````
|
||||
|
||||
selectors: {
|
||||
dataSources: (dataSourceName: string) => `Data source list item ${dataSourceName}`,
|
||||
},
|
||||
});
|
||||
```
|
||||
You might have noticed that instead of a simple `string` as the `selector`, we're using a `function` that takes a string parameter as an argument and returns a formatted string using the argument.
|
||||
|
||||
Just as before we need to add the `DataSources` page to the exported const `Pages` in `packages/grafana-e2e-selectors/src/selectors/pages.ts`.
|
||||
Just as before we need to add the `DataSources` page to the exported const `Pages` in `packages/grafana-e2e/src/pages/index.ts`.
|
||||
|
||||
The next step is to use the `dataSources` selector function as in our example below:
|
||||
|
||||
```jsx harmony
|
||||
<ul>
|
||||
{dataSources.map(dataSource => (
|
||||
<li className="card-item-wrapper" key={dataSource.id}>
|
||||
<a className="card-item" href={`datasources/edit/${dataSource.id}`}>
|
||||
<div className="card-item-name" aria-label={selectors.pages.DataSources.dataSources(dataSource.name)}>
|
||||
<div className="card-item-name" aria-label={e2e.pages.DataSources.selectors.dataSources(dataSource.name)}>
|
||||
{dataSource.name}
|
||||
</div>
|
||||
</a>
|
||||
@@ -156,7 +119,6 @@ The next step is to use the `dataSources` selector function as in our example be
|
||||
```
|
||||
|
||||
When this list is rendered with the data sources with names `A`, `B`, `C` the resulting html would become:
|
||||
|
||||
```jsx harmony
|
||||
<div class="card-item-name" aria-label="Data source list item A">
|
||||
A
|
||||
@@ -172,9 +134,7 @@ When this list is rendered with the data sources with names `A`, `B`, `C` the re
|
||||
```
|
||||
|
||||
Now we can write our test. The one thing that differs from the `Basic example` is that we pass in which data source we want to click on as an argument to the selector function:
|
||||
|
||||
> Best practice after calling `visit` is to always call `should` on a selector to prevent flaky tests when you try to access an element that isn't ready. For more information, refer to [Commands vs. assertions](https://docs.cypress.io/guides/core-concepts/retry-ability.html#Commands-vs-assertions).
|
||||
|
||||
```ecmascript 6
|
||||
describe('List test', () => {
|
||||
it('Clicking on data source named B', () => {
|
||||
@@ -187,18 +147,17 @@ describe('List test', () => {
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
## Debugging PhantomJS image rendering
|
||||
|
||||
### Common Error
|
||||
|
||||
The most common error with PhantomJs image rendering is when a PR introduces an import that has functionality that's not supported by PhantomJs. To quickly identify which new import causes this you can use a tool like `es-check`.
|
||||
|
||||
|
||||
1. Run > `npx es-check es5 './public/build/*.js'`
|
||||
2. Check the output for files that break es5 compatibility.
|
||||
3. Lazy load the failing imports if possible.
|
||||
3. Lazy load the failing imports if possible.
|
||||
|
||||
### Debugging
|
||||
|
||||
There is no easy or comprehensive way to debug PhantomJS smoke test (image rendering) failures. However, PhantomJS exposes remote debugging interface which can give you a sense of what is going wrong in the smoke test. Before performing the steps described below make sure your local Grafana instance is running:
|
||||
|
||||
1. Go to `tools/phantomjs` directory
|
||||
|
||||
@@ -10,7 +10,7 @@ Storybook is:
|
||||
|
||||
## How to create stories
|
||||
|
||||
Stories for a component should be placed next to the component file. The Storybook file requires the same name as the component file. For example, a story for `SomeComponent.tsx` will have the file name `SomeComponent.story.tsx`. If a story should be internal, not visible in production, name the file `SomeComponent.story.internal.tsx`.
|
||||
Stories for a component should be placed next to the component file. The Storybook file requires the same name as the component file. For example, a story for `SomeComponent.tsx` will have the file name `SomeComponent.story.tsx`.
|
||||
|
||||
### Writing stories
|
||||
|
||||
@@ -101,10 +101,7 @@ import { MyComponent } from "./MyComponent";
|
||||
|
||||
### MDX file without a relationship to a component
|
||||
|
||||
An MDX file can exist by itself without any connection to a story. This can be good for writing things such as a general guidelines page. Two things are required for this to work:
|
||||
|
||||
- The file needs to be named `*.story.mdx`
|
||||
- A `Meta` tag must exist that says where in the hierarchy the component lives. It can look like this:
|
||||
An MDX file can exist by itself without any connection to a story. This can be good for writing things such as a general guidelines page. Something that is required when the MDX file has no relation to a component is a `Meta` tag that says where in the hierarchy the component will live. It can look like this:
|
||||
|
||||
```jsx
|
||||
<Meta title="Docs Overview/Color Palettes"/>
|
||||
|
||||
@@ -23,7 +23,7 @@ Try to *chunk* your content. This means you should organize the document so that
|
||||
|
||||
### Chunking example
|
||||
|
||||
If I was writing content for a site called *Doggie handbook*, I might organize it like this.
|
||||
If I was writing a topic called *Doggie handbook*, I might organize it like this.
|
||||
|
||||
**Concept**
|
||||
* What a dog is
|
||||
|
||||
@@ -26,7 +26,7 @@ In the case of a long task, then you probably won't need any headings except for
|
||||
1. Use second-person imperative tense.
|
||||
1. Basically, "You, do this" with every sentence.
|
||||
1. Do not use the third-person "user" for steps you want the reader ("you") to perform.
|
||||
1. Write steps that contain one action, possibly two related actions, such as copy and paste a thing or save and quit the program.
|
||||
1. Write steps that contain one action, possibly two related actions, such as copy and paste a thing or save and quite the program.
|
||||
If a sentence is not telling the reader to do something, then it is not a step. You can use nested images or paragraphs like this one to add information if necessary.
|
||||
|
||||
In many cases, you should tell the reader what the outcome should be so that they know when they are done.
|
||||
|
||||
+1
-3
@@ -36,7 +36,5 @@ make devenv sources=influxdb,prometheus2,elastic5
|
||||
Some of the blocks support dynamic change of the image version used in the Docker file. The signature looks like this:
|
||||
|
||||
```bash
|
||||
make devenv sources=postgres,openldap,grafana postgres_version=9.2 grafana_version=6.7.0-beta1
|
||||
make devenv sources=postgres,openldap postgres_version=9.2
|
||||
```
|
||||
|
||||
Note: The grafana block is pre-configured with the dev-datasources and dashboards.
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
{
|
||||
"editable": true,
|
||||
"gnetId": null,
|
||||
"graphTooltip": 0,
|
||||
"id": null,
|
||||
"links": [],
|
||||
"panels": [
|
||||
{
|
||||
"alert": {
|
||||
"conditions": [
|
||||
{
|
||||
"evaluator": {
|
||||
"params": [
|
||||
65
|
||||
],
|
||||
"type": "gt"
|
||||
},
|
||||
"operator": {
|
||||
"type": "and"
|
||||
},
|
||||
"query": {
|
||||
"params": [
|
||||
"A",
|
||||
"5m",
|
||||
"now"
|
||||
]
|
||||
},
|
||||
"reducer": {
|
||||
"params": [],
|
||||
"type": "avg"
|
||||
},
|
||||
"type": "query"
|
||||
}
|
||||
],
|
||||
"executionErrorState": "alerting",
|
||||
"frequency": "10s",
|
||||
"handler": 1,
|
||||
"name": "bulk alerting",
|
||||
"noDataState": "no_data",
|
||||
"notifications": []
|
||||
},
|
||||
"aliasColors": {},
|
||||
"bars": false,
|
||||
"dashLength": 10,
|
||||
"dashes": false,
|
||||
"datasource": "gdev-prometheus",
|
||||
"fill": 1,
|
||||
"gridPos": {
|
||||
"h": 9,
|
||||
"w": 12,
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"id": 2,
|
||||
"legend": {
|
||||
"avg": false,
|
||||
"current": false,
|
||||
"max": false,
|
||||
"min": false,
|
||||
"show": true,
|
||||
"total": false,
|
||||
"values": false
|
||||
},
|
||||
"lines": true,
|
||||
"linewidth": 1,
|
||||
"nullPointMode": "null",
|
||||
"percentage": false,
|
||||
"pointradius": 5,
|
||||
"points": false,
|
||||
"renderer": "flot",
|
||||
"seriesOverrides": [],
|
||||
"spaceLength": 10,
|
||||
"stack": false,
|
||||
"steppedLine": false,
|
||||
"targets": [
|
||||
{
|
||||
"$$hashKey": "object:117",
|
||||
"expr": "go_goroutines",
|
||||
"format": "time_series",
|
||||
"intervalFactor": 1,
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"thresholds": [
|
||||
{
|
||||
"colorMode": "critical",
|
||||
"fill": true,
|
||||
"line": true,
|
||||
"op": "gt",
|
||||
"value": 50
|
||||
}
|
||||
],
|
||||
"timeFrom": null,
|
||||
"timeShift": null,
|
||||
"title": "Panel Title",
|
||||
"tooltip": {
|
||||
"shared": true,
|
||||
"sort": 0,
|
||||
"value_type": "individual"
|
||||
},
|
||||
"type": "graph",
|
||||
"xaxis": {
|
||||
"buckets": null,
|
||||
"mode": "time",
|
||||
"name": null,
|
||||
"show": true,
|
||||
"values": []
|
||||
},
|
||||
"yaxes": [
|
||||
{
|
||||
"format": "short",
|
||||
"label": null,
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": null,
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"format": "short",
|
||||
"label": null,
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": null,
|
||||
"show": true
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"schemaVersion": 16,
|
||||
"style": "dark",
|
||||
"tags": [],
|
||||
"templating": {
|
||||
"list": []
|
||||
},
|
||||
"time": {
|
||||
"from": "now-6h",
|
||||
"to": "now"
|
||||
},
|
||||
"timepicker": {
|
||||
"refresh_intervals": [
|
||||
"5s",
|
||||
"10s",
|
||||
"30s",
|
||||
"1m",
|
||||
"5m",
|
||||
"15m",
|
||||
"30m",
|
||||
"1h",
|
||||
"2h",
|
||||
"1d"
|
||||
],
|
||||
"time_options": [
|
||||
"5m",
|
||||
"15m",
|
||||
"1h",
|
||||
"6h",
|
||||
"12h",
|
||||
"24h",
|
||||
"2d",
|
||||
"7d",
|
||||
"30d"
|
||||
]
|
||||
},
|
||||
"timezone": "",
|
||||
"title": "New dashboard",
|
||||
"uid": null,
|
||||
"version": 0
|
||||
}
|
||||
@@ -1,170 +0,0 @@
|
||||
{
|
||||
alertingDashboard(dashboardCounter, datasourceCounter):: {
|
||||
title: "alerting-title-" + dashboardCounter,
|
||||
editable: true,
|
||||
gnetId: null,
|
||||
graphTooltip: 0,
|
||||
id: null,
|
||||
links: [],
|
||||
panels: [
|
||||
{
|
||||
alert: {
|
||||
conditions: [
|
||||
{
|
||||
evaluator: {
|
||||
params: [
|
||||
65
|
||||
],
|
||||
type: "gt"
|
||||
},
|
||||
operator: {
|
||||
type: "and"
|
||||
},
|
||||
query: {
|
||||
params: [
|
||||
"A",
|
||||
"5m",
|
||||
"now"
|
||||
]
|
||||
},
|
||||
reducer: {
|
||||
params: [],
|
||||
type: "avg"
|
||||
},
|
||||
type: "query"
|
||||
}
|
||||
],
|
||||
executionErrorState: "alerting",
|
||||
frequency: "24h",
|
||||
handler: 1,
|
||||
name: "bulk alerting " + dashboardCounter,
|
||||
noDataState: "no_data",
|
||||
notifications: []
|
||||
},
|
||||
aliasColors: {},
|
||||
bars: false,
|
||||
dashLength: 10,
|
||||
dashes: false,
|
||||
datasource: "gfdev-bulkalerting-" + datasourceCounter,
|
||||
fill: 1,
|
||||
gridPos: {
|
||||
h: 9,
|
||||
w: 12,
|
||||
x: 0,
|
||||
y: 0
|
||||
},
|
||||
id: 1,
|
||||
legend: {
|
||||
avg: false,
|
||||
current: false,
|
||||
max: false,
|
||||
min: false,
|
||||
show: true,
|
||||
total: false,
|
||||
values: false
|
||||
},
|
||||
lines: true,
|
||||
linewidth: 1,
|
||||
nullPointMode: "null",
|
||||
percentage: false,
|
||||
pointradius: 5,
|
||||
points: false,
|
||||
renderer: "flot",
|
||||
seriesOverrides: [],
|
||||
spaceLength: 10,
|
||||
stack: false,
|
||||
steppedLine: false,
|
||||
targets: [
|
||||
{
|
||||
expr: "go_goroutines",
|
||||
format: "time_series",
|
||||
intervalFactor: 1,
|
||||
refId: "A"
|
||||
}
|
||||
],
|
||||
thresholds: [
|
||||
{
|
||||
colorMode: "critical",
|
||||
fill: true,
|
||||
line: true,
|
||||
op: "gt",
|
||||
value: 50
|
||||
}
|
||||
],
|
||||
timeFrom: null,
|
||||
timeShift: null,
|
||||
title: "Panel Title",
|
||||
tooltip: {
|
||||
shared: true,
|
||||
sort: 0,
|
||||
value_type: "individual"
|
||||
},
|
||||
type: "graph",
|
||||
xaxis: {
|
||||
buckets: null,
|
||||
mode: "time",
|
||||
name: null,
|
||||
show: true,
|
||||
values: []
|
||||
},
|
||||
yaxes: [
|
||||
{
|
||||
format: "short",
|
||||
label: null,
|
||||
logBase: 1,
|
||||
max: null,
|
||||
min: null,
|
||||
show: true
|
||||
},
|
||||
{
|
||||
format: "short",
|
||||
label: null,
|
||||
logBase: 1,
|
||||
max: null,
|
||||
min: null,
|
||||
show: true
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
schemaVersion: 16,
|
||||
style: "dark",
|
||||
tags: [],
|
||||
templating: {
|
||||
list: []
|
||||
},
|
||||
time: {
|
||||
from: "now-6h",
|
||||
to: "now"
|
||||
},
|
||||
timepicker: {
|
||||
refresh_intervals: [
|
||||
"5s",
|
||||
"10s",
|
||||
"30s",
|
||||
"1m",
|
||||
"5m",
|
||||
"15m",
|
||||
"30m",
|
||||
"1h",
|
||||
"2h",
|
||||
"1d"
|
||||
],
|
||||
time_options: [
|
||||
"5m",
|
||||
"15m",
|
||||
"1h",
|
||||
"6h",
|
||||
"12h",
|
||||
"24h",
|
||||
"2d",
|
||||
"7d",
|
||||
"30d"
|
||||
]
|
||||
},
|
||||
timezone: "",
|
||||
uid: null,
|
||||
version: 0
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
local arr = std.range(1, 100);
|
||||
|
||||
{
|
||||
"apiVersion": 1,
|
||||
"datasources": [
|
||||
{
|
||||
"name": 'gfdev-bulkalerting-' + counter,
|
||||
"type": "prometheus",
|
||||
"access": "proxy",
|
||||
"url": "http://localhost:9090"
|
||||
}
|
||||
for counter in arr
|
||||
],
|
||||
}
|
||||
@@ -1,248 +0,0 @@
|
||||
|
||||
apiVersion: 1
|
||||
|
||||
datasources:
|
||||
- name: gdev-graphite
|
||||
type: graphite
|
||||
access: proxy
|
||||
url: http://graphite11:80
|
||||
jsonData:
|
||||
graphiteVersion: "1.1"
|
||||
|
||||
- name: gdev-prometheus
|
||||
type: prometheus
|
||||
access: proxy
|
||||
url: http://prometheus:9090
|
||||
|
||||
- name: gdev-slow-prometheus
|
||||
type: prometheus
|
||||
access: proxy
|
||||
url: http://prometheus:3011
|
||||
|
||||
- name: gdev-testdata
|
||||
isDefault: true
|
||||
type: testdata
|
||||
|
||||
- name: gdev-influxdb
|
||||
type: influxdb
|
||||
access: proxy
|
||||
database: site
|
||||
user: grafana
|
||||
url: http://influxdb:8086
|
||||
jsonData:
|
||||
timeInterval: "15s"
|
||||
secureJsonData:
|
||||
password: grafana
|
||||
|
||||
- name: gdev-influxdb-telegraf
|
||||
type: influxdb
|
||||
access: proxy
|
||||
database: telegraf
|
||||
user: grafana
|
||||
url: http://telegraf:8086
|
||||
jsonData:
|
||||
timeInterval: "10s"
|
||||
secureJsonData:
|
||||
password: grafana
|
||||
|
||||
- name: gdev-opentsdb
|
||||
type: opentsdb
|
||||
access: proxy
|
||||
url: http://opentsdb:4242
|
||||
jsonData:
|
||||
tsdbResolution: 1
|
||||
tsdbVersion: 1
|
||||
|
||||
- name: gdev-elasticsearch-v2-metrics
|
||||
type: elasticsearch
|
||||
access: proxy
|
||||
database: "[metrics-]YYYY.MM.DD"
|
||||
url: http://elasticsearch:9200
|
||||
jsonData:
|
||||
interval: Daily
|
||||
timeField: "@timestamp"
|
||||
esVersion: 2
|
||||
|
||||
- name: gdev-elasticsearch-v2-logs
|
||||
type: elasticsearch
|
||||
access: proxy
|
||||
database: "[logs-]YYYY.MM.DD"
|
||||
url: http://elasticsearch:9200
|
||||
jsonData:
|
||||
interval: Daily
|
||||
timeField: "@timestamp"
|
||||
esVersion: 2
|
||||
|
||||
- name: gdev-elasticsearch-v5-metrics
|
||||
type: elasticsearch
|
||||
access: proxy
|
||||
database: "[metrics-]YYYY.MM.DD"
|
||||
url: http://elasticsearch5:10200
|
||||
jsonData:
|
||||
interval: Daily
|
||||
timeField: "@timestamp"
|
||||
esVersion: 5
|
||||
|
||||
- name: gdev-elasticsearch-v5-logs
|
||||
type: elasticsearch
|
||||
access: proxy
|
||||
database: "[logs-]YYYY.MM.DD"
|
||||
url: http://elasticsearch5:9200
|
||||
jsonData:
|
||||
interval: Daily
|
||||
timeField: "@timestamp"
|
||||
esVersion: 5
|
||||
|
||||
- name: gdev-elasticsearch-v6-metrics
|
||||
type: elasticsearch
|
||||
access: proxy
|
||||
database: "[metrics-]YYYY.MM.DD"
|
||||
url: http://elasticsearch6:9200
|
||||
jsonData:
|
||||
interval: Daily
|
||||
timeField: "@timestamp"
|
||||
esVersion: 60
|
||||
|
||||
- name: gdev-elasticsearch-v6-logs
|
||||
type: elasticsearch
|
||||
access: proxy
|
||||
database: "[logs-]YYYY.MM.DD"
|
||||
url: http://elasticsearch6:9200
|
||||
jsonData:
|
||||
interval: Daily
|
||||
timeField: "@timestamp"
|
||||
esVersion: 60
|
||||
|
||||
- name: gdev-elasticsearch-v6-filebeat
|
||||
type: elasticsearch
|
||||
access: proxy
|
||||
database: "[filebeat-]YYYY.MM.DD"
|
||||
url: http://elasticsearch6:9200
|
||||
jsonData:
|
||||
interval: Daily
|
||||
timeField: "@timestamp"
|
||||
esVersion: 60
|
||||
|
||||
- name: gdev-elasticsearch-v7-metrics
|
||||
type: elasticsearch
|
||||
access: proxy
|
||||
database: "[metrics-]YYYY.MM.DD"
|
||||
url: http://elasticsearch7:9200
|
||||
jsonData:
|
||||
timeInterval: 10s
|
||||
interval: Daily
|
||||
timeField: "@timestamp"
|
||||
esVersion: 70
|
||||
|
||||
- name: gdev-elasticsearch-v7-logs
|
||||
type: elasticsearch
|
||||
access: proxy
|
||||
database: "[logs-]YYYY.MM.DD"
|
||||
url: http://elasticsearch7:9200
|
||||
jsonData:
|
||||
interval: Daily
|
||||
timeField: "@timestamp"
|
||||
esVersion: 70
|
||||
|
||||
- name: gdev-elasticsearch-v7-filebeat
|
||||
type: elasticsearch
|
||||
access: proxy
|
||||
database: "[filebeat-]YYYY.MM.DD"
|
||||
url: http://elasticsearch7:9200
|
||||
jsonData:
|
||||
interval: Daily
|
||||
timeField: "@timestamp"
|
||||
esVersion: 70
|
||||
timeInterval: "10s"
|
||||
logMessageField: message
|
||||
logLevelField: fields.level
|
||||
|
||||
- name: gdev-elasticsearch-v7-metricbeat
|
||||
type: elasticsearch
|
||||
access: proxy
|
||||
database: "[metricbeat-]YYYY.MM.DD"
|
||||
url: http://elasticsearch7:9200
|
||||
jsonData:
|
||||
interval: Daily
|
||||
timeField: "@timestamp"
|
||||
esVersion: 70
|
||||
timeInterval: "10s"
|
||||
|
||||
- name: gdev-mysql
|
||||
type: mysql
|
||||
url: mysql:3306
|
||||
database: grafana
|
||||
user: grafana
|
||||
secureJsonData:
|
||||
password: password
|
||||
|
||||
- name: gdev-mysql-ds-tests
|
||||
type: mysql
|
||||
url: mysqltests:3306
|
||||
database: grafana_ds_tests
|
||||
user: grafana
|
||||
secureJsonData:
|
||||
password: password
|
||||
|
||||
- name: gdev-mssql
|
||||
type: mssql
|
||||
url: mssql:1433
|
||||
database: grafana
|
||||
user: grafana
|
||||
secureJsonData:
|
||||
password: Password!
|
||||
|
||||
- name: gdev-mssql-ds-tests
|
||||
type: mssql
|
||||
url: mssqltests:1433
|
||||
database: grafanatest
|
||||
user: grafana
|
||||
secureJsonData:
|
||||
password: Password!
|
||||
|
||||
- name: gdev-postgres
|
||||
type: postgres
|
||||
url: postgres:5432
|
||||
database: grafana
|
||||
user: grafana
|
||||
secureJsonData:
|
||||
password: password
|
||||
jsonData:
|
||||
sslmode: "disable"
|
||||
|
||||
- name: gdev-postgres-ds-tests
|
||||
type: postgres
|
||||
url: postgrestest:5432
|
||||
database: grafanadstest
|
||||
user: grafanatest
|
||||
secureJsonData:
|
||||
password: grafanatest
|
||||
jsonData:
|
||||
sslmode: "disable"
|
||||
|
||||
- name: gdev-cloudwatch
|
||||
type: cloudwatch
|
||||
editable: true
|
||||
jsonData:
|
||||
authType: credentials
|
||||
defaultRegion: eu-west-2
|
||||
|
||||
# Keep to test old /api/prom API
|
||||
- name: gdev-loki-0.3
|
||||
type: loki
|
||||
access: proxy
|
||||
url: http://loki0.3:3100
|
||||
editable: false
|
||||
|
||||
# First version with new v1 API (remove once v1 is out)
|
||||
- name: gdev-loki-0.4
|
||||
type: loki
|
||||
access: proxy
|
||||
url: http://loki0.4:3100
|
||||
editable: false
|
||||
|
||||
- name: gdev-loki
|
||||
type: loki
|
||||
access: proxy
|
||||
url: http://loki:3100
|
||||
editable: false
|
||||
-195
@@ -1,195 +0,0 @@
|
||||
{
|
||||
"annotations": {
|
||||
"list": [
|
||||
{
|
||||
"builtIn": 1,
|
||||
"datasource": "-- Grafana --",
|
||||
"enable": true,
|
||||
"hide": true,
|
||||
"iconColor": "rgba(0, 211, 255, 1)",
|
||||
"name": "Annotations & Alerts",
|
||||
"type": "dashboard"
|
||||
}
|
||||
]
|
||||
},
|
||||
"editable": true,
|
||||
"gnetId": null,
|
||||
"graphTooltip": 0,
|
||||
"iteration": 1584435937931,
|
||||
"links": [],
|
||||
"panels": [
|
||||
{
|
||||
"aliasColors": {},
|
||||
"bars": false,
|
||||
"dashLength": 10,
|
||||
"dashes": false,
|
||||
"datasource": null,
|
||||
"fill": 1,
|
||||
"fillGradient": 0,
|
||||
"gridPos": {
|
||||
"h": 14,
|
||||
"w": 19,
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"hiddenSeries": false,
|
||||
"id": 2,
|
||||
"legend": {
|
||||
"alignAsTable": true,
|
||||
"avg": false,
|
||||
"current": false,
|
||||
"max": false,
|
||||
"min": true,
|
||||
"rightSide": true,
|
||||
"show": true,
|
||||
"total": false,
|
||||
"values": true
|
||||
},
|
||||
"lines": true,
|
||||
"linewidth": 1,
|
||||
"nullPointMode": "null",
|
||||
"options": {
|
||||
"dataLinks": []
|
||||
},
|
||||
"percentage": false,
|
||||
"pointradius": 2,
|
||||
"points": false,
|
||||
"renderer": "flot",
|
||||
"seriesOverrides": [],
|
||||
"spaceLength": 10,
|
||||
"stack": false,
|
||||
"steppedLine": false,
|
||||
"targets": [
|
||||
{
|
||||
"alias": "updatesOnTime: $updatesOnTime",
|
||||
"refId": "A",
|
||||
"scenarioId": "random_walk"
|
||||
},
|
||||
{
|
||||
"alias": "dependsOnFirst: $dependsOnFirst",
|
||||
"refId": "B",
|
||||
"scenarioId": "random_walk"
|
||||
}
|
||||
],
|
||||
"thresholds": [],
|
||||
"timeFrom": null,
|
||||
"timeRegions": [],
|
||||
"timeShift": null,
|
||||
"title": "Panel Title",
|
||||
"tooltip": {
|
||||
"shared": true,
|
||||
"sort": 0,
|
||||
"value_type": "individual"
|
||||
},
|
||||
"type": "graph",
|
||||
"xaxis": {
|
||||
"buckets": null,
|
||||
"mode": "time",
|
||||
"name": null,
|
||||
"show": true,
|
||||
"values": []
|
||||
},
|
||||
"yaxes": [
|
||||
{
|
||||
"format": "short",
|
||||
"label": null,
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": null,
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"format": "short",
|
||||
"label": null,
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": null,
|
||||
"show": true
|
||||
}
|
||||
],
|
||||
"yaxis": {
|
||||
"align": false,
|
||||
"alignLevel": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"schemaVersion": 22,
|
||||
"style": "dark",
|
||||
"tags": ["gdev", "templating"],
|
||||
"templating": {
|
||||
"list": [
|
||||
{
|
||||
"allValue": null,
|
||||
"current": {
|
||||
"text": "value.1584434137814",
|
||||
"value": "value.1584434137814"
|
||||
},
|
||||
"datasource": "gdev-testdata",
|
||||
"definition": "value.$__from",
|
||||
"hide": 0,
|
||||
"includeAll": false,
|
||||
"index": -1,
|
||||
"label": null,
|
||||
"multi": false,
|
||||
"name": "updatesOnTime",
|
||||
"options": [],
|
||||
"query": "value.$__from",
|
||||
"refresh": 2,
|
||||
"regex": "",
|
||||
"skipUrlSync": false,
|
||||
"sort": 0,
|
||||
"tagValuesQuery": "",
|
||||
"tags": [],
|
||||
"tagsQuery": "",
|
||||
"type": "query",
|
||||
"useTags": false
|
||||
},
|
||||
{
|
||||
"allValue": null,
|
||||
"current": {
|
||||
"text": "value.value.1584434072074",
|
||||
"value": "value.value.1584434072074"
|
||||
},
|
||||
"datasource": "gdev-testdata",
|
||||
"definition": "value.$updatesOnTime",
|
||||
"hide": 0,
|
||||
"includeAll": false,
|
||||
"index": -1,
|
||||
"label": null,
|
||||
"multi": false,
|
||||
"name": "dependsOnFirst",
|
||||
"options": [
|
||||
{
|
||||
"selected": true,
|
||||
"text": "value.value.1584434072074",
|
||||
"value": "value.value.1584434072074"
|
||||
}
|
||||
],
|
||||
"query": "value.$updatesOnTime",
|
||||
"refresh": 0,
|
||||
"regex": "",
|
||||
"skipUrlSync": false,
|
||||
"sort": 0,
|
||||
"tagValuesQuery": "",
|
||||
"tags": [],
|
||||
"tagsQuery": "",
|
||||
"type": "query",
|
||||
"useTags": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"time": {
|
||||
"from": "now-30m",
|
||||
"to": "now"
|
||||
},
|
||||
"timepicker": {
|
||||
"refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"]
|
||||
},
|
||||
"timezone": "",
|
||||
"title": "Templating - Variables That Refresh On Time Change",
|
||||
"uid": "HeUnbEuZk",
|
||||
"variables": {
|
||||
"list": []
|
||||
},
|
||||
"version": 13
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
grafana_version=6.6.2
|
||||
@@ -1,8 +0,0 @@
|
||||
grafana:
|
||||
image: grafana/grafana:${grafana_version}
|
||||
ports:
|
||||
- "3001:3000"
|
||||
volumes:
|
||||
- "./dashboards.yaml:/etc/grafana/provisioning/dashboards/dashboards.yaml"
|
||||
- "./dev-dashboards:/usr/share/grafana/devenv/dev-dashboards"
|
||||
- "./datasources_docker.yaml:/etc/grafana/provisioning/datasources/datasources.yaml"
|
||||
@@ -1,15 +1,18 @@
|
||||
prometheus:
|
||||
build: docker/blocks/prometheus
|
||||
network_mode: host
|
||||
ports:
|
||||
- "9090:9090"
|
||||
|
||||
node_exporter:
|
||||
image: prom/node-exporter
|
||||
network_mode: host
|
||||
ports:
|
||||
- "9100:9100"
|
||||
|
||||
fake-prometheus-data:
|
||||
image: grafana/fake-data-gen
|
||||
network_mode: host
|
||||
ports:
|
||||
- "9091:9091"
|
||||
environment:
|
||||
@@ -17,10 +20,12 @@
|
||||
|
||||
alertmanager:
|
||||
image: quay.io/prometheus/alertmanager
|
||||
network_mode: host
|
||||
ports:
|
||||
- "9093:9093"
|
||||
|
||||
prometheus-random-data:
|
||||
build: docker/blocks/prometheus_random_data
|
||||
network_mode: host
|
||||
ports:
|
||||
- "8081:8080"
|
||||
|
||||
@@ -15,7 +15,7 @@ alerting:
|
||||
- scheme: http
|
||||
static_configs:
|
||||
- targets:
|
||||
- "alertmanager:9093"
|
||||
- "127.0.0.1:9093"
|
||||
|
||||
scrape_configs:
|
||||
- job_name: 'prometheus'
|
||||
@@ -24,16 +24,16 @@ scrape_configs:
|
||||
|
||||
- job_name: 'node_exporter'
|
||||
static_configs:
|
||||
- targets: ['node_exporter:9100']
|
||||
- targets: ['127.0.0.1:9100']
|
||||
|
||||
- job_name: 'fake-data-gen'
|
||||
static_configs:
|
||||
- targets: ['fake-prometheus-data:9091']
|
||||
- targets: ['127.0.0.1:9091']
|
||||
|
||||
- job_name: 'grafana'
|
||||
static_configs:
|
||||
- targets: ['grafana:3000']
|
||||
- targets: ['127.0.0.1:3000']
|
||||
|
||||
- job_name: 'prometheus-random-data'
|
||||
static_configs:
|
||||
- targets: ['prometheus-random-data:8080']
|
||||
- targets: ['127.0.0.1:8081']
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
prometheus:
|
||||
build: docker/blocks/prometheus2
|
||||
network_mode: host
|
||||
ports:
|
||||
- "9090:9090"
|
||||
|
||||
node_exporter:
|
||||
image: prom/node-exporter
|
||||
network_mode: host
|
||||
ports:
|
||||
- "9100:9100"
|
||||
|
||||
fake-prometheus-data:
|
||||
image: grafana/fake-data-gen
|
||||
network_mode: host
|
||||
ports:
|
||||
- "9091:9091"
|
||||
environment:
|
||||
@@ -17,10 +20,12 @@
|
||||
|
||||
alertmanager:
|
||||
image: quay.io/prometheus/alertmanager
|
||||
network_mode: host
|
||||
ports:
|
||||
- "9093:9093"
|
||||
|
||||
prometheus-random-data:
|
||||
build: docker/blocks/prometheus_random_data
|
||||
network_mode: host
|
||||
ports:
|
||||
- "8081:8080"
|
||||
|
||||
@@ -24,16 +24,16 @@ scrape_configs:
|
||||
|
||||
- job_name: 'node_exporter'
|
||||
static_configs:
|
||||
- targets: ['node_exporter:9100']
|
||||
- targets: ['127.0.0.1:9100']
|
||||
|
||||
- job_name: 'fake-data-gen'
|
||||
static_configs:
|
||||
- targets: ['fake-prometheus-data:9091']
|
||||
- targets: ['127.0.0.1:9091']
|
||||
|
||||
- job_name: 'grafana'
|
||||
static_configs:
|
||||
- targets: ['grafana:3000']
|
||||
- targets: ['127.0.0.1:3000']
|
||||
|
||||
- job_name: 'prometheus-random-data'
|
||||
static_configs:
|
||||
- targets: ['prometheus-random-data:8080']
|
||||
- targets: ['127.0.0.1:8081']
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
FROM prom/prometheus:v1.8.2
|
||||
ADD prometheus.yml /etc/prometheus/
|
||||
ADD alert.rules /etc/prometheus/
|
||||
@@ -0,0 +1,10 @@
|
||||
# Alert Rules
|
||||
|
||||
ALERT AppCrash
|
||||
IF process_open_fds > 0
|
||||
FOR 15s
|
||||
LABELS { severity="critical" }
|
||||
ANNOTATIONS {
|
||||
summary = "Number of open fds > 0",
|
||||
description = "Just testing"
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
prometheus:
|
||||
build: docker/blocks/prometheus_mac
|
||||
ports:
|
||||
- "9090:9090"
|
||||
|
||||
node_exporter:
|
||||
image: prom/node-exporter
|
||||
ports:
|
||||
- "9100:9100"
|
||||
|
||||
fake-prometheus-data:
|
||||
image: grafana/fake-data-gen
|
||||
ports:
|
||||
- "9091:9091"
|
||||
environment:
|
||||
FD_DATASOURCE: prom
|
||||
|
||||
alertmanager:
|
||||
image: quay.io/prometheus/alertmanager
|
||||
ports:
|
||||
- "9093:9093"
|
||||
|
||||
prometheus-random-data:
|
||||
build: docker/blocks/prometheus_random_data
|
||||
ports:
|
||||
- "8081:8080"
|
||||
@@ -0,0 +1,39 @@
|
||||
# my global config
|
||||
global:
|
||||
scrape_interval: 10s # By default, scrape targets every 15 seconds.
|
||||
evaluation_interval: 10s # By default, scrape targets every 15 seconds.
|
||||
# scrape_timeout is set to the global default (10s).
|
||||
|
||||
# Load and evaluate rules in this file every 'evaluation_interval' seconds.
|
||||
rule_files:
|
||||
- "alert.rules"
|
||||
# - "first.rules"
|
||||
# - "second.rules"
|
||||
|
||||
alerting:
|
||||
alertmanagers:
|
||||
- scheme: http
|
||||
static_configs:
|
||||
- targets:
|
||||
- "alertmanager:9093"
|
||||
|
||||
scrape_configs:
|
||||
- job_name: 'prometheus'
|
||||
static_configs:
|
||||
- targets: ['localhost:9090']
|
||||
|
||||
- job_name: 'node_exporter'
|
||||
static_configs:
|
||||
- targets: ['node_exporter:9100']
|
||||
|
||||
- job_name: 'fake-data-gen'
|
||||
static_configs:
|
||||
- targets: ['fake-prometheus-data:9091']
|
||||
|
||||
- job_name: 'grafana'
|
||||
static_configs:
|
||||
- targets: ['host.docker.internal:3000']
|
||||
|
||||
- job_name: 'prometheus-random-data'
|
||||
static_configs:
|
||||
- targets: ['prometheus-random-data:8080']
|
||||
@@ -1,7 +1,7 @@
|
||||
# This Dockerfile builds an image for a client_golang example.
|
||||
|
||||
# Builder image, where we build the example.
|
||||
FROM golang:1.14.1 AS builder
|
||||
FROM golang:1.13.4 AS builder
|
||||
# Download prometheus/client_golang/examples/random first
|
||||
RUN go get github.com/prometheus/client_golang/examples/random
|
||||
WORKDIR /go/src/github.com/prometheus/client_golang
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
# There is no data generator for this so easiest way to get some data here is run this example app
|
||||
# https://github.com/openzipkin/zipkin-js-example/tree/master/web
|
||||
zipkin:
|
||||
image: openzipkin/zipkin:latest
|
||||
ports:
|
||||
- "9411:9411"
|
||||
+3
-10
@@ -18,21 +18,14 @@ bulkAlertingDashboard() {
|
||||
|
||||
requiresJsonnet
|
||||
|
||||
jsonnet -o "bulk_alerting_dashboards/bulk_alerting_datasources.yaml" ./bulk_alerting_dashboards/datasources.jsonnet
|
||||
|
||||
COUNTER=1
|
||||
DS=1
|
||||
MAX=1000
|
||||
COUNTER=0
|
||||
MAX=100
|
||||
while [ $COUNTER -lt $MAX ]; do
|
||||
jsonnet -o "bulk_alerting_dashboards/alerting_dashboard${COUNTER}.json" \
|
||||
-e "local bulkDash = import 'bulk_alerting_dashboards/dashboard.libsonnet'; bulkDash.alertingDashboard(${COUNTER}, ${DS})"
|
||||
jsonnet -o "bulk_alerting_dashboards/alerting_dashboard${COUNTER}.json" -e "local bulkDash = import 'bulk_alerting_dashboards/bulkdash_alerting.jsonnet'; bulkDash + { uid: 'bd-${COUNTER}', title: 'alerting-title-${COUNTER}' }"
|
||||
let COUNTER=COUNTER+1
|
||||
let DS=COUNTER/10
|
||||
let DS=DS+1
|
||||
done
|
||||
|
||||
ln -s -f ../../../devenv/bulk_alerting_dashboards/bulk_alerting_dashboards.yaml ../conf/provisioning/dashboards/custom.yaml
|
||||
ln -s -f ../../../devenv/bulk_alerting_dashboards/bulk_alerting_datasources.yaml ../conf/provisioning/datasources/custom.yaml
|
||||
}
|
||||
|
||||
requiresJsonnet() {
|
||||
|
||||
+8
-5
@@ -1,9 +1,12 @@
|
||||
.PHONY: docs docs-test
|
||||
|
||||
IMAGE = grafana/docs-base:latest
|
||||
.PHONY: docs docs-no-pull docs-test
|
||||
|
||||
docs:
|
||||
docker run -v $(shell pwd)/sources:/hugo/content/docs/grafana/latest -p 3002:3002 --rm -it $(IMAGE) /bin/bash -c 'make server'
|
||||
docker pull grafana/docs-base:latest
|
||||
docker run -v $(PWD)/sources:/hugo/content/docs/grafana/latest -p 3002:3002 --rm -it grafana/docs-base:latest /bin/bash -c 'npm i && make webpack && make docs-menu && hugo server -p 3002 -D --ignoreCache --baseUrl http://localhost:3002 --bind 0.0.0.0'
|
||||
|
||||
docs-no-pull:
|
||||
docker run -v $(PWD)/sources:/hugo/content/docs/grafana/latest -p 3002:3002 --rm -it grafana/docs-base:latest /bin/bash -c 'make docs-menu && hugo server -p 3002 -D --ignoreCache --baseUrl http://localhost:3002 --bind 0.0.0.0'
|
||||
|
||||
docs-test:
|
||||
docker run -v $(shell pwd)/sources:/hugo/content/docs/grafana/latest --rm -it $(IMAGE) /bin/bash -c 'make prod'
|
||||
docker pull grafana/docs-base:latest
|
||||
docker run -v $(PWD)/sources:/hugo/content/docs/grafana/latest --rm -it grafana/docs-base:latest /bin/bash -c 'npm i && make prod'
|
||||
|
||||
@@ -8,8 +8,7 @@ aliases = ["/docs/grafana/v1.1", "/docs/grafana/latest/guides/reference/admin",
|
||||
|
||||
# Grafana documentation
|
||||
|
||||
## Installing Grafana
|
||||
|
||||
<h2>Installing Grafana</h2>
|
||||
<div class="nav-cards">
|
||||
<a href="{{< relref "installation/debian.md" >}}" class="nav-cards__item nav-cards__item--install">
|
||||
<div class="nav-cards__icon fa fa-linux">
|
||||
@@ -27,8 +26,8 @@ aliases = ["/docs/grafana/v1.1", "/docs/grafana/latest/guides/reference/admin",
|
||||
<h5>Install on Windows</h5>
|
||||
</a>
|
||||
<a href="{{< relref "installation/docker.md" >}}" class="nav-cards__item nav-cards__item--install">
|
||||
<img src="/static/img/logos/logo-docker.svg">
|
||||
<h5>Run Docker image</h5>
|
||||
<h4>Run Docker image</h4>
|
||||
<p>Run Grafana on a Docker image.</p>
|
||||
</a>
|
||||
<a href="https://grafana.com/cloud/grafana" class="nav-cards__item nav-cards__item--install">
|
||||
<div class="nav-cards__icon fa fa-cloud">
|
||||
@@ -42,7 +41,7 @@ aliases = ["/docs/grafana/v1.1", "/docs/grafana/latest/guides/reference/admin",
|
||||
</a>
|
||||
</div>
|
||||
|
||||
## Guides
|
||||
<h2>Guides</h2>
|
||||
|
||||
<div class="nav-cards">
|
||||
<a href="{{< relref "guides/what-is-grafana.md" >}}" class="nav-cards__item nav-cards__item--guide">
|
||||
@@ -72,8 +71,7 @@ aliases = ["/docs/grafana/v1.1", "/docs/grafana/latest/guides/reference/admin",
|
||||
|
||||
</div>
|
||||
|
||||
## Data source guides
|
||||
|
||||
<h2>Data source guides</h2>
|
||||
<div class="nav-cards">
|
||||
<a href="{{< relref "features/datasources/graphite.md" >}}" class="nav-cards__item nav-cards__item--ds">
|
||||
<img src="/img/docs/logos/icon_graphite.svg" >
|
||||
|
||||
@@ -112,7 +112,7 @@ grafana-cli --debug plugins install <plugin-id>
|
||||
|
||||
`--configOverrides` is a command line argument that acts like an environmental variable override.
|
||||
|
||||
For example, you can use it to redirect logging to another file (maybe to log plugin installations in a service like Hosted Grafana) or when resetting the admin password and you have non-default values for some important config value (like where the database is located).
|
||||
For example, you can use it to redirect logging to another file (maybe to log plugin installs in a service like Hosted Grafana) or when resetting the admin password and you have non-default values for some important config value (like where the database is located).
|
||||
|
||||
**Example:**
|
||||
```bash
|
||||
|
||||
@@ -108,7 +108,7 @@ The following example describes how to build and run the remote HTTP rendering s
|
||||
|
||||
## PhantomJS
|
||||
|
||||
> Starting from Grafana v7.0.0, all PhantomJS support has been removed. Please use the Grafana Image Renderer plugin or remote rendering service.
|
||||
> PhantomJS is deprecated since Grafana v6.4 and will be removed in a future release. Please migrate to the Grafana Image Renderer plugin or remote rendering service.
|
||||
|
||||
## Troubleshoot image rendering
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
+++
|
||||
title = "Internal Grafana metrics"
|
||||
title = "Internal metrics"
|
||||
description = "Internal metrics exposed by Grafana"
|
||||
keywords = ["grafana", "metrics", "internal metrics"]
|
||||
type = "docs"
|
||||
@@ -8,87 +8,8 @@ parent = "admin"
|
||||
weight = 8
|
||||
+++
|
||||
|
||||
# Internal Grafana metrics
|
||||
# Internal metrics
|
||||
|
||||
Grafana collects some metrics about itself internally. Grafana supports pushing metrics to Graphite or exposing them to be scraped by Prometheus.
|
||||
Grafana collects some metrics about itself internally. Currently, Grafana supports pushing metrics to Graphite or exposing them to be scraped by Prometheus.
|
||||
|
||||
For more information about configuration options related to Grafana metrics, refer to [metrics]({{< relref "../installation/configuration/#metrics" >}}) and [metrics.graphite]({{< relref "../installation/configuration/#metrics-graphite" >}}) in [Configuration]({{< relref "../installation/configuration.md" >}}).
|
||||
|
||||
## Available metrics
|
||||
|
||||
When enabled, Grafana exposes a number of metrics, including:
|
||||
|
||||
* Active Grafana instances
|
||||
* Number of dashboards, users, and playlists
|
||||
* HTTP status codes
|
||||
* Requests by routing group
|
||||
* Grafana active alerts
|
||||
* Grafana performance
|
||||
|
||||
## Pull metrics from Grafana into Prometheus
|
||||
|
||||
These instructions assume you have already added Prometheus as a data source in Grafana.
|
||||
|
||||
1. Enable Prometheus to scrape metrics from Grafana. In your configuration file (`grafana.ini` or `custom.ini` depending on your operating system) remove the semicolon to enable the following configuration options:
|
||||
|
||||
```
|
||||
# Metrics available at HTTP API Url /metrics
|
||||
[metrics]
|
||||
# Disable / Enable internal metrics
|
||||
enabled = true
|
||||
|
||||
# Disable total stats (stat_totals_*) metrics to be generated
|
||||
disable_total_stats = false
|
||||
```
|
||||
|
||||
1. (optional) If you want to require authorization to view the metrics endpoint, then uncomment and set the following options:
|
||||
|
||||
```
|
||||
basic_auth_username =
|
||||
basic_auth_password =
|
||||
```
|
||||
|
||||
1. Restart Grafana. Grafana now exposes metrics at http://localhost:3000/metrics.
|
||||
1. Add the job to your prometheus.yml file.
|
||||
Example:
|
||||
|
||||
```
|
||||
- job_name: 'grafana_metrics'
|
||||
|
||||
scrape_interval: 15s
|
||||
scrape_timeout: 5s
|
||||
|
||||
static_configs:
|
||||
- targets: ['localhost:3000']
|
||||
```
|
||||
1. Restart Prometheus. Your new job should appear on the Targets tab.
|
||||
1. In Grafana, hover your mouse over the **Configuration** (gear) icon on the left sidebar and then click **Data Sources**.
|
||||
1. Select the **Prometheus** data source.
|
||||
1. On the Dashboards tab, **Import** the Grafana metrics dashboard. All scraped Grafana metrics are available in the dashboard.
|
||||
|
||||
## View Grafana metrics in Graphite
|
||||
|
||||
These instructions assume you have already added Graphite as a data source in Grafana.
|
||||
|
||||
1. Enable sending metrics to Graphite. In your configuration file (`grafana.ini` or `custom.ini` depending on your operating system) remove the semicolon to enable the following configuration options:
|
||||
|
||||
```
|
||||
# Metrics available at HTTP API Url /metrics
|
||||
[metrics]
|
||||
# Disable / Enable internal metrics
|
||||
enabled = true
|
||||
|
||||
# Disable total stats (stat_totals_*) metrics to be generated
|
||||
disable_total_stats = false
|
||||
```
|
||||
|
||||
1. Enable [metrics.graphite] options:
|
||||
```
|
||||
# Send internal metrics to Graphite
|
||||
[metrics.graphite]
|
||||
# Enable by setting the address setting (ex localhost:2003)
|
||||
address = <hostname or ip>:<port#>
|
||||
prefix = prod.grafana.%(instance_name)s.
|
||||
```
|
||||
|
||||
1. Restart Grafana. Grafana now exposes metrics at http://localhost:3000/metrics and sends them to the Graphite location you specified.
|
||||
To emit internal metrics you have to enable the option under the [metrics] section in your [grafana.ini](http://docs.grafana.org/installation/configuration/#enabled-6) config file. If you want to push metrics to Graphite, you must also configure the [metrics.graphite](http://docs.grafana.org/installation/configuration/#metrics-graphite) section.
|
||||
|
||||
@@ -93,8 +93,6 @@ datasources:
|
||||
access: proxy
|
||||
# <int> org id. will default to orgId 1 if not specified
|
||||
orgId: 1
|
||||
# <string> custom UID which can be used to reference this datasource in other parts of the configuration, if not specified will be generated automatically
|
||||
uid: my_unique_uid
|
||||
# <string> url
|
||||
url: http://localhost:8080
|
||||
# <string> Deprecated, use secureJsonData.password
|
||||
@@ -162,9 +160,6 @@ Since not all datasources have the same configuration settings we only have the
|
||||
| tsdbVersion | string | OpenTSDB | Version |
|
||||
| tsdbResolution | string | OpenTSDB | Resolution |
|
||||
| sslmode | string | PostgreSQL | SSLmode. 'disable', 'require', 'verify-ca' or 'verify-full' |
|
||||
| sslRootCertFile | string | PostgreSQL | SSL server root certificate file, must be readable by the Grafana user |
|
||||
| sslCertFile | string | PostgreSQL | SSL client certificate file, must be readable by the Grafana user |
|
||||
| sslKeyFile | string | PostgreSQL | SSL client key file, must be readable by *only* the Grafana user |
|
||||
| encrypt | string | MSSQL | Connection SSL encryption handling. 'disable', 'false' or 'true' |
|
||||
| postgresVersion | number | PostgreSQL | Postgres version as a number (903/904/905/906/1000) meaning v9.3, v9.4, ..., v10 |
|
||||
| timescaledb | boolean | PostgreSQL | Enable usage of TimescaleDB extension |
|
||||
@@ -208,7 +203,7 @@ datasources:
|
||||
|
||||
### Dashboards
|
||||
|
||||
It's possible to manage dashboards in Grafana by adding one or more yaml config files in the [`provisioning/dashboards`]({{< relref "../installation/configuration.md" >}}) directory. Each config file can contain a list of `dashboards providers` that will load dashboards into Grafana from the local filesystem.
|
||||
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.
|
||||
|
||||
The dashboard provider config file looks somewhat like this:
|
||||
|
||||
@@ -245,9 +240,9 @@ When Grafana starts, it will update/insert all dashboards available in the confi
|
||||
It's possible to make changes to a provisioned dashboard in the Grafana UI. However, it is not possible to automatically save the changes back to the provisioning source.
|
||||
If `allowUiUpdates` is set to `true` and you make changes to a provisioned dashboard, you can `Save` the dashboard then changes will be persisted to the Grafana database.
|
||||
|
||||
> **Note:**
|
||||
> **Note.**
|
||||
> If a provisioned dashboard is saved from the UI and then later updated from the source, the dashboard stored in the database will always be overwritten. The `version` property in the JSON file will not affect this, even if it is lower than the existing dashboard.
|
||||
>
|
||||
>
|
||||
> If a provisioned dashboard is saved from the UI and the source is removed, the dashboard stored in the database will be deleted unless the configuration option `disableDeletion` is set to true.
|
||||
|
||||
If `allowUiUpdates` is configured to `false`, you are not able to make changes to a provisioned dashboard. When you click `Save`, Grafana brings up a *Cannot save provisioned dashboard* dialog. The screenshot below illustrates this behavior.
|
||||
@@ -255,7 +250,7 @@ If `allowUiUpdates` is configured to `false`, you are not able to make changes t
|
||||
Grafana offers options to export the JSON definition of a dashboard. Either `Copy JSON to Clipboard` or `Save JSON to file` can help you synchronize your dashboard changes back to the provisioning source.
|
||||
|
||||
Note: The JSON definition in the input field when using `Copy JSON to Clipboard` or `Save JSON to file` will have the `id` field automatically removed to aid the provisioning workflow.
|
||||
|
||||
|
||||
{{< docs-imagebox img="/img/docs/v51/provisioning_cannot_save_dashboard.png" max-width="500px" class="docs-image--no-shadow" >}}
|
||||
|
||||
### Reusable Dashboard URLs
|
||||
@@ -403,8 +398,6 @@ The following sections detail the supported settings for each alert notification
|
||||
| Name |
|
||||
| ---- |
|
||||
| url |
|
||||
| basicAuthUser |
|
||||
| basicAuthPassword |
|
||||
|
||||
#### Alert notification `teams`
|
||||
|
||||
@@ -422,7 +415,6 @@ The following sections detail the supported settings for each alert notification
|
||||
|
||||
| Name |
|
||||
| ---- |
|
||||
| singleEmail |
|
||||
| addresses |
|
||||
|
||||
#### Alert notification `hipchat`
|
||||
@@ -471,3 +463,4 @@ The following sections detail the supported settings for each alert notification
|
||||
| Name |
|
||||
| ---- |
|
||||
| url |
|
||||
|
||||
|
||||
@@ -71,19 +71,14 @@ external image destination if available or fallback to attaching the image to th
|
||||
Be aware that if you use the `local` image storage email servers and clients might not be
|
||||
able to access the image.
|
||||
|
||||
Setting | Description
|
||||
---------- | -----------
|
||||
Single email | Send a single email to all recipients. Disabled per default.
|
||||
Addresses | Email addresses to recipients. You can enter multiple email addresses using a ";" separator.
|
||||
|
||||
### Slack
|
||||
|
||||
{{< imgbox max-width="40%" img="/img/docs/v4/slack_notification.png" caption="Alerting Slack Notification" >}}
|
||||
|
||||
To set up Slack, you need to configure an incoming Slack webhook URL. You can follow
|
||||
[Sending messages using Incoming Webhooks](https://api.slack.com/incoming-webhooks) on how to do that. If you want to include screenshots of the
|
||||
firing alerts 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
|
||||
To set up Slack, you need to configure an incoming Slack webhook URL. You can follow
|
||||
[their guide](https://api.slack.com/incoming-webhooks) on how to do that. If you want to include screenshots of the
|
||||
firing alerts 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
|
||||
@@ -110,7 +105,7 @@ Integration Key | Integration key for PagerDuty.
|
||||
Severity | Level for dynamic notifications, default is `critical`
|
||||
Auto resolve incidents | Resolve incidents in PagerDuty once the alert goes back to ok
|
||||
|
||||
**Note:** The tags `Severity`, `Class`, `Group`, and `Component` have special meaning in the [Pagerduty Common Event Format - PD-CEF](https://support.pagerduty.com/docs/pd-cef). If an alert panel defines these tag keys, then they are transposed to the root of the event sent to Pagerduty. This means they will be available within the Pagerduty UI and Filtering tools. A Severity tag set on an alert overrides the global Severity set on the notification channel if it's a valid level.
|
||||
**Note:** The tags `Class`, `Group`, and `Component` have special meaning in the [Pagerduty Common Event Format - PD-CEF](https://support.pagerduty.com/docs/pd-cef). If an alert panel defines these tag keys they will be transposed to the root of the event sent to Pagerduty. This means they will be available within the Pagerduty UI and Filtering tools.
|
||||
|
||||
### Webhook
|
||||
|
||||
@@ -203,14 +198,15 @@ Prometheus Alertmanager | `prometheus-alertmanager` | yes, external only | yes
|
||||
Pushover | `pushover` | yes | no
|
||||
Sensu | `sensu` | yes, external only | no
|
||||
Slack | `slack` | yes | no
|
||||
Squadcast | `webhook` | no | no
|
||||
Telegram | `telegram` | yes | no
|
||||
Threema | `threema` | yes, external only | no
|
||||
VictorOps | `victorops` | yes, external only | no
|
||||
Webhook | `webhook` | yes, external only | yes
|
||||
|
||||
## Enable images in notifications {#external-image-store}
|
||||
# Enable images in notifications {#external-image-store}
|
||||
|
||||
Grafana can render the panel associated with the alert rule as a PNG image and include that in the notification. Read more about the requirements and how to configure
|
||||
Grafana can render the panel associated with the alert rule as a PNG image and include that in the notification. Read more about the requirements and how to configure
|
||||
[image rendering]({{< relref "../administration/image_rendering/" >}}).
|
||||
|
||||
Most Notification Channels require that this image be publicly accessible (Slack and PagerDuty for example). In order to include images in alert notifications, Grafana can upload the image to an image store. It currently supports
|
||||
@@ -220,7 +216,7 @@ Be aware that some notifiers requires public access to the image to be able to i
|
||||
|
||||
Notification services which need public image access are marked as 'external only'.
|
||||
|
||||
## Use alert rule tags in notifications {#alert-rule-tags}
|
||||
# Use alert rule tags in notifications {#alert-rule-tags}
|
||||
|
||||
> Only available in Grafana v6.3+.
|
||||
|
||||
@@ -230,7 +226,7 @@ It currently supports only the Prometheus Alertmanager notifier.
|
||||
|
||||
This is an optional feature. You can get notifications without using alert rule tags.
|
||||
|
||||
## Configure the link back to Grafana from alert notifications
|
||||
# Configure the link back to Grafana from alert notifications
|
||||
|
||||
All alert notifications contain a link back to the triggered alert in the Grafana instance.
|
||||
This URL is based on the [domain]({{< relref "../installation/configuration/#domain" >}}) setting in Grafana.
|
||||
|
||||
@@ -122,12 +122,6 @@ only give access to members of the group `example` which has Id `8bab1c86-8fba-3
|
||||
allowed_groups = 8bab1c86-8fba-33e5-2089-1d1c80ec267d
|
||||
```
|
||||
|
||||
You'll need to ensure that you've [enabled group attributes](https://docs.microsoft.com/en-us/azure/active-directory/hybrid/how-to-connect-fed-group-claims#configure-the-azure-ad-application-registration-for-group-attributes) in your Azure AD Application Registration manifest file (Azure Portal -> Azure Active Directory -> Application Registrations -> Select Application -> Manifest)
|
||||
|
||||
```json
|
||||
"groupMembershipClaims": "ApplicationGroup"
|
||||
```
|
||||
|
||||
The `allowed_domains` option limits access to the users belonging to the specific domains. Domains should be separated by space or comma.
|
||||
|
||||
```ini
|
||||
|
||||
@@ -54,6 +54,24 @@ Check for the presence of a role using the [JMESPath](http://jmespath.org/exampl
|
||||
|
||||
See [JMESPath examples](#jmespath-examples) for more information.
|
||||
|
||||
## Set up OAuth2 with Okta
|
||||
|
||||
First set up Grafana as an OpenId client "webapplication" in Okta. Then set the Base URIs to `https://<grafana domain>/` and set the Login redirect URIs to `https://<grafana domain>/login/generic_oauth`.
|
||||
|
||||
Finally set up the generic oauth module like this:
|
||||
|
||||
```bash
|
||||
[auth.generic_oauth]
|
||||
name = Okta
|
||||
enabled = true
|
||||
scopes = openid profile email
|
||||
client_id = <okta application Client ID>
|
||||
client_secret = <okta application Client Secret>
|
||||
auth_url = https://<okta domain>/oauth2/v1/authorize
|
||||
token_url = https://<okta domain>/oauth2/v1/token
|
||||
api_url = https://<okta domain>/oauth2/v1/userinfo
|
||||
```
|
||||
|
||||
## Set up OAuth2 with Bitbucket
|
||||
|
||||
```bash
|
||||
@@ -132,6 +150,46 @@ allowed_organizations =
|
||||
api_url = https://<domain>/userinfo
|
||||
```
|
||||
|
||||
## Set up OAuth2 with Azure Active Directory
|
||||
|
||||
1. Log in to portal.azure.com and click "Azure Active Directory" in the side menu, then click the "Properties" sub-menu item.
|
||||
|
||||
2. Copy the "Directory ID", this is needed for setting URLs later
|
||||
|
||||
3. Click "App Registrations" and add a new application registration:
|
||||
- Name: Grafana
|
||||
- Application type: Web app / API
|
||||
- Sign-on URL: `https://<grafana domain>/login/generic_oauth`
|
||||
|
||||
4. Click the name of the new application to open the application details page.
|
||||
|
||||
5. Note down the "Application ID", this will be the OAuth client id.
|
||||
|
||||
6. Click "Certificates & secrets" and add a new entry under Client secrets
|
||||
- Description: Grafana OAuth
|
||||
- Expires: Never
|
||||
|
||||
7. Click Add then copy the key value, this will be the OAuth client secret.
|
||||
|
||||
8. Configure Grafana as follows:
|
||||
|
||||
```bash
|
||||
[auth.generic_oauth]
|
||||
name = Azure AD
|
||||
enabled = true
|
||||
allow_sign_up = true
|
||||
client_id = <application id>
|
||||
client_secret = <key value>
|
||||
scopes = openid email name
|
||||
auth_url = https://login.microsoftonline.com/<directory id>/oauth2/authorize
|
||||
token_url = https://login.microsoftonline.com/<directory id>/oauth2/token
|
||||
api_url =
|
||||
team_ids =
|
||||
allowed_organizations =
|
||||
```
|
||||
|
||||
> Note: It's important to ensure that the [root_url]({{< relref "../installation/configuration/#root-url" >}}) in Grafana is set in your Azure Application Reply URLs (App -> Settings -> Reply URLs)
|
||||
|
||||
## Set up OAuth2 with Centrify
|
||||
|
||||
1. Create a new Custom OpenID Connect application configuration in the Centrify dashboard.
|
||||
|
||||
@@ -92,14 +92,6 @@ member_of = "memberOf"
|
||||
email = "email"
|
||||
```
|
||||
|
||||
### Using environment variables
|
||||
|
||||
You can interpolate variables in the TOML config from environment variables. For instance, you could externalize your `bind_password` that way:
|
||||
|
||||
```bash
|
||||
bind_password = "${LDAP_ADMIN_PASSWORD}"
|
||||
```
|
||||
|
||||
## LDAP Debug View
|
||||
|
||||
> Only available in Grafana v6.4+
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
+++
|
||||
title = "Okta OAuth2 authentication"
|
||||
description = "Grafana Okta OAuth Guide "
|
||||
keywords = ["grafana", "configuration", "documentation", "oauth"]
|
||||
type = "docs"
|
||||
[menu.docs]
|
||||
name = "Okta"
|
||||
identifier = "okta_oauth2"
|
||||
parent = "authentication"
|
||||
weight = 3
|
||||
+++
|
||||
|
||||
# Okta OAuth2 authentication
|
||||
|
||||
> Only available in Grafana v7.0+
|
||||
|
||||
The Okta authentication allows your Grafana users to log in by using an external Okta authorization server.
|
||||
|
||||
## Create an Okta application
|
||||
|
||||
Before you can sign a user in, you need to create an Okta application from the Okta Developer Console.
|
||||
|
||||
1. Log in to the [Okta portal](https://login.okta.com/).
|
||||
|
||||
1. Go to Admin and then select **Developer Console**.
|
||||
|
||||
1. Select **Applications**, then **Add Application**.
|
||||
|
||||
1. Pick **Web** as the platform.
|
||||
|
||||
1. Enter a name for your application (or leave the default value).
|
||||
|
||||
1. Add the **Base URI** of your application, such as https://grafana.example.com.
|
||||
|
||||
1. Enter values for the **Login redirect URI**. Use **Base URI** and append it with `/login/okta`, for example: https://grafana.example.com/login/okta.
|
||||
|
||||
1. Click **Done** to finish creating the Okta application.
|
||||
|
||||
## Enable Okta Oauth in Grafana
|
||||
|
||||
1. Add the following to the [Grafana configuration file]({{< relref "../installation/configuration.md#config-file-locations" >}}):
|
||||
|
||||
```ini
|
||||
[auth.okta]
|
||||
name = Okta
|
||||
enabled = true
|
||||
allow_sign_up = true
|
||||
client_id = some_id
|
||||
client_secret = some_secret
|
||||
scopes = openid profile email groups
|
||||
auth_url = https://<tenant-id>.okta.com/oauth2/v1/authorize
|
||||
token_url = https://<tenant-id>.okta.com/oauth2/v1/token
|
||||
api_url = https://<tenant-id>.okta.com/oauth2/v1/userinfo
|
||||
allowed_domains =
|
||||
allowed_groups =
|
||||
role_attribute_path =
|
||||
```
|
||||
|
||||
### Configure allowed groups and domains
|
||||
|
||||
To limit access to authenticated users that are members of one or more groups, set `allowed_groups`
|
||||
to a comma- or space-separated list of Okta groups.
|
||||
|
||||
```ini
|
||||
allowed_groups = Developers, Admins
|
||||
```
|
||||
|
||||
The `allowed_domains` option limits access to the users belonging to the specific domains. Domains should be separated by space or comma.
|
||||
|
||||
```ini
|
||||
allowed_domains = mycompany.com mycompany.org
|
||||
```
|
||||
|
||||
### Map roles
|
||||
|
||||
Grafana can attempt to do role mapping through Okta OAuth. In order to achieve this, Grafana checks for the presence of a role using the [JMESPath](http://jmespath.org/examples.html) specified via the `role_attribute_path` configuration option.
|
||||
|
||||
Grafana uses JSON obtained from querying the `/userinfo` endpoint for the path lookup. The result after evaluating the `role_attribute_path` JMESPath expression needs to be a valid Grafana role, i.e. `Viewer`, `Editor` or `Admin`. Refer to [Organization roles]({{< relref "../permissions/organization_roles.md" >}}) for more information about roles and permissions in Grafana.
|
||||
|
||||
Read about how to [add custom claims](https://developer.okta.com/docs/guides/customize-tokens-returned-from-okta/add-custom-claim/) to the user info in Okta. Also, check Generic OAuth page for [JMESPath examples]({{< relref "generic-oauth.md/#jmespath-examples" >}}).
|
||||
|
||||
### Team Sync (Enterprise only)
|
||||
|
||||
Map your Okta groups to teams in Grafana so that your users will automatically be added to
|
||||
the correct teams.
|
||||
|
||||
Okta groups can be referenced by group name, like `Admins`.
|
||||
|
||||
[Learn more about Team Sync]({{< relref "../enterprise/team-sync.md" >}})
|
||||
@@ -1,7 +1,7 @@
|
||||
+++
|
||||
title = "Grafana Enterprise"
|
||||
description = "Grafana Enterprise overview"
|
||||
keywords = ["grafana", "documentation", "datasource", "permissions", "ldap", "licensing", "enterprise", "insights", "reporting"]
|
||||
keywords = ["grafana", "documentation", "datasource", "permissions", "ldap", "licensing", "enterprise"]
|
||||
type = "docs"
|
||||
[menu.docs]
|
||||
name = "Grafana Enterprise"
|
||||
@@ -50,18 +50,10 @@ Supported auth providers:
|
||||
|
||||
[Reporting]({{< relref "reporting.md" >}}) allows you to take any dashboard, generate a PDF report, and set up a schedule to have it emailed to whoever you choose.
|
||||
|
||||
## Export dashboard as PDF
|
||||
|
||||
[Export dashboard as PDF]({{< relref "export-pdf.md" >}}) allows you to export a dashboard as a PDF document.
|
||||
|
||||
## White labeling
|
||||
|
||||
[White labeling]({{< relref "white-labeling.md" >}}) allows you to replace the Grafana brand and logo with your own corporate brand and logo. You can also change footer links to point to your custom resources.
|
||||
|
||||
## Usage insights
|
||||
|
||||
[Usage insights]({{< relref "usage-insights.md" >}}) allow you to understand how your Grafana instance is used. You can see who is looking at a dashboard, how often a dashboard is seen, and which dashboards are prone to errors. You'll also be able to discover what are the least and the most used dashboards.
|
||||
|
||||
## Enterprise plugins
|
||||
|
||||
With a Grafana Enterprise license, you get access to premium plugins, including:
|
||||
@@ -72,7 +64,6 @@ With a Grafana Enterprise license, you get access to premium plugins, including:
|
||||
* [Dynatrace](https://grafana.com/plugins/grafana-dynatrace-datasource)
|
||||
* [New Relic](https://grafana.com/plugins/grafana-newrelic-datasource)
|
||||
* [Oracle Database](https://grafana.com/plugins/grafana-oracle-datasource)
|
||||
* [ServiceNow](https://grafana.com/grafana/plugins/grafana-servicenow-datasource)
|
||||
* [Splunk](https://grafana.com/plugins/grafana-splunk-datasource)
|
||||
|
||||
## Try Grafana Enterprise
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
+++
|
||||
title = "Export dashboard as PDF"
|
||||
description = ""
|
||||
keywords = ["grafana", "export", "pdf", "share"]
|
||||
type = "docs"
|
||||
[menu.docs]
|
||||
parent = "enterprise"
|
||||
weight = 900
|
||||
+++
|
||||
|
||||
# Export dashboard as PDF
|
||||
|
||||
You can generate PDFs from any of your dashboards and save it to file.
|
||||
|
||||
> Only available in Grafana Enterprise v6.7+.
|
||||
|
||||
1. In the upper right corner of the dashboard that you want to export as PDF, click the **Share dashboard** icon.
|
||||
1. On the PDF tab, select the layout option for exported dashboard: **Portrait** or **Landscape**.
|
||||
1. Click **Save as PDF** to render dashboard as a PDF document.
|
||||
Grafana opens the PDF in a new window or browser tab.
|
||||
@@ -28,15 +28,14 @@ Any changes you make to a dashboard used in a report are reflected the next time
|
||||
|
||||
Currently only Organization Admins can create reports.
|
||||
|
||||
1. Click on the reports icon in the side menu. The Reports tab allows you to view, create, and update your reports.
|
||||
1. Click on the reports icon in the side menu. The Reports tab allow you to view, create, and update your reports.
|
||||
1. Enter report information. All fields are required unless otherwise indicated.
|
||||
* **Name -** Name of the report as you want it to appear in the Reports list.
|
||||
* **Choose dashboard -** Select the dashboard to generate the report from.
|
||||
* **Recipients -** Enter the emails of the people or teams that you want to receive the report.
|
||||
* **Reply to -** (optional) The address that will appear in the **Reply to** field of the email.
|
||||
* **Custom message -** (optional) Message body in the email with the report.
|
||||
1. **Preview** the report to make sure it appears as you expect. Update if necessary
|
||||
1. Select the layout option for generated report: **Portrait** or **Landscape**.
|
||||
1. **Preview** the report to make sure it appears as you expect. Update if necessary.
|
||||
1. Enter scheduling information. Options vary depending on the frequency you select.
|
||||
1. **Save** the report.
|
||||
|
||||
@@ -51,7 +50,7 @@ When Grafana generates a report, it will render each panel separately and then p
|
||||
# Set timeout for each panel rendering request
|
||||
rendering_timeout = 10s
|
||||
# Set maximum number of concurrent calls to the rendering service
|
||||
concurrent_render_limit = 4
|
||||
concurrent_render_limit = 10
|
||||
```
|
||||
|
||||
## Troubleshoot reporting
|
||||
@@ -60,5 +59,5 @@ To troubleshoot and get more log information, enable debug logging in the config
|
||||
|
||||
```bash
|
||||
[log]
|
||||
filters = report:debug
|
||||
filters = saml.auth:debug
|
||||
```
|
||||
|
||||
@@ -12,7 +12,7 @@ weight = 500
|
||||
|
||||
# SAML authentication
|
||||
|
||||
SAML authentication integration allows your Grafana users to log in by using an external SAML 2.0 Identity Provider (IdP). To enable this, Grafana becomes a Service Provider (SP) in the authentication flow, interacting with the IdP to exchange user information.
|
||||
SAML authentication integration allows your Grafana users to log in by using an external SAML Identity Provider (IdP). To enable this, Grafana becomes a Service Provider (SP) in the authentication flow, interacting with the IdP to exchange user information.
|
||||
|
||||
The SAML single-sign-on (SSO) standard is varied and flexible. Our implementation contains the subset of features needed to provide a smooth authentication experience into Grafana.
|
||||
|
||||
@@ -20,7 +20,7 @@ The SAML single-sign-on (SSO) standard is varied and flexible. Our implementatio
|
||||
|
||||
## Supported SAML
|
||||
|
||||
Grafana supports the following SAML 2.0 bindings:
|
||||
Grafana supports the following SAML integrations.
|
||||
|
||||
* From the Service Provider (SP) to the Identity Provider (IdP):
|
||||
- `HTTP-POST` binding
|
||||
|
||||
@@ -46,7 +46,6 @@ If you have already grouped some users into a team, then you can synchronize tha
|
||||
## Supported providers
|
||||
|
||||
* [Auth Proxy]({{< relref "../auth/auth-proxy.md#team-sync-enterprise-only">}})
|
||||
* [Azure AD]({{< relref "../auth/azuread.md#team-sync-enterprise-only" >}})
|
||||
* [GitHub OAuth]({{< relref "../auth/github.md#team-sync-enterprise-only" >}})
|
||||
* [GitLab OAuth]({{< relref "../auth/gitlab.md#team-sync-enterprise-only" >}})
|
||||
* [LDAP]({{< relref "enhanced_ldap.md#ldap-group-synchronization-for-teams" >}})
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
+++
|
||||
title = "Usage-insights"
|
||||
description = "Usage-insights"
|
||||
keywords = ["grafana", "usage-insights", "enterprise"]
|
||||
aliases = ["/docs/grafana/latest/enterprise/usage-insights/"]
|
||||
type = "docs"
|
||||
[menu.docs]
|
||||
name = "Usage-insights"
|
||||
parent = "enterprise"
|
||||
weight = 700
|
||||
+++
|
||||
|
||||
# Usage insights
|
||||
|
||||
Usage insights allows you to have a better understanding of how your Grafana instance is used. The collected data are the number of:
|
||||
|
||||
- Dashboard views (aggregated and per user)
|
||||
- Data source errors
|
||||
- Data source queries
|
||||
|
||||
> Only available in Grafana Enterprise v7.0+.
|
||||
|
||||
## Presence indicator
|
||||
|
||||
The presence indicator is visible to all signed-in users on all dashboards. It shows the avatars of users who interacted with the dashboard recently (last 10 minutes by default). You can see the user's name by hovering your cursor over the user's avatar. The avatars come from [Gravatar](https://gravatar.com) based on the user's email.
|
||||
|
||||
When more users are active on a dashboard than can fit in the presence indicator section, click on the `+X` icon that opens [dashboard insights]({{< relref "#dashboard-insights" >}}) to see more details about recent user activity.
|
||||
|
||||
{{< docs-imagebox img="/img/docs/enterprise/presence_indicators.png" max-width="400px" class="docs-image--no-shadow" >}}
|
||||
|
||||
You can choose your own definition of "recent" by setting it in the [configuration]({{< relref "../installation/configuration.md">}}) file.
|
||||
|
||||
```ini
|
||||
[analytics.views]
|
||||
# Set age for recent active users
|
||||
recent_users_age = 10m
|
||||
```
|
||||
|
||||
## Dashboard insights
|
||||
|
||||
You can see dashboard usage information by clicking on the `Dashboard insights` button in the top bar.
|
||||
|
||||
{{< docs-imagebox img="/img/docs/enterprise/dashboard_insights_button.png" max-width="400px" class="docs-image--no-shadow" >}}
|
||||
|
||||
It shows two kinds of information:
|
||||
|
||||
- **Stats:** Shows the daily query count and error count for the last 30 days.
|
||||
- **Users & activity:** Shows the daily view count for the last 30 days; last activities on the dashboard and recent users (with a limit of 20).
|
||||
|
||||
{{< docs-imagebox img="/img/docs/enterprise/dashboard_insights_stats.png" max-width="400px" class="docs-image--no-shadow" >}}{{< docs-imagebox img="/img/docs/enterprise/dashboard_insights_users.png" max-width="400px" class="docs-image--no-shadow" >}}
|
||||
|
||||
|
||||
## Improved dashboard search
|
||||
|
||||
In the search view, you can sort dashboards using these insights data. It helps you find unused or broken dashboards or discover most viewed ones.
|
||||
|
||||
{{< docs-imagebox img="/img/docs/enterprise/improved_search.png" max-width="650px" class="docs-image--no-shadow" >}}
|
||||
@@ -18,7 +18,7 @@ A *dashboard* is a set of one or more panels organized and arranged into one or
|
||||
1. Zoom out time range
|
||||
2. Time picker dropdown. Here you can access relative time range options, auto refresh options and set custom absolute time ranges.
|
||||
3. Manual refresh button. Will cause all panels to refresh (fetch new data).
|
||||
4. Dashboard panel. Click the panel title to edit panels.
|
||||
4. Dashboard panel. You edit panels by clicking the panel title.
|
||||
5. Graph legend. You can change series colors, y-axis and series visibility directly from the legend.
|
||||
|
||||
## Dashboard header
|
||||
@@ -30,7 +30,7 @@ Click the new Dashboard link on the right side of the Dashboard picker. You now
|
||||
The image above shows you the top header for a Dashboard.
|
||||
|
||||
1. Side menubar toggle: This toggles the side menu, allowing you to focus on the data presented in the dashboard. The side menu provides access to features unrelated to a Dashboard such as Users, Organizations, and Data Sources.
|
||||
2. Dashboard dropdown: This dropdown shows you which Dashboard you are currently viewing, and allows you to easily switch to a new Dashboard. From here you can also create a new Dashboard or folder, import existing Dashboards, and manage Dashboard playlists.
|
||||
2. Dashboard dropdown: This dropdown shows you which Dashboard you are currently viewing, and allows you to easily switch to a new Dashboard. From here you can also create a new Dashboard or folder, Import existing Dashboards, and manage Dashboard playlists.
|
||||
3. Add Panel: Adds a new panel to the current Dashboard
|
||||
4. Star Dashboard: Star (or unstar) the current Dashboard. Starred Dashboards will show up on your own Home Dashboard by default, and are a convenient way to mark Dashboards that you're interested in.
|
||||
5. Share Dashboard: Share the current dashboard by creating a link or create a static Snapshot of it. Make sure the Dashboard is saved before sharing.
|
||||
|
||||
@@ -38,4 +38,4 @@ The following data sources are officially supported:
|
||||
|
||||
## Data source plugins
|
||||
|
||||
Since Grafana 3.0 you can install data sources as plugins. Check out [Grafana.com/plugins](https://grafana.com/plugins) for more data sources.
|
||||
Since Grafana 3.0 you can install data sources as plugins. Check out [Grafana.net](https://grafana.com/plugins) for more data sources.
|
||||
|
||||
@@ -12,10 +12,8 @@ weight = 2
|
||||
|
||||
Before you create your first dashboard, you need to add your data source. Following are the list of instructions to create one.
|
||||
|
||||
> Only users with the Admin role can add data sources.
|
||||
|
||||
1. Move your cursor to the cog on the side menu which will show you the configuration menu. If the side menu is not visible click the Grafana icon in the upper left corner. Click on **Configuration** > **Data Sources** in the side menu and you'll be taken to the data sources page
|
||||
where you can add and edit data sources. You can also click the cog.
|
||||
where you can add add and edit data sources. You can also click the cog.
|
||||
{{< docs-imagebox img="/img/docs/v52/sidemenu-datasource.png" max-width="250px" class="docs-image--no-shadow">}}
|
||||
|
||||
1. Click **Add data source** and you will come to the settings page of your new data source.
|
||||
@@ -26,6 +24,6 @@ Before you create your first dashboard, you need to add your data source. Follow
|
||||
|
||||
{{< docs-imagebox img="/img/docs/v52/datasource-settings.png" max-width="700px" class="docs-image--no-shadow">}}
|
||||
|
||||
1. In the **Type**, select the type of data source. See [Supported data sources]({{< relref "../../features/datasources/#supported-data-sources/" >}}) for more information and how to configure your data source settings.
|
||||
1. In the **Type**, select the type of data source. See [Supported data sources]({{< relref "../../features/datasources/#supported-data-sources/" >}}) for more information and how to configure your data source.
|
||||
|
||||
1. Click **Save & Test**.
|
||||
1. Click **Save & Test**.
|
||||
@@ -117,7 +117,7 @@ Azure Monitor Examples:
|
||||
|
||||
### Templating with Variables for the Azure Monitor Service
|
||||
|
||||
Instead of hard-coding things like server, application and sensor name in your metric queries you can use variables in their place. Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns make it easy to change the data being displayed in your dashboard.
|
||||
Instead of hard-coding things like server, application and sensor name in you metric queries you can use variables in their place. Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns makes it easy to change the data being displayed in your dashboard.
|
||||
|
||||
Note that the Azure Monitor service does not support multiple values yet. If you want to visualize multiple time series (for example, metrics for server1 and server2) then you have to add multiple queries to able to view them on the same graph or in the same table.
|
||||
|
||||
@@ -274,45 +274,6 @@ There are also some Grafana variables that can be used in Azure Log Analytics qu
|
||||
|
||||
- `$__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)`
|
||||
|
||||
### Templating with Variables for Azure Log Analytics
|
||||
|
||||
Any Log Analytics query that returns a list of values can be used in the `Query` field in the Variable edit view. There is also one Grafana function for Log Analytics that returns a list of workspaces.
|
||||
|
||||
Refer to the [Variables]({{< relref "../../reference/templating.md" >}}) documentation for an introduction to the templating feature and the different
|
||||
types of template variables.
|
||||
|
||||
| Name | Description |
|
||||
| -------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
|
||||
| _workspaces()_ | Returns a list of workspaces for the default subscription. |
|
||||
| _workspaces(12345678-aaaa-bbbb-cccc-123456789aaa)_ | Returns a list of workspaces for the specified subscription (the parameter can be quoted or unquoted). |
|
||||
|
||||
Example variable queries:
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
| Query | Description |
|
||||
| --------------------------------------------------------------------------------------- | --------------------------------------------------------- |
|
||||
| _subscriptions()_ | Returns a list of Azure subscriptions |
|
||||
| _workspaces()_ | Returns a list of workspaces for default subscription |
|
||||
| _workspaces("12345678-aaaa-bbbb-cccc-123456789aaa")_ | Returns a list of workspaces for a specified subscription |
|
||||
| _workspaces("$subscription")_ | With template variable for the subscription parameter |
|
||||
| _workspace("myWorkspace").Heartbeat \| distinct Computer_ | Returns a list of Virtual Machines |
|
||||
| _workspace("$workspace").Heartbeat \| distinct Computer_ | Returns a list of Virtual Machines with template variable |
|
||||
| _workspace("$workspace").Perf \| distinct ObjectName_ | Returns a list of objects from the Perf table |
|
||||
| _workspace("$workspace").Perf \| where ObjectName == "$object" \| distinct CounterName_ | Returns a list of metric names from the Perf table |
|
||||
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
Example of a time series query using variables:
|
||||
|
||||
```
|
||||
Perf
|
||||
| where ObjectName == "$object" and CounterName == "$metric"
|
||||
| where TimeGenerated >= $__timeFrom() and TimeGenerated <= $__timeTo()
|
||||
| where $__contains(Computer, $computer)
|
||||
| summarize avg(CounterValue) by bin(TimeGenerated, $__interval), Computer
|
||||
| order by TimeGenerated asc
|
||||
```
|
||||
|
||||
### Azure Log Analytics Alerting
|
||||
|
||||
Not implemented yet.
|
||||
@@ -332,34 +293,3 @@ There are some important caveats to remember:
|
||||
- Currently, four default dashboard variables are supported: `$__timeFilter()`, `$__from`, `$__to`, and `$__interval`. If you're searching in timestamped data, replace the beginning of your where clause to `where $__timeFilter()`. Dashboard changes by time region are handled as you'd expect, as long as you leave the name of the `timestamp` column alone. Likewise, `$__interval` will automatically change based on the dashboard's time region _and_ the width of the chart being displayed. Use it in bins, so `bin(timestamp,$__interval)` changes into something like `bin(timestamp,1s)`. Use `$__from` and `$__to` if you just want the formatted dates to be inserted.
|
||||
|
||||
- Templated dashboard variables are not yet supported! They will come in a future version.
|
||||
|
||||
## Configure the data source with provisioning
|
||||
|
||||
It's now possible to configure data sources using config files with Grafana's provisioning system. You can read more about how it works and all the settings you can set for data sources on the [provisioning docs page]({{< relref "../../administration/provisioning/#datasources" >}})
|
||||
|
||||
Here are some provisioning examples for this data source.
|
||||
|
||||
```yaml
|
||||
# config file version
|
||||
apiVersion: 1
|
||||
|
||||
datasources:
|
||||
- name: Azure Monitor
|
||||
type: grafana-azure-monitor-datasource
|
||||
access: proxy
|
||||
jsonData:
|
||||
appInsightsAppId: <app-insights-app-id>
|
||||
clientId: <client-id>
|
||||
cloudName: azuremonitor
|
||||
subscriptionId: <subscription-id>
|
||||
tenantId: <tenant-id>
|
||||
logAnalyticsClientId: <log-analytics-client-id>
|
||||
logAnalyticsDefaultWorkspace: <log-analytics-default-workspace>
|
||||
logAnalyticsSubscriptionId: <log-analytics-subscription-id>
|
||||
logAnalyticsTenantId: <log-analytics-tenant-id>
|
||||
secureJsonData:
|
||||
clientSecret: <client-secret>
|
||||
appInsightsApiKey: <app-insights-api-key>
|
||||
logAnalyticsClientSecret: <log-analytics-client-secret>
|
||||
version: 1
|
||||
```
|
||||
@@ -43,7 +43,7 @@ server is running on AWS you can use IAM Roles and authentication will be handle
|
||||
|
||||
See the AWS documentation on [IAM Roles](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html)
|
||||
|
||||
> NOTE: AWS Role Switching as described [here](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-cli.html) is not supported at the moment.
|
||||
> NOTE: AWS Role Switching as described [here](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-cli.html) it not supported at the moment.
|
||||
|
||||
## IAM Policies
|
||||
|
||||
@@ -62,8 +62,6 @@ Here is a minimal policy example:
|
||||
"Effect": "Allow",
|
||||
"Action": [
|
||||
"cloudwatch:DescribeAlarmsForMetric",
|
||||
"cloudwatch:DescribeAlarmHistory",
|
||||
"cloudwatch:DescribeAlarms",
|
||||
"cloudwatch:ListMetrics",
|
||||
"cloudwatch:GetMetricStatistics",
|
||||
"cloudwatch:GetMetricData"
|
||||
@@ -182,7 +180,7 @@ To import the pre-configured dashboards, go to the configuration page of your Cl
|
||||
|
||||
## Templated queries
|
||||
|
||||
Instead of hard-coding things like server, application and sensor name in you metric queries you can use variables in their place. Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns make it easy to change the data being displayed in your dashboard.
|
||||
Instead of hard-coding things like server, application and sensor name in you metric queries you can use variables in their place. Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns makes it easy to change the data being displayed in your dashboard.
|
||||
|
||||
See the [Templating]({{< relref "../../reference/templating.md" >}}) documentation for an introduction to the templating feature and the different types of template variables.
|
||||
|
||||
|
||||
@@ -116,8 +116,8 @@ Some metric aggregations are called Pipeline aggregations, for example, *Moving
|
||||
|
||||
## Templating
|
||||
|
||||
Instead of hard-coding things like server, application and sensor name in your metric queries you can use variables in their place.
|
||||
Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns make it easy to change the data
|
||||
Instead of hard-coding things like server, application and sensor name in you metric queries you can use variables in their place.
|
||||
Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns makes it easy to change the data
|
||||
being displayed in your dashboard.
|
||||
|
||||
Check out the [Templating]({{< relref "../../reference/templating.md" >}}) documentation for an introduction to the templating feature and the different
|
||||
@@ -172,7 +172,7 @@ Example dashboard:
|
||||
|
||||
## Annotations
|
||||
|
||||
[Annotations]({{< relref "../../reference/annotations.md" >}}) allow you to overlay rich event information on top of graphs. You add annotation
|
||||
[Annotations]({{< relref "../../reference/annotations.md" >}}) allows you to overlay rich event information on top of graphs. You add annotation
|
||||
queries via the Dashboard menu / Annotations view. Grafana can query any Elasticsearch index
|
||||
for annotation events.
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ All requests will be made from the browser directly to the data source and may b
|
||||
|
||||
### Navigate metric segments
|
||||
|
||||
Click the ``Select metric`` link to start navigating the metric space. Once you start you can continue using the mouse
|
||||
Click the ``Select metric`` link to start navigating the metric space. One you start you can continue using the mouse
|
||||
or keyboard arrow keys. You can select a wildcard and still continue.
|
||||
|
||||
{{< docs-imagebox img="/img/docs/v45/graphite_query1_still.png"
|
||||
@@ -87,8 +87,8 @@ this consolidation is done using `avg` function. You can control how Graphite co
|
||||
|
||||
## Templating
|
||||
|
||||
Instead of hard-coding things like server, application and sensor name in your metric queries you can use variables in their place.
|
||||
Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns make it easy to change the data
|
||||
Instead of hard-coding things like server, application and sensor name in you metric queries you can use variables in their place.
|
||||
Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns makes it easy to change the data
|
||||
being displayed in your dashboard.
|
||||
|
||||
Check out the [Templating]({{< relref "../../reference/templating.md" >}}) documentation for an introduction to the templating feature and the different
|
||||
@@ -132,6 +132,7 @@ TagValues
|
||||
tag_values(server, server=~${__searchFilter:regex})
|
||||
```
|
||||
|
||||
|
||||
### Variable Usage
|
||||
|
||||
You can use a variable in a metric node path or as a parameter to a function.
|
||||
@@ -162,16 +163,12 @@ Check out the [Advanced Formatting Options section in the Variables]({{< relref
|
||||
|
||||
## Annotations
|
||||
|
||||
[Annotations]({{< relref "../../reference/annotations.md" >}}) allow you to overlay rich event information on top of graphs. You add annotation
|
||||
[Annotations]({{< relref "../../reference/annotations.md" >}}) allows you to overlay rich event information on top of graphs. You add annotation
|
||||
queries via the Dashboard menu / Annotations view.
|
||||
|
||||
Graphite supports two ways to query annotations. A regular metric query, for this you use the `Graphite query` textbox. A Graphite events query, use the `Graphite event tags` textbox,
|
||||
specify a tag or wildcard (leave empty should also work)
|
||||
|
||||
## Getting Grafana metrics into Graphite
|
||||
|
||||
Grafana exposes metrics for Graphite on the `/metrics` endpoint. For detailed instructions, refer to [Internal Grafana metrics]({{< relref "../../administration/metrics.md">}}).
|
||||
|
||||
## Configure the data source with provisioning
|
||||
|
||||
It's now possible to configure data sources using config files with Grafana's provisioning system. You can read more about how it works and all the settings you can set for data sources on the [provisioning docs page]({{< relref "../../administration/provisioning/#datasources" >}})
|
||||
|
||||
@@ -140,8 +140,8 @@ To add a filter click the plus icon to the right of the `Measurements/Fields` bu
|
||||
|
||||
## Templating
|
||||
|
||||
Instead of hard-coding things like server, application and sensor name in your metric queries you can use variables in their place.
|
||||
Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns make it easy to change the data
|
||||
Instead of hard-coding things like server, application and sensor name in you metric queries you can use variables in their place.
|
||||
Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns makes it easy to change the data
|
||||
being displayed in your dashboard.
|
||||
|
||||
Check out the [Templating]({{< relref "../../reference/templating.md" >}}) documentation for an introduction to the templating feature and the different
|
||||
|
||||
@@ -39,16 +39,14 @@ Just add it as a data source and you are ready to query your log data in [Explor
|
||||
### Derived fields
|
||||
|
||||
The Derived Fields configuration allows you to:
|
||||
|
||||
* Add fields parsed from the log message.
|
||||
* Add a link that uses the value of the field.
|
||||
|
||||
You can use this functionality to link to your tracing backend directly from your logs, or link to a user profile page if a userId is present in the log line. These links appear in the [log details](/features/explore/#labels-and-parsed-fields).
|
||||
You can use this functionality to link to your tracing backend directly from your logs, or link to a user profile page if a userId is present in the log line. These links will be shown in the [log details](/features/explore/#labels-and-parsed-fields).
|
||||
{{< docs-imagebox img="/img/docs/v65/loki_derived_fields.png" class="docs-image--no-shadow" caption="Screenshot of the derived fields configuration" >}}
|
||||
Each derived field consists of:
|
||||
|
||||
- **Name:** Shown in the log details as a label.
|
||||
- **Regex:** A Regex pattern that runs on the log message and captures part of it as the value of the new field. Can only contain a single capture group.
|
||||
- **Regex:** A Regex pattern that runs on the log message and captures part of it to as the value of the new field. Can only contain capture a single group.
|
||||
- **URL**: A URL template used to construct a link next to the field value in log details. Use special `${__value.raw}` value in your template to interpolate the real field value into your URL template.
|
||||
|
||||
You can use a debug section to see what your fields extract and how the URL is interpolated. Click **Show example log message** to show the text area where you can enter a log message.
|
||||
@@ -71,7 +69,7 @@ Once the result is returned, the log panel shows a list of log rows and a bar ch
|
||||
|
||||
<div class="medium-6 columns">
|
||||
<video width="800" height="500" controls>
|
||||
<source src="/assets/videos/explore_loki.mp4" type="video/mp4">
|
||||
<source src="https://grafana.com/static/assets/videos/explore_loki.mp4" type="video/mp4">
|
||||
Your browser does not support the video tag.
|
||||
</video>
|
||||
</div>
|
||||
@@ -98,7 +96,7 @@ Examples:
|
||||
|
||||
The [same rules that apply for Prometheus Label Selectors](https://prometheus.io/docs/prometheus/latest/querying/basics/#instant-vector-selectors) apply for Loki Log Stream Selectors.
|
||||
|
||||
Another way to add a label selector is in the table section. Click **Filter** beside a label to add the label to the query expression. This even works for multiple queries and will add the label selector to each query.
|
||||
Another way to add a label selector, is in the table section, clicking on the **Filter** button beside a label will add the label to the query expression. This even works for multiple queries and will the label selector to each query.
|
||||
|
||||
### Search Expression
|
||||
|
||||
@@ -127,7 +125,7 @@ The following filter types are currently supported:
|
||||
|
||||
## Live tailing
|
||||
|
||||
Loki supports Live tailing which displays logs in real-time. This feature is supported in [Explore]({{< relref "../explore/#loki-specific-features" >}}).
|
||||
Loki supports Live tailing which displays logs in real-time. This feature is supported in [Explore]({{< relref "../explore/#loki-specific-features" >}}) and in dashboards with a Live toggle in the query editor.
|
||||
|
||||
Note that Live Tailing relies on two Websocket connections: one between the browser and the Grafana server, and another between the Grafana server and the Loki server. If you run any reverse proxies, please configure them accordingly.
|
||||
|
||||
@@ -189,16 +187,8 @@ datasources:
|
||||
jsonData:
|
||||
maxLines: 1000
|
||||
derivedFields:
|
||||
# Field with internal link pointing to data source in Grafana.
|
||||
# Right now, Grafana supports only Jaeger and Zipkin data sources as link targets.
|
||||
- datasourceUid: my_jaeger_uid
|
||||
- datasourceName: Jaeger
|
||||
matcherRegex: "traceID=(\\w+)"
|
||||
name: TraceID
|
||||
# url will be interpreted as query for the datasource
|
||||
url: "$${__value.raw}"
|
||||
|
||||
# Field with external link.
|
||||
- matcherRegex: "traceID=(\\w+)"
|
||||
name: TraceID
|
||||
url: "http://localhost:16686/trace/$${__value.raw}"
|
||||
```
|
||||
|
||||
@@ -80,7 +80,7 @@ If possible, we recommend you to use the latest service pack available for optim
|
||||
|
||||
{{< docs-imagebox img="/img/docs/v51/mssql_query_editor.png" class="docs-image--no-shadow" >}}
|
||||
|
||||
You will find the MSSQL query editor in the metrics tab in Graph, Singlestat or Table panel's edit mode. You enter edit mode by clicking the
|
||||
You find the MSSQL query editor in the metrics tab in Graph, Singlestat or Table panel's edit mode. You enter edit mode by clicking the
|
||||
panel title, then edit. The editor allows you to define a SQL query to select data to be visualized.
|
||||
|
||||
1. Select *Format as* `Time series` (for use in Graph or Singlestat panel's among others) or `Table` (for use in Table panel among others).
|
||||
@@ -97,24 +97,24 @@ To simplify syntax and to allow for dynamic parts, like date range filters, the
|
||||
|
||||
Macro example | Description
|
||||
------------ | -------------
|
||||
*`$__time(dateColumn)`* | Will be replaced by an expression to rename the column to *time*. For example, *dateColumn as time*
|
||||
*`$__timeEpoch(dateColumn)`* | Will be replaced by an expression to convert a DATETIME column type to Unix timestamp and rename it to *time*. <br/>For example, *DATEDIFF(second, '1970-01-01', dateColumn) AS time*
|
||||
*`$__timeFilter(dateColumn)`* | Will be replaced by a time range filter using the specified column name. <br/>For example, *dateColumn BETWEEN '2017-04-21T05:01:17Z' AND '2017-04-21T05:06:17Z'*
|
||||
*`$__timeFrom()`* | Will be replaced by the start of the currently active time selection. For example, *'2017-04-21T05:01:17Z'*
|
||||
*`$__timeTo()`* | Will be replaced by the end of the currently active time selection. For example, *'2017-04-21T05:06:17Z'*
|
||||
*`$__timeGroup(dateColumn,'5m'[, fillvalue])`* | Will be replaced by an expression usable in GROUP BY clause. Providing a *fillValue* of *NULL* or *floating value* will automatically fill empty series in timerange with that value. <br/>For example, *CAST(ROUND(DATEDIFF(second, '1970-01-01', time_column)/300.0, 0) as bigint)\*300*.
|
||||
*`$__timeGroup(dateColumn,'5m', 0)`* | Same as above but with a fill parameter so missing points in that series will be added by grafana and 0 will be used as value.
|
||||
*`$__timeGroup(dateColumn,'5m', NULL)`* | Same as above but NULL will be used as value for missing points.
|
||||
*`$__timeGroup(dateColumn,'5m', previous)`* | Same as above but the previous value in that series will be used as fill value if no value has been seen yet NULL will be used (only available in Grafana 5.3+).
|
||||
*`$__timeGroupAlias(dateColumn,'5m')`* | Will be replaced identical to $__timeGroup but with an added column alias (only available in Grafana 5.3+).
|
||||
*`$__unixEpochFilter(dateColumn)`* | Will be replaced by a time range filter using the specified column name with times represented as Unix timestamp. For example, *dateColumn > 1494410783 AND dateColumn < 1494497183*
|
||||
*`$__unixEpochFrom()`* | Will be replaced by the start of the currently active time selection as Unix timestamp. For example, *1494410783*
|
||||
*`$__unixEpochTo()`* | Will be replaced by the end of the currently active time selection as Unix timestamp. For example, *1494497183*
|
||||
*`$__unixEpochNanoFilter(dateColumn)`* | Will be replaced by a time range filter using the specified column name with times represented as nanosecond timestamp. For example, *dateColumn > 1494410783152415214 AND dateColumn < 1494497183142514872*
|
||||
*`$__unixEpochNanoFrom()`* | Will be replaced by the start of the currently active time selection as nanosecond timestamp. For example, *1494410783152415214*
|
||||
*`$__unixEpochNanoTo()`* | Will be replaced by the end of the currently active time selection as nanosecond timestamp. For example, *1494497183142514872*
|
||||
*`$__unixEpochGroup(dateColumn,'5m', [fillmode])`* | Same as $__timeGroup but for times stored as Unix timestamp (only available in Grafana 5.3+).
|
||||
*`$__unixEpochGroupAlias(dateColumn,'5m', [fillmode])`* | Same as above but also adds a column alias (only available in Grafana 5.3+).
|
||||
*$__time(dateColumn)* | Will be replaced by an expression to rename the column to *time*. For example, *dateColumn as time*
|
||||
*$__timeEpoch(dateColumn)* | Will be replaced by an expression to convert a DATETIME column type to Unix timestamp and rename it to *time*. <br/>For example, *DATEDIFF(second, '1970-01-01', dateColumn) AS time*
|
||||
*$__timeFilter(dateColumn)* | Will be replaced by a time range filter using the specified column name. <br/>For example, *dateColumn BETWEEN '2017-04-21T05:01:17Z' AND '2017-04-21T05:06:17Z'*
|
||||
*$__timeFrom()* | Will be replaced by the start of the currently active time selection. For example, *'2017-04-21T05:01:17Z'*
|
||||
*$__timeTo()* | Will be replaced by the end of the currently active time selection. For example, *'2017-04-21T05:06:17Z'*
|
||||
*$__timeGroup(dateColumn,'5m'[, fillvalue])* | Will be replaced by an expression usable in GROUP BY clause. Providing a *fillValue* of *NULL* or *floating value* will automatically fill empty series in timerange with that value. <br/>For example, *CAST(ROUND(DATEDIFF(second, '1970-01-01', time_column)/300.0, 0) as bigint)\*300*.
|
||||
*$__timeGroup(dateColumn,'5m', 0)* | Same as above but with a fill parameter so missing points in that series will be added by grafana and 0 will be used as value.
|
||||
*$__timeGroup(dateColumn,'5m', NULL)* | Same as above but NULL will be used as value for missing points.
|
||||
*$__timeGroup(dateColumn,'5m', previous)* | Same as above but the previous value in that series will be used as fill value if no value has been seen yet NULL will be used (only available in Grafana 5.3+).
|
||||
*$__timeGroupAlias(dateColumn,'5m')* | Will be replaced identical to $__timeGroup but with an added column alias (only available in Grafana 5.3+).
|
||||
*$__unixEpochFilter(dateColumn)* | Will be replaced by a time range filter using the specified column name with times represented as Unix timestamp. For example, *dateColumn > 1494410783 AND dateColumn < 1494497183*
|
||||
*$__unixEpochFrom()* | Will be replaced by the start of the currently active time selection as Unix timestamp. For example, *1494410783*
|
||||
*$__unixEpochTo()* | Will be replaced by the end of the currently active time selection as Unix timestamp. For example, *1494497183*
|
||||
*$__unixEpochNanoFilter(dateColumn)* | Will be replaced by a time range filter using the specified column name with times represented as nanosecond timestamp. For example, *dateColumn > 1494410783152415214 AND dateColumn < 1494497183142514872*
|
||||
*$__unixEpochNanoFrom()* | Will be replaced by the start of the currently active time selection as nanosecond timestamp. For example, *1494410783152415214*
|
||||
*$__unixEpochNanoTo()* | Will be replaced by the end of the currently active time selection as nanosecond timestamp. For example, *1494497183142514872*
|
||||
*$__unixEpochGroup(dateColumn,'5m', [fillmode])* | Same as $__timeGroup but for times stored as Unix timestamp (only available in Grafana 5.3+).
|
||||
*$__unixEpochGroupAlias(dateColumn,'5m', [fillmode])* | Same as above but also adds a column alias (only available in Grafana 5.3+).
|
||||
|
||||
We plan to add many more macros. If you have suggestions for what macros you would like to see, please [open an issue](https://github.com/grafana/grafana) in our GitHub repo.
|
||||
|
||||
@@ -293,12 +293,12 @@ GROUP BY
|
||||
ORDER BY 1
|
||||
```
|
||||
|
||||
When the above query is used in a graph panel, the result is two series named `Metric A` and `Metric B` with a sum of `valueTwo` plotted over `time`.
|
||||
When above query are used in a graph panel the result will be two series named `Metric A` and `Metric B` with a sum of `valueTwo` plotted over `time`.
|
||||
Any series lacking a value in a 3 minute window will have a value of zero which you'll see rendered in the graph to the right.
|
||||
|
||||
## Templating
|
||||
|
||||
Instead of hard-coding things like server, application and sensor name in your metric queries you can use variables in their place. Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns make it easy to change the data being displayed in your dashboard.
|
||||
Instead of hard-coding things like server, application and sensor name in you metric queries you can use variables in their place. Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns makes it easy to change the data being displayed in your dashboard.
|
||||
|
||||
Check out the [Templating]({{< relref "../../reference/templating.md" >}}) documentation for an introduction to the templating feature and the different types of template variables.
|
||||
|
||||
@@ -319,7 +319,7 @@ A query can return multiple columns and Grafana will automatically create a list
|
||||
SELECT [host].[hostname], [other_host].[hostname2] FROM host JOIN other_host ON [host].[city] = [other_host].[city]
|
||||
```
|
||||
|
||||
Another option is a query that can create a key/value variable. The query should return two columns that are named `__text` and `__value`. The `__text` column value should be unique (if it is not unique then the first value is used). The options in the dropdown will have a text and value that allow you to have a friendly name as text and an id as the value. An example query with `hostname` as the text and `id` as the value:
|
||||
Another option is a query that can create a key/value variable. The query should return two columns that are named `__text` and `__value`. The `__text` column value should be unique (if it is not unique then the first value is used). The options in the dropdown will have a text and value that allows you to have a friendly name as text and an id as the value. An example query with `hostname` as the text and `id` as the value:
|
||||
|
||||
```sql
|
||||
SELECT hostname __text, id __value FROM host
|
||||
@@ -374,14 +374,14 @@ Read more about variable formatting options in the [Variables]({{< relref "../..
|
||||
|
||||
## Annotations
|
||||
|
||||
[Annotations]({{< relref "../../reference/annotations.md" >}}) allow you to overlay rich event information on top of graphs. You add annotation queries via the Dashboard menu / Annotations view.
|
||||
[Annotations]({{< relref "../../reference/annotations.md" >}}) allows you to overlay rich event information on top of graphs. You add annotation queries via the Dashboard menu / Annotations view.
|
||||
|
||||
**Columns:**
|
||||
|
||||
Name | Description
|
||||
------------ | -------------
|
||||
time | The name of the date/time field. Could be a column with a native SQL date/time data type or epoch value.
|
||||
timeend | Optional name of the end date/time field. Could be a column with a native SQL date/time data type or epoch value. (Grafana v6.6+)
|
||||
timeend | Optional name of the end date/time field. Could be a column with a native SQL date/time data type or epoch value.
|
||||
text | Event description field.
|
||||
tags | Optional field name to use for event tags as a comma separated string.
|
||||
|
||||
@@ -411,23 +411,6 @@ WHERE
|
||||
ORDER BY 1
|
||||
```
|
||||
|
||||
**Example region query using time and timeend columns with epoch values:**
|
||||
|
||||
> Only available in Grafana v6.6+.
|
||||
|
||||
```sql
|
||||
SELECT
|
||||
time_sec as time,
|
||||
time_end_sec as timeend,
|
||||
description as [text],
|
||||
tags
|
||||
FROM
|
||||
[events]
|
||||
WHERE
|
||||
$__unixEpochFilter(time_sec)
|
||||
ORDER BY 1
|
||||
```
|
||||
|
||||
**Example query using time column of native SQL date/time data type:**
|
||||
|
||||
```sql
|
||||
@@ -444,7 +427,7 @@ ORDER BY 1
|
||||
|
||||
## Stored procedure support
|
||||
|
||||
Stored procedures have been verified to work. However, please note that we haven't done anything special to support this, so there might be edge cases where it won't work as you would expect.
|
||||
Stored procedures have been verified to work. However, please note that we haven't done anything special to support this why there may exist edge cases where it won't work as you would expect.
|
||||
Stored procedures should be supported in table, time series and annotation queries as long as you use the same naming of columns and return data in the same format as describe above under respective section.
|
||||
|
||||
Please note that any macro function will not work inside a stored procedure.
|
||||
@@ -491,7 +474,7 @@ We can define a stored procedure that will return all data we need to render 4 s
|
||||
In this case the stored procedure accepts two parameters `@from` and `@to` of `int` data types which should be a timerange (from-to) in epoch format
|
||||
which will be used to filter the data to return from the stored procedure.
|
||||
|
||||
We're mimicking the `$__timeGroup(time, '5m')` in the select and group by expressions, and that's why there are a lot of lengthy expressions needed -
|
||||
We're mimicking the `$__timeGroup(time, '5m')` in the select and group by expressions and that's why there's a lot of lengthy expressions needed -
|
||||
these could be extracted to MSSQL functions, if wanted.
|
||||
|
||||
```sql
|
||||
|
||||
@@ -15,7 +15,7 @@ weight = 7
|
||||
>
|
||||
> Starting from Grafana v5.1 you can name the time column *time* in addition to earlier supported *time_sec*. Usage of *time_sec* will eventually be deprecated.
|
||||
|
||||
Grafana ships with a built-in MySQL data source plugin that allows you to query and visualize
|
||||
Grafana ships with a built-in MySQL data source plugin that allow you to query any visualize
|
||||
data from a MySQL compatible database.
|
||||
|
||||
## Adding the data source
|
||||
@@ -131,28 +131,28 @@ To simplify syntax and to allow for dynamic parts, like date range filters, the
|
||||
|
||||
Macro example | Description
|
||||
------------ | -------------
|
||||
*`$__time(dateColumn)`* | Will be replaced by an expression to convert to a UNIX timestamp and rename the column to `time_sec`. For example, *UNIX_TIMESTAMP(dateColumn) as time_sec*
|
||||
*`$__timeEpoch(dateColumn)`* | Will be replaced by an expression to convert to a UNIX timestamp and rename the column to `time_sec`. For example, *UNIX_TIMESTAMP(dateColumn) as time_sec*
|
||||
*`$__timeFilter(dateColumn)`* | Will be replaced by a time range filter using the specified column name. For example, *dateColumn BETWEEN FROM_UNIXTIME(1494410783) AND FROM_UNIXTIME(1494410983)*
|
||||
*`$__timeFrom()`* | Will be replaced by the start of the currently active time selection. For example, *FROM_UNIXTIME(1494410783)*
|
||||
*`$__timeTo()`* | Will be replaced by the end of the currently active time selection. For example, *FROM_UNIXTIME(1494410983)*
|
||||
*`$__timeGroup(dateColumn,'5m')`* | Will be replaced by an expression usable in GROUP BY clause. For example, *cast(cast(UNIX_TIMESTAMP(dateColumn)/(300) as signed)*300 as signed),*
|
||||
*`$__timeGroup(dateColumn,'5m', 0)`* | Same as above but with a fill parameter so missing points in that series will be added by grafana and 0 will be used as value.
|
||||
*`$__timeGroup(dateColumn,'5m', NULL)`* | Same as above but NULL will be used as value for missing points.
|
||||
*`$__timeGroup(dateColumn,'5m', previous)`* | Same as above but the previous value in that series will be used as fill value if no value has been seen yet NULL will be used (only available in Grafana 5.3+).
|
||||
*`$__timeGroupAlias(dateColumn,'5m')`* | Will be replaced identical to $__timeGroup but with an added column alias (only available in Grafana 5.3+).
|
||||
*`$__unixEpochFilter(dateColumn)`* | Will be replaced by a time range filter using the specified column name with times represented as Unix timestamp. For example, *dateColumn > 1494410783 AND dateColumn < 1494497183*
|
||||
*`$__unixEpochFrom()`* | Will be replaced by the start of the currently active time selection as Unix timestamp. For example, *1494410783*
|
||||
*`$__unixEpochTo()`* | Will be replaced by the end of the currently active time selection as Unix timestamp. For example, *1494497183*
|
||||
*`$__unixEpochNanoFilter(dateColumn)`* | Will be replaced by a time range filter using the specified column name with times represented as nanosecond timestamp. For example, *dateColumn > 1494410783152415214 AND dateColumn < 1494497183142514872*
|
||||
*`$__unixEpochNanoFrom()`* | Will be replaced by the start of the currently active time selection as nanosecond timestamp. For example, *1494410783152415214*
|
||||
*`$__unixEpochNanoTo()`* | Will be replaced by the end of the currently active time selection as nanosecond timestamp. For example, *1494497183142514872*
|
||||
*`$__unixEpochGroup(dateColumn,'5m', [fillmode])`* | Same as $__timeGroup but for times stored as Unix timestamp (only available in Grafana 5.3+).
|
||||
*`$__unixEpochGroupAlias(dateColumn,'5m', [fillmode])`* | Same as above but also adds a column alias (only available in Grafana 5.3+).
|
||||
*$__time(dateColumn)* | Will be replaced by an expression to convert to a UNIX timestamp and rename the column to `time_sec`. For example, *UNIX_TIMESTAMP(dateColumn) as time_sec*
|
||||
*$__timeEpoch(dateColumn)* | Will be replaced by an expression to convert to a UNIX timestamp and rename the column to `time_sec`. For example, *UNIX_TIMESTAMP(dateColumn) as time_sec*
|
||||
*$__timeFilter(dateColumn)* | Will be replaced by a time range filter using the specified column name. For example, *dateColumn BETWEEN FROM_UNIXTIME(1494410783) AND FROM_UNIXTIME(1494410983)*
|
||||
*$__timeFrom()* | Will be replaced by the start of the currently active time selection. For example, *FROM_UNIXTIME(1494410783)*
|
||||
*$__timeTo()* | Will be replaced by the end of the currently active time selection. For example, *FROM_UNIXTIME(1494410983)*
|
||||
*$__timeGroup(dateColumn,'5m')* | Will be replaced by an expression usable in GROUP BY clause. For example, *cast(cast(UNIX_TIMESTAMP(dateColumn)/(300) as signed)*300 as signed),*
|
||||
*$__timeGroup(dateColumn,'5m', 0)* | Same as above but with a fill parameter so missing points in that series will be added by grafana and 0 will be used as value.
|
||||
*$__timeGroup(dateColumn,'5m', NULL)* | Same as above but NULL will be used as value for missing points.
|
||||
*$__timeGroup(dateColumn,'5m', previous)* | Same as above but the previous value in that series will be used as fill value if no value has been seen yet NULL will be used (only available in Grafana 5.3+).
|
||||
*$__timeGroupAlias(dateColumn,'5m')* | Will be replaced identical to $__timeGroup but with an added column alias (only available in Grafana 5.3+).
|
||||
*$__unixEpochFilter(dateColumn)* | Will be replaced by a time range filter using the specified column name with times represented as Unix timestamp. For example, *dateColumn > 1494410783 AND dateColumn < 1494497183*
|
||||
*$__unixEpochFrom()* | Will be replaced by the start of the currently active time selection as Unix timestamp. For example, *1494410783*
|
||||
*$__unixEpochTo()* | Will be replaced by the end of the currently active time selection as Unix timestamp. For example, *1494497183*
|
||||
*$__unixEpochNanoFilter(dateColumn)* | Will be replaced by a time range filter using the specified column name with times represented as nanosecond timestamp. For example, *dateColumn > 1494410783152415214 AND dateColumn < 1494497183142514872*
|
||||
*$__unixEpochNanoFrom()* | Will be replaced by the start of the currently active time selection as nanosecond timestamp. For example, *1494410783152415214*
|
||||
*$__unixEpochNanoTo()* | Will be replaced by the end of the currently active time selection as nanosecond timestamp. For example, *1494497183142514872*
|
||||
*$__unixEpochGroup(dateColumn,'5m', [fillmode])* | Same as $__timeGroup but for times stored as Unix timestamp (only available in Grafana 5.3+).
|
||||
*$__unixEpochGroupAlias(dateColumn,'5m', [fillmode])* | Same as above but also adds a column alias (only available in Grafana 5.3+).
|
||||
|
||||
We plan to add many more macros. If you have suggestions for what macros you would like to see, please [open an issue](https://github.com/grafana/grafana) in our GitHub repo.
|
||||
|
||||
The query editor has a link named `Generated SQL` that shows up after a query has been executed, while in panel edit mode. Click on it and it will expand and show the raw interpolated SQL string that was executed.
|
||||
The query editor has a link named `Generated SQL` that show up after a query as been executed, while in panel edit mode. Click on it and it will expand and show the raw interpolated SQL string that was executed.
|
||||
|
||||
## Table queries
|
||||
|
||||
@@ -236,7 +236,7 @@ This is something we plan to add.
|
||||
|
||||
This feature is currently available in the nightly builds and will be included in the 5.0.0 release.
|
||||
|
||||
Instead of hard-coding things like server, application and sensor name in your metric queries you can use variables in their place. Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns make it easy to change the data being displayed in your dashboard.
|
||||
Instead of hard-coding things like server, application and sensor name in you metric queries you can use variables in their place. Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns makes it easy to change the data being displayed in your dashboard.
|
||||
|
||||
Check out the [Templating]({{< relref "../../reference/templating.md" >}}) documentation for an introduction to the templating feature and the different types of template variables.
|
||||
|
||||
@@ -251,7 +251,7 @@ For example, you can have a variable that contains all values for the `hostname`
|
||||
SELECT hostname FROM my_host
|
||||
```
|
||||
|
||||
A query can return multiple columns and Grafana will automatically create a list from them. For example, the query below will return a list with values from `hostname` and `hostname2`.
|
||||
A query can returns multiple columns and Grafana will automatically create a list from them. For example, the query below will return a list with values from `hostname` and `hostname2`.
|
||||
|
||||
```sql
|
||||
SELECT my_host.hostname, my_other_host.hostname2 FROM my_host JOIN my_other_host ON my_host.city = my_other_host.city
|
||||
@@ -350,22 +350,6 @@ WHERE
|
||||
$__unixEpochFilter(epoch_time)
|
||||
```
|
||||
|
||||
**Example region query using time and timeend columns with epoch values:**
|
||||
|
||||
> Only available in Grafana v6.6+.
|
||||
|
||||
```sql
|
||||
SELECT
|
||||
epoch_time as time,
|
||||
epoch_timeend as timeend,
|
||||
metric1 as text,
|
||||
CONCAT(tag1, ',', tag2) as tags
|
||||
FROM
|
||||
public.test_data
|
||||
WHERE
|
||||
$__unixEpochFilter(epoch_time)
|
||||
```
|
||||
|
||||
**Example query using time column of native SQL date/time data type:**
|
||||
|
||||
```sql
|
||||
@@ -382,13 +366,13 @@ WHERE
|
||||
Name | Description
|
||||
------------ | -------------
|
||||
time | The name of the date/time field. Could be a column with a native SQL date/time data type or epoch value.
|
||||
timeend | Optional name of the end date/time field. Could be a column with a native SQL date/time data type or epoch value. (Grafana v6.6+)
|
||||
timeend | Optional name of the end date/time field. Could be a column with a native SQL date/time data type or epoch value.
|
||||
text | Event description field.
|
||||
tags | Optional field name to use for event tags as a comma separated string.
|
||||
|
||||
## Alerting
|
||||
|
||||
Time series queries should work in alerting conditions. Table formatted queries are not yet supported in alert rule conditions.
|
||||
Time series queries should work in alerting conditions. Table formatted queries is not yet supported in alert rule conditions.
|
||||
|
||||
## Configure the data source with provisioning
|
||||
|
||||
|
||||
@@ -49,8 +49,8 @@ The autocomplete only works if the OpenTSDB suggest api is enabled.
|
||||
|
||||
## Templating queries
|
||||
|
||||
Instead of hard-coding things like server, application and sensor name in your metric queries you can use variables in their place.
|
||||
Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns make it easy to change the data
|
||||
Instead of hard-coding things like server, application and sensor name in you metric queries you can use variables in their place.
|
||||
Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns makes it easy to change the data
|
||||
being displayed in your dashboard.
|
||||
|
||||
Check out the [Templating]({{< relref "../../reference/templating.md" >}}) documentation for an introduction to the templating feature and the different
|
||||
@@ -66,10 +66,10 @@ When using OpenTSDB with a template variable of `query` type you can use followi
|
||||
Query | Description
|
||||
------------ | -------------
|
||||
*metrics(prefix)* | Returns metric names with specific prefix (can be empty)
|
||||
*tag_names(cpu)* | Returns tag names (i.e. keys) for a specific cpu metric
|
||||
*tag_values(cpu, hostname)* | Returns tag values for metric cpu and tag key hostname
|
||||
*suggest_tagk(prefix)* | Returns tag names (i.e. keys) for all metrics with specific prefix (can be empty)
|
||||
*suggest_tagv(prefix)* | Returns tag values for all metrics with specific prefix (can be empty)
|
||||
*tag_names(cpu)* | Return tag names (i.e. keys) for a specific cpu metric
|
||||
*tag_values(cpu, hostname)* | Return tag values for metric cpu and tag key hostname
|
||||
*suggest_tagk(prefix)* | Return tag names (i.e. keys) for all metrics with specific prefix (can be empty)
|
||||
*suggest_tagv(prefix)* | Return tag values for all metrics with specific prefix (can be empty)
|
||||
|
||||
If you do not see template variables being populated in `Preview of values` section, you need to enable
|
||||
`tsd.core.meta.enable_realtime_ts` in the OpenTSDB server settings. Also, to populate metadata of
|
||||
|
||||
@@ -11,6 +11,8 @@ weight = 7
|
||||
|
||||
# Using PostgreSQL in Grafana
|
||||
|
||||
> NOTE: In **9.5.18, 9.4.23, 9.6.14, 10.9, 11.4, 12-beta2** versions of PostgreSQL has a [bug](https://www.postgresql.org/message-id/flat/28827.1561082086%40sss.pgh.pa.us#df2287bd7481153984bef6bab40af0db) which prevents execution of multiple column modifications via `ALTER TABLE` statement. Because Grafana uses it during initial database set up and since PostgreSQL has [fixed](https://github.com/postgres/postgres/commit/f946a409143d01951411382fbc3c91c7eb640094) this issue, Grafana **does not support these versions**
|
||||
|
||||
Grafana ships with a built-in PostgreSQL data source plugin that allows you to query and visualize data from a PostgreSQL compatible database.
|
||||
|
||||
## Adding the data source
|
||||
@@ -141,24 +143,24 @@ Macros can be used within a query to simplify syntax and allow for dynamic parts
|
||||
|
||||
Macro example | Description
|
||||
------------ | -------------
|
||||
*`$__time(dateColumn)`* | Will be replaced by an expression to rename the column to `time`. For example, *dateColumn as time*
|
||||
*`$__timeSec(dateColumn)`* | Will be replaced by an expression to rename the column to `time` and converting the value to Unix timestamp. For example, *extract(epoch from dateColumn) as time*
|
||||
*`$__timeFilter(dateColumn)`* | Will be replaced by a time range filter using the specified column name. For example, *dateColumn BETWEEN '2017-04-21T05:01:17Z' AND '2017-04-21T05:06:17Z'*
|
||||
*`$__timeFrom()`* | Will be replaced by the start of the currently active time selection. For example, *'2017-04-21T05:01:17Z'*
|
||||
*`$__timeTo()`* | Will be replaced by the end of the currently active time selection. For example, *'2017-04-21T05:06:17Z'*
|
||||
*`$__timeGroup(dateColumn,'5m')`* | Will be replaced by an expression usable in a GROUP BY clause. For example, *(extract(epoch from dateColumn)/300)::bigint*300*
|
||||
*`$__timeGroup(dateColumn,'5m', 0)`* | Same as above but with a fill parameter so missing points in that series will be added by Grafana and 0 will be used as the value.
|
||||
*`$__timeGroup(dateColumn,'5m', NULL)`* | Same as above but NULL will be used as value for missing points.
|
||||
*`$__timeGroup(dateColumn,'5m', previous)`* | Same as above but the previous value in that series will be used as fill value. If no value has been seen yet, NULL will be used (only available in Grafana 5.3+).
|
||||
*`$__timeGroupAlias(dateColumn,'5m')`* | Will be replaced with an expression identical to $__timeGroup, but with an added column alias (only available in Grafana 5.3+).
|
||||
*`$__unixEpochFilter(dateColumn)`* | Will be replaced by a time range filter using the specified column name with times represented as Unix timestamps. For example, *dateColumn >= 1494410783 AND dateColumn <= 1494497183*
|
||||
*`$__unixEpochFrom()`* | Will be replaced by the start of the currently active time selection as Unix timestamp. For example, *1494410783*
|
||||
*`$__unixEpochTo()`* | Will be replaced by the end of the currently active time selection as Unix timestamp. For example, *1494497183*
|
||||
*`$__unixEpochNanoFilter(dateColumn)`* | Will be replaced by a time range filter using the specified column name with times represented as nanosecond timestamps. For example, *dateColumn >= 1494410783152415214 AND dateColumn <= 1494497183142514872*
|
||||
*`$__unixEpochNanoFrom()`* | Will be replaced by the start of the currently active time selection as nanosecond timestamp. For example, *1494410783152415214*
|
||||
*`$__unixEpochNanoTo()`* | Will be replaced by the end of the currently active time selection as Unix timestamp. For example, *1494497183142514872*
|
||||
*`$__unixEpochGroup(dateColumn,'5m', [fillmode])`* | Same as $__timeGroup, but for times stored as Unix timestamp (only available in Grafana 5.3+).
|
||||
*`$__unixEpochGroupAlias(dateColumn,'5m', [fillmode])`* | Same as above, but also adds a column alias (only available in Grafana 5.3+).
|
||||
*$__time(dateColumn)* | Will be replaced by an expression to rename the column to `time`. For example, *dateColumn as time*
|
||||
*$__timeSec(dateColumn)* | Will be replaced by an expression to rename the column to `time` and converting the value to Unix timestamp. For example, *extract(epoch from dateColumn) as time*
|
||||
*$__timeFilter(dateColumn)* | Will be replaced by a time range filter using the specified column name. For example, *dateColumn BETWEEN '2017-04-21T05:01:17Z' AND '2017-04-21T05:06:17Z'*
|
||||
*$__timeFrom()* | Will be replaced by the start of the currently active time selection. For example, *'2017-04-21T05:01:17Z'*
|
||||
*$__timeTo()* | Will be replaced by the end of the currently active time selection. For example, *'2017-04-21T05:06:17Z'*
|
||||
*$__timeGroup(dateColumn,'5m')* | Will be replaced by an expression usable in a GROUP BY clause. For example, *(extract(epoch from dateColumn)/300)::bigint*300*
|
||||
*$__timeGroup(dateColumn,'5m', 0)* | Same as above but with a fill parameter so missing points in that series will be added by Grafana and 0 will be used as the value.
|
||||
*$__timeGroup(dateColumn,'5m', NULL)* | Same as above but NULL will be used as value for missing points.
|
||||
*$__timeGroup(dateColumn,'5m', previous)* | Same as above but the previous value in that series will be used as fill value. If no value has been seen yet, NULL will be used (only available in Grafana 5.3+).
|
||||
*$__timeGroupAlias(dateColumn,'5m')* | Will be replaced with an expression identical to $__timeGroup, but with an added column alias (only available in Grafana 5.3+).
|
||||
*$__unixEpochFilter(dateColumn)* | Will be replaced by a time range filter using the specified column name with times represented as Unix timestamps. For example, *dateColumn >= 1494410783 AND dateColumn <= 1494497183*
|
||||
*$__unixEpochFrom()* | Will be replaced by the start of the currently active time selection as Unix timestamp. For example, *1494410783*
|
||||
*$__unixEpochTo()* | Will be replaced by the end of the currently active time selection as Unix timestamp. For example, *1494497183*
|
||||
*$__unixEpochNanoFilter(dateColumn)* | Will be replaced by a time range filter using the specified column name with times represented as nanosecond timestamps. For example, *dateColumn >= 1494410783152415214 AND dateColumn <= 1494497183142514872*
|
||||
*$__unixEpochNanoFrom()* | Will be replaced by the start of the currently active time selection as nanosecond timestamp. For example, *1494410783152415214*
|
||||
*$__unixEpochNanoTo()* | Will be replaced by the end of the currently active time selection as Unix timestamp. For example, *1494497183142514872*
|
||||
*$__unixEpochGroup(dateColumn,'5m', [fillmode])* | Same as $__timeGroup, but for times stored as Unix timestamp (only available in Grafana 5.3+).
|
||||
*$__unixEpochGroupAlias(dateColumn,'5m', [fillmode])* | Same as above, but also adds a column alias (only available in Grafana 5.3+).
|
||||
|
||||
We plan to add many more macros. If you have suggestions for what macros you would like to see, please [open an issue](https://github.com/grafana/grafana) in our GitHub repo.
|
||||
|
||||
@@ -240,7 +242,7 @@ ORDER BY time
|
||||
|
||||
## Templating
|
||||
|
||||
Instead of hard-coding things like server, application and sensor name in your metric queries you can use variables in their place. Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns make it easy to change the data being displayed in your dashboard.
|
||||
Instead of hard-coding things like server, application and sensor name in you metric queries you can use variables in their place. Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns makes it easy to change the data being displayed in your dashboard.
|
||||
|
||||
Check out the [Templating]({{< relref "../../reference/templating.md" >}}) documentation for an introduction to the templating feature and the different types of template variables.
|
||||
|
||||
@@ -352,22 +354,6 @@ WHERE
|
||||
$__unixEpochFilter(epoch_time)
|
||||
```
|
||||
|
||||
**Example region query using time and timeend columns with epoch values:**
|
||||
|
||||
> Only available in Grafana v6.6+.
|
||||
|
||||
```sql
|
||||
SELECT
|
||||
epoch_time as time,
|
||||
epoch_time_end as timeend,
|
||||
metric1 as text,
|
||||
concat_ws(', ', metric1::text, metric2::text) as tags
|
||||
FROM
|
||||
public.test_data
|
||||
WHERE
|
||||
$__unixEpochFilter(epoch_time)
|
||||
```
|
||||
|
||||
**Example query using time column of native SQL date/time data type:**
|
||||
|
||||
```sql
|
||||
@@ -384,7 +370,7 @@ WHERE
|
||||
Name | Description
|
||||
------------ | -------------
|
||||
time | The name of the date/time field. Could be a column with a native SQL date/time data type or epoch value.
|
||||
timeend | Optional name of the time end field, needs to be date/time data type. If set, then annotations are marked as regions between time and time-end. (Grafana v6.6+)
|
||||
timeend | Optional name of the time end field, needs to be date/time data type. If set, then annotations are marked as regions between time and time-end.
|
||||
text | Event description field.
|
||||
tags | Optional field name to use for event tags as a comma separated string.
|
||||
|
||||
|
||||
@@ -10,13 +10,20 @@ parent = "datasources"
|
||||
weight = 1
|
||||
+++
|
||||
|
||||
# Prometheus data source
|
||||
# Using Prometheus in Grafana
|
||||
|
||||
Grafana includes built-in support for Prometheus. This topic explains options, variables, querying, and other options specific to the Prometheus data source. Refer to [Add a data source]({{< relref "add-a-data-source.md" >}}) for instructions on how to add a data source to Grafana.
|
||||
Grafana includes built-in support for Prometheus.
|
||||
|
||||
## Prometheus settings
|
||||
## Adding the data source
|
||||
|
||||
To access Prometheus settings, click the **Configuration** (gear) icon, then click **Data Sources**, and then click **Prometheus**.
|
||||
1. Open the side menu by clicking the Grafana icon in the top header.
|
||||
2. In the side menu under the `Dashboards` link you should find a link named `Data Sources`.
|
||||
3. Click the `+ Add data source` button in the top header.
|
||||
4. Select `Prometheus` from the _Type_ dropdown.
|
||||
|
||||
> NOTE: If you're not seeing the `Data Sources` link in your side menu it means that your current user does not have the `Admin` role for the current organization.
|
||||
|
||||
## Data source options
|
||||
|
||||
| Name | Description |
|
||||
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
@@ -28,9 +35,9 @@ To access Prometheus settings, click the **Configuration** (gear) icon, then cli
|
||||
| _User_ | User name for basic authentication. |
|
||||
| _Password_ | Password for basic authentication. |
|
||||
| _Scrape interval_ | Set this to the typical scrape and evaluation interval configured in Prometheus. Defaults to 15s. |
|
||||
| _Custom Query Parameters_ | Add custom parameters to the Prometheus query URL. For example `timeout`, `partial_response`, `dedup`, or `max_source_resolution`. Multiple parameters should be concatenated together with an '&'. |
|
||||
| _Custom Query Parameters_ | Add custom parameters to the Prometheus query URL. For example `timeout`, `partial_response`, `dedup` or `max_source_resolution`. Multiple parameters should be concatenated together with an '&'. |
|
||||
|
||||
## Prometheus query editor
|
||||
## Query editor
|
||||
|
||||
Open a graph in edit mode by click the title > Edit (or by pressing `e` key while hovering over panel).
|
||||
|
||||
@@ -40,7 +47,7 @@ Open a graph in edit mode by click the title > Edit (or by pressing `e` key whil
|
||||
| Name | Description |
|
||||
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| _Query expression_ | Prometheus query expression, check out the [Prometheus documentation](http://prometheus.io/docs/querying/basics/). |
|
||||
| _Legend format_ | Controls the name of the time series, using name or pattern. For example `{{hostname}}` is replaced with the label value for the label `hostname`. |
|
||||
| _Legend format_ | Controls the name of the time series, using name or pattern. For example `{{hostname}}` will be replaced with label value for the label `hostname`. |
|
||||
| _Min step_ | An additional lower limit for the [`step` parameter of Prometheus range queries](https://prometheus.io/docs/prometheus/latest/querying/api/#range-queries) and for the `$__interval` variable. The limit is absolute and not modified by the _Resolution_ setting. |
|
||||
| _Resolution_ | `1/1` sets both the `$__interval` variable and the [`step` parameter of Prometheus range queries](https://prometheus.io/docs/prometheus/latest/querying/api/#range-queries) such that each pixel corresponds to one data point. For better performance, lower resolutions can be picked. `1/2` only retrieves a data point for every other pixel, and `1/10` retrieves one data point per 10 pixels. Note that both _Min time interval_ and _Min step_ limit the final value of `$__interval` and `step`. |
|
||||
| _Metric lookup_ | Search for metric names in this input field. |
|
||||
@@ -48,14 +55,15 @@ Open a graph in edit mode by click the title > Edit (or by pressing `e` key whil
|
||||
| _Instant_ | Perform an "instant" query, to return only the latest value that Prometheus has scraped for the requested time series. Instant queries return results much faster than normal range queries. Use them to look up label sets. |
|
||||
| _Min time interval_| This value multiplied by the denominator from the _Resolution_ setting sets a lower limit to both the `$__interval` variable and the [`step` parameter of Prometheus range queries](https://prometheus.io/docs/prometheus/latest/querying/api/#range-queries). Defaults to _Scrape interval_ as set in the data source options. |
|
||||
|
||||
> **Note:** Grafana modifies the request dates for queries to align them with the dynamically calculated step. This ensures consistent display of metrics data, but it can result in a small gap of data at the right edge of a graph.
|
||||
> NOTE: Grafana slightly modifies the request dates for queries to align them with the dynamically calculated step.
|
||||
> This ensures consistent display of metrics data but can result in a small gap of data at the right edge of a graph.
|
||||
|
||||
### Instant queries
|
||||
|
||||
The Prometheus data source allows you to run "instant" queries, which query only the latest value.
|
||||
The Prometheus datasource allows you to run "instant" queries, which queries only the latest value.
|
||||
You can visualize the results in a table panel to see all available labels of a timeseries.
|
||||
|
||||
Instant query results are made up only of one data point per series but can be shown in the graph panel with the help of [series overrides]({{< relref "../panels/graph/#series-overrides" >}}).
|
||||
Instant query results are made up only of one datapoint per series but can be shown in the graph panel with the help of [series overrides]({{< relref "../panels/graph/#series-overrides" >}}).
|
||||
To show them in the graph as a latest value point, add a series override and select `Points > true`.
|
||||
To show a horizontal line across the whole graph, add a series override and select `Transform > constant`.
|
||||
|
||||
@@ -64,7 +72,7 @@ To show a horizontal line across the whole graph, add a series override and sele
|
||||
## Templating
|
||||
|
||||
Instead of hard-coding things like server, application and sensor name in your metric queries, you can use variables in their place.
|
||||
Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns make it easy to change the data
|
||||
Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns makes it easy to change the data
|
||||
being displayed in your dashboard.
|
||||
|
||||
Check out the [Templating]({{< relref "../../reference/templating.md" >}}) documentation for an introduction to the templating feature and the different
|
||||
@@ -83,20 +91,20 @@ provides the following functions you can use in the `Query` input field.
|
||||
| _metrics(metric)_ | Returns a list of metrics matching the specified `metric` regex. |
|
||||
| _query_\__result(query)_ | Returns a list of Prometheus query result for the `query`. |
|
||||
|
||||
For details of what _metric names_, _label names_ and _label values_ are please refer to the [Prometheus documentation](http://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
|
||||
For details of _metric names_, _label names_ and _label values_ are please refer to the [Prometheus documentation](http://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
|
||||
|
||||
#### Using interval and range variables
|
||||
|
||||
> Support for `$__range`, `$__range_s` and `$__range_ms` only available from Grafana v5.3
|
||||
|
||||
You can use some global built-in variables in query variables; `$__interval`, `$__interval_ms`, `$__range`, `$__range_s` and `$__range_ms`, see [Global built-in variables]({{< relref "../../reference/templating/#global-built-in-variables" >}}) for more information. These can be convenient to use in conjunction with the `query_result` function when you need to filter variable queries since
|
||||
It's possible to use some global built-in variables in query variables; `$__interval`, `$__interval_ms`, `$__range`, `$__range_s` and `$__range_ms`, see [Global built-in variables]({{< relref "../../reference/templating/#global-built-in-variables" >}}) for more information. These can be convenient to use in conjunction with the `query_result` function when you need to filter variable queries since
|
||||
`label_values` function doesn't support queries.
|
||||
|
||||
Make sure to set the variable's `refresh` trigger to be `On Time Range Change` to get the correct instances when changing the time range on the dashboard.
|
||||
|
||||
**Example usage:**
|
||||
|
||||
Populate a variable with the busiest 5 request instances based on average QPS over the time range shown in the dashboard:
|
||||
Populate a variable with the the busiest 5 request instances based on average QPS over the time range shown in the dashboard:
|
||||
|
||||
```
|
||||
Query: query_result(topk(5, sum(rate(http_requests_total[$__range])) by (instance)))
|
||||
@@ -122,7 +130,7 @@ options are enabled, Grafana converts the labels from plain text to a regex comp
|
||||
|
||||
## Annotations
|
||||
|
||||
[Annotations]({{< relref "../../reference/annotations.md" >}}) allow you to overlay rich event information on top of graphs. You add annotation
|
||||
[Annotations]({{< relref "../../reference/annotations.md" >}}) allows you to overlay rich event information on top of graphs. You add annotation
|
||||
queries via the Dashboard menu / Annotations view.
|
||||
|
||||
Prometheus supports two ways to query annotations.
|
||||
@@ -132,17 +140,15 @@ Prometheus supports two ways to query annotations.
|
||||
|
||||
The step option is useful to limit the number of events returned from your query.
|
||||
|
||||
## Get Grafana metrics into Prometheus
|
||||
## Getting Grafana metrics into Prometheus
|
||||
|
||||
Grafana exposes metrics for Prometheus on the `/metrics` endpoint. We also bundle a dashboard within Grafana so you can get started viewing your metrics faster. You can import the bundled dashboard by going to the data source edit page and click the dashboard tab. There you can find a dashboard for Grafana and one for Prometheus. Import and start viewing all the metrics!
|
||||
Since 4.6.0 Grafana exposes metrics for Prometheus on the `/metrics` endpoint. We also bundle a dashboard within Grafana so you can get started viewing your metrics faster. You can import the bundled dashboard by going to the data source edit page and click the dashboard tab. There you can find a dashboard for Grafana and one for Prometheus. Import and start viewing all the metrics!
|
||||
|
||||
For detailed instructions, refer to [Internal Grafana metrics]({{< relref "../../administration/metrics.md">}}).
|
||||
## Configure the data source with provisioning
|
||||
|
||||
## Provision the Prometheus data source
|
||||
It's now possible to configure data sources using config files with Grafana's provisioning system. You can read more about how it works and all the settings you can set for data sources on the [provisioning docs page]({{< relref "../../administration/provisioning/#datasources" >}})
|
||||
|
||||
You can configure data sources using config files with Grafana's provisioning system. Read more about how it works and all the settings you can set for data sources on the [provisioning docs page]({{< relref "../../administration/provisioning/#datasources" >}})
|
||||
|
||||
Here are some provisioning examples for this data source:
|
||||
Here are some provisioning examples for this data source.
|
||||
|
||||
```yaml
|
||||
apiVersion: 1
|
||||
|
||||
@@ -27,11 +27,11 @@ Grafana ships with built-in support for Google Stackdriver. Just add it as a dat
|
||||
|
||||
> NOTE: If you're not seeing the `Data Sources` link in your side menu it means that your current user does not have the `Admin` role for the current organization.
|
||||
|
||||
| Name | Description |
|
||||
| --------------------- | ------------------------------------------------------------------------------------- |
|
||||
| _Name_ | The data source name. This is how you refer to the data source in panels and queries. |
|
||||
| _Default_ | Default data source means that it will be pre-selected for new panels. |
|
||||
| _Service Account Key_ | Service Account Key File for a GCP Project. Instructions below on how to create it. |
|
||||
| Name | Description |
|
||||
| --------------------- | ----------------------------------------------------------------------------------- |
|
||||
| _Name_ | The data source name. This is how you refer to the data source in panels and queries. |
|
||||
| _Default_ | Default data source means that it will be pre-selected for new panels. |
|
||||
| _Service Account Key_ | Service Account Key File for a GCP Project. Instructions below on how to create it. |
|
||||
|
||||
## Authentication
|
||||
|
||||
@@ -45,8 +45,8 @@ To authenticate with the Stackdriver API, you need to create a Google Cloud Plat
|
||||
|
||||
The following APIs need to be enabled first:
|
||||
|
||||
- [Monitoring API](https://console.cloud.google.com/apis/library/monitoring.googleapis.com)
|
||||
- [Cloud Resource Manager API](https://console.cloud.google.com/apis/library/cloudresourcemanager.googleapis.com)
|
||||
* [Monitoring API](https://console.cloud.google.com/apis/library/monitoring.googleapis.com)
|
||||
* [Cloud Resource Manager API](https://console.cloud.google.com/apis/library/cloudresourcemanager.googleapis.com)
|
||||
|
||||
Click on the links above and click the `Enable` button:
|
||||
|
||||
@@ -57,24 +57,24 @@ Click on the links above and click the `Enable` button:
|
||||
1. Navigate to the [APIs and Services Credentials page](https://console.cloud.google.com/apis/credentials).
|
||||
2. Click on the `Create credentials` dropdown/button and choose the `Service account key` option.
|
||||
|
||||
{{< docs-imagebox img="/img/docs/v53/stackdriver_create_service_account_button.png" class="docs-image--no-shadow" caption="Create service account button" >}}
|
||||
{{< docs-imagebox img="/img/docs/v53/stackdriver_create_service_account_button.png" class="docs-image--no-shadow" caption="Create service account button" >}}
|
||||
|
||||
3. On the `Create service account key` page, choose key type `JSON`. Then in the `Service Account` dropdown, choose the `New service account` option:
|
||||
|
||||
{{< docs-imagebox img="/img/docs/v53/stackdriver_create_service_account_key.png" class="docs-image--no-shadow" caption="Create service account key" >}}
|
||||
{{< docs-imagebox img="/img/docs/v53/stackdriver_create_service_account_key.png" class="docs-image--no-shadow" caption="Create service account key" >}}
|
||||
|
||||
4. Some new fields will appear. Fill in a name for the service account in the `Service account name` field and then choose the `Monitoring Viewer` role from the `Role` dropdown:
|
||||
|
||||
{{< docs-imagebox img="/img/docs/v53/stackdriver_service_account_choose_role.png" class="docs-image--no-shadow" caption="Choose role" >}}
|
||||
{{< docs-imagebox img="/img/docs/v53/stackdriver_service_account_choose_role.png" class="docs-image--no-shadow" caption="Choose role" >}}
|
||||
|
||||
5. Click the Create button. A JSON key file will be created and downloaded to your computer. Store this file in a secure place as it allows access to your Stackdriver data.
|
||||
6. Upload it to Grafana on the data source Configuration page. You can either upload the file or paste in the contents of the file.
|
||||
|
||||
{{< docs-imagebox img="/img/docs/v53/stackdriver_grafana_upload_key.png" class="docs-image--no-shadow" caption="Upload service key file to Grafana" >}}
|
||||
{{< docs-imagebox img="/img/docs/v53/stackdriver_grafana_upload_key.png" class="docs-image--no-shadow" caption="Upload service key file to Grafana" >}}
|
||||
|
||||
7. The file contents will be encrypted and saved in the Grafana database. Don't forget to save after uploading the file!
|
||||
|
||||
{{< docs-imagebox img="/img/docs/v53/stackdriver_grafana_key_uploaded.png" class="docs-image--no-shadow" caption="Service key file is uploaded to Grafana" >}}
|
||||
{{< docs-imagebox img="/img/docs/v53/stackdriver_grafana_key_uploaded.png" class="docs-image--no-shadow" caption="Service key file is uploaded to Grafana" >}}
|
||||
|
||||
### Using GCE Default Service Account
|
||||
|
||||
@@ -86,68 +86,58 @@ If Grafana is running on a Google Compute Engine (GCE) virtual machine, it is po
|
||||
|
||||
Read more about creating and enabling service accounts for GCE VM instances [here](https://cloud.google.com/compute/docs/access/create-enable-service-accounts-for-instances).
|
||||
|
||||
## Using the Query Editor
|
||||
## Metric Query Editor
|
||||
|
||||
The Stackdriver query editor allows you to build two types of queries - **Metric** and **Service Level Objective (SLO)**. Both types return time series data.
|
||||
{{< docs-imagebox img="/img/docs/v53/stackdriver_query_editor.png" max-width= "400px" class="docs-image--right" >}}
|
||||
|
||||
### Metric Queries
|
||||
The Stackdriver query editor allows you to select metrics, group/aggregate by labels and by time, and use filters to specify which time series you want in the results.
|
||||
|
||||
{{< docs-imagebox img="/img/docs/v70/metric-query-builder.png" max-width= "400px" class="docs-image--right" >}}
|
||||
|
||||
The metric query editor allows you to select metrics, group/aggregate by labels and by time, and use filters to specify which time series you want in the results.
|
||||
|
||||
To create a metric query, follow these steps:
|
||||
|
||||
1. Choose the option **Metrics** in the **Query Type** dropdown
|
||||
2. Choose a project from the **Project** dropdown
|
||||
3. Choose a Google Cloud Platform service from the **Service** dropdown
|
||||
4. Choose a metric from the **Metric** dropdown.
|
||||
5. Use the plus and minus icons in the filter and group by sections to add/remove filters or group by clauses. This step is optional.
|
||||
Begin by choosing a `Service` and then a metric from the `Metric` dropdown. Use the plus and minus icons in the filter and group by sections to add/remove filters or group by clauses.
|
||||
|
||||
Stackdriver metrics can be of different kinds (GAUGE, DELTA, CUMULATIVE) and these kinds have support for different aggregation options (reducers and aligners). The Grafana query editor shows the list of available aggregation methods for a selected metric and sets a default reducer and aligner when you select the metric. Units for the Y-axis are also automatically selected by the query editor.
|
||||
|
||||
#### Filter
|
||||
### Filter
|
||||
|
||||
To add a filter, click the plus icon and choose a field to filter by and enter a filter value e.g. `instance_name = grafana-1`. You can remove the filter by clicking on the filter name and select `--remove filter--`.
|
||||
|
||||
##### Simple wildcards
|
||||
#### Simple wildcards
|
||||
|
||||
When the operator is set to `=` or `!=` it is possible to add wildcards to the filter value field. E.g `us-*` will capture all values that starts with "us-" and `*central-a` will capture all values that ends with "central-a". `*-central-*` captures all values that has the substring of -central-. Simple wildcards are less expensive than regular expressions.
|
||||
|
||||
##### Regular expressions
|
||||
#### Regular expressions
|
||||
|
||||
When the operator is set to `=~` or `!=~` it is possible to add regular expressions to the filter value field. E.g `us-central[1-3]-[af]` would match all values that starts with "us-central", is followed by a number in the range of 1 to 3, a dash and then either an "a" or an "f". Leading and trailing slashes are not needed when creating regular expressions.
|
||||
|
||||
#### Aggregation
|
||||
### Aggregation
|
||||
|
||||
The aggregation field lets you combine time series based on common statistics. Read more about this option [here](https://cloud.google.com/monitoring/charts/metrics-selector#aggregation-options).
|
||||
|
||||
The `Aligner` field allows you to align multiple time series after the same group by time interval. Read more about how it works [here](https://cloud.google.com/monitoring/charts/metrics-selector#alignment).
|
||||
|
||||
##### Alignment Period/Group by Time
|
||||
#### Alignment Period/Group by Time
|
||||
|
||||
The `Alignment Period` groups a metric by time if an aggregation is chosen. The default is to use the GCP Stackdriver default groupings (which allows you to compare graphs in Grafana with graphs in the Stackdriver UI).
|
||||
The option is called `Stackdriver auto` and the defaults are:
|
||||
|
||||
- 1m for time ranges < 23 hours
|
||||
- 5m for time ranges >= 23 hours and < 6 days
|
||||
- 1h for time ranges >= 6 days
|
||||
* 1m for time ranges < 23 hours
|
||||
* 5m for time ranges >= 23 hours and < 6 days
|
||||
* 1h for time ranges >= 6 days
|
||||
|
||||
The other automatic option is `Grafana auto`. This will automatically set the group by time depending on the time range chosen and the width of the graph panel. Read more about the details [here](http://docs.grafana.org/reference/templating/#the-interval-variable).
|
||||
|
||||
It is also possible to choose fixed time intervals to group by, like `1h` or `1d`.
|
||||
|
||||
#### Group By
|
||||
### Group By
|
||||
|
||||
Group by resource or metric labels to reduce the number of time series and to aggregate the results by a group by. E.g. Group by instance_name to see an aggregated metric for a Compute instance.
|
||||
|
||||
##### Metadata labels
|
||||
#### Metadata labels
|
||||
|
||||
Resource metadata labels contain information to uniquely identify a resource in Google Cloud. Metadata labels are only returned in the time series response if they're part of the **Group By** segment in the time series request. There's no API for retrieving metadata labels, so it's not possible to populate the group by dropdown with the metadata labels that are available for the selected service and metric. However, the **Group By** field dropdown comes with a pre-defined list of common system labels.
|
||||
Resource metadata labels contains information to uniquely identify a resource in Google cloud. Metadata labels are only returned in the time series response if they're part of the **Group By** segment in the time series request. There's no API for retrieving metadata labels, so it's not possible to populate the group by dropdown with the metadata labels that are available for the selected service and metric. However, the **Group By** field dropdown comes with a pre-defined list of common system labels.
|
||||
|
||||
User labels cannot be pre-defined, but it's possible to enter them manually in the **Group By** field. If a metadata label, user label or system label is included in the **Group By** segment, then you can create filters based on it and expand its value on the **Alias** field.
|
||||
|
||||
#### Alias patterns
|
||||
### Alias Patterns
|
||||
|
||||
The Alias By field allows you to control the format of the legend keys. The default is to show the metric name and labels. This can be long and hard to read. Using the following patterns in the alias field, you can format the legend key the way you want it.
|
||||
|
||||
@@ -163,10 +153,10 @@ The Alias By field allows you to control the format of the legend keys. The defa
|
||||
|
||||
In the Group By dropdown, you can see a list of metric and resource labels for a metric. These can be included in the legend key using alias patterns.
|
||||
|
||||
| Alias Pattern Format | Description | Alias Pattern Example | Example Result |
|
||||
| -------------------------------- | ---------------------------------------- | --------------------------------- | ---------------- |
|
||||
| `{{metric.label.xxx}}` | returns the metric label value | `{{metric.label.instance_name}}` | `grafana-1-prod` |
|
||||
| `{{resource.label.xxx}}` | returns the resource label value | `{{resource.label.zone}}` | `us-east1-b` |
|
||||
| Alias Pattern Format | Description | Alias Pattern Example | Example Result |
|
||||
| ------------------------ | -------------------------------- | -------------------------------- | ---------------- |
|
||||
| `{{metric.label.xxx}}` | returns the metric label value | `{{metric.label.instance_name}}` | `grafana-1-prod` |
|
||||
| `{{resource.label.xxx}}` | returns the resource label value | `{{resource.label.zone}}` | `us-east1-b` |
|
||||
| `{{metadata.system_labels.xxx}}` | returns the meta data system label value | `{{metadata.system_labels.name}}` | `grafana` |
|
||||
| `{{metadata.user_labels.xxx}}` | returns the meta data user label value | `{{metadata.user_labels.tag}}` | `production` |
|
||||
|
||||
@@ -184,51 +174,10 @@ Example Alias By: `{{resource.type}} - {{metric.type}}`
|
||||
|
||||
Example Result: `gce_instance - compute.googleapis.com/instance/cpu/usage_time`
|
||||
|
||||
### SLO (Service Level Objective) queries
|
||||
|
||||
> Only available in Grafana v7.0+
|
||||
|
||||
{{< docs-imagebox img="/img/docs/v70/slo-query-builder.png" max-width= "400px" class="docs-image--right" >}}
|
||||
|
||||
The SLO query builder in the Stackdriver data source allows you to display SLO data in time series format. To get an understanding of the basic concepts in service monitoring, please refer to Google Stackdriver's [official docs](https://cloud.google.com/monitoring/service-monitoring).
|
||||
|
||||
#### How to create an SLO query
|
||||
|
||||
To create an SLO query, follow these steps:
|
||||
|
||||
1. Choose the option **Service Level Objectives (SLO)** in the **Query Type** dropdown.
|
||||
2. Choose a project from the **Project** dropdown.
|
||||
3. Choose an [SLO service](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services) from the **Service** dropdown.
|
||||
4. Choose an [SLO](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services.serviceLevelObjectives) from the **SLO** dropdown.
|
||||
5. Choose a [time series selector](https://cloud.google.com/monitoring/service-monitoring/timeseries-selectors#ts-selector-list) from the **Selector** dropdown.
|
||||
|
||||
The friendly names for the time series selectors are shown in Grafana. Here is the mapping from the friendly name to the system name that is used in the Service Monitoring documentation:
|
||||
|
||||
| Selector dropdown value | Corresponding time series selector used |
|
||||
| -------------------------- | --------------------------------------- |
|
||||
| SLI Value | select_slo_health |
|
||||
| SLO Compliance | select_slo_compliance |
|
||||
| SLO Error Budget Remaining | select_slo_budget_fraction |
|
||||
|
||||
#### Alias Patterns for SLO queries
|
||||
|
||||
The Alias By field allows you to control the format of the legend keys for SLO queries too.
|
||||
|
||||
| Alias Pattern | Description | Example Result |
|
||||
| -------------- | ---------------------------- | ------------------- |
|
||||
| `{{project}}` | returns the GCP project name | `myProject` |
|
||||
| `{{service}}` | returns the service name | `myService` |
|
||||
| `{{slo}}` | returns the SLO | `latency-slo` |
|
||||
| `{{selector}}` | returns the selector | `select_slo_health` |
|
||||
|
||||
#### Alignment Period/Group by Time for SLO queries
|
||||
|
||||
SLO queries use the same [alignment period functionality as metric queries]({{< relref "#metric-queries" >}}).
|
||||
|
||||
## Templating
|
||||
|
||||
Instead of hard-coding things like server, application and sensor name in you metric queries you can use variables in their place.
|
||||
Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns make it easy to change the data
|
||||
Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns makes it easy to change the data
|
||||
being displayed in your dashboard.
|
||||
|
||||
Check out the [Templating]({{< relref "../../reference/templating.md" >}}) documentation for an introduction to the templating feature and the different
|
||||
@@ -236,27 +185,24 @@ types of template variables.
|
||||
|
||||
### Query Variable
|
||||
|
||||
Variable of the type _Query_ allows you to query Stackdriver for various types of data. The Stackdriver data source plugin provides the following `Query Types`.
|
||||
Variable of the type *Query* allows you to query Stackdriver for various types of data. The Stackdriver data source plugin provides the following `Query Types`.
|
||||
|
||||
| Name | Description |
|
||||
| -------------------------------- | ------------------------------------------------------------------------------------------------- |
|
||||
| _Metric Types_ | Returns a list of metric type names that are available for the specified service. |
|
||||
| _Labels Keys_ | Returns a list of keys for `metric label` and `resource label` in the specified metric. |
|
||||
| _Labels Values_ | Returns a list of values for the label in the specified metric. |
|
||||
| _Resource Types_ | Returns a list of resource types for the the specified metric. |
|
||||
| _Aggregations_ | Returns a list of aggregations (cross series reducers) for the the specified metric. |
|
||||
| _Aligners_ | Returns a list of aligners (per series aligners) for the the specified metric. |
|
||||
| _Alignment periods_ | Returns a list of all alignment periods that are available in Stackdriver query editor in Grafana |
|
||||
| _Selectors_ | Returns a list of selectors that can be used in SLO (Service Level Objectives) queries |
|
||||
| _SLO Services_ | Returns a list of Service Monitoring services that can be used in SLO queries |
|
||||
| _Service Level Objectives (SLO)_ | Returns a list of SLO's for the specified SLO service |
|
||||
| Name | Description |
|
||||
| ------------------- | ------------------------------------------------------------------------------------------------- |
|
||||
| *Metric Types* | Returns a list of metric type names that are available for the specified service. |
|
||||
| *Labels Keys* | Returns a list of keys for `metric label` and `resource label` in the specified metric. |
|
||||
| *Labels Values* | Returns a list of values for the label in the specified metric. |
|
||||
| *Resource Types* | Returns a list of resource types for the the specified metric. |
|
||||
| *Aggregations* | Returns a list of aggregations (cross series reducers) for the the specified metric. |
|
||||
| *Aligners* | Returns a list of aligners (per series aligners) for the the specified metric. |
|
||||
| *Alignment periods* | Returns a list of all alignment periods that are available in Stackdriver query editor in Grafana |
|
||||
|
||||
### Using variables in queries
|
||||
|
||||
There are two syntaxes:
|
||||
|
||||
- `$<varname>` Example: `metric.label.$metric_label`
|
||||
- `[[varname]]` Example: `metric.label.[[metric_label]]`
|
||||
* `$<varname>` Example: `metric.label.$metric_label`
|
||||
* `[[varname]]` Example: `metric.label.[[metric_label]]`
|
||||
|
||||
Why two ways? The first syntax is easier to read and write but does not allow you to use a variable in the middle of a word. When the _Multi-value_ or _Include all value_ options are enabled, Grafana converts the labels from plain text to a regex compatible string, which means you have to use `=~` instead of `=`.
|
||||
|
||||
@@ -264,7 +210,7 @@ Why two ways? The first syntax is easier to read and write but does not allow yo
|
||||
|
||||
{{< docs-imagebox img="/img/docs/v53/stackdriver_annotations_query_editor.png" max-width= "400px" class="docs-image--right" >}}
|
||||
|
||||
[Annotations]({{< relref "../../reference/annotations.md" >}}) allow you to overlay rich event information on top of graphs. You add annotation
|
||||
[Annotations]({{< relref "../../reference/annotations.md" >}}) allows you to overlay rich event information on top of graphs. You add annotation
|
||||
queries via the Dashboard menu / Annotations view. Annotation rendering is expensive so it is important to limit the number of rows returned. There is no support for showing Stackdriver annotations and events yet but it works well with [custom metrics](https://cloud.google.com/monitoring/custom-metrics/) in Stackdriver.
|
||||
|
||||
With the query editor for annotations, you can select a metric and filters. The `Title` and `Text` fields support templating and can use data returned from the query. For example, the Title field could have the following text:
|
||||
|
||||
@@ -13,7 +13,7 @@ weight = 20
|
||||
|
||||
The purpose of this data source is to make it easier to create fake data for any panel.
|
||||
Using `TestData DB` you can build your own time series and have any panel render it.
|
||||
This makes it much easier to verify functionality since the data can be shared very easily.
|
||||
This make is much easier to verify functionally since the data can be shared very easily.
|
||||
|
||||
## Enable
|
||||
|
||||
|
||||
@@ -11,23 +11,25 @@ weight = 5
|
||||
|
||||
# Explore
|
||||
|
||||
Grafana's dashboard UI is all about building dashboards for visualization. Explore strips away all the dashboard and panel options so that you can focus on the query. Iterate until you have a working query and then think about building a dashboard.
|
||||
|
||||
> Explore is only available in Grafana 6.0 and above.
|
||||
|
||||
## Introduction
|
||||
|
||||
One of the major new features of Grafana 6.0 is the new query-focused Explore workflow for troubleshooting and/or for data exploration.
|
||||
|
||||
Grafana's dashboard UI is all about building dashboards for visualization. Explore strips away all the dashboard and panel options so that you can focus on the query. Iterate until you have a working query and then think about building a dashboard.
|
||||
|
||||
For infrastructure monitoring and incident response, you no longer need to switch to other tools to debug what went wrong. Explore allows you to dig deeper into your metrics and logs to find the cause. Grafana's new logging data source, [Loki](https://github.com/grafana/loki) is tightly integrated into Explore and allows you to correlate metrics and logs by viewing them side-by-side. This creates a new debugging workflow where you can:
|
||||
|
||||
1. Receive an alert
|
||||
1. Drill down and examine metrics
|
||||
1. Drill down again and search logs related to the metric and time interval (and in the future, distributed traces).
|
||||
2. Drill down and examine metrics
|
||||
3. Drill down again and search logs related to the metric and time interval (and in the future, distributed traces).
|
||||
|
||||
If you just want to explore your data and do not want to create a dashboard then Explore makes this much easier. Explore will show the results as both a graph and a table enabling you to see trends in the data and more detail at the same time (if the data source supports both graph and table data).
|
||||
|
||||
## Start exploring
|
||||
## How to Start Exploring
|
||||
|
||||
> **Note:** By default, users with the Viewer role cannot edit and do not have access to Explore. Refer to [Organization roles](https://grafana.com/docs/grafana/latest/permissions/organization_roles/) for more information about what each role has access to.
|
||||
|
||||
There is an Explore icon on the menu bar to the left. This opens an empty Explore tab.
|
||||
There is a new Explore icon on the menu bar to the left. This opens a new empty Explore tab.
|
||||
|
||||
{{< docs-imagebox img="/img/docs/v65/explore_menu.png" class="docs-image--no-shadow" caption="Screenshot of the new Explore Icon" >}}
|
||||
|
||||
@@ -39,7 +41,7 @@ Choose your data source in the dropdown in the top left. Prometheus has a custom
|
||||
|
||||
The query field is where you can write your query and explore your data. There are three buttons beside the query field, a clear button (X), an add query button (+) and the remove query button (-). Just like the normal query editor, you can add and remove multiple queries.
|
||||
|
||||
## Split and compare
|
||||
## Split and Compare
|
||||
|
||||
The Split feature is an easy way to compare graphs and tables side-by-side or to look at related data together on one page. Click the split button to duplicate the current query and split the page into two side-by-side queries. It is possible to select another data source for the new query which for example, allows you to compare the same query for two different servers or to compare the staging environment to the production environment.
|
||||
|
||||
@@ -49,76 +51,17 @@ In split view, timepickers for both panels can be linked (if you change one, the
|
||||
|
||||
You can close the newly created query by clicking on the Close Split button.
|
||||
|
||||
## Query history
|
||||
|
||||
Query history is a list of queries that you have used in Explore. The history is local to your browser and is not shared with others. To open and interact with your history, click the **Query history** button in Explore.
|
||||
|
||||
### View query history
|
||||
|
||||
Query history lets you view the history of your querying. For each individual query, you can:
|
||||
|
||||
- Run a query.
|
||||
- Create and/or edit a comment.
|
||||
- Copy a query to the clipboard.
|
||||
- Copy a URL link with the query to the clipboard.
|
||||
- Star a query.
|
||||
|
||||
### Manage favorite queries
|
||||
|
||||
All queries that have been starred in the Query history tab are displayed in the Starred. This allows you to access your favorite queries faster and to reuse these queries without typing them from scratch.
|
||||
|
||||
### Sort query history
|
||||
|
||||
By default, query history shows you the most recent queries. You can sort your history by date or by data source name in ascending or descending order.
|
||||
|
||||
1. Click the **Sort queries by** field.
|
||||
2. Select one of the following options:
|
||||
- Newest first
|
||||
- Oldest first
|
||||
- Data source A-Z
|
||||
- Data source Z-A
|
||||
|
||||
> Note: If you are in split mode, then the chosen sorting mode applies only to the active panel.
|
||||
|
||||
### Filter query history
|
||||
|
||||
Filter query history in Query history and Starred tab by data source name:
|
||||
|
||||
1. Click the **Filter queries for specific data source(s)** field
|
||||
2. Select the data source for which you would like to filter your history. You can select multiple data sources.
|
||||
|
||||
In **Query history** tab it is also possible to filter queries by date using the slider:
|
||||
|
||||
- Use vertical slider to filter queries by date.
|
||||
- By dragging top handle, adjust start date.
|
||||
- By dragging top handle, adjust end date.
|
||||
|
||||
> Note: If you are in split mode, filters are applied only to your currently active panel.
|
||||
|
||||
### Query history settings
|
||||
|
||||
You can customize the query history in the Settings tab. Options are described in the table below.
|
||||
|
||||
| Setting | Default value |
|
||||
| ------------------------------------------------------------- | --------------------------------------- |
|
||||
| Period of time for which Grafana will save your query history | 1 week |
|
||||
| Change the default active tab | Query history tab |
|
||||
| Only show queries for datasource currently active in Explore | False |
|
||||
| Clear query history | Permanently deletes all stored queries. |
|
||||
|
||||
> Note: Query history settings are global, and applied to both panels in split mode.
|
||||
|
||||
## Prometheus-specific Features
|
||||
|
||||
The first version of Explore features a custom querying experience for Prometheus. When a query is executed, it actually executes two queries, a normal Prometheus query for the graph and an Instant Query for the table. An Instant Query returns the last value for each time series which shows a good summary of the data shown in the graph.
|
||||
|
||||
### Metrics explorer
|
||||
### Metrics Explorer
|
||||
|
||||
On the left-hand side of the query field is a `Metrics` button, clicking on this opens the Metric Explorer. This shows a hierarchical menu with metrics grouped by their prefix. For example, all the Alert Manager metrics will be grouped under the `alertmanager` prefix. This is a good starting point if you just want to explore which metrics are available.
|
||||
|
||||
{{< docs-imagebox img="/img/docs/v65/explore_metric_explorer.png" class="docs-image--no-shadow" caption="Screenshot of the new Explore option in the panel menu" >}}
|
||||
|
||||
### Query field
|
||||
### Query Field
|
||||
|
||||
The Query field supports autocomplete for metric names, function and works mostly the same way as the standard Prometheus query editor. Press the enter key to execute a query.
|
||||
|
||||
@@ -126,18 +69,17 @@ The autocomplete menu can be trigger by pressing Ctrl+Space. The Autocomplete me
|
||||
|
||||
Suggestions can appear under the query field - click on them to update your query with the suggested change.
|
||||
|
||||
- For counters (monotonically increasing metrics), a rate function will be suggested.
|
||||
- For buckets, a histogram function will be suggested.
|
||||
- For recording rules, possible to expand the rules.
|
||||
* For counters (monotonically increasing metrics), a rate function will be suggested.
|
||||
* For buckets, a histogram function will be suggested.
|
||||
* For recording rules, possible to expand the rules.
|
||||
|
||||
### Table filters
|
||||
### Table Filters
|
||||
|
||||
Click on the filter button <span title="Filter for label" class="logs-label__icon fa fa-search-plus"></span> in a labels column in the Table panel to add filters to the query expression. This works with multiple queries too - the filter will be added for all the queries.
|
||||
|
||||
## Logs integration
|
||||
## Logs Integration
|
||||
|
||||
Along with metrics, Explore allows you to investigate your logs with the following data sources:
|
||||
|
||||
- [Loki](../datasources/loki)
|
||||
- [InfluxDB](../datasources/influxdb)
|
||||
- [Elasticsearch](../datasources/elasticsearch)
|
||||
@@ -150,9 +92,9 @@ You can customize how logs are displayed and select which columns are shown.
|
||||
|
||||
Log data can be very repetitive and Explore can help by hiding duplicate log lines. There are a few different deduplication algorithms that you can use:
|
||||
|
||||
- `exact` Exact matches are done on the whole line, except for date fields.
|
||||
- `numbers` Matches on the line after stripping out numbers (durations, IP addresses etc.).
|
||||
- `signature` The most aggressive deduping - strips all letters and numbers, and matches on the remaining whitespace and punctuation.
|
||||
* `exact` Exact matches are done on the whole line, except for date fields.
|
||||
* `numbers` Matches on the line after stripping out numbers (durations, IP addresses etc.).
|
||||
* `signature` The most aggressive deduping - strips all letters and numbers, and matches on the remaining whitespace and punctuation.
|
||||
|
||||
#### Time
|
||||
|
||||
@@ -166,7 +108,7 @@ Shows or hides the unique labels column that includes only non-common labels. Al
|
||||
|
||||
Set this to True if you want the display to use line wrapping. If set to False, it will result in horizontal scrolling.
|
||||
|
||||
### Labels and parsed fields
|
||||
### Labels and Parsed fields
|
||||
|
||||
Each log row has an extendable area with its labels and parsed fields, for more robust interaction. For all labels we have added the ability to filter for (positive filter) and filter out (negative filter) selected labels. Each field or label also has a stats icon to display ad-hoc statistics in relation to all displayed logs.
|
||||
|
||||
@@ -176,7 +118,7 @@ As mentioned, one of the log integrations is for the new open source log aggrega
|
||||
|
||||
See [Loki's data source documentation](../datasources/loki) on how to query for log data.
|
||||
|
||||
#### Switch from metrics to logs
|
||||
#### Switching from Metrics to Logs
|
||||
|
||||
If you switch from a Prometheus query to a logs query (you can do a split first to have your metrics and logs side by side) then it will keep the labels from your query that exist in the logs and use those to query the log streams. For example, the following Prometheus query:
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ You can use links to navigate between commonly used dashboards. Links let you cr
|
||||
|
||||
Grafana supports three types of links: Dashboard Links, Panel Links, and Data Links. They are all available from your dashboard.
|
||||
|
||||
{{< docs-imagebox img="/assets/img/blog/dashboard_links.png" max-width="800px" caption="Links Supported in Grafana" >}}
|
||||
{{< docs-imagebox img="/static/assets/img/blog/dashboard_links.png" max-width="800px" caption="Links Supported in Grafana" >}}
|
||||
|
||||
## Which link should you use?
|
||||
|
||||
@@ -38,7 +38,7 @@ Once you've added a dashboard link, it appears in the upper right corner of your
|
||||
|
||||
### Add links to dashboards
|
||||
|
||||
Add links to other dashboards at the top of your current dashboard.
|
||||
Add a links to other dashboards at the top of your current dashboard.
|
||||
|
||||
1. While viewing the dashboard you want to link, click the gear at the top of the screen to open **Dashboard settings**.
|
||||
1. Click **Links** and then click **Add Dashboard Link** or **New**.
|
||||
|
||||
@@ -37,7 +37,7 @@ The Gauge is a single value panel that can repeat a gauge for every series, colu
|
||||
### Thresholds
|
||||
|
||||
Define thresholds that will set the color of either the value or the background depending on your `Color` display option. The
|
||||
thresholds are automatically sorted from lowest value to highest. The `Base` value represents minus infinity.
|
||||
thresholds are automatically sorted from lowerst value to highest. The `Base` value represents minus infinity.
|
||||
|
||||
|
||||
### Value mappings
|
||||
|
||||
@@ -97,11 +97,11 @@ For **Mode** there are three options:
|
||||
|
||||
Additional values can be shown along-side the legend names:
|
||||
|
||||
- **Min** - Minimum of all values 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 the metric query
|
||||
- **Avg** - Average of all values returned from metric query
|
||||
- **Current** - Last value returned from the metric query
|
||||
- **Total** - Sum of all values returned from the metric query
|
||||
- **Total** - Sum 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
|
||||
|
||||
@@ -15,7 +15,7 @@ weight = 4
|
||||
|
||||
> New panel only available in Grafana v4.3+
|
||||
|
||||
The Heatmap panel allows you to view histograms over time. To fully understand and use this panel you need to
|
||||
The Heatmap panel allows you to view histograms over time. To fully understand and use this panel you need
|
||||
understand what Histograms are and how they are created. Read on below to for a quick introduction to the
|
||||
term Histogram.
|
||||
|
||||
@@ -74,7 +74,7 @@ the time range `1h`. This will make the cells 1h wide on the X-axis.
|
||||
### Pre-bucketed data
|
||||
|
||||
If you have a data that is already organized into buckets you can use the `Time series buckets` data format. This format
|
||||
requires that your metric query returns regular time series and that each time series has a numeric name that represents
|
||||
requires that your metric query return regular time series and that each time series has a numeric name that represent
|
||||
the upper or lower bound of the interval.
|
||||
|
||||
There are a number of data sources supporting histogram over time like Elasticsearch (by using a Histogram bucket
|
||||
@@ -108,7 +108,7 @@ change with the bucket count.
|
||||
## Raw data vs aggregated
|
||||
|
||||
If you use the heatmap with regular time series data (not pre-bucketed). Then it's important to keep in mind that your data
|
||||
is often already aggregated by your time series backend. Most time series queries do not return raw sample data
|
||||
is often already by aggregated by your time series backend. Most time series queries do not return raw sample data
|
||||
but include a group by time interval or maxDataPoints limit coupled with an aggregation function (usually average).
|
||||
|
||||
This all depends on the time range of your query of course. But the important point is to know that the Histogram bucketing
|
||||
|
||||
@@ -33,7 +33,7 @@ The singlestat panel has a normal query editor to allow you define your exact me
|
||||
* **diff** - The difference between '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 Singlestat within the panel, and will respect the color and threshold settings for the value.
|
||||
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.
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ type = "docs"
|
||||
|
||||
{{< docs-imagebox img="/img/docs/v66/stat_panel_dark3.png" max-width="1025px" caption="Stat panel" >}}
|
||||
|
||||
The stat panel is designed to show a big single stat value with an optional graph sparkline. You can control
|
||||
The stat panel is designed to show a big single stat values with an optional graph sparkline. You can control
|
||||
background or value color using thresholds.
|
||||
|
||||
## Display options
|
||||
@@ -21,7 +21,7 @@ background or value color using thresholds.
|
||||
* `All values` - Show a separate stat for every row.
|
||||
* Calc
|
||||
* Specify calculation / reducer function. Since this panel is designed to only show a single value Grafana needs to
|
||||
know how to reduce a field's many values to a single value.
|
||||
know how to reduce a fields many values to a single value.
|
||||
* Orientation
|
||||
* If your query returns multiple series or you have set **Show** to `All values` then the visualization will repeat for every series or row. This orientation option will control in what direction it will repeat.
|
||||
* Color
|
||||
@@ -39,7 +39,7 @@ background or value color using thresholds.
|
||||
### Auto layout
|
||||
|
||||
The panel will try to auto adjust layout depending on width & height. The graph will also hide if the panel becomes
|
||||
too small.
|
||||
to small.
|
||||
|
||||
Example of stacked layout where graph is automatically hidden due to each stat being too small:
|
||||
|
||||
@@ -66,7 +66,7 @@ Example of value color mode:
|
||||
### Thresholds
|
||||
|
||||
Define thresholds that will set the color of either the value or the background depending on your `Color` display option. The
|
||||
thresholds are automatically sorted from lowest value to highest. The `Base` value represents minus infinity.
|
||||
thresholds are automatically sorted from lowerst value to highest. The `Base` value represents minus infinity.
|
||||
|
||||
|
||||
### Value mappings
|
||||
|
||||
@@ -96,15 +96,15 @@ Here are some of the TSDBs supported by Grafana:
|
||||
- [InfluxDB](https://www.influxdata.com/products/influxdb-overview/)
|
||||
- [Prometheus](https://prometheus.io/)
|
||||
|
||||
```
|
||||
weather,location=us-midwest temperature=82 1465839830100400200
|
||||
| -------------------- -------------- |
|
||||
| | | |
|
||||
| | | |
|
||||
+-----------+--------+-+---------+-+---------+
|
||||
|measurement|,tag_set| |field_set| |timestamp|
|
||||
+-----------+--------+-+---------+-+---------+
|
||||
```
|
||||
```
|
||||
weather,location=us-midwest temperature=82 1465839830100400200
|
||||
| -------------------- -------------- |
|
||||
| | | |
|
||||
| | | |
|
||||
+-----------+--------+-+---------+-+---------+
|
||||
|measurement|,tag_set| |field_set| |timestamp|
|
||||
+-----------+--------+-+---------+-+---------+
|
||||
```
|
||||
|
||||
### Collecting time series data
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ We also deprecated the `[dashboard.json]` in favor of our new dashboard provisio
|
||||
in sync with dashboards in Grafana's database. The dashboard provisioner has multiple advantages over the old
|
||||
`[dashboard.json]` feature. Instead of storing the dashboard in memory we now insert the dashboard into the database,
|
||||
which makes it possible to star them, use one as the home dashboard, set permissions and other features in Grafana that
|
||||
expects the dashboards to exist in the database. More info in the [dashboard provisioning docs]({{< relref "../administration/provisioning.md" >}})
|
||||
expects the dashboards to exist in the database. More info in the [dashboard provisioning docs](/administration/provisioning/#dashboards)
|
||||
|
||||
|
||||
## Graphite Tags and Integrated Function Docs
|
||||
|
||||
@@ -20,7 +20,7 @@ Grafana 6.7 comes with a lot of new features and enhancements:
|
||||
- **Data source:** Google Sheets data source
|
||||
- [**Explore:** Query history]({{< relref "#query-history" >}})
|
||||
- [**Authorization:** Azure OAuth]({{< relref "#azure-oauth" >}})
|
||||
- [**Stackdriver:** Project Selector]({{< relref "#stackdriver-project-selector" >}})
|
||||
- [**Stackdriver:** Project Selector]({{< relref "#project-selector" >}})
|
||||
- [**Enterprise:** White Labeling for application title]({{< relref "#white-labeling-for-application-title" >}})
|
||||
- [**Enterprise:** Reporting configuration for timeout and concurrency]({{< relref "#reporting-configuration-for-timeout-and-concurrency" >}})
|
||||
- [**Enterprise:** Export dashboard as pdf]({{< relref "#export-dashboard-as-pdf" >}})
|
||||
@@ -29,38 +29,33 @@ Grafana 6.7 comes with a lot of new features and enhancements:
|
||||
|
||||
## General features
|
||||
|
||||
General features are included in all Grafana editions.
|
||||
|
||||
### Query history
|
||||
> BETA: Query history is a beta feature. It is local to your browser and is not shared with others.
|
||||
|
||||
Query history is a new feature that lets you view and interact with the queries that you have previously run in Explore. You can add queries to the Explore query editor, write comments, create and share URL links, star your favorite queries, and much more. Starred queries are displayed in Starred tab, so it is easier to reuse queries that you run often without typing them from scratch.
|
||||
Query history is a new feature that lets you view and interact with the queries that you have previously run in Explore. You can add queries to the Explore query editor, write comments, create and share URL link, star your favourite queries and much more. Starred queries are displayed in "Starred" tab as well, so it is easier to reuse queries that you run often without typing them from scratch.
|
||||
|
||||
Learn more about query history in [Explore]({{< relref "../features/explore" >}}).
|
||||
Learn more about query history in [documentation]({{< relref "../features/explore" >}}).
|
||||
|
||||
{{< docs-imagebox img="/img/docs/v67/rich-history.gif" max-width="1024px" caption="Query history" >}}
|
||||
|
||||
### Azure OAuth
|
||||
Grafana v6.7 comes with a new OAuth integration for Microsoft Azure Active Directory. You can now assign users and groups to Grafana roles from the Azure Portal. Learn how to enable and configure it in [Azure AD OAuth2 authentication]({{< relref "../auth/azuread/" >}}).
|
||||
Grafana 6.7 comes with a new OAuth integration for Microsoft Azure Active Directory. It’s possible to assign Users and Groups to Grafana roles from the Azure Portal. Learn how to enable and configure it in the [documentation]({{< relref "../auth/azuread/" >}}).
|
||||
|
||||
### Enforce minimum dashboard refresh interval
|
||||
|
||||
Allowing a low dashboard refresh interval can cause severe load on data sources and Grafana. Grafana v6.7 allows you to restrict the dashboard refresh interval so it cannot be set lower than a given interval. This provides a way for administrators to control dashboard refresh behavior on a global level.
|
||||
|
||||
Refer to min_refresh_interval in [Configuration]({{< relref "../installation/configuration#min-refresh-interval" >}}) for more information and how to enable this feature.
|
||||
|
||||
### Stackdriver project selector
|
||||
Refer to min_refresh_interval in [Configuration]({{< relref "../administration/configuration/#min-refresh-interval" >}}) for further information and how to enable this.
|
||||
|
||||
### Stackdriver Project Selector
|
||||
A Stackdriver data source in Grafana is configured for one service account only. That service account is always associated with a default project in Google Cloud Platform (GCP). Depending on your setup in GCP, the service account might be granted access to more projects than just the default project.
|
||||
|
||||
In Grafana 6.7, the query editor has been enhanced with a project selector that makes it possible to query different projects without changing datasource. Many thanks [Eraac](https://github.com/Eraac), [eliaslaouiti](https://github.com/eliaslaouiti), and [NaurisSadovskis](https://github.com/NaurisSadovskis) for making this happen!
|
||||
In Grafana 6.7, the query editor has been enhanced with a project selector that makes it possible to query different projects without changing datasource. Many thanks [Eraac](https://github.com/Eraac), [eliaslaouiti](https://github.com/eliaslaouiti) and [NaurisSadovskis](https://github.com/NaurisSadovskis) for making this happen!
|
||||
|
||||
## Grafana Enterprise features
|
||||
## Grafana enterprise features
|
||||
|
||||
General features are included in the Grafana Enterprise edition software.
|
||||
|
||||
### White labeling customizes application title
|
||||
This release adds a new white labeling option to customize the application title. Learn how to configure it in [White labeling]({{< relref "../enterprise/white-labeling/" >}}).
|
||||
### White Labeling for application title
|
||||
This release adds a new white labeling option to customize the application title. Learn how to configure it in the [documentation]({{< relref "../enterprise/white-labeling/" >}}).
|
||||
|
||||
```
|
||||
[white_labeling]
|
||||
@@ -68,9 +63,8 @@ This release adds a new white labeling option to customize the application title
|
||||
app_title = Your Company
|
||||
```
|
||||
|
||||
### Configure reporting for timeout and concurrency
|
||||
|
||||
This release adds more configuration for the reporting feature rendering requests. You can set the panel rendering request timeout and the maximum number of concurrent calls to the rendering service in your configuration. Learn how to do it in [Reporting]({{< relref "../enterprise/reporting/" >}}).
|
||||
### Reporting configuration for timeout and concurrency
|
||||
This release adds more configuration for the reporting feature rendering requests. You can set the panel rendering request timeout and the maximum number of concurrent calls to the rendering service in your configuration. Learn how to do it in the [documentation]({{< relref "../enterprise/reporting/" >}}).
|
||||
|
||||
```
|
||||
[reporting]
|
||||
@@ -80,17 +74,13 @@ rendering_timeout = 10s
|
||||
concurrent_render_limit = 10
|
||||
```
|
||||
|
||||
### Export dashboard as PDF
|
||||
|
||||
This feature allows you to export a dashboard as a PDF document. All dashboard panels will be rendered as images and added into the PDF document. Learn more in [Export dashboard as PDF]({{< relref "../enterprise/export-pdf/" >}}).
|
||||
### Export dashboard as pdf
|
||||
This feature allows you to export the dashboard as a PDF document. All dashboard panels will be rendered as images and added into the PDF document.
|
||||
|
||||
### Report landscape mode
|
||||
|
||||
You can now use either portrait or landscape mode in your reports. Portrait will render three panels per page and landscape two.
|
||||
{{< docs-imagebox img="/img/docs/enterprise/reports_create_new.png" max-width="1024px" caption="New report" >}}
|
||||
|
||||
[Reporting]({{< relref "../enterprise/reporting/" >}}) has been updated as a result of this change.
|
||||
|
||||
### Azure OAuth Team Sync support
|
||||
When setting up OAuth with Microsoft Azure AD, you can now sync Azure groups with Teams in Grafana.
|
||||
Learn more in [Team sync]({{< relref "../enterprise/team-sync/" >}}).
|
||||
When setting up OAuth with Microsoft Azure AD it’s now possible to sync Azure groups with Teams in Grafana.
|
||||
[Learn more]({{< relref "../auth/azuread/#team-sync-enterprise-only" >}}).
|
||||
|
||||
@@ -224,13 +224,10 @@ Content-Type: application/json
|
||||
"name":"User",
|
||||
"email":"user@graf.com",
|
||||
"login":"user",
|
||||
"password":"userpassword",
|
||||
"OrgId": 1
|
||||
"password":"userpassword"
|
||||
}
|
||||
```
|
||||
|
||||
Note that `OrgId` is an optional parameter that can be used to assign a new user to a different organization when [auto_assign_org](https://grafana.com/docs/grafana/latest/installation/configuration/#auto-assign-org) is set to `true`.
|
||||
|
||||
**Example Response**:
|
||||
|
||||
```http
|
||||
|
||||
@@ -28,7 +28,7 @@ that you cannot use this API for retrieving information about the General folder
|
||||
|
||||
`GET /api/folders`
|
||||
|
||||
Returns all folders that the authenticated user has permission to view. You can control the maximum number of folders returned through the `limit` query parameter, the default is 1000.
|
||||
Returns all folders that the authenticated user has permission to view.
|
||||
|
||||
**Example Request**:
|
||||
|
||||
|
||||
@@ -38,22 +38,14 @@ Content-Type: application/json
|
||||
"name": "Admin",
|
||||
"login": "admin",
|
||||
"email": "admin@mygraf.com",
|
||||
"isAdmin": true,
|
||||
"isDisabled": false,
|
||||
"lastSeenAt": "2020-04-10T20:29:27+03:00",
|
||||
"lastSeenAtAge': "2m",
|
||||
"authLabels": ["OAuth"]
|
||||
"isAdmin": true
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"name": "User",
|
||||
"login": "user",
|
||||
"email": "user@mygraf.com",
|
||||
"isAdmin": false,
|
||||
"isDisabled": false,
|
||||
"lastSeenAt": "2020-01-24T12:38:47+02:00",
|
||||
"lastSeenAtAge": "2M",
|
||||
"authLabels": []
|
||||
"isAdmin": false
|
||||
}
|
||||
]
|
||||
```
|
||||
@@ -88,22 +80,14 @@ Content-Type: application/json
|
||||
"name": "Admin",
|
||||
"login": "admin",
|
||||
"email": "admin@mygraf.com",
|
||||
"isAdmin": true,
|
||||
"isDisabled": false,
|
||||
"lastSeenAt": "2020-04-10T20:29:27+03:00",
|
||||
"lastSeenAtAge': "2m",
|
||||
"authLabels": ["OAuth"]
|
||||
"isAdmin": true
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"name": "User",
|
||||
"login": "user",
|
||||
"email": "user@mygraf.com",
|
||||
"isAdmin": false,
|
||||
"isDisabled": false,
|
||||
"lastSeenAt": "2020-01-24T12:38:47+02:00",
|
||||
"lastSeenAtAge": "2M",
|
||||
"authLabels": []
|
||||
"isAdmin": false
|
||||
}
|
||||
],
|
||||
"page": 1,
|
||||
@@ -143,8 +127,7 @@ Content-Type: application/json
|
||||
"isExternal": false,
|
||||
"authLabels": [],
|
||||
"updatedAt": "2019-09-09T11:31:26+01:00",
|
||||
"createdAt": "2019-09-09T11:31:26+01:00",
|
||||
"avatarUrl": ""
|
||||
"createdAt": "2019-09-09T11:31:26+01:00"
|
||||
}
|
||||
```
|
||||
|
||||
@@ -190,8 +173,7 @@ Content-Type: application/json
|
||||
"isExternal": false,
|
||||
"authLabels": null,
|
||||
"updatedAt": "2019-09-25T14:44:37+01:00",
|
||||
"createdAt": "2019-09-25T14:44:37+01:00",
|
||||
"avatarUrl":""
|
||||
"createdAt": "2019-09-25T14:44:37+01:00"
|
||||
}
|
||||
```
|
||||
|
||||
@@ -312,19 +294,12 @@ HTTP/1.1 200
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"id":1,
|
||||
"email":"admin@mygraf.com",
|
||||
"name":"Admin",
|
||||
"login":"admin",
|
||||
"theme":"light",
|
||||
"orgId":1,
|
||||
"isGrafanaAdmin":true,
|
||||
"isDisabled":false
|
||||
"isExternal": false,
|
||||
"authLabels": [],
|
||||
"updatedAt": "2019-09-09T11:31:26+01:00",
|
||||
"createdAt": "2019-09-09T11:31:26+01:00",
|
||||
"avatarUrl": ""
|
||||
"isGrafanaAdmin":true
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -0,0 +1,166 @@
|
||||
+++
|
||||
title = "Running Grafana behind a reverse proxy"
|
||||
description = "Guide for running Grafana behind a reverse proxy"
|
||||
keywords = ["grafana", "nginx", "documentation", "haproxy", "reverse"]
|
||||
type = "docs"
|
||||
[menu.docs]
|
||||
name = "Running Grafana behind a reverse proxy"
|
||||
parent = "tutorials"
|
||||
weight = 1
|
||||
+++
|
||||
|
||||
|
||||
# Running Grafana behind a reverse proxy
|
||||
|
||||
It should be straight forward to get Grafana up and running behind a reverse proxy. But here are some things that you might run into.
|
||||
|
||||
Links and redirects will not be rendered correctly unless you set the server.domain setting.
|
||||
```bash
|
||||
[server]
|
||||
domain = foo.bar
|
||||
```
|
||||
|
||||
To use sub *path* ex `http://foo.bar/grafana` make sure to include `/grafana` in the end of root_url.
|
||||
Otherwise Grafana will not behave correctly. See example below.
|
||||
|
||||
## Examples
|
||||
Here are some example configurations for running Grafana behind a reverse proxy.
|
||||
|
||||
### Grafana configuration (ex http://foo.bar)
|
||||
|
||||
```bash
|
||||
[server]
|
||||
domain = foo.bar
|
||||
```
|
||||
|
||||
### Nginx configuration
|
||||
|
||||
Nginx is a high performance load balancer, web server and reverse proxy: https://www.nginx.com/
|
||||
|
||||
#### Nginx configuration with HTTP and Reverse Proxy enabled
|
||||
```bash
|
||||
server {
|
||||
listen 80;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
|
||||
location / {
|
||||
proxy_pass http://localhost:3000/;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Grafana configuration with hosting HTTPS in Nginx (ex https://foo.bar)
|
||||
|
||||
```bash
|
||||
[server]
|
||||
domain = foo.bar
|
||||
root_url = https://foo.bar
|
||||
```
|
||||
|
||||
#### Nginx configuration with HTTPS, Reverse Proxy, HTTP to HTTPS redirect and URL re-writes enabled
|
||||
|
||||
Instead of http://foo.bar:3000/?orgId=1, this configuration will redirect all HTTP requests to HTTPS and re-write the URL so that port 3000 isn't visible and will result in https://foo.bar/?orgId=1
|
||||
|
||||
```bash
|
||||
server {
|
||||
listen 80;
|
||||
server_name foo.bar;
|
||||
return 301 https://foo.bar$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
server_name foo.bar;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
ssl_certificate /etc/nginx/certs/foo_bar.crt;
|
||||
ssl_certificate_key /etc/nginx/certs/foo_bar_decrypted.key;
|
||||
ssl_protocols TLSv1.2;
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
|
||||
location / {
|
||||
rewrite /(.*) /$1 break;
|
||||
proxy_pass http://localhost:3000/;
|
||||
proxy_redirect off;
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Examples with **sub path** (ex http://foo.bar/grafana)
|
||||
|
||||
#### Grafana configuration with sub path
|
||||
```bash
|
||||
[server]
|
||||
domain = foo.bar
|
||||
root_url = %(protocol)s://%(domain)s/grafana/
|
||||
```
|
||||
|
||||
#### Nginx configuration with sub path
|
||||
```bash
|
||||
server {
|
||||
listen 80;
|
||||
root /usr/share/nginx/www;
|
||||
index index.html index.htm;
|
||||
|
||||
location /grafana/ {
|
||||
proxy_pass http://localhost:3000/;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### HAProxy configuration with sub path
|
||||
```bash
|
||||
frontend http-in
|
||||
bind *:80
|
||||
use_backend grafana_backend if { path /grafana } or { path_beg /grafana/ }
|
||||
|
||||
backend grafana_backend
|
||||
# Requires haproxy >= 1.6
|
||||
http-request set-path %[path,regsub(^/grafana/?,/)]
|
||||
|
||||
# Works for haproxy < 1.6
|
||||
# reqrep ^([^\ ]*\ /)grafana[/]?(.*) \1\2
|
||||
|
||||
server grafana localhost:3000
|
||||
```
|
||||
|
||||
### IIS URL Rewrite Rule (Windows) with Subpath
|
||||
|
||||
IIS requires that the URL Rewrite module is installed.
|
||||
|
||||
Given:
|
||||
|
||||
- subpath `grafana`
|
||||
- Grafana installed on `http://localhost:3000`
|
||||
- server config:
|
||||
|
||||
```bash
|
||||
[server]
|
||||
domain = localhost:8080
|
||||
root_url = %(protocol)s://%(domain)s/grafana/
|
||||
```
|
||||
|
||||
Create an Inbound Rule for the parent website (localhost:8080 in this example) in IIS Manager with the following settings:
|
||||
|
||||
- pattern: `grafana(/)?(.*)`
|
||||
- check the `Ignore case` checkbox
|
||||
- rewrite URL set to `http://localhost:3000/{R:2}`
|
||||
- check the `Append query string` checkbox
|
||||
- check the `Stop processing of subsequent rules` checkbox
|
||||
|
||||
This is the rewrite rule that is generated in the `web.config`:
|
||||
|
||||
```xml
|
||||
<rewrite>
|
||||
<rules>
|
||||
<rule name="Grafana" enabled="true" stopProcessing="true">
|
||||
<match url="grafana(/)?(.*)" />
|
||||
<action type="Rewrite" url="http://localhost:3000/{R:2}" logRewrittenUrl="false" />
|
||||
</rule>
|
||||
</rules>
|
||||
</rewrite>
|
||||
```
|
||||
|
||||
See the [tutorial on IIS URL Rewrites](http://docs.grafana.org/tutorials/iis/) for more in-depth instructions.
|
||||
@@ -81,7 +81,8 @@ export GF_AUTH_GOOGLE_CLIENT_SECRET=newS3cretKey
|
||||
|
||||
## instance_name
|
||||
|
||||
Set the name of the grafana-server instance. Used in logging, internal metrics, and clustering info. Defaults to: `${HOSTNAME}`, which will be replaced with
|
||||
Set the name of the grafana-server instance. Used in logging and internal metrics and in
|
||||
clustering info. Defaults to: `${HOSTNAME}`, which will be replaced with
|
||||
environment variable `HOSTNAME`, if that is empty or does not exist Grafana will try to use
|
||||
system calls to get the machine name.
|
||||
|
||||
@@ -449,11 +450,6 @@ Text used as placeholder text on login page for password input.
|
||||
Grafana provides many ways to authenticate users. The docs for authentication has been split in to many different pages
|
||||
below.
|
||||
|
||||
### oauth_state_cookie_max_age
|
||||
|
||||
How long the OAuth state cookie lives before being deleted. Default is `60` (seconds)
|
||||
Administrators can increase it if they experience OAuth login state mismatch errors.
|
||||
|
||||
- [Authentication Overview]({{< relref "../auth/overview.md" >}}) (anonymous access options, hide login and more)
|
||||
- [Google OAuth]({{< relref "../auth/google.md" >}}) (auth.google)
|
||||
- [GitHub OAuth]({{< relref "../auth/github.md" >}}) (auth.github)
|
||||
@@ -510,7 +506,7 @@ Number dashboard versions to keep (per dashboard). Default: `20`, Minimum: `1`.
|
||||
|
||||
> Only available in Grafana v6.7+.
|
||||
|
||||
This will restrict users to set the refresh interval of a dashboard lower than given interval. Per default this is 5 seconds.
|
||||
When set, this will restrict users to set the refresh interval of a dashboard lower than given interval. Per default this is not set/unrestricted.
|
||||
The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. `30s` or `1m`.
|
||||
|
||||
## [dashboards.json]
|
||||
@@ -643,8 +639,6 @@ Syslog tag. By default, the process's `argv[0]` is used.
|
||||
|
||||
## [metrics]
|
||||
|
||||
For detailed instructions, refer to [Internal Grafana metrics]({{< relref "../administration/metrics.md" >}}).
|
||||
|
||||
### enabled
|
||||
Enable metrics reporting. defaults true. Available via HTTP API `/metrics`.
|
||||
|
||||
@@ -822,11 +816,6 @@ URL to a remote HTTP image renderer service, e.g. http://localhost:8081/render,
|
||||
|
||||
If the remote HTTP image renderer service runs on a different server than the Grafana server you may have to configure this to a URL where Grafana is reachable, e.g. http://grafana.domain/.
|
||||
|
||||
### concurrent_render_request_limit
|
||||
|
||||
Concurrent render request limit affects when the /render HTTP endpoint is used. Rendering many images at the same time can overload the server,
|
||||
which this setting can help protect against by only allowing a certain amount of concurrent requests.
|
||||
|
||||
## [panels]
|
||||
|
||||
### disable_sanitize_html
|
||||
@@ -840,10 +829,6 @@ is false. This settings was introduced in Grafana v6.0.
|
||||
|
||||
Set to true if you want to test alpha plugins that are not yet ready for general usage.
|
||||
|
||||
### allow_loading_unsigned_plugins
|
||||
|
||||
Enter a comma-separated list of plugin identifiers to identify plugins that are allowed to be loaded even if they lack a valid signature.
|
||||
|
||||
## [feature_toggles]
|
||||
### enable
|
||||
|
||||
@@ -859,7 +844,7 @@ for the full list. Environment variables will override any settings provided her
|
||||
|
||||
### address
|
||||
|
||||
The host:port destination for reporting spans. (ex: `localhost:6831`)
|
||||
The host:port destination for reporting spans. (ex: `localhost:6381`)
|
||||
|
||||
Can be set with the environment variables `JAEGER_AGENT_HOST` and `JAEGER_AGENT_PORT`.
|
||||
|
||||
|
||||
@@ -54,8 +54,6 @@ Grafana supports the following databases:
|
||||
|
||||
By default, Grafana installs with and uses SQLite, which is an embedded database stored in the Grafana installation location.
|
||||
|
||||
> NOTE: PostgreSQL versions 9.5.18, 9.4.23, 9.6.14, 10.9, 11.4, and 12-beta2 are affected by a bug (tracked by the PostgreSQL project as [bug #15865](https://www.postgresql.org/message-id/flat/15865-17940eacc8f8b081%40postgresql.org)) which prevents those versions from being used with Grafana. The bug has been fixed in more recent versions of PostgreSQL.
|
||||
|
||||
## Supported web browsers
|
||||
|
||||
Grafana is supported in the current version of the following browsers. Older versions of these browsers might not be supported, so you should always upgrade to the latest version when using Grafana.
|
||||
|
||||
@@ -13,7 +13,7 @@ weight = 800
|
||||
# Upgrade Grafana
|
||||
|
||||
We recommend that you upgrade Grafana often to stay up to date with the latest fixes and enhancements.
|
||||
In order to make this a reality, Grafana upgrades are backward compatible and the upgrade process is simple and quick.
|
||||
In order make this a reality, Grafana upgrades are backward compatible and the upgrade process is simple and quick.
|
||||
|
||||
Upgrading is generally safe (between many minor and one major version) and dashboards and graphs will look the same. There may be minor breaking changes in some edge cases, which are outlined in the [Release Notes](https://community.grafana.com/c/releases) and [Changelog](https://github.com/grafana/grafana/blob/master/CHANGELOG.md)
|
||||
|
||||
@@ -81,7 +81,6 @@ If you installed Grafana from our APT repository, then Grafana will automaticall
|
||||
|
||||
```bash
|
||||
sudo apt-get update
|
||||
sudo apt-get upgrade
|
||||
```
|
||||
|
||||
#### Upgrade from binary .tar file
|
||||
@@ -238,13 +237,3 @@ Due to this change in Chrome, the `[security]` setting `cookie_samesite` configu
|
||||
|
||||
This version of Chrome also rejects insecure `SameSite=None` cookies. See https://www.chromestatus.com/feature/5633521622188032 for more information. Make sure that you
|
||||
change the `[security]` setting `cookie_secure` to `true` and use HTTPS when `cookie_samesite` is configured to `none`, otherwise authentication in Grafana won't work properly.
|
||||
|
||||
## Upgrading to v7.0
|
||||
|
||||
### PhantomJS removed
|
||||
|
||||
PhantomJS was deprecated in [Grafana v6.4](https://grafana.com/docs/grafana/latest/guides/whats-new-in-v6-4/#phantomjs-deprecation) and starting from Grafana v7.0.0, all PhantomJS support has been removed. This means that Grafana no longer ships with a built-in image renderer, and we adwise you to install the [Grafana Image Renderer plugin](https://grafana.com/grafana/plugins/grafana-image-renderer).
|
||||
|
||||
### Dashboard minimum refresh interval enforced
|
||||
|
||||
A global minimum dashboard refresh interval is now enforced and defaults to 5 seconds. Read more [here]({{< relref "configuration/#min-refresh-interval" >}}) about this setting.
|
||||
|
||||
+62
-61
@@ -56,8 +56,6 @@
|
||||
name: GitHub
|
||||
- link: /auth/gitlab/
|
||||
name: GitLab
|
||||
- link: /auth/okta/
|
||||
name: Okta
|
||||
- link: /auth/saml/
|
||||
name: SAML
|
||||
- link: /auth/team-sync/
|
||||
@@ -79,8 +77,6 @@
|
||||
link: /administration/metrics/
|
||||
- name: Provisioning
|
||||
link: /administration/provisioning/
|
||||
- name: Set up Grafana for high availability
|
||||
link: /tutorials/ha_setup/
|
||||
- name: Troubleshooting
|
||||
link: /installation/troubleshooting/
|
||||
- name: Features
|
||||
@@ -147,7 +143,7 @@
|
||||
- name: Data sources
|
||||
link: /features/datasources/
|
||||
children:
|
||||
- link: /features/datasources/add-a-data-source/
|
||||
- link: /features/datasources/add-data-source/
|
||||
name: Add data source
|
||||
- link: /features/datasources/cloudwatch/
|
||||
name: AWS Cloudwatch
|
||||
@@ -196,7 +192,7 @@
|
||||
link: /features/reporting/
|
||||
- name: Navigation links
|
||||
link: /features/navigation-links/
|
||||
- name: What's new in Grafana
|
||||
- name: What's new In Grafana
|
||||
link: /whatsnew/
|
||||
children:
|
||||
- name: Version 6.7
|
||||
@@ -215,19 +211,19 @@
|
||||
link: /guides/whats-new-in-v6-1/
|
||||
- name: Version 6.0
|
||||
link: /guides/whats-new-in-v6-0/
|
||||
- name: Version 5.4
|
||||
link: /guides/whats-new-in-v5-4/
|
||||
- name: Version 5.3
|
||||
link: /guides/whats-new-in-v5-3/
|
||||
- name: Version 5.2
|
||||
link: /guides/whats-new-in-v5-2/
|
||||
- name: Version 5.1
|
||||
link: /guides/whats-new-in-v5-1/
|
||||
- name: Version 5.0
|
||||
link: /guides/whats-new-in-v5/
|
||||
- name: Old versions
|
||||
link: /whatsnew/
|
||||
children:
|
||||
- name: Version 5.4
|
||||
link: /guides/whats-new-in-v5-4/
|
||||
- name: Version 5.3
|
||||
link: /guides/whats-new-in-v5-3/
|
||||
- name: Version 5.2
|
||||
link: /guides/whats-new-in-v5-2/
|
||||
- name: Version 5.1
|
||||
link: /guides/whats-new-in-v5-1/
|
||||
- name: Version 5.0
|
||||
link: /guides/whats-new-in-v5/
|
||||
- name: Version 4.6
|
||||
link: /guides/whats-new-in-v4-6/
|
||||
- name: Version 4.5
|
||||
@@ -249,26 +245,35 @@
|
||||
- name: Grafana Enterprise
|
||||
link: /enterprise/
|
||||
children:
|
||||
- name: Overview
|
||||
link: /enterprise/
|
||||
- name: Data source permissions
|
||||
link: /enterprise/datasource_permissions/
|
||||
- name: Enhanced LDAP
|
||||
link: /enterprise/enhanced_ldap/
|
||||
- name: Reporting
|
||||
link: /enterprise/reporting/
|
||||
- name: Export dashboard as PDF
|
||||
link: /enterprise/export-pdf/
|
||||
- name: SAML authentication
|
||||
link: /enterprise/saml/
|
||||
- name: Team sync
|
||||
link: /enterprise/team-sync/
|
||||
- name: White labeling
|
||||
link: /enterprise/white-labeling/
|
||||
- name: Usage insights
|
||||
link: /enterprise/usage-insights/
|
||||
- name: License expiration
|
||||
link: /enterprise/license-expiration/
|
||||
- name: Overview
|
||||
link: /enterprise/
|
||||
- name: Data source permissions
|
||||
link: /enterprise/datasource_permissions/
|
||||
- name: Enhanced LDAP
|
||||
link: /enterprise/enhanced_ldap/
|
||||
- name: Reporting
|
||||
link: /enterprise/reporting/
|
||||
- name: SAML authentication
|
||||
link: /enterprise/saml/
|
||||
- name: Team sync
|
||||
link: /enterprise/team-sync/
|
||||
- name: White labeling
|
||||
link: /enterprise/white-labeling/
|
||||
- name: License expiration
|
||||
link: /enterprise/license-expiration/
|
||||
- name: Tutorials
|
||||
link: /tutorials/
|
||||
children:
|
||||
- name: Run Grafana behind a reverse proxy
|
||||
link: /installation/behind_proxy/
|
||||
- name: 'API Tutorial: How To Create API Tokens And Dashboards For A Specific Organization'
|
||||
link: /tutorials/api_org_token_howto/
|
||||
- name: Run Grafana with IIS Reverse Proxy on Windows
|
||||
link: /tutorials/iis/
|
||||
- name: Integrate Hubot and Grafana
|
||||
link: /tutorials/hubot_howto/
|
||||
- name: Set up Grafana for High availability
|
||||
link: /tutorials/ha_setup/
|
||||
- name: Plugins
|
||||
link: /plugins/
|
||||
children:
|
||||
@@ -299,60 +304,56 @@
|
||||
name: Snapshot Mode
|
||||
- link: /plugins/developing/plugin.json/
|
||||
name: plugin.json Schema
|
||||
- name: HTTP APIs
|
||||
- name: HTTP API
|
||||
link: /http_api/
|
||||
children:
|
||||
- name: API Authentication
|
||||
link: /http_api/auth/
|
||||
- name: Create API Tokens and Dashboards for a Specific Organization
|
||||
link: /tutorials/api_org_token_howto/
|
||||
- name: Admin API
|
||||
- name: Admin
|
||||
link: /http_api/admin/
|
||||
- name: Alerting API
|
||||
- name: Alerting
|
||||
link: /http_api/alerting/
|
||||
- name: Alerting Notifications API
|
||||
- name: Alerting Notification Channels
|
||||
link: /http_api/alerting_notification_channels/
|
||||
- name: Annotations API
|
||||
- name: Annotations
|
||||
link: /http_api/annotations/
|
||||
- name: Dashboard API
|
||||
- name: Dashboard
|
||||
link: /http_api/dashboard/
|
||||
- name: Dashboard Permissions API
|
||||
- name: Dashboard Permissions
|
||||
link: /http_api/dashboard_permissions/
|
||||
- name: Dashboard Versions API
|
||||
- name: Dashboard Versions
|
||||
link: /http_api/dashboard_versions/
|
||||
- name: Data Source API
|
||||
- name: Data source
|
||||
link: /http_api/data_source/
|
||||
- name: Data source Permissions API
|
||||
- name: Datasource Permissions
|
||||
link: /http_api/datasource_permissions/
|
||||
- name: External Group Sync API
|
||||
- name: External Group Sync
|
||||
link: /http_api/external_group_sync/
|
||||
- name: Folder API
|
||||
- name: Folder
|
||||
link: /http_api/folder/
|
||||
- name: Folder Permissions API
|
||||
- name: Folder Permissions
|
||||
link: /http_api/folder_permissions/
|
||||
- name: Folder/Dashboard Search API
|
||||
- name: Folder/dashboard search
|
||||
link: /http_api/folder_dashboard_search/
|
||||
- name: Organization API
|
||||
- name: Organization
|
||||
link: /http_api/org/
|
||||
- name: Other APIs
|
||||
- name: Other
|
||||
link: /http_api/other/
|
||||
- name: Playlist API
|
||||
- name: Playlist
|
||||
link: /http_api/playlist/
|
||||
- name: Preferences API
|
||||
- name: Preferences
|
||||
link: /http_api/preferences/
|
||||
- name: Snapshot API
|
||||
- name: Snapshot
|
||||
link: /http_api/snapshot/
|
||||
- name: Teams API
|
||||
- name: Teams
|
||||
link: /http_api/team/
|
||||
- name: Users API
|
||||
- name: Users
|
||||
link: /http_api/user/
|
||||
- name: Developers
|
||||
link: /developers/
|
||||
children:
|
||||
- name: Developer resources
|
||||
link: /developers/developer-resources/
|
||||
- name: Packages reference
|
||||
link: /packages_api/
|
||||
- name: Contributor License Agreement (CLA)
|
||||
link: /developers/cla/
|
||||
- name: Docs Archive
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
title = "API Reference"
|
||||
keywords = ["grafana","documentation","sdk"]
|
||||
type = "docs"
|
||||
draft = true
|
||||
+++
|
||||
|
||||
## API Reference
|
||||
@@ -15,7 +16,6 @@ type = "docs"
|
||||
| --- | --- |
|
||||
| [@grafana/data](./data/) | A library containing most of the core functionality and data types used in Grafana. |
|
||||
| [@grafana/e2e](./e2e/) | A library for writing end-to-end tests for Grafana and its ecosystem. |
|
||||
| [@grafana/e2e-selectors](./e2e-selectors/) | A library containing the different design components of the Grafana ecosystem. |
|
||||
| [@grafana/runtime](./runtime/) | A library containing services, configurations etc. used to interact with the Grafana engine. |
|
||||
| [@grafana/ui](./ui/) | A library containing the different design components of the Grafana ecosystem. |
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
title = "@grafana/data"
|
||||
keywords = ["grafana","documentation","sdk","@grafana/data"]
|
||||
type = "docs"
|
||||
draft = true
|
||||
+++
|
||||
|
||||
## @grafana/data package
|
||||
@@ -26,12 +27,9 @@ A library containing most of the core functionality and data types used in Grafa
|
||||
| [DataSourceApi](./datasourceapi/) | The main data source abstraction interface, represents an instance of a data source<!-- -->Although this is a class, datasource implementations do not \*yet\* need to extend it. As such, we can not yet add functions with default implementations. |
|
||||
| [DataSourcePlugin](./datasourceplugin/) | |
|
||||
| [FieldCache](./fieldcache/) | |
|
||||
| [FieldConfigEditorBuilder](./fieldconfigeditorbuilder/) | Fluent API for declarative creation of field config option editors |
|
||||
| [FieldConfigOptionsRegistry](./fieldconfigoptionsregistry/) | |
|
||||
| [GrafanaPlugin](./grafanaplugin/) | |
|
||||
| [LanguageProvider](./languageprovider/) | |
|
||||
| [MutableDataFrame](./mutabledataframe/) | |
|
||||
| [PanelOptionsEditorBuilder](./paneloptionseditorbuilder/) | Fluent API for declarative creation of panel options |
|
||||
| [PanelPlugin](./panelplugin/) | |
|
||||
| [Registry](./registry/) | |
|
||||
| [ScaledVector](./scaledvector/) | |
|
||||
@@ -48,12 +46,11 @@ A library containing most of the core functionality and data types used in Grafa
|
||||
| [DataTransformerID](./datatransformerid/) | |
|
||||
| [ExploreMode](./exploremode/) | |
|
||||
| [FieldColorMode](./fieldcolormode/) | |
|
||||
| [FieldConfigProperty](./fieldconfigproperty/) | |
|
||||
| [FieldMatcherID](./fieldmatcherid/) | |
|
||||
| [FieldType](./fieldtype/) | |
|
||||
| [FrameMatcherID](./framematcherid/) | Field name matchers |
|
||||
| [GrafanaThemeType](./grafanathemetype/) | |
|
||||
| [LoadingState](./loadingstate/) | Represent panel data loading state. |
|
||||
| [LoadingState](./loadingstate/) | |
|
||||
| [LogLevel](./loglevel/) | Mapping of log level abbreviation to canonical log level. Supported levels are reduce to limit color variation. |
|
||||
| [LogsDedupDescription](./logsdedupdescription/) | |
|
||||
| [LogsDedupStrategy](./logsdedupstrategy/) | |
|
||||
@@ -63,11 +60,10 @@ A library containing most of the core functionality and data types used in Grafa
|
||||
| [NullValueMode](./nullvaluemode/) | |
|
||||
| [OrgRole](./orgrole/) | |
|
||||
| [PluginIncludeType](./pluginincludetype/) | |
|
||||
| [PluginSignatureStatus](./pluginsignaturestatus/) | |
|
||||
| [PluginState](./pluginstate/) | |
|
||||
| [PluginType](./plugintype/) | |
|
||||
| [ReducerID](./reducerid/) | |
|
||||
| [ThresholdsMode](./thresholdsmode/) | Display mode |
|
||||
| [ThresholdsMode](./thresholdsmode/) | |
|
||||
| [VariableOrigin](./variableorigin/) | |
|
||||
| [VariableSuggestionsScope](./variablesuggestionsscope/) | |
|
||||
| [VizOrientation](./vizorientation/) | |
|
||||
@@ -83,7 +79,6 @@ A library containing most of the core functionality and data types used in Grafa
|
||||
| [calculateFieldStats(rows, extractor)](./calculatefieldstats/) | |
|
||||
| [calculateLogsLabelStats(rows, label)](./calculatelogslabelstats/) | |
|
||||
| [calculateStats(values)](./calculatestats/) | |
|
||||
| [doStandardCalcs(field, ignoreNulls, nullAsZero)](./dostandardcalcs/) | |
|
||||
| [eventFactory(name)](./eventfactory/) | |
|
||||
| [findCommonLabels(labelsSets)](./findcommonlabels/) | Returns a map labels that are common to the given label sets. |
|
||||
| [findHighlightChunksInText({ searchWords, textToHighlight, })](./findhighlightchunksintext/) | Adapt findMatchesInText for react-highlight-words findChunks handler. See https://github.com/bvaughn/react-highlight-words\#props |
|
||||
@@ -109,7 +104,6 @@ A library containing most of the core functionality and data types used in Grafa
|
||||
| [getValueFormatterIndex()](./getvalueformatterindex/) | |
|
||||
| [grafanaDataFrameToArrowTable(data)](./grafanadataframetoarrowtable/) | |
|
||||
| [guessFieldTypeForField(field)](./guessfieldtypeforfield/) | Looks at the data to guess the column type. This ignores any existing setting |
|
||||
| [guessFieldTypeFromNameAndValue(name, v)](./guessfieldtypefromnameandvalue/) | Given a name and value, this will pick a reasonable field type |
|
||||
| [guessFieldTypeFromValue(v)](./guessfieldtypefromvalue/) | Given a value this will guess the best column type<!-- -->TODO: better Date/Time support! Look for standard date strings? |
|
||||
| [locale(value, decimals)](./locale/) | |
|
||||
| [parseFlags(text)](./parseflags/) | Converts any mode modifiers in the text to the Javascript equivalent flag |
|
||||
@@ -137,41 +131,35 @@ A library containing most of the core functionality and data types used in Grafa
|
||||
| [toNumberString(value)](./tonumberstring/) | |
|
||||
| [transformDataFrame(options, data)](./transformdataframe/) | Apply configured transformations to the input data |
|
||||
| [updateDatasourcePluginOption(props, key, val)](./updatedatasourcepluginoption/) | |
|
||||
| [updateDatasourcePluginResetOption(props, key)](./updatedatasourcepluginresetoption/) | |
|
||||
| [validateFieldConfig(config)](./validatefieldconfig/) | This checks that all options on FieldConfig make sense. It mutates any value that needs fixed. In particular this makes sure that the first threshold value is -Infinity (not valid in JSON) |
|
||||
| [vectorator(vector)](./vectorator/) | Use functional programming with your vector |
|
||||
|
||||
## Interfaces
|
||||
|
||||
| Interface | Description |
|
||||
| --- | --- |
|
||||
| [AbsoluteTimeRange](./absolutetimerange/) | |
|
||||
| [AngularPanelMenuItem](./angularpanelmenuitem/) | |
|
||||
| [AnnotationEvent](./annotationevent/) | |
|
||||
| [AnnotationQueryRequest](./annotationqueryrequest/) | Options passed to the datasource.annotationQuery method. See docs/plugins/developing/datasource.md |
|
||||
| [AppEvent](./appevent/) | |
|
||||
| [ApplyFieldOverrideOptions](./applyfieldoverrideoptions/) | |
|
||||
| [AppPluginMeta](./apppluginmeta/) | |
|
||||
| [AppRootProps](./approotprops/) | |
|
||||
| [ArrowDataFrame](./arrowdataframe/) | |
|
||||
| [BuildInfo](./buildinfo/) | Describes the build information that will be available via the Grafana configuration. |
|
||||
| [CalculateFieldTransformerOptions](./calculatefieldtransformeroptions/) | |
|
||||
| [ColorFieldConfigSettings](./colorfieldconfigsettings/) | |
|
||||
| [Column](./column/) | |
|
||||
| [ConfigOverrideRule](./configoverriderule/) | |
|
||||
| [CreatePlotOverlay](./createplotoverlay/) | |
|
||||
| [CSVConfig](./csvconfig/) | |
|
||||
| [CSVOptions](./csvoptions/) | |
|
||||
| [CSVParseCallbacks](./csvparsecallbacks/) | |
|
||||
| [DataConfigSource](./dataconfigsource/) | Describes and API for exposing panel specific data configurations. |
|
||||
| [DataFrame](./dataframe/) | |
|
||||
| [DataFrameDTO](./dataframedto/) | Like a DataFrame, but fields may be a FieldDTO |
|
||||
| [DataLink](./datalink/) | Link configuration. The values may contain variables that need to be processed before running |
|
||||
| [DataLinkClickEvent](./datalinkclickevent/) | Callback info for DataLink click events |
|
||||
| [DataLinksFieldConfigSettings](./datalinksfieldconfigsettings/) | |
|
||||
| [DataQuery](./dataquery/) | These are the common properties available to all queries in all datasources Specific implementations will extend this interface adding the required properties for the given context |
|
||||
| [DataQuery](./dataquery/) | |
|
||||
| [DataQueryError](./dataqueryerror/) | |
|
||||
| [DataQueryRequest](./dataqueryrequest/) | |
|
||||
| [DataQueryResponse](./dataqueryresponse/) | |
|
||||
| [DataQueryTimings](./dataquerytimings/) | |
|
||||
| [DataSourceConstructor](./datasourceconstructor/) | |
|
||||
| [DataSourceInstanceSettings](./datasourceinstancesettings/) | Frontend settings model that is passed to Datasource constructor. This differs a bit from the model above as this data model is available to every user who has access to a data source (Viewers+). This is loaded in bootData (on page load), or from: /api/frontend/settings |
|
||||
| [DataSourceJsonData](./datasourcejsondata/) | |
|
||||
@@ -186,9 +174,6 @@ A library containing most of the core functionality and data types used in Grafa
|
||||
| [DateTimeBuiltinFormat](./datetimebuiltinformat/) | |
|
||||
| [DateTimeDuration](./datetimeduration/) | |
|
||||
| [DateTimeLocale](./datetimelocale/) | |
|
||||
| [DateTimeOptions](./datetimeoptions/) | |
|
||||
| [DateTimeOptionsWhenParsing](./datetimeoptionswhenparsing/) | |
|
||||
| [DateTimeOptionsWithFormat](./datetimeoptionswithformat/) | |
|
||||
| [DecimalInfo](./decimalinfo/) | |
|
||||
| [Dimension](./dimension/) | |
|
||||
| [DisplayValue](./displayvalue/) | |
|
||||
@@ -196,20 +181,19 @@ A library containing most of the core functionality and data types used in Grafa
|
||||
| [DynamicConfigValue](./dynamicconfigvalue/) | |
|
||||
| [ExploreQueryFieldProps](./explorequeryfieldprops/) | |
|
||||
| [ExploreStartPageProps](./explorestartpageprops/) | |
|
||||
| [FeatureToggles](./featuretoggles/) | Describes available feature toggles in Grafana. These can be configured via the <code>conf/custom.ini</code> to enable features under development or not yet available in stable version. |
|
||||
| [Field](./field/) | |
|
||||
| [FieldCalcs](./fieldcalcs/) | |
|
||||
| [FieldColor](./fieldcolor/) | |
|
||||
| [FieldConfig](./fieldconfig/) | Every property is optional<!-- -->Plugins may extend this with additional properties. Something like series overrides |
|
||||
| [FieldConfigEditorConfig](./fieldconfigeditorconfig/) | |
|
||||
| [FieldConfigEditorProps](./fieldconfigeditorprops/) | |
|
||||
| [FieldConfigPropertyItem](./fieldconfigpropertyitem/) | |
|
||||
| [FieldConfigSource](./fieldconfigsource/) | |
|
||||
| [FieldDisplay](./fielddisplay/) | |
|
||||
| [FieldDisplayOptions](./fielddisplayoptions/) | |
|
||||
| [FieldDTO](./fielddto/) | Like a field, but properties are optional and values may be a simple array |
|
||||
| [FieldMatcherInfo](./fieldmatcherinfo/) | |
|
||||
| [FieldOverrideContext](./fieldoverridecontext/) | |
|
||||
| [FieldOverrideEditorProps](./fieldoverrideeditorprops/) | |
|
||||
| [FieldPropertyEditorItem](./fieldpropertyeditoritem/) | |
|
||||
| [FieldReducerInfo](./fieldreducerinfo/) | |
|
||||
| [FieldWithIndex](./fieldwithindex/) | |
|
||||
| [FilterFieldsByNameTransformerOptions](./filterfieldsbynametransformeroptions/) | |
|
||||
@@ -218,14 +202,12 @@ A library containing most of the core functionality and data types used in Grafa
|
||||
| [FormattedValue](./formattedvalue/) | |
|
||||
| [FrameMatcherInfo](./framematcherinfo/) | |
|
||||
| [GetFieldDisplayValuesOptions](./getfielddisplayvaluesoptions/) | |
|
||||
| [GrafanaConfig](./grafanaconfig/) | Describes all the different Grafana configuration values available for an instance. |
|
||||
| [GrafanaTheme](./grafanatheme/) | |
|
||||
| [GrafanaThemeCommons](./grafanathemecommons/) | |
|
||||
| [GraphSeriesXY](./graphseriesxy/) | View model projection of a series |
|
||||
| [HistoryItem](./historyitem/) | |
|
||||
| [IntervalValues](./intervalvalues/) | |
|
||||
| [Labels](./labels/) | |
|
||||
| [LicenseInfo](./licenseinfo/) | Describes the license information about the current running instance of Grafana. |
|
||||
| [LinkModel](./linkmodel/) | Processed Link Model. The values are ready to use |
|
||||
| [LinkModelSupplier](./linkmodelsupplier/) | Provides a way to produce links on demand<!-- -->TODO: ScopedVars in in GrafanaUI package! |
|
||||
| [LogLabelStatsModel](./loglabelstatsmodel/) | |
|
||||
@@ -238,17 +220,13 @@ A library containing most of the core functionality and data types used in Grafa
|
||||
| [MetadataInspectorProps](./metadatainspectorprops/) | |
|
||||
| [MetricFindValue](./metricfindvalue/) | |
|
||||
| [MutableVector](./mutablevector/) | Vector with standard manipulation functions |
|
||||
| [NavModel](./navmodel/) | Interface used to describe different kinds of page titles and page navigation. Navmodels are usually generated in the backend and stored in Redux. |
|
||||
| [NavModel](./navmodel/) | |
|
||||
| [NavModelBreadcrumb](./navmodelbreadcrumb/) | |
|
||||
| [NavModelItem](./navmodelitem/) | |
|
||||
| [NumberFieldConfigSettings](./numberfieldconfigsettings/) | |
|
||||
| [OrganizeFieldsTransformerOptions](./organizefieldstransformeroptions/) | |
|
||||
| [PanelData](./paneldata/) | |
|
||||
| [PanelEditorProps](./paneleditorprops/) | |
|
||||
| [PanelMenuItem](./panelmenuitem/) | |
|
||||
| [PanelModel](./panelmodel/) | |
|
||||
| [PanelOptionsEditorConfig](./paneloptionseditorconfig/) | |
|
||||
| [PanelOptionsEditorItem](./paneloptionseditoritem/) | |
|
||||
| [PanelOptionsEditorProps](./paneloptionseditorprops/) | |
|
||||
| [PanelPluginMeta](./panelpluginmeta/) | |
|
||||
| [PanelProps](./panelprops/) | |
|
||||
| [PluginBuildInfo](./pluginbuildinfo/) | |
|
||||
@@ -264,12 +242,9 @@ A library containing most of the core functionality and data types used in Grafa
|
||||
| [QueryHint](./queryhint/) | |
|
||||
| [QueryResultBase](./queryresultbase/) | |
|
||||
| [QueryResultMeta](./queryresultmeta/) | |
|
||||
| [QueryResultMetaNotice](./queryresultmetanotice/) | QueryResultMetaNotice is a structure that provides user notices for query result data |
|
||||
| [QueryResultMetaStat](./queryresultmetastat/) | |
|
||||
| [RangeMap](./rangemap/) | |
|
||||
| [RawTimeRange](./rawtimerange/) | |
|
||||
| [ReadWriteVector](./readwritevector/) | Apache arrow vectors are Read/Write |
|
||||
| [ReduceDataOptions](./reducedataoptions/) | Options for how to turn DataFrames into an array of display values |
|
||||
| [ReduceTransformerOptions](./reducetransformeroptions/) | |
|
||||
| [RegistryItem](./registryitem/) | |
|
||||
| [RegistryItemWithOptions](./registryitemwithoptions/) | |
|
||||
@@ -278,30 +253,18 @@ A library containing most of the core functionality and data types used in Grafa
|
||||
| [ScopedVars](./scopedvars/) | |
|
||||
| [ScreenshotInfo](./screenshotinfo/) | |
|
||||
| [SelectableValue](./selectablevalue/) | Used in select elements |
|
||||
| [SelectFieldConfigSettings](./selectfieldconfigsettings/) | |
|
||||
| [SeriesToColumnsOptions](./seriestocolumnsoptions/) | |
|
||||
| [StandardEditorProps](./standardeditorprops/) | |
|
||||
| [StandardEditorsRegistryItem](./standardeditorsregistryitem/) | |
|
||||
| [StringFieldConfigSettings](./stringfieldconfigsettings/) | |
|
||||
| [TableData](./tabledata/) | |
|
||||
| [TextMatch](./textmatch/) | |
|
||||
| [Threshold](./threshold/) | |
|
||||
| [ThresholdsConfig](./thresholdsconfig/) | Config that is passed to the ThresholdsEditor |
|
||||
| [ThresholdsFieldConfigSettings](./thresholdsfieldconfigsettings/) | |
|
||||
| [ThresholdsConfig](./thresholdsconfig/) | |
|
||||
| [TimeOption](./timeoption/) | |
|
||||
| [TimeOptions](./timeoptions/) | |
|
||||
| [TimeRange](./timerange/) | |
|
||||
| [TimeSeries](./timeseries/) | |
|
||||
| [TransformerRegistyItem](./transformerregistyitem/) | |
|
||||
| [TransformerUIProps](./transformeruiprops/) | |
|
||||
| [UnitFieldConfigSettings](./unitfieldconfigsettings/) | |
|
||||
| [UserOrgDTO](./userorgdto/) | |
|
||||
| [ValueFormat](./valueformat/) | |
|
||||
| [ValueFormatCategory](./valueformatcategory/) | |
|
||||
| [ValueLinkConfig](./valuelinkconfig/) | |
|
||||
| [ValueMap](./valuemap/) | |
|
||||
| [ValueMappingFieldConfigSettings](./valuemappingfieldconfigsettings/) | |
|
||||
| [VariableModel](./variablemodel/) | |
|
||||
| [VariableSuggestion](./variablesuggestion/) | |
|
||||
| [Vector](./vector/) | |
|
||||
| [YAxis](./yaxis/) | |
|
||||
@@ -319,19 +282,10 @@ A library containing most of the core functionality and data types used in Grafa
|
||||
|
||||
| Variable | Description |
|
||||
| --- | --- |
|
||||
| [booleanOverrideProcessor](./booleanoverrideprocessor/) | |
|
||||
| [createDimension](./createdimension/) | |
|
||||
| [createOrderFieldsComparer](./createorderfieldscomparer/) | |
|
||||
| [DataLinkBuiltInVars](./datalinkbuiltinvars/) | |
|
||||
| [dataLinksOverrideProcessor](./datalinksoverrideprocessor/) | |
|
||||
| [dateTime](./datetime/) | |
|
||||
| [dateTimeAsMoment](./datetimeasmoment/) | |
|
||||
| [dateTimeFormat](./datetimeformat/) | |
|
||||
| [dateTimeFormatISO](./datetimeformatiso/) | |
|
||||
| [dateTimeFormatTimeAgo](./datetimeformattimeago/) | |
|
||||
| [dateTimeFormatWithAbbrevation](./datetimeformatwithabbrevation/) | |
|
||||
| [dateTimeForTimeZone](./datetimefortimezone/) | |
|
||||
| [dateTimeParse](./datetimeparse/) | |
|
||||
| [DEFAULT\_DATE\_TIME\_FORMAT](./default_date_time_format/) | |
|
||||
| [DEFAULT\_FIELD\_DISPLAY\_VALUES\_LIMIT](./default_field_display_values_limit/) | |
|
||||
| [DefaultTimeRange](./defaulttimerange/) | |
|
||||
@@ -361,48 +315,31 @@ A library containing most of the core functionality and data types used in Grafa
|
||||
| [getValueFromDimension](./getvaluefromdimension/) | |
|
||||
| [guessFieldTypes](./guessfieldtypes/) | |
|
||||
| [hasMsResolution](./hasmsresolution/) | Checks if series time field has ms resolution |
|
||||
| [identityOverrideProcessor](./identityoverrideprocessor/) | |
|
||||
| [isDataFrame](./isdataframe/) | |
|
||||
| [isDateTime](./isdatetime/) | |
|
||||
| [ISO\_8601](./iso_8601/) | |
|
||||
| [isTableData](./istabledata/) | |
|
||||
| [locationUtil](./locationutil/) | |
|
||||
| [LogsParsers](./logsparsers/) | |
|
||||
| [MISSING\_VALUE](./missing_value/) | |
|
||||
| [MS\_DATE\_TIME\_FORMAT](./ms_date_time_format/) | |
|
||||
| [numberOverrideProcessor](./numberoverrideprocessor/) | |
|
||||
| [objRemoveUndefined](./objremoveundefined/) | |
|
||||
| [onUpdateDatasourceJsonDataOption](./onupdatedatasourcejsondataoption/) | |
|
||||
| [onUpdateDatasourceJsonDataOptionChecked](./onupdatedatasourcejsondataoptionchecked/) | |
|
||||
| [onUpdateDatasourceJsonDataOptionSelect](./onupdatedatasourcejsondataoptionselect/) | |
|
||||
| [onUpdateDatasourceOption](./onupdatedatasourceoption/) | |
|
||||
| [onUpdateDatasourceResetOption](./onupdatedatasourceresetoption/) | |
|
||||
| [onUpdateDatasourceSecureJsonDataOption](./onupdatedatasourcesecurejsondataoption/) | |
|
||||
| [onUpdateDatasourceSecureJsonDataOptionSelect](./onupdatedatasourcesecurejsondataoptionselect/) | |
|
||||
| [selectOverrideProcessor](./selectoverrideprocessor/) | |
|
||||
| [setLocale](./setlocale/) | |
|
||||
| [setTimeZoneResolver](./settimezoneresolver/) | |
|
||||
| [standardEditorsRegistry](./standardeditorsregistry/) | |
|
||||
| [standardFieldConfigEditorRegistry](./standardfieldconfigeditorregistry/) | |
|
||||
| [standardTransformers](./standardtransformers/) | |
|
||||
| [standardTransformersRegistry](./standardtransformersregistry/) | Registry of transformation options that can be driven by stored configuration files. |
|
||||
| [stringOverrideProcessor](./stringoverrideprocessor/) | |
|
||||
| [textUtil](./textutil/) | |
|
||||
| [thresholdsOverrideProcessor](./thresholdsoverrideprocessor/) | |
|
||||
| [TIME\_FORMAT](./time_format/) | |
|
||||
| [timeZoneAbbrevation](./timezoneabbrevation/) | |
|
||||
| [toDataFrame](./todataframe/) | |
|
||||
| [toDuration](./toduration/) | |
|
||||
| [toLegacyResponseData](./tolegacyresponsedata/) | |
|
||||
| [toPascalCase](./topascalcase/) | |
|
||||
| [toUtc](./toutc/) | |
|
||||
| [transformersRegistry](./transformersregistry/) | |
|
||||
| [unEscapeStringFromRegex](./unescapestringfromregex/) | |
|
||||
| [unitOverrideProcessor](./unitoverrideprocessor/) | |
|
||||
| [updateDatasourcePluginJsonDataOption](./updatedatasourcepluginjsondataoption/) | |
|
||||
| [updateDatasourcePluginResetOption](./updatedatasourcepluginresetoption/) | |
|
||||
| [updateDatasourcePluginSecureJsonDataOption](./updatedatasourcepluginsecurejsondataoption/) | |
|
||||
| [urlUtil](./urlutil/) | |
|
||||
| [valueMappingsOverrideProcessor](./valuemappingsoverrideprocessor/) | |
|
||||
| [VAR\_CALC](./var_calc/) | |
|
||||
| [VAR\_CELL\_PREFIX](./var_cell_prefix/) | |
|
||||
| [VAR\_FIELD\_NAME](./var_field_name/) | |
|
||||
@@ -417,15 +354,14 @@ A library containing most of the core functionality and data types used in Grafa
|
||||
| [DataQueryResponseData](./dataqueryresponsedata/) | |
|
||||
| [DataSourceOptionsType](./datasourceoptionstype/) | |
|
||||
| [DataSourceQueryType](./datasourcequerytype/) | |
|
||||
| [DataTransformer](./datatransformer/) | Function that transform data frames (AKA transformer) |
|
||||
| [DateTimeFormatter](./datetimeformatter/) | |
|
||||
| [DataTransformer](./datatransformer/) | Immutable data transformation |
|
||||
| [DateTimeInput](./datetimeinput/) | |
|
||||
| [DateTimeParser](./datetimeparser/) | |
|
||||
| [DecimalCount](./decimalcount/) | |
|
||||
| [Dimensions](./dimensions/) | |
|
||||
| [DisplayProcessor](./displayprocessor/) | |
|
||||
| [DurationInput](./durationinput/) | |
|
||||
| [DurationUnit](./durationunit/) | |
|
||||
| [FieldConfigEditorRegistry](./fieldconfigeditorregistry/) | |
|
||||
| [FieldMatcher](./fieldmatcher/) | |
|
||||
| [FormatInput](./formatinput/) | |
|
||||
| [FrameMatcher](./framematcher/) | |
|
||||
@@ -436,10 +372,9 @@ A library containing most of the core functionality and data types used in Grafa
|
||||
| [LinkTarget](./linktarget/) | |
|
||||
| [MutableField](./mutablefield/) | |
|
||||
| [NavIndex](./navindex/) | |
|
||||
| [Omit\_2](./omit_2/) | |
|
||||
| [Omit](./omit/) | |
|
||||
| [PanelMigrationHandler](./panelmigrationhandler/) | Called when a panel is first loaded with current panel model |
|
||||
| [PanelOptionEditorsRegistry](./paneloptioneditorsregistry/) | |
|
||||
| [PanelTypeChangedHandler](./paneltypechangedhandler/) | Called before a panel is initialized. Allows panel inspection for any updates before changing the panel type. |
|
||||
| [PanelTypeChangedHandler](./paneltypechangedhandler/) | Called before a panel is initialized |
|
||||
| [ScaleCalculator](./scalecalculator/) | |
|
||||
| [Subtract](./subtract/) | |
|
||||
| [TimeFragment](./timefragment/) | |
|
||||
@@ -447,12 +382,7 @@ A library containing most of the core functionality and data types used in Grafa
|
||||
| [TimeSeriesValue](./timeseriesvalue/) | |
|
||||
| [TimeZone](./timezone/) | |
|
||||
| [TimeZoneBrowser](./timezonebrowser/) | |
|
||||
| [TimeZoneResolver](./timezoneresolver/) | |
|
||||
| [TimeZoneUtc](./timezoneutc/) | |
|
||||
| [UrlQueryMap](./urlquerymap/) | Type to represent the values parsed from the query string. |
|
||||
| [UrlQueryValue](./urlqueryvalue/) | Type to represent the value of a single query variable. |
|
||||
| [ValueConverter](./valueconverter/) | |
|
||||
| [ValueFormatter](./valueformatter/) | |
|
||||
| [ValueMapping](./valuemapping/) | |
|
||||
| [VariableType](./variabletype/) | |
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
title = "AbsoluteTimeRange"
|
||||
keywords = ["grafana","documentation","sdk","@grafana/data"]
|
||||
type = "docs"
|
||||
draft = true
|
||||
+++
|
||||
|
||||
## AbsoluteTimeRange interface
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
title = "addLogLevelToSeries"
|
||||
keywords = ["grafana","documentation","sdk","@grafana/data"]
|
||||
type = "docs"
|
||||
draft = true
|
||||
+++
|
||||
|
||||
## addLogLevelToSeries() function
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
+++
|
||||
# -----------------------------------------------------------------------
|
||||
# Do not edit this file. It is automatically generated by API Documenter.
|
||||
# -----------------------------------------------------------------------
|
||||
title = "AngularPanelMenuItem"
|
||||
keywords = ["grafana","documentation","sdk","@grafana/data"]
|
||||
type = "docs"
|
||||
draft = true
|
||||
+++
|
||||
|
||||
## AngularPanelMenuItem interface
|
||||
|
||||
<b>Signature</b>
|
||||
|
||||
```typescript
|
||||
export interface AngularPanelMenuItem
|
||||
```
|
||||
<b>Import</b>
|
||||
|
||||
```typescript
|
||||
import { AngularPanelMenuItem } from '@grafana/data';
|
||||
```
|
||||
<b>Properties</b>
|
||||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [click](#click-property) | <code>Function</code> | |
|
||||
| [divider](#divider-property) | <code>boolean</code> | |
|
||||
| [href](#href-property) | <code>string</code> | |
|
||||
| [icon](#icon-property) | <code>string</code> | |
|
||||
| [shortcut](#shortcut-property) | <code>string</code> | |
|
||||
| [submenu](#submenu-property) | <code>any[]</code> | |
|
||||
| [text](#text-property) | <code>string</code> | |
|
||||
|
||||
### click property
|
||||
|
||||
<b>Signature</b>
|
||||
|
||||
```typescript
|
||||
click: Function;
|
||||
```
|
||||
|
||||
### divider property
|
||||
|
||||
<b>Signature</b>
|
||||
|
||||
```typescript
|
||||
divider: boolean;
|
||||
```
|
||||
|
||||
### href property
|
||||
|
||||
<b>Signature</b>
|
||||
|
||||
```typescript
|
||||
href: string;
|
||||
```
|
||||
|
||||
### icon property
|
||||
|
||||
<b>Signature</b>
|
||||
|
||||
```typescript
|
||||
icon: string;
|
||||
```
|
||||
|
||||
### shortcut property
|
||||
|
||||
<b>Signature</b>
|
||||
|
||||
```typescript
|
||||
shortcut: string;
|
||||
```
|
||||
|
||||
### submenu property
|
||||
|
||||
<b>Signature</b>
|
||||
|
||||
```typescript
|
||||
submenu: any[];
|
||||
```
|
||||
|
||||
### text property
|
||||
|
||||
<b>Signature</b>
|
||||
|
||||
```typescript
|
||||
text: string;
|
||||
```
|
||||
@@ -5,6 +5,7 @@
|
||||
title = "AnnotationEvent"
|
||||
keywords = ["grafana","documentation","sdk","@grafana/data"]
|
||||
type = "docs"
|
||||
draft = true
|
||||
+++
|
||||
|
||||
## AnnotationEvent interface
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
title = "AnnotationQueryRequest"
|
||||
keywords = ["grafana","documentation","sdk","@grafana/data"]
|
||||
type = "docs"
|
||||
draft = true
|
||||
+++
|
||||
|
||||
## AnnotationQueryRequest interface
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
title = "AppendedVectors"
|
||||
keywords = ["grafana","documentation","sdk","@grafana/data"]
|
||||
type = "docs"
|
||||
draft = true
|
||||
+++
|
||||
|
||||
## AppendedVectors class
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
title = "AppEvent"
|
||||
keywords = ["grafana","documentation","sdk","@grafana/data"]
|
||||
type = "docs"
|
||||
draft = true
|
||||
+++
|
||||
|
||||
## AppEvent interface
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user