Commit Graph

10 Commits

Author SHA1 Message Date
Olof Bourghardt
d26f3cdd03
Loki: add support for resolution (#36710)
* Add input to specify min step

* Add stepInterval to as input to component

* Add onBlur to Input component

* Loki: add functionality for min step

* Loki: change name on props to step to make it more clear

* Loki: add resolution as a query option

* Loki: Add min,max,exact as step options

* Loki: add functionality for different step modes

* Loki: fix bug where step function isn't working

* Loki: fix bug where exact step isn't working

* Loki: change width of step input field

* Loki: add tests for adjustInterval function

* Loki: add check for max step oprio to make sure it's not below the safe interval

* Loki: fix bug with some tests

* Loki: fix bug with tests

* Explore: add tooltip to loki step function

* Loki: remove resolution as a logs option

* Loki: update snapshots

* Fix failing tests

* Loki: add select component for choosing resolution

* Loki: add functionality for calculating correct interval with resolution applied

* Loki: remove functionality for step mode

* Loki: remove tests for step mode

* Loki: add tooltip to line limit and resolution

* Loki: add backend support for resolution

* Loki: fixed backend bug where resolution was undefined

* Loki: add check for resolution
2021-08-16 14:02:13 +02:00
idafurjes
0563bc68fc
Chore: Refactor loki to use SDK contracts (#37400)
* Refactor loki to use SDK contracts

* Register with service name

* Initialize interval calculator

* Return always created result

* Use go library instead of simplejson

* Update pkg/tsdb/loki/loki.go

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

* Remove newline

* Merge with main

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2021-08-05 10:25:31 +02:00
Ivana Huckova
1083bef030
Prometheus: Implement stepMode for alerting queries (#36796)
* Add select component for choosing step option

* Add onStepChange

* Add functionality for max step

* Rename minInterval to stepInterval to describe min, max and exact step interval

* Change select option from standard to exact

* Add new type StepType for better type safety

* Add tests for adjustInterval

* Add functionality and tests for exact step option

* Prometheus: Spell out min and max in select component

* Prometheus: Change width of step select component and add placeholder

* Prometheus: Adjust for the factor in exact step

* Prometheus: Update tooltip of step lable to include max and exact options and add padding to select component to give it some breathing room from other components

* Update snapshot for step tooltip

* Prometheus: make tooltip more informative

* Prometheus: add tooltip to interval input element

* Prometheus: extract default step option

* Prometheus: update snapshot for PromQueryEditor

* Prometheus: change step labels to uppercase

* Prometheus: define a default step option

* Prometheus: use default step option in both ui component and logic

* Prometheus: update snapshot for PromQueryEditor

* Prometheus: refactor datasource.ts for better readability

* Prometheus: change tool tip for step

* Prometheus: update snapshots

* Prometheus: add correct styling

* Prometheus: update snapshots

* Prometheus change variable name to something less superfluous

* Prometheus: refactor

* Prometheus: add new test for adjustInterval

* Docs: Update docummentation on the step parameter for prometheus

* Prometheus: make step input field smaller and change placeholder text to 15s

* Prometheus: update snapshots

* Prometheus: Make stepMode uniform in all places in the code

* Adjust step based on stepMode

* Adjust comment

* Check if we have queryInterval

* Refactor, add safe interval

* Fix merge resolutions

* Fix tests and add tests

* Update snapshot

* Update docs/sources/datasources/prometheus.md

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

* Update docs/sources/datasources/prometheus.md

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

* Update docs/sources/datasources/prometheus.md

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

* Update docs/sources/datasources/prometheus.md

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

* Update docs/sources/datasources/prometheus.md

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

* Update docs/sources/datasources/prometheus.md

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

* Update docs/sources/datasources/prometheus.md

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

* Implement calculation with intervalMode in calculator.go

* Update tests, add calculate safe interval method

* Replace panic with error

* Update pkg/tsdb/interval/interval_test.go

Co-authored-by: idafurjes <36131195+idafurjes@users.noreply.github.com>

* Update pkg/tsdb/calculator_test.go

Co-authored-by: idafurjes <36131195+idafurjes@users.noreply.github.com>

* Impotrt require

* Remove lint errors

Co-authored-by: Olof Bourghardt <ob655088@gmail.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
Co-authored-by: idafurjes <36131195+idafurjes@users.noreply.github.com>
2021-08-05 09:09:49 +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
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
Ryan McKinley
7627b55ef4
TSDB: add deprecation comments to many tsdb structs (#33281) 2021-04-23 03:03:11 +02:00
Ivana Huckova
4f7728738e
WIP (#33025) 2021-04-15 15:06:26 +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
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
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