* flag vector aggregations containing metric expressions (i.e.`(...)`) containing binary operation expressions with ambiguous error in the UI when switching between code and visual query builders.
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.
* Following similar changes made to prometheus in #47198, reverse the order of binary operator parameter array, and fix bugs introduced by importing prometheus lezer constants into loki parser
* add unit test asserting buildVisualQueryFromString does not properly parse queries with nested binary operations
* fix onOrIgnoring parsing logic which was always stripping out the value of the matcher when a boolean was found
* Add necessary fields to edges
* Add information about name and namespace to edge when available
* Use new fields to build search taking into account namespace
* Remove new fields from NodeGraphDataFrameFieldNames, define them locally
* various type fixes
* candlestick panel type fixes
* few more fixes
* some fixes
* more :)
* moar!
* undo change to SilencesFilter
* undo change to configureStore
* 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>
* check languageProvider to work with non-indexed metadata
* change loki devenv to work with non-indexed metadata
* trigger ci
* add forced labels after parsers
* add comment
* Update public/app/plugins/datasource/loki/modifyQuery.ts
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
---------
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
* fix some event.target as stuff
* segment async story
* segmentinput story
* SegmentSelect
* fixing some tests
* more test fixes
* undo change to SilencesFilter
* 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
* Metrics summary
* Update query
* Remove colors
* Update states
* Add group by into its own component
* Add group by to search and traceql tabs
* Add spacing for group by
* Update span kind values
* Update span status code values
* Update query based on target + group by
* Cleanup
* Only add targetQuery if not empty
* Add kind=server to table
* Update groupBy query logic
* Add feature toggle
* Use feature toggle
* Self review
* Update target query
* Make gen-cue
* Tweak query
* Update states
* useRef for onChange
* Fix for steaming in search tab
* Add loading state tests
* metricsSummary tests
* Datasource tests
* Review updates
* Update aria-label
* Update test
* Simplify response state
* More manual testing and feedback from sync call
* Prettier and fix test
* Remove group by component from traceql tab
* Cleanup, tests, error messages
* Add feature tracking
* move truncating to helper function, to start of array
* Prometheus: Add 1000 result warning as sticky footer in metric select (#73649)
add 1000 result warning as sticky footer in metric select
* Prometheus: Only show truncated results warning if results have been truncated (#73650)
only show truncated warning if results have been truncated
* add test to metric select
---------
Co-authored-by: Brendan O'Handley <brendan.ohandley@grafana.com>
Co-authored-by: bohandley <brendan.ohandley@gmail.com>
* InfluxDB/QueryEditor: Add delete buttons to measurement, part and tag sections
The diff provides an additional "delete" button to measurement section, part list section and tags section in the influxdb datasource editor. This improves user experience by allowing users to delete measurements, parts and tags directly from the user interface. The commit also slightly refactors the options generation for these sections, removing the "-- remove filter --" option as it becomes redundant with the new delete button.
* InfluxDB/QueryEditor: Replace Button with AccessoryButton
Changed the Button components to AccessoryButton from the '@grafana/experimental' package, used for the delete functionality in data source components for influxdb query editor. The AccessoryButton is more visually consistent with our current Grafana UI aesthetic and provides better user experience. The change was implemented in FromSection.tsx, PartListSection.tsx, and TagsSection.tsx files.
* Update public/app/plugins/datasource/influxdb/components/editor/query/influxql/visual/FromSection.tsx
Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
* Update public/app/plugins/datasource/influxdb/components/editor/query/influxql/visual/PartListSection.tsx
Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
---------
Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
Update config editor
- Use Field instead of InlineField
- Make use of new ConfigSection structural components
- Add DataSourceDescription component
- Add secureSocksProxy to types
* Add nested option to DataFrame. Refactor Table to use nested dataframes for sub-tables
* Use nested frames for TraceQL response
* debugging
* Fix cell text and table position
* Update getItemSize
* noHeader size
* Update sub table renderer
* Update table container height
* Cleanup and fix RawPrometheusContainer height
* Update resultTransformer and docker script
* Updates to TableContainer, resultTransformer after merge
* Fixes for table pagination in dashboards
* Cell height and show footer enhancement/fix
* Sub table links
* Update RawPrometheusContainer
* Remove console log
* Update tests
* Update storybook
* Remove Tempo demo
* Store nested data in single field via its values
* Move nested prop into custom
* Tempo demo
* Add field type & update incorrect logic
* Update docker compose image for Tempo
* Update packages/grafana-data/src/field/fieldOverrides.ts
Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
* Simplify logic for getting nestedFrames and rendering sub tables
* Update docs for table
* Update nested table bg color
* Lighten nested table bg color
* Renames
* Migrate frames using parentRowIndex and add deprecation notice
* Update title
* Align expander icon size between Table and interactive table
* Table: Refactor out the expanded rows bits
* fix spacing
* Add line along left side for expanded rows
* Disable hover row background when expanded
---------
Co-authored-by: André Pereira <adrapereira@gmail.com>
Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
* Make it clear that MariaDB is also supported as datasource
MariaDB is now the default relational DB on lots of Linux distribution,
it's important to make it clear that it is perfectly supported.
* Fix 404 and make MySQL docs URL more robust
And lint with prettier.
* Review from lwandz13
Use the same code path to interpolate both metric variables and
filter/tag variables when the data source is accessed either directly or
via the expressions datasource.
partial fix for #48141 (opentsdb datasource only)
Signed-off-by: Uri Okrent <uokrent@gmail.com>
* Add influxdbSqlSupport feature toggle
* Add SQL option to the config page
* Add SQL backend
* Add metadata support in config page
* Implement unified querying
* Fix healthcheck query
* fsql tests
* secure grpc by default
* code cleanup
* Query handing for sql mode
* Implement a placeholder sql editor
* Fix query language dropdown
* drop in SQL editor
* switch to use rawSql, get sql editor working
* fix healthcheck
* WIP
* memoize component to stop unwanted rerender onQuery
* dont reinit datasource on each render of the editor
* remove useless memo
* clean up
* Fix the link
* Alpha state warning
* Remove console.logs
* update model for fsql
* remove unused
---------
Co-authored-by: Galen <galen.kistler@grafana.com>
* Replacing the regex based approach and integrating the lezer-traceql grammar in the editor
* Added some tests
* Added path to capture error in filter root
* Tests are great and help fix issues 👍
* Fix autocomplete tests
* Allow overriding internal data link supplier
* Remove SplitOpen and getFieldLinksForExplore dependencies
* Fix checking if row index is provided
* Fix unit test
* Add a comment
* Mark SplitOpen as deprecated
* Use Panel Context to provide internal data link supplier
* Update packages/grafana-ui/src/components/PanelChrome/PanelContext.ts
Co-authored-by: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com>
* Update packages/grafana-data/src/utils/dataLinks.ts
Co-authored-by: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com>
* Add missing eventsScope
* Fix infinite render loops
* Rename internal data link supplier to data link post processor
* Update packages/grafana-data/src/field/fieldOverrides.ts
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
---------
Co-authored-by: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
* Lucene: add dependency
* ModifyQuery: use Lucene parser to detect key:values in queries
* ModifyQuery: use Lucene parser to remove filters
* Remove test code
* Modify query: switch to recursive implementation
* Modify query: implement remove filter
* Update query normalizing function
* FlagElasticToggleableFilters: remove feature flag
* Remove unused feature flag from test
* Elasticsearch: escape quotes in filter values
* Geomap: Add network layer
* Support text labels for nodes
* Add solid styling for edges
* Remove symbol option for edge style menu
* Add support for edge text labels
* Fix linter issues
* Simplify multiple data frame handling
* Add TODO notes
* Add node and edge style categories for options
* Remove data frame hardcoding
* Hide legend, attempt to hide tooltip by default
* Mark network layer as beta
* refactor updateEdge
* Fix some linter issues
* Remove attempt at disabling tooltip for network layer
* For edge text add a stroke and increase z index
* Restrict field selection based on frame type
* refactor
* add basic bad data handling (prevent entire panel from breaking)
* generate non hard coded graph frames for style editor filtering
* code cleanup; remove hardcoded reference to "edges" frame
* fix select clearing for Data option
* fix styling
* fix lookup
---------
Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
Co-authored-by: Adela Almasan <adela.almasan@grafana.com>
* build httpsettings overhaul with new auth component
* remove test code
* add connection and advanced http settings components
* use tooltip with link
* add correct styling and spacing
* save option select for sigV4
* fix styles in Azure auth to fit new auth component
* add types in overhaul folder that are not available yet in grafana
* update e2e tests for new connection component
* update e2e tests for new connection component
* update width of azure inputs
* fix non custom auth selects
* add feature toggle
* wrap azure style changes behind the feature flag
* fix feature toggle rebase fix error
* move advanced http setting and wrap everything in the config subsection component to fix font
* fix input width
* use cx for conditional classes
* use cx for conditional class
* Revert "remove regions/locations from variable editor"
This reverts commit 41dc6a8bfb.
* Revert "remove region pieces from e2e"
This reverts commit 6b1f82f14a.
* e2e: open resource picker correctly
* AzureMonitor: Fix ResourcePicker hanging
Removed location fetching for every subscription.
Fixes#70523
* fix region for multi metricnames
* fix tests
* fix e2e
* remove regions/locations from variable editor
* remove region pieces from e2e
* Remove feature flag from registry.go
* Remove usages of toggle
* Refactor and cleanup Tempo's query field components
* Added deprecation alert
* Mark nativeSearch fields as deprecated
* Also show deprecated search tab if queryType is nativeSearch
* Update deprecation message to list grafana version
* Fix merge conflict
* Remove mention of toggle from docs
* Update dependency @grafana/experimental to v1.6.1
* chore(mssql-datasource): update completion provider to work with experimental type changes
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
* Datasource test: fix describe nesting
* Parsing: export handleQuotes function
* Modify query: add functions to detect the presence of a label and remove it
* Loki: add support to toggle filters if already present
* Datasource test: fix describe nesting
* Loki: add support to toggle filter out if present
* Remove label: handle escaped values
* Datasource: add test case for escaped label values
* Loki: remove = filter when applying !=
* Remove selector: add support for Selector node being far from Matcher
* Modify query: add unit tests
* Elasticsearch: create modifyQuery for elastic
* Elastic modify query: implement functions
* Elasticsearch: implement modifyQuery functions in datasource
* Elasticsearch: update datasource test
* Loki modify query: check for streamSelectorPositions length
* Elasticsearch query has filter: escape filter value in regex
* Remove unused type
* Modify query: add functions to detect the presence of a label and remove it
* Remove label: handle escaped values
* Logs: create props to check for label filters in the query
* Log Details Row: use label state props to show visual feedback
* Make isCallbacks async
* Explore: add placeholder for checking for filter in query
* Datasource: define new API method
* Inspect query: add base implementation
* Remove isFilterOutLabelActive as it will not be needed
* Check for "isActive" on every render
Otherwise the active state will be out of sync
* Elasticsearch: implement inspectQuery in the datasource
* Logs: update test
* Log details: update test
* Datasources: update tests
* Inspect query: rename to analize query to prevent confusion
* Datasource types: mark method as alpha
* Explore: add comment to log-specific functions
* Remove duplicated code from bad rebase
* Remove label filter: check node type
* getMatchersWithFilter: rename argument
* Fix bad rebase
* Create DataSourceWithQueryManipulationSupport interface
* Implement type guard for DataSourceWithQueryManipulationSupport
* DataSourceWithQueryManipulationSupport: move to logs module
* hasQueryManipulationSupport: change implementation
`modifyQuery` comes from the prototype.
* DataSourceWithQueryManipulationSupport: expand code comments
* AnalyzeQueryOptions: move to logs module
* DataSourceWithQueryManipulationSupport: add support for more return types
* Fix merge error
* Update packages/grafana-data/src/types/logs.ts
Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
* DatasourceAPI: deprecate modifyQuery
* Explore: refactor isFilterLabelActive
* DataSourceWithQueryModificationSupport: rename interface
* Split interfaces into Analyze and Modify
* Query analysis: better name for interface
* Fix guard
* Create feature flag for active state
* Use new feature flag in Explore
* DataSourceToggleableQueryFiltersSupport: create a specific interface for this feature
* Rename feature flag
* De-deprecate modifyQuery
* DataSourceToggleableQueryFiltersSupport: Rethink types and methods
* Explore: adjust modifyQuery and isFilterLabelActive to new methods
* Loki: implement new interface and revert modifyQuery
* DataSourceToggleableQueryFiltersSupport: better name for arguments
* Elasticsearch: implement new interface and revert modifyQuery
* Loki: better name for arguments
* Explore: document current limitation on isFilterLabelActive
* Explore: place toggleable filters under feature flag
* Loki: add tests for the new methods
* Loki: add legacy modifyQuery tests
* Elasticsearch: add tests for the new methods
* Elasticsearch: add legacy modifyQuery tests
* Toggle filter action: improve type values
* Logs types: update interface description
* DataSourceWithToggleableQueryFiltersSupport: update interface name
* Update feature flag description
* Explore: add todo comment for isFilterLabelActive
---------
Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
* pushed to get help of a genius
* fix: error response is not json
* feat: make request on click
* refactor: remove print statement
* refactor: remove unnecessary code
* feat: convert grafana variables to value for API request
* use the parser to interpolate and recover the original query (#64591)
* Prettify query: use the parser to interpolate and recover the original query
* Fix typo
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
* Fix typo
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
* fix: reverse transformation not working
---------
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
Co-authored-by: Gareth Dawson <gwdawson.work@gmail.com>
* fix: bugs created from merge
* refactor: move prettify code out of monaco editor
* fix: variables with the same value get converted back to the incorect variable
* refactor
* use consistent styling with bigquery
* fix: only allow text/plain and application/json
* fix: only make the request if the query is valid
* endpoint now returns application/json
* prettify from js
* WIP: not all cases are handles, code still needs cleaning up
* WIP
* large refactor, finished support for all pipeline expressions
* add tests for all format functions
* idk why these files changed
* add support for range aggregation expr & refactor
* add support for vector aggregation expressions
* add support for bin op expression
* add support for literal and vector expressions
* add tests and fix some bugs
* add support for distinct and decolorize
* feat: update variable replace and return
* fix: lezer throws an errow when using a range variable
* remove api implementation
* remove api implementation
* remove type assertions
* add feature flag
* update naming
* fix: bug incorrectly formatting unwrap with labelfilter
* support label replace expr
* remove duplicate code (after migration)
* add more tests
* validate query before formatting
* move tests to lezer repo
* add feature tracking
* populate feature tracking with some data
* upgrade lezer version to 0.1.7
* bump lezer to 0.1.8
* add tests
---------
Co-authored-by: Matias Chomicki <matyax@gmail.com>
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
* Fix accessibility issues
- Ensure key events exist and role is appropriately set
- Ensure that when the filter field is cleared the query is updated
* Review
* Refactor Tempo datasource backend to support multiple queryData types.
Added traceId query type that is set when performing the request but doesn't map to a tab.
* WIP data is reaching the frontend
* WIP
* Use channels and goroutines
* Some fixes
* Simplify backend code.
Return traces, metrics, state and error in a dataframe.
Shared state type between FE and BE.
Use getStream() instead of getQueryData()
* Handle errors in frontend
* Update Tempo and use same URL for RPC and HTTP
* Cleanup backend code
* Merge main
* Create grpc client only with host and authenticate
* Create grpc client only with host and authenticate
* Cleanup
* Add streaming to TraceQL Search tab
* Fix merge conflicts
* Added tests for processStream
* make gen-cue
* make gen-cue
* goimports
* lint
* Cleanup go.mod
* Comments
* Addressing PR comments
* Fix streaming for tracel search tab
* Added streaming kill switch as the disableTraceQLStreaming feature toggle
* Small comment
* Fix conflicts
* Correctly capture and send all errors as a DF to client
* Fix infinite error loop
* Fix merge conflicts
* Fix test
* Update deprecated import
* Fix feature toggles gen
* Fix merge conflicts
* Update dependency lru-cache to v10
* use named import
* remove outdated type definitions and actually use named import
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* Update dependency immer to v10
* use named export now that the default has been removed
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* Elasticsearch: add additional settings section
* Remove extra lines
* Elastic config: add divider between name and http settings
* Data links: fix subsection title
* Remove unused import
* refactor: replace IconButtons
* refactor: replace tooltip text in order to make it more universal
* refactor: remove additional IconButton
* refactor: add aria-labels
* refactor: fix test
When building a query for multiple resources only a subset of metrics
are valid and that selection is only available via the API version `2017-12-01-preview`.
fixes#68603
* Reduce number of unnecessary request in the alert list panel in case we have data source filter selected
* use fetchPromAndRulerRulesAction instead of fetchAllPromAndRulerRulesAction in case of having datasource selected in options
* remove unnecessary useEffect
* Reduce number of requests in GroupBy component if data source is selected
* use redux utils for asyncmapslice
* lint
* Address review comments
* Skip fetching grafana rules if datasource is not Grafana rules source name
---------
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
* fix: use correct validate funtion
* rename isValidQuery to isQueryWithError
* lets pretend i didnt break things again
* Loki validation: add missing comments and refactor validation function
* isValidQuery: add unit test
* Loki datasource: add tests for getQueryStats
* Remove isValidQuery function
* UnwrapParamEditor: interpolate query before testing validity
* Stats: trim queries when evaluating change
---------
Co-authored-by: Matias Chomicki <matyax@gmail.com>
* remove hover style from results
* remove metric select keyboard interactions and highlighting for table results
* update naming for metrics explorer
* fix bug for match highlighting persisting when empty query