Commit Graph

1359 Commits

Author SHA1 Message Date
Ryan McKinley
1d6e99bc95
SQL: Fixes issues with showing value column name prefix in legends (#35839)
* rename strategy

* Update pkg/tsdb/sqleng/sql_engine.go

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>

* more strict constraints

* Fixed so that it works on multi series results

* only apply the logic when original query returns 3 fields

* removed part of comment

* Update mysql test

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2021-06-18 08:05:23 +02:00
Andrej Ocenas
9a3e3014dd
CloudWatch/Logs: Fix missing response data for log queries (#35724) 2021-06-15 14:42:55 +02:00
Andres Martinez Gotor
7109285ac9
AzureMonitor: Use auth middleware for QueryData requests (#35343) 2021-06-11 17:02:24 +02:00
Marcus Efraimsson
0611207f3b
Postgres/MySQL/MSSQL: Fix concurrent map writes panic (#35510)
Fixes panic/fatal error concurrent map writes in SQL data sources when multiple 
queries are executed concurrently and you interpolate SQL query before executing it.

Fixes #35469
2021-06-11 14:56:29 +02:00
Sofia Papagiannaki
aa8e09d383
Revert "Test datasource: Returns always float values (#34986)" (#35316)
This reverts commit 51afde34bd.
2021-06-11 14:12:11 +03:00
shuotli
05f3985108
Upgrade ARG API version (#35464) 2021-06-10 12:33:34 +02:00
ying-jeanne
a07c53b671
[dataframe] convert opentsdb response to dataframes (#35307)
* draft pr convert opentsdb response to dataframes

* Add test for parse response and fix go lint

* Add test case for create request

* Use go-cmp in test

* Remove comment

Co-authored-by: Ida Furjesova <ida.furjesova@grafana.com>
2021-06-10 12:14:25 +02:00
Erik Sundell
eff2410bae
Cloudwatch: Fix duplicated time series (#35433)
* make sure queries are only ran once

* test aliases

* use correct dates
2021-06-10 10:23:17 +02:00
Andres Martinez Gotor
086309700e
Fix missing defaultRegion (#35436) 2021-06-09 17:19:43 +02:00
Marc Bachmann
9a5e10e6fb
Annotations: Fix sql annotation parsing for empty responses (#35367)
* fix sql annotation parsing for empty responses

* fix backend when no data returned

* add back frontend changes

Co-authored-by: Ying WANG <ying.wang@grafana.com>
2021-06-09 21:14:28 +08:00
Andres Martinez Gotor
d225323049
AzureMonitor: Use plugin SDK contracts (#34729) 2021-06-07 14:54:51 +02:00
Giordano Ricci
7a304223e6
Elasticsearch: Fix min_doc_count value when alerting (#35254)
* Elasticsearch: Fix min_doc_count value when alerting

* Add tests
2021-06-04 16:42:00 +02:00
Sergey Kostrukov
412bcf1fb0
AzureMonitor: fix Azure Resource Graph queries in Azure China (#35235)
* Optimize Azure Monitor routes

* Update API version compatible with Azure China
2021-06-04 12:29:18 +01:00
Chris Cowan
f580c9149c
Elasticsearch: Add Top Metrics Aggregation and X-Pack support (#33041)
* Elasticsearch: Add Top Metrics Aggregation

* Adding support for non-timeseries visualizations

* removing console.logs

* restoring loadOptions type

* Honor xpack setting

* Adding test for elastic_response

* adding test for query builder

* Adding support of alerting

* Fixing separator spelling

* Fixing linting issues

* attempting to reduce cyclomatic complexity

* Adding elastic77 Docker block

* Update public/app/plugins/datasource/elasticsearch/components/QueryEditor/MetricAggregationsEditor/MetricEditor.test.tsx

Co-authored-by: Giordano Ricci <grdnricci@gmail.com>

* refactoring MetricsEditor tests

* Fixing typo

* Change getFields type & move TopMetrics to a separate component

* Fix SegmentAsync styles in TopMetrics Settings

* Fix field types for TopMetrics

* WIP

* Refactoring client side to support multiple top metrics

* Adding tests and finishing go implimentation

* removing fmt lib from debugging

* fixing tests

* reducing the cyclomatic complexity

* Update public/app/plugins/datasource/elasticsearch/elastic_response.ts

Co-authored-by: Giordano Ricci <grdnricci@gmail.com>

* Update public/app/plugins/datasource/elasticsearch/hooks/useFields.ts

Co-authored-by: Giordano Ricci <grdnricci@gmail.com>

* Checking for possible nil value

* Fixing types

* fix fake-data-gen param

* fix useFields hook

* Removing aggregateBy and size

* Fixing go tests

* Fixing TS tests

* fixing tests

* Fixes

* Remove date from top_metrics fields

* Restore previous formatting

* Update pkg/tsdb/elasticsearch/client/models.go

Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>

* Update pkg/tsdb/elasticsearch/client/models.go

Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>

* Fix code review comments on processTopMetricValue

* Remove underscore from variable names

* Remove intermediate array definition

* Refactor test to use testify

Co-authored-by: Giordano Ricci <grdnricci@gmail.com>
Co-authored-by: Elfo404 <me@giordanoricci.com>
Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
2021-06-04 11:07:59 +01:00
Marcus Efraimsson
b3e9087557
Chore: Refactor backend plugin manager/tsdb query data (#34944)
Move QueryData method into backend plugin manager which HandleRequest uses to 
query data from plugin SDK supported data sources. This allowed us to remove a lot 
of code no longer needed.

Ref #21510

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2021-06-03 14:16:58 +02:00
Gábor Farkas
38b030e2a4
InfluxDB: Flux: timestamp-column has to go first (#35036) 2021-06-01 16:03:02 +02:00
Marcus Efraimsson
c775708e45
Chore: Refactor Prometheus custom query parameters middleware (#34814)
Following #34473 refactor to use url.ParseQuery in the Prometheus 
custom query parameter middleware.

Ref #34473
2021-06-01 14:59:44 +02:00
Sofia Papagiannaki
51afde34bd
Test datasource: Returns always float values (#34986) 2021-05-31 19:15:46 +03:00
Marcus Efraimsson
f76f426da3
Chore: Refactor Prometheus HTTP client middleware (#34473)
Following #33439 this refactors the Prometheus HTTP transport 
which is replaced by HTTP client middleware.
2021-05-27 12:43:21 +02:00
Ryan McKinley
67028af99e
Live: check schema equality between push messages (#34548) 2021-05-27 12:55:42 +03:00
Andi Pabst
29be741f26
MySQL Datasource: Add timezone parameter (#27535)
* Add MySQL timezone parameter

* Reword docs/sources/features/datasources/mysql.md

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* update documentation

* fix formatting mistake from merge

* enhance documentation with reason for parameter usage

* enhance documentation with reason for parameter usage

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2021-05-27 10:03:03 +02:00
Torkel Ödegaard
6fb0560a84
TestData: Some simple small test data and first draft of what's new in v8 demo dashboard (#34731)
* TestData: More test data

* Added v8 demo dashboard
2021-05-26 14:11:57 +02:00
Ben Sully
b7ea66b00d
Datasource: Use intervalMs field of query model in GetIntervalFrom if interval field is not set (#34270)
The /api/ds/query and /api/tsdb/query endpoints extract the intervalMs field from
each query in the request, but it currently seems to be ignored, at
least for queries to a Prometheus datasource. This changes
GetIntervalFrom function to check for the presence of intervalMs in the
query model if interval is missing.
2021-05-26 11:45:11 +02:00
Torkel Ödegaard
987bffe482
TestData: Support for csv files & csv content (#34674)
* initial implementation of csv support for test data source

* CSV file & content scenarios working

* Removing categorical data

* fixing handler names

* Update pkg/tsdb/testdatasource/csv_data.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/tsdb/testdatasource/csv_data.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/tsdb/testdatasource/csv_data.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/tsdb/testdatasource/csv_data.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/tsdb/testdatasource/csv_data.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/tsdb/testdatasource/csv_data.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/tsdb/testdatasource/csv_data.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fixed lint issues

* updated so it uses the same parsing

* more CSV tests

* lint fixes

* more lint

* lint

* support time field

* migrate manual entry to csv

* more test output

* more test output

* missing file

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-05-26 10:42:42 +02:00
Arve Knudsen
796590a1aa
Chore: Upgrade opentelemetry.io/collector dependency (#34700)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-05-26 10:11:37 +02:00
Evan Sosenko
80c05becc5
Add missing AWS/AppSync metrics (#34691) 2021-05-26 08:11:26 +02:00
Evan Sosenko
f9b8f3777a
CloudWatch: Add Lambda@Edge Amazon CloudFront metrics (#34561)
* Add LambdaExecutionError to AWS/CloudFront

* Add LambdaValidationError to AWS/CloudFront

* Add LambdaLimitExceededErrors to AWS/CloudFront
2021-05-26 08:11:13 +02:00
Alexander Emelin
063e1b5ff5
Live: use latest changes in Go SDK to deal with streaming frames (#34668) 2021-05-25 10:29:02 -07:00
Gábor Farkas
ab26c4dfa4
InfluxDB: Flux: handle boolean data-columns (#34479)
* InfluxDB: Flux: handle boolean data-columns

* normalize data-type strings based on documentation

* reference missing data type
2021-05-25 17:22:04 +02:00
wangjian
530072fce7
Elasticsearch: fix NewClient not passing httpClientProvider to client impl (#34539)
* Update client.go

fix missing "httpClientProvider" in NewClient

* Update client.go
2021-05-24 14:45:29 +01:00
Giordano Ricci
e2e78f14d2
Elasticsearch: fix flaky test (#34517) 2021-05-20 17:13:48 +02:00
Josh Hunt
cf94410e59
AzureMonitor: Update Logs workspace() template variable query to return resource URIs (#34445)
* Migrate template variables straight into resource field,

Display error if unable to migrate

* Update workspace() template variable query function to return a resource URI

* update backend to support resource uris in workspace field

* don't load resource names for variables

* throw error when workspace migration returns no results

* update testDatasource to work with either resource URI or workspace GUID

* fix tests

* cleanup types just a little bit, as a treat
2021-05-20 10:16:29 +02:00
Marcus Efraimsson
348e76fc8e
Datasource: Shared HTTP client provider for core backend data sources and any data source using the data source proxy (#33439)
Uses new httpclient package from grafana-plugin-sdk-go introduced 
via grafana/grafana-plugin-sdk-go#328. 
Replaces the GetHTTPClient, GetTransport, GetTLSConfig methods defined 
on DataSource model.
Longer-term the goal is to migrate core HTTP backend data sources to use the 
SDK contracts and using httpclient.Provider for creating HTTP clients and such.

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-05-19 23:53:41 +02:00
Josh Hunt
5dca9fd4d8
AzureMonitor: Support querying any Resource for Logs queries (#33879)
* wip

* wip:

* ui work for resource picker

* disable rows when others are selected

* resource picker open button

* Azure Monitor: Connect to backend with real data (#34024)

* Connect to backend with real data

* Fixes from code review.

* WIP:Begin thinking about how to make queries with scope determined by the resource picker

* More fixes post code review.

* Fixes after rebasing

* Remove outdated todo

* AzureMonitor: Support any resource for Logs queries (#33762)

* Apply button for resource picker

* scroll table body

* secondary cancel button

* loading state for nested rows

* Display resource components in picker button

* fix tests

* fix icons

* move route function

* Migrate from workspace to resource uri for log analytics (#34337)

* reword backwards compat comment

* remove base url suffix

* fix lint error

* move migrations to seperate file

* cleanup

* update regex

* cleanup

* update plugin routes to use new azure auth type

* use AzureDataSourceInstanceSettings alias

Co-authored-by: Sarah Zinger <sarahzinger@users.noreply.github.com>
2021-05-19 17:39:08 +01:00
Dominik Prokop
a2cbbe1b8a
BarChart: value label sizing (#34229)
* Bar chart label positioning and sizing

* Dev dashbard

* Improve autosizing

* Remove sync option

* Unify text sizing options between stat-ish visualizations and bar chart

* Add simple categorical data scenario and update dev dashboard

* Remove unused options builder

* Add docs annotations

* Fix go lint
2021-05-19 17:33:56 +02:00
Sergey Kostrukov
e9e80bb4cb
Route fixes for Azure Resource Graph (#34410) 2021-05-19 17:33:03 +02:00
Sergey Kostrukov
db1191f3ef
AzureMonitor: Refactor cloud and route resolution in the backend (#34342)
* Determine Azure cloud based on authentication type

* Route resolution for clouds

* Fix tests

* Constants for cloud names

* move arg cloud route logic to routes.go

Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
2021-05-19 14:36:16 +02:00
shuotli
71fd0981ca
AzureMonitor: Add Azure Resource Graph (#33293)
* Add Azure Resource Graph in Azure Plugin

* fix lodash import

* Fix mock queries

* use "backend" sdk

* Address comments

* add converter for object type

* Query error should cause 400 & apply template var

* fix backend test & add documentation

* update image

* Address comments

* marshal body from map

* use interpolated query instead of raw query

* fix test

* filter out empty queries

* fix go linting problem

* use new query field language name

* improve variable tests

* add better tests for interpolate variable

Co-authored-by: joshhunt <josh@trtr.co>
Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
2021-05-19 10:31:27 +02:00
Freshleaf Media
c30f6fe8fe
Cloudwatch: Adds StorageBytes metrics. Fixes #31836 (#33426) 2021-05-19 09:40:44 +02:00
Erik Sundell
5042dc3b52
CloudMonitoring: Add support for preprocessing (#33011)
* add support for handling preprocessors in the backend

* add preprocessor tests

* use uppercase for constants

* add super label component

* remove error message from query editor since its not working (probably cause onDataError doesnt work anymore)

* use cheat sheet instead of help

* add return type annotation for projects

* add support for preprocessing. replace segment comp with select. change components names and refactoring

* cleanup

* more pr feedback

* fix annotations editor

* rename aggregation component

* fix broken test

* remove unnecessary cast

* fix strict errors

* fix more strict errors

* remove not used prop

* update docs

* use same inline label for annotation editor

* fix react prop warning

* disable preprocessing for distribution types

* using new default values for reducer

* auto select 'rate' if metric kind is not gauge

* fix create label format

* pr feedback

* more pr feedback

* update images
2021-05-19 08:16:05 +02:00
Gábor Farkas
bd4afe41ba
Tempo: fix handling of trace-not-found cases (#34219) 2021-05-18 08:33:53 +02:00
Matthew Coltman
bc21adf712
CloudWatch: Allow use of missing AWS namespaces using custom metrics (#30961)
* add tests

* CloudWatch: Allow use of missing AWS namespaces using custom metrics

* CloudWatch: Allow use of missing AWS namespaces using custom metrics
2021-05-17 07:32:32 +02:00
Sergey Kostrukov
81f6c806e1
Azure token provider with support for Managed Identities (#33807)
* Azure token provider

* Configuration for Azure token provider

* Authentication via Azure SDK for Go

* Fix typo

* ConcurrentTokenCache for Azure credentials

* Resolve AAD authority for selected Azure cloud

* Fixes

* Generic AccessToken and fixes

* Tests and wordings

* Tests for getAccessToken

* Tests for getClientSecretCredential

* Tests for token cache
2021-05-14 13:59:07 +02:00
Giordano Ricci
8ec87250c1
Elasticsearch: Fix handling of inline scripts in different ES versions (#34070)
* Devenv: add block for es 5.0, provisioned datasource & dashboard

* Trasnsform script property based on running ES version

* Handle different scripts format in BE
2021-05-14 11:50:15 +01:00
Alexander Emelin
a14ae53347
UseRunStream is a default behaviour (#34021) 2021-05-12 22:17:31 +03:00
Will Browne
c39d6ad97d
Plugins: Enable plugin runtime install/uninstall capabilities (#33836)
* add uninstall flow

* add install flow

* small cleanup

* smaller-footprint solution

* cleanup + make bp start auto

* fix interface contract

* improve naming

* accept version arg

* ensure use of shared logger

* make installer a field

* add plugin decommissioning

* add basic error checking

* fix api docs

* making initialization idempotent

* add mutex

* fix comment

* fix test

* add test for decommission

* improve existing test

* add more test coverage

* more tests

* change test func to use read lock

* refactoring + adding test asserts

* improve purging old install flow

* improve dupe checking

* change log name

* skip over dupe scanned

* make test assertion more flexible

* remove trailing line

* fix pointer receiver name

* update comment

* add context to API

* add config flag

* add base http api test + fix update functionality

* simplify existing check

* clean up test

* refactor tests based on feedback

* add single quotes to errs

* use gcmp in tests + fix logo issue

* make plugin list testing more flexible

* address feedback

* fix API test

* fix linter

* undo preallocate

* Update docs/sources/administration/configuration.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/administration/configuration.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/administration/configuration.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* fix linting issue in test

* add docs placeholder

* update install notes

* Update docs/sources/plugins/marketplace.md

Co-authored-by: Marcus Olsson <marcus.olsson@hey.com>

* update access wording

* add more placeholder docs

* add link to more info

* PR feedback - improved errors, refactor, lock fix

* improve err details

* propagate plugin version errors

* don't autostart renderer

* add H1

* fix imports

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
Co-authored-by: Marcus Olsson <marcus.olsson@hey.com>
2021-05-12 20:05:16 +02:00
Andrej Ocenas
293677a0cb
Prometheus: Add custom query params for alert and exemplars queries (#32440)
* Add configuration for custom query params

* Add custom transport in prometheus

* Move custom query handling to request method

* Add encoding
2021-05-12 19:30:41 +02:00
Ivana Huckova
6c532c3f1e
Loki: Use data source settings for alerting queries (#33942)
* Add Tripperware

* Return TLSConfig

* Create transport outside of client
2021-05-12 11:20:16 +02:00
Alexander Emelin
95a356a840
Live: using organisation IDs throughout stack (#33714) 2021-05-11 22:03:04 +03:00
Marcus Efraimsson
6c728d6a78
SQL: Use SDK sqlutil package refactor (#33758)
Upgrades grafana-plugin-sdk-go dependency to v0.94.0 to get 
the refactored sqlutil package. 

Co-authored-by: Kevin Minehart <kmineh0151@gmail.com>
2021-05-11 14:59:33 +02:00
Gábor Farkas
2633f245ba
InfluxDB: Flux: Improve handling of complex response-structures (#33823) 2021-05-11 12:36:04 +02:00
Giordano Ricci
e98a8bd11b
Elasticsearch: use semver strings to identify ES version (#33646)
* Elasticsearch: use proper semver strings to identify ES version

* Update BE & tests

* refactor BE tests

* refactor isValidOption check

* update test

* Update pkg/tsdb/elasticsearch/client/client.go

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>

* Update pkg/tsdb/elasticsearch/client/search_request_test.go

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>

* Remove leftover FIXME comment

* Add new test cases for new version format

* Docs: add documentation about version dropdown

* Update docs/sources/datasources/elasticsearch.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/datasources/elasticsearch.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/datasources/elasticsearch.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update provisioning documentation

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-05-11 09:44:00 +01:00
Ryan McKinley
a469fa8416
TestData: allow true and false strings as bool (#33889) 2021-05-10 22:29:46 -07:00
ying-jeanne
0b97cdcee1
fix postgres to have precision of ms (#33853) 2021-05-10 22:22:13 +08:00
Rodrigo Fior Kuntzer
4fc1810cb7
CloudWatch: added Amplify Console specific metrics and dimensions (#33171) 2021-05-10 13:55:48 +02:00
Alexander Emelin
03e91eb1a6
updated sdk-go to v0.93.0, adapt tests (#33769) 2021-05-06 18:10:51 +03:00
Arve Knudsen
c2c1ec7d0f
Chore: Move from master to main branch (#33693)
* Chore: Move from master branch to main

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* CI: Upgrade build pipeline tool to v2

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-05-06 16:29:29 +02:00
Erik Sundell
4089455869
fix aws connect dimensions (#33736) 2021-05-05 21:25:30 +02:00
ying-jeanne
bd66c8dde3
SQL data sources: Convert to return data frames (#32257)
Convert SQL data sources to return data frames.

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Will Browne <will.browne@grafana.com>
Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
2021-05-05 16:46:07 +02:00
dependabot[bot]
8dea72a763
Chore(deps): Bump go.opentelemetry.io/collector from 0.22.0 to 0.25.0 (#33365)
* Chore(deps): Bump go.opentelemetry.io/collector from 0.22.0 to 0.25.0

Bumps [go.opentelemetry.io/collector](https://github.com/open-telemetry/opentelemetry-collector) from 0.22.0 to 0.25.0.
- [Release notes](https://github.com/open-telemetry/opentelemetry-collector/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-collector/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-collector/compare/v0.22.0...v0.25.0)

Signed-off-by: dependabot[bot] <support@github.com>

* Apply changes to tempo code

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2021-04-29 15:01:48 +02:00
Kyle Brandt
968935b8b7
TestData: Change predictable csv scenario to multi-series (#33442)
Allow multiple series in Predictable CSV Wave testdata scenario

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-04-27 16:35:43 -04:00
Giordano Ricci
c88af6e221
Elasticsearch: Add generic support for template variables (#32762)
* Elasticsearch: Add generic support for template variables

* format MovingAverage settings as numbers

* Move formatting logic to query builder & forma serial_diff settings as numbers

* modify presence check

* add todo

* minor fixes

* transform string values to numbers

* Move casting logic

* Slightly cleaner implementation

* Add BE tests

* Leverage elastic validation when string doesn't resolve to a numeric value

* move newly introduced test to testify

* add FE query_builder tests

* check error

* Parse values to float instead of int

* Fix tests & ParseFloat bit size
2021-04-26 16:54:23 +01:00
Ryan McKinley
7627b55ef4
TSDB: add deprecation comments to many tsdb structs (#33281) 2021-04-23 03:03:11 +02:00
Erik Sundell
743b77771f
fix dimension name (#33271) 2021-04-22 15:02:40 +02:00
Gábor Farkas
7ff6665ac2
Alerting: InfluxDB: InfluxQL: convert backend-code to use dataframes (#32950)
* alerting: influxdb: refactor unit-tests

* alerting: influxdb: converted code from timeseries-mode to dataframe-mode

* influxdb: simplify code

* influxdb: better function name

* influxdb: alerting: more tests

* influxdb: alerting: more tests

* influxdb: refactor

* influxdb: improved unit-test

* influxdb: simplified code

* influxdb: refactor reponse-parser code

* influxdb: refactor unit tests

* influxdb: alerting: use nicer names

Co-authored-by: dsotirakis <sotirakis.dim@gmail.com>
2021-04-22 08:43:17 +02:00
Marcus Efraimsson
dd0ba96d7c
Postgres: Fix time group macro when TimescaleDB is enabled and interval is less than a second (#33153)
Fixing a special case with time group macro when 
using TimescaleDB and interval is lower than a second.

Fixes #33124
2021-04-21 12:54:49 +02:00
Ryan McKinley
18bbbaf53e
TestData: support boolean and strings in CSV metric response (#33099) 2021-04-20 11:17:06 -07:00
Ivana Huckova
4f7728738e
WIP (#33025) 2021-04-15 15:06:26 +02:00
Erik Sundell
dac9393061
CloudMonitoring: Use response unit instead of metric descriptor unit (#32928)
* improve unit detection

* Update docs/sources/datasources/google-cloud-monitoring/_index.md

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>

* goimports

* fix typo

* golint fixes

* Update docs/sources/datasources/google-cloud-monitoring/_index.md

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* Update docs/sources/datasources/google-cloud-monitoring/_index.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/datasources/google-cloud-monitoring/_index.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/datasources/google-cloud-monitoring/_index.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/datasources/google-cloud-monitoring/_index.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* pr feedback

* Update docs/sources/datasources/google-cloud-monitoring/_index.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-04-14 16:41:02 +02:00
Giordano Ricci
cdb4785496
Elasticsearch: Allow omitting field when metric supports inline script (#32839)
* Elasticsearch: Allow omitting field when metric supports inline script

* Add tests for MetricEditor to show a None option

* Add tests for useFields hook

* Alerting: allow elasticsearch metrics without field
2021-04-14 15:18:06 +01:00
Kyle Brandt
2d7e980da7
testData: (backend) restore null/nan in predicatable scenarios (#32855) 2021-04-09 14:23:51 -04:00
Josh Hunt
5289603a59
AzureMonitor: fix migration error from older versions of App Insights queries (#32372)
* AzureMonitor: fix nill reference error with missing timeGrain

* add a test

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-04-06 11:33:46 +01:00
Alexander Emelin
93292f6eef
Live: update Streaming plugin definitions, put frame schema in subscribe result data (#32561)
Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-04-02 19:41:45 +03:00
Ryan McKinley
d2afcdd415
Live: remove measurement controller (#32622) 2021-04-01 22:32:56 -07:00
Ryan McKinley
c7ea96940a
Arrow: move arrow support from frontend to backend only (#32575) 2021-04-01 10:30:08 -07:00
Ryan McKinley
1446d094b8
API: return query results as JSON rather than base64 encoded Arrow (#32303) 2021-03-31 08:35:03 -07:00
Dimitris Sotirakis
270a255c08
Add dash / and at @ signs escapes in regex (#32495) 2021-03-30 15:56:15 +03:00
Alexander Emelin
da05b7a07b
Live: http publish, refactor live interfaces (#32317) 2021-03-30 13:23:29 +03:00
Arve Knudsen
2c72f8babc
MSSQL: By default let driver choose port (#32417)
* MSSQL: By default let driver choose port

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-03-30 10:54:57 +02:00
Giordano Ricci
f7b408f99f
Elasticsearch: use application/x-ndjson content type for multisearch requests (#32282) 2021-03-29 23:41:45 +01:00
Marcus Efraimsson
b82c510581
Postgres/MySQL/MSSQL: Don't return connection failure details to the client (#32408)
For security reasons, log any SQL connection error 
details rather than returning it to the client.

Fixes #26623
Fixes #22000

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-03-29 13:03:01 +02:00
Ivana Huckova
5ce9fa360d
Loki: Convert Loki query response to dataframes (#32316)
* Return dataFrames instead of series

* Add test for parseResponse

* Update pkg/tsdb/loki/loki.go

Co-authored-by: Dimitris Sotirakis <sotirakis.dim@gmail.com>

* Fix linting, add test

Co-authored-by: Dimitris Sotirakis <sotirakis.dim@gmail.com>
2021-03-26 16:47:46 +01:00
Dimitris Sotirakis
2a5279911f
Add legend name to dataframes config (#32356) 2021-03-26 16:20:46 +02:00
Marcus Efraimsson
5985c199ae
SQL: Fix so that all captured errors are returned from sql engine (#32353) 2021-03-26 13:17:18 +01:00
Ryan McKinley
adda7c798a
Chore: use uppercase names in manual entry scenario (#32334) 2021-03-26 00:18:17 +01:00
Dimitris Sotirakis
95de48261b
Chore: Move away from convey - introduce testify (#32295)
* Generic OAuth: Prevent adding duplicated users

* Chore: Move away from convey - introduce testify

* Revert commits from another branch

* Fix formatting
2021-03-24 17:32:16 +01:00
Ryan McKinley
7f1b9eafda
Testdata: support null values in manual entry and return all data (#32276) 2021-03-24 08:45:43 +01:00
Alexander Emelin
336bc559a3
Basic streaming plugin support (#31940)
This pull request migrates testdata to coreplugin streaming capabilities,
this is mostly a working concept of streaming plugins at the moment, 
the work will continue in the following pull requests.
2021-03-23 20:24:08 +03:00
Will Browne
d7862c50b8
Plugins: Migrate CloudWatch to backend plugin SDK (#31149)
* first pass

* add instance manager

* fix tests

* remove dead code

* unexport fields

* cleanup

* remove ds instance from executor

* cleanup

* inline im

* remove old func

* get error working

* unexport field

* let fe do its magic

* fix channel name

* revert some tsdb changes

* fix annotations

* cleanup
2021-03-23 16:32:12 +01:00
Dimitris Sotirakis
fdaac2b8fb
Notifications: InfluxDB - Fix regex to include metrics with hyphen in aliases (#32224)
* Notifications: InfluxDB - fix regex to include metrics with hyphen

* Add hyphen check in tests
2021-03-23 13:14:21 +02:00
Nirojan Vythilingam
d45b341fc1
Add cloudwatch metrics for managed RabbitMQ service (#31838)
Co-authored-by: Nirojan Vythilingam <nirojan@users.noreply.github.com>
2021-03-23 08:44:30 +01:00
Andrej Ocenas
3ef9cac640
Tempo: Return new version of dataframe schema directly from the backend (#32116)
* Return dataframe directly from the backend

* Streamline some transforms

* Fix lint issues

* Remove unused lib

* Fix datasource test

* Fix imports and add some typings

* Fix the typings and some tests

* Add private doc comment

* Remove private tag

* Add comments

* Fix some API docs issues
2021-03-22 19:09:15 +01:00
Tom Daly
55258f2795
32120: Add missing Redshift metrics to CloudWatch data source (#32121) 2021-03-22 08:58:16 +01:00
Kyle Brandt
026bf1f9ca
SSE/InfluxDB: Change InfluxQL to work with server side expressions (#31691)
* SSE/InfluxDB: Change InfluxQL to work with server side expressions
updates the request to handle EpochMS as the time range (which is what expressions sends)
and the response to use millisecond timestamps instead of seconds.
fixes #31604
similar to https://github.com/grafana/grafana/pull/31455
2021-03-18 08:02:37 -04:00
Dimitris Sotirakis
2d72b4e69e
Prometheus: Convert Prometheus query response to dataframes (#31948)
* Convert Prometheus query response to dataframes

* Add parseResponse tests

* Fixed lint imports

* Force use UTC as timezone in timeVector

* Updated test to check timezone
2021-03-18 08:40:26 +02:00
Arve Knudsen
87c3a2b790
PluginManager: Make Plugins, Renderer and DataSources non-global (#31866)
* PluginManager: Make Plugins and DataSources non-global

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix integration tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Replace outdated command

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* DashboardService: Ensure it gets constructed with necessary parameters

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix build

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* DashboardService: Ensure it gets constructed with necessary parameters

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Remove dead code

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix test

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix test

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Remove FocusConvey

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix test

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Remove dead code

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Undo interface changes

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Backend: Move tsdbifaces.RequestHandler to plugins.DataRequestHandler

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Rename to DataSourceCount

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Consolidate dashboard interfaces into one

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix test

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix dashboard integration tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-03-17 16:06:10 +01:00
Arve Knudsen
65c1cb62a7
Chore: Move tsdbifaces.RequestHandler to plugins.DataRequestHandler (#31897)
* Backend: Move tsdbifaces.RequestHandler to plugins.DataRequestHandler

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-03-12 18:26:07 +01:00
Ryan McKinley
9dd1d5f553
Cloudwatch: use shared library for aws auth (#29550)
* use sdk for handling auth

* fix broken test

* lint fixes

Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
2021-03-12 14:30:21 +01:00
Zoltán Bedi
3b6168eb4a
Tempo: Add test for backend data source (#31835) 2021-03-11 08:18:24 +01:00
Erik Sundell
d512c5a1b4
Cloudwatch: ListMetrics API page limit (#31788)
* add list metrics api page limit

* Update docs/sources/datasources/cloudwatch.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-03-10 07:41:22 +01:00
Erik Sundell
2d660ee502
CloudWatch: Restrict auth provider and assume role usage according to Grafana configuration (#31805)
* restrict usage of providers and assume role according to grafana config

* update docs

* Update docs/sources/datasources/cloudwatch.md

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/tsdb/cloudwatch/cloudwatch.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/tsdb/cloudwatch/session_test.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* pr feedback

* fix failing test

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-03-09 21:20:59 +01:00
Erik Sundell
13dd9dff50
CloudWatch: Add support for EC2 IAM role (#31804)
* add support for iam role auth

* add stubbable func

* fix broken test

* goimports

* pr feedback
2021-03-09 20:50:16 +01:00
Arve Knudsen
b79e61656a
Introduce TSDB service (#31520)
* Introduce TSDB service

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
Co-authored-by: Will Browne <will.browne@grafana.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2021-03-08 07:02:49 +01:00
Zoltán Bedi
29c998f9eb
Tempo: Convert tempo to backend data source2
This reverts commit c15d1f498a.
2021-03-05 14:28:17 +01:00
Zoltán Bedi
c15d1f498a
Revert "Tempo: convert to backend data source (#31618)" (#31702)
This reverts commit 862f09376f.
2021-03-04 21:20:26 +01:00
Zoltán Bedi
53d4acdad2
Tempo: set authentication header properly (#31699) 2021-03-04 20:39:01 +01:00
Zoltán Bedi
862f09376f
Tempo: convert to backend data source (#31618)
* Tempo: Support opentelemetry response

* Tempo: convert Tempo to backend data source

* Update data source test

* Fix lint issues

* Apply suggestions from code review

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Return error when trace not found

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-03-04 18:23:02 +01:00
Ilya Stoliar
f5d1fa48ca
CloudWatch: Added AWS Timestream Metrics and Dimensions (#31624) 2021-03-03 11:25:45 +02:00
Erik Sundell
580332255d
add new metrics and dimensions (#31595) 2021-03-03 10:18:34 +01:00
Gábor Farkas
8d39e6640c
InfluxDB: Improve maxDataPoints error-message in Flux-mode, raise limits (#31259)
* influxdb: flux: improve error-message

* influxdb: flux: raise max-points tolerance limit

* influxdb: flux: better error-message

* influxdb: flux: different approach to nice-error-message-generation

* influxdb: flux: removed unnecessary whitespace

* influxdb: flux: better error message, new approach

* influxdb: flux: test max-data-points-exceeded situtation
2021-03-02 18:33:51 +01:00
Ivana Huckova
d5fee5a3f5
Loki: Add support for alerting (#31424)
* Create Loki backend template

* Update endpoint

* Adjust step

* Add test

* Change to use Loki client

* Address feedback, improve errors and comments

* Linting

* Update pkg/tsdb/loki/loki.go

* Update pkg/tsdb/loki/loki.go

* Update pkg/tsdb/loki/loki.go
2021-03-02 14:55:16 +01:00
Ilya Stoliar
ad37077610
CloudWatch: Added AWS Network Firewall metrics and dimensions (#31498) 2021-03-02 06:12:59 +01:00
Dimitris Sotirakis
554055e39d
Convert annotations to dataframes (#31400)
* Stop using transformation to tables

* Update datasource.ts to parse from dataframes

* Add test on transformToDataframe func

* Remove parseResponse and do the work inside parseToAnnotations method

* Name the dataframe after the RefID

* Small fix when mapping to annotation

* Add tests in annotation_query_test.go class

* Small fix in loop iteration

* Change for loop signature
2021-02-25 18:29:17 +02:00
Kyle Brandt
c9dbf5a0d0
Graphite/SSE: update graphite to work with server side expressions (#31455)
Changes the time value of the response to be milliseconds, which I think is like the other data sources I have seen.

Also if it sees the timerange values as numbers, assumes they are unixMS (and come from expressions, or our new backend.TimeRange type). When this timerange is used, the request is sent to graphite with from and until as epoch timestamps
2021-02-24 13:16:26 -05:00
Erik Sundell
055590890c
CloudWatch: Make it possible to specify custom api endpoint (#31402)
* wip: add endpoint field

* add endpoint to config and make sure it's part of the cache key

* update docs

* improve endpoint paragraph

* Update docs/sources/datasources/cloudwatch.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update public/app/plugins/datasource/cloudwatch/components/ConfigEditor.tsx

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* goimports

* Update docs/sources/datasources/cloudwatch.md

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* update snapshot

* Update docs/sources/datasources/cloudwatch.md

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
2021-02-24 16:05:14 +01:00
ying-jeanne
c57047a420
Postgres: allow providing TLS/SSL certificates as text in addition to file paths (#30353)
* postgres SSL certification

* add back the UI to configure SSL Authentication files by file path

* add backend logic

* correct unittest

* mini changes

* Update public/app/plugins/datasource/postgres/config_ctrl.ts

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update public/app/plugins/datasource/postgres/partials/config.html

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* mutex

* check file exist before remove

* change permission

* change default configuremethod to file-path

* Update public/app/plugins/datasource/postgres/partials/config.html

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* Update public/app/plugins/datasource/postgres/partials/config.html

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* Update public/app/plugins/datasource/postgres/partials/config.html

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* Update public/app/plugins/datasource/postgres/partials/config.html

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* rename sslconfiguremethod to sslconfigurationmethod

* frontend update

* solve comments

* Postgres: Convert tests to stdlib

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Postgres: Be consistent about TLS/SSL terminology

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* fix init inconsistancy

* Fix tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* naming convention

* Fix tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Undo change

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix TLS issue

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* change permissions

* Fix data source field names

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Clean up HTML

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Improve popover text

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix SSL input bug

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Undo unnecessary change

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Clean up backend code

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix build

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* More consistent naming

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Clean up code

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Enforce certificate file permissions

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* add settings

* Undo changes

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* fix windows file path

* PostgresDataSource: Fix mutex usage

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/tsdb/postgres/postgres.go

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* Apply suggestions from code review

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* fix compilation

* fix unittest

* Apply suggestions from code review

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* Apply suggestions from code review

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* mock function

* change kmutex package

* add kmutex into middleware

* lock connection file per datasource

* add unittest regarding concurrency

* version should be equal

* adding unittest

* fix the loop

* fix unitest

* fix postgres unittst

* remove comments

* move dataPath from arg to tlsManager struct field

* Use DecryptedValues method

Use cached decrypted values instead of
using secure json data decrypt which will
decrypt unchanged values over and over again.

* remove unneeded mutex in tests and cleanup tests

* fix the lint

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-02-23 22:10:55 +01:00
Ilya Stoliar
19c12b5451
CloudWatch: Added AWS Ground Station metrics and dimensions (#31362) 2021-02-23 20:36:18 +01:00
Gábor Farkas
1e7f2e93e6
InfluxDB: handle columns named "table" (#30985)
* influxdb: flux: manually calculate table-group-key

* influxdb: flux: added explanation about the group-key
2021-02-23 16:44:33 +01:00
Rafael de Elvira
c05cf9fdbb
Add new Cloudwatch AWS/DDoSProtection metrics and dimensions (#31297) 2021-02-23 13:50:40 +01:00
Rubycut
833446645a
Add eu-south-1 cloudwatch region, closes #31197 (#31198) 2021-02-23 10:42:54 +01:00
Ricky Putra
d56c5285e2
Postgres: Fix timeGroup macro converts long intervals to invalid numbers when TimescaleDB is enabled (#31179)
Fixes #27253
2021-02-15 17:15:57 +01:00
Torkel Ödegaard
cb5928fdb7
PieChart: Progress on new core pie chart (#28020)
Use visx for the Pie chart plugin.

Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com>
2021-02-11 14:32:33 +01:00
Andrej Ocenas
e0448513eb
Influx: Make max series limit configurable and show the limiting message if applied (#31025)
* Add configuration in ConfigEditor and default to 1000

* Show data in explore if any even if there is an error

* Update pkg/tsdb/influxdb/flux/executor.go

* Better handling of defaults

* Add test for runQuery to show data even with error

* Update public/app/store/configureStore.ts

Co-authored-by: Giordano Ricci <gio.ricci@grafana.com>

* Update public/app/plugins/datasource/influxdb/components/ConfigEditor.tsx

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>

* Update tooltip

* Update input

* Lint fixes

* Update snapshots

* Update decorator tests

Co-authored-by: Giordano Ricci <gio.ricci@grafana.com>
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2021-02-10 15:23:19 +01:00
Nutmos
45b9ea7b4e
Prometheus: Min step defaults to seconds when no unit is set to prevent errors when running alerts. (#30966)
* update interval to fix no unit

* fix bug

* update with new method

* format go

* add test

* change test method to add test error nil

* add simplejson and model package

* change json format

* add parentheses

* add simplejson to function

* change mode to model

* move assert import package

* add one enter to avoid goimport error

* change to test case
2021-02-09 10:23:38 +01:00
Marcus Efraimsson
043d6cd584
Backend Plugins: Convert test data source to use SDK contracts (#29916)
Converts the core testdata data source to use the SDK contracts and by that 
implementing a backend plugin in core Grafana in similar manner as an external one.

Co-authored-by: Will Browne <will.browne@grafana.com>
Co-authored-by: Marcus Efraimsson <marefr@users.noreply.github.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-01-29 18:33:23 +01:00
Marcus Efraimsson
f62eb28f3e
Datasource: Use json-iterator configuration compatible with standard library (#30732)
This will make sure that any map keys in JSON is ordered in /api/ds/query response.
2021-01-29 15:31:19 +01:00
David
1bdd3eb3dd
Influx: Show all datapoints for dynamically windowed flux query (#30688) 2021-01-28 11:36:17 +01:00
Arve Knudsen
be8ba8ef46
Postgres: Convert tests to stdlib (#30536)
* Postgres: Convert tests to stdlib

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-01-22 10:34:53 -05:00
Arve Knudsen
7126a91901
Postgres: Be consistent about TLS/SSL terminology (#30532)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-01-22 14:53:37 +01:00
Will Browne
7562c6749d
Cloud Monitoring: Fix legend naming with display name override (#30440)
* Cloud Monitoring: Fix legend naming with display name override

* include MQL queries

* cover all bases

* refactor
2021-01-21 15:08:57 +01:00
Erik Sundell
d9d27340b5
prevent field config from being overwritten (#30437) 2021-01-20 16:40:37 +01:00
Will Browne
c9da053e5d
Alerting: Evaluate data templating in alert rule name and message (#29908)
* evaluate Go style template

* inlince func

* add test case

* PR feedback and add tests for templte data map func

* Add test case

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* do regex check

* ensure ecape

* small cleanup

* dont exit on template execution errors

* add info tooltip

* add docs

* switch from go tmpl to regex

* update docs/comments

* update tooltip wording

* update docs wording

* add simple test

* avoid .MustCompile

* point to labels in docs

* update docs

* fix docs links

* remove line

* fix lint

* add note about multiple labels

* propagate labels for CM

* update docs

* remove whitespace

* update task title

* update docs

* pr feedback

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-01-19 22:02:44 +01:00
Andrej Ocenas
218a8de220
NodeGraph: Add node graph visualization (#29706)
* Add GraphView component

* Add service map panel

* Add more metadata visuals

* Add context menu on click

* Add context menu for services

* Fix service map in dashboard

* Add field proxy in explore linkSupplier

* Refactor the link creation

* Remove test file

* Fix scale change when view is panned

* Fix node centering

* Don't show context menu if no links

* Fix service map containers

* Add collapsible around the service map

* Fix stats computation

* Remove debug log

* Fix time stats

* Allow string timestamp

* Make panning bounded

* Add zooming by mouse wheel

* Clean up the colors

* Fix stats for single trace graph

* Don't show debug config

* Add more complex layout

* Update layout with better fixing of the root nodes

* Code cleanup

* Change how we pass in link creation function and some more cleanup

* Refactor the panel section into separate render methods

* Make the edge hover more readable

* Move stats computation to data source

* Put edge labels to front

* Simplify layout for better multi graph layout

* Update for dark theme

* Move function to utils

* Visual improvements

* Improve context menu detail

* Allow custom details

* Rename to NodeGraph

* Remove unused dependencies

* Use named color palette and add some fallbacks for missing data

* Add test data scenario

* Rename plugin

* Switch scroll zoom direction to align with google maps

* Do some perf optimisations and rise the node limit

* Update alert styling

* Rename function

* Add tests

* Add more tests

* Change data frame column mapping to use column names

* Fix test

* Fix type errors

* Don't show context menu without links

* Add beta status to panel

* Fix tests

* Changed function to standard methods

* Fix typing

* Clean up yarn.lock

* Add some UI improvements

- better styling of the zoom buttons
- disable buttons when max reached

* Fix panel references after rename

* Add panel icon
2021-01-19 16:34:43 +01:00
Mitsuhiro Tanda
717827725f
Cloud Monitoring: MQL support (#26551)
* cloud monitoring mql support

* reduce nesting

* remove resource type from deep link since. its removed for two reasons. first of all it is not needed for the link to work. secondly, by adding the resource type, the the link will differ from the query in grafana which I think is misleading

* use frame.meta.executedQueryString instead of legacy meta

Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
2021-01-18 13:48:43 +01:00
Chris Cowan
5088e2044a
Elasticsearch: Support extended stats and percentiles in terms order by (#28910)
Adds support to the terms aggregation for ordering by percentiles and extended stats. 

Closes #5148

Co-authored-by: Giordano Ricci <grdnricci@gmail.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-01-15 12:10:16 +01:00
ying-jeanne
65b0365aeb
Cloud Monitoring: Convert datasource to use Dataframes (#29830)
* Convert Cloud Monitoring (Stackdriver) Datasource to use Dataframes #29830

* add deeplink into config

* omggggggggggggggg this deeplink works!

* move unit to the backend part

* remove unit from frontend

* only set the config fields[1] for deeplink and unit

* refactory + fix some test

* remove frontend test for unit

* adding backend test for unit mapping

* resolve review

* rewrtie unit logic to do exactly the same as frontend filter

* refactory
2021-01-14 14:16:20 +01:00
Chris Cowan
3d7748d9f8
Elasticsearch: Use minimum interval for alerts (#30049)
The current backend code doesn't honor the minimum interval set in the UI for alerts using 
the Elasticsearch data source. This means that the data the alerts are triggering against 
will never match the data in the visualization if auto is used in the date histogram as interval. 
This fixes the problem to make sure that date histogram auto interval is set according to 
min interval set in UI for the query or fallback to data source min interval setting.

Fixes #22082

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-01-14 10:48:59 +01:00
Erik Sundell
64d600f971
Cloudwatch: Move deep link creation to the backend (#30206)
* get meta data from dataframe meta

* gmdMeta is not used anymore

* wip: move deep link creation to backend

* Refactor backend. Remove not used front end code

* Unit test deep links. Remove not used frontend tests

* remove reference to gmdmeta

* fix goimports error

* fixed after pr feedback

* more changes according to pr feedback

* fix lint issue

* fix bad math expression check and fix bad test

* Decrease nesting

* put link on first data field only
2021-01-13 15:30:09 +01:00
Arve Knudsen
0e2f1fe3f5
Metrics API: Use jsoniter for JSON encoding (#30250)
* QueryMetricsV2: Stream response

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* API: Use jsoniter instead of standard JSON package

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-01-13 15:20:25 +01:00
Chris Cowan
cf1c01dd8b
Elasticsearch: Add Support for Serial Differencing Pipeline Aggregation (#28618)
* Elasticsearch: Add support for serial diff pipeline aggregation

* Removing settings transsforms

* Removing unused deps

* removing unused dep

* Fixing type in test

* Adding backend support for serial_diff
2021-01-08 11:52:23 +00:00
Arve Knudsen
25048ebdf8
Chore: Add CloudWatch HTTP API tests (#29691)
* CloudWatch: Add HTTP API tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-01-07 11:36:13 +01:00
Emil Hessman
b2b3a603e8
Chore: Rewrite elasticsearch client test to standard library (#30093) 2021-01-07 09:35:56 +01:00
Emil Hessman
2b9387210b
Chore: Rewrite tsdb influxdb test to standard library (#30091) 2021-01-07 09:31:34 +01:00
Emil Hessman
78d72007d8
Chore: Rewrite tsdb cloudmonitoring test to standard library (#30090) 2021-01-06 20:42:48 +01:00
Emil Hessman
6f72ae38d5
Chore: Rewrite tsdb azuremonitor time grain test to standard library (#30089) 2021-01-06 20:16:53 +01:00
Emil Hessman
874dc3d584
Chore: Rewrite tsdb graphite test to standard library (#30088) 2021-01-06 20:14:25 +01:00
Emil Hessman
5c0094feef
Chore: Rewrite influxdb query parser test to standard library (#29940) 2020-12-21 07:51:46 +01:00
Emil Hessman
19b2845581
Chore: Convert tsdb request test to standard library (#29936)
* Chore: Convert tsdb request test to standard library

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-12-20 11:53:28 +01:00
Emil Hessman
408c96fee3
Chore: Convert tsdb interval test to standard library (#29935) 2020-12-20 09:43:06 +01:00
Arve Knudsen
dd2d206d99
Backend: Remove more globals (#29644)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-12-15 19:09:04 +01:00
Arve Knudsen
c2cad26ca9
Chore: Disable default golangci-lint filter (#29751)
* Disable default golangci-lint filter

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Chore: Fix linter warnings

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-12-15 09:32:06 +01:00
Arve Knudsen
ac09baae7d
Chore: Use Header.Set method instead of Header.Add (#29804)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-12-14 15:13:01 +01:00
Emil Hessman
cedaf41a36
Chore: Rewrite opentsdb test to standard library (#29792) 2020-12-14 09:33:25 +01:00
Benjamin Häringer
2b5a88bf8c
CloudWatch: Add support for AWS DirectConnect ConnectionErrorCount metric (#29583) 2020-12-14 10:02:16 +02:00
ying-jeanne
9668c172b3
CloudWatch: namespace in search expression should be quoted if match exact is enabled #29109 (#29563) 2020-12-08 12:37:07 +01:00
Emil Hessman
a5e43535b3
Chore: Rewrite tsdb sql engine test to standard library (#29590)
* Chore: Rewrite tsdb sql engine test to standard library

Signed-off-by: Emil Hessman <emil@hessman.se>
2020-12-07 09:10:33 +01:00
Ryan McKinley
752d4ed941
Cloudwatch: session cache should use UTC consistently (#29627) 2020-12-04 12:44:16 -08:00
Emil Hessman
3c1bcc7275
Chore: Rewrite tsdb prometheus test to standard library (#29592)
Signed-off-by: Emil Hessman <emil@hessman.se>
2020-12-04 08:49:39 +01:00
Emil Hessman
69ac69b7c5
Chore: Rewrite tsdb testdatasource scenarios test to standard library (#29591)
Signed-off-by: Emil Hessman <emil@hessman.se>
2020-12-03 21:31:01 +01:00
Sebastian Poxhofer
63c8945db5
AzureMonitor: Unit MilliSeconds naming (#29399) 2020-12-02 10:09:33 +01:00
Arve Knudsen
f55818ca70
Chore: Enable exhaustive linter (#29458)
* Chore: Enable exhaustive linter

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-12-01 09:53:27 +01:00
Arve Knudsen
107f658229
prometheus: Improve IsAPIError's documentation (#29432)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-11-27 12:05:49 +01:00
Tom Daly
ee3475d900
Elasticsearch: Fix index pattern not working with multiple base sections (#28348)
* Add logic to allow for multiple [] sections in pattern

* Small refactor

* Fix goimport error

* Refactor formateDate
2020-11-27 10:50:35 +01:00
Will Browne
d10a8b2761
Alerting: Improve Prometheus Alert Rule error message (#29390)
* provide better ctx for prom err

* rework

* Update pkg/tsdb/prometheus/prometheus.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/tsdb/prometheus/prometheus.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* call func

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-11-26 13:38:36 +01:00
Ryan McKinley
cfaca42e97
InfluxDB: update flux library and support boolean label values (#29310) 2020-11-23 13:19:52 -08:00
Arve Knudsen
9593d57914
Chore: Enable errorlint linter (#29227)
* Enable errorlint linter
* Handle wrapped errors

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
2020-11-19 14:47:17 +01:00
Kyle Brandt
0cb29d337a
Expressions: Move GEL into core as expressions (#29072)
* comes from grafana/gel-app
* remove transform plugin code
* move __expr__ and -100 constants to expr pkg
* set OrgID on request plugin context
* use gtime for resample duration
* in resample, rename "rule" to "window", use gtime for duration, parse duration before exec
* remove gel entry from plugins-bundled/external.json
which creates an empty array for plugins
2020-11-19 07:17:00 -05:00
Karl Atkinson
65ed8a76a6
CloudWatch: added HTTP API Gateway specific metrics and dimensions (#28780) 2020-11-17 19:27:20 +01:00
Arve Knudsen
4dd7b7a82d
Chore: Remove unused Go code (#28852)
* Chore: Remove more unused Go code

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-11-17 11:51:31 +01:00
Arve Knudsen
2bf964c61e
Chore: Fix linting issues caught by ruleguard (#28799)
* Chore: Fix linting issues caught by ruleguard

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Improve error check

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-11-17 11:27:45 +01:00
kay delaney
9659c98d61
Test Datasource/Bug: Fixes division by zero in csv metric values scenario (#29029)
Closes #8705
2020-11-12 16:20:08 +00:00
Tom Daly
18f3969fdb
Add 'EventBusName' dimension to CloudWatch 'AWS/Events' namespace (#28402) 2020-11-12 16:48:35 +02:00
Marcus Efraimsson
ded4be0435
CloudWatch: Add support for AWS/ClientVPN metrics and dimensions (#29055)
Fixes #28778
2020-11-12 15:47:02 +01:00
Sofia Papagiannaki
43f580c299
AlertingNG: manage and evaluate alert definitions via the API (#28377)
* Alerting NG: prototype v2 (WIP)

* Separate eval package

* Modify eval alert definition endpoint

* Disable migration if ngalert is not enabled

* Remove premature test

* Fix lint issues

* Delete obsolete struct

* Apply suggestions from code review

* Update pkg/services/ngalert/ngalert.go

Co-authored-by: Kyle Brandt <kyle@grafana.com>

* Add API endpoint for listing alert definitions

* Introduce index for alert_definition table

* make ds object for expression to avoid panic

* wrap error

* Update pkg/services/ngalert/eval/eval.go

* Swith to backend.DataQuery

* Export TransformWrapper callback

* Fix lint issues

* Update pkg/services/ngalert/ngalert.go

Co-authored-by: Kyle Brandt <kyle@grafana.com>

* Validate alert definitions before storing them

* Introduce AlertQuery

* Add test

* Add QueryType in AlertQuery

* Accept only float64 (seconds) durations

* Apply suggestions from code review

* Get rid of bus

* Do not export symbols

* Fix failing test

* Fix failure due to service initialization order

Introduce MediumHigh service priority and assign it to backendplugin
service

* Fix test

* Apply suggestions from code review

* Fix renamed reference

Co-authored-by: Kyle Brandt <kyle@grafana.com>
2020-11-12 15:11:30 +02:00
Chris Cowan
4ed7612e57
Elasticsearch: Add Moving Function Pipeline Aggregation (#28131)
* Elasticsearch: Add Moving Function Pipeline Aggregation

* Removing support for moving average in 7.x

* Fixing getMetricAggTypes to handle undefined esVersion

* Adding moving_fn to go code

* Update public/app/plugins/datasource/elasticsearch/metric_agg.ts

Co-authored-by: Giordano Ricci <grdnricci@gmail.com>

* Adding test for esversion 70

* Removing default value for script, adding placeholder instead

* Fixing formatting

* Adding code for handling missing or obsolete aggregations

Co-authored-by: Giordano Ricci <grdnricci@gmail.com>
2020-11-11 17:42:28 +00:00
Arve Knudsen
b5379c5335
Chore: Fix SQL related Go variable naming (#28887)
* Chore: Fix variable naming

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-11-11 06:21:08 +01:00
Ryan McKinley
b91e9faccf
Live: update centrifuge and the ChannelHandler api (#28843) 2020-11-05 10:37:04 -08:00
Arve Knudsen
676d393ec9
Chore: Fix issues reported by staticcheck; enable stylecheck linter (#28866)
* Chore: Fix issues reported by staticcheck

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Apply suggestions from code review

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
2020-11-05 15:37:11 +01:00
Arve Knudsen
574553ec7b
Chore: Fix issues found by staticcheck (#28802)
* Fix linting issues

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-11-05 11:29:39 +01:00
Arve Knudsen
dff84f6a31
Chore: Remove dead code (#28664)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-11-05 11:00:00 +01:00
Ryan McKinley
b7a8416e02
Live: improve broadcast semantics and avoid double posting (#28765) 2020-11-03 09:11:23 -08:00
Torkel Ödegaard
fa567de9b8
Cloudwatch: Fix issue with field calculation transform not working properly with Cloudwatch data (#28761)
* Cloudwatch: Fix issue with reducer transform not working properly with Cloudwatch data

* Updated go sdk and updated code

* CloudWatch: Improve test

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-11-03 11:24:26 +01:00
Arve Knudsen
00508295d1
CloudWatch: Improve method name, performance optimization (#28632)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-10-29 08:27:24 +01:00
kay delaney
c4c5b2dc61
CloudWatch Logs queue and websocket support (#28176)
CloudWatch Logs queue and websocket support
2020-10-28 08:36:57 +00:00
Kyle Brandt
96e6524a7d
AzureMonitor: Support decimal (as float64) type in analytics/logs (#28480)
loss of precision but will make the response work instead of erroring
follows work already done in the ADX plugin
fixes #28278
2020-10-26 08:27:16 -04:00
Ryan McKinley
2aafa39879
Live: support real time measurements (alpha) (#28022)
* improve reduce transformer

* add measurment classes

* sync with new grafana measure format

* use address for live

* use plural in URL

* set the field name

* fix build

* find changes

* POST http to channel

* Yarn: Update lock file (#28014)

* Loki: Run instant query only in Explore (#27974)

* Run instant query only in Explore

* Replace forEach with for loop

* don't cast

* Docs: Fixed row display in table (#28031)

* Plugins: Let descendant plugins inherit their root's signature (#27970)

* plugins: Let descendant plugins inherit their root's signature

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Registry: Fix service shutdown mode trigger location (#28025)

* Add Alex Khomenko as member (#28032)

* show history

* fix confirm

* fix confirm

* add tests

* fix lint

* add more errors

* set values

* remove unrelated changes

* unrelated changes

* Update pkg/models/live.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/models/live.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/services/live/live.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/services/live/pluginHandler.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/services/live/pluginHandler.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/services/live/pluginHandler.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* use measurments for testdata endpoints

* add live to testdata

* add live to testdata

* Update pkg/services/live/channel.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Apply suggestions from code review

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* update comment formats

* uprevert testdata

* Apply suggestions from code review

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>

* Apply suggestions from code review

* CloudWatch: Add EC2CapacityReservations Namespace (#28309)

* API: Fix short URLs (#28300)

* API: Fix short URLs

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Chore: Add cloud-middleware as code owners (#28310)

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* SQLStore: Run tests as integration tests (#28265)

* sqlstore: Run tests as integration tests

* Truncate database instead of re-creating it on each test

* Fix test description

See https://github.com/grafana/grafana/pull/12129

* Fix lint issues

* Fix postgres dialect after review suggestion

* Rename and document functions after review suggestion

* Add periods

* Fix auto-increment value for mysql dialect

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>

* Drone: Fix grafana-mixin linting (#28308)

* Drone: Fix Starlark script

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* grafana-mixin: Move build logic to scripts

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Drone: Use mixin scripts

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* CI build image: Install jsonnetfmt and mixtool

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Makefile: Print commands

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* should only ignore the file in the grafana mixin root folder (#28306)

Signed-off-by: bergquist <carl.bergquist@gmail.com>

* fix: for graph size not taking up full height or width

* Graph NG: fix toggling queries and extract Graph component from graph3 panel (#28290)

* Fix issue when data and config is not in sync

* Extract GraphNG component from graph panel and add some tests coverage

* Update packages/grafana-ui/src/components/uPlot/hooks.test.ts

* Update packages/grafana-ui/src/components/uPlot/hooks.test.ts

* Update packages/grafana-ui/src/components/uPlot/hooks.test.ts

* Fix grid color and annotations refresh

* Drone: Use ${DRONE_TAG} in release pipelines, since it should work (#28299)

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Explore: respect min_refresh_interval (#27988)

* Explore: respect min_refresh_interval

Fixes #27494

* fixup! Explore: respect min_refresh_interval

* fixup! Explore: respect min_refresh_interval

* UI: export defaultIntervals from refresh picker

* fixup! Explore: respect min_refresh_interval

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>

* Loki: Base maxDataPoints limits on query type (#28298)

* Base maxLines and maxDataPoints based on query type

* Allow overriding the limit to higher value

* Bump tree-kill from 1.2.1 to 1.2.2 (#27405)

Bumps [tree-kill](https://github.com/pkrumins/node-tree-kill) from 1.2.1 to 1.2.2.
- [Release notes](https://github.com/pkrumins/node-tree-kill/releases)
- [Commits](https://github.com/pkrumins/node-tree-kill/compare/v1.2.1...v1.2.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump handlebars from 4.4.3 to 4.7.6 (#27416)

Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.4.3 to 4.7.6.
- [Release notes](https://github.com/wycats/handlebars.js/releases)
- [Changelog](https://github.com/handlebars-lang/handlebars.js/blob/master/release-notes.md)
- [Commits](https://github.com/wycats/handlebars.js/compare/v4.4.3...v4.7.6)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Build(deps): Bump http-proxy from 1.18.0 to 1.18.1 (#27507)

Bumps [http-proxy](https://github.com/http-party/node-http-proxy) from 1.18.0 to 1.18.1.
- [Release notes](https://github.com/http-party/node-http-proxy/releases)
- [Changelog](https://github.com/http-party/node-http-proxy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/http-party/node-http-proxy/compare/1.18.0...1.18.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Automation: Add backport github action (#28318)

* BackendSrv: Fixes queue countdown when unsubscribe is before response (#28323)

* GraphNG: Use AxisSide enum (#28320)

* IssueTriage: Needs more info automation and messages (#28137)

* IssueTriage: Needs more info automation and messages

* Updated

* Updated

* Updated wording

* SAML: IdP-initiated SSO docs (#28280)

* SAML: IdP-initiated SSO docs

* Update docs/sources/enterprise/saml.md

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>

* Apply suggestions from code review

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>

* Loki: Run instant query only when doing metric query (#28325)

* Run instant query only when doing metric query

* Update public/app/plugins/datasource/loki/datasource.ts

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>

* Automation: Tweaks to more info message (#28332)

* AlertingNG: remove warn/crit from eval prototype (#28334)

and misc cleanup

* area/grafana/toolkit: update e2e docker image (#28335)

* add xvfb to image

* comment out toolkit inclusion

* add latest tag

* update packages for cypress

* cleanup script

* Update auth-proxy.md (#28339)

Fix a minor grammar mistake: 'handling' to 'handle'.

* Git: Create .gitattributes for windows line endings (#28340)

With this set, Windows users will have text files converted from Windows style line endings (\r\n) to Unix style line endings (\n) when they’re added to the repository.
https://www.edwardthomson.com/blog/git_for_windows_line_endings.html

* Docs: Add docs for valuepicker (#28327)

* Templating: Replace all '$tag' in tag values query (#28343)

* Docs: Add missing records from grafana-ui 7.2.1 CHANGELOG (#28302)

* Dashboard links: Places drop down list so it's always visible (#28330)

* calculating whether to place the list on the right or left edge of the parent

* change naming and add import of createRef

* Automation: Update backport github action trigger (#28352)

It seems like GitHub has solved the problem of running github actions on PRs from forks with access to secrets. 

https://github.blog/2020-08-03-github-actions-improvements-for-fork-and-pull-request-workflows/#improvements-for-public-repository-forks

If I change the event that triggers it to pull_request_target the action is run in the context of the base instead of the merged PR branch

* ColorSchemes: Adds more color schemes and text colors that depend on the background (#28305)

* Adding more color modes and text colors that depend on the background color

* Updates

* Updated

* Another big value fix

* Fixing unit tests

* Updated

* Updated test

* Update

* Updated

* Updated

* Updated

* Updated

* Added new demo dashboard

* Updated

* updated

* Updated

* Updateed

* added beta notice

* Fixed e2e test

* Fix typos

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* revert pseduo code

* apply feedback

* remove HTTP for now

* fix backend test

* change to datasource

* clear input for streams

* fix docs?

* consistent measure vs measurements

* better jsdocs

* fix a few jsdoc errors

* fix comment style

* Remove commented out code

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Clean up code

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Clean up code

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Clean up code

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Clean up code

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Clean up code

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Clean up code

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Clean up code

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/models/live.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix build

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* set the stringField

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
Co-authored-by: ozhuang <ozhuang.95@gmail.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Amos Law <ahlaw.dev@gmail.com>
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
Co-authored-by: The Rock Guy <fabian.bracco@gvcgroup.com.au>
Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
Co-authored-by: Carl Bergquist <carl@grafana.com>
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
Co-authored-by: Elliot Pryde <elliot.pryde@elliotpryde.com>
Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>
Co-authored-by: Kyle Brandt <kyle@grafana.com>
Co-authored-by: Brian Gann <briangann@users.noreply.github.com>
Co-authored-by: J-F-Far <joel.f.farthing@gmail.com>
Co-authored-by: acoder77 <73009264+acoder77@users.noreply.github.com>
Co-authored-by: Peter Holmberg <peterholmberg@users.noreply.github.com>
Co-authored-by: Krzysztof Dąbrowski <krzysdabro@live.com>
Co-authored-by: maknik <mooniczkam@gmail.com>
2020-10-22 09:10:26 +02:00
Krzysztof Warunek
a71eadf379
CloudWatch/Athena - valid metrics and dimensions. (#28436)
* CloudWatch/Athena - valid metrics and dimensions.
In accordance with https://docs.aws.amazon.com/athena/latest/ug/query-metrics-viewing.html.

* Athena: add ProcessedBytes dimension instead of DataScannedInBytes
2020-10-22 10:04:13 +03:00
Arve Knudsen
ec40e49dcb
Chore: Rewrite some tests to use testify (#28420)
* Chore: Improve tests to use testify

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-10-21 10:09:42 +02:00
Arve Knudsen
af17f9fd9b
CloudWatch: Fix custom metrics (#28391)
* CloudWatch: Fix querying for custom metrics

Co-authored by Mitch McKenzie <mitch.mckenzie@outlook.com>

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-10-20 13:33:38 +02:00
Marcus Efraimsson
0e17a15fbd
CloudWatch: Adding support for additional Amazon CloudFront metrics (#28378)
Follow up to #28069 where some metrics was missed.

Ref #28069
2020-10-19 18:14:27 +02:00
The Rock Guy
c9cc82ea55
CloudWatch: Add EC2CapacityReservations Namespace (#28309) 2020-10-16 09:08:50 +02:00
Sofia Papagiannaki
4acbcd7053
AlertingNG: POC of evaluator under feature flag. (#27922)
* New feature toggle for enabling alerting NG

* Initial commit

* Modify evaluate alert API request

* Check for unique labels in alert execution result dataframes

* Remove print statement

* Additional minor fixes/comments

* Fix lint issues

* Add API endpoint for evaluating panel queries

* Push missing renaming

* add refId for condition to API

* add refId for condition to API

* switch dashboard based eval to get method

* add from/to params to dashboard based eval

* add from/to params to  eval endpoint

Co-authored-by: kyle <kyle@grafana.com>
2020-10-12 21:51:39 +03:00
Arve Knudsen
957c88eaca
CloudWatch: Re-implement authentication (#25548)
* CloudWatch: Revisit authentication

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* CloudWatch: Simplify auth code

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Use ARN

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Add Drone configuration

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Remove unused code

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Remove .drone.yml

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix external ID usage

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* CloudWatch: Fix issues after merge

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Remove stale code

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Remove stale code

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Use auth type enum

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix test snapshot

* Coordinate frontend and backend option names

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Remove old comments

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix front-end tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Introduce session cache

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Use constants

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix field alignment

* CloudWatch: Fix log message

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Tidy go.mod

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* CloudWatch: Handle arn auth type

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* CloudWatch: Fix role assumption duration

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix test

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* CloudWatch: Inline unnecessary constants

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* CloudWatch: Use serial comma in UI

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* CloudWatch: Inline unnecessary constants

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* CloudWatch: Fail if missing region

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* CloudWatch: Handle unconfigured region

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* CloudWatch: Log when using cached session

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* CloudWatch: Include region in cache key

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Add UI warnings for lecagy support

* Do not clear ARN fields whenging change authentication provider

* Graph NG: annotations display (#27972)

* Annotations support POC

* Fix markers memoization

* dev dashboard update

* Update public/app/plugins/panel/graph3/plugins/AnnotationsPlugin.tsx

* CloudWatch: Remove errors.BadRequest

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* CloudWatch: Undo unintentional change

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Remove log line

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix cache key computation

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Add region to cache key

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Improve log messages

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* CloudWatch: Add documentation

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Improve tooltip

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Improve docs

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Improve docs

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Improve docs

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Improve tooltip

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Add role assumption provisioning example

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Add upgrade notes

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Improve docs

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Apply suggestions from code review

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* backend: use latest sdk (#28147)

fixes #27713 via https://github.com/grafana/grafana-plugin-sdk-go/pull/227

* Docs: Update Permissions documentation (#28144)

* removed overview.md

* content updates

* Update datasource_permissions.md

* update content

* content updates

* Update organization_roles.md

* Update docs/sources/enterprise/saml.md

Co-authored-by: Kyle Brandt <kyle@grafana.com>

* Update dashboard_folder_permissions.md

Co-authored-by: Kyle Brandt <kyle@grafana.com>

* area/grafana/toolkit: ci-package needs to use synchronous writes (#28148)

* ci needs to use synchronous writes or the file ends up with zero length

* <Enterprise Docs> Add instructions to upload license via UI (#28067)

* Add UI license upload option, reformat Enterprise license activation section

Added the option to upload a license file through the Server Admin UI, and did a little reformatting to make license activation look more like a process.

* Headers not bold, hyphens not asterisks

* Github: run metrics collector workflow every 10min (#28153)

* GithubActions: Updated cron schedule

* Updated

* Docs: Update explore docs: remove dot at the end of line (#28151)

HI - Removed Dot(.) at the end of line to make it consistent with other 2 points.

Thanks,
Ashish

* Fix frontend tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix frontend tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Docs: Update upgrade notes

Co-authored-by: Sofia Papagiannaki <sofia@grafana.com>
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Kyle Brandt <kyle@grafana.com>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
Co-authored-by: Brian Gann <briangann@users.noreply.github.com>
Co-authored-by: Mitch Seaman <mjseaman@users.noreply.github.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
Co-authored-by: ashishagarwal06 <34888589+ashishagarwal06@users.noreply.github.com>
2020-10-12 17:58:58 +02:00
Kyle Brandt
e16637793d
Alerting: Add labels to name when converting data frame to series (#28085)
* also move conversion func to alerting package since it is not used in other places

Fixes #28068
2020-10-09 08:21:16 -04:00
Kyle Brandt
c9a5d1ad4b
AzureMonitor: pass through null values instead of 0 (#28126)
fixes #28001
2020-10-09 08:15:19 -04:00
Darryl
21fc3e702b
Cloudwatch: Adding support for additional Amazon CloudFront. (#27891) (#28069)
* Cloudwatch: Adding support for additional Amazon CloudFront metrics.
2020-10-07 19:03:05 +02:00
jgulick48
9cd3ab0340
Cloudwatch: Adding support for Amazon ElastiCache Redis metrics. (#28040)
* Cloudwatch: Adding support for Amazon ElastiCache Redis metrics.
2020-10-06 19:52:02 +02:00
Spencer Taylor
3606e282ba
CloudWatch: Add missing TransitGateway dimension (#28061)
Adding missing TransitGatewayAttachment dimension to the AWS/TransitGateway namespace.
2020-10-06 19:22:03 +02:00
Arve Knudsen
0a2ef086b3
Chore: Convert CloudWatch metrics to data frames (#27449)
* CloudWatch: Convert metrics results to data frames

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

Co-authored-by: kay delaney <kay@grafana.com>
2020-10-06 13:45:58 +02:00
jgulick48
7c2999709c
Cloudwatch: Add support for AWS DirectConnect virtual interface metrics and add missing dimensions (#28008)
* Cloudwatch: Add support for AWS DirectConnect virtual interface metrics.

* Cloudwatch: Adding dimentions to the AWS/DX namespace for virtual network interface based DirectConnect.
2020-10-05 19:19:40 +03:00
Matheus Alcantara
7d7e727f22
Cloudwatch: Convert go convey tests to standard test library (#28003)
* Cloudwatch: Convert go convey tests to standard test library

* Fix tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-10-02 19:40:15 +02:00
Arve Knudsen
a078e40238
Settings: Rename constants/variables to follow Go naming standards (#28002)
* settings: Rename constants/variables to follow Go naming standards
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-10-02 15:45:45 +02:00
Torkel Ödegaard
adc1b965f3
PanelData: Adds annotations and QueryResultMeta dataTopic (#27757)
* topics round two

* more props

* remove Data from enum

* PanelData: Simplify ideas a bit to only focus on the addition of annotations in panel data

* Test data scenario

* Old graph panel showing annotations from PanelData

* Fixed comment

* Fixed issues trying to remove use of event.source

* Added unit test

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2020-09-24 21:01:31 +02:00
Sofia Papagiannaki
42476811a4
Cloudwatch: Fix loading custom credentials profile (#27684)
* Store credentials profile in JSON

* Update docs example

* Apply suggestions from code review

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-09-24 19:21:17 +03:00
Giordano Ricci
4c7131425b
Revert "Elasticsearch: add frozen indices search support (#27472)" (#27726)
This reverts commit 61a3160c34.
2020-09-23 12:24:46 +01:00
Jorge Vallecillo
9e3def4214
Fix typos (#27711) 2020-09-22 11:00:59 -07:00
Arve Knudsen
a5d9196a53
Chore/fix lint issues (#27704)
* Chore: Fix linting issues

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-09-22 16:22:19 +02:00
Giordano Ricci
61a3160c34
Elasticsearch: add frozen indices search support (#27472)
* Elasticsearch: Add frozen indices support for alerting
2020-09-18 18:27:25 +01:00
Marcus Efraimsson
e85b266f2e
Azure/Insights: Fix handling of none dimension values (#27513)
Properly handle legacy dimension values in the backend.

Fixes #27512
2020-09-10 18:21:56 +02:00
kay delaney
22d6cfc358
DataSource/CloudWatch: Adds metadata to grouped CW Logs dataframe (#27454) 2020-09-09 08:38:53 +01:00
Ryan McKinley
6b0f56b726
InfluxDB: Alerting issue, reasonable defaults for interval and maxDataPoints (#27463) 2020-09-09 09:34:17 +02:00
Kyle Brandt
9bab551d8b
AzureMonitor: change filterDimensions property to match what is stored (#27459)
Changes the dimensionsFilters property to dimensionsFilter in the Azure Monitor Datasource's AzureMonitor service to make what is sent to match the saved model.

Before this, the property that the backend was expecting was not available in the case of alerting, where the stored model is fetched.

This also fixes a panic when there is a dimension alias but no dimension
2020-09-08 15:12:08 -04:00
Arve Knudsen
581d2eaaf4
Revert "Convert CloudWatch to use dataframes (#26702)" (#27448)
This reverts commit 7762839853.
2020-09-08 15:06:58 +02:00
Arve Knudsen
7762839853
Convert CloudWatch to use dataframes (#26702)
* CloudWatch: Convert metrics queries to return data frames

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-09-08 13:35:17 +02:00
Ato Araki
561920f18b
Cloud monitoring: fix missing title and text from cloud monitoring annotations (#27187)
* cloudmonitoring: fix empty title and text annotation

* cloudmonitoring: use metricQuery value
2020-09-08 13:18:41 +03:00
Arve Knudsen
4b1eb6e5c7
Chore: Enable gocyclo linter (#26395)
* Chore: Enable gocyclo linter

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* API: Fix linting issue

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* API: Refactor to reduce complexity

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix type assertion

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-09-07 22:10:06 +02:00
Ryan McKinley
ae385983f4
InfluxDB: support flux editor for template queries (#27370) 2020-09-03 14:11:39 -07:00
Szymon Szypulski
a8db544e85
Cloudwatch: Update list of AmazonMQ metrics and dimensions (#27332)
Update list of AmazonMQ metrics and Dimensions based on the current list
from the official AWS documentation.

Also, change InflightCount to InFlightCount.
2020-09-02 21:32:43 +02:00
Ryan McKinley
0bc67b032a
InfluxDB: return a table rather than an error when timeseries is missing time (#27320) 2020-09-01 15:06:38 -07:00
Kyle Brandt
06323b8e52
AzureMonitor: select plugin route from cloudname (#27273)
* AzureMonitor: select plugin route from cloudname
fixes #27243
2020-08-31 11:10:31 -04:00
Amir Szekely
c5a7afce44
Fix AWS action name (#27205)
The action name is `tag:GetResources`, not `tags:GetResources`. This creates a confusing error message that can have the user add the wrong permission to the IAM role.
2020-08-26 11:01:50 +02:00
Ryan McKinley
cd9a773427
InfluxDB: use converters from SDK (#27138) 2020-08-24 13:19:32 -07:00
Kyle Brandt
1778e9f034
Alerting: remove LongToWide call in alerting (#27140)
causing issues and currently as we use it, the query
should be requesting it as part of the query model via fromat as time series
fixes #27132
2020-08-24 10:05:52 -04:00
Arve Knudsen
c207ea12a4
InfluxDB: Clean up tests (#27135)
* InfluxDB: Clean up tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* InfluxDB: Platform agnostic paths

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-08-21 18:34:21 +02:00
Kyle Brandt
c724449d3d
AzureMonitor: fix panic introduced in 7.1.4 (#27113)
happens when unit was "Unspecified" and alias is being used
2020-08-21 11:37:30 -04:00
Ryan McKinley
a2a6b9448f
InfluxDB: exclude result and table column from Flux table results (#27081) 2020-08-20 10:52:46 -07:00
Kyle Brandt
660510084c
AzureAnalytics: Use fillmode Null with format as time series (#27054)
previously was using fillmode previous, which is not what we want here.
Also we do not have fill missing with this data source anyways
Fixes #27013
2020-08-19 10:42:54 -04:00
kay delaney
a1f90521a0
CloudWatch Logs: Move query response stats to appropriate FrameMeta property (#26732)
* CloudWatch Logs: Move query response stats to appropriate FrameMeta property
2020-08-19 15:18:04 +01:00
Arve Knudsen
0e1e85656b
InfluxDB: Upgrade InfluxDB in devenv (#26983)
* InfluxDB: Upgrade InfluxDB in devenv
* InfluxDB: De-export symbols
* InfluxDB: Remove unused code
* devenv: Make InfluxDB version configurable

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-08-19 09:23:11 +02:00
Arve Knudsen
a2fbffe48a
Server: Add health check route (#26999)
* Server: Add health check route

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Server: Remove health check middleware

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-08-18 14:58:08 +02:00
Arve Knudsen
7896836deb
Chore: Reduce TSDB Go code complexity (#26401)
* tsdb: Make code less complex
2020-08-18 14:43:18 +02:00
Arve Knudsen
be3bf80749
InfluxDB: Upgrade to latest InfluxDB Go client (#27021)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-08-17 08:32:26 +02:00
Arve Knudsen
50ebbb625e
InfluxDB: Upgrade Go client, use data source HTTP client (#27012)
* InfluxDB: Upgrade Go client, use data source HTTP client

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Remove unnecessary Close

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-08-14 18:40:02 +02:00
Kyle Brandt
f9f60c9193
AzureMonitor: map more units (#26990)
add BitsPerSecond and Seconds
2020-08-13 12:57:16 -04:00
Arve Knudsen
c63bbbaec3
InfluxDB: Close Flux query results (#26917)
* InfluxDB: Drop ctxhttp usage
* InfluxDB: Clean up code
* InfluxDB: Close query results

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-08-13 17:50:53 +02:00
Kyle Brandt
f432e153ca
Dataframe/Alerting: to tsdb.TimeSeriesSlice - accept "empty" time series (#26903)
this is in order to trigger no data when used with alerting.
fixes #26897.

This is perhaps better solved in the SDK but that needs more thought and is tracked in grafana/grafana-plugin-sdk-go#214
2020-08-12 12:30:45 -04:00
Arve Knudsen
b1ddbaa395
CloudWatch: Fix sorting of metrics results (#26835)
* CloudWatch: Fix sorting of metrics results
2020-08-07 11:48:40 +02:00
Arve Knudsen
37c278c8f3
InfluxDB: Less chatty logging (#26850)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-08-07 09:18:57 +02:00
Kyle Brandt
62b103b843
Azuremonitor: do not set unit if literal "Unspecified" (#26839)
part of #26828
2020-08-06 16:03:25 -04:00
Sofia Papagiannaki
41f7bccb24
Cloud monitoring: do not create deep link if there are no timeseries (#26737) 2020-08-03 09:28:03 +03:00
Paul Sneddon
a0c1e53fd0
Flux: Increase series limit for Flux queries (#26746) 2020-07-31 15:14:58 -07:00
Paul Sneddon
ec756f3729
Flux: Ensure connections to InflxuDB are closed (#26735)
* Flux: Ensure connections to InflxuDB are closed
2020-07-31 23:11:51 +02:00
waqark3389
642e904048
Show FileSystemId as a dimension key (#26662)
FileSystemId can be used to filter by filesystem ID if needed. Right now it just returns blank
2020-07-29 09:35:07 +03:00
Arve Knudsen
94d0934e90
CloudWatch: Fix a few API status codes (#26578)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-07-24 12:34:56 +02:00
Arve Knudsen
2446ee08f1
CloudWatch: Fix passing of namespace for getting custom metrics (#26515)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-07-24 08:37:24 +02:00
Patrik Karlström
43ef052d57
cloudwatch: Consolidate client logic (#25555)
* cloudwatch: Consolidate client logic

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-07-23 18:52:22 +02:00
Ruan Bekker
b972963934
Cloudwatch: Add af-south-1 region (#26513)
* Adds af-south-1 region to cloudwatch datasource

* Fix test

Co-authored-by: Sofia Papagiannaki <papagian@gmail.com>
2020-07-23 14:02:25 +03:00
Arve Knudsen
415638cdda
Chore: Use interfaces where possible (#26392)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-07-23 08:17:20 +02:00
waqark3389
fabd879cbe
CloudWatch: Add FreeStorageCapacity (#26503)
* Add FreeStorageCapacity metric in AWS/FSx namespace
2020-07-22 16:11:53 +02:00
Kyle Brandt
fb5ff6a70f
Azure: Insights metrics - do not sort if no data (#26486)
fixes #26473
2020-07-21 10:24:55 -04:00