Commit Graph

1853 Commits

Author SHA1 Message Date
Andrej Ocenas
8da90f624d
Pyroscope: Add authentication when calling backendType resource API (#67667) 2023-05-11 16:07:49 +02:00
Adam Simpson
6008296fb7
Google Cloud Monitor: send ServerTiming and metricDescriptors (#67873)
* CloudMonitor: send ServerTiming and metricDescriptors

* fix lint
2023-05-10 19:08:46 +00:00
Emil Tullstedt
b0e681c339
Chore: Update target in go.mod to 1.20 and golangci-lint to v1.52.2 (#67102) 2023-05-10 13:47:35 +02:00
Andreas Christou
e059ce9c8a
AzureMonitor: Correctly set resource parameter for Logs queries (#68133)
* Update to ensure the resources parameter is passed through for logs queries only

* Use string slices for resources to ensure order remains the same

* Fix lint

* clarify test
2023-05-10 13:27:02 +03:00
Andreas Christou
10109eaf00
AzureMonitor: Fix tests (#68127)
Fix tests
2023-05-09 19:39:27 +03:00
Andreas Christou
5ddc37ee21
AzureMonitor: Appropriately handle trace correlation resources (#67934)
* Appropriately handle correlation resources

- Retrieve resources in buildQueries step
- Build updated queries based off of correlation results
- Update tests

* Fix query building and tests

* Fix lint

* Ensure multiple resource queries will work

- Correctly set resources to ensure there is no overlapping between multiple resource selection and correlated resources
- Add tests for these specific cases
- Remove unnecessary pointers
- Build queries correctly
2023-05-09 15:29:36 +01:00
Jev Forsberg
86228ba1a0
Datasource: Fix missing raw SQL query in Query Inspector when query returns zero rows (#67844)
* baldm0mma/issue5799/ add empty frame with all meta data

* baldm0mma/issue5799/ add null test

* write an integration test around query results with empty rows

* baldm0mma/issue5799/ add tests to mssql and postgres

* remove use of apparently reserved keyword in mysql8

* baldm0mma/issue5799

* baldm0mma/issue5799/ update tests

* baldm0mma/issue5799/ update test structs

* baldm0mma/issue5799/ update annotation

---------

Co-authored-by: Michael Mandrus <michael.mandrus@grafana.com>
2023-05-09 08:29:02 -06:00
Andreas Christou
65c1505415
AzureMonitor: Ensure trace exceptions are correctly displayed (#68079)
Ensure trace exceptions are correctly displayed
2023-05-09 15:24:20 +01:00
Ivana Huckova
3145660f5a
Elasticsearch: Run getTerms trough resource call if enableElasticsearchBackendQuerying enabled (#67848)
* Elasticsearch: Run getTerms torugh backend if toggle enabled

* Add template variables to devenv dashboard for easier testing

* Add TODO

* Run feature toggle gen to fix build
2023-05-06 10:00:43 +02:00
Andreas Christou
9d16718acc
AzureMonitor: Fix logs query multi-resource and timespan values (#67914)
* Update TimeGrain interface methods

- Make them util functions because it's simpler

* Update logs ds to appropiately set resources and timespan

* Set timespan using RCF times

* Update tests
2023-05-05 16:47:31 +01: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
Ivana Huckova
f5ac099907
Elasticsearch: Run requestAllIndices trough resource call if enableElasticsearchBackendQuerying enabled (#67825)
* Elasticsearch: Run requestAllIndices trough resource call if enabled

* Unlock resource call path

* Fix lint
2023-05-05 11:35:30 +02:00
Ivana Huckova
95cf598423
Elasticsearch: Fix processing of logs with not-recognized time format (#67767)
* Elasticsearch: Fix parsing of invalid time

* Fix lint

* Add more test data to data.js

* Add tests

* Fix lint

* Update pkg/tsdb/elasticsearch/client/search_request.go
2023-05-04 19:33:00 +02:00
Ivana Huckova
4d7c0904ef
Elasticsearch: Run version check thorugh backend if enableElasticsearchBackendQuerying enabled (#67679)
* Elasticsearch: Run getDBversion trough resource calls

* Update

* Update

* Fix lint

* Close response body

* Fix lint

* Refactor
2023-05-03 18:09:18 +02:00
Andrej Ocenas
92d47a8d8f
Pyroscope: Fix autodetection in case of using Phlare backend (#67536) 2023-04-28 19:53:46 +02: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
Andreas Christou
63383ef545
AzureMonitor: Application Insights Traces (#64859)
* Build out barebones Traces editor

- Add Traces query type and operation ID prop to query type
- Add necessary header types
- Update resource picker to appropriately work with traces query type
- Build out TracesQueryEditor component
- Include logic to retrieve operationId's for AI Workspaces
- Add backend route mapping
- Update macro to use timestamp as default time field for traces

* AzureMonitor: Traces - Response parsing (#65442)

* Update FormatAsField component

- Add trace ResultFormat type
- Generalise FormatAsField component
- Add component to TracesQueryEditor
- Remove duplicate code in setQueryValue

* Add custom filter function to improve performance

* Add basic conversion for logs to trace

- Add serviceTags converter
- Pass through required parameters (queryType and resultFormat)
- Appropriately set visualisation

* Update parsing to also fill trace tags

- Add constant values for each table schema (include legacy mapping for now if needed)
- Add constant for list of table tags
- Set the foundation for dynamic query building
- Update query to build tags value
- Appropriately set operationName
- Update tagsConverter to filter empty values

* Fix lint and test issues

* AzureMonitor: Traces - Data links (#65566)

* Add portal link for traces

- Pull out necessary values (itemId and itemType)
- Appropriately construct
- Fix ordering

* Set default format as value

- Also set default visualisation

* Fix event schema

* Set default formatAsField value

* Include logs link on traces results

- Adapt config links to allow custom title to be set

* Correctly set operationId for query

* Update backend types

- Include OperationID in query
- Pass forward datasource name and UID

* Ensure setTime doesn't consistently get called if operationID is defined

* Add explore link

- Update util functions to allow setting custom datalinks

* Fix tests

* AzureMonitor: Traces - Query and Editor updates (#66076)

* Add initial query

- Will query the resource as soon as a resource has been selected
- Updates the data links for the query without operationId
- Remove initial operationId query and timeRange dependency
- Update query building

* Add entirely separate traces query property

- Update shared types (also including future types for Azure traces)
- Update backend log analytics datasource to accept both azureLogAnalytics and azureTraces queries
- Update backend specific types
- Update frontend datasource for new properties
- Update mock query

* Update FormatAsField to be entirely generic

* Update query building to be done in backend

- Add required mappings in backend
- Update frontend querying

* Fix query and explore data link

* Add trace type selection

* Better method for setting explore link

* Fix operationId updating

* Run go mod tidy

* Unnecessary changes

* Fix tests

* AzureMonitor: Traces - Add correlation API support (#65855)

Add correlation API support

- Add necessary types
- Add correlation API request when conditions are met
- Update query

* Fix property from merge

* AzureMonitor: Traces - Filtering (#66303)

* Add initial query

- Will query the resource as soon as a resource has been selected
- Updates the data links for the query without operationId
- Remove initial operationId query and timeRange dependency
- Update query building

* Add entirely separate traces query property

- Update shared types (also including future types for Azure traces)
- Update backend log analytics datasource to accept both azureLogAnalytics and azureTraces queries
- Update backend specific types
- Update frontend datasource for new properties
- Update mock query

* Update FormatAsField to be entirely generic

* Update query building to be done in backend

- Add required mappings in backend
- Update frontend querying

* Fix query and explore data link

* Add trace type selection

* Better method for setting explore link

* Fix operationId updating

* Run go mod tidy

* Unnecessary changes

* Fix tests

* Start building out Filters component

- Configure component to query for Filter property values when a filter property is set
- Add setFilters function
- Add typing to tablesSchema
- Use component in TracesQueryEditor

* Update Filters

- Asynchronously pull property options
- Setup list of Filter components

* Update filters component

- Remove unused imports
- Have local filters state and query filters
- Correctly set filters values
- Don't update query every time a filter property changes (not performant)

* Update properties query

- Use current timeRange
- Get count to provide informative labels

* Reset map when time changes

* Add operation selection

* Reset filters when property changes

* Appropriate label name for empty values

* Add filtering to query

* Update filter components

- Fix rendering issue
- Correctly compare and update timeRange
- Split out files for simplicity

* Add checkbox option to multiselect

- Add custom option component
- Correctly call onChange
- Add variableOptionGroup for template variable selection

* Fix adding template vars

* Improve labels and refresh labels on query prop changes

* AzureMonitor: Traces - Testing (#66474)

* Select ds for template variable interpolation

* Update az logs ds tests

- Add templateVariables test
- Add filter test
- Update mock
- Remove anys

* Update QueryEditor test

- Update mocks with timeSrv for log analytics datasource
- Fix query mock
- Use appropriate and consistent selectors

* Add TracesQueryEditor test

- Update resourcePickerRows mock to include app insights resources
- Remove comments and extra new line

* Add FormatAsField test

- Remove unneeded condition

* Update resourcePicker utils test

* Don't hide selected options in filters

* Fix multi-selection on filters

* Add TraceTypeField test

- Add test file
- Update selectors (remove copy/paste mistake)
- Update placeholder text for select and add label

* Add basic filters test

* Begin filters test

* Update filters test

* Add final tests and simplify/generalise addFilter helper

* Minor update to datasource test

* Update macros test

* Update selectors in tests

* Add response-table-frame tests

* Add datasource tests

- Use sorting where JSON models are inconsistent
- Update filters clause
- Dedupe tags
- Correct operationId conditions

* Don't set a default value for blurInputOnSelect

* Simplify datasource test

* Update to use CheckGoldenJSON utils

- Update with generated frame files
- Remove redundant expected frame code
- Update all usages

* Fix lint

* AzureMonitor: Traces feedback (#67292)

* Filter traces if the visualisation is set to trace

- Update build query logic
- Added additional test cases
- Return an error if the traces type is set by itself with the trace visualisation
- Add descriptions to event types
- Update tests

* Fix bug for error displaying traces

* Update mappings and add error field

- Update tests
- Remove unnecessary comments

* Switch location of Operation ID field

* Re-order fields

* Update link title

* Update label for event type selection

* Update correct link title

* Update logs datalink to link to Azure Logs in explore

* Fix lint
2023-04-27 20:24:11 +01:00
Danila Shiman
2cd98eae24
Cloudwatch: Add FraudDetector namespace with metrics and dimensions (#67318) 2023-04-27 13:29:35 -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
Shirley
e17496d79a
CloudWatch: Deprecate dynamic labels feature toggle, remove support for Alias in backend (#66494) 2023-04-27 11:19:45 +02:00
Dmitry Filimonov
69a14b9a5e
Phlare: ability to set maxNodes parameter (#67017) 2023-04-27 10:50:11 +02:00
Ivana Huckova
c308118fc0
Elasticsearch: Move response parsing tests to 1 file (#67288)
* Organize tests

* Organize

* Fix lint

* Fix lint
2023-04-26 18:21:04 +02:00
Ivana Huckova
d0ced39847
Elasticsearch: Use array of strings as index in backend queries (#67276)
Elasticsearch: Use array of strings as indice in backend queries
2023-04-26 16:07:15 +02:00
Andrej Ocenas
63777ea368
Phlare: Support both Phlare and Pyroscope backends (#66989) 2023-04-25 16:08:18 +02:00
Kevin Yu
68a277b53b
CloudWatch: Add field level comments to schema (#66900)
* CloudWatch: Add field level comments to schema

* update comments

* pr comments

* remove unneeded test
2023-04-24 08:57:39 -07:00
Ivana Huckova
e2e243d1b6
Elasticsearch: Fix processing of duplicated metric types and field (#66973)
* Elasticsearch: Fix processing of duplicated metric types and field

* Fix lint

* Fix linting
2023-04-24 17:26:04 +02:00
Andreas Christou
a2b97547a6
AzureMonitor: Correct series name accounting for dimensions (#67050)
Correct displayName accounting for dimensions
2023-04-21 19:24:23 +01:00
Alex Khomenko
2e55f26e53
Cloudwatch: Fix nested recursive type (#66950)
* Cloudwatch: Fix nested recursive type

* Cloudwatch: Update exports
2023-04-20 19:39:02 +03:00
Gareth Dawson
82a6c8a647
Elastic: Store index in jsonData (#62808)
* feat(typescript): read and write index to jsonData

* feat(go): read index from jsonData

* clear database column when index-name is updated

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

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

* Update public/app/plugins/datasource/elasticsearch/configuration/ElasticDetails.tsx

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

* add indexChangeHandler function

* fix

* fix failing tests

* fix

* fix

---------

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2023-04-19 09:30:09 +01:00
Kevin Yu
a21fdd9c81
CloudWatch: Use generated type from schema in backend (#66420)
* CloudWatch: Use generated type from schema in backend

* address comments

* don't explicity set default metric query type
2023-04-18 11:56:00 -07:00
Stephanie Hingtgen
255d8f3326
Plugins: Remove secure socks proxy feature toggle (#66611) 2023-04-18 11:11:23 -06:00
Alex Khomenko
49eb9db698
Cloudwatch: Fix some schema todos (#66664)
* Cloudwatch: fix todos

* Cloudwatch: Run make-gen
2023-04-18 08:46:51 +03:00
Kyle Cunningham
92d92187d9
SQL Datasources: Update Max Connection and Max Idle Connection Defaults to 100 and add auto mode (#65834)
* Update connection configuration for SQL datasources

* Working auto state for connection numbers

* Add migration

* Use defaults from constants file

* Remove dead code

* Add tests and restructure useMigrateDatabaseField

* Update function names

* Update docs

* Make sure we don't continually issue updates

* Update docs

* Use onOptionsChnage in ConnectionLimits

* Update docs

* Clean up docs

* Update migration

* Fix default values in docs

* Fix spacing issue

* Fix test

* Update default values for SQL connections

* Include consts

* Allow override for default SQL datasource connection parameters

* Fix linter errors

* Remove extra @ts-ignore

* Centralize logic for default values

* Remove debugging

* Remove unecessary function

* Update configuration docs

* minor suggested change

* Fix comment misspelling

* Remove unecessary default setting code

* Update docs to indicate that code was included for backport version

* Remove dead code

---------

Co-authored-by: lwandz13 <larissa.wandzura@grafana.com>
2023-04-17 11:44:05 +03:00
Adam Simpson
02951e8a26
Google Cloud Monitoring: Fix project variable (#66524)
Google Cloud Monitoring: fix project variable

Also fix typo found while debugging
2023-04-14 15:11:25 +00:00
Selene
9665b3afe7
Chore: Update Cuetsy to v0.1.8 version (#66456)
* Update cuetsy version

* Fix defaults

* Update cuetsy

* Update cuelang version in bingo

* Remove TODO comments
2023-04-14 16:45:54 +02:00
Sven Grossmann
8567ec92b0
Cloudwatch: Change type of ts field in log responses to time (#66525)
* make timestamp field time type

* Add test for type on handleLogEvents data frame field response

---------

Co-authored-by: Shirley Leu <4163034+fridgepoet@users.noreply.github.com>
2023-04-14 16:21:16 +02:00
Gábor Farkas
b928fce070
Loki: Remove alpha feature toggle lokiDataframeApi (#65918)
loki: remove experimental feature-flag
2023-04-13 15:22:09 +02:00
Gábor Farkas
531caec602
Loki: Add feature flag to enable dataplane-compliant metric frames (#66017)
* loki: add feature flag to enable dataplane-compatible metric frames

* linter fix
2023-04-13 15:07:08 +02:00
Ida Štambuk
6309d3fae6
Cloudwatch: Pass refId from query for expression queries (#66147)
Co-authored-by: Shirley <4163034+fridgepoet@users.noreply.github.com>
Co-authored-by: Isabella Siu <Isabella.siu@grafana.com>
2023-04-13 10:07:06 +02: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
Shirley
ae23ef5b41
CloudWatch: Refactor around handleGetRegions (#65713)
* Create minimal EC2 interface

* convert regions variable to a function returning a copy

* Add test for multiple calls to regions to check regionsCache

* Add returns to handler after error

* Refactor handleGetRegions
2023-04-11 19:55:57 +02:00
Ivana Huckova
3e4eb9c93e
Elasticsearch: Fix legend generated on backend (#66039)
* Elasticsearch: Fix legend

* Remove comments

* fix adding name to config

* Fix lint
2023-04-11 13:29:38 +02:00
Gábor Farkas
05f7ae6c69
prometheus: slightly different approach for dataplane compatibility (#65993) 2023-04-11 12:58:55 +02:00
Ida Štambuk
2648fcb833
Cloudwatch: Add missing AWS/IVS namespace metrics (#65985) 2023-04-06 09:52:26 +02:00
Kyle Brandt
6c6427e63f
Chore: Use latest go-sdk (v0.158.0) (#66054)
SDK release notes:
* Logs contract: ignore remaining fields by @gabor in #659
* Logs contract: more robust field finding, explicit approach by @gabor in #660
* Tracing: Support multiple OTel propagators by @xnyo in #663
* Tracing: Add more details to HTTP Outgoing Request by @xnyo in #664
* Data: Encode Nanosecond into JSON by @kylebrandt in #647
* Data: cmp tests using FrameTestCompareOptions() will no longer ignore time differences beyond millisecond resolution
2023-04-05 21:00:31 +03:00
Ivana Huckova
abc11d1dcf
Elasticsearch: Run log context queries through backend (#65805)
* Elasticsearch: Run context queries trough backend

* Fix typing

* Update

* Add possibility to run context query torugh backend and frontend

* Correctly sort
2023-04-05 18:32:02 +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
Stephanie Hingtgen
211beae736
MSSQL: Update forked go-mssqldb dependency (#65658) 2023-03-31 10:07:37 -06:00
Andrej Ocenas
977a7e9a55
Phlare: Rollback pprof code (#65689) 2023-03-31 15:27:14 +02:00