Commit Graph

1358 Commits

Author SHA1 Message Date
Gábor Farkas
b42161a713
Loki: add from JSON to dataframes tests (#44375)
* Loki: add from JSON to dataframes tests

* fixed wrong content-type

* added -Inf test-case
2022-01-27 12:43:44 +01:00
Ryan McKinley
5d66194ec5
FeatureFlags: define features outside settings.Cfg (take 3) (#44443) 2022-01-26 09:44:20 -08:00
Morten Nygaard Åsnes
9e4aafa719
MSSQL: Configuration of certificate verification for TLS connection (#31865)
Fixes #24589

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2022-01-26 15:00:18 +01:00
Mitsuhiro Tanda
d1083b9597
Cloud Monitoring: Reduce request size when listing labels (#44365) 2022-01-26 12:02:42 +01:00
Agnès Toulet
65bdb3a899
FeatureFlags: Revert managing feature flags outside of settings.Cfg (#44382)
* Revert "FeatureToggles: register all enterprise feature toggles (#44336)"

This reverts commit f53b3fb007.

* Revert "FeatureFlags: manage feature flags outside of settings.Cfg (#43692)"

This reverts commit f94c0decbd.
2022-01-24 16:08:05 +01:00
Gábor Farkas
9161f9d2e1
prometheus: added json-loading benchmark (#44309) 2022-01-24 14:39:26 +01:00
Gábor Farkas
0f8b0dc301
prometheus: refactor test (#44358) 2022-01-24 11:08:41 +01:00
Ryan McKinley
f94c0decbd
FeatureFlags: manage feature flags outside of settings.Cfg (#43692) 2022-01-20 13:42:05 -08:00
Will Browne
7fbc7d019a
Plugins: Core plugins register via backend factory provider (#43171)
* refactoring store interface and init flow

* fix import

* fix linter

* refactor resource calling

* load with class

* re-order args

* fix tests

* fix linter

* remove old creator

* add custom config struct

* fix some tests

* cleanup

* fix

* tackle plugins

* fix linter

* refactor and fix test

* add connect failure error

* add fix for azure, cloud monitoring and test data

* restructure

* remove unused err

* add fake tracer for test

* fix grafana ds plugin
2022-01-20 18:16:22 +01:00
Isabella Siu
2c3bed1f4b
CloudWatch: remove unused "live" log code (#44185) 2022-01-20 08:58:39 -05:00
idafurjes
30aa24a183
Chore: Implement OpenTelemtry in Grafana (#42674)
* Separate Tracer interface to TracerService and Tracer

* Fix lint

* Fix:Make it possible to start spans for both opentracing and opentelemetry in ds proxy

* Add span methods, use span interface for rest of tracing

* Fix logs in tracing

* Fix tests that are related to tracing

* Fix resourcepermissions test

* Fix some tests

* Fix more tests

* Add TracingService to wire cli runner

* Remove GlobalTracer from bus

* Renaming test function

* Remove GlobalTracer from TSDB

* Replace GlobalTracer in api

* Adjust tests to the InitializeForTests func

* Remove GlobalTracer from services

* Remove GlobalTracer

* Remove bus.NewTest

* Remove Tracer interface

* Add InitializeForBus

* Simplify tests

* Clean up tests

* Rename TracerService to Tracer

* Update pkg/middleware/request_tracing.go

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

* Initialize tracer before passing it to SQLStore initialization in commands

* Remove tests for opentracing

* Set span attributes correctly, remove unnecessary trace initiliazation form test

* Add tracer instance to newSQLStore

* Fix changes due to rebase

* Add modified tracing middleware test

* Fix opentracing implementation tags

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2022-01-20 11:10:12 +01:00
Gabriel MABILLE
54280fc9d7
AccessControl: Resolve attribute based scopes to id based scopes (#40742)
* AccessControl: POC scope attribute resolution

Refactor based on ScopeMutators

test errors and calls to cache

Add comments to tests

Rename logger

Create keywordMutator only once

* AccessControl: Add AttributeScopeResolver registration

Co-authored-by: gamab <gabriel.mabille@grafana.com>

* AccessControl: Add AttributeScopeResolver to datasources

Co-authored-by: gamab <gabriel.mabille@grafana.com>

* Test evaluation with translation

* fix imports

* AccessControl: Test attribute resolver

* Fix trailing white space

* Make ScopeResolver public for enterprise redefine

* Handle wildcard

Co-authored-by: Jguer <joao.guerreiro@grafana.com>

Co-authored-by: jguer <joao.guerreiro@grafana.com>
2022-01-18 17:34:35 +01:00
Andres Martinez Gotor
4e1c7e868e
Cloudwatch: use the backend HTTP client provider (#44036) 2022-01-18 09:34:12 +01:00
Piotr Jamróz
9fb8339f87
Elastic: Allow using long/int as date field for alerts (#44027)
* Use integers for time range filter

Previously it was passed as a string which is automatically converted by Elastic to a number only if the field type is "date". For other types (e.g. "long") such conversion doesn't work. In theory "date" could be passed as a formatted string but we don't use it this way and always pass it as a number so it is safe to always pass numbers, not strings.

* Fix time_series_query_test

* Retrigger build
2022-01-17 15:45:09 +01:00
Ivana Huckova
e704110f74
Prometheus: Fix interpolation of $__rate_interval variable (#44035)
* Name fields based on targets length

* Remove rounding in rate interval variable replacing

* Refactor and fix edge  case when interval and time duration would be rate interval

* Add tests

* Remove , from test

* Revert "Name fields based on targets length"

This reverts commit 5dcb34a765.
2022-01-17 15:32:23 +01:00
Gábor Farkas
bedc5cccaa
prometheus: fix auto-inserting null-timestamps at the end (#44022) 2022-01-14 09:25:15 +01:00
Gábor Farkas
4a88b8f66c
Prometheus: add tests covering the prometheus-response to dataframes conversion (#43892)
* prometheus: add tests covering prometheus_response to grafana_dataframes

* fixed variable name

* added comment

* removed not-helping function call
2022-01-13 11:52:50 +01:00
Victor Marin
f881fd1637
Postgres/MySQL/MSSQL: Cancel in-flight SQL query if user cancels query in grafana (#43890) 2022-01-12 16:24:27 +02:00
Travis Patterson
9eb82f9fff
Propagate all headers (#43812)
* Propagate all headers

* stable header order
2022-01-07 12:45:26 -07:00
Ryan McKinley
546818819b
Loki: use queryType rather than range|instant flags (#43727) 2022-01-07 10:00:11 -08:00
Emil Tullstedt
fdd196a627
Datemath: Remove unused functions (#43665) 2022-01-07 12:53:31 +01:00
Travis Patterson
20b3b2a448
Forward oauth tokens after prometheus datasource migration (#43686)
* create the prom client

* implement lru cache of prometheus clients based on auth headers

* linter
2022-01-05 13:55:55 -07:00
Ivana Huckova
d7d6c10664
Prometheus: Fill missing steps with null values (#43622)
* Prometheus: Add empty points when data points missing

* Remove newline

* Add comments

* Improve/Fix test

* Remove unused variable
2022-01-05 11:40:32 +01:00
Travis Patterson
c4c05a5b71
refactor promethueus package into sub packages (#43634) 2022-01-04 07:22:33 -07:00
Emil Tullstedt
df4e9ca12b
Datemath: Support fiscal years (#43558) 2022-01-04 13:56:34 +01:00
David Henderson
575eb68828
CloudWatch: Add Missing Elasticache Host-level metrics (#43455)
Add missing host-level Elasticache metrics from https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheMetrics.HostLevel.html

Follows from https://github.com/grafana/grafana/pull/43336#issuecomment-999367311
2021-12-22 14:02:52 +01:00
idafurjes
b8852ef6a3
Chore: Remove context.TODO() (#43409)
* Remove context.TODO() from services

* Fix live test

* Remove context.TODO
2021-12-22 11:02:42 +01:00
Siavash Safi
4c4322f717
CloudWatch: Add all ElastiCache Redis Metrics (#43336)
Add all missing Redis ElastiCache metrics.
https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheMetrics.Redis.html

Signed-off-by: Siavash Safi <siavash.safi@gmail.com>
2021-12-21 09:13:41 +01:00
Gábor Farkas
1879a6855e
prometheus: respect the http-method data source setting (#42753)
* prometheus: respect the http-method data source setting

* removed forgotten if-true section

* refactored json-check
2021-12-20 11:27:18 +01:00
Ilya Stoliar
9cf5623918
CloudWatch: Add Data Lifecycle Manager metrics and dimension (#43310) 2021-12-20 09:48:07 +01:00
Artur Wierzbicki
197f4f81f2
#41993: make it possible to create N random60hz channels (#43295) 2021-12-17 23:42:37 +04:00
Will Browne
e4ba5f17dd
add core plugins thru store (#43085) 2021-12-14 15:22:40 +01:00
Shirley
21656a0491
Remove reference to legacydata package (#43075)
* Remove reference to legacydata package

* Change from and to times
2021-12-14 12:58:31 +01:00
Erik Sundell
043680371f
add all new es metrics (#43034) 2021-12-14 10:12:39 +01:00
Marcus Efraimsson
d6ec6f8ad2
Backport fix to main (#42979)
* fixes

(cherry picked from commit a2c386915ce11b9422f4af8ae181eaa1a22bc5c3)
(cherry picked from commit 06706efbbe)

* fix regex

(cherry picked from commit a259213a3badc9618e969f2c8db0a0143f00faee)
(cherry picked from commit 1d7105c095)

* lint (#42970)

(cherry picked from commit afb9e8e5f3)

Co-authored-by: Will Browne <will.browne@grafana.com>
Co-authored-by: malcolmholmes <42545407+malcolmholmes@users.noreply.github.com>
2021-12-10 16:10:04 +01:00
Gábor Farkas
a4cc1f6b39
loki: alerting: handle curly-braces-style variables (#42933) 2021-12-09 15:16:01 +01:00
Ivana Huckova
2655be61b6
Prometheus: Interpolate curly brackets syntax variable (#42927) 2021-12-09 14:37:24 +01:00
Gábor Farkas
3232ae08c0
loki: removed unused variable (#42909) 2021-12-09 13:16:52 +01:00
Isabella Siu
a2ad0a0fb6
CloudMonitor: Iterate over pageToken for resources (#42546) 2021-12-07 08:54:50 -05:00
Gábor Farkas
6686f8c345
loki: rename ResponseModel to QueryModel (#42794) 2021-12-07 07:57:52 +01:00
Ivana Huckova
21fe78302b
Prometheus: Fix passing of custom params when running queries (#42728)
* Prometheus: Fix passing of custom params

* Remove prints
2021-12-03 16:28:05 +01:00
Yuriy Tseretyan
9139f61105
Alerting: Update alert rule migration to use expanded queries (#42493)
* move targetData to target

* use constants instead of literals.

* Update comments and add tests

Co-authored-by: gotjosh <josue.abreu@gmail.com>
2021-12-01 11:45:27 +00:00
Erik Sundell
bab78a9e64
CloudWatch: Add support for AWS Metric Insights (#42487)
* add support for code editor and builder

* refactor cloudwatch migration

* Add tooltip to editor field (#56)

* add tooltip

* add old tooltips

* Bug bash feedback fixes (#58)

* make ASC the default option

* update sql preview whenever sql changes

* don't allow queries without aggregation

* set default value for aggregation

* use new input field

* cleanup

* pr feedback

* prevent unnecessary rerenders

* use frame error instead of main error

* remove not used snapshot

* Use dimension filter in schema picker  (#63)

* use dimension key filter in group by and schema labels

* add dimension filter also to code editor

* add tests

* fix build error

* fix strict error

* remove debug code

* fix annotation editor (#64)

* fix annotation editor

* fix broken test

* revert annotation backend change

* PR feedback (#67)

* pr feedback

* removed dimension filter from group by

* add spacing between common fields and rest

* do not generate deep link for metric queries (#70)

* update docs (#69)

Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>

* fix lint problem caused by merge conflict

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-11-30 10:53:31 +01:00
Ivan Anselmi
cf3105e5be
MSSQL: Change regex to validate Provider connection string (#40248)
* Change the regex to allow to specified other connection attribute for MSSQL connection like ApplicationIntent property

* Docs update

* docs update

* some tests added

* formatting

* Change the regex to allow to specified other connection attribute for MSSQL connection like ApplicationIntent property

* Docs update

* docs update

* some tests added

* formatting

* docs and formatting

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2021-11-30 09:28:48 +01:00
Will Browne
e440796cb3
only load CSV when data exists (#42441) 2021-11-29 15:21:18 +01:00
Marcus Efraimsson
8927a3ca20
Chore: Query endpoint refactor (#41637)
Get rid of using legacydata.RequestHandler in HTTPServer, /api/tsdb/query and pkg/expr 
with the goal of deprecating /api/tsdb/query and remove it completely eventually. This is 
the first step of cleaning up the HTTP API query endpoint.

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Alexander Emelin <frvzmb@gmail.com>
2021-11-29 14:21:54 +01:00
Ivana Huckova
0b5d7067f9
Prometheus: Fix range variables interpolation for time ranges smaller than 1 second (#42242)
* Prometheus: Fix precision for queries with < 1s timeRange

* Update pkg/tsdb/prometheus/time_series_query.go

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2021-11-29 12:41:23 +01:00
Sriram
70bc0b86e2
TestDataDB: Raw frame input (#42209)
* test datasource raw-frame scenario added

* typo fix in doc
2021-11-25 09:14:34 +00:00
Gábor Farkas
24d4c8a9d1
Loki: alerting: handle variables like __interval and __range (#42126) 2021-11-24 16:56:53 +01:00
Gábor Farkas
fe84454bb0
loki: alerting: simplified config (#42147)
* loki: alerting: simplified config

* adjusted config handling
2021-11-24 11:52:33 +01:00