Commit Graph

1061 Commits

Author SHA1 Message Date
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