grafana/pkg
Matias Chomicki 84f94cdc24
Logs: Show active state of "filter for value" buttons in Logs Details (#70328)
* 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>
2023-07-24 11:22:47 +03:00
..
api RBAC: Split non-empty scopes into kind, attribute and identifier fields for better search performance (#71933) 2023-07-21 15:23:01 +01:00
build Bug: Compare semver digits for frontend packages config (#71829) 2023-07-18 17:10:40 +03:00
bus Chore: Fix goimports grouping in other backend platform packages (#62422) 2023-01-30 08:26:42 +00:00
cmd Plugin: Remove error on invalid version (#71951) 2023-07-19 16:55:31 +02:00
codegen Schemas: minor updates from the k8s branch (#71688) 2023-07-21 19:17:11 +03:00
components ApiKeyGenPrefix: rename package (#65623) 2023-03-30 17:04:10 +02:00
cuectx Kinds: publish kinds to kind registry (#67515) 2023-06-13 14:01:29 +02:00
events Alerting: Update rules version when folder title is updated (#53013) 2022-08-01 19:28:38 -04:00
expr SSE: Use errutil to show better error messages in prod (#71658) 2023-07-21 06:38:29 -04:00
extensions Tempo: TraceQL query response streaming (#69212) 2023-07-14 15:10:46 +01:00
ifaces/gcsifaces Chore: Upgrade Go to 1.19.1 (#54902) 2022-09-12 12:03:49 +02:00
infra Secure socks proxy: use Grafana Plugin SDK (#71616) 2023-07-18 15:23:02 -06:00
kinds Schemas: minor updates from the k8s branch (#71688) 2023-07-21 19:17:11 +03:00
kindsysreport Kinds: Fix report generation (#71048) 2023-07-05 14:58:00 -04:00
login AzureAD: Fix missing context (#71717) 2023-07-18 09:48:58 +02:00
middleware api: ignore /api/gnet proxy when gzipping responses (#71437) 2023-07-13 07:51:25 +01:00
mocks/mock_gcsifaces Chore: Fix goimports grouping in other backend platform packages (#62422) 2023-01-30 08:26:42 +00:00
models Auth: Add empty role definition (#64694) 2023-07-06 15:40:06 +02:00
modules Chore: Wrap provisioning in dskit service (#71598) 2023-07-18 15:37:25 -04:00
plugins Plugins Instrumentation: add exemplar to the plugin requests metrics (#72071) 2023-07-21 18:01:29 +02:00
registry Schema: Remove ServiceAccount kind (#69194) 2023-06-01 07:02:17 -07:00
server Chore: Wrap provisioning in dskit service (#71598) 2023-07-18 15:37:25 -04:00
services Logs: Show active state of "filter for value" buttons in Logs Details (#70328) 2023-07-24 11:22:47 +03:00
setting AuthN: Lock down manual role updates for users synced through Grafana Com portal (#72044) 2023-07-21 15:22:28 +01:00
systemd Chore: Convert background service registry to dskit module (#64062) 2023-07-06 14:45:47 +02:00
tests RBAC: Split non-empty scopes into kind, attribute and identifier fields for better search performance (#71933) 2023-07-21 15:23:01 +01:00
tsdb CloudMonitoring: Correctly set title and text fields for annotations (#71888) 2023-07-21 20:42:42 +00:00
util errutil: (Chore) Make PublicError fulfill error (#71945) 2023-07-19 09:52:49 -04:00
web Chore: Add grafana-apiserver (#70721) 2023-07-14 12:22:10 -07:00
README.md Chore: Move all backend contribution documents to a single directory (#61140) 2023-01-11 11:16:52 +01:00
ruleguard.rules.go Chore: update all +build statements (#38782) 2021-09-01 17:38:56 +03:00

This directory contains the code for the Grafana backend.

The contributor documentation for Grafana's backend is in /contribute/backend/README.md.