* streamline initialization of test databases, support on-disk sqlite test db
* clean up test databases
* introduce testsuite helper
* use testsuite everywhere we use a test db
* update documentation
* improve error handling
* disable entity integration test until we can figure out locking error
* clean up intervalv2 functions
* use roundInterval from grafana-plugin-sdk-go
* use from grafana-plugin-sdk-go
* have intervalv2 in publicdashboards and remove tsdb/intervalv2
* legacydata cleanup
* remove unused variables
* Update pkg/tsdb/legacydata/interval/interval.go
Co-authored-by: Arati R. <33031346+suntala@users.noreply.github.com>
---------
Co-authored-by: Arati R. <33031346+suntala@users.noreply.github.com>
* create the feature flag
* bring the concurrency in to the play
* Update feature flag
* Use concurrency number from settings
* update influxdb dependency
* use ConcurrentQueryCount from plugin-sdk-go
* use helper method for concurrent query count
* log the error
* add value guard
* add unit tests
* handle concurrency error
* use regex as templateSrv replace format
* use regex as templateSrv replace format for raw queries
* import path fix
* don't use regex formatter
* tag value escape
* tag value escape with wrappers
* polished interpolation logic
* update unit tests
* comments and more place to update
* unit test update
* fix escaping
* handle the string and array of string type separately
* update variable type
- Feature Toggle is `promQLScope`.
- Query property is:
"scope": {
"matchers": "{job=~\".*\"}"
}
Misc:
- Also updates drone GO version to address ARM bug https://github.com/golang/go/issues/58425
- Also updates Swagger defs that were causing builds to fail
---------
Co-authored-by: Kevin Minehart <kmineh0151@gmail.com>
* Check the value type before casting it to the string
* set visualization as table by default
* append all values for show diagnostics
* golangci-lint
* append metadata only to first frame
* add clearer comment for function def
* update test to reflect change in range for 1w step
* clarify docs
* add more clarity
* add explanation to query options min interval and link to min step
* Update docs/sources/panels-visualizations/query-transform-data/_index.md
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
---------
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
Sets that status code on backend data responses in prometheus to match the status code returned by prometheus. If the failure is below HTTP/Application Layer, Bad Gateway is returned (502).
---------
Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
* Send sanitized selectors to the Pyroscope backend for LabelNames and LabelValues
* Clean LabelNames response to remove already used labels
* Improve performance after major changes
* Fix import order
* Further improve rendering performance
* Fix frontend tests
* Fix fake pyroscope client signature
* Bump pyroscope/api dependency to include start/end in LabelNames/LabelValues
* Fix issue with old queries running when using the run button
* Add generated file
* Make code more readable, add a few comments
* Format with prettier
* Fix error when assigning data
* Revert "Add generated file"
This reverts commit c4f33727b8.
* Remove leftover code
* Simplify query editor internal state objects
* Move label selector validation up, improve label filtering
* Simplify query editor state, switch to debounce to reduce rerenders
* Revert cosmetic change
* Have the first iteration
* Prepare bench testing
* rename the test files
* Remove unnecessary test file
* Introduce influxqlStreamingParser feature flag
* Apply streaming parser feature flag
* Add new tests
* More tests
* return executedQueryString only in first frame
* add frame meta and config
* Update golden json files
* Support tags/labels
* more tests
* more tests
* Don't change original response_parser.go
* provide context
* create util package
* don't pass the row
* update converter with formatted frameName
* add executedQueryString info only to first frame
* update golden files
* rename
* update test file
* use pointer values
* update testdata
* update parsing
* update converter for null values
* prepare converter for table response
* clean up
* return timeField in fields
* handle no time column responses
* better nil field handling
* refactor the code
* add table tests
* fix config for table
* table response format
* fix value
* if there is no time column set name
* linting
* refactoring
* handle the status code
* add tracing
* Update pkg/tsdb/influxdb/influxql/converter/converter_test.go
Co-authored-by: İnanç Gümüş <m@inanc.io>
* fix import
* update test data
* sanity
* sanity
* linting
* simplicity
* return empty rsp
* rename to prevent confusion
* nullableJson field type for null values
* better handling null values
* remove duplicate test file
* fix healthcheck
* use util for pointer
* move bench test to root
* provide fake feature manager
* add more tests
* partial fix for null values in table response format
* handle partial null fields
* comments for easy testing
* move frameName allocation in readSeries
* one less append operation
* performance improvement by making string conversion once
pkg: github.com/grafana/grafana/pkg/tsdb/influxdb/influxql
│ stream2.txt │ stream3.txt │
│ sec/op │ sec/op vs base │
ParseJson-10 314.4m ± 1% 303.9m ± 1% -3.34% (p=0.000 n=10)
│ stream2.txt │ stream3.txt │
│ B/op │ B/op vs base │
ParseJson-10 425.2Mi ± 0% 382.7Mi ± 0% -10.00% (p=0.000 n=10)
│ stream2.txt │ stream3.txt │
│ allocs/op │ allocs/op vs base │
ParseJson-10 7.224M ± 0% 6.689M ± 0% -7.41% (p=0.000 n=10)
* add comment lines
---------
Co-authored-by: İnanç Gümüş <m@inanc.io>
* Prepare the test files
* use json files everywhere
* update golden json files
* disable update
* update test file
* fix naming
* lint
* InfluxDB: Add metadata information to first frame only (#78664)
* executedString in first frame only
* lint
* fix tests
* update tests
* don't update
* linting
* update
* update again
* handle nil values
* append in the right array
* add comments
* remove redundant if condition
* Prepare the test files
* use json files everywhere
* update golden json files
* disable update
* update test file
* fix naming
* lint
* InfluxDB: Add metadata information to first frame only (#78664)
* executedString in first frame only
* lint
* fix tests
* update tests
* don't update
* linting
* update
* update again
* Use TimeSeriesWide format for table response
* fix group by query result parsing
* handle labels
* provide a test where result has no tags
* parsing results without time column
* clean the code
* remove the comment line
* more cleaning
* lint
* CloudWatch: call query method from DataSourceWithBackend to support public dashboards
* add test
* remove unneeded properties from test case
* update betterer
* add parens to group related logic
* remove unnecessary aliasing of variable
* use t.Cleanup
* remove redundant check
* add comment
* prepare backend for structured metadata
* add `lokiStructuredMetadata` feature toggle
* use `lokiStructuredMetadata` feature flag
* add field type check to `labelTypesField`
* remove fixme
* fix feature toggle
* add field in dataplane mode
* use `data.Labels` where possible
* adjust framing tests
* improve verbiage
* improve naming
* update tests to "attributes"
* InfluxDB: Add new truthiness operators (`Is` and `Is Not`) to InfluxQL Editor for use with boolean fields
* InfluxDB: Make the front-end aware of the new operators so that translation between raw and builder works
* Chore: Add tests
* feat: identify type of field value to allow other types to work with Is/Is Not
Tags: always quote
Integer: Don't quote
Float: Don't quote
Boolean: Don't quote
String: Quote
* Chore: Add test-cases for type inference
* Update front-end to infer type for operators Is and Is Not
* chore: Add front-end tests
* chore: add additional front-end tests
* chore: fix failing lint test
* chore: fix tests (run prettier)
This reverts commit 046791e2be.
Is causing malformed frames, and resulting in errors about mismatched field lengths in the logs, No data in the UI, and will cause SSE to panic.
I think this is because of the global slice vars since it seems to take concurrency to replicate it.
* Use GetDefaultCloud from SDK
* Use GetAzureCloud from SDK
* Credentials parser moved to azmoncredentials
* Refactor legacy credentials
* Tests
* Fix test description
Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
---------
Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
* InfluxDB: Add support for `>=` and `<=` comparison operators to InfluxQL Query Builder
* Add front-end support for the new operators
This ensures that the query translates correctly between raw and builder mode
* Chore: add test for new operators
* chore: add front-end tests
* fix: don't skip quoting on `<>`
This preserves the pre-existing behaviour, fixing a failing test
* chore: fix tests
* WIP
* Refactor, plus update source of error in response_parser
* Adjust test
* Use methods and httpclient from errorsource
* Update pkg/tsdb/elasticsearch/data_query.go
Co-authored-by: Scott Lepper <scott.lepper@gmail.com>
* Return nil error
* Fix test
* Fix integration test
---------
Co-authored-by: Scott Lepper <scott.lepper@gmail.com>
* Storage: Add maxFiles to list functions
* Add maxDataPoints argument to listFiles function
* Add maxFiles to ResourceDimensionEditor
* Update pkg/services/store/http.go
* rename First to Limit
---------
Co-authored-by: jennyfana <110450222+jennyfana@users.noreply.github.com>
Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* Update Tempo devenv to include profiles
* Update devenv to scrape profiles from local services
* Cleanup devenv
* Fix issue with flame graph
* Add width prop to ProfileTypeCascader
* Add trace to profiles settings
* Add new spanSelector API
* Add spanSelector to query editor
* Update span link query
* Conditionally show span link
* Combine profile and spanProfile query types and run specific query type in backend based on spanSelector presence
* Update placeholder
* Create feature toggle
* Remove spanProfile query type
* Cleanup
* Use feeature toggle
* Update feature toggle
* Update devenv
* Update devenv
* Tests
* Tests
* Profiles for this span
* Styling
* Types
* Update type check
* Tidier funcs
* Add config links from dataframe
* Remove time shift
* Update tests
* Update range in test
* Simplify span link logic
* Update default keys
* Update pyro link
* Use const
* Use context in aws ListSinks and ListAttachedLinks
In the current way, ListSinks and ListAttachedLinks is used which doesn't
allow cancelling the request if the context changes.
Using ListSinksWithContext and ListAttachedLinksWithContext is the
preferred way. Adding context for GetAccountsForCurrentUserOrRole
is required to pass it to ListSinks method.
* Add resultFormat to query model
* don't add row name if the result format is table
* No need special formatting since we use unified dataframes
* betterer
* specify visualization type in response
* Unit tests
* fix unit tests
* Use context in aws DescribeRegionsWithContext
In the current way, DescribeRegions is used which doesn't allow
cancelling the request if the context changes. Using
DescribeRegionsWithContext is the preferred way.
* Fix context variable
* Revert GetRegionsWithContext to GetRegions
GetRegions is not an AWS SDK method. Hence, GetRegions should be enough
as the name change is not needed for context implementation.
* 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
* Use apache/arrow v13
* remove apache/thrift
* go mod tidy with go1.21.1
* add metrics team as owner
---------
Co-authored-by: Kyle Brandt <kyle@grafana.com>
* Added spans to trace.go
* Added spans to search_stream.go
* Added spans to parca datasource
* Added spans for pyroscope
* Fix tests
* Fix another test
* Lint
* Revert "Fix another test"
This reverts commit a1639049e3.
* Use grafana-sdk-go tracing
* Only call preventDefault if it exists
* Change "View Traces" link to use traceQLSearch instead of the deprecated nativeSearch
* Thank you again test. Update tests
* Update test
* Update betterer
* Type fix
* Small type change
* Update betterer
* trying to remove tracing
* trying to remove tracing
* use plugin sdk tracing
* tracing is not init
* add infra tracing back
* remove infra trace
* Update pkg/tsdb/azuremonitor/metrics/azuremonitor-datasource.go
Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
* pr feedback
* remove code from other pr
---------
Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
* Use double quotes instead of backticks
* render time field as datetime
* add @react-awesome-query-builder/core
* Add time range filtering
* Update test
* Update macro test
Fix unexpected error when creating a new cloudwatch datasource.
Involves a fair amount of refactoring, so if this causes unexpected issues related to region fetching we can turn this off with the cloudwatchNewRegionsHandler feature toggle, although we do not predict it will so we are enabling it to default to true and hope to remove it shortly.
* issue loki queries in parallel so total query time is only the slowest query rather than the sum of all query times.
* Fix lint
* Add running of queries in parallel behind feature toggle to test the functonality before release
* Add span end
* Move shared logic to separate function
* Add logging and tracing around running of all queries
---------
Co-authored-by: Ivana Huckova <ivana.huckova@gmail.com>
* Elasticsearch: Add tracing do data source
* Fix tests
* Address feedback
* Update pkg/tsdb/elasticsearch/response_parser.go
Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
* Update pkg/tsdb/elasticsearch/response_parser.go
Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
* Track error across both spans
* Add span for decoding of response
* Fix test
* Update setting of errors + fix test
---------
Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
* 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
* Elasticsearch: Adjust naming in logging according to convention
* Log response parsing per response
* Update
* Fix logging of errors when no response
* Add path to error loggigng
* Update pkg/tsdb/elasticsearch/response_parser.go
* adjust Loki to logging convention
* Fix call resource logging
* Update dataquery
* Update
* Remove redundant logging
* Fix TODO
* Rename action to stage and use variables
* `resp` might be `nil`
* `resp` might be `nil` here as well
* change to `statusCode`
* use correct logger
* also here
* add query information to logging
---------
Co-authored-by: Ivana Huckova <ivana.huckova@gmail.com>
* Add support for MI authentication to MSSQL
This adds support for managed identity authentication for MSSQL managed
instances running in Azure.
Co-authored-by: baldm0mma <jev.forsberg@grafana.com>
* removed infra logs
* improve health check
* remove debug and error logs
* feedback
* Update pkg/tsdb/azuremonitor/azuremonitor-resource-handler.go
* Update pkg/tsdb/azuremonitor/loganalytics/azure-log-analytics-datasource.go
* fix close body error
* update test
* resource request should return errors
* go linter
* go linter
* Unify default value
* Use variable to keep default precisions in sync
* Use default precision variable
* Update precision description
* Update defaultPrecisionString and move
* Be more specific in naming of variabkle
* Revert "Merge remote-tracking branch 'origin' into ivana/es-precision-default-value"
This reverts commit 599f236a77, reversing
changes made to 6742be0c6d.
* Revert wrong merge
* Revert wrong merge with turned off lefthook