Commit Graph

218 Commits

Author SHA1 Message Date
ismail simsek
0214b25663
Prometheus: Fix calculating rate interval when there is no interval specified (#78193)
* Use data source scrape interval when no interval is specified

* scrape interval as 15s
2023-11-15 16:20:37 +01:00
Ryan McKinley
f69fd3726b
FeatureToggles: Add context and and an explicit global check (#78081) 2023-11-14 12:50:27 -08:00
ismail simsek
b607a4e0a2
Prometheus: Fix $__rate_interval calculation (#77234)
* Remove unused param

* simple unit test

* rename

* rename

* add some comments

* Update values

* refactor

* rename

* always calculate rate interval

* fix unit tests

* Fix indentation

* linter fix

* update test

* Fixing issues with the calculation

* new test

* fix $__interval interpolation

* fix test

* add comment
2023-11-13 10:13:07 +01:00
Brendan O'Handley
6b729389b5
Prometheus: Set httpMethod as POST for new query client when not defined (#77503)
set httpMethod as POST for new query client when not defined
2023-11-03 10:16:02 -04:00
Kyle Brandt
59ef1558e8
Prometheus: (Chore) Switch to sdk tracing from infra tracing (#76975) 2023-10-23 13:11:12 -04:00
Kyle Brandt
1b420585f9
Prometheus: (Chore) Switch to sdk httpclient from infra httpclient (#76955) 2023-10-23 10:40:43 -04:00
Kyle Brandt
6dea3102cb
Prometheus: (Chore) Switch from infra to sdk logger (#76827) 2023-10-20 08:54:27 -05:00
Will Browne
9d92818cae
Plugins: Update PDC pattern from latest plugin SDK changes (#76576)
* update with sdk

* do sql

* fix core plugins

* fix proxy settings

* bump SDK version

* tidy

* enable pdc for test

* add codeowners

* bump dep

* go mod tidy

* bump SDK
2023-10-16 16:40:04 +02:00
Dan Cech
91cf4f0c1c
Revert "Plugins: Update PDC pattern from latest plugin SDK changes" (#76565)
Revert "Plugins: Update PDC pattern from latest plugin SDK changes (#76036)"

This reverts commit 151f6d6216.
2023-10-13 12:35:16 -04:00
Will Browne
151f6d6216
Plugins: Update PDC pattern from latest plugin SDK changes (#76036)
* update with sdk

* do sql

* fix core plugins

* fix proxy settings

* bump SDK version

* tidy

* enable pdc for test

* add codeowners
2023-10-13 14:42:15 +02:00
Marcus Efraimsson
e4c1a7a141
Tracing: Standardize on otel tracing (#75528) 2023-10-03 14:54:20 +02:00
Sergey Kostrukov
3ee40d3a5a
Azure: Settings for Azure AD Workload Identity (#75283)
* Settings for Azure AD Workload Identity

* Update dependency on Grafana Azure SDK

* Documentation

* Fix JS code

* Cleanup Prometheus backend code

* Making prettier happy
2023-09-28 12:05:16 +01:00
Will Browne
7fca1bde54
Plugins: Set grafana config, plugin version and user agent on plugin requests (#75171)
* first pass

* fixup

* remove test line

* fix tests

* use new fields

* fix imports + formatting

* fix tests

* rollback changes

* undo whitespace

* apply pr feedback
2023-09-21 11:33:31 +02:00
ismail simsek
3107459e57
Prometheus: Handle the response with different field key order (#74567)
* Handle the response with different field key order

* More unit tests to cover edge cases

* Cover more edge cases

* make it simpler

* Better test inputs
2023-09-08 19:58:05 +02:00
Serge Zaitsev
93cdc94a94
Chore: capitalise logs in other backend packages (#74344)
* capitalise logs in observability logs

* capitalise oss-bit-tent packages

* capitalise logs in aws-datasources

* capitalise logs for traces and profiling

* capitalise logs for partner datasources

* capitalise logs in plugins platform

* capitalise logs for observability metrics
2023-09-04 22:25:43 +02:00
Ryan McKinley
025b2f3011
Chore: use any rather than interface{} (#74066) 2023-08-30 18:46:47 +03:00
ismail simsek
cfe3d6346f
Chore: Fix the command in comments (#73872)
Fix the command in comments
2023-08-28 17:47:54 +02:00
Kyle Brandt
38603b1a9e
Prometheus: Check for errors on json response parsing (#73788)
- The util/converter Prometheus response json parse was not checking for errors while parsing. It now does. In particular, if `[dataproxy]/response_limit` is set in Grafana's config, it will now recognize the limit error.
- Fixes #73747
- Adds `jsonitere` package, which wraps json-iterator/go's Iterator's Methods with methods that return errors, so errcheck linting can be relied upon
- Impact:
  - If something was sending malformed JSON to the prometheus or loki datasources, the previous code might have accepted that and partially processed the data
  - Before there may have been partial data with no error, where as no there may be errors but they will have no partial results, just the error.
2023-08-28 15:53:50 +03:00
Owen Williams
7b347fd12a
Prometheus: Add $__rate_interval_ms to go along with $__interval_ms (#69582)
* Add $__rate_interval_ms to go along with $__interval_ms

Fixes https://github.com/grafana/grafana/issues/69581

* update doc

* PoC add rate_interval_ms as rate range in prometheus

* Revert "PoC add rate_interval_ms as rate range in prometheus"

This reverts commit 7d4ec700d7.

* Update docs/sources/dashboards/variables/add-template-variables/index.md

grammar nit

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>

* Update docs/sources/dashboards/variables/add-template-variables/index.md

---------

Co-authored-by: Galen <galen.kistler@grafana.com>
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
2023-08-27 16:44:58 +02:00
Kyle Brandt
6d8fc42cdd
Prometheus: (Chore) Remove experimental unshipped prometheusWideSerie… (#73751) 2023-08-24 17:47:19 +03:00
Kyle Brandt
fe774415b5
Prometheus: Add ExecutedQueryString to first frame only (#73678) 2023-08-23 11:56:19 -04:00
Galen Kistler
7dc071f46b
Prometheus: Version detect bug (#71198)
* remove redundant request copy in backend, add more versions to semver lists
2023-07-07 09:39:20 -05:00
Andreas Deininger
95b1f3c875
Fixing typos (#70487) 2023-06-22 09:43:38 +01:00
Tania
0316350d16
Codegen: Generate any instead of interface{} (#70201)
* Chore: Update thema to latest

* Regenerate
2023-06-16 10:54:56 +02:00
Ludovic Viaud
bb7acf9e47
Add prometheus querydata instrumentation (#69447) 2023-06-07 13:36:03 +02:00
George Robinson
f80463a8a9
Alerting: Add heuristics back to datasource healthchecks (#69329)
This commit adds heuristics back to datasource healthchecks as
it was removed in #66198. The healthcheck for Prometheus datasources
also returns the kind (Prometheus or Mimir) and a boolean if the
ruler is enabled or disabled.
2023-06-05 10:35:18 +01:00
Selene
bd622a5381
Chore: Unify references for dataquery (#68963)
* Unify references for dataquery

* Fix ResultFormat in azure types

* Update azure-log with new schema

* Fix cloudwatch query

* Update thema

* Fix test

* More fixes

* More fixes

* Fix lint
2023-05-26 10:16:01 +02:00
Will Browne
286b9e08e9
Plugins: Bump Plugin SDK version and address instance management breaking changes (#68900)
* bump sdk and propagate ctx

* fix tests
2023-05-24 10:19:34 +02:00
ismail simsek
670c987409
Prometheus: Update schema with legendFormat and intervalFactor (#68687)
add legendFormat and intervalFactor to the schema
2023-05-22 16:20:15 +02:00
Kyle Brandt
4abc56c583
Prometheus: (Chore/Instrumentation) add trace spans for result proces… (#67858)
Prometheus: (Chore/Instrumentation) add trace spans for result processing
2023-05-05 09:07:39 -04:00
Brendan O'Handley
d4a22cff0a
Prometheus: Fix regression for $__rate_interval comparison (#67460)
* fix ,  comparison regression

* intervalMs was not pressent before the regression and this value changes the adjusted interval calculating giving a false positive in favor of the regression
2023-04-28 08:40:17 -04:00
Brendan O'Handley
f70efed2cb
Prometheus: Update healthcheck text message (#67401)
* the healthcheck is used outside the config save&test so change text message

* fix e2e test
2023-04-27 15:54:12 -04:00
Brendan O'Handley
0a9240aeba
Prometheus: Configuration page overhaul (#66198)
* organize layout, make design uniform, add doc link

* fix e2e test

* move overhauled config parts into prometheus code

* update tooltips with doc links

* clean component styles for section padding, top and bottom 32px

* make additional settings subsection headers h6

* use secondary gray for section descriptions

* fix merge issues

* change inlineswitch to switch only in prom settings because the other components are shared

* remove legacy formfield and input, replace with inlinefield and input from grafana-ui

* find more formfield and UI design fixes like changing inlineformlabel to inlinefield

* remove unused inline form label

* replace legacy duration validations with <FieldValidationMessage>

* fix styles secondary gray from theme

* change language, headings and datasource -> data source

* update alert setting styles with new component

* update prom url heading and tooltip

* update default editor tooltip and set builder as default editor

* update interval tooltip

* update prom type tooltip

* update custom query params tooltip

* update exemplar internal link tooltip

* fix inline form styling inconsistency

* allow for using the DataSourceHTTPSettings component without the connection string

* remove overhaul component, re-use dshtttps comp, and use connection input in config editor

* make tooltips interactive to click links

* consistent label width across the elements we can control for now, fix exemplar switch

* make connection url a component

* refactor onBlur validation

* remove unused component

* add tests for config validations

* add more meaningful health check

* fix e2e test

* fix e2e test

* fix e2e test

* add error handling for more url errors

* remove unnecessary conversion

* health check tests

* Clean up the health check

* health check unit tests

* health check unit tests improved

* make pretty for drone

* lint check go

* lint check go

* add required attr to connection component

* Update public/app/plugins/datasource/prometheus/configuration/Connection.tsx

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

* fix read only issue for provisioned datasources

* validate multiple durations for incremental query setting

* use sentence case for headers

* use className consistently for styles

* add tests for url regex

* remove console logs

* only use query as healthcheck as the healthy api is not supported by Mimir

* fix exemplar e2e test

* remove overhaul prop from custom headers setting component

* remove connection section and use DatasourceHttpSettings connection with custom label and interactive tooltip

* add spaces back

* spaces

---------

Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2023-04-27 09:43:54 -04:00
Gábor Farkas
d830591cdc
Revert "Prometheus: Reduce allocations parsing exemplars" (#66367)
Revert "Prometheus: Reduce allocations parsing exemplars (#58959)"

This reverts commit a1f2d0e205.
2023-04-12 14:45:21 +02:00
Gábor Farkas
05f7ae6c69
prometheus: slightly different approach for dataplane compatibility (#65993) 2023-04-11 12:58:55 +02:00
Galen Kistler
96e9e80739
Prometheus: Browser resource caching (#60711)
Add cache control headers and range snapping to Prometheus resource API calls.
2023-04-03 09:07:17 -05:00
ismail simsek
959349d191
Prometheus: Fix fallback http method when no http method specified in jsonData (#65229)
Use POST as default if no http method specified in jsonData
2023-03-30 00:50:25 +02:00
Sergey Kostrukov
746b70bb86
Prometheus: Update audiences for Azure auth (#65498)
* Update US Gov audience for Azure auth in Prometheus

* Update China audience for Azure auth in Prometheus
2023-03-29 20:49:37 +02:00
Kyle Brandt
674144c8e8
Prometheus: Update FrameType and make __name__ the field name (#62694)
These changes would make the response more in line with the dataplane contract, changes are under the feature toggle prometheusDataplane
2023-03-29 11:26:32 -04:00
Arve Knudsen
f7ee42d871
Prometheus: Reduce memory allocations in QueryData.processExemplars (#63373)
* tsdb/prometheus/querydata: Reduce memory allocations in QueryData.processExemplars

---------

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2023-03-22 10:59:39 +01:00
Kristin Laemmert
8745d7ef1b
extract kindsys to external library (#64562)
* extract kindsys

* reinstate kindsys report

This may end up living somewhere else (or not! who knows!), but the important part is that I don't get rid of it right now :)

I hate the package layout (kindsysreport/codegen) for the main function and will take pretty much any alternative suggestion, but we can change also change it later.

Note that the generated report.json is in a different location - anything using this (ops something) needs to be updated.

* kindsysreport in codeowners
2023-03-15 12:04:28 -04:00
ismail simsek
68b588b912
Prometheus schematization (#63878)
* Schematize prometheus

* revert changes

* close response body

* Update report.json

* Update pkg/tsdb/prometheus/models/query.go

Co-authored-by: sam boyer <sdboyer@grafana.com>

* Use without pointers

* remove unused

* Specify query format

* Rename

* Clean up schema

* Update public/app/plugins/datasource/prometheus/dataquery.cue

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>

* Update pkg/tsdb/prometheus/models/query.go

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>

* Clean up tests

* Update public/app/plugins/datasource/prometheus/dataquery.cue

Co-authored-by: sam boyer <sdboyer@grafana.com>

* make gen-cue

* Add comments

* Make linter happy

* Remove editormode override

* Update

---------

Co-authored-by: sam boyer <sdboyer@grafana.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2023-03-09 11:26:15 +01:00
Sofia Papagiannaki
e643437ee6
Prometheus: Fix panic-ing when closing response body (#63895)
Prometheus: Fix panicing when closing response body
2023-02-28 13:08:01 -05:00
Emil Tullstedt
3abaf32cf2
Chore: Upgrade golangci-lint to v1.51.2 (#63630)
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2023-02-23 15:10:03 +01:00
Kyle Brandt
52ed297ed5
Backend: Use latest plugin-sdk-go v0.149.1 (#63498)
Use latest github.com/grafana/grafana-plugin-sdk-go which includes changes to the TypeVersion property (always present in JSON).

Also included is squtil changes: SQL util - allow using the database scan type for converters
2023-02-21 09:06:15 -05:00
Sergey Kostrukov
2f218ab928
Azure: Update Grafana Azure SDK and middleware (#62050)
* Update middleware

* Update Grafana Azure SDK

* Client options to client builder

* Fix tests

* maputil from SDK
2023-02-02 16:58:10 +00:00
ismail simsek
49258b135a
Prometheus: Refactor error handling logic (#62254)
* Refactor error handling logic
- Enable query inspector to show error information
- Update naming

* Change fetch method return signature

* update the snapshot

* Revert "update the snapshot"

This reverts commit 28b26ce426.
2023-01-31 19:26:45 +01:00
Serge Zaitsev
f8ec35e643
Chore: Fix goimports grouping (#62427)
* fix goimports order

* fix goimports order
2023-01-30 09:38:51 +01:00
Kyle Brandt
5bb38293d2
SSE/Prom: Undo empty frame change that triggers 500s in SSE (#61871)
added in https://github.com/grafana/grafana/pull/61643
2023-01-20 17:32:14 +00:00
ismail simsek
29c8ce12a0
Prometheus: Fix handling errors in streaming client (#61643)
* Return errors from data parsing

* Better error handling

* Fix the tests

* When there is no frame add empty frame to get metadata attached to it

* Fix tests

* Update testdata
2023-01-18 22:30:15 +01:00