Commit Graph

210 Commits

Author SHA1 Message Date
Todd Treece
cdb2e7dd3e
Chore: Sync go workspace (#84932) 2024-03-21 18:34:40 +02:00
Ryan McKinley
e27c08cfa9
QueryService: Return application/json and better errors (#84234) 2024-03-19 15:52:15 +02:00
Jack Westbrook
6599fa805d
Plugins: Always load decoupled frontend assets from builds (#81873)
* Wip

* Wip

* Adapt to load external module

* build: remove cloudmonitoring from built_in_plugins, clean up webpack output

* chore(plugins): remove decoupled plugins from package.json deps

* chore(codeowners): update file for nx.json

* revert(webpack): put back path in config

* build(frontend): use nx to run prod builds of decoupled plugins with yarn build

* style(prometheus): run prettier-write to fix tsconfig.json

* style(backend): remove unused subFile.isDistDir

* revert(locales): remove formatting changes adding new line at end of files

* chore(webpack): clean up dev output

* build(nx): make grafana an nx project, bump lerna and nx

* build(plugin-configs): move cache directory to node_modules

* style(datasource-plugins): add eslint ignore for .gen.ts files

* chore(codeowners): add frontend-ops as owner of project.json

* build(webpack): add getDecoupledPlugins to automatically ignore when watching

* ci(drone): skip nx cache when building frontend packages

* style(ci): fix missing trailing comma

* Revert "style(ci): fix missing trailing comma"

This reverts commit 7520d41576.

* Revert "ci(drone): skip nx cache when building frontend packages"

This reverts commit 46938883ac.

* feat(zipkin): remove from grafana core bundle

* chore(npm): bump nx package to latest 18.0.8

* docs(dev-guide): add a note about what yarn start now builds

---------

Co-authored-by: Andres Martinez <andres.martinez@grafana.com>
2024-03-13 12:40:09 +01:00
ismail simsek
3bb38d82ab
Chore: Bump grafana-plugin-sdk-go version to v0.214.0 (#84162)
* bump grafana-plugin-sdk-go version to v0.214.0

* make swagger-clean && make openapi3-gen
2024-03-11 16:49:53 +01:00
Todd Treece
49d3cb29eb
Chore: Add go workspace (#83191)
---------

Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
2024-02-23 08:54:24 -05:00
ismail simsek
916a7bbb08
Prometheus: Move converter in prometheus package (#82269)
* use jsoniter from sdk

* move converter into the prometheus

* remove jsonitere

* unit test

* remove redundant ownership
2024-02-15 15:09:30 +01:00
Ryan McKinley
3482c8ef09
Chore: Add omit wrapper for xorm (#82476) 2024-02-14 12:19:46 -08:00
ismail simsek
63670b7adc
Chore: Use jsoniter in prometheus from grafana-plugin-sdk-go (#82359)
use jsoniter from grafana-plugin-sdk-go
2024-02-13 21:19:13 +01:00
Jo
6f62d970e3
JWT Authentication: Add support for specifying groups in auth.jwt for teamsync (#82175)
* merge JSON search logic

* document public methods

* improve test coverage

* use separate JWT setting struct

* correct use of cfg.JWTAuth

* add group tests

* fix DynMap typing

* add settings to default ini

* add groups option to devenv path

* fix test

* lint

* revert jwt-proxy change

* remove redundant check

* fix parallel test
2024-02-09 16:35:58 +01:00
Diego Augusto Molina
b02f0b926a
Settings: Fix data race when dynamically overriding settings with environment variables (#81667)
Chore: Fix data race when dynamically overriding settings with environment variables
2024-02-05 12:25:54 -03:00
Kyle Brandt
1b155a02fd
Prometheus: (Dataplane) Set FrameTypeVersion on Scalar type responses (#81491)
So expressions (SSE) and recorded queries (RQ) detect the response correctly
2024-01-29 11:39:23 -05:00
Ryan McKinley
c9ff6a9ab9
Chore: Generate shorter UIDs (#79843) 2024-01-24 11:27:46 -08:00
Sven Grossmann
e1aa8a95d9
Loki: Fix bug duplicating parsed labels across multiple log lines (#80292) 2024-01-11 15:09:13 +01:00
Will Browne
78ae795e06
Plugins: Fix loading of dist folders (#80015)
* end to end

* tidy

* fix whitespace

* remove unused code

* fix linter

* fix gosec + add sort

* fix test

* apply cr feedback
2024-01-08 11:45:03 +01:00
Serge Zaitsev
4f70586ead
Chore: Remove mssql driver from xorm (#79930)
remove mssql driver from xorm
2024-01-02 17:11:35 +01:00
Will Browne
ef60c90dfa
Plugins: Make file system path handling in tests OS agnostic (#79651)
* make path handling OS agnostic

* PR feedback

* fix input for test case
2023-12-19 11:01:48 +01:00
Ryan McKinley
9849c954a3
Chore: remove the entity kind registry (#79178) 2023-12-06 14:00:53 -08:00
Ryan McKinley
3299809977
Chore: remove unused math function (#79120) 2023-12-06 01:38:48 -08:00
Gabriel MABILLE
ef2c79d22a
Chore: use errutil for pluginRepo errors (#78647)
* Chore: use errutil for pluginRepo errors

* Update pkg/util/errutil/status.go

* Use errutil helper functions

Co-Authored-By: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* Forgot the log level

* Use entity

---------

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2023-11-30 15:49:27 +01:00
Sven Grossmann
44586df7bf
Loki: Fix scope of labels variable being wrong (#78417)
fix scope of labels var
2023-11-21 10:14:21 +01:00
Sven Grossmann
a01f8c5b42
Loki: Add backend functionality to parse structured metadata from Loki (#77361)
* 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"
2023-11-16 17:06:14 +01:00
Will Browne
26bcfe300f
Plugins: Follow root level dist and siblings when walking file system (#78042)
* simplify

* add comments

* tidy up

* remove line

* update comment

* fix pfs test

* fix err import

* delete code
2023-11-14 10:31:46 +01:00
Serge Zaitsev
5458ea18e7
Chore: Use vendored xorm instead of a fork (#77388)
* use vendored xorm instead of a fork

* bring back mssql driver

* backport azuresql driver

* restore NoAutoTime
2023-11-06 16:09:49 +01:00
Andres Martinez Gotor
d5f749482a
Ignore dist folder for core plugin (#77549) 2023-11-02 14:56:47 +01:00
Alexander Zobnin
cad3c43bb1
Team LBAC: Move middleware to enterprise (#76969)
* Team LBAC: Move middleware to enterprise

* Remove ds proxy part

* Move utils to enterprise
2023-10-24 14:06:18 +03:00
Alexander Zobnin
5563f2f98f
Team LBAC: Fix multiple header values (#76821)
* Team LBAC: Fix multiple header values

Co-authored-by: Eric Leijonmarck <eleijonmarck@users.noreply.github.com>

* Fix linter error

---------

Co-authored-by: Eric Leijonmarck <eleijonmarck@users.noreply.github.com>
2023-10-19 17:09:53 +02:00
Eric Leijonmarck
17fe1d3fc7
Team LBAC: Refactor to use only the teamHeader json part (#76756)
* refactor: to check for feature toggle and for checking for jsonData field

* fix tests

* whitelisting of X-Prom-Label-Policy Header
2023-10-18 16:09:22 +01:00
Eric Leijonmarck
be5ba68132
Team LBAC: Add teamHeaders for datasource proxy requests (#76339)
* Add teamHeaders for datasource proxy requests

* adds validation for the teamHeaders

* added tests for applying teamHeaders

* remove previous implementation

* validation for header values being set to authproxy

* removed unnecessary checks

* newline

* Add middleware for injecting headers on the data source backend

* renamed feature toggle

* Get user teams from context

* Fix feature toggle name

* added test for validation of the auth headers and fixed evaluation to cover headers

* renaming of teamHeaders to teamHTTPHeaders

* use of header set for non-existing header and add for existing headers

* moves types into datasources

* fixed unchecked errors

* Refactor

* Add tests for data model

* Update pkg/api/datasources.go

Co-authored-by: Victor Cinaglia <victor@grafana.com>

* Update pkg/api/datasources.go

Co-authored-by: Victor Cinaglia <victor@grafana.com>

---------

Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>
Co-authored-by: Victor Cinaglia <victor@grafana.com>
2023-10-17 11:23:54 +01:00
Marcus Efraimsson
90631360eb
Instrumentation: Handle context.Canceled (#75867)
Ref #68480

Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>
2023-10-10 12:28:39 +02:00
Marcus Efraimsson
e4c1a7a141
Tracing: Standardize on otel tracing (#75528) 2023-10-03 14:54:20 +02:00
Karl Persson
684d68365e
IDforwarding: forward signed id to plugins (#75651)
* Plugins: Add client middlware that forwards the signed grafana id token if present

* DsProxy: Set grafana id header if id token exists

* Add util function to apply id token to header

* Only add id forwarding middleware if feature toggle is enabled

* Add feature toggles to ds proxy and check if id forwarding is enabled

* Clean up test setup

* Change to use backend.ForwardHTTPHeaders interface

* PluginProxy: Forward signed identity when feature toggle is enabled

* PluginProxy: forrward signed id header
2023-10-02 09:14:10 +02:00
Kyle Brandt
b87279b8d8
Prometheus: Fix creation of invalid dataframes with exemplars (#75187)
for #73654
2023-09-21 07:30:14 -04:00
Marcus Efraimsson
8ee43f3705
Instrumentation: Add status_source label to request metrics/logs (#74114)
Ref #68480

Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>
2023-09-11 12:13:13 +02:00
Yuri Tseretyan
99fd7b8141
Alerting: Update provisioning to validate user-defined UID on create (#73793)
* add ValidateUID to util
* provisioning to validate UID on rule creation

---------

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
2023-09-08 15:09:35 -04:00
ismail simsek
3107459e57
Prometheus: Handle the response with different field key order (#74567)
* 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
2023-09-08 19:58:05 +02:00
Jo
dcf06658eb
Chore: Implement requester in util pkg (#74105)
implement requester changes that do not impact functionality
2023-08-31 09:46:55 +02:00
Ryan McKinley
025b2f3011
Chore: use any rather than interface{} (#74066) 2023-08-30 18:46:47 +03:00
Kyle Brandt
38603b1a9e
Prometheus: Check for errors on json response parsing (#73788)
- The util/converter Prometheus response json parse was not checking for errors while parsing. It now does. In particular, if `[dataproxy]/response_limit` is set in Grafana's config, it will now recognize the limit error.
- Fixes #73747
- Adds `jsonitere` package, which wraps json-iterator/go's Iterator's Methods with methods that return errors, so errcheck linting can be relied upon
- Impact:
  - If something was sending malformed JSON to the prometheus or loki datasources, the previous code might have accepted that and partially processed the data
  - Before there may have been partial data with no error, where as no there may be errors but they will have no partial results, just the error.
2023-08-28 15:53:50 +03:00
Kyle Brandt
6d8fc42cdd
Prometheus: (Chore) Remove experimental unshipped prometheusWideSerie… (#73751) 2023-08-24 17:47:19 +03:00
Marcus Efraimsson
040b7d2571
Chore: Add errutils helpers (#73577)
Add helpers for the errutil package in favor of errutil.NewBase.
2023-08-22 12:52:24 +02:00
Kyle Brandt
ebc6288191
errutil: (Chore) Make PublicError fulfill error (#71945) 2023-07-19 09:52:49 -04:00
ismail simsek
81ba27c149
Feat: Match allowed cookies with optional character (#71047)
* Match allowed cookies with optional character

* Use strings package
2023-07-05 16:12:56 +02:00
Yuri Tseretyan
2e0dae8fa0
Chore: Fix DiffReporter.Paths to properly initialize slice (#70870) 2023-06-28 18:08:05 -04:00
SatVeer Singh
1bfa3a0f1e
Chore: Replace go-multierror with errors package (#66432)
* code refactor and type assertions added to tests

* no-lint rule added for specific line
2023-06-19 12:29:45 +03:00
Jean-Philippe Quéméner
fe2103bfc8
Util: Fix panic when generating UIDs concurrently (#69476) 2023-06-05 11:21:11 +02:00
venkatbvc
b9e53f628f
HTTP: Add TLS version configurability for Grafana server (#67482)
Co-authored-by: Rao B V Chalapathi <b_v_chalapathi.rao@nokia.com>
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
2023-05-08 17:11:36 +02:00
Ieva
848f1f0fb2
Chore: change default log level (#64304)
raise log level

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
2023-05-05 15:45:48 +01:00
Emil Tullstedt
cefeef7134
Proxy: Improve header handling for reverse proxy (#67279) 2023-04-27 13:30:11 +02:00
Kevin Minehart
405bda7e99
Packaging: Added deprecation warnings when running grafana-cli or grafana-server; the grafana command should be used instead. (#66976)
* Add grafana-cli and grafana-server deprecation warnings

* remove extra :
2023-04-20 19:51:50 +02:00
Dan Cech
7e765c870a
Utils: Reimplement util.GetRandomString to avoid modulo bias (#64481)
* reimplement GetRandomString, add tests that results are unbiased
2023-04-20 10:24:02 -04:00