grafana/pkg
Gareth Dawson 4e42f9b619
Loki: Add the ability to prettify logql queries (#64337)
* 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>
2023-07-21 13:03:56 +01:00
..
api Tempo: remove deprecated model package usage (remove replace) (#71687) 2023-07-18 19:30:29 +03: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 Kindsys: update generated doc and add check in CI (#71871) 2023-07-20 11:48:12 +02: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 Core: Update thema, cuetsy and cue fork (#71527) 2023-07-13 17:29:38 +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 Chore: Remove pfs.GrafanaPlugin from schemas (#71884) 2023-07-19 03:46:13 -04: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 Loki: Add the ability to prettify logql queries (#64337) 2023-07-21 13:03:56 +01:00
setting Secure socks proxy: use Grafana Plugin SDK (#71616) 2023-07-18 15:23:02 -06:00
systemd Chore: Convert background service registry to dskit module (#64062) 2023-07-06 14:45:47 +02:00
tests Chore: Convert background service registry to dskit module (#64062) 2023-07-06 14:45:47 +02:00
tsdb AzureMonitor: Set timespan in Logs Portal URL link (#71841) 2023-07-19 09:15:14 +01: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.