11 Commits

Author SHA1 Message Date
54a51bd3e3 Data source plugin: Improve error message when plugin has connection issues (#102625)
* Improve data source error message when stackID

* Update comment

* Revert "Update comment"

This reverts commit 48922bc55259803f1717e91afc9f749a60d61184.

* Revert "Improve data source error message when stackID"

This reverts commit 4bf0a2f7b712e77b9de4655716695a7ee75c183b.

* Make public messagic configurable based on context

* Update, simplify

* Update

* Update getting stack

* Update pkg/plugins/errors.go

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>

* Refactor test to test for when context has stack value

* Remove duplicated test

* Fix error checking logic

---------

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
2025-03-31 12:00:40 +02:00
307974f20d Data sources: Improve error messages for grpc errors (#102372)
* Data sources: Improve error messages for grpc errors

* Improve code comments

* Fix lint

* Update connection issue message

* Update name

* Update comment

* Update, rename and add test

* Update, remove POC change

* Fix lint
2025-03-20 18:44:47 +01:00
9eda0f44ac Update ErrRequestErrorBase from [plugin.downstreamError] to [plugin.requestFailureError] (#100965)
* Update ErrRequestErrorBase to make it more clear for developers

* Trigger build

* requestError -> requestFailureError

* Fix test

* Update pkg/plugins/backendplugin/grpcplugin/client_v2.go

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>

---------

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2025-02-20 10:23:53 +01:00
99d8025829 Chore: Move identity and errutil to apimachinery module (#89116) 2024-06-13 07:11:35 +03:00
f5076d1868 Plugins: Add status_source label to plugin request metrics (#76236)
* Plugins: Chore: Renamed instrumentation middleware to metrics middleware

* Removed repeated logger attributes in middleware and contextual logger

* renamed loggerParams to logParams

* PR review suggestion

* Add pluginsInstrumentationStatusSource feature toggle

* Plugin error source prometheus metrics

* Add error_source to logs

* re-generate feature toggles

* fix compilation issues

* remove unwanted changes

* Removed logger middleware changes, implement error source using context

* Renamed pluginmeta to pluginrequestmeta, changed some method names

* Fix comment

* pluginrequestmeta.go -> plugin_request_meta.go

* Replaced plugin request meta with status source

* Add tests for pluginrequestmeta status source

* Fix potential nil pointer dereference in instrmentation middleware

* Add metrics middleware tests

* Sort imports in clienttest.go

* Add StatusSourceFromContext test

* Add error_source label to plugin_request_duration_seconds

* Re-generate feature flags

* lint

* Use StatusSourcePlugin by default

* re-generate feature flags
2023-10-17 10:27:45 +02:00
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
af8a46adbb Bug Fix: Restore health check error (#75508) 2023-09-27 10:44:43 +03:00
1714fa598c Chore: Refactor backend plugin errors (#74928) 2023-09-25 11:56:03 +02:00
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
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
29327cbba2 Plugins: Use error plane for api/ds/query (#54750)
* plugin client returns error base

* fix api test

* add plugin client test

* add fallback err

* fix linting

* wip

* replace bad query

* template is an error

* failing test of templated error

* add one test passing

* fix failing test

* move test

* rename ErrBadQuery to ErrQueryValidationFailure

* tidy diff

* Change to one error per specific error kind

* last err + fix test

* fix imports

* more tests

* keep req vars together

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2022-09-14 18:19:57 +02:00