Compare commits

...

910 Commits

Author SHA1 Message Date
Jack Westbrook
a19b14a54a chore(yarn): dedupe lock file 2025-02-18 10:17:58 +01:00
Jack Westbrook
48793907a0 refactor(plugin-configs): use the amd option rather than hacking per node_module for amd deps 2025-02-18 10:17:34 +01:00
Jack Westbrook
c611c0bbd4 build(plugins-config): hacky attempt to work around define.amd umd modules breaking runtime 2025-02-18 10:17:34 +01:00
Jack Westbrook
1a492a0eb8 chore(decoupled-plugins): bump rspack to latest 2025-02-18 10:17:33 +01:00
Jack Westbrook
8df4243a8c chore(e2e-plugins): fix stray rspack/cli version 2025-02-18 10:17:19 +01:00
Jack Westbrook
156e160cfa chore(decoupled-plugins): bump rspack to 1.2.0-beta.0 2025-02-18 10:17:19 +01:00
Jack Westbrook
8d03ea95af chore(decoupled-plugins): update rspack to 1.1.5 2025-02-18 10:17:17 +01:00
Jack Westbrook
5174fd803e Wip 2025-02-18 10:16:58 +01:00
Jack Westbrook
79f13e6280 chore(azuremonitor): fix broken dev script 2025-02-18 10:16:58 +01:00
Jack Westbrook
7166eb8fc4 feat(e2e-test-plugins): migrate plugins to use rspack 2025-02-18 10:16:58 +01:00
Jack Westbrook
b9392dd8a9 build(plugin-configs): add imports-loader to dependencies and require.resolve it 2025-02-18 10:16:57 +01:00
Jack Westbrook
3dfd0b923c chore(mysql): remove redundant rspack dep 2025-02-18 10:16:57 +01:00
Jack Westbrook
3b850fa1df feat(zipkin): migrate to rspack 2025-02-18 10:16:57 +01:00
Jack Westbrook
ed879eef40 feat(tempo): migrate to rspack 2025-02-18 10:16:57 +01:00
Jack Westbrook
eafb09b302 feat(parca): migrate to rspack 2025-02-18 10:16:56 +01:00
Jack Westbrook
e955b3c864 feat(mssql): migrate to rspack 2025-02-18 10:16:56 +01:00
Jack Westbrook
ecaba8b054 feat(jaeger): migrate to rspack 2025-02-18 10:16:56 +01:00
Jack Westbrook
e764556aba feat(testdata): migrate to rspack 2025-02-18 10:16:56 +01:00
Jack Westbrook
6c31fe645c feat(pyroscope): migrate to rspack 2025-02-18 10:16:55 +01:00
Jack Westbrook
0402709e68 feat(postgresql): migrate to rspack 2025-02-18 10:16:55 +01:00
Jack Westbrook
a301c22e2b feat(cloud-monitoring): migrate to rspack 2025-02-18 10:16:55 +01:00
Jack Westbrook
f90c4b9cad feat(azuremonitor): migrate to rspack 2025-02-18 10:16:55 +01:00
Jack Westbrook
f7d1a86122 feat(plugin-configs): put back commit hash to versioning 2025-02-18 10:16:55 +01:00
Jack Westbrook
bbda8c6b6b feat(mssql-datasource): move to use rspack 2025-02-18 10:16:52 +01:00
Jack Westbrook
32af00eff9 feat(plugin-configs): replace webpack with rspack 2025-02-18 10:16:28 +01:00
Karl Persson
4df398c084 Authz: Sync authlib and update authz client setup code (#100817)
* Sync authlib and update setup code for authz client
2025-02-18 09:09:20 +01:00
grafana-pr-automation[bot]
61d959d04b I18n: Download translations from Crowdin (#100850)
New Crowdin translations by GitHub Action

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-18 02:32:09 +02:00
Matheus Macabu
aceda85a4d Chore: Regenerate go.work.sum (#100816) 2025-02-17 22:44:02 +02:00
Ezequiel Victorero
9df6412e92 Reporting: Add new creation drawer feature flag (#100759)
Reporting: Add new creation drawer
2025-02-17 16:05:46 -03:00
Mat Ryer
ff7ba54cbc Investigations: Add experimental app platform backend (#100584)
* add investigations group?

* Investigations: Add experimental app platform backend

* change `grafana-app-sdk/logging` version

* investigations: add feature flag to test

---------

Co-authored-by: Sven Grossmann <svennergr@gmail.com>
2025-02-17 19:19:22 +01:00
Andrej Ocenas
78ef9fd9d9 QueryLibrary: rename API from peakq to querylibrary (#100813) 2025-02-17 17:49:11 +01:00
Ashley Harrison
7a6f4ced06 Themes: Temporary fix for initialising saved grafanacon themes (#100810)
temporary fix for initialising saved grafanacon themes
2025-02-17 16:39:04 +00:00
Sonia Aguilar
3bb3a74ac1 Alerting: Add tracking for the mode used in query and notifications step when c… (#100824)
Add tracking for the mode used in query and notifications step when creating a grafana rule
2025-02-17 18:09:02 +02:00
Robert Goltz
27837ee937 Chore: Update alpine docker image (minor) - 3.20.5 to 3.20.6 [security] (#100791)
* Chore: Update alpine docker image (minor) - 3.20.5 to 3.20.6 [sec-fixes]

* Chore: Regenerate .drone.yml

---------

Co-authored-by: Matheus Macabu <macabu.matheus@gmail.com>
2025-02-17 16:41:38 +01:00
Sonia Aguilar
67722de343 Alerting: Add DAG errors to alert rule creation and view (#99423)
* catch error in query tab when running query throws an error

* add translations

* fix translations

* update query runner to omit nodes that failed to link

* remove unused function

* add DAG errors to AlertingQueryRunner

* bump CI

* fix test

* update test

* fix i18n

* revert code pieve

* Bring the piece of code back 😁

* bail from runner when no queries are to be executed

* add tests and translations

* refactor prepareQueries to omit broken refs and exclude descendant nodes

* update code comments

* fix omitting descendant nodes

* add all broken or missing nodes to panel errors

* go go drone

* remove unused function

* fix prettier and translations

* add export

---------

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2025-02-17 16:11:52 +01:00
Hugo Kiyodi Oshiro
29afe7d2cc Plugins: Remove managedPluginsInstall feature toggle (#100416)
* Plugins: Remove managedPluginsInstall feature toggle

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2025-02-17 16:07:41 +01:00
Marcus Andersson
39b424b8a7 PluginExtensions: Making it possible to set secureJsonData on datasource config page. (#100726)
* Added setSecureJsonData to the configure context.

* Exposing which fields are set in secureJsonData.

* removed omit.
2025-02-17 15:20:35 +01:00
Ashley Harrison
60fa83ea53 Theme: ensure feedback link is gated behind config option (#100815)
ensure feedback link is behind config option
2025-02-17 16:15:03 +02:00
Marcus Andersson
84d22e176b PluginExtensions: Exposing registry meta for components returned via usePluginComponents (#100587)
Exposing meta information from registry via Component.meta.
2025-02-17 14:50:35 +01:00
renovate[bot]
187a18ea25 Update dependency i18next-parser to v9.3.0 (#100800)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-17 13:50:19 +00:00
Bogdan Matei
d4fdffc387 Explore: Fix key error (#100812) 2025-02-17 15:37:55 +02:00
Karl Persson
e9b2f69137 Authz: Only have two modes for authz client (#100803)
* Only have "inproc" and "clod" mode
2025-02-17 14:37:25 +01:00
Roberto Jiménez Sánchez
8edfff1bba [Enterprise] Consolidate extensions folders and keep them around (#98486)
* WIP: copy approach

* Fix package name

* Do not ignore .keep for frontend extensions

* Add keep file for frontend extensions

* Tweak makefile to generate enterprise swagger or not

* Remove duplicate imports

* Add build extensions

* Add CMD extensions

* Add keep to e2e extensions

* Add .keep

* Reduce file structure changes

* Ignore boring crypto

* Add e2e extensions keep file

* Remove enterprise file

* Update .gitignore

* Move things around

* Update git ignore

* Consolidate backend extensions folder

* Move enterprise deps

* Update comment

* Do not use build tags

* Ignore setting enterprise

* Revert changes in makefile

* Revert package changes

* Add back extensions main.go

* Update git ignore

* Ignore spanner tests

* Trick ignore files only by git

* Add .ignore file to CODEOWNERS for frontend-ops

* Fix issue with noisy duplicate targets
2025-02-17 14:00:21 +01:00
Sonia Aguilar
2014d27def Alerting: Add alert rule version history - part1 (#99490)
* Add alertingRuleVersionHistory feature toggle

* WIP: Add version history tab

* revert temp change in index.ts

* wip2

* --wip--

* sync code with the BE changes in the endpoint

* add translations

* Add translations

* use ff only for restore feature

* WIP: Add tracking, make version required, and start mapping dif results
Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>

* Tweak more translations and improve types

* Add button to show/hide JSON diff

* update type for top level rule fields

* Create types

* Make updated_by/version properties optional

* Update mocks to remove updated by and version

* add comments to restore code

* rename fetature flag, as we use this one only for the restore feature

* Update version history to handle special cases

* Add diff numbers

* Fix conflicts

* Move generic computeVersionDiff to a utils file

* Update DOM structure of version summary and tidy up types

* Add tests for version comparison logic

* Lint fix utils file

* Rename props and add docs

* Change to EmptyState and log when no versions

* Remove CreatedBy component and simplify

* Add missing i18n for version history

* add test for computeVersionDiff

* update test

* fix number diff order and add a test

* fix prettier

* fix prettier

* Add promise resolve back in

* Rename to humanReadableDiff and tweak translation

* Show tab for recording rules as well

* Split components out to separate files

* Add optional interval seconds

* Update i18n

* Remove commented code

* Remove value

* Remove unneeded version

* Consistent rendering of updated by

* Mode parseVersionInfo to a separate pure function

* update invalidate/provide tags for getAlertVersionHistory

* Use checkedVersions state only in the parent component

* update getSpecialUidMap name and create an interface

* Fix prettier

* update tab description

* use set instead of map for checkedVersions

---------

Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
2025-02-17 13:25:32 +01:00
Dominik Prokop
c9250c9135 Transformation: Add support for variables to ALL transformations (#100225)
* Transformation: generic support for variables, yay

* clean up value matcher editors

* clean

* clean up filterByValue

* more

* clean

* clean

* more!

* lint

* Revert "Transformation: generic support for variables, yay"

This reverts commit deec7c306b.

* Bump scenes to canary

* filterByValue - remove irrelevant tests

* filterByName tests update

* calculateField test update

* nit

* is that gonna work?

* Update grafana-data tscnig config to use grafana-ui's react table types

---------

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
Co-authored-by: oscarkilhed <oscar.kilhed@grafana.com>
2025-02-17 13:07:11 +01:00
Tobias Skarhed
f15c961a90 MultiCombobox: Add basic docs and make story public (#100806)
* MutliCombobox: Add basic docs and make story public

* Apply suggestions from code review

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>

---------

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
2025-02-17 13:52:11 +02:00
Oscar Kilhed
855eadcabd Dashboards: Tabs layout persistence (#100485)
* Tabs layout persistence

* fix lint issue

* Add tests, add tabs serializer to registry

* Fix deserialize tabs

* more tests

* tab item title optional

* change TabItemKind -> TabLayoutTabKind

* add tests for tabs serializer

* fix name in test

* Fix test after renaming tabs
2025-02-17 12:50:26 +01:00
Jack Westbrook
497491846e Grafana Prometheus: Clean up package dependencies (#97398)
* chore(grafana-prometheus): use knip to clean up deps and dev deps

* update

---------

Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
2025-02-17 12:48:17 +01:00
Mariell Hoversholm
f535a7804f Provisioning: Update types (#100722)
* Provisioning: Remove S3

* Provisioning: Use URL for GitHub

Co-Authored-By: Ryan McKinley <ryantxu@gmail.com>
Co-Authored-By: Alex Khomenko <Clarity-89@users.noreply.github.com>

* Provisioning: Use workflow list

Co-Authored-By: =?UTF-8?q?Roberto=20Jim=C3=A9nez=20S=C3=A1nchez?= <roberto.jimenez@grafana.com>

* Provisioning: Model secrets

* Provisioning: Define a total in the job summary

* Provisioning: Generate code

* Provisioning: Update testdata

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
Co-authored-by: =?UTF-8?q?Roberto=20Jim=C3=A9nez=20S=C3=A1nchez?= <roberto.jimenez@grafana.com>
2025-02-17 12:45:23 +01:00
Ashley Harrison
a05ba6ff41 Theme: minor tweaks (#100751)
* theme tweaks!

* remove commented code
2025-02-17 11:37:03 +00:00
Karl Persson
6eeb28e312 Authn: use authenticator for grpc (#99573)
* Remove usage of grpc-authenticator

* Cleanup client construction code
2025-02-17 10:58:59 +01:00
Charandas
ea788975e0 K8s: refactor build handler chain func to allow easier injection from enterprise (#100777) 2025-02-15 04:08:00 +02:00
grafana-pr-automation[bot]
e5b49a406f I18n: Download translations from Crowdin (#100774)
New Crowdin translations by GitHub Action

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-15 02:36:23 +02:00
Staton Hysell
89e85c1592 Added width style to the action button (#100768)
* Added width style to the action button

* Fix typo
2025-02-14 18:09:18 -05:00
Stephanie Hingtgen
9494e6eb37 K8s: Search fallback: Support tag search (#100767) 2025-02-14 16:57:10 -05:00
Stephanie Hingtgen
b89fd287c7 K8s: Dashboards: Fix history list (#100763) 2025-02-14 22:12:18 +02:00
Will Assis
77fd572973 dont return not found error in mode 2 (#100758)
* dual writer: dont return not found error in mode 2 when failing to find object in unistore
2025-02-14 20:39:51 +02:00
Kevin Minehart
cd30f3839d Update whatsnewURL in package.json (#100753) 2025-02-14 19:45:49 +02:00
Todd Treece
30ae434a2e K8s: Support multiple versions in builder (#100331) 2025-02-14 12:29:43 -05:00
Ashley Harrison
39db59fc73 Chore: remove the queryLibraryDashboards toggle since we didn't end up using it (#100749)
remove the queryLibraryDashboards toggle since we didn't end up using it
2025-02-14 16:39:22 +00:00
Josh Hunt
589340e03c GrafanaUI: Deprecate Select in favor of Combobox (#100294)
* GrafanaUI: Deprecate Select

* add deprecated decorator to stories

* tweak message
2025-02-14 16:07:26 +00:00
Mihai Doarna
dc5602bad9 SSO: Fix team_ids validation for Generic OAuth (#100732)
fix team_ids validation in the API
2025-02-14 17:57:28 +02:00
Alexander Akhmetov
cbae35c28b Alerting: Delete protobuf alert rule state on alert rule deletion (#100736) 2025-02-14 16:56:14 +01:00
Tito Lins
e343cb5ac9 Alerting: Stop running AM integration tests on CI (#100702) 2025-02-14 16:55:20 +01:00
Bogdan Matei
6bd1041cda Dashboard: Fix panel edits for repeats (#100658) 2025-02-14 17:42:10 +02:00
Peter Štibraný
d0394bfa7e Extract NewSearchOptions from unified sql client setup. (#100719)
* Extract NewSearchOptions from unified sql client setup.

Co-authored-by: Georges Chaudy <chaudyg@gmail.com>
2025-02-14 16:39:48 +01:00
Josh Hunt
861686adaa Combobox: Tighten up storybook documentation (#100313)
* Add JSDoc comments to more props

* Remove in-dev decorator

* reword MDX documentation and add migration guide
2025-02-14 17:34:44 +02:00
Agnès Toulet
37ee1c427d Plugins: Upgrade grafana-plugin-sdk to 0.266.0 (#100727) 2025-02-14 16:33:45 +01:00
Jean-Philippe Quéméner
c522a5b13b fix(unified-storage): proper setup TLS in new db_engine for MySQL (#100686) 2025-02-14 16:23:25 +01:00
Kyle Brandt
4d7b9a3c77 SQL Expressions: Improve response to frame conversion handling (#100625)
- use types.Convert to get a more normalized type returned from GMS. After syncing with GMS maintainers, the underlying type of the row could be different things (e.g. int when unit32, so this calls the Convert method from the GMS types library to normalize the interface.
- Clean up fieldValFromRow more
- Use IsText to capture different string types
- Add more types to test, also update test to use same cmp.Diff method as others

---------

Co-authored-by: Sam Jewell <2903904+samjewell@users.noreply.github.com>
2025-02-14 17:21:08 +02:00
Kevin Minehart
3a8a24e662 Docker: Missing libresolv.so.2 from glibc (#100729)
* Docker: Missing libresolv.so.2 from glibc

* Misplaced &&
2025-02-14 08:54:36 -06:00
Ashley Harrison
b9034f413e Query library: Refactor to use onSelectQuery callback (#100360)
* starting to refactor query library to use callback

* replace QueryActionButton with onSelectQuery

* hook up properly in explore

* fix unit tests

* i18n

* extract types

* fix refId in explore

* fix unit tests

* handle changing datasource to mixed

* enrich queries with datasource

* move out into separate function

* filter out expression datasources
2025-02-14 14:44:47 +00:00
Carl Bergquist
9cff383830 scopenodes: check if the query exists in the title instead of starts with the query (#100578)
scopenodes: check if the string contains the search param instead of limiting to prefix

Signed-off-by: bergquist <carl.bergquist@gmail.com>
2025-02-14 09:21:35 -05:00
Carl Bergquist
23a657a72d scopes: adds more logging details to the scopedashboard query (#100267)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2025-02-14 09:20:07 -05:00
Kyle Brandt
c291ec7ba9 SQL Expressions: Include SQL Parser/Syntax error in the public message (#100725)
fixes #100721
2025-02-14 09:09:21 -05:00
beejeebus
196a73ec72 influxdb - fix nil pointer usage - fixes #100723 (#100724)
When introducing errorsource over in:

https://github.com/grafana/grafana/pull/99900

I introduced a bug - trying to use a http response with a non-nil error.
In that case, the response is nil, so code panics.

This PR removes that check.
2025-02-14 08:25:26 -05:00
Sonia Aguilar
af8cab9210 Alerting: Add Jira integration to cloud AMs (#100482)
* Add Jira integration to cloud AMs

* Add alertingJiraIntegration feature toggle for jira integration

* Update integration name to Jira Service Management

* address pr comments

* gen ff

* add project to the getReceiverDescription for jira

* Update getReceiverDescription for jira

* update text

* update texts and add required option

* Add conversion for fields jira integration to JSON format in the dto and viceversa

* add tests

* Add translation for jira receiver summary

* Add placeholder for Jira duration option

* move logic cheking integrtion type outside the conversion method

---------

Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
2025-02-14 13:22:04 +01:00
Gilles De Mey
101c590f34 Revert "Alerting: Fix loading states" (#100717)
Revert "Alerting: Fix loading states (#100641)"

This reverts commit ba3a90d8fd.
2025-02-14 13:04:19 +01:00
Matias Chomicki
b814f1628f New Logs Panel: Add infinite scrolling support (#99773)
* Create Infinite Scroll wrapper component

* Logs list: refactor event subscriber

* Infinitely load logs

* Move renderer to Infinite Scroll component

* Implement infinite scroll state

* Switch internal implementation to use the existing infinite scrolling component logic

* Integrate with logs panel

* Move scrolling management to infinite scrolling component

* LogList: change subscription dependency to prevent unnecessary runs

* Infinite scroll: remove autoscrolling

* Logs Panel: fix dependencies to prevent re-renders on refresh

* Infinite scroll: introduce pre-scroll state

* LogList: expose initial log position prop

* Infinite scroll: less work on scroll and autoscroll behavior

* Remove console

* Fix imports

* Add infinite scroll translations

* Fix imports

* Add visual delimiter for new pages and increase gap

* Remove log

* Chore: rename interface to LogListModel

* Hover: decrease opacity

* Fix no-logs state

* Prettier

* Infinite scroll: move scroll delimiter

* Load more message: make it clickable
2025-02-14 13:52:34 +02:00
Sonia Aguilar
9e3872f8dd Alerting: Disable create rule menu item from panel when unifiedAlerting is disabled (#100701)
* add config.unifiedAlertingEnabled check to render create alerts menu item from panels

* Disable create rule from panel when unifiedAlerting is disabled

* fix test and lint

* fix test
2025-02-14 13:38:32 +02:00
Peter Štibraný
1856d47e47 Remove GetResourceClient hack from unified package. (#100636)
* Remove GetResourceClient hack from unified package.
2025-02-14 12:34:52 +01:00
Andrej Ocenas
d092998927 Query Library: Move backend to enterprise (#100371)
* Move files to enterprise

* Remove last parts of QL api

* Fix CODEOWNERS
2025-02-14 11:05:03 +00:00
Gilles De Mey
ba3a90d8fd Alerting: Fix loading states (#100641) 2025-02-14 11:38:38 +01:00
Georges Chaudy
9d68c4f665 unified: allow customising the ProvideUnifiedStorageClient (#100704)
* unified: allow customising the ProvideUnifiedStorageClient

* fix go mod
2025-02-14 11:26:51 +01:00
github-actions[bot]
cf2a7687e0 Update make docs procedure (#100167)
Co-authored-by: grafanabot <bot@grafana.com>
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
2025-02-14 10:26:29 +00:00
Georges Chaudy
b1222be02e unistore: add small buffer of watched events (#100431)
* change log level

* Add a small buffer when watching events
2025-02-14 12:18:59 +02:00
Pepe Cano
f1b4678012 Alerting docs: update Configure Webhook notifications (#100650)
* Alerting docs: update `Configure Webhook notifications`

* fix typo

* fix typo

* Update docs/sources/alerting/configure-notifications/manage-contact-points/integrations/webhook-notifier.md

Co-authored-by: Matthew Jacobson <matthew.jacobson@grafana.com>

* Update docs/sources/alerting/configure-notifications/manage-contact-points/integrations/webhook-notifier.md

Co-authored-by: Matthew Jacobson <matthew.jacobson@grafana.com>

* fix typo

* Add `Note` to  configure either HTTP Basic Authentication or the Authorization request header

* Use `inline` format for JSON keys

---------

Co-authored-by: Matthew Jacobson <matthew.jacobson@grafana.com>
2025-02-14 11:04:08 +01:00
Alex Khomenko
da66060f75 Grafana/ui: Export UsersIndicator (#100698)
grafana-ui: Export UsersIndicator
2025-02-14 11:58:42 +02:00
Alex Khomenko
dc3de1a1d5 Badge: Add darkgrey color (#100699) 2025-02-14 11:57:30 +02:00
Karl Persson
d8b26b0a31 Search: Search dashboards without a parent (#100615)
* Search dashboards without a parent
2025-02-14 10:39:57 +01:00
Andres Martinez Gotor
12bb50f97f Advisor: Make evaluation interval and max history configurable (#100534) 2025-02-14 10:05:34 +01:00
grafana-pr-automation[bot]
7f20495289 I18n: Download translations from Crowdin (#100689)
New Crowdin translations by GitHub Action

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-14 02:30:34 +02:00
Stephanie Hingtgen
1c2f4e35bf Frontend tests: comment out flaky test (#100685) 2025-02-14 00:44:15 +02:00
Will Assis
c963032915 search: handle "sharedwithme" use-case in both legacy/US modes (#100286)
* handle "sharedwithme" use-case in both legacy/US modes

* display "Shared with me" as location in dashboard list

* fix missing "TotalHits" prop in mode 2
2025-02-13 15:56:29 -05:00
Stephanie Hingtgen
e2081c3e0c K8s: Fix legacy fallback provisioning (#100566) 2025-02-13 21:32:25 +02:00
Brendan O'Handley
3b694785f3 Explore metrics: Use combobox for adhoc filters (#100151)
use combobox for adhoc filters
2025-02-13 12:58:29 -06:00
Brendan O'Handley
964f3d0cad Explore metrics: Remove operators =| and !=| from adhoc filters (#100300)
Remove operators =| and !=| from adhoc filters
2025-02-13 12:58:07 -06:00
Ariana
d81c4b3c42 Docs: Updating SAML UI Docs for Azure specific attributes (#100565)
* Updating SAML for Azure specific attribute structures

Adding additional context surrounding SAML via Azure where the full attribute URL needs to be specified or it will not map correctly. 

This generates a lot of support contacts and isn't documented causing friction when organizations can't set it up themselves or lack the technical staff to self manage.

* run prettier

---------

Co-authored-by: Irene Rodriguez <irene.rodriguez@grafana.com>
2025-02-13 19:46:38 +01:00
Kim Nylander
ac412e6859 [DOC] Update links, page weights for mounting content in Tempo data source (#100395)
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
2025-02-13 13:42:43 -05:00
Isabel Matwawana
4e976fc277 Docs: One-click data links for some visualizations (#100434) 2025-02-13 12:52:47 -05:00
Isabel Matwawana
75320990db Docs: Canvas one-click data links & actions (#100453)
Co-authored-by: Adela Almasan <88068998+adela-almasan@users.noreply.github.com>
2025-02-13 12:46:46 -05:00
Adela Almasan
5aeaa18ac2 Canvas: One click links and actions (#99616)
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2025-02-13 11:46:29 -06:00
Ashley Harrison
02118cc6aa Chore: Automerge i18n PRs (#99555)
* add enable automerge step and update CODEOWNERS

* add approver steps

* move automerge step to pr approver token

* get vault secrets

* update workflow permissions

* remove local
2025-02-13 17:44:13 +00:00
xavi
eeadb7e771 IAM: Log error when malformed json arrays are found in SSO configs (#99896) 2025-02-13 18:02:54 +01:00
linoman
19777ba3e9 Skip flaky test that's breaking the CI pipelines (#100640) 2025-02-13 17:49:21 +01:00
Bogdan Matei
5315b4fd2d Dashboard: Fix repeats behavior for inspect, solo panel and repeated and empty panels (#100605) 2025-02-13 18:41:09 +02:00
Georges Chaudy
b58b5b5768 grpc: improve grpc logger (#100606)
use proper grpc logging
2025-02-13 17:39:33 +01:00
Josh Hunt
2bdeb727cf Chore: Bump react-router to v5.3.4 (#100500) 2025-02-13 18:36:16 +02:00
Will Assis
155492c8a5 search: handle "permission" query param in search (#100607)
handle "permission" query param in search
2025-02-13 11:35:53 -05:00
Johnny Kartheiser
6e4c1a57c1 docs: capitalization issues (#100562)
fixing two capitalization issues for product names.
2025-02-13 10:29:04 -06:00
Gabriel MABILLE
90eb499b78 PublicDashboards: Fetch dashboard as Grafana (#100344) 2025-02-13 17:17:14 +01:00
Alexander Zobnin
d719e6c621 ServiceAccounts: Fix search in SA picker (#100634) 2025-02-13 17:02:51 +01:00
Ryan McKinley
0dab384826 K8s/Frontend: Update watch support (#100631)
use watch from gitsync
2025-02-13 18:55:36 +03:00
Hugo Kiyodi Oshiro
aeb57f671b Docs: Improve instructions to change basic roles (#100586) 2025-02-13 16:53:03 +01:00
Irene Rodríguez
30939fd0e9 Update relrefs (#100626) 2025-02-13 16:44:20 +01:00
Oscar Kilhed
1018aec6bc Dashboards: Fix repeats not being added on refresh when using searchLayout (#100621)
Fix repeats not being added
2025-02-13 16:31:11 +01:00
Todd Treece
5a74a1a0f6 Metrics: Use correct gatherer in graphite bridge (#100624) 2025-02-13 10:19:22 -05:00
Ivan Ortega Alba
527fc3bb21 Dashboards: Remove schemaVersion < min_version validation (#100555) 2025-02-13 06:56:16 -08:00
Dominik Prokop
7edcde6365 Dashboards: Bring back scripted dashboards (#100575)
* Dashboards: Bring back scripted dashboards

* Fix scripted dashboard examples

* Fix dashboard-solo page not respecnig scripted dashboards
2025-02-13 15:46:22 +01:00
Yuri Tseretyan
9dd75aee32 Alerting: Refactor State Transition (part 2 of n) (#99985)
* split create to create and patch and move to state

patch will be refactored further

* move setNextState to state transition

* move tests

* split tests for patch function
2025-02-13 09:45:16 -05:00
Victor Cinaglia
71f97f380d Docs: Fix URLs to auth providers from Team Sync page (#100563)
* iam/docs: fix links to providers in team sync page

* iam/docs: make auth proxy link look more like other links
2025-02-13 09:35:35 -05:00
Haris Rozajac
9ad6653871 Dashboard Schema V2: Improve diffing (#100022)
* improve diffing

* define dash spec props a-z

* Fix

* sort deep initialSaveModel

* update tests

* Fix test, description, and query ds issues

* Fix seralizer test

* response transformers

* skip panelMerge tests
2025-02-13 07:20:17 -07:00
Tobias Skarhed
afe8b08a48 MultiCombobox: Fix labels disappearing on selected items when filtering (#100602)
* Fix label disappearing on filtering

* Remove only from test

* Fix custom value test
2025-02-13 16:03:54 +02:00
Karl Persson
a58564a35e Unified Storage: Register metrics (#100600)
use seperate once struct
2025-02-13 14:24:59 +01:00
Karl Persson
be60ef0500 IDToken: cache invalidation (#100592)
* Make org role part of id token cache key. This way we will always sign a new token when it changes

* Remove calls to remove id token
2025-02-13 14:10:58 +01:00
Ivana Huckova
a69fac6e16 Mark grpc data source timeouts as cancelled queries (#100573)
* Set up to reproduce issue locally

* add check for deadline exceeded

* Revert "Set up to reproduce issue locally"

This reverts commit d8d9b354ca.

* Trigger build

---------

Co-authored-by: Will Browne <will.browne@grafana.com>
2025-02-13 13:40:53 +01:00
Jack Westbrook
1c7a758127 Frontend: Lazy load Echo Backends (#100345)
feat(app): lazy load echo backends depending on config. Move lodash to sharedDependencies
2025-02-13 12:11:41 +01:00
Ryan McKinley
3c56e32b0c K8s/Utils: Find title in unstructured content (#100576) 2025-02-13 14:04:03 +03:00
Karl Persson
1b1954de28 Authz: add support to use folder api to fetch folder tree (#100038)
* Add FolderStore interface

* Authz: add implementation to use folders api and use it inproc with loopback config

* Add tracing and add rest.Config for talking with folder api using access tokens

* Restructure test to get rid of circular dependencies in tests

* use correct group version kind

---------

Co-authored-by: gamab <gabriel.mabille@grafana.com>
2025-02-13 11:59:59 +01:00
Tito Lins
ae9837b793 Alerting: Add alertmanager integration tests (#100106) 2025-02-13 11:36:45 +01:00
Yulia Shanyrova
6db155649c Plugins: Custom links for plugin details page (#97186)
* Custom links with repository link, licence link, docs link and raise an issue link

* run translation command

* delete console log

* delete console log

* fix frontend tests

* change UI with a new design

* remove license, documentation, repository url calculation logic from grafana

* remove unsused function from helpers

* change repo icons and raise an issue icon

* fix the build

* remove logic for raiseAnIssueUrl

* fix the build

* fix lint

* Delete Links title in the box of links

---------

Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com>
2025-02-13 11:31:57 +01:00
Karl Persson
0b4c622df8 AuthN: Refetch user on "ErrUserAlreadyExists" (#100346)
* AuthN: Refetch user on "ErrUserAlreadyExists"
2025-02-13 11:27:57 +01:00
Hugo Kiyodi Oshiro
95ee93a0d8 Plugins: Improve plugin details UX for core plugins (#99830) 2025-02-13 11:07:24 +01:00
Bogdan Matei
293f514854 Dashboard: Fix removing row repeats having indexes ending with 0 (#100487) 2025-02-13 11:58:28 +02:00
Misi
5a6d2f2e49 Auth: Add early return if auth_token is in the URL for JWT auth (#100539)
* Add early return

* Update public/app/app.ts

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

---------

Co-authored-by: Victor Cinaglia <victor@grafana.com>
2025-02-13 10:46:19 +01:00
Dominik Süß
8a8e47fcea PluginExtensions: Added support for sharing functions (#98888)
* feat: add generic plugin extension functions

* updated betterer.

* Fixed type issues after sync with main.

* Remved extensions from datasource and panel.

* Added validation for extension function registry.

* Added tests and validation logic for function extensions registry.

* removed prop already existing on base.

* fixed lint error.

---------

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
2025-02-13 10:18:55 +01:00
Konrad Lalik
fbf96916aa Alerting: Use alerting-specific error boundary for page components (#99980)
Use alerting-specific error boundary for page components
2025-02-13 09:20:45 +01:00
Karl Persson
df64dd0762 LibraryElements: Propagate service identity in context when searching for dashboards (#100220)
* Propagate service identity in context when searching for dashboards
2025-02-13 09:17:16 +01:00
Mariell Hoversholm
2dee9ccbbc APIServer: Cancel forked context after handler returns (#100504)
We currently cancel the context when the adapter function is done. We should wait for the entire handler we're wrapping
to finish before cancelling our context.
2025-02-12 23:54:58 -08:00
Ivan Ortega Alba
2b2b19478a Dashboard V0->V1 Migration: Schema migration v41 (#100554) 2025-02-13 08:19:51 +01:00
Brendan O'Handley
0a88cb528a Explore metrics: Show the native histogram banner once (#99857)
* use local storage to show the native histogram banner has been loaded

* remove banner logic from datatrail

* set banner shown in local storage on closing the banner
2025-02-12 16:51:58 -06:00
owensmallwood
a34e7e176d Unified Storage: Sprinkles latency metric (#100542)
* add sprinkles latency metric

* fixes failing tests - forgot to register metric only once
2025-02-12 16:22:18 -06:00
Adela Almasan
3dcd885644 Data links: Show oneClick option just for specific panels (#100298)
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2025-02-12 16:14:52 -06:00
margotphelps
f9c329bbd1 Docs: updated supported versions with 11.5 (#100548)
Co-authored-by: Isabel Matwawana <isabel.matwawana@grafana.com>
2025-02-12 16:15:28 -05:00
Adela Almasan
62e06cfac8 Actions: Fix support in StateTimeline and XYChart (#100543)
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2025-02-12 21:53:32 +02:00
Sergej-Vlasov
d1dee968c3 Schema V2: Adjust quick_ranges in time settings and remove time_options (#100135)
* adjut quickRanges type in v2

* clean up unused time_options property

* remove deprecated time_options property on time picker

* add schema migration for time_options

* adjust test
2025-02-12 19:23:09 +00:00
Ivan Ortega Alba
e60e217a23 Dashboard V0->V1 Migration: Schema migration v37 (#99962) 2025-02-12 21:19:57 +02:00
Ivan Ortega Alba
950726a3c5 Dashboard V0->V1 Migration: Schema migration v38 (#99778) 2025-02-12 19:52:39 +01:00
Alexander Akhmetov
c556f20627 Alerting: Fix default max_attempts value in the docs (#100497) 2025-02-12 19:24:22 +01:00
Alexander Akhmetov
3cc4320aa9 Alerting: Add rule conversion package (#100224) 2025-02-12 19:38:48 +02:00
Stephanie Hingtgen
e2a101cde3 Dashboard history: Track version created timestamp in restore (#100451) 2025-02-12 11:19:55 -06:00
Tobias Skarhed
21861867c1 Combobox: Fix broken styles for options (#100536)
Add basicOption styles to Combobox
2025-02-12 18:51:39 +02:00
Nick Richmond
d3de9dbce6 ExploreMetrics: Fix escaping of regex metacharacters in label filters (#100513)
* fix: don't over-escape label values

* test: handling of regex metacharacters in filters
2025-02-12 11:29:47 -05:00
Torkel Ödegaard
cfc529cb03 Design/Theme: Change dropdown background in dark themes (#100415)
* Dropdowns: Change background for Selects/Comboboxs

* Update

* Update

* Review fixes

* Update
2025-02-12 17:22:56 +01:00
Jack Baldry
2b054d4154 Correct release branch trigger glob (#100496) 2025-02-12 16:11:12 +00:00
renovate[bot]
f6f50f7693 Update scenes to v6 (#100445)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-12 17:07:38 +01:00
Gilles De Mey
6e00954bb1 Devenv: Use newer label syntax (#100507) 2025-02-12 16:44:49 +01:00
Tom Ratcliffe
1f6142dd8f Chore: Remove betterer:merge and revert previous changes to betterer:stats (#98609) 2025-02-12 17:14:43 +02:00
Tom Ratcliffe
a1e59a92b0 Alerting: Allow collapsing of rule sections and fix Grafana configure link (#100290) 2025-02-12 17:12:11 +02:00
Josh Hunt
a9b4b1e5be Chore: pin tonistiigi/binfmt version (#100510)
* Chore: pin tonistiigi/binfmt version

* change version to qemu-v7.0.0-28

* uninstall first, log version

* uninstall first, log version

* uninstall first, log version
2025-02-12 08:37:04 -06:00
Pepe Cano
983829e47b Alerting docs: remove admonition about auto-generated policies (#100501) 2025-02-12 15:13:05 +01:00
Misi
ee0a1391df Auth: Add OrgRole to ID token (#100383)
* Changes for Users and ServiceAccounts

* Align tests
2025-02-12 05:51:29 -08:00
Solomon Himelbloom
a5c8b5ed83 docs: Copy code to clipboard (set-up-https.md) (#100509) 2025-02-12 14:42:12 +01:00
Nick Richmond
91242340c1 Prometheus: Fix operator handling when making label expressions utf-8 friendly (#100475)
* fix: operator handling

* refactor: stay dry
2025-02-12 07:09:22 -05:00
antonio
2f329c211d docs>tutorials>minor-update (#100488)
* docs>tutorials>minor-update

* link to part 5 from part 4

* all pretty, no pity
2025-02-12 12:01:15 +01:00
Adela Almasan
33b48f7c6e PanelPlugin: Allow inverting hideFromDefaults (#100473) 2025-02-12 04:46:00 -06:00
Laura Fernández
b44b82606a MultiCombobox: Add grouping (#100297) 2025-02-12 11:19:28 +01:00
Pepe Cano
8e436fc473 Alerting docs: Add Enable notifications section to Configure contact points docs (#100446)
Alerting docs: Add `Enable notifications` section to `Configure contact points` page
2025-02-12 11:18:31 +01:00
Pepe Cano
2b4e1f3c51 Alerting docs: clarify that silences and mute timings do not interrupt alert evaluation (#100414)
* Alerting docs: clarify that `silences` and `mute timings` do not interrupt alert evaluation

* replace `ad-hoc` word
2025-02-12 11:12:40 +01:00
Pepe Cano
99c8d4b0c6 Update Intro > Queries and Conditions (#95109)
* Update `Intro > Queries and Conditions`

* Small tweaks (advanced options) and screenshots

* Change `Expressions` heading

* Set links from Alert rules introduction

* Minor intro changes

* small change due to recent updates

* fix vale errors

* fix vale error

* Remove unnecessary mention to `alertingQueryAndExpressionsStepMode` feature flag
2025-02-12 10:42:53 +01:00
Edvard Falkskär
eb4c428d4e NodeGraph: Improve view traces for uninstrumented services (#98442)
* NodeGraph: Improve view traces for uninstrumented services

* Switch to onBuildUrl and more peer attributes

* Update unit tests

* Added test for new logic

* Open traces in same tab

* Update the tests

* bring back internal link

* Update public/app/plugins/datasource/tempo/datasource.ts

Co-authored-by: Joey <90795735+joey-grafana@users.noreply.github.com>

* Revert export of generateInternalHref

* Update tests after change from onBuildUrl to query function

---------

Co-authored-by: Domas Lapinskas <domasx2@gmail.com>
Co-authored-by: Joey <90795735+joey-grafana@users.noreply.github.com>
2025-02-12 11:28:44 +02:00
Mariell Hoversholm
a0701a42f1 APIServer: Propagate a new context with limited information (#100374)
* APIServer: Propagate a new context with limited information

* APIServer: Remove error return

* APIServer: Test that context propagation does fork

* APIServer: Fix golangci-lint lints

* chore: make update-workspace
2025-02-12 10:11:52 +01:00
Jean-Philippe Quéméner
aca024bcbb fix(unified-storage): use dedicated mocks per storage type (#100389) 2025-02-12 09:59:21 +01:00
Alexander Akhmetov
9593e51da7 Alerting: conversion API structure (#100258) 2025-02-12 08:13:21 +01:00
jackyin
9b37e9249a Dashboard: Folder move unexpected behavior (#100394)
* Dashboard: Folder move unexpected behavior

* format
2025-02-12 08:16:01 +02:00
Sven Grossmann
d199c33d7e Log Context: Fix bug where variables are not replaced in dashboards (#100433)
* Log Context: Fix bug where variables are not replaced in dashboards

* add objects to act as `row` and `options`

* run prettier

* fix lint
2025-02-11 20:25:52 +01:00
Stephanie Hingtgen
df84d928e2 K8s: Folders: Fix legacy search (#100393) 2025-02-11 13:14:25 -06:00
Staton Hysell
ab74852fc9 PanelEdit: Align chevron direction (#100386)
Adjusted the collapsable section chevron
+ point down when closed
+ point up when expanded
2025-02-11 13:16:19 -05:00
Charandas
ccb442558f chore: fix dockerfile for local development (#99721) 2025-02-11 10:00:15 -08:00
Ryan McKinley
a5355fd66c Storage: Add command line tool to migrate legacy dashboards (and folders) to unified storage (#99199) 2025-02-11 19:57:46 +02:00
Jacob Valdez
b6ea06f259 Docs: Updating manual installation instructions (#98834)
* Docs: adding additional installation steps to Grafana on openSUSE docs

* Docs: Adding systemd service info for grafana manual install

* Finalizing first edit with tested steps

* spacing adjustment and adding steps to RHEL/Fedora

* Adding a note based on Marins feedback

* A slight adjustment based on feedback from Marin and adding steps to Debian installation

* adjusting some wording

* adjusting naming conventions for Debian instructions

* changing "open-source" to "open source"

* vale and review edits

* deleting erroneous character in shortcode

* updating some shortcodes

---------

Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>
2025-02-11 11:42:30 -06:00
Rares Mardare
6d374a3d7f Configuration tracker: Update copy in IRM and point to new IRM slack integration (#100440)
Update copy + point to new IRM slack
2025-02-11 18:41:34 +01:00
Christopher Moyer
53ae85ca57 docs: updates to support prometheus data source learning journey (#100363)
* updates to support prometheus data source learning journey

* makes prettier
2025-02-11 10:20:47 -06:00
ismail simsek
c15c9f8af6 Prometheus: Fix cursor jump in prometheus code editor (#100273)
* set save view state prop

* remove custom onChange function
2025-02-11 16:55:54 +01:00
Kevin Minehart
a8b98ded66 CI: Add release branches to patch automation (#100442)
* CI: Add release branches to patch automation

* Update .github/workflows/create-security-patch-from-security-mirror.yml

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>

---------

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>
2025-02-11 17:41:46 +02:00
Jean-Philippe Quéméner
d1b4162a33 refactor(unified-storage): measure also failed queries (#100430) 2025-02-11 16:19:43 +01:00
Kyle Brandt
f7588376df SQL Expressions: (Chore) Update code for latest plugin-sdk data pkg (#100425)
Use new NilAt and SetRefId methods
2025-02-11 15:15:54 +00:00
Yuri Tseretyan
28f21e0a0d Alerting: Do not record rule version if no difference (#100364) 2025-02-11 09:46:26 -05:00
renovate[bot]
6da6660def Update dependency esbuild-plugin-browserslist to ^0.16.0 (#100420)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-11 16:46:16 +02:00
Yuri Tseretyan
4cac3158c7 Alerting: Fix alert rule copy to include metadata (#100212)
* copy metadata

* add tests for copy and generator

* extract copy rule to a production method and update usages

* fix tests
2025-02-11 09:46:02 -05:00
renovate[bot]
79bd3ffd8c Update dependency rollup-plugin-esbuild to v6.2.0 (#100421)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-11 14:44:41 +00:00
Jean-Philippe Quéméner
8a9f6416d2 fix(unified-storage): error on failed primary deletes in mode2 (#100427) 2025-02-11 15:39:39 +01:00
renovate[bot]
14c8eb2373 Update dependency esbuild-loader to v4.3.0 (#100423)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-11 16:27:29 +02:00
renovate[bot]
8c0e087ce2 Update dependency esbuild to v0.25.0 [SECURITY] (#100426)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-11 16:04:18 +02:00
Alexander Zobnin
7234a17d1d Zanzana: Use authzService audience (#100417) 2025-02-11 14:25:30 +01:00
Sergej-Vlasov
bbe21bb1d2 Bump Scenes to 5.42.0 (#100205)
* update scenes and weekStart prop type

* update test

* adjust weekStart type in schemaV2

* clean up weekStart error message

* clean up weekStart in test data
2025-02-11 13:20:47 +00:00
Laura Fernández
43d7d00247 Combobox: fix check for existing options when creating a custom value (#100123) 2025-02-11 14:13:42 +01:00
Alexander Zobnin
5118e82e8c Zanzana: Run reconciliation in its own service (#100361)
* Zanzana: Start reconciliation in its own service

* cleanup

* update go workspaces

* refactor

* remove unused code

* move func definition
2025-02-11 14:09:39 +01:00
Ryan McKinley
e3cb73301e Authz/Schema: Remove unused stub cue definitions (#100387) 2025-02-11 15:24:11 +03:00
Oscar Kilhed
6ee3c71ffe Dashboards: refactor transform scene layout to save model and transform save model to scene layout, schema v2 (#100322)
* Add tests

* refactor transformSaveModelToSchemaV2 and transformSceneToSaveModelV2

* move default grid serializer functions outside of class

* simplify layoutmanager descriptor

* add test for SaveModel -> Scene

* Fix lint issues

* remove auto added import

* Fix name

* Fix test typo
2025-02-11 13:08:07 +01:00
Victor Marin
e17fd5e8ad DashboardDS: Re-run dashboard queries within MixedDS on transformation reprocessing (#100370)
* fix scenario where results subscription is lost due to transformations

* fix
2025-02-11 13:39:00 +02:00
Karl Persson
bfa4fa3c68 Authz: Refactor folder tree (#99554)
* Refactor folder tree to its own structure

* Make it possible to json encode the tree

* Use iterations for Ancestors and Children

---------

Co-authored-by: IevaVasiljeva <ieva.vasiljeva@grafana.com>
2025-02-11 12:36:11 +01:00
Torkel Ödegaard
a1dacc24b9 CSS: Update generated scss file (#100413) 2025-02-11 12:35:21 +01:00
Torkel Ödegaard
9bdacf3833 DesignSystem: Menu and popover styling update to use new elevated background token (#100255)
* DesignSystem: Menu and popover styling tweak proposal

* Fix submenu

* Themes: Add elevated prop

* Update themes

* update

* Fixed tests

* Update

* fix markdown lint

* Update packages/grafana-data/src/themes/createColors.ts

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>

* Update contribute/style-guides/themes.md

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>

* Update

* Update

---------

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2025-02-11 12:27:04 +01:00
Ashley Harrison
d87ef806f0 LoadingBar: Use a theme variable instead of hardcoded hex color (#100407)
use the theme variable in our loadingbar instead of a hardcoded hex color
2025-02-11 11:17:15 +00:00
Andre Pereira
d48802cdfb Tempo: TraceQL metrics streaming (#99037)
* TraceQL metrics streaming POC

* Reduce duplicate frames by using scan() and combineResponses()

* Trying to remove samples outside of time range

* Remove code to clean out of range

* Metrics streaming config toggle

* Sync opening the search and metrics options

* Fix tests

* Fix issues after conflicts

* Fix tests

* Use absolute value when computing minXDelta

* Revert last commit

* Fix frame sorting

* Remove all duplicates

* Use fields from schema to get the frames

* Use FieldCache

* Address PR comments
2025-02-11 11:11:01 +00:00
Jack Westbrook
cbe5741096 Fix: Optimise frontend Postgresql plugin cache busting (#100406)
fix(postgresql): add version for optimised cache busting
2025-02-11 12:08:19 +01:00
antonio
cfb26f2a4b docs: new alerting tutorial - part 5 (#100367)
* docs: new alerting tutorial - part 5

* all pretty, no pity

* title

* vale vale

* minor formatting issues

* minor formatting issues2

* format

* prettier

* docker compose

* creds

* format

* even prettier
2025-02-11 12:04:24 +01:00
Ashley Harrison
70b86eeb6d App: Fix web app behaviour on iOS (#100382)
readd apple-mobile-wep-app-capable
2025-02-11 10:01:33 +00:00
Vishal N
b0dd6e900a Docs: Fixed hyperlinks pointing to supported auth providers (#100404) 2025-02-11 11:00:36 +01:00
Esteban Beltran
9f77c86b21 Frontend Sandbox: Allow enabling sandbox before installing plugins (#100365)
* Frontend Sandbox: Allow enabling sandbox before installing plugins
2025-02-11 11:52:21 +02:00
Josh Hunt
e5154ce799 Combobox: Add tests for labels with Combobox (#100044)
* Add tests for labels with Combobox

* clean
2025-02-11 09:44:38 +00:00
Jean-Philippe Quéméner
6eaf702e96 fix(unified-storage): return legacy data in mode 2 (#100353) 2025-02-11 10:34:56 +01:00
Andres Martinez Gotor
b6c0db31d9 Advisor: Clean up old checks (#100375) 2025-02-11 09:36:46 +01:00
Andres Martinez Gotor
f8efdaf88c apiserver: Avoid panic for DELETE requests (#100372) 2025-02-11 09:18:57 +01:00
jackyin
f2d34254d3 Panel: Editor theme can't change (#99621)
editor theme can't change
2025-02-11 09:51:59 +02:00
Gábor Farkas
e4ef71b78e querier: handle datasource-not-found (#100175) 2025-02-11 08:25:27 +01:00
Isabel Matwawana
63216a3e6e Docs: Vale fixes (#100277) 2025-02-10 14:19:44 -05:00
Ida Štambuk
7092fd269d Elasticsearch: Remove frontend testDatasource method (#99894) 2025-02-10 18:33:36 +01:00
Ida Štambuk
4e48b7557c CloudWatch: Track Logs Insights query language (#100254)
Co-authored-by: Kevin Yu <kevinwcyu@users.noreply.github.com>
2025-02-10 18:13:26 +01:00
Sarah Zinger
0152f414f0 DS Apiservers: return 404 when receiving a datasource not found error (#100025)
* DS Apiservers should return a k8s 404 error

* Do not swallow status codes

* Updates from initial CR.

* Add test for ds apiserver to retunr 404 when a datasource is not found

* Didn't intend for a change here
2025-02-10 12:07:51 -05:00
Alex Khomenko
27ece859e7 MultiCombobox: Export from grafana/ui (#100368)
* MultiCombobox: Export from grafana/ui

* Fix typos

* Update options styles
2025-02-10 17:37:17 +02:00
Moustafa Baiou
7dee4d1808 Alerting: Allow specifying uid for new rules added to groups (#99858)
When modifying rule groups the `uid` can be specified but only if the rule already existed in the DB. If the rule is new the update would be rejected.

This updates the RuleGroup provisioning apis to allow specifying the `uid` when creating/updating rule groups. 

Additionally, the RuleGroupIdx was not being updated when rules were reordered in the group.

Context: https://github.com/grafana/terraform-provider-grafana/pull/1971#issuecomment-2599223897
Relates to: https://github.com/grafana/terraform-provider-grafana/issues/1928

Fixes: #98283
2025-02-10 10:28:34 -05:00
ismail simsek
55e7c4ae6d Prometheus: Get the utcOffset value of timezone when it's specified (#99910)
* get the utcOffset value of timezone when it's specified

* Update packages/grafana-prometheus/src/datasource.ts

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>

* calculate utcOffset from timezone when the request timezone is not browser

* lint

---------

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2025-02-10 16:11:06 +01:00
Yuri Tseretyan
1b8db233a7 Alerting: Rule Version API to Ignore versions without diff (#100093) 2025-02-10 09:20:35 -05:00
Marco Schaefer
dec07c4c34 Update-faro-versions-in-grafana-packages (#100354)
* update faro versions in grafana-runtime

* update faro packages in root

* update Faro version in Grafana UI

* upgrade faro version in grafana-prometheus

* replace deprecated type
2025-02-10 15:07:32 +01:00
beejeebus
02caf915a5 Don't remove DWARF info from Go binaries in dev (#100328)
Only ask the linker to strip DWARF information if we're not in
dev, to avoid seeing stuff like this when using delve:

    ~ $ dlv attach $(pgrep grafana)
    (dlv) l main.main
    Command failed: location "main.main" not found

After this change:

    ~ $ dlv attach $(pgrep grafana)
    Type 'help' for list of commands.
    (dlv) l main.main
    Showing /home/justin/code/grafana/pkg/cmd/grafana/main.go:23 (PC: 0xac93533)
        18: var commit = gcli.DefaultCommitValue
        19: var enterpriseCommit = gcli.DefaultCommitValue
        20: var buildBranch = "main"
        21: var buildstamp string
        22:
        23: func main() {
        24:         app := MainApp()
        25:
        26:         if err := app.Run(os.Args); err != nil {
2025-02-10 08:43:31 -05:00
Torkel Ödegaard
68700e3d7d TimeRangePicker: Options list padding (#100343) 2025-02-10 14:12:23 +01:00
Josh Hunt
30abff9998 Chore: Bump undici (#100352) 2025-02-10 13:05:48 +00:00
Josh Hunt
9697a699f2 Chore: Remove unused knip dependency (#100351) 2025-02-10 14:40:45 +02:00
Andres Martinez Gotor
42170ad23a Advisor: Create checks following a schedule (#100282) 2025-02-10 13:15:41 +01:00
Alex Khomenko
2518012569 grafana-ui: Update InlineField error prop type to React.ReactNode (#100347) 2025-02-10 13:46:46 +02:00
Ryan McKinley
7c8fddc729 Chore: remove CVE from code scanning tool (#100312) 2025-02-10 13:07:04 +02:00
Gábor Farkas
390b5eb6d4 go.mod: updated grafana-plugin-sdk-go (#100342)
* go.mod: update grafana-plugin-sdk-go

* make update-workspace
2025-02-10 11:38:30 +01:00
Gilles De Mey
afab71e28c Alerting: Remove rule group edit from single rule editor (#100191)
remove rule group edit from single rule editor
2025-02-10 11:13:28 +01:00
Konrad Lalik
6723159b12 Alerting: Fix useAlertingQueryRunner re-rendering loop (#100206)
* Fix AlertingQueryRunner infinite re-rendering loop

* Update tests
2025-02-10 10:51:54 +01:00
Josh Hunt
00155abf1b Codeowners: Make Grafana Frontend Platform only own Grafana UI documentation (#100314)
* Codeowners: Make Grafana Frontend Platform exclusive owners of MDX documentation

* more
2025-02-10 09:50:49 +00:00
Misi
acc1521929 Auth: Fix redirect with JWT auth URL login (#100295)
fix
2025-02-10 10:48:35 +01:00
Elliot Kirk
95e61f63f7 Faro: Upgrading faro deps to 1.13.1, enabling error serializer (#100145)
* upping faro deps, enabling error serializer

* linting

* fix lint errors

* more linting stuff

* yarn lock
2025-02-10 09:32:47 +01:00
Sam Jewell
45775dd6ad Skip flakey test (#100251) 2025-02-10 07:40:32 +00:00
Adela Almasan
f5c049012b Chore: Data links and Actions components refactor (#100097)
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2025-02-07 20:03:05 -06:00
Adela Almasan
bce05cd48d VizActions: Add confirmation message (#100012)
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2025-02-07 16:58:09 -06:00
Scott Lepper
378bb6ea3f [search] folder name lookup performance (#100154)
[search] use search for folder name lookup
2025-02-07 17:19:23 -05:00
owensmallwood
196029f287 Unified Storage: Adds more spans to handleEvent (#100304)
adds more spans to handleEvent
2025-02-07 19:43:02 +01:00
Will Assis
7e11e604c7 [search] fix offset param in finddashboards (#100302)
* fix offset param in finddashboards

* separate offset from page in k8s search endponit
2025-02-07 13:24:27 -05:00
owensmallwood
bf27e6d3ed Unified Storage: Fix legacy dashboard query when using continue token (#100244)
* query for rows less than the continue token LastID since the queries are sorted by dash ID in DESC order

* run dashboard query tests
2025-02-07 12:16:41 -06:00
Torkel Ödegaard
79d7e11fa4 Menu: Uniform padding to make menu item hover state look better (#100275)
* Menu: Uniform padding

* tweak menu header

---------

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2025-02-07 19:07:10 +01:00
Haris Rozajac
f5d8f42635 Dashboard Scene: Fix unnecessary diffing (#100158)
* Fix unnecessary diffing

* use a diferent approach; update legacyId type

* fix test
2025-02-07 10:47:07 -07:00
AsocPro
7b48670104 Alerting: Remove leftover legacy alerting types (#100162) 2025-02-07 17:46:12 +00:00
Will Assis
7c9f47ac67 [search] handle folderids query param (#100223)
handle folderids query param
2025-02-07 12:24:21 -05:00
Ashley Harrison
0bd4e3bda2 Theme: properly clip corners in loki/prom query editor (#100253)
properly clip corners in loki/prom query editor
2025-02-07 17:17:46 +00:00
Ethan
bf413643c8 Remove unused SBOM report workflow from GitHub Actions (#100124)
* Remove SBOM report workflow from GitHub Actions

* Remove SBOM report workflow from CODEOWNERS
2025-02-07 18:11:11 +01:00
Alexander Akhmetov
97109b36e3 Update grafana/alerting package from 995709fe8d64 to 04c87cf39038 (#100293) 2025-02-07 18:38:22 +02:00
Fayzal Ghantiwala
7ae8058c8b Alerting: Return 404 when /api/ruler/grafana/api/v1/rules/{Namespace}/{Groupname} does not exist (#100264)
* Return a 404 when rule group doesn't exist

* Update tests

* Update swagger doc and tests
2025-02-07 16:24:28 +00:00
renovate[bot]
9ce6c69996 Update dependency nanoid to v5.0.9 [SECURITY] (#100279)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-07 15:25:29 +00:00
Bogdan Matei
be42685852 Dashboards: Add tabs layout (#100127) 2025-02-07 16:50:53 +02:00
Andres Martinez Gotor
f607bcd43f Advisor: Replace Error naming with Failure (#100262) 2025-02-07 15:48:18 +01:00
Agnès Toulet
0beb7e668b E2E: Add PDF/CSV/Image comparison tasks (#99104)
* E2E: Add tasks for new reporting tests

* try to switch to pdf-parse

* fix pdf comparison

* add log

* increase threshold

* clean up

* apply review feedback

* improve logs + fix local setup for reporting

* format
2025-02-07 15:46:32 +01:00
Bogdan Matei
158c5443b5 Dashboard: Fix for overwriting an edited dashboard in the old architecture (#100247) 2025-02-07 16:44:55 +02:00
Alex Khomenko
53030e7960 Card: Render description element based on children type (#100276) 2025-02-07 16:39:13 +02:00
Mariell Hoversholm
dfaa12b800 Provisioning: Sync API with current feature branch (#100252)
* Provisioning: Jobs: Define repository name field

* Provisioning: Jobs: Separate options per job type

* Provisioning: Define a sanitised settings resource

* Provisioning: Jobs: Define a job summary

* Provisioning: Remove linting

* Provisioning: Update docs for a few fields

* Provisioning: Remove HelloWorld

* Provisioning: Replace Repository with Message in job info

* Provisioning: Remove YAML support

* Provisioning: Remove custom folder specification

* Provisioning: Support read-only repositories

* Provisioning: Remove edit options

* Provisioning: Add sync options for repositories

* Provisioning: Add resource statistics

* Provisioning: Make slices atomic lists

* Provisioning: Message list needs to exist even if empty

If we don't do this, we can't clear the messages field, leading to buggy UX.

* Provisioning: Support incremental syncing

* Provisioning: Remove the 'items' subresource workaround

* Provisioning: Add resource list

* Provisioning: Reformat

* Provisioning: Declare new types

* OpenAPI: Generate openapi JSON spec from generated code

* Codegen: Generate OpenAPI spec

* Provisioning: Support generating frontend API

* Codegen: Generate Go code

* Provisioning: Define the base API

* Codegen: Generate frontend endpoints for provisioning

* Refactor: yarn prettier:write

* Provisioning: Tiger team takes ownership

* Chore: Remove dir we haven't added yet

* Provisioning: Remove frontend

* Test: Update example repositories
2025-02-07 15:35:55 +01:00
Torkel Ödegaard
9d7a4a53e4 Themes: Adds 1 more GrafanaCon theme (wip) (#100228)
* Themes: Gloom theme wip

* Themes: Gloom theme wip

* refactor

* A bit brown maybe?

* Update secondary to also be a bit brownish orangy

* Not super happy

* down a bit

* Progress

* Update

* Update

* orange primary again
2025-02-07 15:27:56 +01:00
Kristina
9fbb0b6636 Panel edit: Remove use of SheetJS (#100161)
Remove SheetJS
2025-02-07 08:21:14 -06:00
Todd Treece
6af67197a7 Dual Writer: Remove list comparisons in mode 2 & 3 (#100215) 2025-02-07 09:17:53 -05:00
Oscar Kilhed
a412394a14 Dashboards: Save rows and responsive grid layouts in v2 (#100035)
* save rows and responsive grid layouts in v2

* Add back accidentally removed assert

* adress feedback

* use getGridItemKeyForPanel

* Fix import

* fix another import

* Remove RowGridLayout
2025-02-07 14:45:04 +01:00
Alex Khomenko
882b993496 Card: Use div for description (#100272) 2025-02-07 15:30:22 +02:00
Georges Chaudy
6e748a9ee7 fix: Ensure we check the user identity for search (#100190)
Ensure we check the user identity for search
2025-02-07 12:32:45 +01:00
Piotr Jamróz
c43517d278 Explore: Fix resizing split view with Loki query editor (#100257) 2025-02-07 12:05:45 +01:00
Mariell Hoversholm
e815a2850e Provisioning: Integration test that Repository resources work (#100197)
* Provisioning: Set up server in practice

* Provisioning: Integration test that Repository resources work
2025-02-07 12:04:58 +01:00
Bogdan Matei
a51e785bc1 Dashboards: Finalize refactoring for dynamic dashboards (#100198) 2025-02-07 12:57:54 +02:00
Andrej Ocenas
4b9fee61a8 QueryLibrary: Move to enterprise (#100133) 2025-02-07 11:09:51 +01:00
Giuseppe Guerra
ccb9cab131 Plugins: Add synchronous CDN plugin loader (#99096)
* WIP

* Run plugin validations and validation steps sequentially if feature is off

* Remove dependency between sources.Service and pluginscdn.Service

* lint

* Parallelize validation only if class is CDN

* re-generate feature toggles

* remove waitgroup usage

* PR review: Add loader concurrency limit setting

* re-generate feature toggles

* pr review feedback

* fix const name

* Skip module.js validation for cdn plugins

* do not run validation steps in parallel

* lint

* reduce diff

* re-generate feature toggles

* lint

* pr review feedback

* remove leftover config.PluginManagementCfg from sources.Service
2025-02-07 11:07:08 +01:00
Andres Martinez Gotor
e291140be3 Advisor: Run check steps in parallel (#100200) 2025-02-07 10:57:26 +01:00
Kyle Brandt
6dc98dbbcc SQL Expressions: Add str_to_date function and unskip test (#100226) 2025-02-07 11:51:55 +02:00
Levente Balogh
9da423045e Advisor: Enable frontend code generation for the checktype kind (#100208)
nit: enabling frontend code generation for the `checktype`
2025-02-07 10:49:27 +01:00
Kyle Brandt
d196b789e2 SQL Expressions: Add more SQLNodes and funcs to allow list (#100227)
sql_expr: Add more Nodes and funcs to allow list
2025-02-07 09:44:17 +00:00
Arati R.
d62c490af5 UniStore Big Objects: Fix spec rebuilding (#100183)
* Fix big object spec rebuilding and associated test

---------

Co-authored-by: Jean-Philippe Quémémer <jeanphilippe.quemener@grafana.com>
2025-02-07 09:29:25 +01:00
Brendan O'Handley
d16f2315a4 Explore metrics: Always check that custom var is present for otel dep env migration (#100233) 2025-02-06 18:26:25 -06:00
Jev Forsberg
74b2b5fb19 Chore: Update drone.yml signature (#100236)
baldm0mma/update drone signature
2025-02-06 15:58:56 -07:00
Jev Forsberg
8e3327a446 Chore: Update grabpl version to v3.1.2 (#100157)
baldm0mma/ update grabpl version
2025-02-06 15:23:51 -07:00
Jean-Philippe Quéméner
c8609b8a61 feat(unified-storage): keep tags on reduce of dashboards (#100230) 2025-02-06 22:23:00 +01:00
Sam Jewell
f4426e22bf SQL Expressions: Bump go-mysql-server dependency to main (#100222)
Bump go-mysql-server dependency to `main`

This is so we receive a few bug fixes - fixes to these issues:

- https://github.com/dolthub/dolt/issues/8807
- https://github.com/dolthub/dolt/issues/8735
- https://github.com/dolthub/dolt/issues/8724
2025-02-06 17:34:35 +00:00
Alexander Akhmetov
a9ce930634 Alerting: Promote alertingSaveStateCompressed flag to public preview (#99935) 2025-02-06 18:09:43 +01:00
Victor Marin
2b3ccfe5b9 DynamicDashboards: Revert unnecessary empty page on new layouts (#100218)
Revert unnecessary empty page on new layouts
2025-02-06 18:37:28 +02:00
Tobias Skarhed
677060862c Combobox: Fix list not being virtualized initially in some cases (#100188)
* Combobox: Set arbitrary initial max size

* Remove ?

* Set initial values to 0
2025-02-06 17:34:52 +01:00
Will Assis
1467d4b3e3 [search] Legacy search fallback support legacy query params (#99765)
* add support for deleted query param

* support tag query param in modes 2 and below

* handle dashboardIds

* hhandle dashboardUIDs

* handle folderUIDs query param

* handle page query param when hitting legacy storage

* handle sort query param

* handle type query param

* re-enable search fallback

* remove folder search workaround and fix /api/search to return both folders and dashboards when no title or type is provided

---------

Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
2025-02-06 11:30:47 -05:00
Matthew Jacobson
ccb0e9222a Alerting: Upgrade grafana/alerting to use EmbeddedContents (#99983)
* Upgrade grafana/alerting to include EmbeddedContents for email images
2025-02-06 11:29:43 -05:00
Karl Persson
011301f06f Authz: client cache (#100195)
* Reduce client permissions cache for authz client

* Adjust server cache ttl
2025-02-06 17:16:30 +01:00
Josh Hunt
f8509273cb Slider: Fix text input box being too wide (#100138)
* Fix Input width from className not being respected

* Also use width prop in Slider
2025-02-06 16:14:38 +00:00
Sarah Zinger
0035ed8a5e Add log line for unexpected queries in ds querier (#100147) 2025-02-06 11:05:30 -05:00
Karl Persson
126396399e Folder+Dashboard: Resolve parent folders as service in search (#100185)
Resolve parent folders as service to guarantee that we can fetch the title
2025-02-06 16:40:07 +01:00
Haris Rozajac
1bf53e7a5f Dashboard Schema V2: E2E setup (#99843)
* basic setup

* update CODEOWNERS

* update name

* add temp test that ensures we are loading schema V2 json in the UI

* update language

* test with yarn cache and combine steps

* revert combine

* remove commented out code

* Run current dashboard suite, make workflow optional

* make job always succeed

* Remove temp v2 suite

* don't run on draft PRs

* command for old arch
2025-02-06 08:33:18 -07:00
Andres Martinez Gotor
05ea450dd2 Drone: Add apps directory for backend tests (#100204) 2025-02-06 17:01:50 +02:00
Nathan Marrs
21bfdd445f Image Renderer: Minor refactor cleanup (#100089) 2025-02-06 08:01:11 -07:00
Haris Rozajac
4c52abb6b4 Dashboard Schema V2: Introduce __legacyStringValue and deprecate string type for query prop in QueryVariableSpec (#99716)
* Introduce __legacyStringValue and deprecate string type for query

* Fix tests

* Fix tests

* remove default

* kind should default to default ds if variable doesn't have ds field

* lint

* getDefaultDataSourceRef should not return undefined
2025-02-06 07:33:06 -07:00
Torkel Ödegaard
f1eac34b54 Dashboard: Simpify is empty handling (#100189)
* Dashboard: Simpify is empty handling

* remove unused imports

* Update

* Update

* Update

* add code for other layouts

---------

Co-authored-by: Victor Marin <victor.marin@grafana.com>
2025-02-06 15:30:54 +01:00
Mariell Hoversholm
ae33d49036 Advisor: Assert new fields (#100199) 2025-02-06 16:29:54 +02:00
Jacob Valdez
d3ce9e1fe2 Docs: adding actions_allow_post_url example to plugin docs (#96157) 2025-02-06 08:24:30 -06:00
Eric Leijonmarck
98e3237ce2 LBAC for data sources: Update to indicate that we have experimental and GA (#100187)
update confusing docs
2025-02-06 14:05:52 +00:00
Ida Štambuk
57e30633e9 Docs: Add a note on query caching for Cloudwatch datasource (#100180) 2025-02-06 15:02:34 +01:00
Andres Martinez Gotor
52db2070a0 Advisor: Expose check types as a resource (#100058) 2025-02-06 13:35:40 +01:00
Kyle Brandt
d64f41afdc SQL Expressions: Re-implement feature using go-mysql-server (#99521)
* Under feature flag `sqlExpressions` and is experimental
* Excluded from arm32
* Will not work with the Query Service yet
* Does not have limits in place yet
* Does not working with alerting yet
* Currently requires "prepare time series" Transform for time series viz
 
---------

Co-authored-by: Sam Jewell <sam.jewell@grafana.com>
2025-02-06 07:27:28 -05:00
Matias Chomicki
4e6bdce41c Loki query direction: run initialization only in Explore and Dashboards (#100182) 2025-02-06 13:02:43 +01:00
Sriram
9fc82faea7 [analytics] added plugin version to grafana_ds_test_datasource_clicked event (#100168) 2025-02-06 11:50:48 +00:00
Matheus Macabu
fde475e3d9 CloudMigrations: save snapshot of alert rule groups (#100109) 2025-02-06 12:35:59 +01:00
Ashley Harrison
7d3a77a45c Themes: Add new theme definitions behind feature toggle (#100129)
* create new toggle

* add survey link behind feature toggle

* fix translations

* better theme structure

* add all the themes back

* update matrix

* fix mars contrast

* fix color contrast probs with tron

* fix a11y issues with synthwave/victorian themes

* fix aubergine/zen

* rename green + gold

* rename to space

* rename, only enable 4 for grafanacon

* add survey link

* fix info color in sapphiredusk

* handle extra themes in storybook
2025-02-06 11:08:04 +00:00
Karl Persson
e05413dcc4 Dashboards+Folders: Ensure the service identity is used for resolvers (#100128)
* Dashboards+Folders: Ensure the service identity is used for dashboard and folder resolvers

* Add convinient function to call closure with service context
2025-02-06 12:07:52 +01:00
Torkel Ödegaard
0916994d0a Dashboard: Various fixes to new layouts (#100107)
* Dashboard: Various fixes to new layouts

* review fixes

* Fix

* Update

* Fix test
2025-02-06 10:57:08 +01:00
Leon Sorokin
d5f1f4eb5c ComboBox: Fall back to substring matching for symbols/operators (#100148) 2025-02-06 09:33:08 +00:00
Ashley Harrison
f89da88f0f Storybook: Support an arbitrary number of themes (#100111)
* support more themes in storybook

* default to dark theme

* fix type error

* change theme in docs container

* add TODO

* only show extra themes in development mode

* add comment
2025-02-06 09:16:47 +00:00
Andres Martinez Gotor
36275a5510 Advisor: Refactor check interfaces (#100043) 2025-02-06 09:55:17 +01:00
Stephanie Hingtgen
495aa65c6e FindDashboards: filter by dashboard type (#100160) 2025-02-05 18:57:26 -06:00
Yuri Tseretyan
f7d476e408 Alerting: Remove id and org_id from grafana alert rule API model (#100139) 2025-02-05 23:13:22 +02:00
Brendan O'Handley
0fe4b15d00 Explore metrics: Add option to use regex (#100146)
add option to use regex
2025-02-05 15:11:43 -06:00
Todd Treece
69e4d8468b Dashboard: Add v1alpha1 test coverage (#100149) 2025-02-05 23:01:51 +02:00
Jean-Philippe Quéméner
364559e856 feat(unified-storage): use continue token when building list (#100143) 2025-02-05 21:02:35 +01:00
Kevin Minehart
8e10ee9056 CI: remove unnecessary line in backport.yml (#100144)
remove bad line
2025-02-05 21:37:19 +02:00
Kevin Yu
b7b2e2bbaa CI: Commit package.json changes in e2e/test-plugins when bumping versions (#97506) 2025-02-05 13:29:18 -06:00
Yuri Tseretyan
33b11d5c76 Alerting: Remove ID and OrgID from hash calculation (#100140) 2025-02-05 14:15:02 -05:00
Kevin Minehart
6787cdccb9 CI: Backport to release branches (#100067)
* update backport and release comms

* Backport to release branches and change docs source branch for publishing

* Add new workflows to CODEOWNERS

* Re-add removed line oops

* backport-testing -> grafana

* checkout grafana repo in backport action, reference repo / branch in reusable action

* generate -> create
2025-02-05 21:04:03 +02:00
colin-stuart
6200361f36 Auth: Add IP address login attempt validation (#98123)
* Auth: Add IP address login attempt validation

* LoginAttempt struct IpAddress field must be camelCase to match db ip_address column

* add setting DisableIPAddressLoginProtection

* lint

* add DisableIPAddressLoginProtection setting to tests

* add request object to authenticate password test

* nit suggestions & rename tests

* add login attempt on failed password authentication

* dont need to reset login attempts if successful

* don't change error message

* revert go.work.sum

* Update pkg/services/authn/clients/password.go

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>

---------

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
2025-02-05 20:16:36 +02:00
colin-stuart
d58dec7951 Docs: Add docs for Passwordless Authentication Using Magic Links (#96877)
* Docs: Add docs for Passwordless Authentication Using Magic Links

* Update docs/sources/setup-grafana/configure-security/configure-authentication/passwordless/index.md

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>

* Update docs/sources/setup-grafana/configure-security/configure-authentication/passwordless/index.md

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>

* Update docs/sources/setup-grafana/configure-security/configure-authentication/passwordless/index.md

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>

* match Writer's Toolkit style

* Update docs/sources/setup-grafana/configure-security/configure-authentication/passwordless/index.md

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>

---------

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
2025-02-05 17:58:14 +00:00
Isabel Matwawana
92bb51bdda Docs: move missing ref URI to correct page (#100131) 2025-02-05 12:08:50 -05:00
Artur Wierzbicki
130d268b51 Dashboards: Update POST /api/dashboards/db docs (#99363)
update dashboard update docs
2025-02-05 22:47:08 +06:00
Matthew Jacobson
a93664ff3d Alerting: Add EmbeddedContents as alternative embedding in smtp (#99937)
Adds support for embedding []byte in SmtpClient instead of filenames. This is backwards compatible as it uses a new field EmbeddedContents to add an alternative to the existing EmbeddedFiles which takes filenames.
2025-02-05 11:12:30 -05:00
Josh Hunt
0ca1febb77 FolderPicker: Make lazy in prep for exposing publicly (#100118)
* Make lazy NestedFolderPicker

* Change permission prop to use string union instead of enum

* reword comment
2025-02-05 17:21:32 +02:00
Karl Persson
39d94eabcd Auth: Fix function name (#100122)
Fix spelling
2025-02-05 15:32:22 +01:00
Karl Persson
64800f293e Authz: Check for parent uid instead of id (#100121)
* Check for parent uid instead of id
2025-02-05 15:06:38 +01:00
Andres Martinez Gotor
6d159b6240 Advisor: Fix Healtcheck check (#100115) 2025-02-05 14:59:40 +01:00
Jacob Valdez
bf1174cfdc Docs: Adding info on decrypting encrypted certificates (#100020) 2025-02-05 07:47:56 -06:00
Ivan Ortega Alba
d53b269455 Dashboard V0->V1 Migration: Schema migration v39 (#99631) 2025-02-05 13:50:38 +01:00
Dana Axinte
665974e751 CloudMigrations: Update link to cloud migration assistant page (#99915)
* change link

* consolidate banners

* remove banner on plugins
2025-02-05 12:01:04 +00:00
Ieva
095593c018 RBAC: Don't check folder access if annotationPermissionUpdate FT is enabled (#99717)
don't check folder access if annotation permission update is enabled
2025-02-05 11:15:24 +00:00
Bogdan Matei
c4d0114376 Dashboards: Use i18n for texts in dynamic dashboards (#100108) 2025-02-05 13:14:03 +02:00
Nick Richmond
39a6d2e586 ExploreMetrics: Use redirect to route traffic to metrics drilldown app (#100098)
* fix: drilldown app redirect

* chore: make copilot review happy, I guess 🤷
2025-02-05 06:09:16 -05:00
Bogdan Matei
f51571db5d Dashboards: Refactor types for dynamic dashboards (#100064) 2025-02-05 11:08:41 +02:00
Rares Mardare
bea62aa615 Alerting: Update IRM copies in Configuration Tracker (#100069)
* updated alerting configuration tracker with new IRM copies

* Configuration tracker steps

* copy

* CI trigger

---------

Co-authored-by: Sonia Aguilar <soniaaguilarpeiron@gmail.com>
2025-02-05 09:58:19 +01:00
Mihai Doarna
5ad31ebe39 API keys: Migrate API keys to service accounts at startup (#96924)
* migrate API keys to SA at startup

* send metrics with api key migration stats

* address feedback

* run API keys migration in a server lock

* update logging
2025-02-05 10:55:47 +02:00
Todd Treece
17e21bff97 Dashboards: Fix title conversions (#100084) 2025-02-04 16:22:42 -05:00
Brendan O'Handley
7ebc81fbbf Explore metrics: Fix otel bug (#100092) 2025-02-04 15:18:30 -06:00
owensmallwood
f9c4d3edce Unified Storage: Updates index latency logging (#100085)
updates index latency logging
2025-02-04 13:33:44 -06:00
Yuri Tseretyan
68f1730461 Alerting: set updated_by for system owned operations (#100068) 2025-02-04 14:23:15 -05:00
Nathan Marrs
6eac07c3a7 Image Renderer: Add support for SSL in plugin mode (#98009) 2025-02-04 10:44:02 -08:00
Matias Chomicki
ff926c5ac5 Logs Panel: Base elements for the new visualization (#99084)
* Create base components

* Create measurement service

* Add container for list

* Use measurement to render virtualized log lines

* Match rendered styles in 2d context for measuring

* Improve virtualization initialization and handle resize

* Introduce log line processing

* Virtualization: fix measurement of lines with line endings

* Virtualization: include scrollbar width in calculation

* Remove logs

* Virtualization: optimize text measurement

* Add support for forceEscape

* Log line: properly style wrapped/unwrapped lines

* Virtualization: handle possible overflows

* Improve overflow handling

* LogList: remove scroll position ref

* Remove logs

* Remove log

* Add top/bottom navigation buttons

* Add timestamp to pre-processing

* Add showtime support

* Fix imports

* Chore: simplify dedup

* Show level

* Refactor measurement and measure level and timestamp

* Virtualization: skip unnecessary measurements

* Improve measurements to minimize overflow chance

* Introduce logline colors

* Update palette

* Remove pretiffying

* Add comment

* Remove unused variable

* Add color for info level

* Fix dependencies

* Refactor overflow to account for smaller estimations

* Debounce resizing

* Fix imports

* Further optimize height calculation

* Remove outline

* Unused import

* Use less under/overflow method

* Respond to height changes

* Refactor size adjustment to account for layout changes

* Add Logs Panel support

* Add margin bottom to log lines

* Remove unused option

* LogList: container div should never be null

Bad API design

* Log List: make app not undefined and update containerElement usages

* New Logs Panel: Create as new visualization (#99427)

* Logs Panel: clean up old panel

* Logs Panel New: create as new visualization

* Plugin: mark as alpha

* Logs panel new: hold container in a state variable

* Logs panel: fix no data state

* Create newLogsPanel feature flag

* Logs: use new feature flag

* Prettier

* Add new panel to code owners

* Logs Navigation: add translations

* Address betterer issues

* Fix import

* Extract translations

* Update virtualization.ts

* Virtualization: add DOM fallback for text measurement

* Run gen-cue

* plugins_integration_test: add logs-new to expected plugins
2025-02-04 18:40:17 +01:00
Sven Grossmann
87bb7c3947 Explore: Fix casing for exploreHideLogsDownload setting (#100081) 2025-02-04 18:32:08 +01:00
Todd Treece
3fd1b67381 Dashboards: Apply schemaVersion migration in v2 conversion (#99973) 2025-02-04 12:11:08 -05:00
Christopher Lord
e74cf72d99 Plugin Metrics: Eliminate data race in plugin metrics middleware (#99396)
fix: eliminate data race in plugin metrics middleware

A data race was detected when multiple goroutines accessed the `MetricsMiddleware`
simultaneously. The race occurred because a single `MetricsMiddleware` instance
was being shared across goroutines while its `BaseHandler` field was being
modified during middleware chain setup.

Fix by creating a new `MetricsMiddleware` instance for each middleware chain,
while safely sharing the thread-safe Prometheus metrics and plugin registry.
This maintains proper metrics collection while eliminating the mutable shared
state that caused the race condition.

Original error was detected here:

```
WARNING: DATA RACE
Read at 0x00c0039c0790 by goroutine 4486:
  github.com/grafana/grafana-plugin-sdk-go/backend.(*ErrorSourceMiddleware).CallResource()
      /Users/clord/src/grafana/irm-devstack/.devenv/state/go/pkg/mod/github.com/grafana/grafana-plugin-sdk-go@v0.261.0/backend/error_source_middleware.go:93 +0x40
  github.com/grafana/grafana-plugin-sdk-go/backend.BaseHandler.CallResource()
  ...

```
2025-02-04 16:54:27 +00:00
Karl Persson
b16e290444 Auth: Remove feature toggle authAPIAccessTokenAuth (#100055)
Remove feature toggle
2025-02-04 16:31:24 +01:00
Tom Ratcliffe
bb15f24dcd Alerting: Update design of rule details tab and add updated by (#99895) 2025-02-04 16:56:17 +02:00
Victor Marin
00bcb61382 DynamicDashboards: Open edit overlay on selection if pane is collapsed (#99885)
* open edit pane on selection

* stuff

* use drawer instead for override panel options

* reverts

* closing edit pane while selection exists should also clear selection

* set width
2025-02-04 16:54:29 +02:00
Sergey Naumov
eb2f8182c0 Dashboards: Allow custom quick time ranges specified in dashboard model (#93724)
* TimeRangePicker: allow to customize quick ranges per dashboard

* TimeRangePicker: show selected custom time range using its name

* rangeutil: add tests for describeTextRange + quickRanges

* Fix up tests, and add an extra case for hidden time ranges

* Don't construct an object to find options, add findRangeInOptions util

* fix type errors detected by TypeScript

---------

Co-authored-by: joshhunt <josh@trtr.co>
2025-02-04 14:36:28 +00:00
beejeebus
cfae9d20d2 Add errorsource to InfluxDB datasource plugin fixes #1072 (#99900)
This PR adds `backend.ErrorSourceDownstream` values to all `backend.DataResponse`
values where it's certain that the error wasn't the result of the
InfluxDB datasource plugin.
2025-02-04 09:33:32 -05:00
Todd Treece
1f0ff19471 Dashboards: Fix schemaVersion test order (#100016) 2025-02-04 09:16:03 -05:00
Isabel Matwawana
4009433792 Docs: fix link text (#99932) 2025-02-04 09:06:39 -05:00
Victor Marin
2efb120737 DynamicDashboards: Fix scroll positioning when returning to dashboard (#100047)
* fix scroll positioning in new layouts editor

* refactor
2025-02-04 15:51:43 +02:00
Karl Persson
958d6e5e3a Auth: Update authlib (#100041)
Bump authlib
2025-02-04 14:36:48 +01:00
Agnès Toulet
cd7c9f8666 Share: Fix short links when root_url is different from the browser URL (#99950)
Share: Fix short links when appUrl is misconfigured
2025-02-04 14:00:55 +01:00
Ivana Huckova
6e7e389ee2 Report grpc canceled timeouts as cancelled status and not error (#99981) 2025-02-04 13:31:03 +01:00
Bogdan Matei
d06d646aa1 DashboardList: Throttle the re-renders (#99982) 2025-02-04 14:14:28 +02:00
brendamuir
5d232daf0b Adds johnny as codeowner for alerting docs (#99877)
* Adds johnny as codeowner for alerting docs

* changes maintainer
2025-02-04 13:10:57 +01:00
Bogdan Matei
c0f8d58079 Bump Scenes to 5.41.2 (#100036) 2025-02-04 13:18:37 +02:00
Alexa V
0fced84796 Dashboards: SchemaV2 - Fix saving dashboards on folder (#100037)
* Remove folder annotations not relevant to v2 api
* Add unit test for folder annotations
2025-02-04 12:57:38 +02:00
jackyin
73e3b04565 Dashboard: Playlist - Fix issue with back button (#99401)
* Playlist: Goback not work
* add unit test
* format code
2025-02-04 11:44:52 +01:00
Ashley Harrison
c94b8b78ae API client generation: Add verify-api-clients step to drone (#99987)
* add verify-api-clients step to drone

* change to check the verify step fails

* ignore conf dir

* rerun make drone

* undo change to make step fail
2025-02-04 09:13:44 +00:00
Alex Khomenko
443cb092b4 RTK APIs: Support multiple source files (#100029) 2025-02-04 10:32:29 +02:00
Stephanie Hingtgen
0fa2d182d6 K8s: Fix dashboard deletion in folders (#100023) 2025-02-04 06:38:57 +02:00
Stephanie Hingtgen
8ac9c47222 Folders: Validator: add temporary fix (#100019) 2025-02-03 17:08:15 -06:00
Jev Forsberg
88c62cd828 Chore: Manually update versions and update grafana-test-datasource to "workspace:*" (#99999)
* baldm0mma/ manually update deps and run yarn

* baldm0mma/ update version from workspace to actual version

* baldm0mma/ revert some workspaces

* baldm0mma/ update workspace

* baldm0mma/ update deps
2025-02-03 15:12:05 -07:00
Jev Forsberg
46af49f907 Chore: Update alpine build docker image (#99998)
baldm0mma/ update alpine build image
2025-02-03 15:06:29 -07:00
Pepe Cano
5fe6479a10 Alerting docs: update screenshot (modify NoData/Error state) (#99996) 2025-02-03 22:01:18 +01:00
Scott Lepper
9677f4b692 [search] fix folder sync (#99913)
[search] fix folder sync
2025-02-03 15:55:22 -05:00
Nick Richmond
29fa6dfc8d ExploreMetrics: Add toggle to enable routing to externalized Explore Metrics app plugin (#99481)
* feat: toggle for explore metrics app plugin

* chore: put app navigation settings behind feature toggle

* chore: require restart

* feat: context-driven applinks toggling

* fix: toggle ownership

* docs: note restart requirement

* refactor: prefer global feature toggle check

* chore: undo rm newlines

* fix: minimize changes

* fix: app id, `chromeless`, sidebar ordering
2025-02-03 15:46:54 -05:00
Yuri Tseretyan
ac41c19350 Alerting: Rule version history API (#99041)
* implement store method to read rule versions

* implement request handler

* declare a new endpoint

* fix fake to return correct response

* add tests

* add integration tests

* rename history to versions

* apply diff from swagger CI step

Signed-off-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>

---------

Signed-off-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
2025-02-03 13:26:18 -05:00
Andreas Christou
8a259ecafa Graphite: Ensure frames have refId set (#99911)
Ensure frames have refIDs

- Sanitise the refID
- Alias the query target with the refID
- Set the appropriate refID on the created frames
- Update tests
2025-02-03 17:43:28 +00:00
Matheus Macabu
66aec9ec1f Docs: Fix typos in Cloud Migration Assistant standalone guide (#99959)
* Docs: fix typo important admonition in Cloud Migration Assistant page

* Docs: fix typo in feature toggle name in Cloud Migration Assistant page

* Docs: fix bullet point <li> missing in Cloud Migration Assistant page
2025-02-03 17:21:34 +01:00
Matias Chomicki
6805c5283c LogsPanel: do not re-render while data is loading (#99882) 2025-02-03 16:47:26 +01:00
Yuri Tseretyan
807f94b2c7 Alerting: Remove feature toggle alertingNoNormalState (#99905) 2025-02-03 17:32:50 +02:00
Ashley Harrison
f728b2df12 API client generation: Dedupe scripts and centralise them (#99970)
dedupe scripts and centralise them
2025-02-03 15:26:23 +00:00
Victor Marin
d96c1169c2 DashboardLayouts: Multi-select elements (#99257)
* wip

* refactor to map

Co-authored-by: Sergej-Vlasov <sergej.vlasov@grafana.com>

* refactor + allow selecting any kind of elements

* rename class

* refactor + tests

* cr changes

* fix deselection on shift clicking multiselected objects

* i18n

* fix

* move logic to elementSelection

* lint fix

* unselecting last multiselected item should reopen dashboard options

---------

Co-authored-by: Sergej-Vlasov <sergej.vlasov@grafana.com>
2025-02-03 17:21:38 +02:00
Eric Leijonmarck
62aaec14b6 LBAC for datasources: Enabled by default - expression "true" (#99971)
* add expression "true"

* update gen json
2025-02-03 14:46:34 +00:00
Alexander Akhmetov
d6c1e3bb45 Alerting: Use org store to read organization IDs (#99938) 2025-02-03 15:38:16 +01:00
Joey
a18fa4af8f Tempo: Fix devenv (#99750)
Fix Tempo devenv
2025-02-03 15:14:41 +01:00
Joey
302e90b8f8 TraceView: Add class name for Explore Traces to hide span details row (#98946)
Add class name for Explore Traces to hide span details row
2025-02-03 15:09:51 +01:00
Mitch Seaman
c3a55ab8cb Docs: Correct license token renewal frequency (#99969)
Co-authored-by: Irene Rodríguez <irene.rodriguez@grafana.com>
2025-02-03 14:09:36 +00:00
Sonia Aguilar
489c5006b4 Alerting: Update irm links for incident and oncall in case new irm plugin is present (#99952)
Update irm links for incident and oncall in case new irm plugin is present
2025-02-03 15:00:32 +01:00
jackyin
6496705120 Dashboards: Remove default empty string from variable create view (#98922)
* default empty string

* optimize
2025-02-03 13:55:41 +00:00
Ashley Harrison
e0151528a4 API client generation: Update iam client (#99963)
* update generated iam client

* update API

* with meta api

* regenerate client

* with identify ref

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2025-02-03 13:40:36 +00:00
Ida Štambuk
34b2cb5e02 Features: Remove openSearchBackendFlowEnabled feature toggle (#99068) 2025-02-03 14:24:49 +01:00
Marcus Andersson
39605a93ab E2E: Adding API tests for panel edit settings (#99038)
* Updating plugin-e2e!

* Added API tests for new panel edit APIs in plugin-e2e

* Added API tests.

* rebased main.

* removed only.
2025-02-03 14:15:29 +01:00
Ashley Harrison
30bf2bcde1 API client generation: create a central getAPIBaseURL function (#99961)
* create a getAPIBaseURL function

* use base url in iam api
2025-02-03 13:05:47 +00:00
Karl Persson
c85a175212 RBAC: only query folder service when fetching parent folders (#99893)
* only query folder service when fetching parent folders
* Perform validation and inehrited scopes solvers as service instead of caller
2025-02-03 13:56:25 +01:00
Alex Khomenko
a0901456ae RTK Clients: Fix namespace filter (#99949)
* Fix namespace filter

* Update comment

* Update filter
2025-02-03 13:50:15 +02:00
Ryan McKinley
b636b81b16 K8s/IAM: Use raw handler for display (not rest.Connector) (#99898) 2025-02-03 14:24:35 +03:00
grafana-delivery-bot[bot]
2aa78139c4 Release: update changelog for 11.5.1 (#99956)
* Update changelog

* update changelog manually

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: joshhunt <josh@trtr.co>
2025-02-03 11:15:22 +00:00
Karl Persson
d16374d339 Authz: For list collect all folder permisions into items (#99955)
* For list collect all folder permisions into items
---------

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2025-02-03 12:14:28 +01:00
Andres Martinez Gotor
4cd2ebe186 Grafana Advisor: Automatically generate frontend types (#99807)
* Grafana Advisor: Frontend types

* fix bad merge
2025-02-03 11:45:17 +01:00
Laura Fernández
74e3beabd0 MultiCombobox: add CustomValue as an option (#99815) 2025-02-03 11:41:54 +01:00
Bogdan Matei
61f5f215ee Dashboards: Implement rows repeat in rows layout (#99300) 2025-02-03 11:46:47 +02:00
Ryan McKinley
8c0b812874 Provisioning: Expose dashboard config within grafana (#99947) 2025-02-03 11:44:34 +02:00
Gábor Farkas
295c0afc35 datasources: querier: adjust the query-client (#99805) 2025-02-03 09:06:18 +01:00
Alexander Akhmetov
f45265b5f7 Alerting: Read from both proto and simple DB instance stores on startup (#99855) 2025-01-31 23:34:00 +01:00
Isabel Matwawana
e03656669a Docs: Updated Reporting docs (#99665)
Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>
2025-01-31 17:08:55 -05:00
renovate[bot]
7d9896d07e Update dependency fishery to v2.2.3 (#99914)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-31 18:33:39 +00:00
renovate[bot]
e7902316a8 Update dependency @playwright/test to v1.50.1 (#99912)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-31 17:38:50 +00:00
Dan Cech
481f99b07f Docker: Use our own glibc 2.40 binaries (#99903)
* use our own glibc 2.40 binaries
2025-01-31 12:37:20 -05:00
Ashley Harrison
9693212475 API client generation: Create new IAM api client and use in query library (#99888)
* create new generated iam api client and use in query library

* update betterer

* use new createBaseQuery method

* update CODEOWNERS

* fix unit tests

* use shared type

* update comment

* fix test
2025-01-31 17:12:55 +00:00
Isabel Matwawana
a21265a7ad Docs: Fix broken link (#99907) 2025-01-31 11:25:18 -05:00
Yuri Tseretyan
0be6e1bb86 Alerting: Extra dedup stage in Grafana Alertmanager (#99825)
* add feature flags

* update alerting module

* update grafana alertmanager to configure the extra dedup stage

---------

Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>
2025-01-31 11:12:38 -05:00
renovate[bot]
d0703cfdbd Update dependency @types/swagger-ui-react to v5 (#99902)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-31 15:50:19 +00:00
Isabella Siu
a3eebd7157 Elasticsearch: Replace term size dropdown with text input (#99718) 2025-01-31 10:20:14 -05:00
renovate[bot]
3d3b781c19 Update dependency @stylistic/eslint-plugin-ts to v3 (#99897)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-31 15:16:37 +00:00
renovate[bot]
2e5f0bf77b Update typescript-eslint monorepo to v8.22.0 (#99891)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-31 15:12:33 +01:00
Karl Persson
c3599d9236 Dashboards: Use uid instead of id to determine if dashboard exists or not (#99890)
Use uid instead of id to determine if dashboard exists or not
2025-01-31 14:46:26 +01:00
Ivana Huckova
7c15d33304 Remove @grafana/experimental in the last various places (#99875)
* Remove @grafana/experimental in the last various places

* Remove experimental from yarn.lock

* Fix import order
2025-01-31 15:43:58 +02:00
Leonor Oliveira
d699f023c2 Return max depth folder reached instead of a generic error (#99804)
* Return max depth folder reached instead of a generic error

* Unit test error function

* Lint

* Update pkg/api/apierrors/folder.go

Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com>

---------

Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com>
2025-01-31 14:36:20 +01:00
renovate[bot]
9ae5552cab Update testing-library monorepo (#99889)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-31 13:30:24 +00:00
renovate[bot]
74b04a237d Update dependency yaml to v2.7.0 (#99887)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-31 15:07:05 +02:00
renovate[bot]
05f039d5ab Update dependency type-fest to v4.33.0 (#99883)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-31 12:49:10 +00:00
Alex Khomenko
f51eacef9a RTK APIs: Extract base query logic (#99800)
* RTK APIs: Extract base query function

* Add error handling

* Add return type

* Use createBaseQuery in browseDashboards

* Support custom manageError

* Export getConfigError

* Remove redundant type

* data -> body
2025-01-31 14:25:16 +02:00
renovate[bot]
111f973242 Update dependency react-zoom-pan-pinch to v3.7.0 (#99879)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-31 14:05:46 +02:00
renovate[bot]
95a19c21df Update dependency @grafana/plugin-e2e to v1.17.1 (#99876)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-31 11:45:03 +00:00
Santiago
39f212a965 Alerting: Call RLock() before reading sendAlertsTo map (#99812)
* Alerting: Call RLock() before reading sendAlertsTo map

* defer unlocking

* drive-tru fix for another lock

* less time holding the lock in SyncAndApplyConfigFromDatabase
2025-01-31 12:43:02 +01:00
Josh Hunt
abc76f8aad Chore: Change jsonMarkup.js to esm (#99269) 2025-01-31 11:03:13 +00:00
Ivana Huckova
3372720a52 Tempo, Pyroscope and tracing: Replace deprecated @grafana/experimental with @grafana/plugin-ui (#99671)
* Tempo: Replace deprecated @grafana/experimental with @grafana/plugin-ui

* Add also pyroscope and tracing features

* align version of package with main
2025-01-31 11:54:28 +01:00
renovate[bot]
71e78b49ab Update dependency stylelint to v16.14.1 (#99873)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-31 10:51:39 +00:00
ismail simsek
d062453c49 Prometheus: Don't show expand rules warning for unique rule (#99540)
* fix recording rule query hints

* don't show the hint twice in code editor

* provide testing rules
2025-01-31 11:46:38 +01:00
renovate[bot]
a2b1a85dc4 Update dependency @types/diff to v7.0.1 (#99864)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-31 11:06:38 +01:00
Tobias Skarhed
7190bfb0ca DashboardVariables: Use Combobox behind feature flag (#98261)
* Add feature toggle

* Use feature toggle

* Remove usage of renderWithCombobox
2025-01-31 11:53:13 +02:00
ismail simsek
1458f5d0fb Prometheus: Use the timerange in languageProvider when it's not provided (#99699)
use the timerange in languageProvider
2025-01-31 10:39:22 +01:00
ismail simsek
ec836f2760 Chore: Code cleaning with unit tests in promlib (#99542)
* update request tests

* remove unused functions

* add unit tests

* remove commented code

* fix unit tests
2025-01-31 10:39:08 +01:00
renovate[bot]
3b231c433f Update dependency semver to v7.7.0 (#99837)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-31 09:37:24 +00:00
Dominik Prokop
bfdd00665b Schema V2: Support v2 custom home dashboards (#99748) 2025-01-31 10:36:56 +01:00
Alexa V
bda4deb20c Dashboards - Schema V2 - Implement move dashboards using v2 api (#99664)
* Dashboards - Schema V2 - Implement move dashboards using v2 api
* Fix root folder uid not being picked by FolderPicker
2025-01-31 10:30:39 +01:00
owensmallwood
58df80e542 Unified Storage: Fix panic from log (#99850)
evt.Object can be nil, so use the key instead
2025-01-30 19:29:51 -05:00
Ryan McKinley
e3d9b6cadf K8s/Unstructured: Avoid panic in DeepCopy (#99840) 2025-01-31 00:19:09 +02:00
beejeebus
8ce8c1635f Escape database names in MSSQL datasource (#99754)
Valid MSSQL database names can contain characters like `-`, which need
to be escaped when used in queries.

This PR wraps database names in `[]`, and fixes Grafana issue #58757.
2025-01-30 15:36:45 -05:00
Scott Lepper
ce38eb3398 [search] fix dashboard list default sort (#99813)
[search] fix dashboard list default sort
2025-01-30 14:22:22 -05:00
Jacob Valdez
8e53e997a0 Docs: Moving migrate to cloud guide from website repo to OSS (#99829) 2025-01-30 12:32:31 -06:00
renovate[bot]
c8297599a9 Update dependency rollup to v4.32.1 (#99820)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-30 17:27:40 +00:00
github-actions[bot]
415628a2c6 Update make docs procedure (#99789)
Co-authored-by: grafanabot <bot@grafana.com>
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
2025-01-30 17:24:02 +00:00
Alexander Zobnin
a95005eab5 Zanzana: Disable broken OpenFGA health check (#99818)
* Zanzana: Disable broken OpenFGA health check

* simplify return

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>

---------

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2025-01-30 17:42:48 +01:00
Irene Rodríguez
3d19a778ba Remove old admonition (#99821) 2025-01-30 10:26:34 -06:00
ismail simsek
52aeae1342 Prometheus: Implement dispose method (#99782)
* implement dispose method

* use s instead of i

* add debug log
2025-01-30 16:58:18 +01:00
Ivana Huckova
f92945ac35 Update @grafana/plugin-ui to v0.10.0 (treeshake-able version) (#99809)
* Update @grafana/plugin-ui to v0.10.0 (treeshake-able version)

* Update to 0.10.1
2025-01-30 16:49:28 +01:00
renovate[bot]
9189feeaf5 Update scenes to v5.41.1 (#99811)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-30 15:46:12 +00:00
Andres Martinez Gotor
a066659e11 Frontend Sandbox: Add to statscollector (#99735) 2025-01-30 16:17:36 +01:00
Joey
64e9c38b66 Tempo: Show consistently named links for external reference types (#99008)
* Show consistently named links for external reference types

* Update betterer
2025-01-30 15:14:38 +00:00
Dominik Broj
3589d9192d chore: use IRM plugin ID instead of OnCall / Incident if it's present… (#99742)
* chore: use IRM plugin ID instead of OnCall / Incident if it's present in the stack

* minor improvements

* fix unit tests

* Add IRM plugin discovery tests

---------

Co-authored-by: Konrad Lalik <konrad.lalik@grafana.com>
2025-01-30 16:00:23 +01:00
Igor Suleymanov
b683724bec Upgrade grafana-app-sdk to 0.31.0 (#99739)
* Upgrade grafana-app-sdk to 0.31.0

What

This commit upgrades the app SDK to 0.31.0 and re-generates codegen files.
It doesn't touch alerting schemas, because those are quite old and
should be upgraded separately.

This commit slightly alters the schemas for the investigations app,
because the codegen is not happy with the current syntax, for some
reason (probably has to do with CUE upgrades in `cog`).

Why

To make sure we use up-to-date SDK version and remove the workaround for
the `defencoding=none` bug that required us to clean up generated CRD
files.

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

* Revert changes to golden file for store tests

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

---------

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
2025-01-30 16:10:42 +02:00
renovate[bot]
7e1a8cb984 Update dependency dompurify to v3.2.4 (#99799)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-30 13:55:08 +00:00
Andrej Ocenas
86a68627dd QueryLibrary: Make query library available outside of Explore (#99319) 2025-01-30 14:53:01 +01:00
Carl Bergquist
a92c8145f1 TopNav: Move news into profile menu (#99535)
* remove news icon from topnav

Signed-off-by: bergquist <carl.bergquist@gmail.com>

* TopNav: Move rss feed and kiosk action into profile menu

* Update language keys

* Update

* review fixes

* Update

* Update

---------

Signed-off-by: bergquist <carl.bergquist@gmail.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2025-01-30 14:43:26 +01:00
Gilles De Mey
6392542db4 Alerting: Fix inheritance of the timing options for policy tree (#99398) 2025-01-30 15:42:11 +02:00
Oscar Kilhed
800c9fa3e6 SchemaV2: Rows in dashboard schema v2 (#99239)
* Testing out rows in schemav2

* update schema

* loading sort of works

* descibe position in relation to row

* add row repeats by variable

* explain ts-expect-error

* Save repeats as well

* Update tests for repeat behavior of rows

* Don't add the clones of the repeated rows

* Add row support for response transformer for V2

* Add row actions

* fix panel name

* fix merge issue

* fix tests

* Implement ensureV1

* set key of GridRow

* fix lint issue

* When going from V2 to V1 rows should be assigned unique ids following max panel id

* remove old comment

* Add panel repeats in V2 -> V1 transform
2025-01-30 15:24:37 +02:00
Andres Martinez Gotor
1e3783cc11 Grafana Advisor: Add links to suggested actions (#99764)
Grafana Advisor: Add links to proposed actions
2025-01-30 13:40:37 +01:00
Ivana Huckova
f637ea225a Loki: Replace deprecated @grafana/experimental with @grafana/plugin-ui (#99642)
* Loki: Replace @grafana/experimental with @grafana/plugin-ui

* Fix imports

* Fix incorrect import
2025-01-30 13:13:29 +01:00
renovate[bot]
4aa495fd02 Update dependency centrifuge to v5.3.2 (#99797)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-30 10:49:34 +00:00
Laura Fernández
2df05505db MultiCombobox: Add Clear all button (#99668) 2025-01-30 11:44:15 +01:00
renovate[bot]
c2b44a5da1 Update dependency @swc/core to v1.10.12 (#99796)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-30 10:26:18 +00:00
Ben Sully
408e3e91a8 Live: make maximum WebSocket message size configurable (#99770)
Co-authored-by: Chris Marchbanks <chris.marchbanks@grafana.com>
2025-01-30 10:24:29 +00:00
Ryan McKinley
9d5af95565 K8s/OpenAPI: Remove /watch/ from the openapi spec (#99793) 2025-01-30 12:51:55 +03:00
renovate[bot]
e61036271a Update dependency react-select to v5.10.0 (#99775)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-30 09:47:58 +00:00
Mariell Hoversholm
0c120db84d Provisioning: Setup server and storage (#99757)
feat: setup server and storage

This simply sets up the API server and its storage for `provisioning.grafana.app`.
Features will be added eventually.
2025-01-30 08:11:50 +01:00
Ryan McKinley
3c0383f0d5 K8s/Test: Allow setting license path in test helper (#99786) 2025-01-30 08:59:00 +02:00
Stephanie Hingtgen
4b0f8d8363 K8s: Fix search when query is set (#99787) 2025-01-30 03:42:06 +02:00
Stephanie Hingtgen
2d491a9367 K8s: Implement folder search (#99781) 2025-01-29 17:44:42 -06:00
Yuri Tseretyan
7007342704 Alerting: k8s receivers api encrypt existing unencrypted secureFields on update (#99784)
* apply security patch: v11.5.x/305-202501232115.patch

commit 874ce8d12caad3742857ca86d2da7d5f81f3f825
Author: Matt Jacobson <matthew.jacobson@grafana.com>
Date:   Thu Jan 23 16:14:28 2025 -0500

    linting

commit c4b6d9194cc8b79e252e562a27a2d09a42d7a5e8
Author: Matt Jacobson <matthew.jacobson@grafana.com>
Date:   Thu Jan 23 14:56:35 2025 -0500

    CVE-2024-11741 - victorops url
2025-01-30 00:48:26 +02:00
Scott Lepper
8e9e3b8362 [search] title phrase (#99753)
[search] rename title_sort to title_phrase
2025-01-29 17:31:59 -05:00
Garret Wyman
cf177776bf Alerting: Adding color option for slack receiver (#99615) 2025-01-30 00:12:16 +02:00
Moustafa Baiou
b820fd6bef Alerting: Fix Alertmanager configuration updates (#99610)
* Alerting: Fix Alertmanager configuration updates

Alertmanager configuration updates would behave inconsistently when performing no-op updates with `mysql` as the store.

In particular this bug manifested as a failure to reload the provisioned alertmanager configuration components with no changes to the configuration itself. This would result in a 500 error with mysql store only.

The core issue is that we were relying on the number of rows affected by the update query to determine if the configuration was found in the db or not.
While this behavior works for certain sql dialects, mysql does not return the number of rows matched by the update query but rather the number of rows actually updated.

Also discovered and fixed the mismatched `xorm` tag for the `CreatedAt` field to match the actual column name in the db.

References: https://dev.mysql.com/doc/refman/8.4/en/update.html
2025-01-29 23:00:45 +02:00
Oscar Kilhed
83d4f6e868 Remove e2e benchmark (#99695) 2025-01-29 21:36:57 +01:00
Leon Sorokin
3954a1948c Data links: Remove messaging around deprecating compact Explore URLs (#99780) 2025-01-29 13:44:09 -06:00
Kristina
1795a2b4e3 Bar Gauge: Add extra padding for scrollbar (#99722)
* Add extra padding in bar gauge if scroll exists

* Add thin scroll bars, and fix test

* add comment about height calculation
2025-01-29 13:02:56 -06:00
renovate[bot]
1048e23872 Update dependency react-i18next to v15.4.0 (#99772)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-29 17:57:54 +00:00
Gilles De Mey
49bd8a608e Alerting: Fix fieldSelector encoding (#99751)
Co-authored-by: Sonia Aguilar <soniaaguilarpeiron@gmail.com>
2025-01-29 19:54:41 +02:00
Santiago
7d4895c3c9 Alerting: Use exponential backoff in the remote Alertmanager readiness check (#99756)
* Alerting: Use exponential backoff in the remote Alertmanager readiness check

* fix capitalized error

* remove unnecessary 'for'

* refactor, use time.After() instead of channel
2025-01-29 18:53:30 +01:00
renovate[bot]
243ce03b93 Update dependency @types/babel__preset-env to v7.10.0 (#99768)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-29 17:29:43 +00:00
Ashley Harrison
8f60308e73 Chore: centralise getK8sNamespace (#99767)
* create new public/app/api folder, expose getK8sNamespace

* rename to getAPINamespace
2025-01-29 17:29:16 +00:00
Scott Lepper
07601bee6f [search] title search wildcard (#99769) 2025-01-29 10:48:19 -06:00
renovate[bot]
be9a7ce908 Update dependency knip to v5.43.6 (#99766)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-29 16:12:47 +00:00
Alex Khomenko
9f4e8ee206 Query Library: Update API client (#99382)
* Add process script

* Working version

* Use new types

* Use new types

* Update client

* Tweaks

* Process multiple specs

* Remove 'any' types

* Use BASE_URL

* Update CODEOWNERS

* Fix filename

* add openapi

* update CODEOWNDER

* use JSONeq

* Use existing specs

* Filter ForAllNamespaces

* Add instructions

* Switch to tsx

* Use openapi-types

* Update src path

* Expand docs

* Update docs

* Rename script

* codeowners

* More docs

* Move openapi-types to dev deps

* Update error message

* Update doc

* Fix typo

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2025-01-29 18:05:40 +02:00
renovate[bot]
0613ed1f11 Update dependency i18next to v24.2.2 (#99763)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-29 15:47:25 +00:00
Ashley Harrison
d198fa1dd0 Chore: add lint rule prevent t import from i18next (#99761)
* also handle i18next import

* fix violations
2025-01-29 15:46:13 +00:00
Joey
7883215c68 Tempo: Support TraceQL instant metrics queries (#99732)
Support TraceQL instant metrics
2025-01-29 15:40:06 +00:00
Jean-Philippe Quéméner
90c18099a5 fix(unified-storage): return folder title in legacy search (#99762) 2025-01-29 16:38:25 +01:00
renovate[bot]
9b37337f7b Update dependency @types/webpack-env to v1.18.8 (#99759)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-29 17:14:41 +02:00
Kevin Minehart
c0600969e0 CI: update changelog generator to use compare API (#99688)
update changelog generator to use compare API
2025-01-29 09:04:12 -06:00
renovate[bot]
f39517304b Update dependency @tanstack/react-virtual to v3.11.3 (#99746)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-29 14:53:26 +00:00
Dana Axinte
b4802e7116 CloudMigrations: Update Banner on Cloud Stack (#99741)
* add message with flag

* message only in cloud
2025-01-29 14:11:01 +00:00
Laura Fernández
03f89a1925 MultiCombobox: Show placeholder when there is no options selected (#99743) 2025-01-29 15:02:53 +01:00
Mariell Hoversholm
baaff6296f Logging: Use slog adapter for go-kit/log with App SDK logger (#99740)
* feat: use slog adapter for go-kit/log

The adapter library is Apache-2.0, which is compatible with AGPL-3.0 as a dependency.

The adapter library outputs a little more info than we'd like, but rather a couple fields too many than it outputting
ERROR logs as INFO.

* feat: update dependencies

* chore: attribute ownership of dependency

* refactor: move require

* chore: make update-workspace
2025-01-29 14:59:37 +01:00
Jean-Philippe Quéméner
1087ed623f feat(unified-storage): fetch full path if needed (#99747) 2025-01-29 14:50:49 +01:00
Jack Westbrook
514da10f46 Revert "Bug: Fix broken ui components when angular is disabled" (#99730)
Revert "Bug: Fix broken ui components when angular is disabled (#78208)"

This reverts commit 1112e9006b.
2025-01-29 14:22:23 +01:00
renovate[bot]
eb52af2b14 Update dependency @grafana/plugin-e2e to v1.17.0 (#99736)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-29 13:08:19 +00:00
Torkel Ödegaard
ebe2f442bd Dashboard: Simplify handling of variables that update on time range change when used in repeats (#99432)
* Dashboard: Simplify handling of variables that update on time range change when used in repeats

* Update

* Update

* Update

* Update

* Update

* Update
2025-01-29 13:32:50 +01:00
Fayzal Ghantiwala
1444051b65 Alerting: Feature flag to fetch rules by passing down RBAC namespaces (#99738)
New feature flag
2025-01-29 12:17:44 +00:00
renovate[bot]
9b0078326a Update dependency ol-ext to v4.0.26 (#99734)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-29 11:11:23 +00:00
Sven Grossmann
336449c169 Explore: Add hide_logs_download and hide button to download logs (#99512)
* Explore: Add `disableLogsDownload` and hide button to download logs

* change copy

* Explore: Change `disableLogsDownload` to `hide_logs_download`

* change casing in frontend

* also hide from inspector

* add test

* lint
2025-01-29 11:53:52 +01:00
renovate[bot]
6ea87802ed Update dependency @types/webpack-env to v1.18.8 (#99731)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-29 10:47:15 +00:00
Jean-Philippe Quéméner
e6c2db82e0 fix(search): use the right services when unfied search is enabled for folders (#99661)
Co-authored-by: Scott Lepper <scott.lepper@gmail.com>
Co-authored-by: joshhunt <josh@trtr.co>
2025-01-29 11:45:24 +01:00
renovate[bot]
a0f27caff2 Update dependency eslint to v9.19.0 (#99702)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-29 09:46:59 +00:00
Josh Hunt
978101b7a5 ImportDashboards: Use NestedFolderPicker (#99696) 2025-01-29 09:24:41 +00:00
Alexa V
30c8ac7108 Dashboard: Schema V2 - Remove Dashboard id from spec (#99590)
* Dashboard: Schema V2 - Remove Dashboard id from spec

* Fix issue with dashboard id used in examples and serializers for schema v2

* Fix snapshot test
2025-01-29 10:13:56 +01:00
Jack Baldry
8e5a4560e8 Add workflow that comments when PRs include the add to what's new label (#99637)
Co-authored-by: Mitch Seaman <mjseaman@users.noreply.github.com>
2025-01-29 08:36:53 +00:00
Ryan McKinley
8415059290 K8s/OpenAPI: Move openapi snapshots out of the root (#99728) 2025-01-29 09:26:17 +02:00
Stephanie Hingtgen
c7f83b7311 K8s: Fix internal id setting in mode4 (#99720) 2025-01-29 08:17:17 +03:00
Stephanie Hingtgen
b06f83670e Cleanup: comment out unreachable code (#99723) 2025-01-29 07:00:49 +03:00
maicon
20f02ec12f Unistore: refactor provisioning to work with folder service (#99473) 2025-01-29 05:19:38 +02:00
Stephanie Hingtgen
6908f91428 Search fallback: prevent for now (#99725) 2025-01-29 04:57:34 +02:00
Stephanie Hingtgen
745a25ad0a Folders API: Return orgID in response (#99724) 2025-01-28 23:13:26 -03:00
Ryan McKinley
5cd1efb2d1 K8s/Dashboard: Improve legacy error handling (#99658) 2025-01-28 18:47:02 -06:00
Stephanie Hingtgen
6ba18d05be Folders: fix deletion logic that relies on the dashboard store (#99715) 2025-01-29 00:06:53 +02:00
Stephanie Hingtgen
d7070d11f6 k8s: Dashboard history: Fix created by (#99714) 2025-01-28 18:53:12 -03:00
Stephanie Hingtgen
b4b49fc587 K8s: Dashboards: use title sort field instead (#99712) 2025-01-28 23:24:55 +02:00
Isabel Matwawana
055a63873b Docs: add pan and zoom key combos (#99523) 2025-01-28 15:21:41 -05:00
Nikita Pande
046754c3c2 [TLS] Remove the hard-coded TLS ciphers in http.go to fix Pen test findings (#98749)
Remove the hard-coded TLS ciphers in http.go to fix Pen test findings

Signed-off-by: GitHub <noreply@github.com>
2025-01-28 12:57:53 -07:00
owensmallwood
f55686a0b4 Unified Storage: Adds some more traces to search and the bleve search impl (#99704)
adds some more traces to search and the bleve search impl
2025-01-28 21:27:01 +02:00
Alexander Akhmetov
a0bf9202f5 Alerting: Clear the state cache when the alert routine stops (#99681) 2025-01-28 21:15:19 +02:00
Aleksandar Petrov
97f4a164d1 [DOC] Add connection URL info to Pyroscope datasource doc (#99605)
* [DOC] Add connection URL info to Pyroscope datasource doc

* Fix wordlist violation

* Apply suggestions from code review

Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>

---------

Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
2025-01-28 15:02:53 -04:00
Stephanie Hingtgen
516bd0fd1c K8s: Folders: Fix get command (#99690) 2025-01-28 13:00:57 -06:00
owensmallwood
3ba0d8d4b5 Unified Storage: Improve observability for indexing latency (#99700)
* adds extra debug logs and a new metric for poller query latency to help us better understand watch and index latency for write events

* adds trace span to the index for handling index write events
2025-01-28 12:30:20 -06:00
renovate[bot]
dddfce2df7 Update dependency knip to v5.43.6 (#99698)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-28 18:21:45 +00:00
grafana-delivery-bot[bot]
721c2b0c7c Release: update changelog for 11.5.0 (#99652)
* Update changelog

* baldm0mma/add changelog content

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: jev forsberg <jev.forsberg@grafana.com>
2025-01-28 11:18:43 -07:00
renovate[bot]
04c84e06e5 Update dependency @types/swagger-ui-react to v4.19.0 (#99674)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-28 18:01:00 +00:00
owensmallwood
3228ae727e wires up dashboards page to be able to sort by usage stats (sprinkles) (#99479)
* wires up dashboards page to be able to sort by usage stats (sprinkles)

* dont mutate field

* use better type for field

* adds tests. Had to export some types and put the field type back to object.

* frontend asks for sort field in response if needed

* adds some unit tests for getSortOptions

* use Record instead of object

* prettier

* adds ternaries, another unit test
2025-01-28 19:36:26 +02:00
Oscar Kilhed
056b5a7b08 Dashboards: Monitor dashboard loading performance (#99629)
* WIP benchmark dashboard rendering

* Script

* Benchmark with variable and a panel

* Add one more benchmark

* Explicitely enable profiling

* Playwright tests

* update scenes

* Report measurement to faro when config set

* Let user enable metrics reporting in UI

* Fix logging

* Change how performance metrics is enabled per dashboard, now in config file only

* add benchmark run option

* Fix benchmark runs

* fix description for performance config

* remove console.log

* update codeowners

* add back crashDetection init that was lost in merge

* fix yarn.lock

* restore custom.ini

* fix import

* Make sure we have the echoSrv

* fix config type

* Try to limit changes to e2e runs

* remove benchmark

* Fix lint issue

* fix codeowners

---------

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
Co-authored-by: Sergej-Vlasov <sergej.s.vlasov@gmail.com>
2025-01-28 18:36:10 +01:00
Ivan Ortega Alba
92d5e82a33 LibraryPanels: Respect model title when adding a library panel (#99687)
* Revert "Revert "LibraryPanel: Fallback to panel title if library panel title …"

This reverts commit 6e705ee67c.

* LibraryPanels: Respect model title when adding a library panel to a dashboard

* remove debugger

---------

Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
2025-01-28 10:19:33 -07:00
Ivan Ortega Alba
abac53bd0a Revert "Revert "LibraryPanel: Fallback to panel title if library panel title is not set"" (#99678)
Revert "Revert "LibraryPanel: Fallback to panel title if library panel title …"

This reverts commit 6e705ee67c.
2025-01-28 09:53:19 -07:00
Arati R.
94a844977e Folders/K8s: Fix createdBy and updatedBy fields in response (#99569) 2025-01-28 10:46:07 -06:00
renovate[bot]
d81b1bf803 Update scenes to v5.41.0 (#99684)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-28 18:37:22 +02:00
Ashley Harrison
6e8e320ace Chore: emit event whenever the theme changes (#99672)
emit event whenever the theme changes
2025-01-28 16:00:54 +00:00
Jacob Valdez
1fb1f8846f Docs: What's new & Upgrade guide v11.5 (#99341)
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: Robby Milo <robbymilo@fastmail.com>
Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>
Co-authored-by: Isabel Matwawana <isabel.matwawana@grafana.com>
2025-01-28 09:16:42 -06:00
renovate[bot]
78848095ca Update dependency swagger-ui-react to v5.18.3 (#99669)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-28 17:01:32 +02:00
renovate[bot]
0a805a2314 Update dependency moment-timezone to v0.5.47 (#99657)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-28 16:40:21 +02:00
Mitch Seaman
fe49b6279a docs: update enterprise docs with license token renewal details (#99662) 2025-01-28 14:38:17 +00:00
Stephanie Hingtgen
0cef2b9ae7 Dashboard Versions: Make compatible with app platform (#99327) 2025-01-28 08:17:52 -06:00
Ashley Harrison
05905a5069 Chore: bracket properly to ensure name is set correctly (#99660)
bracket properly to ensure name is set
2025-01-28 16:16:36 +02:00
Ivana Huckova
058d3946b7 Zipkin: Remove frontend query running code (#99557)
* Zipkin: Remove frontend query running code

* Fix lint
2025-01-28 15:11:10 +01:00
Kristina
52a6c27d99 VizTooltip: Check useragent to perform consistently on all mobile devices (#99655)
* Add useragent check to be comprehensive

* move check outside function and add hopefully clarifying comment
2025-01-28 16:00:15 +02:00
Konrad Lalik
0bf31c14a7 Alerting: Improve default form values handling (#97564)
This PR refactors how rule form state is managed and relies less on prop drilling and removes dependency on redux store.
2025-01-28 15:49:47 +02:00
renovate[bot]
8b9d4d1358 Update dependency @types/node to v22.12.0 (#99638)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-28 13:37:10 +00:00
Josh Hunt
9d635edd0e MultiCombobox: Async options (#99469)
* remove managed isOpen state, add hook to abstract away options/async functionality

* split useOptions into new file

* refactor stories

revert combobox stories to what's in main. I screwed up that rebase

* change onChange type, clean up what calls onChange, add debounce and useLatestAsyncCall

* tests (mid trying to figure out the act stuff)

* tests

* debounce-promise doesn't work with rollup?

* just some minor code clean up

* fix type import
2025-01-28 13:36:59 +00:00
grafana-delivery-bot[bot]
af2c7a19d1 Release: update changelog for 11.4.1 (#99650)
Update changelog

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-01-28 12:29:59 +00:00
grafana-delivery-bot[bot]
b1f39f4b8b Release: update changelog for 11.3.3 (#99647)
Update changelog

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-01-28 12:06:25 +00:00
Fayzal Ghantiwala
f8e7e9e024 Alerting: Make pagination token empty if an invalid token is passed (#99644)
Reset token to empty if invalid
2025-01-28 11:54:11 +00:00
grafana-delivery-bot[bot]
1cc9f8f0c2 Release: update changelog for 11.2.6 (#99645)
Update changelog

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-01-28 11:46:25 +00:00
Gareth Dawson
ecc9b0c10c partner data sources: remove experimental imports from datasources (#99370)
* remove experimental imports from datasources

* add plugin-ui deps

* remove

* trigger workflow

* Make versions of plugin-ui fixed

* Fix import in test

---------

Co-authored-by: Ivana Huckova <ivana.huckova@gmail.com>
2025-01-28 18:44:22 +07:00
grafana-delivery-bot[bot]
d2eac460cf Release: update changelog for 11.1.11 (#99639)
Update changelog

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-01-28 11:25:01 +00:00
renovate[bot]
8e6a868178 Update dependency papaparse to v5.5.2 (#99635)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-28 10:56:34 +00:00
grafana-delivery-bot[bot]
a66857dfbe Release: update changelog for 11.0.10 (#99636)
Update changelog

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-01-28 10:54:23 +00:00
Alexander Akhmetov
a28328d764 Alerting: Call the deletion reason provider even if the rule is no longer scheduled (#99571)
Alerting: Call the deletion reason provider even if the rule is not scheduled anymore
2025-01-28 11:34:26 +01:00
renovate[bot]
f6fc39e71f Update dependency @types/webpack-env to v1.18.7 (#99633)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-28 10:30:33 +00:00
grafana-delivery-bot[bot]
58a279e109 Release: update changelog for 10.4.15 (#99634)
Update changelog

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-01-28 10:28:22 +00:00
Tobias Skarhed
8c2824cf3b MultiCombobox: Autosize (#99510)
* Add input auto resizing

* Initial auotsize

* Initial implementation

* Remove px

* Remove unused import

* Handle backspace and support the width prop

* Make sizing work with useComboboxFloat

* Remove unused expression

* Add supoport for min and max width

* Change space for clicking
2025-01-28 11:03:08 +01:00
renovate[bot]
a05f539dd2 Update dependency @types/lodash to v4.17.15 (#99632)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-28 10:02:23 +00:00
Stephanie Closson
9c7618160d Update queries-conditions.md (#99592) 2025-01-28 10:52:50 +01:00
Ivana Huckova
58a3e0ae86 Remove @grafana/experimental in @grafana/o11y-ds-frontend and @grafana/sql (#99501)
* Remove @grafana/experimental in @grafana/o11y-ds-frontend

* Remove @grafana/experimental in @grafana/sql

* Fix mock in test
2025-01-28 10:48:19 +01:00
renovate[bot]
ae0de61b92 Update dependency @types/babel__preset-env to v7.10.0 (#99611)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-28 09:39:55 +00:00
Stephanie Hingtgen
959a942b5c K8s: Dashboards: fix in folder count (#99622) 2025-01-28 10:28:12 +01:00
Stephanie Hingtgen
9949a56f3b K8s: Fix legacy stats (#99623) 2025-01-28 10:08:48 +01:00
Tom Ratcliffe
3ed138543d Chore: Fix translation imports from @grafana/ui (#99614) 2025-01-28 08:36:31 +00:00
Joey
acbdc1f415 Tempo: Add separate options groups (#99310)
* Separate options groups

* Editor row for styling
2025-01-28 08:20:23 +00:00
Ryan McKinley
4e703576b0 K8s/OpenAPI: Render openapi into a static file (#99561) 2025-01-28 10:30:53 +03:00
Stephanie Hingtgen
61c5b4a25e Library elements: remove usage of dashboard table on get (#99619) 2025-01-27 17:39:18 -06:00
owensmallwood
fd85ddf647 Unified Storage: Fix search case sensitivity (#99603)
lowercase search query when doing a text query. Doing this makes the NewWildcardQuery be case-insensitive
2025-01-27 20:39:36 +00:00
Stephanie Hingtgen
078ce6a289 Library elements: Delete orphaned connections with the dashboard service (#99612) 2025-01-27 22:37:38 +02:00
Moustafa Baiou
82f457495a Alerting: Correctly escape provisioning API exports (#99039)
When exporting contact-points, mute-timings, and notification policies in the provisioning API, we need to escape the `$` character which is used in interpolation by file provisioning.

Follow up to #97985
2025-01-27 14:59:50 -05:00
Yuri Tseretyan
d71904cb27 Alerting: Expose updated_by in rules GET APIs (#99525)
---------

Signed-off-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
2025-01-27 14:31:40 -05:00
renovate[bot]
32ae292334 Update dependency rudder-sdk-js to v2.48.44 (#99609)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-27 19:07:34 +00:00
Stephanie Hingtgen
7ebe599389 Library elements: do not error if dashboard is not found (#99608) 2025-01-27 20:35:30 +02:00
renovate[bot]
8954800d37 Update dependency react-window-infinite-loader to v1.0.10 (#99607)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-27 18:34:18 +00:00
William Assis
be8396cafa Setup legacy search based on mode (#98908) 2025-01-27 12:32:07 -06:00
renovate[bot]
060182a3ba Update dependency ol-ext to v4.0.25 (#99606)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-27 18:07:47 +00:00
Galen Kistler
5c785e6101 LogsPanel: Fix safari text selection bug (#99522)
* feat: a11y review - remove anchor wrapping LogMessage, instead style expand button focus to wrap row
2025-01-27 12:05:50 -06:00
Alexander Akhmetov
cb43f4b696 Alerting: Add compressed protobuf-based alert state storage (#99193) 2025-01-27 18:47:33 +01:00
Josh Hunt
6edd4f5a7c Combobox: Remove circular dependency caused by ComboboxOption type (#99601) 2025-01-27 19:45:09 +02:00
Stephanie Hingtgen
6e705ee67c Revert "LibraryPanel: Fallback to panel title if library panel title is not set" (#99602)
Revert "LibraryPanel: Fallback to panel title if library panel title is not s…"

This reverts commit c862aa4d68.
2025-01-27 10:31:35 -07:00
renovate[bot]
2f2c6360cd Update dependency knip to v5.43.5 (#99600)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-27 17:29:46 +00:00
renovate[bot]
b5ca30c69e Update dependency i18next to v24.2.2 (#99593)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-27 16:59:34 +00:00
Andreas Christou
30ee8b9813 Azure: Correctly set application insights resource values (#99214)
Correctly set resource values
2025-01-27 16:57:43 +00:00
Ryan McKinley
a5c14db051 Folders: Convert between unstructured and legacy (#99504) 2025-01-27 17:37:28 +01:00
renovate[bot]
b4c13defa6 Update dependency eslint-plugin-jsdoc to v50.6.3 (#99591)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-27 16:36:36 +00:00
Andreas Christou
763f0bac90 Azure: Support more complex variable interpolation (#99284)
Support more complex variable interpolation

- Update test
2025-01-27 16:21:24 +00:00
Joey
1f19fc8e0f Tempo: Limit tags and tag values (#98306)
* Limit tags and tag values API response

* Add tag limit setting in datasource

* Add docs

* Update limit options

* Update docs
2025-01-27 16:20:51 +00:00
Alex Spencer
9bdeca8d10 ExemplarMarker: Fix exemplar tooltip box shadow (#99464)
fix: exempla tooltip box shadow
2025-01-27 09:16:31 -07:00
renovate[bot]
1c66e0fe30 Update dependency centrifuge to v5.3.1 (#99577)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-27 16:08:05 +00:00
Fayzal Ghantiwala
848ef72100 Alerting: Check if pagination token is greater than or equal to (#99576)
Use goe for token comparison
2025-01-27 15:56:06 +00:00
Andreas Christou
cc09f38421 MSSQL: Correctly type UDPConnectionLimit (#99011)
* Correctly type UDPConnectionLimit

* Update tests

* Handle legacy case
2025-01-27 15:53:46 +00:00
Andreas Christou
e01d8ad5b5 Azure: Add support for custom namespace and custom metrics variable queries (#99279)
* Add custom metric namespace and metric name queries

* Fix outdated type

* Support specifying custom

- Add custom support to getMetricNamespaces
- Ensure the customNamespace is specified in getMetricNames calls

* Update data source tests

* Support custom namespace/metrics variable queries

- Add tests

* Add fields to variable editor

- Update tests
- Update docs
- Update selectors

* Remove unneeded Promise.resolve

* Add comment

* Don't mutate expected path

* Lint

* Update docs/sources/datasources/azure-monitor/template-variables/index.md

Co-authored-by: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com>

* Update docs/sources/datasources/azure-monitor/template-variables/index.md

Co-authored-by: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com>

* Update docs

* Update conditionals

* Lint

---------

Co-authored-by: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com>
2025-01-27 15:53:00 +00:00
renovate[bot]
c6ba0910b4 Update dependency @types/webpack-env to v1.18.6 (#99575)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-27 15:47:36 +00:00
Andres Martinez Gotor
b0e74cf737 Grafana Advisor: Plugin checks (#99502) 2025-01-27 16:39:46 +01:00
renovate[bot]
50b14c533c Update dependency @types/node to v22.10.10 (#99570)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-27 15:25:51 +00:00
Dominik Prokop
ae62b3817b Dashboards: Change the way dashboard not found error is handled (#98950)
* Get rid of _dashboardLoadFailed

* Get rid of dashboardNotFound meta

* Update public dashboards tests

* Fix DashboardPage tests

* DashboardPageProxy tests

* DashboardScenePageStateManager test fix

* Beterer

* Fix merge

* Nits

* Fix test

* remove debugger

* Update get folder to throw

* translate error title

* Update public/app/features/apiserver/types.ts

Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>

* Update public/app/features/dashboard/services/DashboardLoaderSrv.ts

Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>

* Update public/app/features/dashboard/services/DashboardLoaderSrv.ts

Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>

* Update public/app/features/dashboard/services/DashboardLoaderSrv.ts

Co-authored-by: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com>

* Betterer

* Update test cases

* More test updates

* More translations

---------

Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>
Co-authored-by: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com>
2025-01-27 15:54:10 +01:00
John Naizer
571f20676d Azure: Bump grafana-azure-sdk-go to 2.1.6 (#99524)
* added changes for rebase

* ran go mod tidy and ran a build

* ran a build

* Update docs/sources/setup-grafana/configure-grafana/_index.md

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>

* Update docs/sources/setup-grafana/configure-grafana/_index.md

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>

* Update docs/sources/setup-grafana/configure-grafana/_index.md

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>

* updated go.work.sum to upstream

* added newline to match upstream

* added more specificity in documentation

* bump grafana-azure-sdk-go to update package for currentuser auth support

---------

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
2025-01-27 14:50:31 +00:00
Georges Chaudy
7720f0b64e folder: allow standalone folder apiserver (#99508)
* add standalone folders

* add validate

* fix auth
2025-01-27 15:50:06 +01:00
renovate[bot]
a5916116b1 Update dependency @tanstack/react-virtual to v3.11.3 (#99567)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-27 14:28:12 +00:00
Stephanie Hingtgen
dde199f684 Unistore: use object from legacy in mode2 (#99533) 2025-01-27 08:11:31 -06:00
Konrad Lalik
c5ff5d89df Alerting: Add GMA action buttons to the new list view (#98449)
* Add GMA action buttons based on the ruler rule definition

* Improve imports

* Remove rulesSource from Grafana group identifier

* Improve ruler loader error handling

* Clean imports, add details page link

* Remove unnecessary property from the API:

* Change Prometheus page size in the FilterView

* Fix lint errors and tests

* Revert filtered items page size

* Fix cache invalidation for RTKQ ruler requests

* Fix tags ids

* Naming improvements

* Fix lint errors, use util function for pause checking

* Alerting: Add ruleGroupIdentifierV2toV1 function to PR 98449 (#99326)

* Move params validation to the rulerUrlBuilder, tidy up code

---------

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2025-01-27 15:08:33 +01:00
Isabella Siu
49f8359ce5 Elasticsearch: Fix adhoc filters with number fields (#99514) 2025-01-27 09:04:48 -05:00
renovate[bot]
53cc790180 Update dependency @swc/core to v1.10.11 (#99565)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-27 13:59:18 +00:00
Leonor Oliveira
abe2a5370d Use dashboards service to query for dashboard uid when getting library elements (#99369) 2025-01-27 14:42:57 +01:00
renovate[bot]
e94c9f733b Update dependency @reduxjs/toolkit to v2.5.1 (#99563)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-27 13:30:24 +00:00
Arati R.
a2097fbc2f Folders: Add user service to folder service implementation (#99518)
Add user service to folder service implementation
2025-01-27 14:29:47 +01:00
Haris Rozajac
de1df2f4e9 Dashboard: Add ScopeMeta to DashboardModel (#99475) 2025-01-27 06:28:51 -07:00
Karl Persson
d5d8abcd64 Authn: Use authenticator for inproc (#99550)
Use generic authenticator for inproc
2025-01-27 14:28:46 +01:00
Alexa V
8f3fd8f91d Schema v2: Write Path Implement saveDashboard in v2 client API (#98263)
Create new function for save dashboards written in schema v2 and using the v2 api from k8s
2025-01-27 14:14:19 +01:00
renovate[bot]
ead8236cec Update babel monorepo to v7.26.7 (#99558)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-27 13:05:11 +00:00
Scott Lepper
629b20700c [search] mimic sql search (#99526) 2025-01-27 08:03:39 -05:00
Erik Sundell
394d081df2 Selectors: Add selectors for alert rule steps (#99553)
* add selectors for alert rule steps

* refactor alert rule tests
2025-01-27 13:57:31 +01:00
renovate[bot]
103a8f0793 Update dependency @grafana/plugin-e2e to v1.16.2 (#99492)
* Update dependency @grafana/plugin-e2e to v1.16.1

* bump plugin-e2e

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
2025-01-27 12:44:19 +01:00
Alexander Akhmetov
12bda63871 Alerting: Optional function to find the rule deletion reason (#99422) 2025-01-27 11:35:52 +01:00
Shay Molcho
84da64462e Added missing period for consistency and readability (#99549) 2025-01-27 05:20:24 -05:00
Dominik Prokop
8e078315f0 Schema v2: Reason about new dashboard based on UID (#98879)
* Schema v2: Reason about new dashboard based on UID

* Fix test

* Alerting: respect isNew dashboard for legacy and new arch

* Translate untranslated strings

* Unify is new checks

* PanelInspectDrawer update

* typo fix

* on close test for panel inspect drawer

* Update public/app/features/alerting/unified/PanelAlertTabContent.tsx
2025-01-27 11:18:06 +01:00
Leonor Oliveira
0003efa285 Library Panels: Remove dashboards table dependency when getting all library panels (#99160)
* Remove dashboards table dependency when getting all library panels
* Filter library elements a user can see using the folder service
* Stop using folder name as UID in get all elements tests
* Set actual folder name not UID when getting all elements
* Stop selecting folder name in the get all elements sql query
* Introduce a library elements param selector without where clause
* Include empty string as general folder UID when getting all library elements

---------

Co-authored-by: suntala <arati.rana@grafana.com>
2025-01-27 10:51:41 +01:00
Misi
25bb210ca3 Auth: Store array settings from the config UI in JSON array format (#99454)
* Store array settings in JSON array format

* Align tests
2025-01-26 10:08:07 -05:00
Sven Grossmann
154a57cd30 Explore Metrics: Add panel menu with "Explore" and "Investigations" options (#98900)
* Explore Metrics: Add panel menu with "Explore" and "Investigations" features

* Explore Metrics: Get better explore link

* hide menu in metricSelect

* Update public/app/features/trails/Breakdown/LabelBreakdownScene.tsx

Co-authored-by: Nick Richmond <5732000+NWRichmond@users.noreply.github.com>

* Update public/app/features/trails/MetricSelect/MetricSelectScene.tsx

Co-authored-by: Nick Richmond <5732000+NWRichmond@users.noreply.github.com>

* fix: formatting

---------

Co-authored-by: Nick Richmond <5732000+NWRichmond@users.noreply.github.com>
Co-authored-by: Nick Richmond <nick.richmond@grafana.com>
2025-01-24 22:51:04 +02:00
Alex Spencer
35a581a2ba GroupingToMatrix: Type fix to resolve localeCompare error (#98710)
* draft: coerce types to string to prevent localCompare bug

* chore: update with comment for draft

* chore: cleanup and change fix

* fix: instantiate compare outside of functions scope

* chore: update tests!

* fix: make the linter happy again

* fix: remove unnecessary loop to generate array

* chore: revert forEach to for loops, other changes also

* chore: reduce diff

* chore: one more revert

---------

Co-authored-by: drew08t <drew08@gmail.com>
2025-01-24 13:45:20 -07:00
Kristina
d409853683 StatusHistory: Add pagination option (#99517)
* first pass

* Add to docs

* Move pagination hook and styles to a shared util

* Update docs/sources/panels-visualizations/visualizations/status-history/index.md

Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>

---------

Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>
2025-01-24 21:52:04 +02:00
Yuri Tseretyan
af663dadc7 Alerting: Refactor integration tests (#99519)
---------

Signed-off-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
2025-01-24 14:49:05 -05:00
Adam Yeats
4570f7319d Add E2E smoke tests for Jaeger, PostgreSQL, Zipkin (#99515) 2025-01-24 20:21:41 +01:00
Yuri Tseretyan
92d6762a3a Alerting: Store information about user that created\updated alert rule (#99395)
* introduce new fields created_by in rule tables
* update domain model and compat layer to support UpdatedBy
* add alert rule generator mutators for UpdatedBy
* ignore UpdatedBy in diff and hash calculation
* Add user context to alert rule insert/update operations
  Updated InsertAlertRules and UpdateAlertRules methods to accept a user context parameter. This change ensures auditability and better tracking of user actions when creating or updating alert rules. Adjusted all relevant calls and interfaces to pass the user context accordingly.

* set UpdatedBy in PreSave because this is where Updated is set
* Use nil userID for system-initiated updates
This ensures differentiation between system and user-initiated changes for better traceability and clarity in update origins.

---------

Signed-off-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
2025-01-24 12:09:17 -05:00
lean.dev
b3209b1e01 CloudMigrations: Remove onPremToCloudMigrationsAuthApiMig feature flag (#99368) 2025-01-24 13:53:58 -03:00
Sonia Aguilar
63a89afe00 Alerting: Fix silence drawer being re-rendered when the alert list is refreshed (#99468)
* Fix silence drawer being re-rendered when the alert list is refreshed

* remove unnecessary formValues usage as prop

* remove AlertmanagerProvider in RuleActionsButtonsV2
2025-01-24 17:03:58 +01:00
Sonia Aguilar
888965023c Alerting: Fix getting targets in dag when using classic condition (#99503)
* fix getting targets in dag when using classic condition

* remove query fingerprinting
the DAG function is probably fast enough and the fingerprinting function is too complex to make it work for all expression types

---------

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2025-01-24 17:45:46 +02:00
Santiago
361312bbd7 Alerting: Expect 406s from the remote Alertmanager during the readiness check (#99507)
* Alerting: Expect 406s from the remote Alertmanager during the readiness check

* make it clear in the warning logs that we'll attempt to send the confgiuration/state without comparing in case of error pulling the current state/config
2025-01-24 16:26:57 +01:00
Stephanie Hingtgen
6284dd61ae K8s: Fix get dashboard by plugin id (#99509) 2025-01-24 15:26:42 +00:00
Sofia Papagiannaki
d192a44469 Plugins: Modify interface for plugin validations to allow taking PDC into account (#96089)
* Request interceptor: Do not block PDC

* Apply change after feedback received

* Add test

* Check if secure socks proxy configured for the instance

* Apply suggestions from code review

* Add dedicated service for datasource request URL validation (#99179)

---------

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2025-01-24 17:01:46 +02:00
Ieva
33a53d170b AuthZ service: Add metrics (#99007)
* add metrics for authZ MT service

* remove metrics that are already tracked by the GRPC server metrics

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>

* undo unneeded change

* test fix

---------

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2025-01-24 14:03:23 +00:00
Misi
437b7a565d Auth: Add access token to in-proc communication and ServiceIdentity (#98926)
Use fake access token for in-proc grpc and add ServiceIdentity 
---------

Co-authored-by: gamab <gabriel.mabille@grafana.com>
Co-authored-by: Karl Persson <23356117+kalleep@users.noreply.github.com>
2025-01-24 14:03:23 +01:00
John Naizer
eb2d276a42 OAuth: Add support for new user identity flags for grafana-azure-sdk-go (#98703)
* added changes for rebase

* ran go mod tidy and ran a build

* ran a build

* Update docs/sources/setup-grafana/configure-grafana/_index.md

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>

* Update docs/sources/setup-grafana/configure-grafana/_index.md

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>

* Update docs/sources/setup-grafana/configure-grafana/_index.md

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>

* updated go.work.sum to upstream

* added newline to match upstream

* added more specificity in documentation

---------

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
2025-01-24 12:48:27 +00:00
Gareth Dawson
33d82c43df Jaeger: run health check through backend (#99322)
run health check through backend
2025-01-24 19:37:36 +07:00
Ivana Huckova
e3ba96113c @grafana/plugin-ui: use fixed version of package (#99500)
@grafana/plugin-ui: use set version of package
2025-01-24 13:35:55 +01:00
Tobias Skarhed
a9f62953df Combobox: Add fuzzy search (#99359)
* Add initial fuzzy match

* Remove unused import

* Fuzzy search for Multi

* Remove old filter function

* Restore changes to Multi while waiting for async

* Add non ascii support and memoize stringified version

* updates

* Add tests

* Add tests for real this time

---------

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2025-01-24 13:31:55 +01:00
Ivana Huckova
2dfb796f21 Prometheus package: Replace deprecated @grafana/experimental with @grafana/plugin-ui and @grafana/llm (#99385)
* Prometheus package: Replace deprecated @grafana/experimental with @grafana/plugin-ui and @grafana/llm

* Fix @grafana/llm mock in test

* Keep version exact

* Keep version exact

* Update lock
2025-01-24 12:46:31 +01:00
Alex Bikfalvi
b07a39bb46 docs: Fixes broken link in data source LBAC (#99496)
Co-authored-by: Irene Rodríguez <irene.rodriguez@grafana.com>
2025-01-24 11:28:15 +00:00
Stephanie Hingtgen
c787239252 Folder guardian: fail on empty uid (#99465) 2025-01-24 11:26:05 +01:00
Josh Hunt
7cb6845d44 Combobox: refactor stories (#99482)
refactor stories
2025-01-24 09:57:20 +00:00
Josh Hunt
df024793d8 GrafanaUI: Fix error handling from rejected promises in Combobox (#99478)
fix error handling not actually catching rejected promises from options fn
2025-01-24 09:55:49 +00:00
renovate[bot]
5da15ccdc4 Update scenes to v5.38.0 (#99470)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-24 09:37:35 +00:00
Tom Ratcliffe
8c2a74bd74 Chore: Add vscode ESLint debug target (#98277) 2025-01-24 09:34:32 +00:00
Gabriel MABILLE
a9f0e15778 AuthZ: Change cache interface (#99058)
* Authz: Switch to remotecache

* Todos

* lint

* lint test

* test readibility

* Remove ttls

* implement a cache wrap

* Rm unused func

* Comment

* Update workspace:

* Use cache

* Fix comment
2025-01-24 09:51:39 +01:00
Stephanie Hingtgen
6a205af5fe K8s: Fix GetDashboards (#99484) 2025-01-24 00:37:15 +02:00
Alex Spencer
af640e2e50 PanelDataPane: Render bottom border on tabs bar (#99471)
fix: render bottom border on tabs bar
2025-01-23 14:37:11 -07:00
Ezequiel Victorero
3a94057ec8 PublicDashboards: Delete on folder deletion (#99040) 2025-01-23 17:23:59 -03:00
Kristina
fdbac6fb54 State Timeline / Status History / Heatmap: Show vertical lines for regional annotations (#99480)
* show vertical annotation lines when canvasRegionRendering is not true

* simplify

---------

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2025-01-23 22:20:40 +02:00
Galen Kistler
be40f531e6 Loki: Add fetchDetectedFields to LanguageProvider (#99394)
* feat: add fetchDetectedFields to loki LanguageProvider
2025-01-23 12:56:37 -06:00
Adela Almasan
572be19f76 DataLinks: Add one-click option (#98563)
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2025-01-23 12:47:42 -06:00
Kristina
e9d9b15295 StateTimeline / StatusHistory: Add axis visibility and width controls (#98548)
* Allow setting the y axis width

* Add to docs

* Add to status history as well

* Add to status history docs and schema

* Change config to come from generic axis builder

* keep axis

* Change overridden label

* Update docs/sources/panels-visualizations/visualizations/status-history/index.md

Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>

* Update docs/sources/panels-visualizations/visualizations/state-timeline/index.md

Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>

* Remove the category/label override

* Move axis to its own section in docs as well

* clean

* rename to addAxisWidth

* Apply suggestions from code review

Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>

* Move sections to match UI order

* Update docs/sources/shared/visualizations/axis-options-all.md

Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>

* Change other axis options doc to be consistent.

* Fix linter

* add AxisPlacement

* Add new placement option to docs

* change some wording

* Apply suggestions from code review

Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>

---------

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>
2025-01-23 12:21:24 -06:00
renovate[bot]
d24e7c126d Update dependency yaml to v2.7.0 (#99466)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-23 17:21:11 +00:00
ismail simsek
6b227bb374 Prometheus: Handle non-json errors in a better way (#99342)
* handle json errors in a better way

* update comments

* update unit tests

* Update pkg/promlib/converter/prom.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/promlib/querydata/response_test.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/promlib/querydata/response_test.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/promlib/querydata/response_test.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* update import

---------

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2025-01-23 18:05:23 +01:00
renovate[bot]
75e7236687 Update dependency type-fest to v4.33.0 (#99463)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-23 16:41:27 +00:00
Todd Treece
a4ef1f76e4 Dashboards: Backend schema version migration (#99392) 2025-01-23 11:40:22 -05:00
Stephanie Hingtgen
192a81d07f Folders: Fix guardian to use folder service (#99339) 2025-01-23 10:30:14 -06:00
renovate[bot]
59b246dbea Update dependency stylelint to v16.13.2 (#99455)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-23 16:10:59 +00:00
Juan Cabanas
ef3a53f85c Share: Add tracking to invite user button (#99376) 2025-01-23 13:06:48 -03:00
ismail simsek
ec9f59fe9e Chore: Bump promlib to v.0.0.8 (#99458)
* bump promlib

* make update-workspace
2025-01-23 18:06:14 +02:00
Andres Martinez Gotor
3993d691f4 Advisor: Implement authorizer (#99440) 2025-01-23 18:00:02 +02:00
Josh Hunt
a540c2fe7c MultiCombobox: Refactor open state (#99453)
* Make downshift useCombobox own the isOpen state again

* oopsie, removed my console logs
2025-01-23 15:31:34 +00:00
Andres Martinez Gotor
b066a63131 Grafana Advisor: Datasource checks (#99313) 2025-01-23 16:19:50 +01:00
renovate[bot]
7d2eb83cbd Update dependency @playwright/test to v1.50.0 (#99452)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-23 15:11:05 +00:00
Gabriel MABILLE
05015a57b3 Chore: Upgrade authlib (#99447) 2025-01-23 15:52:03 +01:00
Tobias Skarhed
5ca24fde02 AutoSizeInput: Improve performance when typing (#99443)
* AutoSizeInput: Fix performance issue

* Add comments

* Fix a little oopsie
2025-01-23 16:48:06 +02:00
renovate[bot]
f6202f59d4 Update dependency rollup to v4.31.0 (#99449)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-23 14:38:27 +00:00
Ryan McKinley
a037c6f344 K8s/Folders: Remove kubernetesFolders flag and full path metadata (#99256)
* remove full path

* remove more

* remove KubernetesFolders tests

* remove feature toggles

* remove feature toggles

* skip permissions test

* skip permissions test

---------

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
2025-01-23 17:25:03 +03:00
renovate[bot]
d39e57e836 Update dependency react-i18next to v15.4.0 (#99444)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-23 13:42:29 +00:00
Stephanie Hingtgen
89dd54a474 Folder: delete from folder table after children (#99399)
Co-authored-by: maicon <maiconscosta@gmail.com>
2025-01-23 07:36:07 -06:00
Sonia Aguilar
2716db4270 Alerting: Use stack_id instead of id in cloud failures panel in the Insights page (#99424)
* Use stack_id instead of id in cloud failures panel in the insights page

* update all the wrong id to stack_id
2025-01-23 14:13:29 +01:00
Andreas Christou
4e740d8410 GCM: Time-range fix (#98455)
* Include timeRange on all query executors

* Ensure queries run against query specific time range

* Fix lint

* Improve safety of annotations queries
2025-01-23 14:57:00 +02:00
renovate[bot]
e110338dce Update dependency react-highlight-words to v0.21.0 (#99442)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-23 14:51:31 +02:00
renovate[bot]
c62bc501d3 Update dependency @types/node to v22.10.9 (#99413)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-23 12:33:13 +00:00
Karl Persson
b79f1b2a29 AuzerAD: Handle empty client_authentication case (#99437)
AuzerAD: Require client secret when client_authentication is set to empty string
2025-01-23 13:04:51 +01:00
Karl Persson
b0347792cc Zazana: Fix verb to relation mapping (#99409) 2025-01-23 13:04:41 +01:00
Ivan Ortega Alba
83bbdbf8b6 LibraryPanel: Use id and title from panel model (#99281) 2025-01-23 13:57:45 +02:00
Anton Engelhardt
750027d0a7 fix(docs): add team call returns uid (#99425)
Co-authored-by: Irene Rodríguez <irene.rodriguez@grafana.com>
2025-01-23 12:03:56 +01:00
Ryan McKinley
c4c934e0bd SQL/Storage: Remove SkipDataMigration flag (#99404) 2025-01-23 12:34:48 +02:00
Jack Baldry
fc7db91bf1 Use tags for documentation-ci actions (#99419) 2025-01-23 10:26:37 +00:00
Ieva
723fa7ddf9 MT AuthZ: Resolve renderer permissions in MT authZ service (#99362)
* resolve renderer permissions in MT authZ service

* also include DS read perms

* fix tests and linting
2025-01-23 10:21:43 +00:00
Mariell Hoversholm
4fb7b47971 Trivy: Document Vulnerability Observability (#99414)
We use Vulnerability Observability for Docker images. The current comments say we simply don't scan them at all, so
let's make it clear for future readers that we do, in fact, scan Docker images, too.
2025-01-23 11:02:23 +01:00
Nick Botticelli
d476b65d34 Docs: Fix chmod command for LetsEncrypt cert/key file access (#98354)
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: Irene Rodríguez <irene.rodriguez@grafana.com>
2025-01-23 10:46:32 +01:00
Mariell Hoversholm
25447ea93a Fix: Update yarn.lock so CI can pass again (#99416)
Chore: Update yarn.lock

`yarn install && yarn build`
2025-01-23 10:38:43 +01:00
renovate[bot]
db3dcd4f7d Update dependency knip to v5.43.1 (#99381)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-23 09:50:25 +01:00
Ivan Ortega Alba
c862aa4d68 LibraryPanel: Fallback to panel title if library panel title is not set (#99377) 2025-01-23 09:46:25 +01:00
Karl Persson
d740f9fc60 Authz: Simplify mapper and only check folders if its supported (#99357)
* Simplify mapper and only check folders if its supported
2025-01-23 09:23:00 +01:00
Mitch Seaman
36fadf19d1 Docs: add user de-duplication description, update usage billing instructions (#99333)
Co-authored-by: Irene Rodríguez <irene.rodriguez@grafana.com>
2025-01-23 08:33:26 +01:00
Ida Štambuk
dfc565db8d Datasources: Replace deprecated @grafana/experimental with @grafana/plugin-ui in Cloudwatch and Elasticsearch (#99374) 2025-01-23 03:00:30 +01:00
Brendan O'Handley
1a634b0539 Explore metrics: Add metadata heuristic for native histograms (#99348) 2025-01-22 18:09:03 -06:00
Brendan O'Handley
887e9fb5b5 Explore metrics: fix flexGrow issue with native histograms banner (#99346) 2025-01-22 18:07:51 -06:00
Ryan McKinley
7564ce8ce1 Chore: update feature toggle git stats (#99390) 2025-01-22 14:48:51 -05:00
maicon
8de4b64047 Unistore: get folder by title (#99391)
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
2025-01-22 16:47:46 -03:00
Haris Rozajac
1c8a7d8872 Dashboard Schema V2: Remove type assertions and anys from schemav2 code (#99222)
* Remove type assertions and anys from schemav2 code

* Handle type conversion

* fix test

* Filter undefined
2025-01-22 09:45:49 -07:00
Alex Spencer
29d9d8cf51 GroupingToMatrix: Defensively guard against null column name (#99286)
* bugfix: defensive guard against null columnName

* fix: per suggestion limit diff and revert alphabetization of properties

* test: add test for null case

* chore: remove it.only

* test: convert to inline snapshot
2025-01-22 09:37:21 -07:00
Haris Rozajac
a0e7569e4f Dashboard Schema V2: ResponseTransformers: Transform layout, panels, annotations and variables when ensuring v1 (#99050)
* wip

* Fix annotationV1

* variables

* tests

* Fix query variable

* Don't need extra chaining arg in maxPerRow

* Logic for libary panels; tests for variables and library panels

* lint
2025-01-22 08:56:20 -07:00
Dominik Prokop
daced46d27 Schema v2: Remove schemaVersion property (#99375)
* Schema v2: Remove schemaVersion property

* ah snap
2025-01-22 16:52:34 +01:00
ismail simsek
88ab29f6ba Explore Metrics: Open queries that have utf8 labels in explore properly (#99117)
* open queries that have utf8 labels in explore properly

* remove unnecessary line

* Revert "open queries that have utf8 labels in explore properly"

This reverts commit 85b81c96

* remove quoting

* support open in explore
2025-01-22 16:41:40 +01:00
renovate[bot]
974cec2936 Update dependency fs-extra to v11.3.0 (#99378)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-22 17:05:55 +02:00
renovate[bot]
a05bb05e60 Update dependency eslint-plugin-jest to v28.11.0 (#99365)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-22 14:44:52 +00:00
Andres Martinez Gotor
003f0e5918 Plugins: Expose function to retrieve gcom info (#99372) 2025-01-22 16:41:34 +02:00
Ivana Huckova
23f495d4cd Big tent data sources: Replace deprecated @grafana/experimental with @grafana/plugin-ui (#99331)
* Zipkin: Replace deprecated @grafana/experimental with @grafana/plugin-ui

* Prometheus: Replace deprecated @grafana/experimental with @grafana/plugin-ui

* Mysql: Replace deprecated @grafana/experimental with @grafana/plugin-ui

* Jaeger: Replace deprecated @grafana/experimental with @grafana/plugin-ui

* Postgresql: Replace deprecated @grafana/experimental with @grafana/plugin-ui

* Brin experimental back to main package.json - accidentally removed

* Fix order of imports
2025-01-22 15:18:41 +01:00
Bogdan Matei
d2d6dd2e5f Dashboards: Prevent rows nesting (#99246) 2025-01-22 15:57:45 +02:00
Dominik Prokop
51b4ac50aa Panel inspect: Fix inspect keyboard shortcut when grafana served from subpath (#99366)
* Panel inspect: Fix inspect keyboard shortcut when grafana served from a subpath

* Add e2e test
2025-01-22 13:25:10 +01:00
Sven Grossmann
5b8e6f8fa8 Explore: Prevent hidden queries from being run as supplementary query (#99356)
fix(loki/elasticsearch): prevent hidden queries from being run as supplementary query
2025-01-22 13:13:57 +01:00
Ida Štambuk
149bc74191 ElasticSearch: Parse histogram interval as float instead int (#99270) 2025-01-22 12:51:24 +01:00
owensmallwood
dd483fc17f Unified Storage: Search permissions put behind feature flag (#99340)
* add feature flag

* puts search permission filtering behind a feature flag

* fixes issue with doc match id. When the match is for an in-memory index, the internal id is a string (this is what we expected). However, when its a file-based index, the internal id is a binary encoded int64 that point to something internally. So to get the id, we need to use ExternalID() instead of relying on the indexInternalID to be the correct format.

* adds debug log

* update comment

* formatting
2025-01-22 05:38:37 -06:00
Torkel Ödegaard
5b5831ae34 Dashboard: Simplify repeating logic and panel menu interaction (#99352)
* Dashboard: Simplify repeating logic and panel menu interaction

* Update

* Remove unused behavior
2025-01-22 12:25:04 +01:00
Ryan McKinley
9d30911107 SQL/Storage: Use xorm code migration for DeletionMarker (#99353) 2025-01-22 14:07:08 +03:00
renovate[bot]
3ae6e09fee Update scenes to v5.37.1 (#99364)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-22 11:01:37 +00:00
dependabot[bot]
2dfa0abfbe Bump undici from 6.19.8 to 6.21.1 (#99345)
Bumps [undici](https://github.com/nodejs/undici) from 6.19.8 to 6.21.1.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v6.19.8...v6.21.1)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-22 11:59:57 +01:00
Sam Jewell
97db8b19c7 [Prometheus]: Mark ALERTS synthetic metric as a gauge (#99328)
Mark ALERTS synthetic metric as a gauge

It's not a counter. It can go down in value, but counters cannot
2025-01-22 10:50:33 +00:00
renovate[bot]
4b8e6b3401 Update dependency @grafana/plugin-e2e to v1.16.0 (#99358)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-22 10:39:10 +00:00
antonio
88d5ae8153 docs>alert-rules>templates:example-fix (#99355)
* docs>alert-rules>templates:example-fix

* second-fix

* fixed 2 other label templates
2025-01-22 11:01:11 +01:00
renovate[bot]
5791115b0a Update dependency centrifuge to v5.3.0 (#99337)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-22 09:41:11 +00:00
maicon
28ad61ff6c Unistore: Get Folder By ID (#99131)
* Unistore: Get Folder By ID

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>

---------

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
2025-01-22 01:45:59 -03:00
Matthew Jacobson
20d25c6ad9 Alerting: Use rule uid in silenceURL template instead of alertname and folder (#99221)
* Update grafana/alerting to a5e8136407d4

Includes:
- Alerting: Use rule uid in silenceURL template instead of alertname and folder (#266)

* Fix tests
2025-01-21 18:11:22 -05:00
Dave Henderson
f1e9c5b1ef chore: Use non-zero version to reference github.com/grafana/grafana Go module (#99343)
Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
2025-01-21 23:59:22 +02:00
Todd Treece
2622449718 Dashboards: Use dashboard service in access control (#99053) 2025-01-21 22:57:43 +02:00
maicon
45e2f95a41 Unistore: Avoid circular dependency when injecting restcfgprovider into FolderSvc (#99295)
* Avoid circular dependency when getting a restCfgProvider for Folder Svc

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>

---------

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
2025-01-21 17:42:38 -03:00
Leon Sorokin
1c858caec3 Transformations: Use FrameMultiSelectionEditor in Filter data by refId (#97212)
Co-authored-by: Sergej-Vlasov <sergej.s.vlasov@gmail.com>
2025-01-21 13:36:34 -06:00
Leon Sorokin
a03f897cd5 Table: Fix viz suggestions (#99335) 2025-01-21 13:25:33 -06:00
Matias Chomicki
dccca0729f Logs Volume: Do not throw when fields are missing (#99318)
* Logs Volume: Do not throw when fields are missing

* Add removed line back

* Prevent permanent mutations

* Decrease nesting

* Move conditional up

* Update public/app/features/logs/utils.ts

Co-authored-by: Galen Kistler <109082771+gtk-grafana@users.noreply.github.com>

* Use dataframe length and remove from function

* Use getFieldDisplayName

* Keep original dependency array

* Keep original dependency array

---------

Co-authored-by: Galen Kistler <109082771+gtk-grafana@users.noreply.github.com>
2025-01-21 20:02:07 +01:00
renovate[bot]
ad30ca2ccd Update dependency @react-types/shared to v3.27.0 (#99332)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-21 17:54:06 +00:00
Syerikjan Kh
97d8f68b70 Feat: Data source connections tab in plugin detail page (#99049)
* feat: datasource connections tab in plugin detail page

* test: no ds defined test added

* feat: configure feature toggle

* chore: i18n extract

* test: added unit tests for page and list
2025-01-21 12:39:48 -05:00
Bogdan Matei
b11d3bc045 Dashboards: Prevent panel selection on drag and items click (#99190) 2025-01-21 19:26:06 +02:00
Ashley Harrison
2982d95a74 Chore: Convert query library to use generated RTK query apis (#99314)
* add generate script and endpoints.gen.ts

* temp state with delete working

* list + save working

* edit working

* starting to clean up

* fix remaining type errors

* remove withNamespace function

* fix richhistory

* clean up some types

* extract query limit to endpoint definition

* extract namespace logic into common util

* update CODEOWNERS

* move script to be nearer generated endpoints

* remove nonexistent script from CODEOWNERS
2025-01-21 17:25:45 +00:00
renovate[bot]
bd84fdad51 Update dependency @swc/core to v1.10.9 (#99330)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-21 16:37:29 +00:00
Ryan McKinley
3bc9f10bb3 Dashboards/SQL: Improve SQL query behavior (#99253)
* update legacy dashboard SQL

* merge main

* trim message
2025-01-21 19:35:33 +03:00
Victor Marin
eaca8e501f DashboardScenes: Fix issue where timezone was not considered in relative time override (#99316)
* Fix issue where timezone was not considered in relative time override

* fix
2025-01-21 18:09:23 +02:00
renovate[bot]
5532d7007c Update dependency @grafana/plugin-e2e to v1.15.0 (#99320)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-21 16:01:21 +00:00
ismail simsek
12ae2a520c Explore Metrics: Remove overview tab in metric select view (#97118)
* introduce the exploreMetricsRemoveOverviewTab feature toggle

* handle actionView equal to overview in url

* set description in selected metric scene

* fix import

* ExploreMetrics: Disable the Overview tab by default (#98988)

feat: disable overview tab by default

* fix: remove unnecessary feature toggle

* chore: remove overview

* make i18n-extract

---------

Co-authored-by: Nick Richmond <5732000+NWRichmond@users.noreply.github.com>
Co-authored-by: Nick Richmond <nick.richmond@grafana.com>
2025-01-21 16:51:02 +01:00
owensmallwood
6f12b8e3a4 Unified Storage: Add more debug logs to permission filtering (#99325)
add more debug logs
2025-01-21 17:34:58 +02:00
Stephanie Hingtgen
2fe510eb6f Dashboards: set max length of message to 500 (#99229) 2025-01-21 08:50:24 -06:00
Ezequiel Victorero
865e911e10 Share: Add analytics to invite user flow (#99116) 2025-01-21 11:47:57 -03:00
Pepe Cano
c7edbffd82 Alerting docs: add Admonitions to Link Doc pages with practical Tutorials (#99317)
Alerting docs: add admonitions to link to practical tutorials
2025-01-21 15:18:57 +01:00
Galen Kistler
ee0129e8cf Loki datasource: move loki-editor e2e test to playwright (#99192)
* test: rewrite cypress test in playwright

* Update e2e/plugin-e2e/plugin-e2e-api-tests/as-admin-user/lokiEditor.spec.ts

Co-authored-by: Matias Chomicki <matyax@gmail.com>

---------

Co-authored-by: Matias Chomicki <matyax@gmail.com>
2025-01-21 15:39:33 +02:00
renovate[bot]
5a45f59573 Update dependency @faker-js/faker to v9.4.0 (#99315)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-21 13:37:00 +00:00
Tobias Skarhed
36f850601f MultiCombobox: Extract message rows (#98614)
* Extract messagerows

* Fix imports

* Fix again

* Remove export

* Fix text color
2025-01-21 14:22:09 +01:00
Yulia Shanyrova
3177e33470 Plugins: Return styles for info section at Plugin details panel (#99307)
return styles for info section
2025-01-21 14:08:17 +01:00
Ryan McKinley
1740ee82ba Chore: Avoid authlib/claims in go.mod (#99311) 2025-01-21 14:01:21 +01:00
renovate[bot]
c1eac9f997 Update dependency @bsull/augurs to ^0.9.0 (#99309)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-21 13:50:06 +02:00
Andres Martinez Gotor
e747350fee Grafana Advisor: Skeleton app (#99242) 2025-01-21 12:31:33 +01:00
renovate[bot]
1b5eaebb6e Update dependency knip to v5.42.2 (#99308)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-21 11:28:24 +00:00
renovate[bot]
83fffe83a2 Update dependency eslint-plugin-jsdoc to v50.6.2 (#99305)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-21 11:09:55 +00:00
renovate[bot]
13121ccf23 Update dependency @types/node to v22.10.7 (#99288)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-21 12:22:37 +02:00
Ryan McKinley
0f023e7039 FeatureToggles: remove panelTitleSearchInV1 (#99292)
remove panelTitleSearchInV1
2025-01-21 12:59:32 +03:00
Ryan McKinley
d8b6ded101 K8s: use deprecatedInternalID label rather than SQL annotation (#99263) 2025-01-21 12:38:14 +03:00
Pepe Cano
9ce9ad1777 Alerting docs: add instructions to execute notification template examples (#99275) 2025-01-21 10:32:04 +01:00
Ryan McKinley
d91d729749 Storage/SQL: Support more filter by namespace/group/resource (#99249) 2025-01-21 12:15:08 +03:00
Ryan McKinley
680e6bc1f8 Authlib: Use types package rather than claims (#99243) 2025-01-21 12:06:55 +03:00
Ryan McKinley
b2d0359e72 K8s/Folders: Remove slow/redundant folder integration tests (#99291) 2025-01-21 11:14:31 +03:00
Victor Marin
bf1a0837af DashboardScenes: Fix issue where relative time does not pass properly (#99282)
fix issue where relative time does not pass properly
2025-01-21 09:37:40 +02:00
ismail simsek
d3a27a8c73 Chore: Remove redundant test files (#99293)
remove redundant test files
2025-01-21 07:17:38 +03:00
owensmallwood
c45aff1251 Unified Storage: Permissions can filter search results (#99042)
* fix bug when parsing results in search handler

* applies permissions filtering to bleve query

* formatting

* wraps in check for access being present, adds some comments

* update go mod

* fix tests

* add dep owner

* fix go mod

* add space after //

* clean up returns

Co-authored-by: Bruno Abrantes <bruno.abrantes@grafana.com>

* fixed formatting

* Uses single checker since index is for single resource. Passes folderId using dvReader to checker func. Adds debug logging.

* handles federation with index permission checkers

* formatting

* move import

---------

Co-authored-by: Bruno Abrantes <bruno.abrantes@grafana.com>
2025-01-20 14:30:09 -06:00
Isabel Matwawana
9801a5a943 Docs: Reporting restructure (#98913)
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>
2025-01-20 14:17:54 -05:00
renovate[bot]
8c90f30e68 Update dependency @swc/core to v1.10.8 (#99287)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-20 18:57:53 +00:00
Ryan McKinley
2756bc9a87 Zipkin: Fix key order in flaky test (#99285)
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2025-01-20 20:24:45 +02:00
Tom Ratcliffe
52c95f77cd Alerting: Include error from current condition when previewing queries (#98202) 2025-01-20 17:56:21 +00:00
renovate[bot]
80a2d8ad34 Update dependency @react-types/overlays to v3.8.12 (#99283)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-20 17:49:39 +00:00
renovate[bot]
4fb9f0a386 Update dependency @react-types/menu to v3.9.14 (#99280)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-20 17:27:44 +00:00
Ryan McKinley
52c1a3dccd Search: Delete old indexes once not in use (#99251) 2025-01-20 20:25:26 +03:00
renovate[bot]
427a601980 Update dependency @react-types/button to v3.10.2 (#99274)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-20 17:03:10 +00:00
renovate[bot]
15d0b139c7 Update dependency @grafana/faro-web-tracing to v1.12.3 (#99272)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-20 15:49:38 +00:00
Leon Sorokin
863d56b7e1 Prometheus: Sort Table format data frames by first field's values (#99223) 2025-01-20 09:42:13 -06:00
renovate[bot]
cc3b3ccdef Update dependency @grafana/faro-web-sdk to v1.12.3 (#99268)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-20 15:27:15 +00:00
Karl Persson
7329d2c34b Authz: Account for fixed roles when running oss and using authz service (#99244)
* Extract "PermissionStore" from general store interface

* Add static and union permission stores

* Add GetStaticRoles

* Use accesscontrol.Service for inproc to provide static permissions
2025-01-20 16:00:36 +01:00
renovate[bot]
0baf3a8f95 Update dependency @grafana/faro-web-sdk to v1.12.3 (#99267)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-20 14:47:41 +00:00
Juan Cabanas
37b7776b21 PublicDashboards: HorizontalGroup removal (#98697) 2025-01-20 11:41:58 -03:00
renovate[bot]
c241ac57d8 Update dependency @grafana/faro-core to v1.12.3 (#99265)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-20 14:26:06 +00:00
Eric Leijonmarck
cf19d6d4b7 Teams: Consistency in save/update on the team settings page (#99200)
* make team page consistent

* fmt/linting

* fix tests
2025-01-20 14:07:38 +00:00
renovate[bot]
c601d79889 Update dependency @grafana/monaco-logql to ^0.0.8 (#99226)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-20 13:58:36 +00:00
Sonia Aguilar
80b8dd3fc8 Alerting: Set alert form simple modes enabled by default (#99233)
set alert form simple modes enabled by default
2025-01-20 14:55:34 +02:00
Ivan Ortega Alba
95d4f83889 DashboardSchema: Add library panel to v2 (#98484)
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
2025-01-20 12:44:36 +01:00
Misi
f96a2082d0 Auth: Allow self serve for improved external session handling feature toggles (#99245)
Auth: Allow self serve for improved external session handling
2025-01-20 12:33:37 +01:00
Alexander Akhmetov
651430e34a Alerting: Add sync state persister to save entire state of the rule (#96628) 2025-01-20 12:12:27 +01:00
Ivana Huckova
63a68f3e99 Zipkin: Fix test file name (#99238)
Zipkin: Fix test file name
2025-01-20 12:01:17 +01:00
Marc M.
27cdd25917 FlameGraph: Add prop to keep focused items when the profile data changes (#98356) 2025-01-20 12:34:48 +02:00
Joao Silva
b3b044b54b MultiCombobox: Add "All" option (#98377)
* MultiCombobox: Add All option

* Translate

* Add prop to show All option

* Change variable name

* betterer update

* Extract variable

* Update packages/grafana-ui/src/components/Combobox/MultiCombobox.tsx

Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>

* Return All item

* Update checkboxes

* Add filtering functionality

* Handle deduplication when selecting already selected items

* Performance improvements when selecting and modifying all items

* Handle bug with isOpen for tests to pass

* Small fixes

* Add filtered phrase

* Address PR feedback

* Reset okg/services from main

* Reset from main

* Restore main

* Add counter to filtered all

* Fix OptionListItem

* Hide all when there are no results

* Refactor to use useMemo instead

* Fix comments

* Remove useEffect

---------

Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>
Co-authored-by: Tobias Skarhed <tobias.skarhed@gmail.com>
2025-01-20 12:32:09 +02:00
Andres Martinez Gotor
c1364d6be6 New feature flag grafanaAdvisor (#99235) 2025-01-20 11:08:00 +01:00
jackyin
55ec66c416 Datasources: timeEnd not work (#98375)
* time end not work
2025-01-20 10:04:43 +00:00
Jack Baldry
1f780fdce1 Lint for Writers' Toolkit style (#99234) 2025-01-20 09:55:37 +00:00
Jack Baldry
1e53ab609e Only run documentation linter on branches that target main (#99163) 2025-01-20 09:52:39 +00:00
Jack Westbrook
dea2e41e9f Grafana UI: Use Eslint no-restricted-imports in tests and stories (#99191)
* style(eslint): remove ignore from grafana/ui-overrides

* style(grafana-ui): update imports for tests

* style(grafana-ui): update imports for stories

* chore(betterer): update results file

* Fix useTheme import

* Change deprecated Horizontal/Vertical group usages

---------

Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
2025-01-20 09:44:19 +01:00
Stephanie Hingtgen
1a2a284972 K8s: Dashboards: Set message as annotation (#99230) 2025-01-20 08:40:23 +03:00
Stephanie Hingtgen
b309c5daed K8s: Refactor client to be generic (#99231) 2025-01-19 16:53:53 -06:00
antonio
d346819d62 add note to part 4 (#99194) 2025-01-19 09:37:36 +01:00
Matias Chomicki
a61548c5b9 PreviewLogRow: fix LogRowMessageDisplayedFields being unnecessarily rendered (#99217) 2025-01-17 23:40:53 +02:00
Stephanie Hingtgen
e33936398c Public dashboards: return full list when more than 1000 (#99216) 2025-01-17 23:16:30 +02:00
Sonia Aguilar
8fabc66bd2 Alerting: Fix not showing metadata in contact point when rendering an existing alert rule (#98956)
show metadata in contact point when loading an existing alert rule
2025-01-17 22:02:10 +01:00
Matthew Jacobson
a6dffd7552 Upgrade grafana/alerting to 209e052dba64 (#99118)
Update grafana/alerting to 209e052dba64

Includes:
- Add NoopDecode function for non-base64-encoded secrets (#264)
- Log duplicated receivers (#265)
2025-01-17 21:53:41 +02:00
Stephanie Hingtgen
fb3a858726 Revert "Remove dependency on dashboards table to get library element and library element connection" (#99213)
Revert "Remove dependency on dashboards table to get library element and libr…"

This reverts commit 32790c6918.
2025-01-17 21:43:14 +02:00
Andreas Christou
414f8d14f4 Azure: User-auth updates (#99113)
* Bump Azure sdk

* Minor fix because of credentials update

* Revert "Minor fix because of credentials update"

This reverts commit 1f49949ee3.
2025-01-17 12:13:34 -06:00
Andreas Christou
f39c5bb45c Azure: Correctly set instance settings based on new credentials (#99112)
Correctly set value based on new credentials
2025-01-17 12:13:15 -06:00
Sonia Aguilar
798b32138d Alerting: Use useProduceNewAlertmanagerConfiguration for notification policies (#98615)
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2025-01-17 20:06:50 +02:00
Ronald McCollam
59184628e1 Add Apache instructions (#97369)
Co-authored-by: Joseph Perez <45749060+josmperez@users.noreply.github.com>
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: Irene Rodriguez <irene.rodriguez@grafana.com>
Co-authored-by: Jacob Valdez <jacob.valdez@grafana.com>
2025-01-17 11:53:25 -06:00
Haris Rozajac
4f337b99d4 Dashboards Schema V2: ResponseTransformers: Transform remaining variables when ensuring v2 (#98777)
* add missing vars

* Don't create undefined variable fields

* tests

* Fix test; remove allValue from groupBy

* Fix tests

* betterer

* Use @ts-expect-error

* betterer
2025-01-17 09:54:42 -07:00
SeamusGrafana
40baca699a Alerting: Add Missing Quotes to Failed Evaluations Queries (#99067)
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2025-01-17 16:43:33 +00:00
Tom Ratcliffe
55644faa9d Chore: Remove alerting frontend from app/alerting codeowners (#99147)
Remove alerting frontend from app/alerting codeowners
2025-01-17 18:06:31 +02:00
Ashley Harrison
7411663b74 Chore: Upgrade to React 18.3 (#99183)
upgrade to react 18.3
2025-01-17 15:56:44 +00:00
Brendan O'Handley
ac94e81423 Explore metrics: Update copy for missing metrics message when OTel is on (#99056)
* Update copy for missing metrics when OTel is on

* update message

* Add OTel message in no metrics found message, not the warning banner

* Otel > OTel
2025-01-17 09:32:22 -06:00
Brendan O'Handley
7ccc811203 Explore metrics: Add class to metric prefix dropdown for fullstory (#99106)
add class to metric prefix dropdown for fullstory
2025-01-17 09:31:30 -06:00
Ivan Ortega Alba
feae06d81c QueryVariable: Default query is not set when creating a new variable (#99029)
* QueryVariable: Default query is not set when creating a new variable

* use correct getDefaultQuery

---------

Co-authored-by: Sergej-Vlasov <sergej.s.vlasov@gmail.com>
2025-01-17 15:11:25 +00:00
Arati R.
2bce8c5e29 Folders: Use folder UID instead of folder ID in query for getting library elements (#99028) 2025-01-17 16:04:11 +01:00
Isabel Matwawana
348c0319c4 Docs: move DynamoDB to Unsupported list (#99120) 2025-01-17 09:52:37 -05:00
Igor Suleymanov
bc6b7a4df6 Update playlists app schemas to work with app SDK v0.29.0 (#98974)
* Update playlists app schemas to work with app SDK v0.29.0

What

* Added the manifest for the playlists app
* Updated playlist kind definition to match the new format
* Re-generated the files
* Changed Makefile to not use post-processing flag

Why

To make sure the codegen works with the latest version of the app SDK.

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

* Update app SDK to v0.30.0

* Skip generating custom resource definitions

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

* Fix SDK not generating the manifest Go file

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

---------

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
2025-01-17 16:17:31 +02:00
Bogdan Matei
1d7d658934 Dashboard: Show hidden elements (#99073) 2025-01-17 15:40:18 +02:00
Ryan McKinley
356b32008b Storage: Show history+trash using the list command (#99009)
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
2025-01-17 15:54:25 +03:00
Karl Persson
67252dfa46 Zanzana: Add grpc health and readiness checks for standalone zanzana (#99176)
Add grpc health and readiness checks for standalone zanzana
2025-01-17 13:39:42 +01:00
Daniel Holmes
032f465ac6 Grafana UI: W/m2 should still support SI prefixes (#98362)
fix: W/m2 should still support SI prefixes

Co-authored-by: oscarkilhed <oscar.kilhed@grafana.com>
2025-01-17 12:59:21 +01:00
Ryan McKinley
7c04247d6f K8s/Dashboard: Set generation from version (#99142) 2025-01-17 13:52:01 +02:00
Arati R.
a0d1a197e3 Folders: Use folder UID when deleting library elements in folder (#98967)
* Refactor  deleteLibraryElementsInFolderUID to use folder UID only
* Convert dashboard error to folder one when deleting library elements
* Fix incorrectly set folder UID in nested folder test

---------

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
2025-01-17 12:04:02 +01:00
Esteban Beltran
f65e9fa9ab Sandbox: Add SRI validation for CDN assets loaded in the sandbox (#99023)
Add SRI validation for frontend sandbox
2025-01-17 11:47:36 +01:00
Mariell Hoversholm
f9cc08a42d Test: Skip loki-editor spec test for being flaky (#99145)
test: skip loki-editor spec test

This is a flaky test. Examples:

 * Failure:    https://drone.grafana.net/grafana/grafana/217717/6/21
 * Successful: https://drone.grafana.net/grafana/grafana/217748/6/21
 * Failure:    https://drone.grafana.net/grafana/grafana/217795/6/21
 * Successful: https://drone.grafana.net/grafana/grafana/217796/6/21
 * Failure:    https://drone.grafana.net/grafana/grafana/217826/6/21
 * Failure:    https://drone.grafana.net/grafana/grafana/217834/6/21
2025-01-17 12:20:47 +02:00
Alexander Zobnin
c5f14407cc Zanzana: Refactor stores listing (#99098)
Zanzana: Refactor store loading
2025-01-17 11:10:22 +01:00
Ivana Huckova
5e23b2c07f Zipkin: Improve error source (#99099)
* Zipkin: Improve error source

* Revert file name change
2025-01-17 10:04:33 +01:00
renovate[bot]
f9a61e2eb2 Update React Aria (#99129)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-17 09:49:39 +01:00
Alexander Zobnin
17a09c28dd Chore: Upgrade openfga to 1.8.4 (#99095) 2025-01-17 09:36:08 +01:00
Mariell Hoversholm
a08f406781 Security: Update to Go 1.23.5 (#99121)
* feat: update to Go 1.23.5

* chore: make drone

* chore: make update-workspace

* CI: Force re-build

* CI: Force re-build
2025-01-17 09:29:52 +01:00
Stephanie Hingtgen
e019e34eb5 Stats: use dashboard stats rather than list (#99130) 2025-01-17 08:19:56 +03:00
Stephanie Hingtgen
5a930e0ec6 K8s search: add legacy id to dashboard response (#99132) 2025-01-17 08:16:48 +03:00
ismail simsek
6901bad03b Chore: Export some more from index for explore metrics (#99110)
* export some more from index.ts for explore metrics

* lint

* export default member

* update imports in explore metrics

* Update packages/grafana-prometheus/src/index.ts

Co-authored-by: Nick Richmond <5732000+NWRichmond@users.noreply.github.com>

* Update public/app/features/trails/helpers/MetricDatasourceHelper.ts

Co-authored-by: Nick Richmond <5732000+NWRichmond@users.noreply.github.com>

---------

Co-authored-by: Nick Richmond <5732000+NWRichmond@users.noreply.github.com>
2025-01-16 22:38:40 +01:00
Nick Richmond
c63c869bca ExploreMetrics: Add label cross-reference technique in Related Logs tab (#98775)
* feat: fetch logs containing active labels

* refactor: simplify & handle unhappy path

* refactor: avoid local plugins

* refactor: simplify, clarify, and add operator flexibility

* fix: messaging for no related logs

* refactor: prefer early return

* refactor: avoid problematic `instanceof` checks

* test: `getDataSources` + `getLokiQueryExpr` functionality

* refactor: add clarity

* refactor: clean up

* refactor: add clarity

* feat: account for known label name differences

* refactor: prefer shared type

* test: label name conversions

* test: update to match refactor

* fix: multi-connector query combination

* perf: prefer labels queries to full Loki queries

* fix: limit number of Loki data sources

* docs: explain purpose of parsing solution

* refactor: simplify logs queries

* docs: add clarity

* fix: handle unhappy path w/variable updates

* fix: handle unhealthy Loki data sources
2025-01-16 14:29:17 -05:00
Andreas Christou
f6194931f5 Azure: Improve resource request error handling (#99017)
* Improve resource request error handling

- Correctly parse JSON responses
- Log erroneous failures in JSON marshalling/unmarshalling
- Correctly set response status code
- Do not attempt to use the response writer as it will be nil

* Minor change

* Improve type assertion handling
2025-01-16 18:38:20 +00:00
maicon
b4ec11e150 Unistore: Ensure deprecated Folder ID gets stored on all modes (#99043)
* Unistore: Ensure deprecated Folder ID gets stored on all modes

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>

---------

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
2025-01-16 15:01:00 -03:00
Ashley Harrison
8e59f618c1 CodeEditor: Fix cursor alignment (#99090)
* remeasure fonts once they've loaded

* add test mock

* fix unit test

* remeasure fonts after the editor has mounted just to be safe
2025-01-16 16:54:16 +00:00
Irene Rodríguez
54440811b3 Add DynamoDB to unconfirmed list (#99087) 2025-01-16 17:32:13 +01:00
ismail simsek
e96b5a68c4 Prometheus: Support utf8 metrics and labels in scopes (#99015)
* support utf8 in scopes

* separate the utf8 tests

* remove redundant test after enabling utf8 validation in prometheus
2025-01-16 18:11:44 +02:00
kay delaney
c0b3932168 Graphite: Fix issue where duplicated panels share same query object (#99077) 2025-01-16 16:07:57 +00:00
Brendan O'Handley
1eb45dd0f8 Explore metrics: Do not show otel switch in related metrics tab (#99054)
do not show otel switch in related metrics tab
2025-01-16 10:00:39 -06:00
Ashley Harrison
cff07c9fb6 Chore: Replace rc-time-picker with rc-picker (#99022)
* replace rc-time-picker with rc-picker

* remove unnecessary stack

* remove TimePickerInput

* make props stricter

* fix type assertions

* remove outdated comment

* fix types

* fix clear icon

* fix styling

* fix z-index and 6 tests

* fix remaining unit tests

* betterer results

* styling tweaks

* don't show/hide scrollbars on hover
2025-01-16 15:58:02 +00:00
ismail simsek
106af5d0ee Prometheus: UTF8 support in metrics browser (#98612)
* utf8 metrics for prometheus devenv

* introduce utf8 support

* completions and suggestions

* don't wrap the utf8 label in quotes

* linting

* support utf8 labels and metrics on visual query builder

* lint

* update raw view for utf8 metric syntax

* betterer

* support utf8 metric names in explore metrics

* utf8 support in grouop by

* utf8 support in label break down

* utf8 metric and label support in metric_find_query for label values

* use the same regex to check label values

* no need to escape

* support series endpoint

* support series endpoint

* support series endpoint

* support series endpoint

* fix tests

* fix extracting labels from labelValuesQuery

* show explanation with right syntax

* support utf8 metrics and labels
2025-01-16 17:50:35 +02:00
ismail simsek
029edcb6be Prometheus: Render metrics and labels in explanation with right syntax (#98591)
* utf8 metrics for prometheus devenv

* introduce utf8 support

* completions and suggestions

* don't wrap the utf8 label in quotes

* linting

* support utf8 labels and metrics on visual query builder

* lint

* update raw view for utf8 metric syntax

* betterer

* support utf8 metric names in explore metrics

* utf8 support in grouop by

* utf8 support in label break down

* utf8 metric and label support in metric_find_query for label values

* use the same regex to check label values

* no need to escape

* support series endpoint

* support series endpoint

* support series endpoint

* support series endpoint

* fix tests

* fix extracting labels from labelValuesQuery

* show explanation with right syntax

* betterer
2025-01-16 17:30:29 +02:00
ismail simsek
4386cfc984 Prometheus: Support utf8 metrics and labels in variable editor (#98345)
* utf8 metrics for prometheus devenv

* introduce utf8 support

* completions and suggestions

* don't wrap the utf8 label in quotes

* linting

* support utf8 labels and metrics on visual query builder

* lint

* update raw view for utf8 metric syntax

* betterer

* support utf8 metric names in explore metrics

* utf8 support in grouop by

* utf8 support in label break down

* utf8 metric and label support in metric_find_query for label values

* use the same regex to check label values

* no need to escape

* support series endpoint

* support series endpoint

* support series endpoint

* support series endpoint

* fix tests

* fix extracting labels from labelValuesQuery

* betterer
2025-01-16 17:10:34 +02:00
Ihor Yeromin
019ee9c2d4 Table: Fix inspect drawer disappears unexpectedly (#99025)
fix(table): inspect drawer disappears unexpectedly
2025-01-16 15:58:56 +01:00
ismail simsek
b532df36c4 Explore Metrics: Support prometheus utf8 metrics names and labels (#98285)
* utf8 metrics for prometheus devenv

* introduce utf8 support

* completions and suggestions

* don't wrap the utf8 label in quotes

* linting

* support utf8 labels and metrics on visual query builder

* lint

* update raw view for utf8 metric syntax

* betterer

* support utf8 metric names in explore metrics

* utf8 support in grouop by

* utf8 support in label break down

* support series endpoint

* support series endpoint

* support series endpoint

* Explore metrics: Utf8 support in Explore metrics with OTel experience enabled (#98707)

* betterer

---------

Co-authored-by: Brendan O'Handley <brendan.ohandley@grafana.com>
2025-01-16 16:49:06 +02:00
Sergej-Vlasov
a32eed1d13 TransformationFilter: Include transformation outputs in transformation filtering options (#98323)
* wip: include transformation output as filtering option

* add refId to joinByField transformation

* clean up

* add refId to transformations that create new data frames

* adjust duplicate query removal for filtering options

* refactor transformation input/output subscription effect

* adjust input data frame filtering logic to include transformations as input for debug view

* transformation filter can only filter on output of previous transformation
2025-01-16 14:45:23 +00:00
Sergej-Vlasov
3df1fa86ae setDashboardPanelContext: Allow to add filters from the table with the same key (#99004)
* always add filters for elastic seach ds when filtering table value

* simplify update filter logic and restore behaviour from old arch

* remove unnecessary modifications

* adjust namig
2025-01-16 14:43:46 +00:00
Ryan McKinley
d95484fba6 K8s/Client: Add watch support (#99060)
* add watch client

* add watch client

* add support for selectors

* parse labels

* always send watch

* reuse decoder

* Update public/app/features/apiserver/client.ts

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>

* Update public/app/features/apiserver/client.ts

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>

* Update public/app/features/apiserver/client.ts

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>

---------

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
2025-01-16 17:41:52 +03:00
ismail simsek
31deddafb6 Prometheus: Support utf8 labels and metrics on visual query builder (#98274)
* utf8 metrics for prometheus devenv

* introduce utf8 support

* completions and suggestions

* don't wrap the utf8 label in quotes

* linting

* support utf8 labels and metrics on visual query builder

* lint

* update raw view for utf8 metric syntax

* betterer

* support series endpoint

* support series endpoint

* betterer
2025-01-16 16:24:56 +02:00
ismail simsek
4c0fa629da Prometheus: Support utf8 metric/label/label value suggestions in code mode (#98253)
* utf8 metrics for prometheus devenv

* introduce utf8 support

* completions and suggestions

* don't wrap the utf8 label in quotes

* linting

* support series endpoint
2025-01-16 15:01:51 +01:00
Tom Ratcliffe
862c0ce9b5 Alerting: Fix check for contact point email in IRM essentials page (#98977) 2025-01-16 13:59:32 +00:00
Gabriel MABILLE
70ddf9cb76 Authenticator: Return gRPC errors (#99000) 2025-01-16 14:33:57 +01:00
Georges Chaudy
98e9f3a534 [unistore] wire authlib compile (#99027)
* Wire authz client compile method

* add verb to metric

* remove tipo
2025-01-16 14:11:55 +01:00
Sven Grossmann
4936c53072 chore: upgrade @grafana/lezer-logql and @grafana/monaco-logql (#99076) 2025-01-16 15:08:32 +02:00
Arati R.
a3cdad25a3 Docs: Fix broken link to provisioning instructions in elasticsearch doc page (#98871)
Fix broken link in elasticsearch data source doc page
2025-01-16 13:40:00 +01:00
Karl Persson
2187a66f2b Zanzana: Split up settings into client and server sections (#99066)
* Split up zanzana settings into client and server sections

* Update workspace
2025-01-16 13:39:39 +01:00
Gaurav Soni
ee4016f4bc Docs: add that traces panel works with traceID to show a singular trace (#98451)
* update that traces panel works with traceID to show a singular trace

* Update docs/sources/panels-visualizations/visualizations/traces/index.md

Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>

---------

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>
2025-01-16 13:21:11 +01:00
Kévin Gomez
77f7ab27be Use cog as a cli tool to generate code for kinds v2 schemas (#99044)
* Use cog as a cli tool to generate code for kinds v2 schemas

* Update imports to dashboard v2 package in frontend

* Ensure cog is installed before using it
2025-01-16 13:18:47 +01:00
Yaelle Chaudy
4fcd529d0e Dashboards Versions: Add event to dashboards restore version (#98855)
* Add event to dashboards restore version

* moved changes to scenes instead

* remove last non-scene change

* Move events to centralised file

* remove ? from properties copy pasta

* Add tests
2025-01-16 12:37:45 +01:00
Brendan O'Handley
76a7987427 Explore metrics: Support native histograms (#98894)
* identify native histograms by classic histograms

* use trail to expose ds helper

* identify native histograms for preview panel

* refactor ds helper to initialize all native histograms

* remove await

* add info message for native histograms

* hide button on show examples

* show nh in metric scene by passing check for nh and storing in url for url loads, bookmarks and recent explorations

* add badge for native histograms

* click native histogram examples in info message to see them

* add link for learn more

* close banner on select when selecting native histogram in info banner

* show message for newly selected data sources

* capitalize Native Histogram badge

* prettier

* fix badge ui width

* add padding for badge

* add images, styling and tests for native histogram banner

* move images to img folder

* fix store tests

* run i18n

* fix betterer

* fix betterer with translations

* cannot translate interpolated metric in button text

* Fix import

* do  not indent the > See examples section

* trans component interferes with text with special chars

* update sm text with 4px padding and 16px spacing between images

* do not show banner after closing then changing data sources

* prettier

* Update public/app/features/trails/helpers/MetricDatasourceHelper.ts

Co-authored-by: Nick Richmond <5732000+NWRichmond@users.noreply.github.com>

* Update public/app/features/trails/banners/NativeHistogramBanner.tsx

Co-authored-by: Nick Richmond <5732000+NWRichmond@users.noreply.github.com>

* Update public/app/features/trails/banners/NativeHistogramBanner.tsx

Co-authored-by: Nick Richmond <5732000+NWRichmond@users.noreply.github.com>

* update comments

* remove unnecessary code check

* add rudderstack types

* add close example functionality

* prettier

* add t() for betterer

* prettier

* fix betterer and trans issues

* fix test

---------

Co-authored-by: Nick Richmond <5732000+NWRichmond@users.noreply.github.com>
2025-01-16 03:36:10 +02:00
owensmallwood
7da6e48036 Unified Storage: Remove history stub (#99048)
remove history stub
2025-01-16 03:05:13 +02:00
Matias Chomicki
3641b28e84 Explore: fix logs no results and scanning states (#98605) 2025-01-15 22:08:19 +00:00
Yuri Tseretyan
d025523a8b Alerting: Log reason for taking image. (#99036) 2025-01-15 16:11:38 -05:00
Ryan McKinley
cd46f1ddb9 Search: Remove history query (#99026) 2025-01-15 12:49:47 -06:00
Andreas Christou
f9f341e9c9 Azure: Fix interface conversion (#99034) 2025-01-15 13:28:04 -05:00
Adam Yeats
bab55a4cb8 Elasticsearch: Process ES multisearch JSON response by streaming (#93689)
Co-authored-by: Isabella Siu <isabella.siu@grafana.com>
2025-01-15 12:05:54 -05:00
Matthew Jacobson
fc90a446c6 Alerting: Ensure long-lived repeat alerts keep images after 24h expiry (#98993)
Ensures we retake images after expiration on long-lived repeat alerts.
Otherwise, logs would show "Image not found in database" and notifications
would cease to contain an image after 24h of continuous firing.
2025-01-15 11:45:43 -05:00
Gabriel MABILLE
b6fc695598 ExtJwtClient: Use user namespace for k8s allowed namespace (#93687)
* ExtJwtClient: Use user namespace for k8s allowed namespace

* fix test
2025-01-15 17:38:46 +01:00
Andrej Ocenas
5d45af1110 I18n: Add doc comment for t() (#99024)
* Add comment doc

* Reorder information
2025-01-15 17:31:06 +01:00
owensmallwood
d00592ffa0 Unified Storage: Make all dashboard fields searchable (#98899)
* wip. adding sprinkles fields.

* some refactoring. Works with sprinkles now.

* exclude top level dashboard hit fields from hit "fields"

* adds unit test for DecodeCell helper

* test can search for specific dashboard fields on bleve index

* adds search handler tests for the fields and tests for fields when transforming the search req to a bleve search req

* fix panic when calling fields.Set() with int32

* adds regression test

* remove unneeded method on test mock client

* fix linter issues

* updates dashboard test data for bleve tests

* remove DASHBOARD_LEGACY_ID from bleve_tests

* dont cast twice

* updates test to sort by dashboard_views_last_1_days

* declare excludedFields outside of function

* fixes sorting by dashboard fields - prepends "fields." to any dashboard fields we try to sort by

* uses map for excludedFields

* expects fields to be array-style url param

* change method name

* fixes failing tests - needed to add column type to mocks
2025-01-15 10:23:05 -06:00
William Wernert
8415089534 Alerting: Use correct status code for UID conflict in contact point provisionining API (#98970)
Use correct status code for UID conflict in contact point provisioning API
2025-01-15 11:07:56 -05:00
Misi
125fdc8f21 Auth: Fix AzureAD public client configuration (#99019)
Auth: Add client auth none as default to ensure public clients can be configured on the UI
2025-01-15 16:49:58 +01:00
Jack Baldry
f142f12887 Ignore spelling errors in bold formatting (#99006) 2025-01-15 15:08:20 +00:00
Jean-Philippe Quéméner
c03586dfe8 fix(unified-storage): initialize blob storage when using grpc (#99020) 2025-01-15 16:04:41 +01:00
Jean-Philippe Quéméner
38927f0719 fix(indexer): reduce cardinality of indexer metric (#99018) 2025-01-15 16:01:31 +01:00
beejeebus
a290db6a7e Ensure we delete playlists when deleting an org, fixes #98736 (#98771) 2025-01-15 08:13:56 -06:00
Josh Hunt
e3e580edfa Chore: Prevent direct path imports from workspace grafana packages (#98940)
* restrict imports from @grafana/ui/src paths

* prevent path imports from all grafana packages

* just run on ui, runtime, data packages

* update
2025-01-15 15:47:44 +02:00
antonio
1dcff0a71f docs/alerting/tutorials/part4 (#98942)
* docs/alerting/tutorials/part4

* interactives

* refs

* links

* formatting

* links2

* alt text

* steps, new alert configuration sections

* feedback

* bypass spellcheck

* Update docs/sources/tutorials/alerting-get-started-pt4/index.md

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

* Update docs/sources/tutorials/alerting-get-started-pt4/index.md

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

* Update docs/sources/tutorials/alerting-get-started-pt4/index.md

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

* Update docs/sources/tutorials/alerting-get-started-pt4/index.md

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

* added note and minor formatting

* made links killercoda friendly

* all pretty no pity

---------

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
2025-01-15 14:35:51 +01:00
Syerikjan Kh
dfe0712955 feat: pass gcom sso_api_token to repo created from install command (#98973)
* feat: pass gcom sso_api_token to repo created from install command

* fix

* fix: extract gcom section to a func

* Update pkg/cmd/grafana-cli/utils/command_line.go

Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>

* fix: only set gcom token when the request is to GCOM

---------

Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>
2025-01-15 08:15:18 -05:00
ismail simsek
79fc26ea87 Chore: Remove prometheus replace directive (#98966)
* remove replace directive

* have an adapter

* go mod tidy

* make update-workspace

* make update-workspace
2025-01-15 14:04:14 +01:00
Santiago
ea6cb8f139 Alerting: Panic when rule being evaluated has unexpected key (#99002) 2025-01-15 14:59:50 +02:00
Konrad Lalik
5aeaccadff Alerting: Add read-only GMA rules to the new list view (#98116)
* Reuse prom groups generator between GMA, external DS and list view

* Improve generators, add initial support for GMA in grouped view components

* Improve handling of GMA rules

* Split componentes into files

* Improve error handling, simplify groups grouping

* Extract grafana rules component

* Reset yarn.lock

* Reset yarn.lock 2

* Update filters, adjust file names, add folder display name to GMA rules

* Re-enable filtering for cloud rules

* Rename AlertRuleLoader

* Add missing translations, fix lint errors

* Remove unused imports, update translations

* Fix responses in BE tests

* Update backend tests

* Update integration test

* Tidy up group page size constants

* Add error throwing to getGroups endpoint to prevent grafana usage

* Refactor FilterView to remove exhaustive check

* Refactor common props for grafana rule rendering

* Unify identifiers' discriminators, add comments, minor refactor

* Update translations

* Remove unnecessary prev page condition, add a few explanations

---------

Co-authored-by: fayzal-g <fayzal.ghantiwala@grafana.com>
Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
2025-01-15 11:36:32 +01:00
Igor Suleymanov
7f04f66137 Allow listing Dashboards through k8s APIs (#98997)
What

This PR changes the dashboard authorizer logic to no longer require
requester to be the super admin user in order to list dashboards using
k8s APIs.

Why

We no longer need this precondition - dashboards should be listable
based on the regular authorizer logic.

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
2025-01-15 11:50:28 +02:00
Leonor Oliveira
32790c6918 Remove dependency on dashboards table to get library element and library element connection (#98941)
* Remove dependency on dashboards table to get library element

* WIP

* Don't use dashboard id when getting library connections

* Lint

* Don;t include folder_uid in library element
2025-01-15 10:32:24 +01:00
Matias Chomicki
bbade6b011 Shard query splitting: run queries through time query splitting (#98126)
* Query splitting: add skipPartialUpdates option

* Shard query splitting: run queries through time splitting

* Query splitting: delegate error retry to shard splitting

* Shard query splitting: update unit tests

* Shard query splitting: test combined requests

* Formatting

* Query splitting: test new options

* Query splitting: update assertion

* Formatting
2025-01-15 10:26:23 +01:00
Jack Baldry
a6eb8abd05 Simplify language and lint for style (#98964) 2025-01-15 08:36:31 +00:00
Karl Persson
3f71a72c1a Authz: Remove "wrapper" interface and only check feature toggle for grpc mode (#98933)
* Remove "wrapper" interface and only check feature toggle for grpc and cloud mode

* Only set name for update checks

* Set dashboard permissions for admin user
2025-01-15 09:23:56 +01:00
Ryan McKinley
0d302a161a BackendSrv: Support streaming chunked responses (#98691) 2025-01-15 10:01:22 +03:00
Ryan McKinley
0fce8799eb Chore: go.mod cleanup (#98987) 2025-01-15 08:35:22 +03:00
Stephanie Hingtgen
2a08c9ed82 K8s Dashboards: Fix creating a dashboard inside a folder (#98982) 2025-01-15 07:15:58 +02:00
Stephanie Hingtgen
dbfc412ed8 K8s: Fix dashboard search (#98989) 2025-01-14 18:45:27 -05:00
Yuri Tseretyan
e15fc984c3 Alerting: Deprecate Alertmanager config and receivers APIs (#98918) 2025-01-14 17:22:01 -05:00
jackyin
69da0bb22c FieldReducers: Fix median (#98184)
Co-authored-by: Kristina Durivage <kristina.durivage@grafana.com>
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2025-01-14 23:38:34 +02:00
Piotr Jamróz
c5111b8132 Explore: Add missing translations (#98984)
Add missing translation
2025-01-14 21:55:58 +01:00
Scott Lepper
3b8477dcda Search: fix uid/name filter (#98981)
[search] fix uid/name filter
2025-01-14 15:48:14 -05:00
Isabel Matwawana
feb334cdbb Docs: update broken Play link (#98985) 2025-01-14 15:47:07 -05:00
Piotr Jamróz
f7e0710f53 Explore: Limit number of columns shown in Explore table (#98726) 2025-01-14 17:01:34 +01:00
Edvard Falkskär
e38bab43db Remove console.log from correlations service (#98969) 2025-01-14 16:09:32 +01:00
Gábor Farkas
1ff4053f03 go.mod: updated grafana-plugin-sdk-go from v0.261.0 to v0.262.0 (#98930) 2025-01-14 16:06:41 +01:00
Karl Persson
ce0d986673 Zanzana: Use cache for both streamed and non-stream version of list objects (#98882)
* Add prefix constants and use string builders / string concatinations

* Use cache for both streamed and non-stream versions of list objects

* Remove unused constants
2025-01-14 16:00:59 +01:00
Selene
7151ea6abc Codegen: Generate Golang code using cog (#98812)
* Use cog for Go types

* Delete old generation code

* Fix plugins generation

* workspaces update

* Update datasources with new generated code

* More fixes

* Update swagger and openapi specs

* Fixes

* More files...

* Update workspace

* More fixes...

* Remove unused functions
2025-01-14 15:58:38 +01:00
renovate[bot]
b96a752db3 Update dependency rc-tree to v5.13.0 (#98959)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-14 14:36:58 +00:00
Haris Rozajac
125a11ca99 Dashboard: Fix snapshots for the old arch (#98902)
Fix snapshots for the old arch
2025-01-14 07:33:29 -07:00
Jack Baldry
3884c0e896 Replace codespell with Vale spelling check (#98406) 2025-01-14 14:08:01 +00:00
Alexander Zobnin
037570b9c8 Chore: Add vscode config for zanzana server (#98957) 2025-01-14 15:01:10 +01:00
Leonor Oliveira
7c87ff1b84 Folders: Use folder service to count library panels (#98802)
* Use folder service to count library panels

---------

Co-authored-by: suntala <arati.rana@grafana.com>
2025-01-14 14:58:36 +01:00
renovate[bot]
2594b4f7af Update scenes to v5.37.0 (#98958)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-14 15:42:21 +02:00
renovate[bot]
0032e839ce Update dependency rc-tooltip to v6.4.0 (#98952)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-14 13:17:49 +00:00
Ashley Harrison
6b5146651f Select/Combobox: Tweak menu styling so hover states don't overflow (#98944)
tweak menu styling so hover states don't overflow
2025-01-14 13:16:42 +00:00
Pepe Cano
7771768363 Alerting docs: clarify data source-managed rules for Prometheus (#98378)
* Clarify DS managed rules support only the creation of Mimir and Loki rules

* additional copy changes

* Extend `Manage alerts via Alerting UI` description

* fix capital letter

* further details for `Manage alerts via Alerting UI`
2025-01-14 13:34:02 +01:00
renovate[bot]
0b5b21548b Update dependency rc-cascader to v3.33.0 (#98949)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-14 14:19:52 +02:00
Will Browne
70fb7b9545 Plugins: Remove bundled plugins feature (#96490)
* remove bundled plugins

* Add echo to command

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

* remove folder entirely

* remove folder from CODEOWNERS

---------

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
2025-01-14 12:04:01 +00:00
renovate[bot]
ff032a61d5 Update dependency postcss to v8.5.1 (#98945)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-14 11:44:11 +00:00
Jack Baldry
5570a7e42e Fix broken link (#98947) 2025-01-14 11:38:32 +00:00
Edvard Falkskär
e45eb95812 Correlations: Expose correlations logic through correlations service (#98124)
* Correlations: Expose correlations logic through correlations service

* Resolve remaining todos

* Marked new items as @alpha
2025-01-14 13:27:13 +02:00
renovate[bot]
33a91f22c0 Update dependency postcss to v8.5.0 (#98943)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-14 13:22:57 +02:00
renovate[bot]
dbd3bb7667 Update dependency papaparse to v5.5.1 (#98939)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-14 11:01:57 +00:00
Ashley Harrison
740cd22fe5 Query Library: Add feature toggle for query library in dashboards (#98938)
add feature toggle for query library in dashboards
2025-01-14 11:01:15 +00:00
renovate[bot]
64617886d9 Update dependency sass to v1.83.4 (#98936)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-14 10:30:40 +00:00
renovate[bot]
1281b0f094 Update dependency @types/node to v22.10.6 (#98934)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-14 12:09:54 +02:00
renovate[bot]
5c49b6cf73 Update dependency knip to v5.42.0 (#98892)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-14 09:46:18 +00:00
Josh Hunt
65f5a176a8 Chore: Import Combobox from main grafana-ui package (#98897) 2025-01-14 09:35:27 +00:00
Mariell Hoversholm
36d6fad421 Feat: Setup the App SDK logging module (#98927)
* Feat: Setup the App SDK logging module

* Build: Depend on logging pkg and update App SDK

* Chore: Assign owner to logging module
2025-01-14 10:34:57 +01:00
2744 changed files with 116480 additions and 50276 deletions

View File

@@ -86,6 +86,10 @@ module.exports = [
importNames: ['Layout', 'HorizontalGroup', 'VerticalGroup'],
message: 'Use Stack component instead.',
},
{
group: ['@grafana/ui/src/*', '@grafana/runtime/src/*', '@grafana/data/src/*'],
message: 'Import from the public export instead.',
},
],
},
],

File diff suppressed because it is too large Load Diff

View File

@@ -5,6 +5,10 @@ GOPATH ?= $(shell go env GOPATH)
GOBIN ?= $(firstword $(subst :, ,${GOPATH}))/bin
GO ?= $(shell which go)
# Add this near the top of the file, after the initial variable definitions
ifndef VARIABLES_MK
VARIABLES_MK := 1
# Below generated variables ensure that every time a tool under each variable is invoked, the correct version
# will be used; reinstalling only if needed.
# For example for bra variable:
@@ -23,6 +27,12 @@ $(BRA): $(BINGO_DIR)/bra.mod
@echo "(re)installing $(GOBIN)/bra-v0.0.0-20200517080246-1e3013ecaff8"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=bra.mod -o=$(GOBIN)/bra-v0.0.0-20200517080246-1e3013ecaff8 "github.com/unknwon/bra"
COG := $(GOBIN)/cog-v0.0.15
$(COG): $(BINGO_DIR)/cog.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/cog-v0.0.15"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=cog.mod -o=$(GOBIN)/cog-v0.0.15 "github.com/grafana/cog/cmd/cli"
CUE := $(GOBIN)/cue-v0.5.0
$(CUE): $(BINGO_DIR)/cue.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@@ -59,3 +69,4 @@ $(SWAGGER): $(BINGO_DIR)/swagger.mod
@echo "(re)installing $(GOBIN)/swagger-v0.30.6-0.20240310114303-db51e79a0e37"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=swagger.mod -o=$(GOBIN)/swagger-v0.30.6-0.20240310114303-db51e79a0e37 "github.com/go-swagger/go-swagger/cmd/swagger"
endif

5
.bingo/cog.mod Normal file
View File

@@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.23.4
require github.com/grafana/cog v0.0.15 // cmd/cli

View File

@@ -1,11 +1,10 @@
cuelabs.dev/go/oci/ociregistry v0.0.0-20240906074133-82eb438dd565 h1:R5wwEcbEZSBmeyg91MJZTxfd7WpBo2jPof3AYjRbxwY=
cuelabs.dev/go/oci/ociregistry v0.0.0-20240906074133-82eb438dd565/go.mod h1:5A4xfTzHTXfeVJBU6RAUf+QrlfTCW+017q/QiW+sMLg=
cuelang.org/go v0.11.1 h1:pV+49MX1mmvDm8Qh3Za3M786cty8VKPWzQ1Ho4gZRP0=
cuelang.org/go v0.11.1/go.mod h1:PBY6XvPUswPPJ2inpvUozP9mebDVTXaeehQikhZPBz0=
cuelang.org/go v0.11.0 h1:2af2nhipqlUHtXk2dtOP5xnMm1ObGvKqIsJUJL1sRE4=
cuelang.org/go v0.11.0/go.mod h1:PBY6XvPUswPPJ2inpvUozP9mebDVTXaeehQikhZPBz0=
github.com/cockroachdb/apd/v3 v3.2.1 h1:U+8j7t0axsIgvQUqthuNm82HIrYXodOV2iWLWtEaIwg=
github.com/cockroachdb/apd/v3 v3.2.1/go.mod h1:klXJcjp+FffLTHlhIG69tezTDvdP065naDsHzKhYSqc=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/emicklei/proto v1.13.2 h1:z/etSFO3uyXeuEsVPzfl56WNgzcvIr42aQazXaQmFZY=
github.com/emicklei/proto v1.13.2/go.mod h1:rn1FgRS/FANiZdD2djyH7TMA9jdRDcYQ9IEN9yvjX0A=
github.com/expr-lang/expr v1.16.9 h1:WUAzmR0JNI9JCiF0/ewwHB1gmcGw5wW7nWt8gc6PpCI=
@@ -16,18 +15,16 @@ github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1
github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY=
github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE=
github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI=
github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow=
github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM=
github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/grafana/codejen v0.0.4-0.20230321061741-77f656893a3d h1:hrXbGJ5jgp6yNITzs5o+zXq0V5yT3siNJ+uM8LGwWKk=
github.com/grafana/codejen v0.0.4-0.20230321061741-77f656893a3d/go.mod h1:zmwwM/DRyQB7pfuBjTWII3CWtxcXh8LTwAYGfDfpR6s=
github.com/grafana/cog v0.0.5 h1:BCa+10i3KvV+KMSQuxlN1DS9cZEwN+EAFc7ZmXqHxQE=
github.com/grafana/cog v0.0.5/go.mod h1:lzetOuhGUl/JaSACiJoHvBokf9/fS6PEFaWZvnQu2vs=
github.com/grafana/cog v0.0.14 h1:sBK89oSu9BK4S9l3G9ewVJnGYnNQJTHFBC/01DZDRZs=
github.com/grafana/cog v0.0.14/go.mod h1:HwJbc60fZ+viayROClLGdDwO5w/JjBOpO9wjGnAfMLc=
github.com/grafana/cog v0.0.15 h1:e2pMY+Hf2nS22HcKJuguEzl0BVmV9DSINwCfWt+dFZQ=
github.com/grafana/cog v0.0.15/go.mod h1:jrS9indvWuDs60RHEZpLaAkmZdgyoLKMOEUT0jiB1t0=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
@@ -35,18 +32,12 @@ github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+l
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
github.com/huandu/xstrings v1.5.0 h1:2ag3IFq9ZDANvthTwTiqSSZLjDc+BedvHPAp5tJy2TI=
github.com/huandu/xstrings v1.5.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/invopop/yaml v0.3.1 h1:f0+ZpmhfBSS4MhG+4HYseMdJhoeeopbSKbq5Rpeelso=
github.com/invopop/yaml v0.3.1/go.mod h1:PMOp3nn4/12yEZUFfmOuNHJsZToEEOwoWsT+D81KkeA=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0=
@@ -61,36 +52,35 @@ github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNH
github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc=
github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s=
github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/protocolbuffers/txtpbfmt v0.0.0-20241112170944-20d2c9ebc01d h1:HWfigq7lB31IeJL8iy7jkUmU/PG1Sr8jVGhS749dbUA=
github.com/protocolbuffers/txtpbfmt v0.0.0-20241112170944-20d2c9ebc01d/go.mod h1:jgxiZysxFPM+iWKwQwPR+y+Jvo54ARd4EisXxKYpB5c=
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4=
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM=
github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/yalue/merged_fs v1.3.0 h1:qCeh9tMPNy/i8cwDsQTJ5bLr6IRxbs6meakNE5O+wyY=
github.com/yalue/merged_fs v1.3.0/go.mod h1:WqqchfVYQyclV2tnR7wtRhBddzBvLVR83Cjw9BKQw0M=
golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=
golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI=
golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs=
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE=
golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8=
golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw=
golang.org/x/tools v0.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE=
golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

View File

@@ -10,6 +10,8 @@ fi
BRA="${GOBIN}/bra-v0.0.0-20200517080246-1e3013ecaff8"
COG="${GOBIN}/cog-v0.0.15"
CUE="${GOBIN}/cue-v0.5.0"
DRONE="${GOBIN}/drone-v1.5.0"

File diff suppressed because it is too large Load Diff

52
.github/CODEOWNERS vendored
View File

@@ -32,13 +32,13 @@
/devenv/README.md @grafana/docs-grafana
# START Technical documentation
/.vale.ini @grafana/docs-tooling
# `make docs` procedure and related workflows are owned @grafana/docs-tooling. Slack #docs.
/docs/ @grafana/docs-tooling
/docs/.codespellignore @grafana/docs-tooling
/docs/sources/ @irenerl24
/docs/sources/alerting/ @brendamuir
/docs/sources/alerting/ @JohnnyK-Grafana
/docs/sources/dashboards/ @imatwawana
/docs/sources/datasources/ @lwandz13
/docs/sources/panels-visualizations/ @imatwawana
@@ -66,9 +66,13 @@
/scripts/go-workspace @grafana/grafana-app-platform-squad
/hack/ @grafana/grafana-app-platform-squad
/apps/alerting/ @grafana/alerting-backend @grafana/alerting-frontend
/pkg/apis/provisioning @grafana/grafana-git-ui-sync-team
/pkg/registry/apis/provisioning @grafana/grafana-git-ui-sync-team
/apps/alerting/ @grafana/alerting-backend
/apps/playlist/ @grafana/grafana-app-platform-squad
/apps/investigation/ @fcjack @matryer
/apps/investigations/ @fcjack @matryer @svennergr
/apps/advisor/ @grafana/plugins-platform-backend
/pkg/api/ @grafana/grafana-backend-group
/pkg/apis/ @grafana/grafana-app-platform-squad
/pkg/apis/query @grafana/grafana-datasources-core-services
@@ -237,6 +241,7 @@
/devenv/dev-dashboards/extensions/ @grafana/plugins-platform-frontend
/devenv/docker/blocks/alert_webhook_listener/ @grafana/alerting-backend
/devenv/docker/blocks/stateful_webhook/ @grafana/alerting-backend
/devenv/docker/blocks/caddy_tls/ @grafana/alerting-backend
/devenv/docker/blocks/clickhouse/ @grafana/partner-datasources
/devenv/docker/blocks/collectd/ @grafana/observability-metrics
@@ -376,6 +381,11 @@
/crowdin.yml @grafana/grafana-frontend-platform
/public/locales/ @grafana/grafana-frontend-platform
/public/locales/de-DE @grafanabot
/public/locales/es-ES @grafanabot
/public/locales/fr-FR @grafanabot
/public/locales/pt-BR @grafanabot
/public/locales/zh-Hans @grafanabot
/public/app/core/internationalization/ @grafana/grafana-frontend-platform
/e2e/ @grafana/grafana-frontend-platform
/e2e/cloud-plugins-suite/ @grafana/partner-datasources
@@ -401,7 +411,7 @@
/packages/grafana-schema/src/**/*canvas* @grafana/dataviz-squad
/packages/grafana-schema/src/**/*tempo* @grafana/observability-traces-and-profiling
/packages/grafana-sql/ @grafana/partner-datasources @grafana/oss-big-tent
/packages/grafana-ui/.storybook/ @grafana/plugins-platform-frontend
/packages/grafana-ui/.storybook/ @grafana/grafana-frontend-platform
/packages/grafana-ui/src/components/ @grafana/grafana-frontend-platform
/packages/grafana-ui/src/components/BarGauge/ @grafana/dataviz-squad
/packages/grafana-ui/src/components/DataLinks/ @grafana/dataviz-squad
@@ -420,9 +430,7 @@
/packages/grafana-ui/src/graveyard/Graph/ @grafana/dataviz-squad
/packages/grafana-ui/src/graveyard/GraphNG/ @grafana/dataviz-squad
/packages/grafana-ui/src/graveyard/TimeSeries/ @grafana/dataviz-squad
/packages/grafana-ui/src/utils/storybook/ @grafana/plugins-platform-frontend
/plugins-bundled/ @grafana/plugins-platform-frontend
/packages/grafana-ui/src/utils/storybook/ @grafana/grafana-frontend-platform
# root files, mostly frontend
/.browserslistrc @grafana/frontend-ops
@@ -436,6 +444,7 @@
/.betterer.eslint.config.js @grafana/frontend-ops
/.gitattributes @grafana/frontend-ops
/.gitignore @grafana/frontend-ops
/.ignore @grafana/frontend-ops
/.nvmrc @grafana/frontend-ops
/.prettierignore @grafana/frontend-ops
/.yarn @grafana/frontend-ops
@@ -456,6 +465,7 @@
playwright.config.ts @grafana/plugins-platform-frontend
# public folder
/public/app/api/ @grafana/grafana-frontend-platform
/public/app/core/ @grafana/grafana-frontend-platform
/public/app/core/components/TimePicker/ @grafana/grafana-frontend-platform
/public/app/core/components/Layers/ @grafana/dataviz-squad
@@ -492,6 +502,7 @@ playwright.config.ts @grafana/plugins-platform-frontend
/public/app/features/explore/ @grafana/observability-traces-and-profiling
/public/app/features/expressions/ @grafana/observability-metrics
/public/app/features/folders/ @grafana/grafana-frontend-platform
/public/app/features/iam/ @grafana/grafana-frontend-platform
/public/app/features/inspector/ @grafana/dashboards-squad
/public/app/features/invites/ @grafana/grafana-frontend-platform
/public/app/features/library-panels/ @grafana/dashboards-squad
@@ -505,7 +516,6 @@ playwright.config.ts @grafana/plugins-platform-frontend
/public/app/features/playlist/ @grafana/dashboards-squad
/public/app/features/plugins/ @grafana/plugins-platform-frontend
/public/app/features/profile/ @grafana/grafana-frontend-platform
/public/app/features/query-library/ @grafana/grafana-frontend-platform
/public/app/features/runtime/ @ryantxu
/public/app/features/query/ @grafana/dashboards-squad
/public/app/features/sandbox/ @grafana/grafana-frontend-platform
@@ -534,6 +544,7 @@ playwright.config.ts @grafana/plugins-platform-frontend
/public/app/plugins/panel/heatmap/ @grafana/dataviz-squad
/public/app/plugins/panel/histogram/ @grafana/dataviz-squad
/public/app/plugins/panel/logs/ @grafana/observability-logs
/public/app/plugins/panel/logs-new/ @grafana/observability-logs
/public/app/plugins/panel/nodeGraph/ @grafana/observability-traces-and-profiling @grafana/app-o11y-visualizations
/public/app/plugins/panel/traces/ @grafana/observability-traces-and-profiling
/public/app/plugins/panel/flamegraph/ @grafana/observability-traces-and-profiling
@@ -582,6 +593,7 @@ playwright.config.ts @grafana/plugins-platform-frontend
/public/app/features/explore/NodeGraph/ @grafana/observability-traces-and-profiling
/public/app/features/explore/FlameGraph/ @grafana/observability-traces-and-profiling
/public/app/features/explore/TraceView/ @grafana/observability-traces-and-profiling
/public/app/features/explore/QueryLibrary/ @grafana/grafana-frontend-platform
/public/api-merged.json @grafana/grafana-backend-group
/public/api-enterprise-spec.json @grafana/grafana-backend-group
@@ -594,9 +606,6 @@ playwright.config.ts @grafana/plugins-platform-frontend
/public/app/AppWrapper.tsx @grafana/frontend-ops
/public/app/partials/ @grafana/grafana-frontend-platform
/scripts/benchmark-access-control.sh @grafana/access-squad
/scripts/check-breaking-changes.sh @grafana/plugins-platform-frontend
/scripts/ci-* @grafana/grafana-developer-enablement-squad
@@ -621,6 +630,7 @@ playwright.config.ts @grafana/plugins-platform-frontend
/scripts/cleanup-husky.sh @grafana/frontend-ops
/scripts/verify-repo-update/ @grafana/grafana-developer-enablement-squad
/scripts/generate-rtk-apis.ts @grafana/grafana-frontend-platform
/scripts/process-specs.ts @grafana/grafana-frontend-platform
/scripts/generate-alerting-rtk-apis.ts @grafana/alerting-frontend
/scripts/levitate-parse-json-report.js @grafana/plugins-platform-frontend
/scripts/levitate-show-affected-plugins.js @grafana/plugins-platform-frontend
@@ -634,9 +644,6 @@ playwright.config.ts @grafana/plugins-platform-frontend
.betterer.results @grafanabot
.betterer.ts @grafana/grafana-frontend-platform
# @grafana/ui component documentation
*.mdx @grafana/plugins-platform-frontend
# Design system
/public/img/icons/unicons/ @grafana/design-system
@@ -727,6 +734,7 @@ embed.go @grafana/grafana-as-code
/pkg/registry/apis/alerting @grafana/grafana-app-platform-squad @grafana/alerting-backend
/pkg/registry/apis/query @grafana/grafana-datasources-core-services
/pkg/registry/apis/userstorage @grafana/grafana-app-platform-squad @grafana/plugins-platform-backend
/pkg/registry/apps/advisor @grafana/plugins-platform-backend
/pkg/codegen/ @grafana/grafana-as-code
/pkg/codegen/generators @grafana/grafana-as-code
/pkg/kinds/*/*_gen.go @grafana/grafana-as-code
@@ -746,6 +754,7 @@ embed.go @grafana/grafana-as-code
/.github/pr-checks.json @tolzhabayev
/.github/pr-commands.json @tolzhabayev
/.github/renovate.json5 @grafana/frontend-ops
/.github/workflows/add-to-whats-new.yml @grafana/docs-tooling
/.github/workflows/auto-triager/ @grafana/plugins-platform-frontend
/.github/workflows/alerting-swagger-gen.yml @grafana/alerting-backend
/.github/workflows/auto-milestone.yml @grafana/grafana-developer-enablement-squad
@@ -754,11 +763,14 @@ embed.go @grafana/grafana-as-code
/.github/workflows/close-milestone.yml @grafana/grafana-developer-enablement-squad
/.github/workflows/release-pr.yml @grafana/grafana-developer-enablement-squad
/.github/workflows/release-comms.yml @grafana/grafana-developer-enablement-squad
/.github/workflows/migrate-prs.yml @grafana/grafana-developer-enablement-squad
/.github/workflows/create-next-release-branch.yml @grafana/grafana-developer-enablement-squad
/.github/workflows/codeowners-validator.yml @tolzhabayev
/.github/workflows/codeql-analysis.yml @DanCech
/.github/workflows/commands.yml @torkelo
/.github/workflows/community-release.yml @grafana/grafana-developer-enablement-squad
/.github/workflows/detect-breaking-changes-* @grafana/plugins-platform-frontend
/.github/workflows/documentation-ci.yml @grafana/docs-tooling
/.github/workflows/doc-validator.yml @grafana/docs-tooling
/.github/workflows/deploy-pr-preview.yml @grafana/docs-tooling
/.github/workflows/epic-add-to-platform-ux-parent-project.yml @meanmina
@@ -776,16 +788,16 @@ embed.go @grafana/grafana-as-code
/.github/workflows/publish-technical-documentation-next.yml @grafana/docs-tooling
/.github/workflows/publish-technical-documentation-release.yml @grafana/docs-tooling
/.github/workflows/remove-milestone.yml @grafana/grafana-developer-enablement-squad
/.github/workflows/sbom-report.yml @grafana/security-team
/.github/workflows/scripts/json-file-to-job-output.js @grafana/plugins-platform-frontend
/.github/workflows/stale.yml @grafana/grafana-developer-enablement-squad
/.github/workflows/update-changelog.yml @grafana/grafana-developer-enablement-squad
/.github/workflows/update-make-docs.yml @grafana/docs-tooling
/.github/workflows/scripts/kinds/verify-kinds.go @grafana/platform-cat
/.github/workflows/publish-kinds-next.yml @grafana/platform-cat
/.github/workflows/publish-kinds-release.yml @grafana/platform-cat
/.github/workflows/verify-kinds.yml @grafana/platform-cat
/.github/workflows/scripts/kinds/verify-kinds.go @grafana/platform-monitoring
/.github/workflows/publish-kinds-next.yml @grafana/platform-monitoring
/.github/workflows/publish-kinds-release.yml @grafana/platform-monitoring
/.github/workflows/verify-kinds.yml @grafana/platform-monitoring
/.github/workflows/dashboards-issue-add-label.yml @grafana/dashboards-squad
/.github/workflows/run-schema-v2-e2e.yml @grafana/dashboards-squad
/.github/workflows/ephemeral-instances-pr-comment.yml @grafana/grafana-backend-services-squad
/.github/workflows/create-security-patch-from-security-mirror.yml @grafana/grafana-developer-enablement-squad
/.github/workflows/core-plugins-build-and-release.yml @grafana/plugins-platform-frontend @grafana/plugins-platform-backend

View File

@@ -8,7 +8,7 @@ updates:
directories:
- "/"
- "/apps/playlist"
- "/apps/investigation"
- "/apps/investigations"
- "/pkg/aggregator"
- "/pkg/apimachinery"
- "/pkg/apiserver"

View File

@@ -14,7 +14,6 @@
"public/**/*",
"packages/**/*",
"e2e/**/*",
"plugins-bundled/**/*",
"scripts/build/release-packages.sh",
"scripts/circle-release-next-packages.sh",
"scripts/ci-frontend-metrics.sh",
@@ -248,7 +247,8 @@
"/pkg/services/sqlstore/migrations/ualert/**/*",
"/pkg/services/alerting/**/*",
"/public/app/features/alerting/**/*",
"/pkg/tests/api/alerting/**/*"
"/pkg/tests/api/alerting/**/*",
"/pkg/tests/alertmanager/**/*"
],
"action": "updateLabel",
"addLabel": "area/alerting"
@@ -437,4 +437,4 @@
"action": "updateLabel",
"addLabel": "area/panel/table"
}
]
]

View File

@@ -13,13 +13,12 @@
"slate-react", // we don't want to continue using this on the long run, use Monaco editor instead of Slate
"@types/slate-react", // we don't want to continue using this on the long run, use Monaco editor instead of Slate
"@types/slate", // we don't want to continue using this on the long run, use Monaco editor instead of Slate
"storybook-dark-mode", // 4.0.2 causes storybook 8.4 to break with react hooks errors
// Temporarily pause updating lerna and nx until we resolve build issues
"lerna",
"nx"
],
includePaths: ["package.json", "packages/**", "public/app/plugins/**"],
ignorePaths: ["emails/**", "plugins-bundled/**", "**/mocks/**"],
ignorePaths: ["emails/**", "**/mocks/**"],
labels: ["area/frontend", "dependencies", "no-changelog"],
postUpdateOptions: ["yarnDedupeHighest"],
packageRules: [

View File

@@ -69,8 +69,17 @@ const graphql = async (ghtoken, query, variables) => {
},
body: JSON.stringify({ query, variables }),
});
const { data } = await results.json();
return data;
const res = await results.json();
LOG(
JSON.stringify({
status: results.status,
text: results.statusText,
})
);
return res.data;
};
// Using Github GraphQL API find the timestamp for the given tag/commit hash.
@@ -99,20 +108,20 @@ const getCommitishDate = async (name, owner, target) => {
// Using Github GraphQL API get a list of PRs between the two "commitish" items.
// This resoves the "since" item's timestamp first and iterates over all PRs
// till "target" using naïve pagination.
const getHistory = async (name, owner, target, sinceDate) => {
LOG(`Fetching ${owner}/${name} PRs since ${sinceDate} till ${target}`);
const getHistory = async (name, owner, from, to) => {
LOG(`Fetching ${owner}/${name} PRs between ${from} and ${to}`);
const query = `
query findCommitsWithAssociatedPullRequests(
$name: String!
$owner: String!
$target: String!
$sinceDate: GitTimestamp
$from: String!
$to: String!
$cursor: String
) {
repository(name: $name, owner: $owner) {
object(expression: $target) {
... on Commit {
history(first: 50, since: $sinceDate, after: $cursor) {
ref(qualifiedName: $from) {
compare(headRef: $to) {
commits(first: 25, after: $cursor) {
totalCount
pageInfo {
hasNextPage
@@ -155,13 +164,13 @@ const getHistory = async (name, owner, target, sinceDate) => {
const result = await graphql(ghtoken, query, {
name,
owner,
target,
sinceDate,
from,
to,
cursor,
});
LOG(`GraphQL: ${JSON.stringify(result)}`);
nodes = [...nodes, ...result.repository.object.history.nodes];
const { hasNextPage, endCursor } = result.repository.object.history.pageInfo;
nodes = [...nodes, ...result.repository.ref.compare.commits.nodes];
const { hasNextPage, endCursor } = result.repository.ref.compare.commits.pageInfo;
if (!hasNextPage) {
break;
}
@@ -175,11 +184,11 @@ const getHistory = async (name, owner, target, sinceDate) => {
// feature, deprecation, breaking change and plugin fixes/enhancements).
//
// PR grouping relies on Github labels only, not on the PR contents.
const getChangeLogItems = async (name, owner, sinceDate, to) => {
const getChangeLogItems = async (name, owner, from, to) => {
// check if a node contains a certain label
const hasLabel = ({ labels }, label) => labels.nodes.some(({ name }) => name === label);
// get all the PRs between the two "commitish" items
const history = await getHistory(name, owner, to, sinceDate);
const history = await getHistory(name, owner, from, to);
const items = history.flatMap((node) => {
// discard PRs without a "changelog" label
@@ -231,13 +240,10 @@ const previous = process.argv[3] || process.env.INPUT_PREVIOUS || (await getPrev
LOG(`Previous tag/commit: ${previous}`);
const sinceDate = await getCommitishDate('grafana', 'grafana', previous);
LOG(`Previous tag/commit timestamp: ${sinceDate}`);
// Get all changelog items from Grafana OSS
const oss = await getChangeLogItems('grafana', 'grafana', sinceDate, target);
const oss = await getChangeLogItems('grafana', 'grafana', previous, target);
// Get all changelog items from Grafana Enterprise
const entr = await getChangeLogItems('grafana-enterprise', 'grafana', sinceDate, target);
const entr = await getChangeLogItems('grafana-enterprise', 'grafana', previous, target);
LOG(`Found OSS PRs: ${oss.length}`);
LOG(`Found Enterprise PRs: ${entr.length}`);

16
.github/workflows/add-to-whats-new.yml vendored Normal file
View File

@@ -0,0 +1,16 @@
name: Add comment about adding a What's new note
on:
pull_request:
types: [labeled]
jobs:
add-comment:
if: ${{ ! github.event.pull_request.head.repo.fork && contains(github.event.pull_request.labels.*.name, 'add to what''s new') }}
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: marocchino/sticky-pull-request-comment@52423e01640425a022ef5fd42c6fb5f633a02728 # v2.9.1
with:
message: |
Since you've added the `Add to what's new` label, consider drafting a [What's new note](https://admin.grafana.com/content-admin/#/collections/whats-new/new) for this feature.

View File

@@ -10,24 +10,18 @@ jobs:
if: github.repository == 'grafana/grafana'
runs-on: ubuntu-latest
steps:
- name: Checkout Actions
- name: Checkout
uses: actions/checkout@v4
with:
repository: "grafana/grafana-github-actions"
path: ./actions
ref: main
- name: Install Actions
run: npm install --production --prefix ./actions
- name: "Generate token"
id: generate_token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
with:
app_id: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }}
private_key: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }}
- run: git config --global user.email '132647405+grafana-delivery-bot[bot]@users.noreply.github.com'
- run: git config --global user.name 'grafana-delivery-bot[bot]'
- run: git remote set-url origin "https://grafana-delivery-bot:${{ steps.generate_token.outputs.token }}@github.com/grafana/grafana.git"
- name: Run backport
uses: ./actions/backport
uses: grafana/grafana-github-actions-go/backport@main
with:
metricsWriteAPIKey: ${{secrets.GRAFANA_MISC_STATS_API_KEY}}
token: ${{ steps.generate_token.outputs.token }}
labelsToAdd: "backport"
title: "[{{base}}] {{originalTitle}}"

View File

@@ -0,0 +1,43 @@
name: Create next release branch
on:
workflow_call:
inputs:
ownerRepo:
type: string
description: Owner/repo of the repository where the branch is created (e.g. 'grafana/grafana')
required: true
source:
description: The release branch to increment (eg providing `release-11.2.3` will result in `release-11.2.4` being created)
type: string
required: true
secrets:
token:
required: true
outputs:
branch:
description: The new branch that was created
value: ${{ jobs.main.outputs.branch }}
workflow_dispatch:
inputs:
ownerRepo:
description: Owner/repo of the repository where the branch is created (e.g. 'grafana/grafana')
source:
description: The release branch to increment (eg providing `release-11.2.3` will result in `release-11.2.4` being created)
type: string
required: true
secrets:
token:
required: true
jobs:
main:
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.branch.outputs.branch }}
steps:
- name: Create release branch
id: branch
uses: grafana/grafana-github-actions-go/bump-release@main
with:
ownerRepo: ${{ inputs.ownerRepo }}
source: ${{ inputs.source }}
token: ${{ secrets.token }}

View File

@@ -11,6 +11,7 @@ on:
branches:
- "main"
- "v*.*.*"
- "release-*.*.*"
# This is run before the pull request has been merged, so we'll run against the src branch
jobs:

19
.github/workflows/documentation-ci.yml vendored Normal file
View File

@@ -0,0 +1,19 @@
name: Documentation CI
on:
pull_request:
branches: ["main"]
paths: ["docs/sources/**"]
workflow_dispatch:
jobs:
vale:
runs-on: ubuntu-latest
container:
image: grafana/vale:latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: grafana/writers-toolkit/vale-action@vale-action/v1
with:
filter: '.Name in ["Grafana.WordList", "Grafana.Spelling", "Grafana.ProductPossessives"]'
token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -3,7 +3,7 @@ name: Crowdin Download Action
on:
workflow_dispatch:
schedule:
- cron: "0 * * * *"
- cron: "0 0 * * *"
jobs:
download-sources-from-crowdin:
@@ -12,6 +12,7 @@ jobs:
permissions:
contents: write # needed to commit changes into the PR
pull-requests: write # needed to update PR description, labels, etc
id-token: write # needed to get vault secrets
steps:
- name: Generate token
@@ -41,17 +42,11 @@ jobs:
pull_request_body: |
:robot: Automatic download of translations from Crowdin.
Steps for merging:
1. A quick sanity check of the changes and approve. Things to look out for:
- No changes in the English file. The source of truth is in the main branch, NOT in Crowdin.
- Translations maybe be removed if the English phrase was removed, but there should not be many of these
- Anything else that looks 'funky'. Ask if you're not sure.
2. Approve & (Auto-)merge. :tada:
This runs once per day and will merge automatically if all the required checks pass.
If there's a conflict, close the pull request and **delete the branch**. A GH action will recreate the pull request.
Remember, the longer this pull request is open, the more likely it is that it'll get conflicts.
If there's a conflict, close the pull request and **delete the branch**.
You can then either wait for the schedule to trigger a new PR, or rerun the action manually.
pull_request_labels: 'area/frontend, area/internationalization, no-changelog, no-backport'
pull_request_reviewers: 'grafana-frontend-platform'
pull_request_base_branch_name: 'main'
base_url: 'https://grafana.api.crowdin.com'
config: 'crowdin.yml'
@@ -119,3 +114,45 @@ jobs:
with:
pr: ${{ steps.crowdin-download.outputs.pull_request_number }}
token: ${{ steps.generate_token.outputs.token }}
- name: Get vault secrets
id: vault-secrets
uses: grafana/shared-workflows/actions/get-vault-secrets@main
with:
# Secrets placed in ci/repo/grafana/grafana/grafana-pr-approver
repo_secrets: |
GRAFANA_PR_APPROVER_APP_ID=grafana-pr-approver:app-id
GRAFANA_PR_APPROVER_APP_PEM=grafana-pr-approver:private-key
- name: Generate approver token
if: steps.crowdin-download.outputs.pull_request_url
id: generate_approver_token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
with:
app_id: ${{ env.GRAFANA_PR_APPROVER_APP_ID }}
private_key: ${{ env.GRAFANA_PR_APPROVER_APP_PEM }}
- name: Approve and automerge PR
if: steps.crowdin-download.outputs.pull_request_url
shell: bash
# Only approve if:
# - the PR does not modify files other than json files under the public/locales/ directory
# - the PR does not modify the en-US locale
run: |
filesChanged=$(gh pr diff --name-only ${{ steps.crowdin-download.outputs.pull_request_url }})
if [[ $(echo $filesChanged | grep -v 'public/locales/[a-zA-Z\-]*/grafana.json' | wc -l) -ne 0 ]]; then
echo "Non-i18n changes detected, not approving"
exit 1
fi
if [[ $(echo $filesChanged | grep "public/locales/en-US" | wc -l) -ne 0 ]]; then
echo "public/locales/en-US changes detected, not approving"
exit 1
fi
echo "Approving and enabling automerge"
gh pr review ${{ steps.crowdin-download.outputs.pull_request_url }} --approve
gh pr merge --auto --squash ${{ steps.crowdin-download.outputs.pull_request_url }}
env:
GITHUB_TOKEN: ${{ steps.generate_approver_token.outputs.token }}

50
.github/workflows/migrate-prs.yml vendored Normal file
View File

@@ -0,0 +1,50 @@
name: Migrate open PRs
# Migrate open PRs from a superseded release branch to the current release branch and notify authors
on:
workflow_call:
inputs:
from:
description: 'The base branch to check for open PRs'
required: true
type: string
to:
description: 'The base branch to migrate open PRs to'
required: true
type: string
ownerRepo:
description: Owner/repo of the repository where the branch is created (e.g. 'grafana/grafana')
required: true
type: string
secrets:
token:
required: true
workflow_dispatch:
inputs:
from:
description: 'The base branch to check for open PRs'
required: true
type: string
to:
description: 'The base branch to migrate open PRs to'
required: true
type: string
ownerRepo:
description: Owner/repo of the repository where the branch is created (e.g. 'grafana/grafana')
required: true
type: string
secrets:
token:
required: true
jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Migrate PRs
uses: grafana/grafana-github-actions-go/migrate-open-prs@main
with:
token: ${{ secrets.token }}
ownerRepo: ${{ inputs.ownerRepo }}
from: ${{ inputs.from }}
to: ${{ inputs.to }}
binary_release_tag: 'dev'

View File

@@ -3,7 +3,7 @@ name: publish-technical-documentation-release
on:
push:
branches:
- v[0-9]+.[0-9]+.x
- release-[0-9]+.[0-9]+.[0-9]+
tags:
- v[0-9]+.[0-9]+.[0-9]+
paths:
@@ -23,7 +23,7 @@ jobs:
- uses: grafana/writers-toolkit/publish-technical-documentation-release@publish-technical-documentation-release/v2
with:
release_tag_regexp: "^v(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"
release_branch_regexp: "^v(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.x$"
release_branch_with_patch_regexp: "^v(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"
release_branch_regexp: "^release-(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"
release_branch_with_patch_regexp: "^release-(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"
website_directory: content/docs/grafana
version_suffix: ""

View File

@@ -27,10 +27,18 @@ jobs:
name: Setup and establish latest
outputs:
version: ${{ steps.output.outputs.version }}
release_branch: ${{ steps.output.outputs.release_branch }}
dry_run: ${{ steps.output.outputs.dry_run }}
latest: ${{ steps.output.outputs.latest }}
token: ${{ steps.output.outputs.token }}
runs-on: ubuntu-latest
steps:
- name: "Generate token"
id: generate_token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
with:
app_id: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }}
private_key: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }}
# The github-release action expects a `LATEST` value of a string of either '1' or '0'
- if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
@@ -49,9 +57,51 @@ jobs:
echo "latest: $LATEST"
echo "version: $VERSION"
echo "release_branch=$(echo $VERSION | sed -s 's/^v/release-/g')" >> "$GITHUB_OUTPUT"
echo "token=${{ steps.generate_token.outputs.token }}" >> "$GITHUB_OUTPUT"
echo "dry_run=$DRY_RUN" >> "$GITHUB_OUTPUT"
echo "latest=$LATEST" >> "$GITHUB_OUTPUT"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
create_next_release_branch_grafana:
name: Create next release branch (Grafana)
needs: setup
uses: ./.github/workflows/create-next-release-branch.yml
with:
ownerRepo: 'grafana/grafana'
source: ${{ needs.setup.outputs.release_branch }}
secrets:
token: ${{ needs.setup.outputs.token }}
create_next_release_branch_enterprise:
name: Create next release branch (Grafana Enterprise)
needs: setup
uses: ./.github/workflows/create-next-release-branch.yml
with:
ownerRepo: 'grafana/grafana'
source: ${{ needs.setup.outputs.release_branch }}
secrets:
token: ${{ needs.setup.outputs.token }}
migrate_prs_grafana:
needs:
- setup
- create_next_release_branch_grafana
uses: ./.github/workflows/migrate-prs.yml
with:
ownerRepo: 'grafana/grafana'
from: ${{ needs.setup.outputs.release_branch }}
to: ${{ needs.create_next_release_branch_grafana.outputs.branch }}
secrets:
token: ${{ needs.setup.outputs.token }}
migrate_prs_enterprise:
needs:
- setup
- create_next_release_branch_enterprise
uses: ./.github/workflows/migrate-prs.yml
with:
ownerRepo: 'grafana/grafana-enterprise'
from: ${{ needs.setup.outputs.release_branch }}
to: ${{ needs.create_next_release_branch_enterprise.outputs.branch }}
secrets:
token: ${{ needs.setup.outputs.token }}
post_changelog_on_forum:
needs: setup
uses: ./.github/workflows/community-release.yml

View File

@@ -4,7 +4,7 @@
# Please refrain from including any processes that do not result in code changes in this workflow. Instead, they should
# either be triggered in the release promotion process or in the release comms process (that is triggered by merging
# this PR).
name: Complete a Grafana release
name: Grafana Release PR
on:
workflow_dispatch:
inputs:
@@ -19,7 +19,7 @@ on:
target:
required: true
type: string
description: The base branch that these changes are being merged into
description: The release branch pattern (eg v9.5.x) that these changes are being merged into
backport:
required: false
type: string
@@ -61,10 +61,17 @@ jobs:
with:
app_id: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }}
private_key: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }}
- name: Get release branch
id: branch
uses: grafana/grafana-github-actions-go/latest-release-branch@main
with:
token: ${{ steps.generate_token.outputs.token }}
ownerRepo: 'grafana/grafana'
pattern: ${{ inputs.target }}
- name: Checkout Grafana
uses: actions/checkout@v4
with:
ref: ${{ inputs.target }}
ref: ${{ steps.branch.outputs.branch }}
fetch-depth: 0
fetch-tags: true
- name: Checkout Grafana (main)
@@ -124,7 +131,6 @@ jobs:
rm -f CHANGELOG.part changelog_items.md
git diff CHANGELOG.md
- name: "Prettify CHANGELOG.md"
run: npx prettier --write CHANGELOG.md
- name: Commit CHANGELOG.md changes
@@ -137,7 +143,7 @@ jobs:
- name: Add package.json changes
run: |
git add package.json lerna.json yarn.lock packages public
git add package.json lerna.json yarn.lock packages public e2e/test-plugins
git commit -m "Update version to ${{ inputs.version }}"
- name: Git push
@@ -151,7 +157,7 @@ jobs:
$( [ "x${{ inputs.latest }}" == "xtrue" ] && printf %s '-l "release/latest"') \
-l "no-changelog" \
--dry-run=${{ inputs.dry_run }} \
-B "${{ inputs.target }}" \
-B "${{ steps.branch.outputs.branch }}" \
--title "Release: ${{ inputs.version }}" \
--body "These code changes must be merged after a release is complete"
env:
@@ -165,7 +171,7 @@ jobs:
-l "product-approved" \
-l "no-changelog" \
--dry-run=${{ inputs.dry_run }} \
-B "${{ inputs.target }}" \
-B "${{ steps.branch.outputs.branch }}" \
--title "Release: ${{ inputs.version }}" \
--body "These code changes must be merged after a release is complete"
env:

44
.github/workflows/run-schema-v2-e2e.yml vendored Normal file
View File

@@ -0,0 +1,44 @@
name: Run dashboard schema v2 e2e
on:
push:
branches:
- main
pull_request:
branches:
- '**'
env:
ARCH: linux-amd64
jobs:
dashboard-schema-v2-e2e:
runs-on: ubuntu-latest
continue-on-error: true
if: github.event.pull_request.draft == false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Pin Go version to mod file
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- run: go version
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
- name: Install dependencies
run: yarn install --immutable
- name: Build grafana
run: make build
- name: Install Cypress dependencies
uses: cypress-io/github-action@v6
with:
runTests: false
- name: Run dashboard scenes e2e
run: yarn e2e:schema-v2 || echo "Test failed but marking as success since schema V2 is behind a feature flag and should not block PRs"
- name: Always succeed # This is a workaround to make the job pass even if the previous step fails
if: failure()
run: exit 0

View File

@@ -1,15 +0,0 @@
name: syft-sbom-ci
on:
release:
types: [ published ]
workflow_dispatch:
jobs:
syft-sbom:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Anchore SBOM Action
uses: grafana/shared-workflows/actions@syft-sbom-v0.0.1
with:
artifact-name: ${{ github.event.repository.name }}-spdx.json

View File

@@ -27,11 +27,14 @@ jobs:
trivy fs --no-progress --download-db-only --db-repository public.ecr.aws/aquasecurity/trivy-db
- name: Run Trivy vulnerability scanner (table output)
# Use the trivy binary rather than the aquasecurity/trivy-action action
# to avoid a few bugs
# scan the filesystem, rather than building a Docker image prior - the
# downside is we won't catch dependencies that are only installed in the
# image, but the upside is we'll only catch vulnerabilities that are
# explicitly in the our dependencies
# to avoid a few bugs.
#
# We scan the file system rather than building the Docker image to only scan
# our direct dependencies. The Docker images are still scanned by
# Vulnerability Observability:
# - OSS: https://ops.grafana-ops.net/a/grafana-vulnerabilityobs-app/projects/sources/1
# - Enterprise: https://ops.grafana-ops.net/a/grafana-vulnerabilityobs-app/projects/sources/12
# (If these links are outdated, just go to the list and find the images manually.)
run: |
trivy fs \
--scanners vuln \

17
.gitignore vendored
View File

@@ -40,6 +40,7 @@ __debug_bin*
# This is the new place of the block, but I leave the previous here for a while
/devenv/docker/blocks/auth/saml-enterprise
/devenv/docker/blocks/auth/signer
/devenv/docker/blocks/spanner_tests
/tmp
tools/phantomjs/phantomjs
@@ -103,14 +104,18 @@ profile.cov
/pkg/cmd/grafana-cli/grafana-cli
/pkg/cmd/grafana-server/grafana-server
/pkg/cmd/grafana-server/debug
/pkg/extensions/*
/pkg/build/cmd/artifactspage.go
/pkg/build/cmd/artifactspage.tmpl.html
/pkg/build/cmd/exportversion.go
/pkg/server/wireexts_enterprise.go
# Extensions
/pkg/cmd/grafana-cli/runner/wireexts_enterprise.go
/pkg/server/wireexts_enterprise.go
/pkg/build/cmd/enterprise.go
/pkg/extensions/*
!/pkg/extensions/.keep
!/pkg/extensions/main.go
/public/app/extensions
!/public/app/extensions/.keep
debug.test
/examples/*/dist
/packaging/**/*.rpm
@@ -170,13 +175,13 @@ compilation-stats.json
/e2e/benchmarks/**/results
/e2e/build_results.zip
/e2e/extensions
!/e2e/extensions/.keep
/e2e/extensions-suite
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
/playwright/.auth/
# grafana server
/scripts/grafana-server/server.log

View File

@@ -191,10 +191,10 @@ linters-settings:
allow: []
deny:
- pkg: github.com/grafana/grafana/pkg
desc: apps/investigation is not allowed to import grafana core
desc: apps/investigations is not allowed to import grafana core
files:
- ./apps/investigation/*
- ./apps/investigation/**/*
- ./apps/investigations/*
- ./apps/investigations/**/*
gocritic:
enabled-checks:
- ruleguard

22
.ignore Normal file
View File

@@ -0,0 +1,22 @@
# This is a trick to ignore files only by git but not by other tools
!/public/app/extensions
!/pkg/extensions/*
!/pkg/cmd/grafana-cli/runner/wireexts_enterprise.go
!/pkg/server/wireexts_enterprise.go
!/pkg/build/cmd/enterprise.go
!/pkg/extensions/*
# Enterprise emails
!/emails/templates/enterprise_*
!/public/emails/enterprise_*
# Enterprise reporting fonts
!/public/fonts/dejavu
# Enterprise devenv
!/devenv/docker/blocks/grafana-enterprise
!/devenv/docker/blocks/saml-enterprise
# This is the new place of the block, but I leave the previous here for a while
!/devenv/docker/blocks/auth/saml-enterprise
!/devenv/docker/blocks/auth/signer
!/devenv/docker/blocks/spanner_tests

5
.vale.ini Normal file
View File

@@ -0,0 +1,5 @@
MinAlertLevel = warning
[*]
BasedOnStyles = Grafana
TokenIgnores = (<http[^\n]+>+?), \*\*[^\n]+\*\*

28
.vscode/launch.json vendored
View File

@@ -9,12 +9,7 @@
"program": "${workspaceFolder}/pkg/cmd/grafana/",
"env": {},
"cwd": "${workspaceFolder}",
"args": [
"server",
"--homepath", "${workspaceFolder}",
"--packaging", "dev",
"cfg:app_mode=development",
]
"args": ["server", "--homepath", "${workspaceFolder}", "--packaging", "dev", "cfg:app_mode=development"]
},
{
"name": "Attach to Test Process",
@@ -23,7 +18,7 @@
"mode": "remote",
"host": "127.0.0.1",
"port": 50480,
"apiVersion": 2,
"apiVersion": 2
},
{
"name": "Run API Server (testdata)",
@@ -72,6 +67,16 @@
"cwd": "${workspaceFolder}",
"args": ["server", "target", "--homepath", "${workspaceFolder}", "--packaging", "dev"]
},
{
"name": "Run Authz server",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/pkg/cmd/grafana/",
"env": { "GF_DEFAULT_TARGET": "zanzana-server", "GF_SERVER_HTTP_PORT": "3001" },
"cwd": "${workspaceFolder}",
"args": ["server", "target", "--homepath", "${workspaceFolder}", "--packaging", "dev"]
},
{
"name": "Attach to Chrome",
"port": 9222,
@@ -91,6 +96,15 @@
"NODE_ENV": "test"
}
},
{
"name": "Debug ESLint",
"type": "node",
"request": "launch",
"runtimeExecutable": "yarn",
"runtimeArgs": ["run", "eslint", "${file}"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
},
{
"name": "Debug Go test",
"type": "go",

View File

@@ -13,10 +13,6 @@ packageExtensions:
doctrine@3.0.0:
dependencies:
assert: 2.0.0
rc-time-picker@3.7.3:
peerDependencies:
react: 17.0.1
react-dom: 17.0.1
rc-trigger@2.6.5:
peerDependencies:
react: 17.0.1

View File

@@ -1,3 +1,296 @@
<!-- 11.5.1 START -->
# 11.5.1 (2025-02-03)
### Bug fixes
- **CodeEditor:** Fix cursor alignment [#99090](https://github.com/grafana/grafana/pull/99090), [@ashharrison90](https://github.com/ashharrison90)
- **TransformationFilter**: Include transformation outputs in transformation filtering options: Include transformation outputs in transformation filtering options [#98323](https://github.com/grafana/grafana/pull/98323), [@Sergej-Vlasov](https://github.com/Sergej-Vlasov)
<!-- 11.5.1 END -->
<!-- 11.5.0 START -->
# 11.5.0 (2025-01-28)
### Features and enhancements
- ** CloudMigration:** Create authapi service [#96581](https://github.com/grafana/grafana/pull/96581), [@leandro-deveikis](https://github.com/leandro-deveikis)
- **Alerting:** Add new button for exporting new alert rule in HCL format [#96785](https://github.com/grafana/grafana/pull/96785), [@soniaAguilarPeiron](https://github.com/soniaAguilarPeiron)
- **Alerting:** Add option to show inactive alerts in alert list panel [#96888](https://github.com/grafana/grafana/pull/96888), [@bradleypettit](https://github.com/bradleypettit)
- **Alerting:** Add state_periodic_save_batch_size config option [#98019](https://github.com/grafana/grafana/pull/98019), [@alexander-akhmetov](https://github.com/alexander-akhmetov)
- **Alerting:** Change default for max_attempts to 3. [#97461](https://github.com/grafana/grafana/pull/97461), [@stevesg](https://github.com/stevesg)
- **Alerting:** Consume k8s API for notification policies tree [#96147](https://github.com/grafana/grafana/pull/96147), [@konrad147](https://github.com/konrad147)
- **Alerting:** Enable flag alertingApiServer by default [#98282](https://github.com/grafana/grafana/pull/98282), [@yuri-tceretian](https://github.com/yuri-tceretian)
- **Alerting:** Explore button in Insights view [#96496](https://github.com/grafana/grafana/pull/96496), [@ppcano](https://github.com/ppcano)
- **Alerting:** Improve performance ash page [#97619](https://github.com/grafana/grafana/pull/97619), [@soniaAguilarPeiron](https://github.com/soniaAguilarPeiron)
- **Alerting:** Make alert rule policies preview use k8s API [#97070](https://github.com/grafana/grafana/pull/97070), [@tomratcliffe](https://github.com/tomratcliffe)
- **Alerting:** Return default builtin templates in k8s templategroup API and UI [#96330](https://github.com/grafana/grafana/pull/96330), [@JacobsonMT](https://github.com/JacobsonMT)
- **Alerting:** Simplify notification step [#96430](https://github.com/grafana/grafana/pull/96430), [@soniaAguilarPeiron](https://github.com/soniaAguilarPeiron)
- **Alerting:** Update state manager to take image only once per rule evaluation [#98289](https://github.com/grafana/grafana/pull/98289), [@yuri-tceretian](https://github.com/yuri-tceretian)
- **Analytics Views:** Deprecate :dashboardID endpoints in favor of uid/:dashboardUID (Enterprise)
- **Analytics:** Summaries: Deprecate dashboard_id endpoints in favor of dashboard_uid (Enterprise)
- **Announcement Banners:** Enable feature for all cloud tiers (Enterprise)
- **Announcement banner:** Remove feature toggle [#98782](https://github.com/grafana/grafana/pull/98782), [@Clarity-89](https://github.com/Clarity-89)
- **Announcement banner:** Remove feature toggle (Enterprise)
- **Announcement banner:** Sort by last updated (Enterprise)
- **Auth:** Return error when retries have been exhausted for OAuth token refresh [#98034](https://github.com/grafana/grafana/pull/98034), [@mgyongyosi](https://github.com/mgyongyosi)
- **Azure Monitor:** Add a feature flag to toggle user auth for Azure Monitor only [#96858](https://github.com/grafana/grafana/pull/96858), [@adamyeats](https://github.com/adamyeats)
- **Azure:** Improve Azure Prometheus exemplars UI/UX [#97198](https://github.com/grafana/grafana/pull/97198), [@aangelisc](https://github.com/aangelisc)
- **Azure:** Unify credentials in frontend for Prometheus [#96568](https://github.com/grafana/grafana/pull/96568), [@yjsong11](https://github.com/yjsong11)
- **Chore:** Bump Go to 1.23.4 [#98853](https://github.com/grafana/grafana/pull/98853), [@Proximyst](https://github.com/Proximyst)
- **Chore:** Bump Go to 1.23.4 (Enterprise)
- **Chore:** Remove experimental Storage UI [#96887](https://github.com/grafana/grafana/pull/96887), [@ryantxu](https://github.com/ryantxu)
- **Chore:** Update to node 22 [#97779](https://github.com/grafana/grafana/pull/97779), [@ashharrison90](https://github.com/ashharrison90)
- **CloudMigrations:** Enable feature toggle by default in 11.5 [#98686](https://github.com/grafana/grafana/pull/98686), [@mmandrus](https://github.com/mmandrus)
- **CloudMigrations:** Introduce RBAC role for migration assistant [#98588](https://github.com/grafana/grafana/pull/98588), [@macabu](https://github.com/macabu)
- **CloudWatch:** Add OpenSearch PPL and SQL support in Logs Insights [#97508](https://github.com/grafana/grafana/pull/97508), [@idastambuk](https://github.com/idastambuk)
- **CloudWatch:** Batch different time ranges separately [#98230](https://github.com/grafana/grafana/pull/98230), [@iwysiu](https://github.com/iwysiu)
- **Cloudwatch:** Accept empty string for logstimeout and mark errors downstream [#96947](https://github.com/grafana/grafana/pull/96947), [@iwysiu](https://github.com/iwysiu)
- **Cloudwatch:** Update grafana-aws-sdk for AWS/AmplifyHosting metrics [#97799](https://github.com/grafana/grafana/pull/97799), [@iwysiu](https://github.com/iwysiu)
- **Dashboard Scene:** Shows usages in variables list [#96000](https://github.com/grafana/grafana/pull/96000), [@harisrozajac](https://github.com/harisrozajac)
- **Dashboards:** Add option to specify explicit percent change text size for stat panels [#96952](https://github.com/grafana/grafana/pull/96952), [@XZCendence](https://github.com/XZCendence)
- **Dashboards:** Allow DashboardDS subqueries in MixedDS [#97116](https://github.com/grafana/grafana/pull/97116), [@mdvictor](https://github.com/mdvictor)
- **Dashboards:** Update docs of the `overwrite` param in Save Dashboard API Call [#97011](https://github.com/grafana/grafana/pull/97011), [@ArturWierzbicki](https://github.com/ArturWierzbicki)
- **Datasources:** Add toggle to control default behaviour of 'Manage alerts via Alerts UI' toggle [#98441](https://github.com/grafana/grafana/pull/98441), [@macabu](https://github.com/macabu)
- **Datasources:** Allow clearing trace to logs, metrics and profiles datasource pickers [#96554](https://github.com/grafana/grafana/pull/96554), [@adrapereira](https://github.com/adrapereira)
- **Docker:** Don't use legacy ENV syntax [#93218](https://github.com/grafana/grafana/pull/93218), [@simPod](https://github.com/simPod)
- **Elasticsearch:** Health endpoint should handle http errors [#96803](https://github.com/grafana/grafana/pull/96803), [@iwysiu](https://github.com/iwysiu)
- **Elasticsearch:** Use \_field_caps instead of \_mapping to get fields [#97607](https://github.com/grafana/grafana/pull/97607), [@iwysiu](https://github.com/iwysiu)
- **Explore Profiles:** Preinstall for onprem Grafana instances [#97775](https://github.com/grafana/grafana/pull/97775), [@ifrost](https://github.com/ifrost)
- **Explore metrics:** Consolidate filters with the OTel experience [#98371](https://github.com/grafana/grafana/pull/98371), [@bohandley](https://github.com/bohandley)
- **Explore:** Show links to queryless apps [#96625](https://github.com/grafana/grafana/pull/96625), [@ifrost](https://github.com/ifrost)
- **Expressions:** Add notification for Strict Mode behavior in Reduce component [#97224](https://github.com/grafana/grafana/pull/97224), [@shubhankarunhale](https://github.com/shubhankarunhale)
- **Faro:** Improve performance of TRACKING_URLS regex [#98022](https://github.com/grafana/grafana/pull/98022), [@kpelelis](https://github.com/kpelelis)
- **FeatureToggles:** Make newFiltersUI feature toggle generally available [#97460](https://github.com/grafana/grafana/pull/97460), [@Sergej-Vlasov](https://github.com/Sergej-Vlasov)
- **Features:** Remove cloudwatchMetricInsightsCrossAccount feature toggle [#98826](https://github.com/grafana/grafana/pull/98826), [@idastambuk](https://github.com/idastambuk)
- **Frontend Sandbox:** Add switch to toggle plugins frontend sandbox via catalog UI (Enterprise)
- **Graphite:** Set `maxDataPoints` based on user value in alerting [#97178](https://github.com/grafana/grafana/pull/97178), [@aangelisc](https://github.com/aangelisc)
- **Licensing:** Tidy up license token database code (Enterprise)
- **LoginAttempt:** Add setting to control max number of attempts before user login gets locked [#97091](https://github.com/grafana/grafana/pull/97091), [@kalleep](https://github.com/kalleep)
- **Logs Panel:** Add infinite scrolling support for Dashboards and Apps [#97095](https://github.com/grafana/grafana/pull/97095), [@matyax](https://github.com/matyax)
- **Logs Panel:** Allow text selection without changing Log Details state [#96995](https://github.com/grafana/grafana/pull/96995), [@matyax](https://github.com/matyax)
- **Logs Panel:** Limit displayed characters to MAX_CHARACTERS [#96997](https://github.com/grafana/grafana/pull/96997), [@matyax](https://github.com/matyax)
- **Logs:** Added option to show the log line body when displayed fields are used [#97209](https://github.com/grafana/grafana/pull/97209), [@matyax](https://github.com/matyax)
- **Logs:** Added support to disable and re-enable the popover menu [#98254](https://github.com/grafana/grafana/pull/98254), [@matyax](https://github.com/matyax)
- **Logs:** Allow scroll to reach the bottom of the log list before loading more [#96668](https://github.com/grafana/grafana/pull/96668), [@matyax](https://github.com/matyax)
- **Loki:** Added support for disabled operations in Query Builder [#96751](https://github.com/grafana/grafana/pull/96751), [@matyax](https://github.com/matyax)
- **Loki:** Added support to show label types in Log Details [#97284](https://github.com/grafana/grafana/pull/97284), [@matyax](https://github.com/matyax)
- **Loki:** Allow regex in `label` derived field [#96609](https://github.com/grafana/grafana/pull/96609), [@svennergr](https://github.com/svennergr)
- **Loki:** Hide internal labels [#97323](https://github.com/grafana/grafana/pull/97323), [@svennergr](https://github.com/svennergr)
- **Loki:** Sync query direction with sort order in Explore and Dashboards [#98722](https://github.com/grafana/grafana/pull/98722), [@matyax](https://github.com/matyax)
- **OAuth:** Support client_secret_jwt for oauth providers when doing token exchange [#95455](https://github.com/grafana/grafana/pull/95455), [@naizerjohn-ms](https://github.com/naizerjohn-ms)
- **OAuth:** Use the attached external session data in OAuthToken and OAuthTokenSync [#96655](https://github.com/grafana/grafana/pull/96655), [@mgyongyosi](https://github.com/mgyongyosi)
- **Org Selection:** Show correct selected org when select is open [#96601](https://github.com/grafana/grafana/pull/96601), [@yincongcyincong](https://github.com/yincongcyincong)
- **PDF:** Add new zoom options (Enterprise)
- **Plugin Extensions:** Only load app plugins when necessary [#86624](https://github.com/grafana/grafana/pull/86624), [@leventebalogh](https://github.com/leventebalogh)
- **Plugins:** Add token to gcom requests [#96261](https://github.com/grafana/grafana/pull/96261), [@oshirohugo](https://github.com/oshirohugo)
- **Plugins:** Add token to gcom requests (Enterprise)
- **Plugins:** Disable version install when angular version is not supported [#97189](https://github.com/grafana/grafana/pull/97189), [@oshirohugo](https://github.com/oshirohugo)
- **Plugins:** Disable version installation for specific plugin types [#98597](https://github.com/grafana/grafana/pull/98597), [@oshirohugo](https://github.com/oshirohugo)
- **Plugins:** Update to latest go plugin SDK (v0.260.3) w/ arrow v18 [#97561](https://github.com/grafana/grafana/pull/97561), [@ryantxu](https://github.com/ryantxu)
- **Plugins:** Use grafana-com sso_api_token [#97096](https://github.com/grafana/grafana/pull/97096), [@oshirohugo](https://github.com/oshirohugo)
- **Plugins:** Use grafana-com sso_api_token (Enterprise)
- **Prometheus datasource:** Show info annotations in the UI [#97978](https://github.com/grafana/grafana/pull/97978), [@zenador](https://github.com/zenador)
- **Prometheus:** Improve handling of special chars in label values [#96067](https://github.com/grafana/grafana/pull/96067), [@NWRichmond](https://github.com/NWRichmond)
- **PublicDashboards:** Remove publicDashboards FF [#96578](https://github.com/grafana/grafana/pull/96578), [@juanicabanas](https://github.com/juanicabanas)
- **Reporting:** Add allow list email domain configuration (Enterprise)
- **Reporting:** Include the apiserver by default and deprecated internal ids (Enterprise)
- **RuntimeDataSource:** Support in core for runtime registered data sources [#93956](https://github.com/grafana/grafana/pull/93956), [@torkelo](https://github.com/torkelo)
- **SAML:** Add the ability to specify EntityID (Enterprise)
- **SAML:** Implement correct SLO with NameID and SessionIndex handling (Enterprise)
- **Security:** Update to Go 1.23.5 - Backport to v11.5.x [#99122](https://github.com/grafana/grafana/pull/99122), [@Proximyst](https://github.com/Proximyst)
- **Security:** Update to Go 1.23.5 - Backport to v11.5.x (Enterprise)
- **Snapshots:** Add RBAC roles for creating and deleting [#96126](https://github.com/grafana/grafana/pull/96126), [@evictorero](https://github.com/evictorero)
- **Storage:** Removes integration tests for MySQL 5.7 since it is EOL [#98013](https://github.com/grafana/grafana/pull/98013), [@inf0rmer](https://github.com/inf0rmer)
- **Tempo:** Add support for TraceQL Metrics exemplars [#96859](https://github.com/grafana/grafana/pull/96859), [@adrapereira](https://github.com/adrapereira)
- **Tempo:** Honor datasource TLS settings for gRPC requests [#97484](https://github.com/grafana/grafana/pull/97484), [@mdisibio](https://github.com/mdisibio)
- **Tempo:** Improve handling of multiple values in the Search tab query generation [#98427](https://github.com/grafana/grafana/pull/98427), [@adrapereira](https://github.com/adrapereira)
- **ToolbarButton:** Auto width on smaller screen sizes [#96023](https://github.com/grafana/grafana/pull/96023), [@yincongcyincong](https://github.com/yincongcyincong)
- **Trace View:** Set span filters as panel options [#98328](https://github.com/grafana/grafana/pull/98328), [@adrapereira](https://github.com/adrapereira)
- **TransformationFilter:** Implement RefID multi picker [#96841](https://github.com/grafana/grafana/pull/96841), [@Sergej-Vlasov](https://github.com/Sergej-Vlasov)
- **Transformations:** Add Delimiter format option to Extract fields [#97340](https://github.com/grafana/grafana/pull/97340), [@tskarhed](https://github.com/tskarhed)
- **Transformations:** Add RegExp option to Extract fields transformer [#96593](https://github.com/grafana/grafana/pull/96593), [@leeoniya](https://github.com/leeoniya)
- **Transformations:** GroupToMatrix add 0 as special value [#97642](https://github.com/grafana/grafana/pull/97642), [@tskarhed](https://github.com/tskarhed)
- **Zipkin:** Run queries through backend [#97754](https://github.com/grafana/grafana/pull/97754), [@ivanahuckova](https://github.com/ivanahuckova)
### Bug fixes
- **Alerting:** AlertingQueryRunner should skip descendant nodes of invalid queries [#97528](https://github.com/grafana/grafana/pull/97528), [@gillesdemey](https://github.com/gillesdemey)
- **Alerting:** Allow notification policy filters to match quoted matchers [#98525](https://github.com/grafana/grafana/pull/98525), [@gillesdemey](https://github.com/gillesdemey)
- **Alerting:** Fix alert rule list view summaries [#98433](https://github.com/grafana/grafana/pull/98433), [@yincongcyincong](https://github.com/yincongcyincong)
- **Alerting:** Fix alert rules unpausing after moving rule to different folder [#97580](https://github.com/grafana/grafana/pull/97580), [@santihernandezc](https://github.com/santihernandezc)
- **Alerting:** Fix ash not showing history graph in firefox [#98128](https://github.com/grafana/grafana/pull/98128), [@soniaAguilarPeiron](https://github.com/soniaAguilarPeiron)
- **Alerting:** Fix bug when saving a rule more than once [#96658](https://github.com/grafana/grafana/pull/96658), [@soniaAguilarPeiron](https://github.com/soniaAguilarPeiron)
- **Alerting:** Fix data-testid in RuleEditorSection [#97473](https://github.com/grafana/grafana/pull/97473), [@soniaAguilarPeiron](https://github.com/soniaAguilarPeiron)
- **Alerting:** Fix filtering rule group permissions based on their full path (Enterprise)
- **Alerting:** Fix go template parsing [#97145](https://github.com/grafana/grafana/pull/97145), [@konrad147](https://github.com/konrad147)
- **Alerting:** Fix label escaping in rule export [#97985](https://github.com/grafana/grafana/pull/97985), [@moustafab](https://github.com/moustafab)
- **Alerting:** Fix missing instances and history when Grafana rule is stored in folder with / [#97956](https://github.com/grafana/grafana/pull/97956), [@gillesdemey](https://github.com/gillesdemey)
- **Alerting:** Fix navigating to URLs with "%25" [#96992](https://github.com/grafana/grafana/pull/96992), [@gillesdemey](https://github.com/gillesdemey)
- **Alerting:** Fix no-change scenario in provisioning rule update API [#98389](https://github.com/grafana/grafana/pull/98389), [@alexander-akhmetov](https://github.com/alexander-akhmetov)
- **Alerting:** Fix not being able to remove a reducer when using range query [#97757](https://github.com/grafana/grafana/pull/97757), [@soniaAguilarPeiron](https://github.com/soniaAguilarPeiron)
- **Alerting:** Fix recording rules rendering simplified condition [#97497](https://github.com/grafana/grafana/pull/97497), [@soniaAguilarPeiron](https://github.com/soniaAguilarPeiron)
- **Alerting:** Fix removing reducer when inital value is instant [#97054](https://github.com/grafana/grafana/pull/97054), [@soniaAguilarPeiron](https://github.com/soniaAguilarPeiron)
- **Alerting:** Fix simplified query step [#97046](https://github.com/grafana/grafana/pull/97046), [@soniaAguilarPeiron](https://github.com/soniaAguilarPeiron)
- **Alerting:** Fix slack image uploading to use new api [#97817](https://github.com/grafana/grafana/pull/97817), [@moustafab](https://github.com/moustafab)
- **Alerting:** Fix terraform export of notification policy [#98429](https://github.com/grafana/grafana/pull/98429), [@moustafab](https://github.com/moustafab)
- **Alerting:** Fix updating condition when refId changes [#97753](https://github.com/grafana/grafana/pull/97753), [@soniaAguilarPeiron](https://github.com/soniaAguilarPeiron)
- **Alerting:** Fix using stacks- prefix instead of stack- for checking the namespace in boot data [#97492](https://github.com/grafana/grafana/pull/97492), [@soniaAguilarPeiron](https://github.com/soniaAguilarPeiron)
- **Anonymous User:** Adds validator service for anonymous users (Enterprise)
- **Auth:** Fix SAML user IsExternallySynced not being set correctly [#98487](https://github.com/grafana/grafana/pull/98487), [@volcanonoodle](https://github.com/volcanonoodle)
- **Azure Monitor:** Add safety around usage of frame.Meta.Custom struct [#97766](https://github.com/grafana/grafana/pull/97766), [@adamyeats](https://github.com/adamyeats)
- **Azure/GCM:** Improve error display [#96921](https://github.com/grafana/grafana/pull/96921), [@aangelisc](https://github.com/aangelisc)
- **CloudWatch:** Fix conditions for fetching wildcards [#98648](https://github.com/grafana/grafana/pull/98648), [@iwysiu](https://github.com/iwysiu)
- **CloudWatch:** Fix interpolation of log groups when fetching fields [#98054](https://github.com/grafana/grafana/pull/98054), [@idastambuk](https://github.com/idastambuk)
- **Dashboard:** Fixes issue with compatability of old DashboardModel.annotations [#97328](https://github.com/grafana/grafana/pull/97328), [@torkelo](https://github.com/torkelo)
- **Dashboards:** Fix issue where filtered panels would not react to variable changes [#98718](https://github.com/grafana/grafana/pull/98718), [@oscarkilhed](https://github.com/oscarkilhed)
- **Dashboards:** Fixes week relative time ranges when weekStart was changed [#98167](https://github.com/grafana/grafana/pull/98167), [@torkelo](https://github.com/torkelo)
- **Dashboards:** Panel react for `timeFrom` and `timeShift` changes using variables [#98510](https://github.com/grafana/grafana/pull/98510), [@Sergej-Vlasov](https://github.com/Sergej-Vlasov)
- **DateTimePicker:** Fixes issue with date picker showing invalid date [#97888](https://github.com/grafana/grafana/pull/97888), [@torkelo](https://github.com/torkelo)
- **Fix:** Add support for datasource variable queries [#98098](https://github.com/grafana/grafana/pull/98098), [@sunker](https://github.com/sunker)
- **Fix:** Do not fetch Orgs if the user is authenticated by apikey/sa or render key [#97162](https://github.com/grafana/grafana/pull/97162), [@mgyongyosi](https://github.com/mgyongyosi)
- **Fix:** Double encoding of URLs when using data proxy [#98494](https://github.com/grafana/grafana/pull/98494), [@s4kh](https://github.com/s4kh)
- **Font:** Disable contextual font ligatures [#98521](https://github.com/grafana/grafana/pull/98521), [@ashharrison90](https://github.com/ashharrison90)
- **GrafanaUI:** Fix inconsistent controlled/uncontrolled state in AutoSizeInput [#96696](https://github.com/grafana/grafana/pull/96696), [@joshhunt](https://github.com/joshhunt)
- **GrafanaUI:** Revert: Fix inconsistent controlled/uncontrolled state in AutoSizeInput [#97551](https://github.com/grafana/grafana/pull/97551), [@itsmylife](https://github.com/itsmylife)
- **InfluxDB:** Adhoc filters can use template vars as values [#98567](https://github.com/grafana/grafana/pull/98567), [@bossinc](https://github.com/bossinc)
- **Library Panel:** Fix issue where library panels did not display panel links. [#98655](https://github.com/grafana/grafana/pull/98655), [@yincongcyincong](https://github.com/yincongcyincong)
- **LibraryPanel:** Fallback to panel title if library panel title is not set [#99411](https://github.com/grafana/grafana/pull/99411), [@ivanortegaalba](https://github.com/ivanortegaalba)
- **Loki:** Fix a bug when reading frames without values but warnings [#97197](https://github.com/grafana/grafana/pull/97197), [@svennergr](https://github.com/svennergr)
- **Loki:** Only hide a set of labels instead of every label starting with `__` [#98730](https://github.com/grafana/grafana/pull/98730), [@svennergr](https://github.com/svennergr)
- **Org:** Fix redirection logic to work consistently [#96521](https://github.com/grafana/grafana/pull/96521), [@yincongcyincong](https://github.com/yincongcyincong)
- **Panel inspect:** Fix file names of data download included uninterpolated variable names. [#98832](https://github.com/grafana/grafana/pull/98832), [@alexrosenfeld10](https://github.com/alexrosenfeld10)
- **Scenes:** Upgrade to 5.36.3 [#98661](https://github.com/grafana/grafana/pull/98661), [@ivanortegaalba](https://github.com/ivanortegaalba)
- **Snapshot:** Show proper breadcrumb path [#98806](https://github.com/grafana/grafana/pull/98806), [@ashharrison90](https://github.com/ashharrison90)
- **Time Picker:** Fix "Fiscal year start month" selection behaviour [#98576](https://github.com/grafana/grafana/pull/98576), [@ashharrison90](https://github.com/ashharrison90)
- **Unified Storage:** Add support for verify-full in postgres [#96825](https://github.com/grafana/grafana/pull/96825), [@chaudyg](https://github.com/chaudyg)
- **Unified Storage:** Use tls preferred when grafana db using ssl [#97378](https://github.com/grafana/grafana/pull/97378), [@owensmallwood](https://github.com/owensmallwood)
- **Usage Insights:** Fix usage insight errors being logged as [object Object] [#93502](https://github.com/grafana/grafana/pull/93502), [@mmandrus](https://github.com/mmandrus)
### Breaking changes
- **Loki:** Default to `/labels` API with `query` param instead of `/series` API [#97935](https://github.com/grafana/grafana/pull/97935), [@svennergr](https://github.com/svennergr)
### Plugin development fixes & changes
- **Grafana UI:** Re-add react-router-dom as a dependency [#97540](https://github.com/grafana/grafana/pull/97540), [@leventebalogh](https://github.com/leventebalogh)
<!-- 11.5.0 END -->
<!-- 11.4.1 START -->
# 11.4.1 (2025-01-28)
### Features and enhancements
- **Security:** Update to Go 1.23.5 - Backport to v11.4.x [#99123](https://github.com/grafana/grafana/pull/99123), [@Proximyst](https://github.com/Proximyst)
- **Security:** Update to Go 1.23.5 - Backport to v11.4.x (Enterprise)
### Bug fixes
- **Alerting:** AlertingQueryRunner should skip descendant nodes of invalid queries [#97830](https://github.com/grafana/grafana/pull/97830), [@gillesdemey](https://github.com/gillesdemey)
- **Alerting:** Fix alert rules unpausing after moving rule to different folder [#97583](https://github.com/grafana/grafana/pull/97583), [@santihernandezc](https://github.com/santihernandezc)
- **Alerting:** Fix label escaping in rule export [#98649](https://github.com/grafana/grafana/pull/98649), [@moustafab](https://github.com/moustafab)
- **Alerting:** Fix slack image uploading to use new api [#98066](https://github.com/grafana/grafana/pull/98066), [@moustafab](https://github.com/moustafab)
- **Azure/GCM:** Improve error display [#97594](https://github.com/grafana/grafana/pull/97594), [@aangelisc](https://github.com/aangelisc)
- **Dashboards:** Fix issue where filtered panels would not react to variable changes [#98734](https://github.com/grafana/grafana/pull/98734), [@oscarkilhed](https://github.com/oscarkilhed)
- **Dashboards:** Fixes issue with panel header showing even when hide time override was enabled [#98747](https://github.com/grafana/grafana/pull/98747), [@torkelo](https://github.com/torkelo)
- **Dashboards:** Fixes week relative time ranges when weekStart was changed [#98269](https://github.com/grafana/grafana/pull/98269), [@torkelo](https://github.com/torkelo)
- **Dashboards:** Panel react for `timeFrom` and `timeShift` changes using variables [#98659](https://github.com/grafana/grafana/pull/98659), [@Sergej-Vlasov](https://github.com/Sergej-Vlasov)
- **DateTimePicker:** Fixes issue with date picker showing invalid date [#97971](https://github.com/grafana/grafana/pull/97971), [@torkelo](https://github.com/torkelo)
- **Fix:** Add support for datasource variable queries [#98119](https://github.com/grafana/grafana/pull/98119), [@sunker](https://github.com/sunker)
- **InfluxDB:** Adhoc filters can use template vars as values [#98786](https://github.com/grafana/grafana/pull/98786), [@bossinc](https://github.com/bossinc)
- **LibraryPanel:** Fallback to panel title if library panel title is not set [#99410](https://github.com/grafana/grafana/pull/99410), [@ivanortegaalba](https://github.com/ivanortegaalba)
### Plugin development fixes & changes
- **Grafana UI:** Re-add react-router-dom as a dependency [#98422](https://github.com/grafana/grafana/pull/98422), [@leventebalogh](https://github.com/leventebalogh)
<!-- 11.4.1 END -->
<!-- 11.3.3 START -->
# 11.3.3 (2025-01-28)
### Features and enhancements
- **Azure Monitor:** Add a feature flag to toggle user auth for Azure Monitor only [#97576](https://github.com/grafana/grafana/pull/97576), [@adamyeats](https://github.com/adamyeats)
- **Security:** Update to Go 1.23.5 - Backport to v11.3.x [#99124](https://github.com/grafana/grafana/pull/99124), [@Proximyst](https://github.com/Proximyst)
- **Security:** Update to Go 1.23.5 - Backport to v11.3.x (Enterprise)
### Bug fixes
- **Alerting:** AlertingQueryRunner should skip descendant nodes of invalid queries [#97829](https://github.com/grafana/grafana/pull/97829), [@gillesdemey](https://github.com/gillesdemey)
- **Azure/GCM:** Improve error display [#97593](https://github.com/grafana/grafana/pull/97593), [@aangelisc](https://github.com/aangelisc)
- **Dashboard:** Fixes issue with compatability of old DashboardModel.annotations [#97467](https://github.com/grafana/grafana/pull/97467), [@torkelo](https://github.com/torkelo)
- **Dashboards:** Fix issue where filtered panels would not react to variable changes [#98733](https://github.com/grafana/grafana/pull/98733), [@oscarkilhed](https://github.com/oscarkilhed)
- **Dashboards:** Fixes issue with panel header showing even when hide time override was enabled [#97389](https://github.com/grafana/grafana/pull/97389), [@torkelo](https://github.com/torkelo)
- **Dashboards:** Fixes week relative time ranges when weekStart was changed [#98268](https://github.com/grafana/grafana/pull/98268), [@torkelo](https://github.com/torkelo)
- **DateTimePicker:** Fixes issue with date picker showing invalid date [#97970](https://github.com/grafana/grafana/pull/97970), [@torkelo](https://github.com/torkelo)
- **Fix:** Add support for datasource variable queries [#98118](https://github.com/grafana/grafana/pull/98118), [@sunker](https://github.com/sunker)
- **InfluxDB:** Adhoc filters can use template vars as values [#98785](https://github.com/grafana/grafana/pull/98785), [@bossinc](https://github.com/bossinc)
- **Unified Storage:** Use tls preferred when grafana db using ssl [#97379](https://github.com/grafana/grafana/pull/97379), [@owensmallwood](https://github.com/owensmallwood)
### Plugin development fixes & changes
- **Grafana UI:** Re-add react-router-dom as a dependency [#98421](https://github.com/grafana/grafana/pull/98421), [@leventebalogh](https://github.com/leventebalogh)
<!-- 11.3.3 END -->
<!-- 11.2.6 START -->
# 11.2.6 (2025-01-28)
### Features and enhancements
- **Azure Monitor:** Add a feature flag to toggle user auth for Azure Monitor only [#97565](https://github.com/grafana/grafana/pull/97565), [@adamyeats](https://github.com/adamyeats)
- **Security:** Update to Go 1.22.11 - Backport to v11.2.x [#99125](https://github.com/grafana/grafana/pull/99125), [@Proximyst](https://github.com/Proximyst)
- **Security:** Update to Go 1.22.11 - Backport to v11.2.x (Enterprise)
### Bug fixes
- **Azure/GCM:** Improve error display [#97591](https://github.com/grafana/grafana/pull/97591), [@aangelisc](https://github.com/aangelisc)
<!-- 11.2.6 END -->
<!-- 11.1.11 START -->
# 11.1.11 (2025-01-28)
### Features and enhancements
- **Security:** Update to Go 1.22.11 - Backport to v11.1.x [#99126](https://github.com/grafana/grafana/pull/99126), [@Proximyst](https://github.com/Proximyst)
- **Security:** Update to Go 1.22.11 - Backport to v11.1.x (Enterprise)
### Bug fixes
- **Azure/GCM:** Improve error display [#97595](https://github.com/grafana/grafana/pull/97595), [@aangelisc](https://github.com/aangelisc)
<!-- 11.1.11 END -->
<!-- 11.0.10 START -->
# 11.0.10 (2025-01-28)
### Features and enhancements
- **Security:** Update to Go 1.22.11 - Backport to v11.0.x [#99127](https://github.com/grafana/grafana/pull/99127), [@Proximyst](https://github.com/Proximyst)
- **Security:** Update to Go 1.22.11 - Backport to v11.0.x (Enterprise)
### Bug fixes
- **Azure/GCM:** Improve error display [#97592](https://github.com/grafana/grafana/pull/97592), [@aangelisc](https://github.com/aangelisc)
<!-- 11.0.10 END -->
<!-- 10.4.15 START -->
# 10.4.15 (2025-01-28)
### Features and enhancements
- **Security:** Update to Go 1.22.11 - Backport to v10.4.x [#99128](https://github.com/grafana/grafana/pull/99128), [@Proximyst](https://github.com/Proximyst)
- **Security:** Update to Go 1.22.11 - Backport to v10.4.x (Enterprise)
### Bug fixes
- **Azure/GCM:** Improve error display [#97590](https://github.com/grafana/grafana/pull/97590), [@aangelisc](https://github.com/aangelisc)
<!-- 10.4.15 END -->
<!-- 11.4.0 START -->
# 11.4.0 (2024-12-05)

View File

@@ -1,13 +1,19 @@
# syntax=docker/dockerfile:1
# to maintain formatting of multiline commands in vscode, add the following to settings.json:
# "docker.languageserver.formatter.ignoreMultilineInstructions": true
ARG BASE_IMAGE=alpine:3.20
ARG JS_IMAGE=node:22-alpine
ARG JS_PLATFORM=linux/amd64
ARG GO_IMAGE=golang:1.23.1-alpine
ARG GO_IMAGE=golang:1.23.5-alpine
# Default to building locally
ARG GO_SRC=go-builder
ARG JS_SRC=js-builder
FROM --platform=${JS_PLATFORM} ${JS_IMAGE} as js-builder
# Javascript build stage
FROM --platform=${JS_PLATFORM} ${JS_IMAGE} AS js-builder
ENV NODE_OPTIONS=--max_old_space_size=8000
@@ -16,7 +22,6 @@ WORKDIR /tmp/grafana
COPY package.json project.json nx.json yarn.lock .yarnrc.yml ./
COPY .yarn .yarn
COPY packages packages
COPY plugins-bundled plugins-bundled
COPY public public
COPY LICENSE ./
COPY conf/defaults.ini ./conf/defaults.ini
@@ -33,7 +38,8 @@ COPY emails emails
ENV NODE_ENV=production
RUN yarn build
FROM ${GO_IMAGE} as go-builder
# Golang build stage
FROM ${GO_IMAGE} AS go-builder
ARG COMMIT_SHA=""
ARG BUILD_BRANCH=""
@@ -56,23 +62,24 @@ COPY go.* ./
COPY .bingo .bingo
# Include vendored dependencies
COPY pkg/util/xorm/go.* pkg/util/xorm/
COPY pkg/apiserver/go.* pkg/apiserver/
COPY pkg/apimachinery/go.* pkg/apimachinery/
COPY pkg/build/go.* pkg/build/
COPY pkg/build/wire/go.* pkg/build/wire/
COPY pkg/promlib/go.* pkg/promlib/
COPY pkg/storage/unified/resource/go.* pkg/storage/unified/resource/
COPY pkg/storage/unified/apistore/go.* pkg/storage/unified/apistore/
COPY pkg/semconv/go.* pkg/semconv/
COPY pkg/aggregator/go.* pkg/aggregator/
COPY apps/playlist/go.* apps/playlist/
COPY apps/investigation/go.* apps/investigation/
COPY pkg/util/xorm pkg/util/xorm
COPY pkg/apiserver pkg/apiserver
COPY pkg/apimachinery pkg/apimachinery
COPY pkg/build pkg/build
COPY pkg/build/wire pkg/build/wire
COPY pkg/promlib pkg/promlib
COPY pkg/storage/unified/resource pkg/storage/unified/resource
COPY pkg/storage/unified/apistore pkg/storage/unified/apistore
COPY pkg/semconv pkg/semconv
COPY pkg/aggregator pkg/aggregator
COPY apps/playlist apps/playlist
COPY apps/investigations apps/investigations
COPY apps/advisor apps/advisor
COPY apps apps
COPY kindsv2 kindsv2
COPY apps/alerting/notifications/go.* apps/alerting/notifications/
COPY pkg/codegen/go.* pkg/codegen/
COPY pkg/plugins/codegen/go.* pkg/plugins/codegen/
COPY apps/alerting/notifications apps/alerting/notifications
COPY pkg/codegen pkg/codegen
COPY pkg/plugins/codegen pkg/plugins/codegen
RUN go mod download
RUN if [[ "$BINGO" = "true" ]]; then \
@@ -97,7 +104,8 @@ ENV BUILD_BRANCH=${BUILD_BRANCH}
RUN make build-go GO_BUILD_TAGS=${GO_BUILD_TAGS} WIRE_TAGS=${WIRE_TAGS}
FROM ${BASE_IMAGE} as tgz-builder
# From-tarball build stage
FROM ${BASE_IMAGE} AS tgz-builder
WORKDIR /tmp/grafana
@@ -109,8 +117,8 @@ COPY ${GRAFANA_TGZ} /tmp/grafana.tar.gz
RUN tar x -z -f /tmp/grafana.tar.gz --strip-components=1
# helpers for COPY --from
FROM ${GO_SRC} as go-src
FROM ${JS_SRC} as js-src
FROM ${GO_SRC} AS go-src
FROM ${JS_SRC} AS js-src
# Final stage
FROM ${BASE_IMAGE}
@@ -145,19 +153,20 @@ RUN if grep -i -q alpine /etc/issue; then \
fi
# glibc support for alpine x86_64 only
# docker run --rm --env STDOUT=1 sgerrand/glibc-builder 2.40 /usr/glibc-compat > glibc-bin-2.40.tar.gz
ARG GLIBC_VERSION=2.40
RUN if grep -i -q alpine /etc/issue && [ `arch` = "x86_64" ]; then \
wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r0/glibc-2.35-r0.apk \
-O /tmp/glibc-2.35-r0.apk && \
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r0/glibc-bin-2.35-r0.apk \
-O /tmp/glibc-bin-2.35-r0.apk && \
apk add --force-overwrite --no-cache /tmp/glibc-2.35-r0.apk /tmp/glibc-bin-2.35-r0.apk && \
rm -f /lib64/ld-linux-x86-64.so.2 && \
ln -s /usr/glibc-compat/lib64/ld-linux-x86-64.so.2 /lib64/ld-linux-x86-64.so.2 && \
rm -f /tmp/glibc-2.35-r0.apk && \
rm -f /tmp/glibc-bin-2.35-r0.apk && \
rm -f /lib/ld-linux-x86-64.so.2 && \
rm -f /etc/ld.so.cache; \
wget -qO- "https://dl.grafana.com/glibc/glibc-bin-$GLIBC_VERSION.tar.gz" | tar zxf - -C / \
usr/glibc-compat/lib/ld-linux-x86-64.so.2 \
usr/glibc-compat/lib/libc.so.6 \
usr/glibc-compat/lib/libdl.so.2 \
usr/glibc-compat/lib/libm.so.6 \
usr/glibc-compat/lib/libpthread.so.0 \
usr/glibc-compat/lib/librt.so.1 \
usr/glibc-compat/lib/libresolv.so.2 && \
mkdir /lib64 && \
ln -s /usr/glibc-compat/lib/ld-linux-x86-64.so.2 /lib64; \
fi
COPY --from=go-src /tmp/grafana/conf ./conf

View File

@@ -8,4 +8,4 @@
- @davkal
- Docs:
- @chri2547
- @brendamuir
- @JohnnyK-Grafana

View File

@@ -8,7 +8,7 @@ WIRE_TAGS = "oss"
include .bingo/Variables.mk
GO = go
GO_VERSION = 1.23.4
GO_VERSION = 1.23.5
GO_LINT_FILES ?= $(shell ./scripts/go-workspace/golangci-lint-includes.sh)
GO_TEST_FILES ?= $(shell ./scripts/go-workspace/test-includes.sh)
SH_FILES ?= $(shell find ./scripts -name *.sh)
@@ -149,7 +149,7 @@ gen-cue: ## Do all CUE/Thema code generation
.PHONY: gen-cuev2
gen-cuev2: ## Do all CUE code generation
@echo "generate code from .cue files (v2)"
go generate ./kindsv2/gen.go
@$(MAKE) -C ./kindsv2 all
.PHONY: gen-feature-toggles
gen-feature-toggles:
@@ -211,7 +211,6 @@ build-cli: ## Build Grafana CLI application.
build-js: ## Build frontend assets.
@echo "build frontend"
yarn run build
yarn run plugins:build-bundled
PLUGIN_ID ?=
@@ -272,6 +271,14 @@ test-go-integration-alertmanager: ## Run integration tests for the remote alertm
AM_URL=http://localhost:8080 AM_TENANT_ID=test \
$(GO) test $(GO_RACE_FLAG) -count=1 -run "^TestIntegrationRemoteAlertmanager" -covermode=atomic -timeout=5m ./pkg/services/ngalert/...
.PHONY: test-go-integration-grafana-alertmanager
test-go-integration-grafana-alertmanager: ## Run integration tests for the grafana alertmanager
@echo "test grafana alertmanager integration tests"
@export GRAFANA_VERSION=11.5.0-81938; \
$(GO) run tools/setup_grafana_alertmanager_integration_test_images.go; \
$(GO) clean -testcache; \
$(GO) test $(GO_RACE_FLAG) -count=1 -run "^TestAlertmanagerIntegration" -covermode=atomic -timeout=10m ./pkg/tests/alertmanager/...
.PHONY: test-go-integration-postgres
test-go-integration-postgres: devenv-postgres ## Run integration tests for postgres backend with flags.
@echo "test backend integration postgres tests"
@@ -422,6 +429,7 @@ protobuf: ## Compile protobuf definitions
buf generate pkg/plugins/backendplugin/secretsmanagerplugin --template pkg/plugins/backendplugin/secretsmanagerplugin/buf.gen.yaml
buf generate pkg/storage/unified/resource --template pkg/storage/unified/resource/buf.gen.yaml
buf generate pkg/services/authz/proto/v1 --template pkg/services/authz/proto/v1/buf.gen.yaml
buf generate pkg/services/ngalert/store/proto/v1 --template pkg/services/ngalert/store/proto/v1/buf.gen.yaml
.PHONY: clean
clean: ## Clean up intermediate build artifacts.

View File

@@ -43,7 +43,7 @@ If you're interested in contributing to the Grafana project:
- If you have a specific question, check out our [discussion forums](https://community.grafana.com/).
- For general discussions, join us on the [official Slack](https://slack.grafana.com) team.
This project is tested with [BrowserStack](https://www.browserstack.com/)
This project is tested with [BrowserStack](https://www.browserstack.com/).
## License

1
apps/advisor/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
plugin/src

3
apps/advisor/Makefile Normal file
View File

@@ -0,0 +1,3 @@
.PHONY: generate
generate:
@grafana-app-sdk generate -g ./pkg/apis --grouping=group --postprocess --defencoding=none

View File

@@ -1,9 +1,9 @@
module github.com/grafana/grafana/apps/investigation
module github.com/grafana/grafana/apps/advisor
go 1.23.1
go 1.23.4
require (
github.com/grafana/grafana-app-sdk v0.23.1
github.com/grafana/grafana-app-sdk v0.31.0
k8s.io/apimachinery v0.32.0
k8s.io/klog/v2 v2.130.1
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f
@@ -29,8 +29,10 @@ require (
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.0 // indirect
github.com/grafana/grafana-app-sdk/logging v0.29.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/invopop/yaml v0.3.1 // indirect
@@ -58,17 +60,18 @@ require (
go.opentelemetry.io/otel/metric v1.33.0 // indirect
go.opentelemetry.io/otel/sdk v1.33.0 // indirect
go.opentelemetry.io/otel/trace v1.33.0 // indirect
go.opentelemetry.io/proto/otlp v1.4.0 // indirect
go.opentelemetry.io/proto/otlp v1.5.0 // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/oauth2 v0.25.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/term v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/time v0.9.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241216192217-9240e9c98484 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250102185135-69823020774d // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250102185135-69823020774d // indirect
google.golang.org/grpc v1.69.2 // indirect
google.golang.org/grpc v1.69.4 // indirect
google.golang.org/protobuf v1.36.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect

View File

@@ -29,6 +29,8 @@ github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF
github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4=
github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE=
github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM=
github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
@@ -43,12 +45,16 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad h1:a6HEuzUHeKH6hwfN/ZoQgRgVIWFJljSWa/zetS2WTvg=
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/grafana/grafana-app-sdk v0.23.1 h1:BRpUG0bA0oVxjthkmO2thuJBo3nbjaRSSmZJHw+mA8I=
github.com/grafana/grafana-app-sdk v0.23.1/go.mod h1:KzgPnTJfMeckGmMctv6CJb8Jr/o/5rwARDyjXoeR0Fc=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.0 h1:TmHmbvxPmaegwhDubVz0lICL0J5Ka2vwTzhoePEXsGE=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.0/go.mod h1:qztMSjm835F2bXf+5HKAPIS5qsmQDqZna/PgVt4rWtI=
github.com/grafana/grafana-app-sdk v0.30.0 h1:Hqn2pETu2mQ4RpWkZYEQfu01P7xd1Z1Gj+HX/8aB0tw=
github.com/grafana/grafana-app-sdk v0.30.0/go.mod h1:jhfqNIovb+Mes2vdMf9iMCWQkp1GTNtyNuExONtiNuk=
github.com/grafana/grafana-app-sdk/logging v0.29.0 h1:mgbXaAf33aFwqwGVeaX30l8rkeAJH0iACgX5Rn6YkN4=
github.com/grafana/grafana-app-sdk/logging v0.29.0/go.mod h1:xy6ZyVXl50Z3DBDLybvBPphbykPhuVNed/VNmen9DQM=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 h1:VNqngBF40hVlDloBruUehVYC3ArSgIyScOAyMRqBxRg=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1/go.mod h1:RBRO7fro65R6tjKzYgLAFo0t1QEXY1Dp+i/bvpRiqiQ=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
@@ -81,6 +87,10 @@ github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/onsi/ginkgo/v2 v2.21.0 h1:7rg/4f3rB88pb5obDgNZrNHrQ4e6WpjonchcpuBRnZM=
github.com/onsi/ginkgo/v2 v2.21.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo=
github.com/onsi/gomega v1.35.1 h1:Cwbd75ZBPxFSuZ6T+rN/WCb/gOc6YgFBXLlZLhC7Ds4=
github.com/onsi/gomega v1.35.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog=
github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s=
github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
@@ -130,8 +140,8 @@ go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4Jjx
go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8=
go.opentelemetry.io/otel/trace v1.33.0 h1:cCJuF7LRjUFso9LPnEAHJDB2pqzp+hbO8eu1qqW2d/s=
go.opentelemetry.io/otel/trace v1.33.0/go.mod h1:uIcdVUZMpTAmz0tI1z04GoVSezK37CbGV4fr1f2nBck=
go.opentelemetry.io/proto/otlp v1.4.0 h1:TA9WRvW6zMwP+Ssb6fLoUIuirti1gGbP28GcKG1jgeg=
go.opentelemetry.io/proto/otlp v1.4.0/go.mod h1:PPBWZIP98o2ElSqI35IHfu7hIhSwvc5N38Jw8pXuGFY=
go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4=
go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
@@ -150,6 +160,8 @@ golang.org/x/oauth2 v0.25.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbht
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -167,18 +179,20 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE=
golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw=
gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
google.golang.org/genproto/googleapis/api v0.0.0-20241216192217-9240e9c98484 h1:ChAdCYNQFDk5fYvFZMywKLIijG7TC2m1C2CMEu11G3o=
google.golang.org/genproto/googleapis/api v0.0.0-20241216192217-9240e9c98484/go.mod h1:KRUmxRI4JmbpAm8gcZM4Jsffi859fo5LQjILwuqj9z8=
google.golang.org/genproto/googleapis/api v0.0.0-20250102185135-69823020774d h1:H8tOf8XM88HvKqLTxe755haY6r1fqqzLbEnfrmLXlSA=
google.golang.org/genproto/googleapis/api v0.0.0-20250102185135-69823020774d/go.mod h1:2v7Z7gP2ZUOGsaFyxATQSRoBnKygqVq2Cwnvom7QiqY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250102185135-69823020774d h1:xJJRGY7TJcvIlpSrN3K6LAWgNFUILlO+OMAqtg9aqnw=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250102185135-69823020774d/go.mod h1:3ENsm/5D1mzDyhpzeRi1NR784I0BcofWBoSc5QqqMK4=
google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU=
google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4=
google.golang.org/grpc v1.69.4 h1:MF5TftSMkd8GLw/m0KM6V8CMOCY6NZ1NQDPGFgbTt4A=
google.golang.org/grpc v1.69.4/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4=
google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk=
google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

View File

@@ -0,0 +1,49 @@
package advisor
check: {
kind: "Check"
pluralName: "Checks"
current: "v0alpha1"
versions: {
"v0alpha1": {
codegen: {
frontend: true
backend: true
}
validation: {
operations: [
"CREATE",
"UPDATE",
]
}
schema: {
#Data: {
// Generic data input that a check can receive
data?: [string]: string
}
#ReportFailure: {
// Severity of the failure
severity: "high" | "low"
// Human readable reason for the failure
reason: string
// Action to take to resolve the failure
action: string
// Step ID that the failure is associated with
stepID: string
// Item ID that the failure is associated with
itemID: string
}
#Report: {
// Number of elements analyzed
count: int
// List of failures
failures: [...#ReportFailure]
}
spec: #Data
status: {
report: #Report
}
}
}
}
}

View File

@@ -0,0 +1,26 @@
package advisor
checktype: {
kind: "CheckType"
pluralName: "CheckTypes"
current: "v0alpha1"
versions: {
"v0alpha1": {
codegen: {
frontend: true
backend: true
}
schema: {
#Step: {
title: string
description: string
stepID: string
}
spec: {
name: string
steps: [...#Step]
}
}
}
}
}

View File

@@ -0,0 +1,4 @@
module: "github.com/grafana/grafana/apps/advisor/kinds"
language: {
version: "v0.9.0"
}

View File

@@ -0,0 +1,10 @@
package advisor
manifest: {
appName: "advisor"
groupOverride: "advisor.grafana.app"
kinds: [
check,
checktype,
]
}

View File

@@ -0,0 +1,28 @@
//
// Code generated by grafana-app-sdk. DO NOT EDIT.
//
package v0alpha1
import (
"encoding/json"
"io"
"github.com/grafana/grafana-app-sdk/resource"
)
// CheckJSONCodec is an implementation of resource.Codec for kubernetes JSON encoding
type CheckJSONCodec struct{}
// Read reads JSON-encoded bytes from `reader` and unmarshals them into `into`
func (*CheckJSONCodec) Read(reader io.Reader, into resource.Object) error {
return json.NewDecoder(reader).Decode(into)
}
// Write writes JSON-encoded bytes into `writer` marshaled from `from`
func (*CheckJSONCodec) Write(writer io.Writer, from resource.Object) error {
return json.NewEncoder(writer).Encode(from)
}
// Interface compliance checks
var _ resource.Codec = &CheckJSONCodec{}

View File

@@ -0,0 +1,28 @@
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
package v0alpha1
import (
time "time"
)
// metadata contains embedded CommonMetadata and can be extended with custom string fields
// TODO: use CommonMetadata instead of redefining here; currently needs to be defined here
// without external reference as using the CommonMetadata reference breaks thema codegen.
type CheckMetadata struct {
UpdateTimestamp time.Time `json:"updateTimestamp"`
CreatedBy string `json:"createdBy"`
Uid string `json:"uid"`
CreationTimestamp time.Time `json:"creationTimestamp"`
DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty"`
Finalizers []string `json:"finalizers"`
ResourceVersion string `json:"resourceVersion"`
Generation int64 `json:"generation"`
UpdatedBy string `json:"updatedBy"`
Labels map[string]string `json:"labels"`
}
// NewCheckMetadata creates a new CheckMetadata object.
func NewCheckMetadata() *CheckMetadata {
return &CheckMetadata{}
}

View File

@@ -0,0 +1,266 @@
//
// Code generated by grafana-app-sdk. DO NOT EDIT.
//
package v0alpha1
import (
"fmt"
"github.com/grafana/grafana-app-sdk/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/types"
"time"
)
// +k8s:openapi-gen=true
type Check struct {
metav1.TypeMeta `json:",inline" yaml:",inline"`
metav1.ObjectMeta `json:"metadata" yaml:"metadata"`
Spec CheckSpec `json:"spec" yaml:"spec"`
CheckStatus CheckStatus `json:"status" yaml:"status"`
}
func (o *Check) GetSpec() any {
return o.Spec
}
func (o *Check) SetSpec(spec any) error {
cast, ok := spec.(CheckSpec)
if !ok {
return fmt.Errorf("cannot set spec type %#v, not of type Spec", spec)
}
o.Spec = cast
return nil
}
func (o *Check) GetSubresources() map[string]any {
return map[string]any{
"status": o.CheckStatus,
}
}
func (o *Check) GetSubresource(name string) (any, bool) {
switch name {
case "status":
return o.CheckStatus, true
default:
return nil, false
}
}
func (o *Check) SetSubresource(name string, value any) error {
switch name {
case "status":
cast, ok := value.(CheckStatus)
if !ok {
return fmt.Errorf("cannot set status type %#v, not of type CheckStatus", value)
}
o.CheckStatus = cast
return nil
default:
return fmt.Errorf("subresource '%s' does not exist", name)
}
}
func (o *Check) GetStaticMetadata() resource.StaticMetadata {
gvk := o.GroupVersionKind()
return resource.StaticMetadata{
Name: o.ObjectMeta.Name,
Namespace: o.ObjectMeta.Namespace,
Group: gvk.Group,
Version: gvk.Version,
Kind: gvk.Kind,
}
}
func (o *Check) SetStaticMetadata(metadata resource.StaticMetadata) {
o.Name = metadata.Name
o.Namespace = metadata.Namespace
o.SetGroupVersionKind(schema.GroupVersionKind{
Group: metadata.Group,
Version: metadata.Version,
Kind: metadata.Kind,
})
}
func (o *Check) GetCommonMetadata() resource.CommonMetadata {
dt := o.DeletionTimestamp
var deletionTimestamp *time.Time
if dt != nil {
deletionTimestamp = &dt.Time
}
// Legacy ExtraFields support
extraFields := make(map[string]any)
if o.Annotations != nil {
extraFields["annotations"] = o.Annotations
}
if o.ManagedFields != nil {
extraFields["managedFields"] = o.ManagedFields
}
if o.OwnerReferences != nil {
extraFields["ownerReferences"] = o.OwnerReferences
}
return resource.CommonMetadata{
UID: string(o.UID),
ResourceVersion: o.ResourceVersion,
Generation: o.Generation,
Labels: o.Labels,
CreationTimestamp: o.CreationTimestamp.Time,
DeletionTimestamp: deletionTimestamp,
Finalizers: o.Finalizers,
UpdateTimestamp: o.GetUpdateTimestamp(),
CreatedBy: o.GetCreatedBy(),
UpdatedBy: o.GetUpdatedBy(),
ExtraFields: extraFields,
}
}
func (o *Check) SetCommonMetadata(metadata resource.CommonMetadata) {
o.UID = types.UID(metadata.UID)
o.ResourceVersion = metadata.ResourceVersion
o.Generation = metadata.Generation
o.Labels = metadata.Labels
o.CreationTimestamp = metav1.NewTime(metadata.CreationTimestamp)
if metadata.DeletionTimestamp != nil {
dt := metav1.NewTime(*metadata.DeletionTimestamp)
o.DeletionTimestamp = &dt
} else {
o.DeletionTimestamp = nil
}
o.Finalizers = metadata.Finalizers
if o.Annotations == nil {
o.Annotations = make(map[string]string)
}
if !metadata.UpdateTimestamp.IsZero() {
o.SetUpdateTimestamp(metadata.UpdateTimestamp)
}
if metadata.CreatedBy != "" {
o.SetCreatedBy(metadata.CreatedBy)
}
if metadata.UpdatedBy != "" {
o.SetUpdatedBy(metadata.UpdatedBy)
}
// Legacy support for setting Annotations, ManagedFields, and OwnerReferences via ExtraFields
if metadata.ExtraFields != nil {
if annotations, ok := metadata.ExtraFields["annotations"]; ok {
if cast, ok := annotations.(map[string]string); ok {
o.Annotations = cast
}
}
if managedFields, ok := metadata.ExtraFields["managedFields"]; ok {
if cast, ok := managedFields.([]metav1.ManagedFieldsEntry); ok {
o.ManagedFields = cast
}
}
if ownerReferences, ok := metadata.ExtraFields["ownerReferences"]; ok {
if cast, ok := ownerReferences.([]metav1.OwnerReference); ok {
o.OwnerReferences = cast
}
}
}
}
func (o *Check) GetCreatedBy() string {
if o.ObjectMeta.Annotations == nil {
o.ObjectMeta.Annotations = make(map[string]string)
}
return o.ObjectMeta.Annotations["grafana.com/createdBy"]
}
func (o *Check) SetCreatedBy(createdBy string) {
if o.ObjectMeta.Annotations == nil {
o.ObjectMeta.Annotations = make(map[string]string)
}
o.ObjectMeta.Annotations["grafana.com/createdBy"] = createdBy
}
func (o *Check) GetUpdateTimestamp() time.Time {
if o.ObjectMeta.Annotations == nil {
o.ObjectMeta.Annotations = make(map[string]string)
}
parsed, _ := time.Parse(time.RFC3339, o.ObjectMeta.Annotations["grafana.com/updateTimestamp"])
return parsed
}
func (o *Check) SetUpdateTimestamp(updateTimestamp time.Time) {
if o.ObjectMeta.Annotations == nil {
o.ObjectMeta.Annotations = make(map[string]string)
}
o.ObjectMeta.Annotations["grafana.com/updateTimestamp"] = updateTimestamp.Format(time.RFC3339)
}
func (o *Check) GetUpdatedBy() string {
if o.ObjectMeta.Annotations == nil {
o.ObjectMeta.Annotations = make(map[string]string)
}
return o.ObjectMeta.Annotations["grafana.com/updatedBy"]
}
func (o *Check) SetUpdatedBy(updatedBy string) {
if o.ObjectMeta.Annotations == nil {
o.ObjectMeta.Annotations = make(map[string]string)
}
o.ObjectMeta.Annotations["grafana.com/updatedBy"] = updatedBy
}
func (o *Check) Copy() resource.Object {
return resource.CopyObject(o)
}
func (o *Check) DeepCopyObject() runtime.Object {
return o.Copy()
}
// Interface compliance compile-time check
var _ resource.Object = &Check{}
// +k8s:openapi-gen=true
type CheckList struct {
metav1.TypeMeta `json:",inline" yaml:",inline"`
metav1.ListMeta `json:"metadata" yaml:"metadata"`
Items []Check `json:"items" yaml:"items"`
}
func (o *CheckList) DeepCopyObject() runtime.Object {
return o.Copy()
}
func (o *CheckList) Copy() resource.ListObject {
cpy := &CheckList{
TypeMeta: o.TypeMeta,
Items: make([]Check, len(o.Items)),
}
o.ListMeta.DeepCopyInto(&cpy.ListMeta)
for i := 0; i < len(o.Items); i++ {
if item, ok := o.Items[i].Copy().(*Check); ok {
cpy.Items[i] = *item
}
}
return cpy
}
func (o *CheckList) GetItems() []resource.Object {
items := make([]resource.Object, len(o.Items))
for i := 0; i < len(o.Items); i++ {
items[i] = &o.Items[i]
}
return items
}
func (o *CheckList) SetItems(items []resource.Object) {
o.Items = make([]Check, len(items))
for i := 0; i < len(items); i++ {
o.Items[i] = *items[i].(*Check)
}
}
// Interface compliance compile-time check
var _ resource.ListObject = &CheckList{}

View File

@@ -0,0 +1,34 @@
//
// Code generated by grafana-app-sdk. DO NOT EDIT.
//
package v0alpha1
import (
"github.com/grafana/grafana-app-sdk/resource"
)
// schema is unexported to prevent accidental overwrites
var (
schemaCheck = resource.NewSimpleSchema("advisor.grafana.app", "v0alpha1", &Check{}, &CheckList{}, resource.WithKind("Check"),
resource.WithPlural("checks"), resource.WithScope(resource.NamespacedScope))
kindCheck = resource.Kind{
Schema: schemaCheck,
Codecs: map[resource.KindEncoding]resource.Codec{
resource.KindEncodingJSON: &CheckJSONCodec{},
},
}
)
// Kind returns a resource.Kind for this Schema with a JSON codec
func CheckKind() resource.Kind {
return kindCheck
}
// Schema returns a resource.SimpleSchema representation of Check
func CheckSchema() *resource.SimpleSchema {
return schemaCheck
}
// Interface compliance checks
var _ resource.Schema = kindCheck

View File

@@ -0,0 +1,14 @@
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
package v0alpha1
// +k8s:openapi-gen=true
type CheckSpec struct {
// Generic data input that a check can receive
Data map[string]string `json:"data,omitempty"`
}
// NewCheckSpec creates a new CheckSpec object.
func NewCheckSpec() *CheckSpec {
return &CheckSpec{}
}

View File

@@ -0,0 +1,87 @@
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
package v0alpha1
// +k8s:openapi-gen=true
type CheckReportFailure struct {
// Severity of the failure
Severity CheckReportFailureSeverity `json:"severity"`
// Human readable reason for the failure
Reason string `json:"reason"`
// Action to take to resolve the failure
Action string `json:"action"`
// Step ID that the failure is associated with
StepID string `json:"stepID"`
// Item ID that the failure is associated with
ItemID string `json:"itemID"`
}
// NewCheckReportFailure creates a new CheckReportFailure object.
func NewCheckReportFailure() *CheckReportFailure {
return &CheckReportFailure{}
}
// +k8s:openapi-gen=true
type CheckstatusOperatorState struct {
// lastEvaluation is the ResourceVersion last evaluated
LastEvaluation string `json:"lastEvaluation"`
// state describes the state of the lastEvaluation.
// It is limited to three possible states for machine evaluation.
State CheckStatusOperatorStateState `json:"state"`
// descriptiveState is an optional more descriptive state field which has no requirements on format
DescriptiveState *string `json:"descriptiveState,omitempty"`
// details contains any extra information that is operator-specific
Details map[string]interface{} `json:"details,omitempty"`
}
// NewCheckstatusOperatorState creates a new CheckstatusOperatorState object.
func NewCheckstatusOperatorState() *CheckstatusOperatorState {
return &CheckstatusOperatorState{}
}
// +k8s:openapi-gen=true
type CheckStatus struct {
Report CheckV0alpha1StatusReport `json:"report"`
// operatorStates is a map of operator ID to operator state evaluations.
// Any operator which consumes this kind SHOULD add its state evaluation information to this field.
OperatorStates map[string]CheckstatusOperatorState `json:"operatorStates,omitempty"`
// additionalFields is reserved for future use
AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"`
}
// NewCheckStatus creates a new CheckStatus object.
func NewCheckStatus() *CheckStatus {
return &CheckStatus{
Report: *NewCheckV0alpha1StatusReport(),
}
}
// +k8s:openapi-gen=true
type CheckReportFailureSeverity string
const (
CheckReportFailureSeverityHigh CheckReportFailureSeverity = "high"
CheckReportFailureSeverityLow CheckReportFailureSeverity = "low"
)
// +k8s:openapi-gen=true
type CheckStatusOperatorStateState string
const (
CheckStatusOperatorStateStateSuccess CheckStatusOperatorStateState = "success"
CheckStatusOperatorStateStateInProgress CheckStatusOperatorStateState = "in_progress"
CheckStatusOperatorStateStateFailed CheckStatusOperatorStateState = "failed"
)
// +k8s:openapi-gen=true
type CheckV0alpha1StatusReport struct {
// Number of elements analyzed
Count int64 `json:"count"`
// List of failures
Failures []CheckReportFailure `json:"failures"`
}
// NewCheckV0alpha1StatusReport creates a new CheckV0alpha1StatusReport object.
func NewCheckV0alpha1StatusReport() *CheckV0alpha1StatusReport {
return &CheckV0alpha1StatusReport{}
}

View File

@@ -0,0 +1,28 @@
//
// Code generated by grafana-app-sdk. DO NOT EDIT.
//
package v0alpha1
import (
"encoding/json"
"io"
"github.com/grafana/grafana-app-sdk/resource"
)
// CheckTypeJSONCodec is an implementation of resource.Codec for kubernetes JSON encoding
type CheckTypeJSONCodec struct{}
// Read reads JSON-encoded bytes from `reader` and unmarshals them into `into`
func (*CheckTypeJSONCodec) Read(reader io.Reader, into resource.Object) error {
return json.NewDecoder(reader).Decode(into)
}
// Write writes JSON-encoded bytes into `writer` marshaled from `from`
func (*CheckTypeJSONCodec) Write(writer io.Writer, from resource.Object) error {
return json.NewEncoder(writer).Encode(from)
}
// Interface compliance checks
var _ resource.Codec = &CheckTypeJSONCodec{}

View File

@@ -0,0 +1,28 @@
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
package v0alpha1
import (
time "time"
)
// metadata contains embedded CommonMetadata and can be extended with custom string fields
// TODO: use CommonMetadata instead of redefining here; currently needs to be defined here
// without external reference as using the CommonMetadata reference breaks thema codegen.
type CheckTypeMetadata struct {
UpdateTimestamp time.Time `json:"updateTimestamp"`
CreatedBy string `json:"createdBy"`
Uid string `json:"uid"`
CreationTimestamp time.Time `json:"creationTimestamp"`
DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty"`
Finalizers []string `json:"finalizers"`
ResourceVersion string `json:"resourceVersion"`
Generation int64 `json:"generation"`
UpdatedBy string `json:"updatedBy"`
Labels map[string]string `json:"labels"`
}
// NewCheckTypeMetadata creates a new CheckTypeMetadata object.
func NewCheckTypeMetadata() *CheckTypeMetadata {
return &CheckTypeMetadata{}
}

View File

@@ -0,0 +1,266 @@
//
// Code generated by grafana-app-sdk. DO NOT EDIT.
//
package v0alpha1
import (
"fmt"
"github.com/grafana/grafana-app-sdk/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/types"
"time"
)
// +k8s:openapi-gen=true
type CheckType struct {
metav1.TypeMeta `json:",inline" yaml:",inline"`
metav1.ObjectMeta `json:"metadata" yaml:"metadata"`
Spec CheckTypeSpec `json:"spec" yaml:"spec"`
CheckTypeStatus CheckTypeStatus `json:"status" yaml:"status"`
}
func (o *CheckType) GetSpec() any {
return o.Spec
}
func (o *CheckType) SetSpec(spec any) error {
cast, ok := spec.(CheckTypeSpec)
if !ok {
return fmt.Errorf("cannot set spec type %#v, not of type Spec", spec)
}
o.Spec = cast
return nil
}
func (o *CheckType) GetSubresources() map[string]any {
return map[string]any{
"status": o.CheckTypeStatus,
}
}
func (o *CheckType) GetSubresource(name string) (any, bool) {
switch name {
case "status":
return o.CheckTypeStatus, true
default:
return nil, false
}
}
func (o *CheckType) SetSubresource(name string, value any) error {
switch name {
case "status":
cast, ok := value.(CheckTypeStatus)
if !ok {
return fmt.Errorf("cannot set status type %#v, not of type CheckTypeStatus", value)
}
o.CheckTypeStatus = cast
return nil
default:
return fmt.Errorf("subresource '%s' does not exist", name)
}
}
func (o *CheckType) GetStaticMetadata() resource.StaticMetadata {
gvk := o.GroupVersionKind()
return resource.StaticMetadata{
Name: o.ObjectMeta.Name,
Namespace: o.ObjectMeta.Namespace,
Group: gvk.Group,
Version: gvk.Version,
Kind: gvk.Kind,
}
}
func (o *CheckType) SetStaticMetadata(metadata resource.StaticMetadata) {
o.Name = metadata.Name
o.Namespace = metadata.Namespace
o.SetGroupVersionKind(schema.GroupVersionKind{
Group: metadata.Group,
Version: metadata.Version,
Kind: metadata.Kind,
})
}
func (o *CheckType) GetCommonMetadata() resource.CommonMetadata {
dt := o.DeletionTimestamp
var deletionTimestamp *time.Time
if dt != nil {
deletionTimestamp = &dt.Time
}
// Legacy ExtraFields support
extraFields := make(map[string]any)
if o.Annotations != nil {
extraFields["annotations"] = o.Annotations
}
if o.ManagedFields != nil {
extraFields["managedFields"] = o.ManagedFields
}
if o.OwnerReferences != nil {
extraFields["ownerReferences"] = o.OwnerReferences
}
return resource.CommonMetadata{
UID: string(o.UID),
ResourceVersion: o.ResourceVersion,
Generation: o.Generation,
Labels: o.Labels,
CreationTimestamp: o.CreationTimestamp.Time,
DeletionTimestamp: deletionTimestamp,
Finalizers: o.Finalizers,
UpdateTimestamp: o.GetUpdateTimestamp(),
CreatedBy: o.GetCreatedBy(),
UpdatedBy: o.GetUpdatedBy(),
ExtraFields: extraFields,
}
}
func (o *CheckType) SetCommonMetadata(metadata resource.CommonMetadata) {
o.UID = types.UID(metadata.UID)
o.ResourceVersion = metadata.ResourceVersion
o.Generation = metadata.Generation
o.Labels = metadata.Labels
o.CreationTimestamp = metav1.NewTime(metadata.CreationTimestamp)
if metadata.DeletionTimestamp != nil {
dt := metav1.NewTime(*metadata.DeletionTimestamp)
o.DeletionTimestamp = &dt
} else {
o.DeletionTimestamp = nil
}
o.Finalizers = metadata.Finalizers
if o.Annotations == nil {
o.Annotations = make(map[string]string)
}
if !metadata.UpdateTimestamp.IsZero() {
o.SetUpdateTimestamp(metadata.UpdateTimestamp)
}
if metadata.CreatedBy != "" {
o.SetCreatedBy(metadata.CreatedBy)
}
if metadata.UpdatedBy != "" {
o.SetUpdatedBy(metadata.UpdatedBy)
}
// Legacy support for setting Annotations, ManagedFields, and OwnerReferences via ExtraFields
if metadata.ExtraFields != nil {
if annotations, ok := metadata.ExtraFields["annotations"]; ok {
if cast, ok := annotations.(map[string]string); ok {
o.Annotations = cast
}
}
if managedFields, ok := metadata.ExtraFields["managedFields"]; ok {
if cast, ok := managedFields.([]metav1.ManagedFieldsEntry); ok {
o.ManagedFields = cast
}
}
if ownerReferences, ok := metadata.ExtraFields["ownerReferences"]; ok {
if cast, ok := ownerReferences.([]metav1.OwnerReference); ok {
o.OwnerReferences = cast
}
}
}
}
func (o *CheckType) GetCreatedBy() string {
if o.ObjectMeta.Annotations == nil {
o.ObjectMeta.Annotations = make(map[string]string)
}
return o.ObjectMeta.Annotations["grafana.com/createdBy"]
}
func (o *CheckType) SetCreatedBy(createdBy string) {
if o.ObjectMeta.Annotations == nil {
o.ObjectMeta.Annotations = make(map[string]string)
}
o.ObjectMeta.Annotations["grafana.com/createdBy"] = createdBy
}
func (o *CheckType) GetUpdateTimestamp() time.Time {
if o.ObjectMeta.Annotations == nil {
o.ObjectMeta.Annotations = make(map[string]string)
}
parsed, _ := time.Parse(time.RFC3339, o.ObjectMeta.Annotations["grafana.com/updateTimestamp"])
return parsed
}
func (o *CheckType) SetUpdateTimestamp(updateTimestamp time.Time) {
if o.ObjectMeta.Annotations == nil {
o.ObjectMeta.Annotations = make(map[string]string)
}
o.ObjectMeta.Annotations["grafana.com/updateTimestamp"] = updateTimestamp.Format(time.RFC3339)
}
func (o *CheckType) GetUpdatedBy() string {
if o.ObjectMeta.Annotations == nil {
o.ObjectMeta.Annotations = make(map[string]string)
}
return o.ObjectMeta.Annotations["grafana.com/updatedBy"]
}
func (o *CheckType) SetUpdatedBy(updatedBy string) {
if o.ObjectMeta.Annotations == nil {
o.ObjectMeta.Annotations = make(map[string]string)
}
o.ObjectMeta.Annotations["grafana.com/updatedBy"] = updatedBy
}
func (o *CheckType) Copy() resource.Object {
return resource.CopyObject(o)
}
func (o *CheckType) DeepCopyObject() runtime.Object {
return o.Copy()
}
// Interface compliance compile-time check
var _ resource.Object = &CheckType{}
// +k8s:openapi-gen=true
type CheckTypeList struct {
metav1.TypeMeta `json:",inline" yaml:",inline"`
metav1.ListMeta `json:"metadata" yaml:"metadata"`
Items []CheckType `json:"items" yaml:"items"`
}
func (o *CheckTypeList) DeepCopyObject() runtime.Object {
return o.Copy()
}
func (o *CheckTypeList) Copy() resource.ListObject {
cpy := &CheckTypeList{
TypeMeta: o.TypeMeta,
Items: make([]CheckType, len(o.Items)),
}
o.ListMeta.DeepCopyInto(&cpy.ListMeta)
for i := 0; i < len(o.Items); i++ {
if item, ok := o.Items[i].Copy().(*CheckType); ok {
cpy.Items[i] = *item
}
}
return cpy
}
func (o *CheckTypeList) GetItems() []resource.Object {
items := make([]resource.Object, len(o.Items))
for i := 0; i < len(o.Items); i++ {
items[i] = &o.Items[i]
}
return items
}
func (o *CheckTypeList) SetItems(items []resource.Object) {
o.Items = make([]CheckType, len(items))
for i := 0; i < len(items); i++ {
o.Items[i] = *items[i].(*CheckType)
}
}
// Interface compliance compile-time check
var _ resource.ListObject = &CheckTypeList{}

View File

@@ -0,0 +1,34 @@
//
// Code generated by grafana-app-sdk. DO NOT EDIT.
//
package v0alpha1
import (
"github.com/grafana/grafana-app-sdk/resource"
)
// schema is unexported to prevent accidental overwrites
var (
schemaCheckType = resource.NewSimpleSchema("advisor.grafana.app", "v0alpha1", &CheckType{}, &CheckTypeList{}, resource.WithKind("CheckType"),
resource.WithPlural("checktypes"), resource.WithScope(resource.NamespacedScope))
kindCheckType = resource.Kind{
Schema: schemaCheckType,
Codecs: map[resource.KindEncoding]resource.Codec{
resource.KindEncodingJSON: &CheckTypeJSONCodec{},
},
}
)
// Kind returns a resource.Kind for this Schema with a JSON codec
func CheckTypeKind() resource.Kind {
return kindCheckType
}
// Schema returns a resource.SimpleSchema representation of CheckType
func CheckTypeSchema() *resource.SimpleSchema {
return schemaCheckType
}
// Interface compliance checks
var _ resource.Schema = kindCheckType

View File

@@ -0,0 +1,26 @@
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
package v0alpha1
// +k8s:openapi-gen=true
type CheckTypeStep struct {
Title string `json:"title"`
Description string `json:"description"`
StepID string `json:"stepID"`
}
// NewCheckTypeStep creates a new CheckTypeStep object.
func NewCheckTypeStep() *CheckTypeStep {
return &CheckTypeStep{}
}
// +k8s:openapi-gen=true
type CheckTypeSpec struct {
Name string `json:"name"`
Steps []CheckTypeStep `json:"steps"`
}
// NewCheckTypeSpec creates a new CheckTypeSpec object.
func NewCheckTypeSpec() *CheckTypeSpec {
return &CheckTypeSpec{}
}

View File

@@ -0,0 +1,44 @@
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
package v0alpha1
// +k8s:openapi-gen=true
type CheckTypestatusOperatorState struct {
// lastEvaluation is the ResourceVersion last evaluated
LastEvaluation string `json:"lastEvaluation"`
// state describes the state of the lastEvaluation.
// It is limited to three possible states for machine evaluation.
State CheckTypeStatusOperatorStateState `json:"state"`
// descriptiveState is an optional more descriptive state field which has no requirements on format
DescriptiveState *string `json:"descriptiveState,omitempty"`
// details contains any extra information that is operator-specific
Details map[string]interface{} `json:"details,omitempty"`
}
// NewCheckTypestatusOperatorState creates a new CheckTypestatusOperatorState object.
func NewCheckTypestatusOperatorState() *CheckTypestatusOperatorState {
return &CheckTypestatusOperatorState{}
}
// +k8s:openapi-gen=true
type CheckTypeStatus struct {
// operatorStates is a map of operator ID to operator state evaluations.
// Any operator which consumes this kind SHOULD add its state evaluation information to this field.
OperatorStates map[string]CheckTypestatusOperatorState `json:"operatorStates,omitempty"`
// additionalFields is reserved for future use
AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"`
}
// NewCheckTypeStatus creates a new CheckTypeStatus object.
func NewCheckTypeStatus() *CheckTypeStatus {
return &CheckTypeStatus{}
}
// +k8s:openapi-gen=true
type CheckTypeStatusOperatorStateState string
const (
CheckTypeStatusOperatorStateStateSuccess CheckTypeStatusOperatorStateState = "success"
CheckTypeStatusOperatorStateStateInProgress CheckTypeStatusOperatorStateState = "in_progress"
CheckTypeStatusOperatorStateStateFailed CheckTypeStatusOperatorStateState = "failed"
)

View File

@@ -0,0 +1,18 @@
package v0alpha1
import "k8s.io/apimachinery/pkg/runtime/schema"
const (
// Group is the API group used by all kinds in this package
Group = "advisor.grafana.app"
// Version is the API version used by all kinds in this package
Version = "v0alpha1"
)
var (
// GroupVersion is a schema.GroupVersion consisting of the Group and Version constants for this package
GroupVersion = schema.GroupVersion{
Group: Group,
Version: Version,
}
)

View File

@@ -3,7 +3,7 @@
// Code generated by grafana-app-sdk. DO NOT EDIT.
package v1alpha1
package v0alpha1
import (
common "k8s.io/kube-openapi/pkg/common"
@@ -12,22 +12,23 @@ import (
func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition {
return map[string]common.OpenAPIDefinition{
"github.com/grafana/grafana/apps/investigation/pkg/apis/investigation/v1alpha1.Investigation": schema_pkg_apis_investigation_v1alpha1_Investigation(ref),
"github.com/grafana/grafana/apps/investigation/pkg/apis/investigation/v1alpha1.InvestigationAbsoluteTimeRange": schema_pkg_apis_investigation_v1alpha1_InvestigationAbsoluteTimeRange(ref),
"github.com/grafana/grafana/apps/investigation/pkg/apis/investigation/v1alpha1.InvestigationComment": schema_pkg_apis_investigation_v1alpha1_InvestigationComment(ref),
"github.com/grafana/grafana/apps/investigation/pkg/apis/investigation/v1alpha1.InvestigationDataQueryLogs": schema_pkg_apis_investigation_v1alpha1_InvestigationDataQueryLogs(ref),
"github.com/grafana/grafana/apps/investigation/pkg/apis/investigation/v1alpha1.InvestigationDataQueryMetrics": schema_pkg_apis_investigation_v1alpha1_InvestigationDataQueryMetrics(ref),
"github.com/grafana/grafana/apps/investigation/pkg/apis/investigation/v1alpha1.InvestigationDatasourceRef": schema_pkg_apis_investigation_v1alpha1_InvestigationDatasourceRef(ref),
"github.com/grafana/grafana/apps/investigation/pkg/apis/investigation/v1alpha1.InvestigationInvestigationItem": schema_pkg_apis_investigation_v1alpha1_InvestigationInvestigationItem(ref),
"github.com/grafana/grafana/apps/investigation/pkg/apis/investigation/v1alpha1.InvestigationList": schema_pkg_apis_investigation_v1alpha1_InvestigationList(ref),
"github.com/grafana/grafana/apps/investigation/pkg/apis/investigation/v1alpha1.InvestigationOperatorState": schema_pkg_apis_investigation_v1alpha1_InvestigationOperatorState(ref),
"github.com/grafana/grafana/apps/investigation/pkg/apis/investigation/v1alpha1.InvestigationSpec": schema_pkg_apis_investigation_v1alpha1_InvestigationSpec(ref),
"github.com/grafana/grafana/apps/investigation/pkg/apis/investigation/v1alpha1.InvestigationStatus": schema_pkg_apis_investigation_v1alpha1_InvestigationStatus(ref),
"github.com/grafana/grafana/apps/investigation/pkg/apis/investigation/v1alpha1.InvestigationstatusOperatorState": schema_pkg_apis_investigation_v1alpha1_InvestigationstatusOperatorState(ref),
"github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.Check": schema_pkg_apis_advisor_v0alpha1_Check(ref),
"github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckList": schema_pkg_apis_advisor_v0alpha1_CheckList(ref),
"github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckReportFailure": schema_pkg_apis_advisor_v0alpha1_CheckReportFailure(ref),
"github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckSpec": schema_pkg_apis_advisor_v0alpha1_CheckSpec(ref),
"github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckStatus": schema_pkg_apis_advisor_v0alpha1_CheckStatus(ref),
"github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckType": schema_pkg_apis_advisor_v0alpha1_CheckType(ref),
"github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckTypeList": schema_pkg_apis_advisor_v0alpha1_CheckTypeList(ref),
"github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckTypeSpec": schema_pkg_apis_advisor_v0alpha1_CheckTypeSpec(ref),
"github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckTypeStatus": schema_pkg_apis_advisor_v0alpha1_CheckTypeStatus(ref),
"github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckTypeStep": schema_pkg_apis_advisor_v0alpha1_CheckTypeStep(ref),
"github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckTypestatusOperatorState": schema_pkg_apis_advisor_v0alpha1_CheckTypestatusOperatorState(ref),
"github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckV0alpha1StatusReport": schema_pkg_apis_advisor_v0alpha1_CheckV0alpha1StatusReport(ref),
"github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckstatusOperatorState": schema_pkg_apis_advisor_v0alpha1_CheckstatusOperatorState(ref),
}
}
func schema_pkg_apis_investigation_v1alpha1_Investigation(ref common.ReferenceCallback) common.OpenAPIDefinition {
func schema_pkg_apis_advisor_v0alpha1_Check(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
@@ -56,13 +57,13 @@ func schema_pkg_apis_investigation_v1alpha1_Investigation(ref common.ReferenceCa
"spec": {
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("github.com/grafana/grafana/apps/investigation/pkg/apis/investigation/v1alpha1.InvestigationSpec"),
Ref: ref("github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckSpec"),
},
},
"status": {
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("github.com/grafana/grafana/apps/investigation/pkg/apis/investigation/v1alpha1.InvestigationStatus"),
Ref: ref("github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckStatus"),
},
},
},
@@ -70,289 +71,11 @@ func schema_pkg_apis_investigation_v1alpha1_Investigation(ref common.ReferenceCa
},
},
Dependencies: []string{
"github.com/grafana/grafana/apps/investigation/pkg/apis/investigation/v1alpha1.InvestigationSpec", "github.com/grafana/grafana/apps/investigation/pkg/apis/investigation/v1alpha1.InvestigationStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"},
"github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckSpec", "github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"},
}
}
func schema_pkg_apis_investigation_v1alpha1_InvestigationAbsoluteTimeRange(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "AbsoluteTimeRange is a time range specified by absolute timestamps.",
Type: []string{"object"},
Properties: map[string]spec.Schema{
"from": {
SchemaProps: spec.SchemaProps{
Default: 0,
Type: []string{"number"},
Format: "float",
},
},
"to": {
SchemaProps: spec.SchemaProps{
Default: 0,
Type: []string{"number"},
Format: "float",
},
},
},
Required: []string{"from", "to"},
},
},
}
}
func schema_pkg_apis_investigation_v1alpha1_InvestigationComment(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "Comment is a comment on an investigation item.",
Type: []string{"object"},
Properties: map[string]spec.Schema{
"authorUserID": {
SchemaProps: spec.SchemaProps{
Default: "",
Type: []string{"string"},
Format: "",
},
},
"bodyMarkdown": {
SchemaProps: spec.SchemaProps{
Default: "",
Type: []string{"string"},
Format: "",
},
},
},
Required: []string{"authorUserID", "bodyMarkdown"},
},
},
}
}
func schema_pkg_apis_investigation_v1alpha1_InvestigationDataQueryLogs(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "DataQueryLogs is a data query for logs.",
Type: []string{"object"},
Properties: map[string]spec.Schema{
"datasource": {
SchemaProps: spec.SchemaProps{
Description: "DatasourceRef is a reference to a datasource.",
Default: map[string]interface{}{},
Ref: ref("github.com/grafana/grafana/apps/investigation/pkg/apis/investigation/v1alpha1.InvestigationDatasourceRef"),
},
},
"expr": {
SchemaProps: spec.SchemaProps{
Description: "expr is the expression of the query.",
Default: "",
Type: []string{"string"},
Format: "",
},
},
"maxLines": {
SchemaProps: spec.SchemaProps{
Description: "maxLines (optional) is used to limit the number of log rows returned.",
Type: []string{"integer"},
Format: "int64",
},
},
"refId": {
SchemaProps: spec.SchemaProps{
Description: "refId is the reference ID of the query.",
Default: "",
Type: []string{"string"},
Format: "",
},
},
},
Required: []string{"datasource", "expr", "refId"},
},
},
Dependencies: []string{
"github.com/grafana/grafana/apps/investigation/pkg/apis/investigation/v1alpha1.InvestigationDatasourceRef"},
}
}
func schema_pkg_apis_investigation_v1alpha1_InvestigationDataQueryMetrics(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "DataQueryMetrics is a data query for metrics.",
Type: []string{"object"},
Properties: map[string]spec.Schema{
"datasource": {
SchemaProps: spec.SchemaProps{
Description: "DatasourceRef is a reference to a datasource.",
Default: map[string]interface{}{},
Ref: ref("github.com/grafana/grafana/apps/investigation/pkg/apis/investigation/v1alpha1.InvestigationDatasourceRef"),
},
},
"expr": {
SchemaProps: spec.SchemaProps{
Default: "",
Type: []string{"string"},
Format: "",
},
},
"refId": {
SchemaProps: spec.SchemaProps{
Default: "",
Type: []string{"string"},
Format: "",
},
},
},
Required: []string{"datasource", "expr", "refId"},
},
},
Dependencies: []string{
"github.com/grafana/grafana/apps/investigation/pkg/apis/investigation/v1alpha1.InvestigationDatasourceRef"},
}
}
func schema_pkg_apis_investigation_v1alpha1_InvestigationDatasourceRef(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "DatasourceRef is a reference to a datasource.",
Type: []string{"object"},
Properties: map[string]spec.Schema{
"apiVersion": {
SchemaProps: spec.SchemaProps{
Default: "",
Type: []string{"string"},
Format: "",
},
},
"name": {
SchemaProps: spec.SchemaProps{
Default: "",
Type: []string{"string"},
Format: "",
},
},
"type": {
SchemaProps: spec.SchemaProps{
Default: "",
Type: []string{"string"},
Format: "",
},
},
"uid": {
SchemaProps: spec.SchemaProps{
Default: "",
Type: []string{"string"},
Format: "",
},
},
},
Required: []string{"apiVersion", "name", "type", "uid"},
},
},
}
}
func schema_pkg_apis_investigation_v1alpha1_InvestigationInvestigationItem(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "InvestigationItem is an item in an investigation.",
Type: []string{"object"},
Properties: map[string]spec.Schema{
"dataQuery": {
SchemaProps: spec.SchemaProps{
Description: "dataQuery contains the query used to generate this item.",
Type: []string{"object"},
Format: "",
},
},
"iconPath": {
SchemaProps: spec.SchemaProps{
Description: "iconPath (optional) is the path to the icon for the item.",
Type: []string{"string"},
Format: "",
},
},
"id": {
SchemaProps: spec.SchemaProps{
Default: "",
Type: []string{"string"},
Format: "",
},
},
"note": {
SchemaProps: spec.SchemaProps{
Description: "note (optional) is a comment on the item.",
Type: []string{"array"},
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("github.com/grafana/grafana/apps/investigation/pkg/apis/investigation/v1alpha1.InvestigationComment"),
},
},
},
},
},
"origin": {
SchemaProps: spec.SchemaProps{
Description: "origin is where the item was created from.",
Default: "",
Type: []string{"string"},
Format: "",
},
},
"queryType": {
SchemaProps: spec.SchemaProps{
Description: "queryType is the type of the query used to generate this item.",
Default: "",
Type: []string{"string"},
Format: "",
},
},
"timeRange": {
SchemaProps: spec.SchemaProps{
Description: "AbsoluteTimeRange is a time range specified by absolute timestamps.",
Default: map[string]interface{}{},
Ref: ref("github.com/grafana/grafana/apps/investigation/pkg/apis/investigation/v1alpha1.InvestigationAbsoluteTimeRange"),
},
},
"title": {
SchemaProps: spec.SchemaProps{
Default: "",
Type: []string{"string"},
Format: "",
},
},
"type": {
SchemaProps: spec.SchemaProps{
Description: "type is the type of the item \"timeseries\", \"heatmap\", \"log-table\" (not an enum to allow for future extensions).",
Default: "",
Type: []string{"string"},
Format: "",
},
},
"url": {
SchemaProps: spec.SchemaProps{
Description: "url is the URL to the item.",
Default: "",
Type: []string{"string"},
Format: "",
},
},
},
Required: []string{"dataQuery", "id", "origin", "queryType", "timeRange", "title", "type", "url"},
},
},
Dependencies: []string{
"github.com/grafana/grafana/apps/investigation/pkg/apis/investigation/v1alpha1.InvestigationAbsoluteTimeRange", "github.com/grafana/grafana/apps/investigation/pkg/apis/investigation/v1alpha1.InvestigationComment"},
}
}
func schema_pkg_apis_investigation_v1alpha1_InvestigationList(ref common.ReferenceCallback) common.OpenAPIDefinition {
func schema_pkg_apis_advisor_v0alpha1_CheckList(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
@@ -385,7 +108,7 @@ func schema_pkg_apis_investigation_v1alpha1_InvestigationList(ref common.Referen
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("github.com/grafana/grafana/apps/investigation/pkg/apis/investigation/v1alpha1.Investigation"),
Ref: ref("github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.Check"),
},
},
},
@@ -396,112 +119,118 @@ func schema_pkg_apis_investigation_v1alpha1_InvestigationList(ref common.Referen
},
},
Dependencies: []string{
"github.com/grafana/grafana/apps/investigation/pkg/apis/investigation/v1alpha1.Investigation", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"},
"github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.Check", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"},
}
}
func schema_pkg_apis_investigation_v1alpha1_InvestigationOperatorState(ref common.ReferenceCallback) common.OpenAPIDefinition {
func schema_pkg_apis_advisor_v0alpha1_CheckReportFailure(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "InvestigationOperatorState defines model for InvestigationOperatorState.",
Type: []string{"object"},
Type: []string{"object"},
Properties: map[string]spec.Schema{
"descriptiveState": {
"severity": {
SchemaProps: spec.SchemaProps{
Description: "descriptiveState is an optional more descriptive state field which has no requirements on format",
Description: "Severity of the failure",
Default: "",
Type: []string{"string"},
Format: "",
},
},
"details": {
"reason": {
SchemaProps: spec.SchemaProps{
Description: "details contains any extra information that is operator-specific",
Description: "Human readable reason for the failure",
Default: "",
Type: []string{"string"},
Format: "",
},
},
"action": {
SchemaProps: spec.SchemaProps{
Description: "Action to take to resolve the failure",
Default: "",
Type: []string{"string"},
Format: "",
},
},
"stepID": {
SchemaProps: spec.SchemaProps{
Description: "Step ID that the failure is associated with",
Default: "",
Type: []string{"string"},
Format: "",
},
},
"itemID": {
SchemaProps: spec.SchemaProps{
Description: "Item ID that the failure is associated with",
Default: "",
Type: []string{"string"},
Format: "",
},
},
},
Required: []string{"severity", "reason", "action", "stepID", "itemID"},
},
},
}
}
func schema_pkg_apis_advisor_v0alpha1_CheckSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: map[string]spec.Schema{
"data": {
SchemaProps: spec.SchemaProps{
Description: "Generic data input that a check can receive",
Type: []string{"object"},
AdditionalProperties: &spec.SchemaOrBool{
Allows: true,
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Format: "",
Default: "",
Type: []string{"string"},
Format: "",
},
},
},
},
},
"lastEvaluation": {
SchemaProps: spec.SchemaProps{
Description: "lastEvaluation is the ResourceVersion last evaluated",
Default: "",
Type: []string{"string"},
Format: "",
},
},
"state": {
SchemaProps: spec.SchemaProps{
Description: "state describes the state of the lastEvaluation. It is limited to three possible states for machine evaluation.",
Default: "",
Type: []string{"string"},
Format: "",
},
},
},
Required: []string{"lastEvaluation", "state"},
},
},
}
}
func schema_pkg_apis_investigation_v1alpha1_InvestigationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
func schema_pkg_apis_advisor_v0alpha1_CheckStatus(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "InvestigationSpec defines model for InvestigationSpec.",
Type: []string{"object"},
Type: []string{"object"},
Properties: map[string]spec.Schema{
"items": {
"report": {
SchemaProps: spec.SchemaProps{
Type: []string{"array"},
Items: &spec.SchemaOrArray{
Default: map[string]interface{}{},
Ref: ref("github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckV0alpha1StatusReport"),
},
},
"operatorStates": {
SchemaProps: spec.SchemaProps{
Description: "operatorStates is a map of operator ID to operator state evaluations. Any operator which consumes this kind SHOULD add its state evaluation information to this field.",
Type: []string{"object"},
AdditionalProperties: &spec.SchemaOrBool{
Allows: true,
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("github.com/grafana/grafana/apps/investigation/pkg/apis/investigation/v1alpha1.InvestigationInvestigationItem"),
Ref: ref("github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckstatusOperatorState"),
},
},
},
},
},
"status": {
SchemaProps: spec.SchemaProps{
Default: "",
Type: []string{"string"},
Format: "",
},
},
"title": {
SchemaProps: spec.SchemaProps{
Default: "",
Type: []string{"string"},
Format: "",
},
},
},
Required: []string{"items", "status", "title"},
},
},
Dependencies: []string{
"github.com/grafana/grafana/apps/investigation/pkg/apis/investigation/v1alpha1.InvestigationInvestigationItem"},
}
}
func schema_pkg_apis_investigation_v1alpha1_InvestigationStatus(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "InvestigationStatus defines model for InvestigationStatus.",
Type: []string{"object"},
Properties: map[string]spec.Schema{
"additionalFields": {
SchemaProps: spec.SchemaProps{
Description: "additionalFields is reserved for future use",
@@ -517,6 +246,151 @@ func schema_pkg_apis_investigation_v1alpha1_InvestigationStatus(ref common.Refer
},
},
},
},
Required: []string{"report"},
},
},
Dependencies: []string{
"github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckV0alpha1StatusReport", "github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckstatusOperatorState"},
}
}
func schema_pkg_apis_advisor_v0alpha1_CheckType(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: map[string]spec.Schema{
"kind": {
SchemaProps: spec.SchemaProps{
Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
Type: []string{"string"},
Format: "",
},
},
"apiVersion": {
SchemaProps: spec.SchemaProps{
Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
Type: []string{"string"},
Format: "",
},
},
"metadata": {
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"),
},
},
"spec": {
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckTypeSpec"),
},
},
"status": {
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckTypeStatus"),
},
},
},
Required: []string{"metadata", "spec", "status"},
},
},
Dependencies: []string{
"github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckTypeSpec", "github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckTypeStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"},
}
}
func schema_pkg_apis_advisor_v0alpha1_CheckTypeList(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: map[string]spec.Schema{
"kind": {
SchemaProps: spec.SchemaProps{
Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
Type: []string{"string"},
Format: "",
},
},
"apiVersion": {
SchemaProps: spec.SchemaProps{
Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
Type: []string{"string"},
Format: "",
},
},
"metadata": {
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"),
},
},
"items": {
SchemaProps: spec.SchemaProps{
Type: []string{"array"},
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckType"),
},
},
},
},
},
},
Required: []string{"metadata", "items"},
},
},
Dependencies: []string{
"github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckType", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"},
}
}
func schema_pkg_apis_advisor_v0alpha1_CheckTypeSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: map[string]spec.Schema{
"name": {
SchemaProps: spec.SchemaProps{
Default: "",
Type: []string{"string"},
Format: "",
},
},
"steps": {
SchemaProps: spec.SchemaProps{
Type: []string{"array"},
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckTypeStep"),
},
},
},
},
},
},
Required: []string{"name", "steps"},
},
},
Dependencies: []string{
"github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckTypeStep"},
}
}
func schema_pkg_apis_advisor_v0alpha1_CheckTypeStatus(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: map[string]spec.Schema{
"operatorStates": {
SchemaProps: spec.SchemaProps{
Description: "operatorStates is a map of operator ID to operator state evaluations. Any operator which consumes this kind SHOULD add its state evaluation information to this field.",
@@ -526,7 +400,22 @@ func schema_pkg_apis_investigation_v1alpha1_InvestigationStatus(ref common.Refer
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("github.com/grafana/grafana/apps/investigation/pkg/apis/investigation/v1alpha1.InvestigationstatusOperatorState"),
Ref: ref("github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckTypestatusOperatorState"),
},
},
},
},
},
"additionalFields": {
SchemaProps: spec.SchemaProps{
Description: "additionalFields is reserved for future use",
Type: []string{"object"},
AdditionalProperties: &spec.SchemaOrBool{
Allows: true,
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Format: "",
},
},
},
@@ -536,17 +425,66 @@ func schema_pkg_apis_investigation_v1alpha1_InvestigationStatus(ref common.Refer
},
},
Dependencies: []string{
"github.com/grafana/grafana/apps/investigation/pkg/apis/investigation/v1alpha1.InvestigationstatusOperatorState"},
"github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckTypestatusOperatorState"},
}
}
func schema_pkg_apis_investigation_v1alpha1_InvestigationstatusOperatorState(ref common.ReferenceCallback) common.OpenAPIDefinition {
func schema_pkg_apis_advisor_v0alpha1_CheckTypeStep(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "InvestigationstatusOperatorState defines model for Investigationstatus.#OperatorState.",
Type: []string{"object"},
Type: []string{"object"},
Properties: map[string]spec.Schema{
"title": {
SchemaProps: spec.SchemaProps{
Default: "",
Type: []string{"string"},
Format: "",
},
},
"description": {
SchemaProps: spec.SchemaProps{
Default: "",
Type: []string{"string"},
Format: "",
},
},
"stepID": {
SchemaProps: spec.SchemaProps{
Default: "",
Type: []string{"string"},
Format: "",
},
},
},
Required: []string{"title", "description", "stepID"},
},
},
}
}
func schema_pkg_apis_advisor_v0alpha1_CheckTypestatusOperatorState(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: map[string]spec.Schema{
"lastEvaluation": {
SchemaProps: spec.SchemaProps{
Description: "lastEvaluation is the ResourceVersion last evaluated",
Default: "",
Type: []string{"string"},
Format: "",
},
},
"state": {
SchemaProps: spec.SchemaProps{
Description: "state describes the state of the lastEvaluation. It is limited to three possible states for machine evaluation.",
Default: "",
Type: []string{"string"},
Format: "",
},
},
"descriptiveState": {
SchemaProps: spec.SchemaProps{
Description: "descriptiveState is an optional more descriptive state field which has no requirements on format",
@@ -569,6 +507,56 @@ func schema_pkg_apis_investigation_v1alpha1_InvestigationstatusOperatorState(ref
},
},
},
},
Required: []string{"lastEvaluation", "state"},
},
},
}
}
func schema_pkg_apis_advisor_v0alpha1_CheckV0alpha1StatusReport(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: map[string]spec.Schema{
"count": {
SchemaProps: spec.SchemaProps{
Description: "Number of elements analyzed",
Default: 0,
Type: []string{"integer"},
Format: "int64",
},
},
"failures": {
SchemaProps: spec.SchemaProps{
Description: "List of failures",
Type: []string{"array"},
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckReportFailure"),
},
},
},
},
},
},
Required: []string{"count", "failures"},
},
},
Dependencies: []string{
"github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1.CheckReportFailure"},
}
}
func schema_pkg_apis_advisor_v0alpha1_CheckstatusOperatorState(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: map[string]spec.Schema{
"lastEvaluation": {
SchemaProps: spec.SchemaProps{
Description: "lastEvaluation is the ResourceVersion last evaluated",
@@ -585,6 +573,28 @@ func schema_pkg_apis_investigation_v1alpha1_InvestigationstatusOperatorState(ref
Format: "",
},
},
"descriptiveState": {
SchemaProps: spec.SchemaProps{
Description: "descriptiveState is an optional more descriptive state field which has no requirements on format",
Type: []string{"string"},
Format: "",
},
},
"details": {
SchemaProps: spec.SchemaProps{
Description: "details contains any extra information that is operator-specific",
Type: []string{"object"},
AdditionalProperties: &spec.SchemaOrBool{
Allows: true,
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Format: "",
},
},
},
},
},
},
Required: []string{"lastEvaluation", "state"},
},

View File

@@ -0,0 +1,73 @@
//
// This file is generated by grafana-app-sdk
// DO NOT EDIT
//
package apis
import (
"encoding/json"
"github.com/grafana/grafana-app-sdk/app"
)
var (
rawSchemaCheckv0alpha1 = []byte(`{"spec":{"properties":{"data":{"additionalProperties":{"type":"string"},"description":"Generic data input that a check can receive","type":"object"}},"type":"object"},"status":{"properties":{"additionalFields":{"description":"additionalFields is reserved for future use","type":"object","x-kubernetes-preserve-unknown-fields":true},"operatorStates":{"additionalProperties":{"properties":{"descriptiveState":{"description":"descriptiveState is an optional more descriptive state field which has no requirements on format","type":"string"},"details":{"description":"details contains any extra information that is operator-specific","type":"object","x-kubernetes-preserve-unknown-fields":true},"lastEvaluation":{"description":"lastEvaluation is the ResourceVersion last evaluated","type":"string"},"state":{"description":"state describes the state of the lastEvaluation.\nIt is limited to three possible states for machine evaluation.","enum":["success","in_progress","failed"],"type":"string"}},"required":["lastEvaluation","state"],"type":"object"},"description":"operatorStates is a map of operator ID to operator state evaluations.\nAny operator which consumes this kind SHOULD add its state evaluation information to this field.","type":"object"},"report":{"properties":{"count":{"description":"Number of elements analyzed","type":"integer"},"failures":{"description":"List of failures","items":{"properties":{"action":{"description":"Action to take to resolve the failure","type":"string"},"itemID":{"description":"Item ID that the failure is associated with","type":"string"},"reason":{"description":"Human readable reason for the failure","type":"string"},"severity":{"description":"Severity of the failure","enum":["high","low"],"type":"string"},"stepID":{"description":"Step ID that the failure is associated with","type":"string"}},"required":["severity","reason","action","stepID","itemID"],"type":"object"},"type":"array"}},"required":["count","failures"],"type":"object"}},"required":["report"],"type":"object","x-kubernetes-preserve-unknown-fields":true}}`)
versionSchemaCheckv0alpha1 app.VersionSchema
_ = json.Unmarshal(rawSchemaCheckv0alpha1, &versionSchemaCheckv0alpha1)
rawSchemaCheckTypev0alpha1 = []byte(`{"spec":{"properties":{"name":{"type":"string"},"steps":{"items":{"properties":{"description":{"type":"string"},"stepID":{"type":"string"},"title":{"type":"string"}},"required":["title","description","stepID"],"type":"object"},"type":"array"}},"required":["name","steps"],"type":"object"},"status":{"properties":{"additionalFields":{"description":"additionalFields is reserved for future use","type":"object","x-kubernetes-preserve-unknown-fields":true},"operatorStates":{"additionalProperties":{"properties":{"descriptiveState":{"description":"descriptiveState is an optional more descriptive state field which has no requirements on format","type":"string"},"details":{"description":"details contains any extra information that is operator-specific","type":"object","x-kubernetes-preserve-unknown-fields":true},"lastEvaluation":{"description":"lastEvaluation is the ResourceVersion last evaluated","type":"string"},"state":{"description":"state describes the state of the lastEvaluation.\nIt is limited to three possible states for machine evaluation.","enum":["success","in_progress","failed"],"type":"string"}},"required":["lastEvaluation","state"],"type":"object"},"description":"operatorStates is a map of operator ID to operator state evaluations.\nAny operator which consumes this kind SHOULD add its state evaluation information to this field.","type":"object"}},"type":"object","x-kubernetes-preserve-unknown-fields":true}}`)
versionSchemaCheckTypev0alpha1 app.VersionSchema
_ = json.Unmarshal(rawSchemaCheckTypev0alpha1, &versionSchemaCheckTypev0alpha1)
)
var appManifestData = app.ManifestData{
AppName: "advisor",
Group: "advisor.grafana.app",
Kinds: []app.ManifestKind{
{
Kind: "Check",
Scope: "Namespaced",
Conversion: false,
Versions: []app.ManifestKindVersion{
{
Name: "v0alpha1",
Admission: &app.AdmissionCapabilities{
Validation: &app.ValidationCapability{
Operations: []app.AdmissionOperation{
app.AdmissionOperationCreate,
app.AdmissionOperationUpdate,
},
},
},
Schema: &versionSchemaCheckv0alpha1,
},
},
},
{
Kind: "CheckType",
Scope: "Namespaced",
Conversion: false,
Versions: []app.ManifestKindVersion{
{
Name: "v0alpha1",
Schema: &versionSchemaCheckTypev0alpha1,
},
},
},
},
}
func jsonToMap(j string) map[string]any {
m := make(map[string]any)
json.Unmarshal([]byte(j), &j)
return m
}
func LocalManifest() app.Manifest {
return app.NewEmbeddedManifest(appManifestData)
}
func RemoteManifest() app.Manifest {
return app.NewAPIServerManifest("advisor")
}

116
apps/advisor/pkg/app/app.go Normal file
View File

@@ -0,0 +1,116 @@
package app
import (
"context"
"fmt"
"github.com/grafana/grafana-app-sdk/app"
"github.com/grafana/grafana-app-sdk/k8s"
"github.com/grafana/grafana-app-sdk/resource"
"github.com/grafana/grafana-app-sdk/simple"
advisorv0alpha1 "github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1"
"github.com/grafana/grafana/apps/advisor/pkg/app/checkregistry"
"github.com/grafana/grafana/apps/advisor/pkg/app/checks"
"github.com/grafana/grafana/apps/advisor/pkg/app/checkscheduler"
"github.com/grafana/grafana/apps/advisor/pkg/app/checktyperegisterer"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/klog/v2"
)
func New(cfg app.Config) (app.App, error) {
// Read config
specificConfig, ok := cfg.SpecificConfig.(checkregistry.AdvisorAppConfig)
if !ok {
return nil, fmt.Errorf("invalid config type")
}
checkRegistry := specificConfig.CheckRegistry
// Prepare storage client
clientGenerator := k8s.NewClientRegistry(cfg.KubeConfig, k8s.ClientConfig{})
client, err := clientGenerator.ClientFor(advisorv0alpha1.CheckKind())
if err != nil {
return nil, err
}
// Initialize checks
checkMap := map[string]checks.Check{}
for _, c := range checkRegistry.Checks() {
checkMap[c.ID()] = c
}
simpleConfig := simple.AppConfig{
Name: "advisor",
KubeConfig: cfg.KubeConfig,
InformerConfig: simple.AppInformerConfig{
ErrorHandler: func(ctx context.Context, err error) {
klog.ErrorS(err, "Informer processing error")
},
},
ManagedKinds: []simple.AppManagedKind{
{
Kind: advisorv0alpha1.CheckKind(),
Validator: &simple.Validator{
ValidateFunc: func(ctx context.Context, req *app.AdmissionRequest) error {
if req.Object != nil {
_, err := getCheck(req.Object, checkMap)
return err
}
return nil
},
},
Watcher: &simple.Watcher{
AddFunc: func(ctx context.Context, obj resource.Object) error {
check, err := getCheck(obj, checkMap)
if err != nil {
return err
}
return processCheck(ctx, client, obj, check)
},
},
},
{
Kind: advisorv0alpha1.CheckTypeKind(),
},
},
}
a, err := simple.NewApp(simpleConfig)
if err != nil {
return nil, err
}
err = a.ValidateManifest(cfg.ManifestData)
if err != nil {
return nil, err
}
// Save check types as resources
ctr, err := checktyperegisterer.New(cfg)
if err != nil {
return nil, err
}
a.AddRunnable(ctr)
// Start scheduler
csch, err := checkscheduler.New(cfg)
if err != nil {
return nil, err
}
a.AddRunnable(csch)
return a, nil
}
func GetKinds() map[schema.GroupVersion][]resource.Kind {
gv := schema.GroupVersion{
// Group and version are the same for all checks
Group: advisorv0alpha1.CheckKind().Group(),
Version: advisorv0alpha1.CheckKind().Version(),
}
return map[schema.GroupVersion][]resource.Kind{
gv: {
advisorv0alpha1.CheckKind(),
advisorv0alpha1.CheckTypeKind(),
},
}
}

View File

@@ -0,0 +1,31 @@
package app
import (
"context"
"github.com/grafana/grafana/pkg/apimachinery/identity"
"k8s.io/apiserver/pkg/authorization/authorizer"
)
func GetAuthorizer() authorizer.Authorizer {
return authorizer.AuthorizerFunc(func(
ctx context.Context, attr authorizer.Attributes,
) (authorized authorizer.Decision, reason string, err error) {
if !attr.IsResourceRequest() {
return authorizer.DecisionNoOpinion, "", nil
}
// require a user
u, err := identity.GetRequester(ctx)
if err != nil {
return authorizer.DecisionDeny, "valid user is required", err
}
// check if is admin
if u.GetIsGrafanaAdmin() {
return authorizer.DecisionAllow, "", nil
}
return authorizer.DecisionDeny, "forbidden", nil
})
}

View File

@@ -0,0 +1,78 @@
package app
import (
"context"
"testing"
"github.com/grafana/grafana/pkg/apimachinery/identity"
"github.com/stretchr/testify/assert"
"k8s.io/apiserver/pkg/authorization/authorizer"
)
func TestGetAuthorizer(t *testing.T) {
tests := []struct {
name string
ctx context.Context
attr authorizer.Attributes
expectedDecision authorizer.Decision
expectedReason string
expectedErr error
}{
{
name: "non-resource request",
ctx: context.TODO(),
attr: &mockAttributes{resourceRequest: false},
expectedDecision: authorizer.DecisionNoOpinion,
expectedReason: "",
expectedErr: nil,
},
{
name: "user is admin",
ctx: identity.WithRequester(context.TODO(), &mockUser{isGrafanaAdmin: true}),
attr: &mockAttributes{resourceRequest: true},
expectedDecision: authorizer.DecisionAllow,
expectedReason: "",
expectedErr: nil,
},
{
name: "user is not admin",
ctx: identity.WithRequester(context.TODO(), &mockUser{isGrafanaAdmin: false}),
attr: &mockAttributes{resourceRequest: true},
expectedDecision: authorizer.DecisionDeny,
expectedReason: "forbidden",
expectedErr: nil,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
auth := GetAuthorizer()
decision, reason, err := auth.Authorize(tt.ctx, tt.attr)
assert.Equal(t, tt.expectedDecision, decision)
assert.Equal(t, tt.expectedReason, reason)
assert.Equal(t, tt.expectedErr, err)
})
}
}
type mockAttributes struct {
authorizer.Attributes
resourceRequest bool
}
func (m *mockAttributes) IsResourceRequest() bool {
return m.resourceRequest
}
// Implement other methods of authorizer.Attributes as needed
type mockUser struct {
identity.Requester
isGrafanaAdmin bool
}
func (m *mockUser) GetIsGrafanaAdmin() bool {
return m.isGrafanaAdmin
}
// Implement other methods of identity.Requester as needed

View File

@@ -0,0 +1,65 @@
package checkregistry
import (
"github.com/grafana/grafana/apps/advisor/pkg/app/checks"
"github.com/grafana/grafana/apps/advisor/pkg/app/checks/datasourcecheck"
"github.com/grafana/grafana/apps/advisor/pkg/app/checks/plugincheck"
"github.com/grafana/grafana/pkg/plugins"
"github.com/grafana/grafana/pkg/plugins/repo"
"github.com/grafana/grafana/pkg/services/datasources"
"github.com/grafana/grafana/pkg/services/pluginsintegration/managedplugins"
"github.com/grafana/grafana/pkg/services/pluginsintegration/plugincontext"
"github.com/grafana/grafana/pkg/services/pluginsintegration/plugininstaller"
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginstore"
)
type CheckService interface {
Checks() []checks.Check
}
type Service struct {
datasourceSvc datasources.DataSourceService
pluginStore pluginstore.Store
pluginContextProvider *plugincontext.Provider
pluginClient plugins.Client
pluginRepo repo.Service
pluginPreinstall plugininstaller.Preinstall
managedPlugins managedplugins.Manager
}
func ProvideService(datasourceSvc datasources.DataSourceService, pluginStore pluginstore.Store,
pluginContextProvider *plugincontext.Provider, pluginClient plugins.Client,
pluginRepo repo.Service, pluginPreinstall plugininstaller.Preinstall, managedPlugins managedplugins.Manager) *Service {
return &Service{
datasourceSvc: datasourceSvc,
pluginStore: pluginStore,
pluginContextProvider: pluginContextProvider,
pluginClient: pluginClient,
pluginRepo: pluginRepo,
pluginPreinstall: pluginPreinstall,
managedPlugins: managedPlugins,
}
}
func (s *Service) Checks() []checks.Check {
return []checks.Check{
datasourcecheck.New(
s.datasourceSvc,
s.pluginStore,
s.pluginContextProvider,
s.pluginClient,
),
plugincheck.New(
s.pluginStore,
s.pluginRepo,
s.pluginPreinstall,
s.managedPlugins,
),
}
}
// AdvisorAppConfig is the configuration received from Grafana to run the app
type AdvisorAppConfig struct {
CheckRegistry CheckService
PluginConfig map[string]string
}

View File

@@ -0,0 +1,150 @@
package datasourcecheck
import (
"context"
"fmt"
"github.com/grafana/grafana-plugin-sdk-go/backend"
advisor "github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1"
"github.com/grafana/grafana/apps/advisor/pkg/app/checks"
"github.com/grafana/grafana/pkg/apimachinery/identity"
"github.com/grafana/grafana/pkg/plugins"
"github.com/grafana/grafana/pkg/services/datasources"
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginstore"
"github.com/grafana/grafana/pkg/util"
)
type check struct {
DatasourceSvc datasources.DataSourceService
PluginStore pluginstore.Store
PluginContextProvider pluginContextProvider
PluginClient plugins.Client
}
func New(
datasourceSvc datasources.DataSourceService,
pluginStore pluginstore.Store,
pluginContextProvider pluginContextProvider,
pluginClient plugins.Client,
) checks.Check {
return &check{
DatasourceSvc: datasourceSvc,
PluginStore: pluginStore,
PluginContextProvider: pluginContextProvider,
PluginClient: pluginClient,
}
}
func (c *check) Items(ctx context.Context) ([]any, error) {
dss, err := c.DatasourceSvc.GetAllDataSources(ctx, &datasources.GetAllDataSourcesQuery{})
if err != nil {
return nil, err
}
res := make([]any, len(dss))
for i, ds := range dss {
res[i] = ds
}
return res, nil
}
func (c *check) ID() string {
return "datasource"
}
func (c *check) Steps() []checks.Step {
return []checks.Step{
&uidValidationStep{},
&healthCheckStep{
PluginContextProvider: c.PluginContextProvider,
PluginClient: c.PluginClient,
},
}
}
type uidValidationStep struct{}
func (s *uidValidationStep) ID() string {
return "uid-validation"
}
func (s *uidValidationStep) Title() string {
return "UID validation"
}
func (s *uidValidationStep) Description() string {
return "Check if the UID of each data source is valid."
}
func (s *uidValidationStep) Run(ctx context.Context, obj *advisor.CheckSpec, i any) (*advisor.CheckReportFailure, error) {
ds, ok := i.(*datasources.DataSource)
if !ok {
return nil, fmt.Errorf("invalid item type %T", i)
}
// Data source UID validation
err := util.ValidateUID(ds.UID)
if err != nil {
return checks.NewCheckReportFailure(
advisor.CheckReportFailureSeverityLow,
fmt.Sprintf("Invalid UID '%s' for data source %s", ds.UID, ds.Name),
"Check the <a href='https://grafana.com/docs/grafana/latest/upgrade-guide/upgrade-v11.2/#grafana-data-source-uid-format-enforcement' target=_blank>documentation</a> for more information.",
s.ID(),
ds.UID,
), nil
}
return nil, nil
}
type healthCheckStep struct {
PluginContextProvider pluginContextProvider
PluginClient plugins.Client
}
func (s *healthCheckStep) Title() string {
return "Health check"
}
func (s *healthCheckStep) Description() string {
return "Check if all data sources are healthy."
}
func (s *healthCheckStep) ID() string {
return "health-check"
}
func (s *healthCheckStep) Run(ctx context.Context, obj *advisor.CheckSpec, i any) (*advisor.CheckReportFailure, error) {
ds, ok := i.(*datasources.DataSource)
if !ok {
return nil, fmt.Errorf("invalid item type %T", i)
}
// Health check execution
requester, err := identity.GetRequester(ctx)
if err != nil {
return nil, err
}
pCtx, err := s.PluginContextProvider.GetWithDataSource(ctx, ds.Type, requester, ds)
if err != nil {
return nil, fmt.Errorf("failed to get plugin context: %w", err)
}
req := &backend.CheckHealthRequest{
PluginContext: pCtx,
Headers: map[string]string{},
}
resp, err := s.PluginClient.CheckHealth(ctx, req)
if err != nil || resp.Status != backend.HealthStatusOk {
return checks.NewCheckReportFailure(
advisor.CheckReportFailureSeverityHigh,
fmt.Sprintf("Health check failed for %s", ds.Name),
fmt.Sprintf(
"Go to the <a href='/connections/datasources/edit/%s'>data source configuration</a>"+
" and address the issues reported.", ds.UID),
s.ID(),
ds.UID,
), nil
}
return nil, nil
}
type pluginContextProvider interface {
GetWithDataSource(ctx context.Context, pluginID string, user identity.Requester, ds *datasources.DataSource) (backend.PluginContext, error)
}

View File

@@ -0,0 +1,149 @@
package datasourcecheck
import (
"context"
"testing"
"github.com/grafana/grafana-plugin-sdk-go/backend"
advisor "github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1"
"github.com/grafana/grafana/pkg/apimachinery/identity"
"github.com/grafana/grafana/pkg/plugins"
"github.com/grafana/grafana/pkg/services/datasources"
"github.com/grafana/grafana/pkg/services/user"
"github.com/stretchr/testify/assert"
)
func TestCheck_Run(t *testing.T) {
t.Run("should return no failures when all datasources are healthy", func(t *testing.T) {
datasources := []*datasources.DataSource{
{UID: "valid-uid-1", Type: "prometheus", Name: "Prometheus"},
{UID: "valid-uid-2", Type: "mysql", Name: "MySQL"},
}
mockDatasourceSvc := &MockDatasourceSvc{dss: datasources}
mockPluginContextProvider := &MockPluginContextProvider{pCtx: backend.PluginContext{}}
mockPluginClient := &MockPluginClient{res: &backend.CheckHealthResult{Status: backend.HealthStatusOk}}
check := &check{
DatasourceSvc: mockDatasourceSvc,
PluginContextProvider: mockPluginContextProvider,
PluginClient: mockPluginClient,
}
ctx := identity.WithRequester(context.Background(), &user.SignedInUser{})
items, err := check.Items(ctx)
assert.NoError(t, err)
failures := []advisor.CheckReportFailure{}
for _, step := range check.Steps() {
for _, item := range items {
stepFailures, err := step.Run(ctx, &advisor.CheckSpec{}, item)
assert.NoError(t, err)
if stepFailures != nil {
failures = append(failures, *stepFailures)
}
}
}
assert.NoError(t, err)
assert.Equal(t, 2, len(items))
assert.Empty(t, failures)
})
t.Run("should return failures when datasource UID is invalid", func(t *testing.T) {
datasources := []*datasources.DataSource{
{UID: "invalid uid", Type: "prometheus", Name: "Prometheus"},
}
mockDatasourceSvc := &MockDatasourceSvc{dss: datasources}
mockPluginContextProvider := &MockPluginContextProvider{pCtx: backend.PluginContext{}}
mockPluginClient := &MockPluginClient{res: &backend.CheckHealthResult{Status: backend.HealthStatusOk}}
check := &check{
DatasourceSvc: mockDatasourceSvc,
PluginContextProvider: mockPluginContextProvider,
PluginClient: mockPluginClient,
}
ctx := identity.WithRequester(context.Background(), &user.SignedInUser{})
items, err := check.Items(ctx)
assert.NoError(t, err)
failures := []advisor.CheckReportFailure{}
for _, step := range check.Steps() {
for _, item := range items {
stepFailures, err := step.Run(ctx, &advisor.CheckSpec{}, item)
assert.NoError(t, err)
if stepFailures != nil {
failures = append(failures, *stepFailures)
}
}
}
assert.NoError(t, err)
assert.Equal(t, 1, len(items))
assert.Len(t, failures, 1)
assert.Equal(t, "Invalid UID 'invalid uid' for data source Prometheus", failures[0].Reason)
})
t.Run("should return failures when datasource health check fails", func(t *testing.T) {
datasources := []*datasources.DataSource{
{UID: "valid-uid-1", Type: "prometheus", Name: "Prometheus"},
}
mockDatasourceSvc := &MockDatasourceSvc{dss: datasources}
mockPluginContextProvider := &MockPluginContextProvider{pCtx: backend.PluginContext{}}
mockPluginClient := &MockPluginClient{res: &backend.CheckHealthResult{Status: backend.HealthStatusError}}
check := &check{
DatasourceSvc: mockDatasourceSvc,
PluginContextProvider: mockPluginContextProvider,
PluginClient: mockPluginClient,
}
ctx := identity.WithRequester(context.Background(), &user.SignedInUser{})
items, err := check.Items(ctx)
assert.NoError(t, err)
failures := []advisor.CheckReportFailure{}
for _, step := range check.Steps() {
for _, item := range items {
stepFailures, err := step.Run(ctx, &advisor.CheckSpec{}, item)
assert.NoError(t, err)
if stepFailures != nil {
failures = append(failures, *stepFailures)
}
}
}
assert.NoError(t, err)
assert.Equal(t, 1, len(items))
assert.Len(t, failures, 1)
assert.Equal(t, "Health check failed for Prometheus", failures[0].Reason)
})
}
type MockDatasourceSvc struct {
datasources.DataSourceService
dss []*datasources.DataSource
}
func (m *MockDatasourceSvc) GetAllDataSources(ctx context.Context, query *datasources.GetAllDataSourcesQuery) ([]*datasources.DataSource, error) {
return m.dss, nil
}
type MockPluginContextProvider struct {
pCtx backend.PluginContext
}
func (m *MockPluginContextProvider) GetWithDataSource(ctx context.Context, pluginID string, user identity.Requester, ds *datasources.DataSource) (backend.PluginContext, error) {
return m.pCtx, nil
}
type MockPluginClient struct {
plugins.Client
res *backend.CheckHealthResult
}
func (m *MockPluginClient) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error) {
return m.res, nil
}

View File

@@ -0,0 +1,29 @@
package checks
import (
"context"
advisorv0alpha1 "github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1"
)
// Check returns metadata about the check being executed and the list of Steps
type Check interface {
// ID returns the unique identifier of the check
ID() string
// Items returns the list of items that will be checked
Items(ctx context.Context) ([]any, error)
// Steps returns the list of steps that will be executed
Steps() []Step
}
// Step is a single step in a check, including its metadata
type Step interface {
// ID returns the unique identifier of the step
ID() string
// Title returns the title of the step
Title() string
// Description returns the description of the step
Description() string
// Run executes the step for an item and returns a report
Run(ctx context.Context, obj *advisorv0alpha1.CheckSpec, item any) (*advisorv0alpha1.CheckReportFailure, error)
}

View File

@@ -0,0 +1,184 @@
package plugincheck
import (
"context"
"fmt"
sysruntime "runtime"
"github.com/Masterminds/semver/v3"
advisor "github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1"
"github.com/grafana/grafana/apps/advisor/pkg/app/checks"
"github.com/grafana/grafana/pkg/cmd/grafana-cli/services"
"github.com/grafana/grafana/pkg/plugins/repo"
"github.com/grafana/grafana/pkg/services/pluginsintegration/managedplugins"
"github.com/grafana/grafana/pkg/services/pluginsintegration/plugininstaller"
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginstore"
)
func New(
pluginStore pluginstore.Store,
pluginRepo repo.Service,
pluginPreinstall plugininstaller.Preinstall,
managedPlugins managedplugins.Manager,
) checks.Check {
return &check{
PluginStore: pluginStore,
PluginRepo: pluginRepo,
PluginPreinstall: pluginPreinstall,
ManagedPlugins: managedPlugins,
}
}
type check struct {
PluginStore pluginstore.Store
PluginRepo repo.Service
PluginPreinstall plugininstaller.Preinstall
ManagedPlugins managedplugins.Manager
}
func (c *check) ID() string {
return "plugin"
}
func (c *check) Items(ctx context.Context) ([]any, error) {
ps := c.PluginStore.Plugins(ctx)
res := make([]any, len(ps))
for i, p := range ps {
res[i] = p
}
return res, nil
}
func (c *check) Steps() []checks.Step {
return []checks.Step{
&deprecationStep{
PluginRepo: c.PluginRepo,
},
&updateStep{
PluginRepo: c.PluginRepo,
PluginPreinstall: c.PluginPreinstall,
ManagedPlugins: c.ManagedPlugins,
},
}
}
type deprecationStep struct {
PluginRepo repo.Service
}
func (s *deprecationStep) Title() string {
return "Deprecation check"
}
func (s *deprecationStep) Description() string {
return "Check if any installed plugins are deprecated."
}
func (s *deprecationStep) ID() string {
return "deprecation"
}
func (s *deprecationStep) Run(ctx context.Context, _ *advisor.CheckSpec, it any) (*advisor.CheckReportFailure, error) {
p, ok := it.(pluginstore.Plugin)
if !ok {
return nil, fmt.Errorf("invalid item type %T", it)
}
// Skip if it's a core plugin
if p.IsCorePlugin() {
return nil, nil
}
// Check if plugin is deprecated
i, err := s.PluginRepo.PluginInfo(ctx, p.ID)
if err != nil {
// Unable to check deprecation status
return nil, nil
}
if i.Status == "deprecated" {
return checks.NewCheckReportFailure(
advisor.CheckReportFailureSeverityHigh,
fmt.Sprintf("Plugin deprecated: %s", p.ID),
"Check the <a href='https://grafana.com/legal/plugin-deprecation/#a-plugin-i-use-is-deprecated-what-should-i-do' target=_blank>documentation</a> for recommended steps.",
s.ID(),
p.ID,
), nil
}
return nil, nil
}
type updateStep struct {
PluginRepo repo.Service
PluginPreinstall plugininstaller.Preinstall
ManagedPlugins managedplugins.Manager
}
func (s *updateStep) Title() string {
return "Update check"
}
func (s *updateStep) Description() string {
return "Check if any installed plugins have a newer version available."
}
func (s *updateStep) ID() string {
return "update"
}
func (s *updateStep) Run(ctx context.Context, _ *advisor.CheckSpec, i any) (*advisor.CheckReportFailure, error) {
p, ok := i.(pluginstore.Plugin)
if !ok {
return nil, fmt.Errorf("invalid item type %T", i)
}
// Skip if it's a core plugin
if p.IsCorePlugin() {
return nil, nil
}
// Skip if it's managed or pinned
if s.isManaged(ctx, p.ID) || s.PluginPreinstall.IsPinned(p.ID) {
return nil, nil
}
// Check if plugin has a newer version available
compatOpts := repo.NewCompatOpts(services.GrafanaVersion, sysruntime.GOOS, sysruntime.GOARCH)
info, err := s.PluginRepo.GetPluginArchiveInfo(ctx, p.ID, "", compatOpts)
if err != nil {
// Unable to check updates
return nil, nil
}
if hasUpdate(p, info) {
return checks.NewCheckReportFailure(
advisor.CheckReportFailureSeverityLow,
fmt.Sprintf("New version available for %s", p.ID),
fmt.Sprintf(
"Go to the <a href='/plugins/%s?page=version-history'>plugin admin page</a>"+
" and upgrade to the latest version.", p.ID),
s.ID(),
p.ID,
), nil
}
return nil, nil
}
func hasUpdate(current pluginstore.Plugin, latest *repo.PluginArchiveInfo) bool {
// If both versions are semver-valid, compare them
v1, err1 := semver.NewVersion(current.Info.Version)
v2, err2 := semver.NewVersion(latest.Version)
if err1 == nil && err2 == nil {
return v1.LessThan(v2)
}
// In other case, assume that a different latest version will always be newer
return current.Info.Version != latest.Version
}
func (s *updateStep) isManaged(ctx context.Context, pluginID string) bool {
for _, managedPlugin := range s.ManagedPlugins.ManagedPlugins(ctx) {
if managedPlugin == pluginID {
return true
}
}
return false
}

View File

@@ -0,0 +1,198 @@
package plugincheck
import (
"context"
"testing"
advisor "github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1"
"github.com/grafana/grafana/pkg/plugins"
"github.com/grafana/grafana/pkg/plugins/repo"
"github.com/grafana/grafana/pkg/services/pluginsintegration/managedplugins"
"github.com/grafana/grafana/pkg/services/pluginsintegration/plugininstaller"
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginstore"
"github.com/stretchr/testify/assert"
)
func TestRun(t *testing.T) {
tests := []struct {
name string
plugins []pluginstore.Plugin
pluginInfo map[string]*repo.PluginInfo
pluginArchives map[string]*repo.PluginArchiveInfo
pluginPreinstalled []string
pluginManaged []string
expectedFailures []advisor.CheckReportFailure
}{
{
name: "No plugins",
plugins: []pluginstore.Plugin{},
expectedFailures: []advisor.CheckReportFailure{},
},
{
name: "Deprecated plugin",
plugins: []pluginstore.Plugin{
{JSONData: plugins.JSONData{ID: "plugin1", Info: plugins.Info{Version: "1.0.0"}}},
},
pluginInfo: map[string]*repo.PluginInfo{
"plugin1": {Status: "deprecated"},
},
pluginArchives: map[string]*repo.PluginArchiveInfo{
"plugin1": {Version: "1.0.0"},
},
expectedFailures: []advisor.CheckReportFailure{
{
Severity: advisor.CheckReportFailureSeverityHigh,
Reason: "Plugin deprecated: plugin1",
Action: "Check the <a href='https://grafana.com/legal/plugin-deprecation/#a-plugin-i-use-is-deprecated-what-should-i-do' target=_blank>documentation</a> for recommended steps.",
StepID: "deprecation",
ItemID: "plugin1",
},
},
},
{
name: "Plugin with update",
plugins: []pluginstore.Plugin{
{JSONData: plugins.JSONData{ID: "plugin2", Info: plugins.Info{Version: "1.0.0"}}},
},
pluginInfo: map[string]*repo.PluginInfo{
"plugin2": {Status: "active"},
},
pluginArchives: map[string]*repo.PluginArchiveInfo{
"plugin2": {Version: "1.1.0"},
},
expectedFailures: []advisor.CheckReportFailure{
{
Severity: advisor.CheckReportFailureSeverityLow,
Reason: "New version available for plugin2",
Action: "Go to the <a href='/plugins/plugin2?page=version-history'>plugin admin page</a> and upgrade to the latest version.",
StepID: "update",
ItemID: "plugin2",
},
},
},
{
name: "Plugin with update (non semver)",
plugins: []pluginstore.Plugin{
{JSONData: plugins.JSONData{ID: "plugin2", Info: plugins.Info{Version: "alpha"}}},
},
pluginInfo: map[string]*repo.PluginInfo{
"plugin2": {Status: "active"},
},
pluginArchives: map[string]*repo.PluginArchiveInfo{
"plugin2": {Version: "beta"},
},
expectedFailures: []advisor.CheckReportFailure{
{
Severity: advisor.CheckReportFailureSeverityLow,
Reason: "New version available for plugin2",
Action: "Go to the <a href='/plugins/plugin2?page=version-history'>plugin admin page</a> and upgrade to the latest version.",
StepID: "update",
ItemID: "plugin2",
},
},
},
{
name: "Plugin pinned",
plugins: []pluginstore.Plugin{
{JSONData: plugins.JSONData{ID: "plugin3", Info: plugins.Info{Version: "1.0.0"}}},
},
pluginInfo: map[string]*repo.PluginInfo{
"plugin3": {Status: "active"},
},
pluginArchives: map[string]*repo.PluginArchiveInfo{
"plugin3": {Version: "1.1.0"},
},
pluginPreinstalled: []string{"plugin3"},
expectedFailures: []advisor.CheckReportFailure{},
},
{
name: "Managed plugin",
plugins: []pluginstore.Plugin{
{JSONData: plugins.JSONData{ID: "plugin4", Info: plugins.Info{Version: "1.0.0"}}},
},
pluginInfo: map[string]*repo.PluginInfo{
"plugin4": {Status: "active"},
},
pluginArchives: map[string]*repo.PluginArchiveInfo{
"plugin4": {Version: "1.1.0"},
},
pluginManaged: []string{"plugin4"},
expectedFailures: []advisor.CheckReportFailure{},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
pluginStore := &mockPluginStore{plugins: tt.plugins}
pluginRepo := &mockPluginRepo{
pluginInfo: tt.pluginInfo,
pluginArchiveInfo: tt.pluginArchives,
}
pluginPreinstall := &mockPluginPreinstall{pinned: tt.pluginPreinstalled}
managedPlugins := &mockManagedPlugins{managed: tt.pluginManaged}
check := New(pluginStore, pluginRepo, pluginPreinstall, managedPlugins)
items, err := check.Items(context.Background())
assert.NoError(t, err)
failures := []advisor.CheckReportFailure{}
for _, step := range check.Steps() {
for _, item := range items {
stepFailures, err := step.Run(context.Background(), &advisor.CheckSpec{}, item)
assert.NoError(t, err)
if stepFailures != nil {
failures = append(failures, *stepFailures)
}
}
}
assert.NoError(t, err)
assert.Equal(t, len(tt.plugins), len(items))
assert.Equal(t, tt.expectedFailures, failures)
})
}
}
type mockPluginStore struct {
pluginstore.Store
plugins []pluginstore.Plugin
}
func (m *mockPluginStore) Plugins(ctx context.Context, t ...plugins.Type) []pluginstore.Plugin {
return m.plugins
}
type mockPluginRepo struct {
repo.Service
pluginInfo map[string]*repo.PluginInfo
pluginArchiveInfo map[string]*repo.PluginArchiveInfo
}
func (m *mockPluginRepo) PluginInfo(ctx context.Context, id string) (*repo.PluginInfo, error) {
return m.pluginInfo[id], nil
}
func (m *mockPluginRepo) GetPluginArchiveInfo(ctx context.Context, id, version string, opts repo.CompatOpts) (*repo.PluginArchiveInfo, error) {
return m.pluginArchiveInfo[id], nil
}
type mockPluginPreinstall struct {
plugininstaller.Preinstall
pinned []string
}
func (m *mockPluginPreinstall) IsPinned(pluginID string) bool {
for _, p := range m.pinned {
if p == pluginID {
return true
}
}
return false
}
type mockManagedPlugins struct {
managedplugins.Manager
managed []string
}
func (m *mockManagedPlugins) ManagedPlugins(ctx context.Context) []string {
return m.managed
}

View File

@@ -0,0 +1,26 @@
package checks
import (
advisor "github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1"
)
const (
TypeLabel = "advisor.grafana.app/type"
StatusAnnotation = "advisor.grafana.app/status"
)
func NewCheckReportFailure(
severity advisor.CheckReportFailureSeverity,
reason string,
action string,
stepID string,
itemID string,
) *advisor.CheckReportFailure {
return &advisor.CheckReportFailure{
Severity: severity,
Reason: reason,
Action: action,
StepID: stepID,
ItemID: itemID,
}
}

View File

@@ -0,0 +1,219 @@
package checkscheduler
import (
"context"
"fmt"
"sort"
"strconv"
"time"
"github.com/grafana/grafana-app-sdk/app"
"github.com/grafana/grafana-app-sdk/k8s"
"github.com/grafana/grafana-app-sdk/resource"
"github.com/grafana/grafana-plugin-sdk-go/backend/gtime"
advisorv0alpha1 "github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1"
"github.com/grafana/grafana/apps/advisor/pkg/app/checkregistry"
"github.com/grafana/grafana/apps/advisor/pkg/app/checks"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/klog/v2"
)
const defaultEvaluationInterval = 24 * time.Hour
const defaultMaxHistory = 10
// Runner is a "runnable" app used to be able to expose and API endpoint
// with the existing checks types. This does not need to be a CRUD resource, but it is
// the only way existing at the moment to expose the check types.
type Runner struct {
checkRegistry checkregistry.CheckService
client resource.Client
evaluationInterval time.Duration
maxHistory int
}
// NewRunner creates a new Runner.
func New(cfg app.Config) (app.Runnable, error) {
// Read config
specificConfig, ok := cfg.SpecificConfig.(checkregistry.AdvisorAppConfig)
if !ok {
return nil, fmt.Errorf("invalid config type")
}
checkRegistry := specificConfig.CheckRegistry
evalInterval, err := getEvaluationInterval(specificConfig.PluginConfig)
if err != nil {
return nil, err
}
maxHistory, err := getMaxHistory(specificConfig.PluginConfig)
if err != nil {
return nil, err
}
// Prepare storage client
clientGenerator := k8s.NewClientRegistry(cfg.KubeConfig, k8s.ClientConfig{})
client, err := clientGenerator.ClientFor(advisorv0alpha1.CheckKind())
if err != nil {
return nil, err
}
return &Runner{
checkRegistry: checkRegistry,
client: client,
evaluationInterval: evalInterval,
maxHistory: maxHistory,
}, nil
}
func (r *Runner) Run(ctx context.Context) error {
lastCreated, err := r.checkLastCreated(ctx)
if err != nil {
return err
}
// do an initial creation if necessary
if lastCreated.IsZero() {
err = r.createChecks(ctx)
if err != nil {
klog.Error("Error creating new check reports", "error", err)
} else {
lastCreated = time.Now()
}
}
nextSendInterval := time.Until(lastCreated.Add(r.evaluationInterval))
if nextSendInterval < time.Minute {
nextSendInterval = 1 * time.Minute
}
ticker := time.NewTicker(nextSendInterval)
defer ticker.Stop()
for {
select {
case <-ticker.C:
err = r.createChecks(ctx)
if err != nil {
klog.Error("Error creating new check reports", "error", err)
}
err = r.cleanupChecks(ctx)
if err != nil {
klog.Error("Error cleaning up old check reports", "error", err)
}
if nextSendInterval != r.evaluationInterval {
nextSendInterval = r.evaluationInterval
}
ticker.Reset(nextSendInterval)
case <-ctx.Done():
return ctx.Err()
}
}
}
// checkLastCreated returns the creation time of the last check created
// regardless of its ID. This assumes that the checks are created in batches
// so a batch will have a similar creation time.
func (r *Runner) checkLastCreated(ctx context.Context) (time.Time, error) {
list, err := r.client.List(ctx, metav1.NamespaceDefault, resource.ListOptions{})
if err != nil {
return time.Time{}, err
}
lastCreated := time.Time{}
for _, item := range list.GetItems() {
itemCreated := item.GetCreationTimestamp().Time
if itemCreated.After(lastCreated) {
lastCreated = itemCreated
}
}
return lastCreated, nil
}
// createChecks creates a new check for each check type in the registry.
func (r *Runner) createChecks(ctx context.Context) error {
for _, check := range r.checkRegistry.Checks() {
obj := &advisorv0alpha1.Check{
ObjectMeta: metav1.ObjectMeta{
GenerateName: "check-",
Namespace: metav1.NamespaceDefault,
Labels: map[string]string{
checks.TypeLabel: check.ID(),
},
},
Spec: advisorv0alpha1.CheckSpec{},
}
id := obj.GetStaticMetadata().Identifier()
_, err := r.client.Create(ctx, id, obj, resource.CreateOptions{})
if err != nil {
return fmt.Errorf("error creating check: %w", err)
}
}
return nil
}
// cleanupChecks deletes the olders checks if the number of checks exceeds the limit.
func (r *Runner) cleanupChecks(ctx context.Context) error {
list, err := r.client.List(ctx, metav1.NamespaceDefault, resource.ListOptions{Limit: -1})
if err != nil {
return err
}
// organize checks by type
checksByType := map[string][]resource.Object{}
for _, check := range list.GetItems() {
labels := check.GetLabels()
checkType, ok := labels[checks.TypeLabel]
if !ok {
klog.Error("Check type not found in labels", "check", check)
continue
}
checksByType[checkType] = append(checksByType[checkType], check)
}
for _, checks := range checksByType {
if len(checks) > r.maxHistory {
// Sort checks by creation time
sort.Slice(checks, func(i, j int) bool {
ti := checks[i].GetCreationTimestamp().Time
tj := checks[j].GetCreationTimestamp().Time
return ti.Before(tj)
})
// Delete the oldest checks
for i := 0; i < len(checks)-r.maxHistory; i++ {
check := checks[i]
id := check.GetStaticMetadata().Identifier()
err := r.client.Delete(ctx, id, resource.DeleteOptions{})
if err != nil {
return fmt.Errorf("error deleting check: %w", err)
}
}
}
}
return nil
}
func getEvaluationInterval(pluginConfig map[string]string) (time.Duration, error) {
evaluationInterval := defaultEvaluationInterval
configEvaluationInterval, ok := pluginConfig["evaluation_interval"]
if ok {
var err error
evaluationInterval, err = gtime.ParseDuration(configEvaluationInterval)
if err != nil {
return 0, fmt.Errorf("invalid evaluation interval: %w", err)
}
}
return evaluationInterval, nil
}
func getMaxHistory(pluginConfig map[string]string) (int, error) {
maxHistory := defaultMaxHistory
configMaxHistory, ok := pluginConfig["max_history"]
if ok {
var err error
maxHistory, err = strconv.Atoi(configMaxHistory)
if err != nil {
return 0, fmt.Errorf("invalid max history: %w", err)
}
}
return maxHistory, nil
}

View File

@@ -0,0 +1,279 @@
package checkscheduler
import (
"context"
"errors"
"fmt"
"math/rand/v2"
"testing"
"time"
"github.com/grafana/grafana-app-sdk/resource"
advisorv0alpha1 "github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1"
"github.com/grafana/grafana/apps/advisor/pkg/app/checks"
"github.com/stretchr/testify/assert"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func TestRunner_Run_ErrorOnList(t *testing.T) {
mockCheckService := &MockCheckService{}
mockClient := &MockClient{
listFunc: func(ctx context.Context, namespace string, options resource.ListOptions) (resource.ListObject, error) {
return nil, errors.New("list error")
},
createFunc: func(ctx context.Context, id resource.Identifier, obj resource.Object, opts resource.CreateOptions) (resource.Object, error) {
return &advisorv0alpha1.Check{}, nil
},
}
runner := &Runner{
checkRegistry: mockCheckService,
client: mockClient,
}
err := runner.Run(context.Background())
assert.Error(t, err)
}
func TestRunner_checkLastCreated_ErrorOnList(t *testing.T) {
mockClient := &MockClient{
listFunc: func(ctx context.Context, namespace string, options resource.ListOptions) (resource.ListObject, error) {
return nil, errors.New("list error")
},
}
runner := &Runner{
client: mockClient,
}
lastCreated, err := runner.checkLastCreated(context.Background())
assert.Error(t, err)
assert.True(t, lastCreated.IsZero())
}
func TestRunner_createChecks_ErrorOnCreate(t *testing.T) {
mockCheckService := &MockCheckService{
checks: []checks.Check{
&mockCheck{
id: "check-1",
},
},
}
mockClient := &MockClient{
createFunc: func(ctx context.Context, id resource.Identifier, obj resource.Object, opts resource.CreateOptions) (resource.Object, error) {
return nil, errors.New("create error")
},
}
runner := &Runner{
checkRegistry: mockCheckService,
client: mockClient,
}
err := runner.createChecks(context.Background())
assert.Error(t, err)
}
func TestRunner_createChecks_Success(t *testing.T) {
mockCheckService := &MockCheckService{
checks: []checks.Check{
&mockCheck{
id: "check-1",
},
},
}
mockClient := &MockClient{
createFunc: func(ctx context.Context, id resource.Identifier, obj resource.Object, opts resource.CreateOptions) (resource.Object, error) {
return &advisorv0alpha1.Check{}, nil
},
}
runner := &Runner{
checkRegistry: mockCheckService,
client: mockClient,
}
err := runner.createChecks(context.Background())
assert.NoError(t, err)
}
func TestRunner_cleanupChecks_ErrorOnList(t *testing.T) {
mockClient := &MockClient{
listFunc: func(ctx context.Context, namespace string, options resource.ListOptions) (resource.ListObject, error) {
return nil, errors.New("list error")
},
}
runner := &Runner{
client: mockClient,
}
err := runner.cleanupChecks(context.Background())
assert.Error(t, err)
}
func TestRunner_cleanupChecks_WithinMax(t *testing.T) {
mockClient := &MockClient{
listFunc: func(ctx context.Context, namespace string, options resource.ListOptions) (resource.ListObject, error) {
return &advisorv0alpha1.CheckList{
Items: []advisorv0alpha1.Check{{}, {}},
}, nil
},
deleteFunc: func(ctx context.Context, identifier resource.Identifier, options resource.DeleteOptions) error {
return fmt.Errorf("shouldn't be called")
},
}
runner := &Runner{
client: mockClient,
}
err := runner.cleanupChecks(context.Background())
assert.NoError(t, err)
}
func TestRunner_cleanupChecks_ErrorOnDelete(t *testing.T) {
mockClient := &MockClient{
listFunc: func(ctx context.Context, namespace string, options resource.ListOptions) (resource.ListObject, error) {
items := make([]advisorv0alpha1.Check, 0, defaultMaxHistory+1)
for i := 0; i < defaultMaxHistory+1; i++ {
item := advisorv0alpha1.Check{}
item.ObjectMeta.SetLabels(map[string]string{
checks.TypeLabel: "mock",
})
items = append(items, item)
}
return &advisorv0alpha1.CheckList{
Items: items,
}, nil
},
deleteFunc: func(ctx context.Context, identifier resource.Identifier, options resource.DeleteOptions) error {
return errors.New("delete error")
},
}
runner := &Runner{
client: mockClient,
maxHistory: defaultMaxHistory,
}
err := runner.cleanupChecks(context.Background())
assert.ErrorContains(t, err, "delete error")
}
func TestRunner_cleanupChecks_Success(t *testing.T) {
itemsDeleted := []string{}
items := make([]advisorv0alpha1.Check, 0, defaultMaxHistory+1)
for i := 0; i < defaultMaxHistory+1; i++ {
item := advisorv0alpha1.Check{}
item.ObjectMeta.SetName(fmt.Sprintf("check-%d", i))
item.ObjectMeta.SetLabels(map[string]string{
checks.TypeLabel: "mock",
})
item.ObjectMeta.SetCreationTimestamp(metav1.NewTime(time.Time{}.Add(time.Duration(i) * time.Hour)))
items = append(items, item)
}
// shuffle the items to ensure the oldest are deleted
rand.Shuffle(len(items), func(i, j int) { items[i], items[j] = items[j], items[i] })
mockClient := &MockClient{
listFunc: func(ctx context.Context, namespace string, options resource.ListOptions) (resource.ListObject, error) {
return &advisorv0alpha1.CheckList{
Items: items,
}, nil
},
deleteFunc: func(ctx context.Context, identifier resource.Identifier, options resource.DeleteOptions) error {
itemsDeleted = append(itemsDeleted, identifier.Name)
return nil
},
}
runner := &Runner{
client: mockClient,
maxHistory: defaultMaxHistory,
}
err := runner.cleanupChecks(context.Background())
assert.NoError(t, err)
assert.Equal(t, []string{"check-0"}, itemsDeleted)
}
func Test_getEvaluationInterval(t *testing.T) {
t.Run("default", func(t *testing.T) {
interval, err := getEvaluationInterval(map[string]string{})
assert.NoError(t, err)
assert.Equal(t, 24*time.Hour, interval)
})
t.Run("invalid", func(t *testing.T) {
interval, err := getEvaluationInterval(map[string]string{"evaluation_interval": "invalid"})
assert.Error(t, err)
assert.Zero(t, interval)
})
t.Run("custom", func(t *testing.T) {
interval, err := getEvaluationInterval(map[string]string{"evaluation_interval": "1h"})
assert.NoError(t, err)
assert.Equal(t, time.Hour, interval)
})
}
func Test_getMaxHistory(t *testing.T) {
t.Run("default", func(t *testing.T) {
history, err := getMaxHistory(map[string]string{})
assert.NoError(t, err)
assert.Equal(t, 10, history)
})
t.Run("invalid", func(t *testing.T) {
history, err := getMaxHistory(map[string]string{"max_history": "invalid"})
assert.Error(t, err)
assert.Zero(t, history)
})
t.Run("custom", func(t *testing.T) {
history, err := getMaxHistory(map[string]string{"max_history": "5"})
assert.NoError(t, err)
assert.Equal(t, 5, history)
})
}
type MockCheckService struct {
checks []checks.Check
}
func (m *MockCheckService) Checks() []checks.Check {
return m.checks
}
type MockClient struct {
resource.Client
listFunc func(ctx context.Context, namespace string, options resource.ListOptions) (resource.ListObject, error)
createFunc func(ctx context.Context, identifier resource.Identifier, obj resource.Object, options resource.CreateOptions) (resource.Object, error)
deleteFunc func(ctx context.Context, identifier resource.Identifier, options resource.DeleteOptions) error
}
func (m *MockClient) List(ctx context.Context, namespace string, options resource.ListOptions) (resource.ListObject, error) {
return m.listFunc(ctx, namespace, options)
}
func (m *MockClient) Create(ctx context.Context, identifier resource.Identifier, obj resource.Object, options resource.CreateOptions) (resource.Object, error) {
return m.createFunc(ctx, identifier, obj, options)
}
func (m *MockClient) Delete(ctx context.Context, identifier resource.Identifier, options resource.DeleteOptions) error {
return m.deleteFunc(ctx, identifier, options)
}
type mockCheck struct {
checks.Check
id string
steps []checks.Step
}
func (m *mockCheck) ID() string {
return m.id
}
func (m *mockCheck) Steps() []checks.Step {
return m.steps
}

View File

@@ -0,0 +1,83 @@
package checktyperegisterer
import (
"context"
"fmt"
"github.com/grafana/grafana-app-sdk/app"
"github.com/grafana/grafana-app-sdk/k8s"
"github.com/grafana/grafana-app-sdk/resource"
advisorv0alpha1 "github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1"
"github.com/grafana/grafana/apps/advisor/pkg/app/checkregistry"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// Runner is a "runnable" app used to be able to expose and API endpoint
// with the existing checks types. This does not need to be a CRUD resource, but it is
// the only way existing at the moment to expose the check types.
type Runner struct {
checkRegistry checkregistry.CheckService
client resource.Client
}
// NewRunner creates a new Runner.
func New(cfg app.Config) (app.Runnable, error) {
// Read config
specificConfig, ok := cfg.SpecificConfig.(checkregistry.AdvisorAppConfig)
if !ok {
return nil, fmt.Errorf("invalid config type")
}
checkRegistry := specificConfig.CheckRegistry
// Prepare storage client
clientGenerator := k8s.NewClientRegistry(cfg.KubeConfig, k8s.ClientConfig{})
client, err := clientGenerator.ClientFor(advisorv0alpha1.CheckTypeKind())
if err != nil {
return nil, err
}
return &Runner{
checkRegistry: checkRegistry,
client: client,
}, nil
}
func (r *Runner) Run(ctx context.Context) error {
for _, t := range r.checkRegistry.Checks() {
steps := t.Steps()
stepTypes := make([]advisorv0alpha1.CheckTypeStep, len(steps))
for i, s := range steps {
stepTypes[i] = advisorv0alpha1.CheckTypeStep{
Title: s.Title(),
Description: s.Description(),
StepID: s.ID(),
}
}
obj := &advisorv0alpha1.CheckType{
ObjectMeta: metav1.ObjectMeta{
Name: t.ID(),
Namespace: metav1.NamespaceDefault,
},
Spec: advisorv0alpha1.CheckTypeSpec{
Name: t.ID(),
Steps: stepTypes,
},
}
id := obj.GetStaticMetadata().Identifier()
_, err := r.client.Create(ctx, id, obj, resource.CreateOptions{})
if err != nil {
if errors.IsAlreadyExists(err) {
// Already exists, update
_, err = r.client.Update(ctx, id, obj, resource.UpdateOptions{})
if err != nil {
return err
} else {
continue
}
}
return err
}
}
return nil
}

View File

@@ -0,0 +1,169 @@
package checktyperegisterer
import (
"context"
"errors"
"testing"
"github.com/grafana/grafana-app-sdk/resource"
"github.com/grafana/grafana/apps/advisor/pkg/app/checks"
k8sErrs "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime/schema"
)
func TestCheckTypesRegisterer_Run(t *testing.T) {
tests := []struct {
name string
checks []checks.Check
createFunc func(ctx context.Context, id resource.Identifier, obj resource.Object, opts resource.CreateOptions) (resource.Object, error)
updateFunc func(ctx context.Context, id resource.Identifier, obj resource.Object, opts resource.UpdateOptions) (resource.Object, error)
expectedErr error
}{
{
name: "successful create",
checks: []checks.Check{
&mockCheck{
id: "check1",
steps: []checks.Step{
&mockStep{id: "step1", title: "Step 1", description: "Description 1"},
},
},
},
createFunc: func(ctx context.Context, id resource.Identifier, obj resource.Object, opts resource.CreateOptions) (resource.Object, error) {
return obj, nil
},
updateFunc: nil,
expectedErr: nil,
},
{
name: "create already exists, successful update",
checks: []checks.Check{
&mockCheck{
id: "check1",
steps: []checks.Step{
&mockStep{id: "step1", title: "Step 1", description: "Description 1"},
},
},
},
createFunc: func(ctx context.Context, id resource.Identifier, obj resource.Object, opts resource.CreateOptions) (resource.Object, error) {
return nil, k8sErrs.NewAlreadyExists(schema.GroupResource{}, obj.GetName())
},
updateFunc: func(ctx context.Context, id resource.Identifier, obj resource.Object, opts resource.UpdateOptions) (resource.Object, error) {
return obj, nil
},
expectedErr: nil,
},
{
name: "create error",
checks: []checks.Check{
&mockCheck{
id: "check1",
steps: []checks.Step{
&mockStep{id: "step1", title: "Step 1", description: "Description 1"},
},
},
},
createFunc: func(ctx context.Context, id resource.Identifier, obj resource.Object, opts resource.CreateOptions) (resource.Object, error) {
return nil, errors.New("create error")
},
updateFunc: nil,
expectedErr: errors.New("create error"),
},
{
name: "update error",
checks: []checks.Check{
&mockCheck{
id: "check1",
steps: []checks.Step{
&mockStep{id: "step1", title: "Step 1", description: "Description 1"},
},
},
},
createFunc: func(ctx context.Context, id resource.Identifier, obj resource.Object, opts resource.CreateOptions) (resource.Object, error) {
return nil, k8sErrs.NewAlreadyExists(schema.GroupResource{}, obj.GetName())
},
updateFunc: func(ctx context.Context, id resource.Identifier, obj resource.Object, opts resource.UpdateOptions) (resource.Object, error) {
return nil, errors.New("update error")
},
expectedErr: errors.New("update error"),
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
r := &Runner{
checkRegistry: &mockCheckRegistry{checks: tt.checks},
client: &mockClient{
createFunc: tt.createFunc,
updateFunc: tt.updateFunc,
},
}
err := r.Run(context.Background())
if err != nil {
if tt.expectedErr == nil {
t.Errorf("unexpected error: %v", err)
} else if err.Error() != tt.expectedErr.Error() {
t.Errorf("expected error: %v, got: %v", tt.expectedErr, err)
}
}
})
}
}
type mockCheckRegistry struct {
checks []checks.Check
}
func (m *mockCheckRegistry) Checks() []checks.Check {
return m.checks
}
type mockCheck struct {
checks.Check
id string
steps []checks.Step
}
func (m *mockCheck) ID() string {
return m.id
}
func (m *mockCheck) Steps() []checks.Step {
return m.steps
}
type mockStep struct {
checks.Step
id string
title string
description string
}
func (m *mockStep) ID() string {
return m.id
}
func (m *mockStep) Title() string {
return m.title
}
func (m *mockStep) Description() string {
return m.description
}
type mockClient struct {
resource.Client
createFunc func(ctx context.Context, id resource.Identifier, obj resource.Object, opts resource.CreateOptions) (resource.Object, error)
updateFunc func(ctx context.Context, id resource.Identifier, obj resource.Object, opts resource.UpdateOptions) (resource.Object, error)
}
func (m *mockClient) Create(ctx context.Context, id resource.Identifier, obj resource.Object, opts resource.CreateOptions) (resource.Object, error) {
return m.createFunc(ctx, id, obj, opts)
}
func (m *mockClient) Update(ctx context.Context, id resource.Identifier, obj resource.Object, opts resource.UpdateOptions) (resource.Object, error) {
return m.updateFunc(ctx, id, obj, opts)
}

View File

@@ -0,0 +1,143 @@
package app
import (
"context"
"errors"
"fmt"
"sync"
claims "github.com/grafana/authlib/types"
"github.com/grafana/grafana-app-sdk/resource"
advisorv0alpha1 "github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1"
"github.com/grafana/grafana/apps/advisor/pkg/app/checks"
"github.com/grafana/grafana/pkg/apimachinery/identity"
"github.com/grafana/grafana/pkg/apimachinery/utils"
"github.com/grafana/grafana/pkg/services/user"
)
func getCheck(obj resource.Object, checkMap map[string]checks.Check) (checks.Check, error) {
labels := obj.GetLabels()
objTypeLabel, ok := labels[checks.TypeLabel]
if !ok {
return nil, errors.New("missing check type as label")
}
c, ok := checkMap[objTypeLabel]
if !ok {
supportedTypes := ""
for k := range checkMap {
supportedTypes += k + ", "
}
return nil, fmt.Errorf("unknown check type %s. Supported types are: %s", objTypeLabel, supportedTypes)
}
return c, nil
}
func getStatusAnnotation(obj resource.Object) string {
return obj.GetAnnotations()[checks.StatusAnnotation]
}
func setStatusAnnotation(ctx context.Context, client resource.Client, obj resource.Object, status string) error {
annotations := obj.GetAnnotations()
annotations[checks.StatusAnnotation] = status
return client.PatchInto(ctx, obj.GetStaticMetadata().Identifier(), resource.PatchRequest{
Operations: []resource.PatchOperation{{
Operation: resource.PatchOpAdd,
Path: "/metadata/annotations",
Value: annotations,
}},
}, resource.PatchOptions{}, obj)
}
func processCheck(ctx context.Context, client resource.Client, obj resource.Object, check checks.Check) error {
status := getStatusAnnotation(obj)
if status != "" {
// Check already processed
return nil
}
c, ok := obj.(*advisorv0alpha1.Check)
if !ok {
return fmt.Errorf("invalid object type")
}
// Populate ctx with the user that created the check
meta, err := utils.MetaAccessor(obj)
if err != nil {
return err
}
createdBy := meta.GetCreatedBy()
typ, uid, err := claims.ParseTypeID(createdBy)
if err != nil {
return err
}
ctx = identity.WithRequester(ctx, &user.SignedInUser{
UserUID: uid,
FallbackType: typ,
})
// Get the items to check
items, err := check.Items(ctx)
if err != nil {
setErr := setStatusAnnotation(ctx, client, obj, "error")
if setErr != nil {
return setErr
}
return fmt.Errorf("error initializing check: %w", err)
}
// Run the steps
steps := check.Steps()
failures, err := runStepsInParallel(ctx, &c.Spec, steps, items)
if err != nil {
setErr := setStatusAnnotation(ctx, client, obj, "error")
if setErr != nil {
return setErr
}
return fmt.Errorf("error running steps: %w", err)
}
report := &advisorv0alpha1.CheckV0alpha1StatusReport{
Failures: failures,
Count: int64(len(items)),
}
err = setStatusAnnotation(ctx, client, obj, "processed")
if err != nil {
return err
}
return client.PatchInto(ctx, obj.GetStaticMetadata().Identifier(), resource.PatchRequest{
Operations: []resource.PatchOperation{{
Operation: resource.PatchOpAdd,
Path: "/status/report",
Value: *report,
}},
}, resource.PatchOptions{}, obj)
}
func runStepsInParallel(ctx context.Context, spec *advisorv0alpha1.CheckSpec, steps []checks.Step, items []any) ([]advisorv0alpha1.CheckReportFailure, error) {
reportFailures := []advisorv0alpha1.CheckReportFailure{}
var internalErr error
var wg sync.WaitGroup
var mu sync.Mutex
// Avoid too many concurrent requests
limit := make(chan struct{}, 10)
for _, step := range steps {
for _, item := range items {
wg.Add(1)
limit <- struct{}{}
go func(step checks.Step, item any) {
defer wg.Done()
defer func() { <-limit }()
stepErr, err := step.Run(ctx, spec, item)
mu.Lock()
defer mu.Unlock()
if err != nil {
internalErr = fmt.Errorf("error running step %s: %w", step.ID(), err)
return
}
if stepErr != nil {
reportFailures = append(reportFailures, *stepErr)
}
}(step, item)
}
}
wg.Wait()
return reportFailures, internalErr
}

View File

@@ -0,0 +1,196 @@
package app
import (
"context"
"errors"
"fmt"
"testing"
"github.com/grafana/grafana-app-sdk/resource"
advisorv0alpha1 "github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1"
"github.com/grafana/grafana/apps/advisor/pkg/app/checks"
"github.com/grafana/grafana/pkg/apimachinery/utils"
"github.com/stretchr/testify/assert"
)
func TestGetCheck(t *testing.T) {
obj := &advisorv0alpha1.Check{}
obj.SetLabels(map[string]string{checks.TypeLabel: "testType"})
checkMap := map[string]checks.Check{
"testType": &mockCheck{},
}
check, err := getCheck(obj, checkMap)
assert.NoError(t, err)
assert.NotNil(t, check)
}
func TestGetCheck_MissingLabel(t *testing.T) {
obj := &advisorv0alpha1.Check{}
checkMap := map[string]checks.Check{}
_, err := getCheck(obj, checkMap)
assert.Error(t, err)
assert.Equal(t, "missing check type as label", err.Error())
}
func TestGetCheck_UnknownType(t *testing.T) {
obj := &advisorv0alpha1.Check{}
obj.SetLabels(map[string]string{checks.TypeLabel: "unknownType"})
checkMap := map[string]checks.Check{
"testType": &mockCheck{},
}
_, err := getCheck(obj, checkMap)
assert.Error(t, err)
assert.Contains(t, err.Error(), "unknown check type unknownType")
}
func TestSetStatusAnnotation(t *testing.T) {
obj := &advisorv0alpha1.Check{}
obj.SetAnnotations(map[string]string{})
client := &mockClient{}
ctx := context.TODO()
err := setStatusAnnotation(ctx, client, obj, "processed")
assert.NoError(t, err)
assert.Equal(t, "processed", obj.GetAnnotations()[checks.StatusAnnotation])
}
func TestProcessCheck(t *testing.T) {
obj := &advisorv0alpha1.Check{}
obj.SetAnnotations(map[string]string{})
meta, err := utils.MetaAccessor(obj)
if err != nil {
t.Fatal(err)
}
meta.SetCreatedBy("user:1")
client := &mockClient{}
ctx := context.TODO()
check := &mockCheck{
items: []any{"item"},
}
err = processCheck(ctx, client, obj, check)
assert.NoError(t, err)
assert.Equal(t, "processed", obj.GetAnnotations()[checks.StatusAnnotation])
}
func TestProcessMultipleCheckItems(t *testing.T) {
obj := &advisorv0alpha1.Check{}
obj.SetAnnotations(map[string]string{})
meta, err := utils.MetaAccessor(obj)
if err != nil {
t.Fatal(err)
}
meta.SetCreatedBy("user:1")
client := &mockClient{}
ctx := context.TODO()
items := make([]any, 100)
for i := range items {
if i%2 == 0 {
items[i] = fmt.Sprintf("item-%d", i)
} else {
items[i] = errors.New("error")
}
}
check := &mockCheck{
items: items,
}
err = processCheck(ctx, client, obj, check)
assert.NoError(t, err)
assert.Equal(t, "processed", obj.GetAnnotations()[checks.StatusAnnotation])
r := client.lastValue.(advisorv0alpha1.CheckV0alpha1StatusReport)
assert.Equal(t, r.Count, int64(100))
assert.Len(t, r.Failures, 50)
}
func TestProcessCheck_AlreadyProcessed(t *testing.T) {
obj := &advisorv0alpha1.Check{}
obj.SetAnnotations(map[string]string{checks.StatusAnnotation: "processed"})
client := &mockClient{}
ctx := context.TODO()
check := &mockCheck{}
err := processCheck(ctx, client, obj, check)
assert.NoError(t, err)
}
func TestProcessCheck_RunError(t *testing.T) {
obj := &advisorv0alpha1.Check{}
obj.SetAnnotations(map[string]string{})
meta, err := utils.MetaAccessor(obj)
if err != nil {
t.Fatal(err)
}
meta.SetCreatedBy("user:1")
client := &mockClient{}
ctx := context.TODO()
check := &mockCheck{
items: []any{"item"},
err: errors.New("run error"),
}
err = processCheck(ctx, client, obj, check)
assert.Error(t, err)
assert.Equal(t, "error", obj.GetAnnotations()[checks.StatusAnnotation])
}
type mockClient struct {
resource.Client
lastValue any
}
func (m *mockClient) PatchInto(ctx context.Context, id resource.Identifier, req resource.PatchRequest, opts resource.PatchOptions, obj resource.Object) error {
m.lastValue = req.Operations[0].Value
return nil
}
type mockCheck struct {
err error
items []any
}
func (m *mockCheck) ID() string {
return "mock"
}
func (m *mockCheck) Items(ctx context.Context) ([]any, error) {
return m.items, nil
}
func (m *mockCheck) Steps() []checks.Step {
return []checks.Step{
&mockStep{err: m.err},
}
}
type mockStep struct {
err error
}
func (m *mockStep) Run(ctx context.Context, obj *advisorv0alpha1.CheckSpec, items any) (*advisorv0alpha1.CheckReportFailure, error) {
if m.err != nil {
return nil, m.err
}
if _, ok := items.(error); ok {
return &advisorv0alpha1.CheckReportFailure{}, nil
}
return nil, nil
}
func (m *mockStep) Title() string {
return "mock"
}
func (m *mockStep) Description() string {
return "mock"
}
func (m *mockStep) ID() string {
return "mock"
}

View File

@@ -0,0 +1,7 @@
This folder contains the automatically generated types for the frontend that are used in the app plugin.
To update the types:
1. Make any necessary changes in the `kinds` directory
2. Run `make generate`
3. Copy the `plugin` directory to the frontend app: https://github.com/grafana/grafana-advisor-app/tree/main/src/plugin

View File

@@ -1,14 +1,14 @@
module github.com/grafana/grafana/apps/alerting/notifications
go 1.23.4
go 1.23.5
replace github.com/grafana/grafana => ../../..
require (
github.com/grafana/grafana v0.0.0-00010101000000-000000000000
github.com/grafana/grafana-app-sdk v0.23.1
k8s.io/apimachinery v0.32.0
k8s.io/apiserver v0.32.0
github.com/grafana/grafana v11.4.0-00010101000000-000000000000+incompatible
github.com/grafana/grafana-app-sdk v0.31.0
k8s.io/apimachinery v0.32.1
k8s.io/apiserver v0.32.1
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f
)
@@ -36,9 +36,9 @@ require (
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20240821155123-6891eb1d35da // indirect
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20250121113133-e747350fee2d // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.1-0.20191002090509-6af20e3a5340 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jmespath-community/go-jmespath v1.1.1 // indirect
github.com/josharian/intern v1.0.0 // indirect
@@ -52,7 +52,7 @@ require (
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.20.5 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.61.0 // indirect
github.com/prometheus/common v0.62.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/spf13/cobra v1.8.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
@@ -61,35 +61,35 @@ require (
go.etcd.io/etcd/client/pkg/v3 v3.5.16 // indirect
go.etcd.io/etcd/client/v3 v3.5.16 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect
go.opentelemetry.io/otel v1.33.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.33.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.33.0 // indirect
go.opentelemetry.io/otel/metric v1.33.0 // indirect
go.opentelemetry.io/otel/sdk v1.33.0 // indirect
go.opentelemetry.io/otel/trace v1.33.0 // indirect
go.opentelemetry.io/proto/otlp v1.4.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // indirect
go.opentelemetry.io/otel v1.34.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 // indirect
go.opentelemetry.io/otel/metric v1.34.0 // indirect
go.opentelemetry.io/otel/sdk v1.34.0 // indirect
go.opentelemetry.io/otel/trace v1.34.0 // indirect
go.opentelemetry.io/proto/otlp v1.5.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.32.0 // indirect
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/oauth2 v0.25.0 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/oauth2 v0.26.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/term v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/time v0.9.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241216192217-9240e9c98484 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250102185135-69823020774d // indirect
google.golang.org/grpc v1.69.2 // indirect
google.golang.org/protobuf v1.36.1 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect
google.golang.org/grpc v1.70.0 // indirect
google.golang.org/protobuf v1.36.4 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/api v0.32.0 // indirect
k8s.io/client-go v0.32.0 // indirect
k8s.io/component-base v0.32.0 // indirect
k8s.io/api v0.32.1 // indirect
k8s.io/client-go v0.32.1 // indirect
k8s.io/component-base v0.32.1 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0 // indirect

View File

@@ -71,18 +71,18 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grafana/grafana-app-sdk v0.23.1 h1:BRpUG0bA0oVxjthkmO2thuJBo3nbjaRSSmZJHw+mA8I=
github.com/grafana/grafana-app-sdk v0.23.1/go.mod h1:KzgPnTJfMeckGmMctv6CJb8Jr/o/5rwARDyjXoeR0Fc=
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20240821155123-6891eb1d35da h1:2E3c/I3ayAy4Z1GwIPqXNZcpUccRapE1aBXA1ho4g7o=
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20240821155123-6891eb1d35da/go.mod h1:p09fvU5ujNL/Ig8HB7g4f+S0zyYbQq3x/f0jA4ujVOM=
github.com/grafana/grafana-app-sdk v0.31.0 h1:/mFCcx+YqG8cWAi9hePDJQxIdtXDClDIDRgZwHkksFk=
github.com/grafana/grafana-app-sdk v0.31.0/go.mod h1:Xw00NL7qpRLo5r3Gn48Bl1Xn2n4eUDI5pYf/wMufKWs=
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20250121113133-e747350fee2d h1:0WJ4uZ3gtbX7S5RGMarA+0TccmB7qEPhhNm34NcfBzs=
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20250121113133-e747350fee2d/go.mod h1:PNmbi49lVrv2b2I8pdu46dTs2728lKEbnVuQD8I5MnM=
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI=
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.1-0.20191002090509-6af20e3a5340 h1:uGoIog/wiQHI9GAxXO5TJbT0wWKH3O9HhOJW1F9c3fY=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.1-0.20191002090509-6af20e3a5340/go.mod h1:3bDW6wMZJB7tiONtC/1Xpicra6Wp5GgbTbQWCbI5fkc=
github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.0 h1:TmHmbvxPmaegwhDubVz0lICL0J5Ka2vwTzhoePEXsGE=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.0/go.mod h1:qztMSjm835F2bXf+5HKAPIS5qsmQDqZna/PgVt4rWtI=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 h1:VNqngBF40hVlDloBruUehVYC3ArSgIyScOAyMRqBxRg=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1/go.mod h1:RBRO7fro65R6tjKzYgLAFo0t1QEXY1Dp+i/bvpRiqiQ=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/jmespath-community/go-jmespath v1.1.1 h1:bFikPhsi/FdmlZhVgSCd2jj1e7G/rw+zyQfyg5UF+L4=
@@ -130,8 +130,8 @@ github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.61.0 h1:3gv/GThfX0cV2lpO7gkTUwZru38mxevy90Bj8YFSRQQ=
github.com/prometheus/common v0.61.0/go.mod h1:zr29OCN/2BsJRaFwG8QOBr41D6kkchKbpeNH7pAjb/s=
github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io=
github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I=
github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
@@ -178,26 +178,26 @@ go.etcd.io/etcd/server/v3 v3.5.16 h1:d0/SAdJ3vVsZvF8IFVb1k8zqMZ+heGcNfft71ul9GWE
go.etcd.io/etcd/server/v3 v3.5.16/go.mod h1:ynhyZZpdDp1Gq49jkUg5mfkDWZwXnn3eIqCqtJnrD/s=
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0 h1:PS8wXpbyaDJQ2VDHHncMe9Vct0Zn1fEjpsjrLxGJoSc=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0/go.mod h1:HDBUsEjOuRC0EzKZ1bSaRGZWUBAzo+MhAcUUORSr4D0=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 h1:yd02MEjBdJkG3uabWP9apV+OuWRIXGDuJEUJbOHmCFU=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0/go.mod h1:umTcuxiv1n/s/S6/c2AT/g2CQ7u5C59sHDNmfSwgz7Q=
go.opentelemetry.io/otel v1.33.0 h1:/FerN9bax5LoK51X/sI0SVYrjSE0/yUL7DpxW4K3FWw=
go.opentelemetry.io/otel v1.33.0/go.mod h1:SUUkR6csvUQl+yjReHu5uM3EtVV7MBm5FHKRlNx4I8I=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.33.0 h1:Vh5HayB/0HHfOQA7Ctx69E/Y/DcQSMPpKANYVMQ7fBA=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.33.0/go.mod h1:cpgtDBaqD/6ok/UG0jT15/uKjAY8mRA53diogHBg3UI=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.33.0 h1:5pojmb1U1AogINhN3SurB+zm/nIcusopeBNp42f45QM=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.33.0/go.mod h1:57gTHJSE5S1tqg+EKsLPlTWhpHMsWlVmer+LA926XiA=
go.opentelemetry.io/otel/metric v1.33.0 h1:r+JOocAyeRVXD8lZpjdQjzMadVZp2M4WmQ+5WtEnklQ=
go.opentelemetry.io/otel/metric v1.33.0/go.mod h1:L9+Fyctbp6HFTddIxClbQkjtubW6O9QS3Ann/M82u6M=
go.opentelemetry.io/otel/sdk v1.33.0 h1:iax7M131HuAm9QkZotNHEfstof92xM+N8sr3uHXc2IM=
go.opentelemetry.io/otel/sdk v1.33.0/go.mod h1:A1Q5oi7/9XaMlIWzPSxLRWOI8nG3FnzHJNbiENQuihM=
go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc=
go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8=
go.opentelemetry.io/otel/trace v1.33.0 h1:cCJuF7LRjUFso9LPnEAHJDB2pqzp+hbO8eu1qqW2d/s=
go.opentelemetry.io/otel/trace v1.33.0/go.mod h1:uIcdVUZMpTAmz0tI1z04GoVSezK37CbGV4fr1f2nBck=
go.opentelemetry.io/proto/otlp v1.4.0 h1:TA9WRvW6zMwP+Ssb6fLoUIuirti1gGbP28GcKG1jgeg=
go.opentelemetry.io/proto/otlp v1.4.0/go.mod h1:PPBWZIP98o2ElSqI35IHfu7hIhSwvc5N38Jw8pXuGFY=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0 h1:rgMkmiGfix9vFJDcDi1PK8WEQP4FLQwLDfhp5ZLpFeE=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0/go.mod h1:ijPqXp5P6IRRByFVVg9DY8P5HkxkHE5ARIa+86aXPf4=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 h1:CV7UdSGJt/Ao6Gp4CXckLxVRRsRgDHoI8XjbL3PDl8s=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0/go.mod h1:FRmFuRJfag1IZ2dPkHnEoSFVgTVPUd2qf5Vi69hLb8I=
go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY=
go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 h1:OeNbIYk/2C15ckl7glBlOBp5+WlYsOElzTNmiPW/x60=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0/go.mod h1:7Bept48yIeqxP2OZ9/AqIpYS94h2or0aB4FypJTc8ZM=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 h1:tgJ0uaNS4c98WRNUEx5U3aDlrDOI5Rs+1Vifcw4DJ8U=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0/go.mod h1:U7HYyW0zt/a9x5J1Kjs+r1f/d4ZHnYFclhYY2+YbeoE=
go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ=
go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE=
go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A=
go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU=
go.opentelemetry.io/otel/sdk/metric v1.32.0 h1:rZvFnvmvawYb0alrYkjraqJq0Z4ZUJAiyYCU9snn1CU=
go.opentelemetry.io/otel/sdk/metric v1.32.0/go.mod h1:PWeZlq0zt9YkYAp3gjKZ0eicRYvOh1Gd+X99x6GHpCQ=
go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k=
go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE=
go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4=
go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
@@ -226,8 +226,8 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.25.0 h1:CY4y7XT9v0cRI9oupztF8AgiIu99L/ksR/Xp/6jrZ70=
golang.org/x/oauth2 v0.25.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/oauth2 v0.26.0 h1:afQXWNNaeC4nvZ0Ed9XvCCzXM6UHJG7iCg0W4fPqSBE=
golang.org/x/oauth2 v0.26.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -237,8 +237,8 @@ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg=
golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -262,15 +262,15 @@ google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9Ywl
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20241021214115-324edc3d5d38 h1:Q3nlH8iSQSRUwOskjbcSMcF2jiYMNiQYZ0c2KEJLKKU=
google.golang.org/genproto v0.0.0-20241021214115-324edc3d5d38/go.mod h1:xBI+tzfqGGN2JBeSebfKXFSdBpWVQ7sLW40PTupVRm4=
google.golang.org/genproto/googleapis/api v0.0.0-20241216192217-9240e9c98484 h1:ChAdCYNQFDk5fYvFZMywKLIijG7TC2m1C2CMEu11G3o=
google.golang.org/genproto/googleapis/api v0.0.0-20241216192217-9240e9c98484/go.mod h1:KRUmxRI4JmbpAm8gcZM4Jsffi859fo5LQjILwuqj9z8=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250102185135-69823020774d h1:xJJRGY7TJcvIlpSrN3K6LAWgNFUILlO+OMAqtg9aqnw=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250102185135-69823020774d/go.mod h1:3ENsm/5D1mzDyhpzeRi1NR784I0BcofWBoSc5QqqMK4=
google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f h1:gap6+3Gk41EItBuyi4XX/bp4oqJ3UwuIMl25yGinuAA=
google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:Ic02D47M+zbarjYYUlK57y316f2MoN0gjAwI3f2S95o=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f h1:OxYkA3wjPsZyBylwymxSHa7ViiW1Sml4ToBrncvFehI=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:+2Yz8+CLJbIfL9z73EW45avw8Lmge3xVElCP9zEKi50=
google.golang.org/grpc v1.18.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU=
google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4=
google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk=
google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
google.golang.org/grpc v1.70.0 h1:pWFv03aZoHzlRKHWicjsZytKAiYCtNS0dHbXnIdq7jQ=
google.golang.org/grpc v1.70.0/go.mod h1:ofIJqVKDXx/JiXrwr2IG4/zwdH9txy3IlF40RmcJSQw=
google.golang.org/protobuf v1.36.4 h1:6A3ZDJHn/eNqc1i+IdefRzy/9PokBTPvcqMySR7NNIM=
google.golang.org/protobuf v1.36.4/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
@@ -283,16 +283,16 @@ gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYs
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
k8s.io/api v0.32.0 h1:OL9JpbvAU5ny9ga2fb24X8H6xQlVp+aJMFlgtQjR9CE=
k8s.io/api v0.32.0/go.mod h1:4LEwHZEf6Q/cG96F3dqR965sYOfmPM7rq81BLgsE0p0=
k8s.io/apimachinery v0.32.0 h1:cFSE7N3rmEEtv4ei5X6DaJPHHX0C+upp+v5lVPiEwpg=
k8s.io/apimachinery v0.32.0/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE=
k8s.io/apiserver v0.32.0 h1:VJ89ZvQZ8p1sLeiWdRJpRD6oLozNZD2+qVSLi+ft5Qs=
k8s.io/apiserver v0.32.0/go.mod h1:HFh+dM1/BE/Hm4bS4nTXHVfN6Z6tFIZPi649n83b4Ag=
k8s.io/client-go v0.32.0 h1:DimtMcnN/JIKZcrSrstiwvvZvLjG0aSxy8PxN8IChp8=
k8s.io/client-go v0.32.0/go.mod h1:boDWvdM1Drk4NJj/VddSLnx59X3OPgwrOo0vGbtq9+8=
k8s.io/component-base v0.32.0 h1:d6cWHZkCiiep41ObYQS6IcgzOUQUNpywm39KVYaUqzU=
k8s.io/component-base v0.32.0/go.mod h1:JLG2W5TUxUu5uDyKiH2R/7NnxJo1HlPoRIIbVLkK5eM=
k8s.io/api v0.32.1 h1:f562zw9cy+GvXzXf0CKlVQ7yHJVYzLfL6JAS4kOAaOc=
k8s.io/api v0.32.1/go.mod h1:/Yi/BqkuueW1BgpoePYBRdDYfjPF5sgTr5+YqDZra5k=
k8s.io/apimachinery v0.32.1 h1:683ENpaCBjma4CYqsmZyhEzrGz6cjn1MY/X2jB2hkZs=
k8s.io/apimachinery v0.32.1/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE=
k8s.io/apiserver v0.32.1 h1:oo0OozRos66WFq87Zc5tclUX2r0mymoVHRq8JmR7Aak=
k8s.io/apiserver v0.32.1/go.mod h1:UcB9tWjBY7aryeI5zAgzVJB/6k7E97bkr1RgqDz0jPw=
k8s.io/client-go v0.32.1 h1:otM0AxdhdBIaQh7l1Q0jQpmo7WOFIk5FFa4bg6YMdUU=
k8s.io/client-go v0.32.1/go.mod h1:aTTKZY7MdxUaJ/KiUs8D+GssR9zJZi77ZqtzcGXIiDg=
k8s.io/component-base v0.32.1 h1:/5IfJ0dHIKBWysGV0yKTFfacZ5yNV1sulPh3ilJjRZk=
k8s.io/component-base v0.32.1/go.mod h1:j1iMMHi/sqAHeG5z+O9BFNCF698a1u0186zkjMZQ28w=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f h1:GA7//TjRY9yWGy1poLzYYJJ4JRdzg3+O6e8I+e+8T5Y=

View File

@@ -1,3 +0,0 @@
.PHONY: generate
generate:
@grafana-app-sdk generate -g ./pkg/apis --kindgrouping=group --postprocess --crdencoding none

View File

@@ -1,2 +0,0 @@
module: "github.com/grafana/grafana/apps/investigation/kinds"
language: version: "v0.8.2"

View File

@@ -1,96 +0,0 @@
package kinds
// This is our Investigation definition, which contains metadata about the kind, and the kind's schema
investigation: {
group: "investigation"
kind: "Investigation"
pluralName: "Investigations"
scope: "Namespaced"
apiResource: {
groupOverride: "investigation.grafana.app"
}
codegen: {
frontend: false
backend: true
}
current: "v1alpha1"
versions: {
"v1alpha1": {
version: "v1alpha1"
schema: {
// spec is the schema of our resource. The spec should include all the user-ediable information for the kind.
spec: #InvestigationSpec
}
}
}
}
#InvestigationSpec: {
title: string
status: "open" | "closed"
items: [...#InvestigationItem]
}
// InvestigationItem is an item in an investigation.
#InvestigationItem: {
id: string
title: string
// type is the type of the item "timeseries", "heatmap", "log-table" (not an enum to allow for future extensions).
type: string
// url is the URL to the item.
url: string
// origin is where the item was created from.
origin: string // "explore-metrics", "explore-logs", "explore-traces" (not an enum to allow for future extensions)
// iconPath (optional) is the path to the icon for the item.
iconPath?: string
// timeRange (optional) is the time range of the item.
timeRange: #AbsoluteTimeRange
// note (optional) is a comment on the item.
note?: [...#Comment]
// queryType is the type of the query used to generate this item.
queryType: "logs" | "metrics"
// dataQuery contains the query used to generate this item.
dataQuery: #DataQueryLogs | #DataQueryMetrics
}
// DataQueryLogs is a data query for logs.
#DataQueryLogs: {
// refId is the reference ID of the query.
refId: string
// datasource is the datasource of the query.
datasource: #DatasourceRef
// expr is the expression of the query.
expr: string
// maxLines (optional) is used to limit the number of log rows returned.
maxLines?: int64
}
// DataQueryMetrics is a data query for metrics.
#DataQueryMetrics: {
refId: string
datasource: #DatasourceRef
expr: string
}
// Comment is a comment on an investigation item.
#Comment: {
authorUserID: string
bodyMarkdown: string
}
// DatasourceRef is a reference to a datasource.
#DatasourceRef: {
uid: string
type: string
apiVersion: string
name: string
}
// AbsoluteTimeRange is a time range specified by absolute timestamps.
#AbsoluteTimeRange: {
from: number
to: number
}

View File

@@ -1,32 +0,0 @@
package v1alpha1
import (
"time"
)
// InvestigationMetadata defines model for InvestigationMetadata.
type InvestigationMetadata struct {
CreatedBy string `json:"createdBy"`
CreationTimestamp time.Time `json:"creationTimestamp"`
DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty"`
Finalizers []string `json:"finalizers"`
Generation int64 `json:"generation"`
Labels map[string]string `json:"labels"`
ResourceVersion string `json:"resourceVersion"`
Uid string `json:"uid"`
UpdateTimestamp time.Time `json:"updateTimestamp"`
UpdatedBy string `json:"updatedBy"`
}
// _kubeObjectMetadata is metadata found in a kubernetes object's metadata field.
// It is not exhaustive and only includes fields which may be relevant to a kind's implementation,
// As it is also intended to be generic enough to function with any API Server.
type InvestigationKubeObjectMetadata struct {
CreationTimestamp time.Time `json:"creationTimestamp"`
DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty"`
Finalizers []string `json:"finalizers"`
Generation int64 `json:"generation"`
Labels map[string]string `json:"labels"`
ResourceVersion string `json:"resourceVersion"`
Uid string `json:"uid"`
}

View File

@@ -1,107 +0,0 @@
package v1alpha1
// Defines values for InvestigationInvestigationItemQueryType.
const (
InvestigationInvestigationItemQueryTypeLogs InvestigationInvestigationItemQueryType = "logs"
InvestigationInvestigationItemQueryTypeMetrics InvestigationInvestigationItemQueryType = "metrics"
)
// Defines values for InvestigationSpecStatus.
const (
InvestigationSpecStatusClosed InvestigationSpecStatus = "closed"
InvestigationSpecStatusOpen InvestigationSpecStatus = "open"
)
// AbsoluteTimeRange is a time range specified by absolute timestamps.
// +k8s:openapi-gen=true
type InvestigationAbsoluteTimeRange struct {
From float32 `json:"from"`
To float32 `json:"to"`
}
// Comment is a comment on an investigation item.
// +k8s:openapi-gen=true
type InvestigationComment struct {
AuthorUserID string `json:"authorUserID"`
BodyMarkdown string `json:"bodyMarkdown"`
}
// DataQueryLogs is a data query for logs.
// +k8s:openapi-gen=true
type InvestigationDataQueryLogs struct {
// DatasourceRef is a reference to a datasource.
Datasource InvestigationDatasourceRef `json:"datasource"`
// expr is the expression of the query.
Expr string `json:"expr"`
// maxLines (optional) is used to limit the number of log rows returned.
MaxLines *int64 `json:"maxLines,omitempty"`
// refId is the reference ID of the query.
RefId string `json:"refId"`
}
// DataQueryMetrics is a data query for metrics.
// +k8s:openapi-gen=true
type InvestigationDataQueryMetrics struct {
// DatasourceRef is a reference to a datasource.
Datasource InvestigationDatasourceRef `json:"datasource"`
Expr string `json:"expr"`
RefId string `json:"refId"`
}
// DatasourceRef is a reference to a datasource.
// +k8s:openapi-gen=true
type InvestigationDatasourceRef struct {
ApiVersion string `json:"apiVersion"`
Name string `json:"name"`
Type string `json:"type"`
Uid string `json:"uid"`
}
// InvestigationItem is an item in an investigation.
// +k8s:openapi-gen=true
type InvestigationInvestigationItem struct {
// dataQuery contains the query used to generate this item.
DataQuery interface{} `json:"dataQuery"`
// iconPath (optional) is the path to the icon for the item.
IconPath *string `json:"iconPath,omitempty"`
Id string `json:"id"`
// note (optional) is a comment on the item.
Note []InvestigationComment `json:"note,omitempty"`
// origin is where the item was created from.
Origin string `json:"origin"`
// queryType is the type of the query used to generate this item.
QueryType InvestigationInvestigationItemQueryType `json:"queryType"`
// AbsoluteTimeRange is a time range specified by absolute timestamps.
TimeRange InvestigationAbsoluteTimeRange `json:"timeRange"`
Title string `json:"title"`
// type is the type of the item "timeseries", "heatmap", "log-table" (not an enum to allow for future extensions).
Type string `json:"type"`
// url is the URL to the item.
Url string `json:"url"`
}
// InvestigationInvestigationItemQueryType queryType is the type of the query used to generate this item.
// +k8s:openapi-gen=true
type InvestigationInvestigationItemQueryType string
// InvestigationSpec defines model for InvestigationSpec.
// +k8s:openapi-gen=true
type InvestigationSpec struct {
Items []InvestigationInvestigationItem `json:"items"`
Status InvestigationSpecStatus `json:"status"`
Title string `json:"title"`
}
// InvestigationSpecStatus defines model for InvestigationSpec.Status.
// +k8s:openapi-gen=true
type InvestigationSpecStatus string

View File

@@ -1,70 +0,0 @@
package v1alpha1
// Defines values for InvestigationOperatorStateState.
const (
InvestigationOperatorStateStateFailed InvestigationOperatorStateState = "failed"
InvestigationOperatorStateStateInProgress InvestigationOperatorStateState = "in_progress"
InvestigationOperatorStateStateSuccess InvestigationOperatorStateState = "success"
)
// Defines values for InvestigationstatusOperatorStateState.
const (
InvestigationstatusOperatorStateStateFailed InvestigationstatusOperatorStateState = "failed"
InvestigationstatusOperatorStateStateInProgress InvestigationstatusOperatorStateState = "in_progress"
InvestigationstatusOperatorStateStateSuccess InvestigationstatusOperatorStateState = "success"
)
// InvestigationOperatorState defines model for InvestigationOperatorState.
// +k8s:openapi-gen=true
type InvestigationOperatorState struct {
// descriptiveState is an optional more descriptive state field which has no requirements on format
DescriptiveState *string `json:"descriptiveState,omitempty"`
// details contains any extra information that is operator-specific
Details map[string]interface{} `json:"details,omitempty"`
// lastEvaluation is the ResourceVersion last evaluated
LastEvaluation string `json:"lastEvaluation"`
// state describes the state of the lastEvaluation.
// It is limited to three possible states for machine evaluation.
State InvestigationOperatorStateState `json:"state"`
}
// InvestigationOperatorStateState state describes the state of the lastEvaluation.
// It is limited to three possible states for machine evaluation.
// +k8s:openapi-gen=true
type InvestigationOperatorStateState string
// InvestigationStatus defines model for InvestigationStatus.
// +k8s:openapi-gen=true
type InvestigationStatus struct {
// additionalFields is reserved for future use
AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"`
// operatorStates is a map of operator ID to operator state evaluations.
// Any operator which consumes this kind SHOULD add its state evaluation information to this field.
OperatorStates map[string]InvestigationstatusOperatorState `json:"operatorStates,omitempty"`
}
// InvestigationstatusOperatorState defines model for Investigationstatus.#OperatorState.
// +k8s:openapi-gen=true
type InvestigationstatusOperatorState struct {
// descriptiveState is an optional more descriptive state field which has no requirements on format
DescriptiveState *string `json:"descriptiveState,omitempty"`
// details contains any extra information that is operator-specific
Details map[string]interface{} `json:"details,omitempty"`
// lastEvaluation is the ResourceVersion last evaluated
LastEvaluation string `json:"lastEvaluation"`
// state describes the state of the lastEvaluation.
// It is limited to three possible states for machine evaluation.
State InvestigationstatusOperatorStateState `json:"state"`
}
// InvestigationstatusOperatorStateState state describes the state of the lastEvaluation.
// It is limited to three possible states for machine evaluation.
// +k8s:openapi-gen=true
type InvestigationstatusOperatorStateState string

View File

@@ -1,50 +0,0 @@
//
// This file is generated by grafana-app-sdk
// DO NOT EDIT
//
package apis
import (
"encoding/json"
"github.com/grafana/grafana-app-sdk/app"
)
var (
rawSchemaInvestigationv1alpha1 = []byte(`{"spec":{"description":"spec is the schema of our resource. The spec should include all the user-ediable information for the kind.","properties":{"items":{"items":{"properties":{"dataQuery":{"description":"dataQuery contains the query used to generate this item.","oneOf":[{"allOf":[{"required":["refId","datasource","expr"]},{"not":{"anyOf":[{"required":["refId","datasource","expr"]}]}}]},{"allOf":[{"required":["refId","datasource","expr"]},{"not":{"anyOf":[{"required":["refId","datasource","expr"]}]}}]}],"properties":{"datasource":{"description":"datasource is the datasource of the query.","properties":{"apiVersion":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"uid":{"type":"string"}},"required":["uid","type","apiVersion","name"],"type":"object"},"expr":{"description":"expr is the expression of the query.","type":"string"},"maxLines":{"description":"maxLines (optional) is used to limit the number of log rows returned.","format":"int64","type":"integer"},"refId":{"description":"refId is the reference ID of the query.","type":"string"}},"type":"object"},"iconPath":{"description":"iconPath (optional) is the path to the icon for the item.","type":"string"},"id":{"type":"string"},"note":{"description":"note (optional) is a comment on the item.","items":{"properties":{"authorUserID":{"type":"string"},"bodyMarkdown":{"type":"string"}},"required":["authorUserID","bodyMarkdown"],"type":"object"},"type":"array"},"origin":{"description":"origin is where the item was created from.","type":"string"},"queryType":{"description":"queryType is the type of the query used to generate this item.","enum":["logs","metrics"],"type":"string"},"timeRange":{"description":"timeRange (optional) is the time range of the item.","properties":{"from":{"type":"number"},"to":{"type":"number"}},"required":["from","to"],"type":"object"},"title":{"type":"string"},"type":{"description":"type is the type of the item \"timeseries\", \"heatmap\", \"log-table\" (not an enum to allow for future extensions).","type":"string"},"url":{"description":"url is the URL to the item.","type":"string"}},"required":["id","title","type","url","origin","timeRange","queryType","dataQuery"],"type":"object"},"type":"array"},"status":{"enum":["open","closed"],"type":"string"},"title":{"type":"string"}},"required":["title","status","items"],"type":"object"},"status":{"properties":{"additionalFields":{"description":"additionalFields is reserved for future use","type":"object","x-kubernetes-preserve-unknown-fields":true},"operatorStates":{"additionalProperties":{"properties":{"descriptiveState":{"description":"descriptiveState is an optional more descriptive state field which has no requirements on format","type":"string"},"details":{"description":"details contains any extra information that is operator-specific","type":"object","x-kubernetes-preserve-unknown-fields":true},"lastEvaluation":{"description":"lastEvaluation is the ResourceVersion last evaluated","type":"string"},"state":{"description":"state describes the state of the lastEvaluation.\nIt is limited to three possible states for machine evaluation.","enum":["success","in_progress","failed"],"type":"string"}},"required":["lastEvaluation","state"],"type":"object"},"description":"operatorStates is a map of operator ID to operator state evaluations.\nAny operator which consumes this kind SHOULD add its state evaluation information to this field.","type":"object"}},"type":"object","x-kubernetes-preserve-unknown-fields":true}}`)
versionSchemaInvestigationv1alpha1 app.VersionSchema
_ = json.Unmarshal(rawSchemaInvestigationv1alpha1, &versionSchemaInvestigationv1alpha1)
)
var appManifestData = app.ManifestData{
AppName: "investigation",
Group: "investigation.grafana.app",
Kinds: []app.ManifestKind{
{
Kind: "Investigation",
Scope: "Namespaced",
Conversion: false,
Versions: []app.ManifestKindVersion{
{
Name: "v1alpha1",
Schema: &versionSchemaInvestigationv1alpha1,
},
},
},
},
}
func jsonToMap(j string) map[string]any {
m := make(map[string]any)
json.Unmarshal([]byte(j), &j)
return m
}
func LocalManifest() app.Manifest {
return app.NewEmbeddedManifest(appManifestData)
}
func RemoteManifest() app.Manifest {
return app.NewAPIServerManifest("investigation")
}

View File

@@ -0,0 +1,3 @@
.PHONY: generate
generate:
@grafana-app-sdk generate -g ./pkg/apis --grouping=group --postprocess --defencoding=none

View File

@@ -0,0 +1,152 @@
[
{
"id": "896312ce-65b0-4b50-ade1-e7f04fa22c66",
"title": "Thursday morning investigation",
"hasCustomName": false,
"isFavorite": false,
"collectables": [
{
"origin": "Explore Logs",
"type": "timeseries",
"queries": [
{
"refId": "LABEL_BREAKDOWN_VALUES",
"queryType": "range",
"editorMode": "code",
"supportingQueryType": "grafana-lokiexplore-app",
"legendFormat": "{{detected_level}}",
"expr": "sum(count_over_time({service_name=\"web_app_1\"} | detected_level != \"\"[$__auto])) by (detected_level)"
}
],
"timeRange": {
"to": "2025-02-13T11:31:20.536Z",
"from": "2025-02-13T11:16:20.536Z",
"raw": {
"from": "now-15m",
"to": "now"
}
},
"datasource": {
"uid": "fe9k7u07b1a0wc"
},
"url": "http://localhost:3000/a/grafana-lokiexplore-app/explore/service/web_app_1/labels?patterns=%5B%5D&from=now-15m&to=now&var-ds=fe9k7u07b1a0wc&var-filters=service_name%7C%3D%7Cweb_app_1&var-fields=&var-levels=&var-metadata=&var-patterns=&var-lineFilterV2=&var-lineFilters=&urlColumns=%5B%5D&visualizationType=%22logs%22&displayedFields=%5B%5D&timezone=browser&var-all-fields=&var-labelBy=$__all",
"id": "LABEL_BREAKDOWN_VALUES_detected_level",
"title": "detected_level",
"logoPath": "public/plugins/grafana-lokiexplore-app/img/img/logo.svg",
"createdAt": "2025-02-13T11:31:23.637Z"
}
],
"createdAt": "2025-02-13T11:31:23.636Z",
"updatedAt": "2025-02-13T11:31:23.637Z",
"viewMode": {
"mode": "compact",
"showComments": true,
"showTooltips": false
}
},
{
"id": "e9cf1958-d0ed-46b7-b597-9052c7648656",
"title": "Thursday morning investigation",
"hasCustomName": false,
"isFavorite": false,
"collectables": [
{
"origin": "Explore Logs",
"type": "timeseries",
"queries": [
{
"refId": "LABEL_BREAKDOWN_VALUES",
"queryType": "range",
"editorMode": "code",
"supportingQueryType": "grafana-lokiexplore-app",
"legendFormat": "{{detected_level}}",
"expr": "sum(count_over_time({service_name=\"web_app_1\"} | detected_level != \"\"[$__auto])) by (detected_level)"
}
],
"timeRange": {
"to": "2025-02-13T11:31:20.536Z",
"from": "2025-02-13T11:16:20.536Z",
"raw": {
"from": "now-15m",
"to": "now"
}
},
"datasource": {
"uid": "fe9k7u07b1a0wc"
},
"url": "http://localhost:3000/a/grafana-lokiexplore-app/explore/service/web_app_1/labels?patterns=%5B%5D&from=now-15m&to=now&var-ds=fe9k7u07b1a0wc&var-filters=service_name%7C%3D%7Cweb_app_1&var-fields=&var-levels=&var-metadata=&var-patterns=&var-lineFilterV2=&var-lineFilters=&urlColumns=%5B%5D&visualizationType=%22logs%22&displayedFields=%5B%5D&timezone=browser&var-all-fields=&var-labelBy=$__all",
"id": "LABEL_BREAKDOWN_VALUES_detected_level",
"title": "detected_level",
"logoPath": "public/plugins/grafana-lokiexplore-app/img/img/logo.svg",
"createdAt": "2025-02-13T11:31:23.638Z"
},
{
"origin": "Explore Logs",
"type": "timeseries",
"queries": [
{
"refId": "LABEL_BREAKDOWN_VALUES",
"queryType": "range",
"editorMode": "code",
"supportingQueryType": "grafana-lokiexplore-app",
"legendFormat": "{{service_name}}",
"expr": "sum(count_over_time({service_name=\"web_app_1\",service_name != \"\"} [$__auto])) by (service_name)"
}
],
"timeRange": {
"to": "2025-02-13T11:31:20.536Z",
"from": "2025-02-13T11:16:20.536Z",
"raw": {
"from": "now-15m",
"to": "now"
}
},
"datasource": {
"uid": "fe9k7u07b1a0wc"
},
"url": "http://localhost:3000/a/grafana-lokiexplore-app/explore/service/web_app_1/labels?patterns=%5B%5D&from=now-15m&to=now&var-ds=fe9k7u07b1a0wc&var-filters=service_name%7C%3D%7Cweb_app_1&var-fields=&var-levels=&var-metadata=&var-patterns=&var-lineFilterV2=&var-lineFilters=&urlColumns=%5B%5D&visualizationType=%22logs%22&displayedFields=%5B%5D&timezone=browser&var-all-fields=&var-labelBy=$__all",
"id": "LABEL_BREAKDOWN_VALUES_service_name",
"title": "service_name",
"logoPath": "public/plugins/grafana-lokiexplore-app/img/img/logo.svg",
"createdAt": "2025-02-13T11:31:41.507Z"
},
{
"origin": "Explore Logs",
"type": "timeseries",
"queries": [
{
"refId": "LABEL_BREAKDOWN_VALUES",
"queryType": "range",
"editorMode": "code",
"supportingQueryType": "grafana-lokiexplore-app",
"legendFormat": "{{service}}",
"expr": "sum(count_over_time({service_name=\"web_app_1\",service != \"\"} [$__auto])) by (service)"
}
],
"timeRange": {
"to": "2025-02-13T11:31:20.536Z",
"from": "2025-02-13T11:16:20.536Z",
"raw": {
"from": "now-15m",
"to": "now"
}
},
"datasource": {
"uid": "fe9k7u07b1a0wc"
},
"url": "http://localhost:3000/a/grafana-lokiexplore-app/explore/service/web_app_1/labels?patterns=%5B%5D&from=now-15m&to=now&var-ds=fe9k7u07b1a0wc&var-filters=service_name%7C%3D%7Cweb_app_1&var-fields=&var-levels=&var-metadata=&var-patterns=&var-lineFilterV2=&var-lineFilters=&urlColumns=%5B%5D&visualizationType=%22logs%22&displayedFields=%5B%5D&timezone=browser&var-all-fields=&var-labelBy=$__all",
"id": "LABEL_BREAKDOWN_VALUES_service",
"title": "service",
"logoPath": "public/plugins/grafana-lokiexplore-app/img/img/logo.svg",
"createdAt": "2025-02-13T11:31:43.698Z"
}
],
"createdAt": "2025-02-13T11:31:23.637Z",
"updatedAt": "2025-02-13T11:31:43.698Z",
"viewMode": {
"mode": "compact",
"showComments": true,
"showTooltips": false
}
}
]

View File

@@ -0,0 +1,86 @@
module github.com/grafana/grafana/apps/investigations
go 1.23.4
require (
github.com/grafana/grafana-app-sdk v0.31.0
k8s.io/apimachinery v0.32.1
k8s.io/klog/v2 v2.130.1
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f
)
require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/bradfitz/gomemcache v0.0.0-20230905024940-24af94b03874 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/getkin/kin-openapi v0.129.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/grafana/grafana-app-sdk/logging v0.30.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.11 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/oasdiff/yaml v0.0.0-20241210131133-6b86fb107d80 // indirect
github.com/oasdiff/yaml3 v0.0.0-20241210130736-a94c01f36349 // indirect
github.com/perimeterx/marshmallow v1.1.5 // indirect
github.com/prometheus/client_golang v1.20.5 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.62.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/puzpuzpuz/xsync/v2 v2.5.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/otel v1.34.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.34.0 // indirect
go.opentelemetry.io/otel/metric v1.34.0 // indirect
go.opentelemetry.io/otel/sdk v1.34.0 // indirect
go.opentelemetry.io/otel/trace v1.34.0 // indirect
go.opentelemetry.io/proto/otlp v1.5.0 // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/oauth2 v0.26.0 // indirect
golang.org/x/sync v0.11.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/term v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/time v0.9.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect
google.golang.org/grpc v1.70.0 // indirect
google.golang.org/protobuf v1.36.4 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/api v0.32.1 // indirect
k8s.io/apiextensions-apiserver v0.32.1 // indirect
k8s.io/client-go v0.32.1 // indirect
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.5.0 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)

228
apps/investigations/go.sum Normal file
View File

@@ -0,0 +1,228 @@
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bradfitz/gomemcache v0.0.0-20230905024940-24af94b03874 h1:N7oVaKyGp8bttX0bfZGmcGkjz7DLQXhAn3DNd3T0ous=
github.com/bradfitz/gomemcache v0.0.0-20230905024940-24af94b03874/go.mod h1:r5xuitiExdLAJ09PR7vBVENGvp4ZuTBeWTGtxuX3K+c=
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g=
github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U=
github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=
github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
github.com/getkin/kin-openapi v0.129.0 h1:QGYTNcmyP5X0AtFQ2Dkou9DGBJsUETeLH9rFrJXZh30=
github.com/getkin/kin-openapi v0.129.0/go.mod h1:gmWI+b/J45xqpyK5wJmRRZse5wefA5H0RDMK46kLUtI=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ=
github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY=
github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ=
github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4=
github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE=
github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM=
github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=
github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad h1:a6HEuzUHeKH6hwfN/ZoQgRgVIWFJljSWa/zetS2WTvg=
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/grafana/grafana-app-sdk v0.31.0 h1:/mFCcx+YqG8cWAi9hePDJQxIdtXDClDIDRgZwHkksFk=
github.com/grafana/grafana-app-sdk v0.31.0/go.mod h1:Xw00NL7qpRLo5r3Gn48Bl1Xn2n4eUDI5pYf/wMufKWs=
github.com/grafana/grafana-app-sdk/logging v0.30.0 h1:K/P/bm7Cp7Di4tqIJ3EQz2+842JozQGRaz62r95ApME=
github.com/grafana/grafana-app-sdk/logging v0.30.0/go.mod h1:xy6ZyVXl50Z3DBDLybvBPphbykPhuVNed/VNmen9DQM=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 h1:VNqngBF40hVlDloBruUehVYC3ArSgIyScOAyMRqBxRg=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1/go.mod h1:RBRO7fro65R6tjKzYgLAFo0t1QEXY1Dp+i/bvpRiqiQ=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc=
github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/oasdiff/yaml v0.0.0-20241210131133-6b86fb107d80 h1:nZspmSkneBbtxU9TopEAE0CY+SBJLxO8LPUlw2vG4pU=
github.com/oasdiff/yaml v0.0.0-20241210131133-6b86fb107d80/go.mod h1:7tFDb+Y51LcDpn26GccuUgQXUk6t0CXZsivKjyimYX8=
github.com/oasdiff/yaml3 v0.0.0-20241210130736-a94c01f36349 h1:t05Ww3DxZutOqbMN+7OIuqDwXbhl32HiZGpLy26BAPc=
github.com/oasdiff/yaml3 v0.0.0-20241210130736-a94c01f36349/go.mod h1:y5+oSEHCPT/DGrS++Wc/479ERge0zTFxaF8PbGKcg2o=
github.com/onsi/ginkgo/v2 v2.21.0 h1:7rg/4f3rB88pb5obDgNZrNHrQ4e6WpjonchcpuBRnZM=
github.com/onsi/ginkgo/v2 v2.21.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo=
github.com/onsi/gomega v1.35.1 h1:Cwbd75ZBPxFSuZ6T+rN/WCb/gOc6YgFBXLlZLhC7Ds4=
github.com/onsi/gomega v1.35.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog=
github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s=
github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y=
github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io=
github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I=
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
github.com/puzpuzpuz/xsync/v2 v2.5.1 h1:mVGYAvzDSu52+zaGyNjC+24Xw2bQi3kTr4QJ6N9pIIU=
github.com/puzpuzpuz/xsync/v2 v2.5.1/go.mod h1:gD2H2krq/w52MfPLE+Uy64TzJDVY7lP2znR9qmR35kU=
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY=
go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 h1:OeNbIYk/2C15ckl7glBlOBp5+WlYsOElzTNmiPW/x60=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0/go.mod h1:7Bept48yIeqxP2OZ9/AqIpYS94h2or0aB4FypJTc8ZM=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 h1:tgJ0uaNS4c98WRNUEx5U3aDlrDOI5Rs+1Vifcw4DJ8U=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0/go.mod h1:U7HYyW0zt/a9x5J1Kjs+r1f/d4ZHnYFclhYY2+YbeoE=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.34.0 h1:BEj3SPM81McUZHYjRS5pEgNgnmzGJ5tRpU5krWnV8Bs=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.34.0/go.mod h1:9cKLGBDzI/F3NoHLQGm4ZrYdIHsvGt6ej6hUowxY0J4=
go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ=
go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE=
go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A=
go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU=
go.opentelemetry.io/otel/sdk/metric v1.32.0 h1:rZvFnvmvawYb0alrYkjraqJq0Z4ZUJAiyYCU9snn1CU=
go.opentelemetry.io/otel/sdk/metric v1.32.0/go.mod h1:PWeZlq0zt9YkYAp3gjKZ0eicRYvOh1Gd+X99x6GHpCQ=
go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k=
go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE=
go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4=
go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
golang.org/x/oauth2 v0.26.0 h1:afQXWNNaeC4nvZ0Ed9XvCCzXM6UHJG7iCg0W4fPqSBE=
golang.org/x/oauth2 v0.26.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg=
golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY=
golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE=
golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw=
gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f h1:gap6+3Gk41EItBuyi4XX/bp4oqJ3UwuIMl25yGinuAA=
google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:Ic02D47M+zbarjYYUlK57y316f2MoN0gjAwI3f2S95o=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f h1:OxYkA3wjPsZyBylwymxSHa7ViiW1Sml4ToBrncvFehI=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:+2Yz8+CLJbIfL9z73EW45avw8Lmge3xVElCP9zEKi50=
google.golang.org/grpc v1.70.0 h1:pWFv03aZoHzlRKHWicjsZytKAiYCtNS0dHbXnIdq7jQ=
google.golang.org/grpc v1.70.0/go.mod h1:ofIJqVKDXx/JiXrwr2IG4/zwdH9txy3IlF40RmcJSQw=
google.golang.org/protobuf v1.36.4 h1:6A3ZDJHn/eNqc1i+IdefRzy/9PokBTPvcqMySR7NNIM=
google.golang.org/protobuf v1.36.4/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4=
gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
k8s.io/api v0.32.1 h1:f562zw9cy+GvXzXf0CKlVQ7yHJVYzLfL6JAS4kOAaOc=
k8s.io/api v0.32.1/go.mod h1:/Yi/BqkuueW1BgpoePYBRdDYfjPF5sgTr5+YqDZra5k=
k8s.io/apiextensions-apiserver v0.32.1 h1:hjkALhRUeCariC8DiVmb5jj0VjIc1N0DREP32+6UXZw=
k8s.io/apiextensions-apiserver v0.32.1/go.mod h1:sxWIGuGiYov7Io1fAS2X06NjMIk5CbRHc2StSmbaQto=
k8s.io/apimachinery v0.32.1 h1:683ENpaCBjma4CYqsmZyhEzrGz6cjn1MY/X2jB2hkZs=
k8s.io/apimachinery v0.32.1/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE=
k8s.io/client-go v0.32.1 h1:otM0AxdhdBIaQh7l1Q0jQpmo7WOFIk5FFa4bg6YMdUU=
k8s.io/client-go v0.32.1/go.mod h1:aTTKZY7MdxUaJ/KiUs8D+GssR9zJZi77ZqtzcGXIiDg=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f h1:GA7//TjRY9yWGy1poLzYYJJ4JRdzg3+O6e8I+e+8T5Y=
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f/go.mod h1:R/HEjbvWI0qdfb8viZUeVZm0X6IZnxAydC7YU42CMw4=
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro=
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8=
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo=
sigs.k8s.io/structured-merge-diff/v4 v4.5.0 h1:nbCitCK2hfnhyiKo6uf2HxUPTCodY6Qaf85SbDIaMBk=
sigs.k8s.io/structured-merge-diff/v4 v4.5.0/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5/2tiu1w1AGfACIGE4=
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=

View File

@@ -0,0 +1,51 @@
package investigations
// Collectable represents an item collected during investigation
#Collectable: {
id: string
createdAt: string
title: string
origin: string
type: string
queries: [...#Query] // +listType=atomic
timeRange: #TimeRange
datasource: #DatasourceRef
url: string
logoPath?: string
note: string
noteUpdatedAt: string
}
#CollectableSummary: {
id: string
title: string
logoPath: string
origin: string
}
// Query represents a data query
#Query: {
refId: string
queryType: string
editorMode: string
supportingQueryType: string
legendFormat: string
expr: string
}
// TimeRange represents a time range with both absolute and relative values
#TimeRange: {
from: string
to: string
raw: {
from: string
to: string
}
}
// DatasourceRef is a reference to a datasource
#DatasourceRef: {
uid: string
}

View File

@@ -0,0 +1 @@
module: "github.com/grafana/grafana/apps/investigations"

View File

@@ -0,0 +1,64 @@
package investigations
// This is our Investigation definition, which contains metadata about the kind, and the kind's schema
investigation: {
kind: "Investigation"
group: "investigations.grafana.app"
apiResource: {
groupOverride: "investigations.grafana.app"
}
pluralName: "Investigations"
current: "v0alpha1"
versions: {
"v0alpha1": {
codegen: {
frontend: true
backend: true
options: {
generateObjectMeta: true
generateClient: true
k8sLike: true
package: "github.com/grafana/grafana/apps/investigations"
}
}
schema: {
// spec is the schema of our resource
spec: {
title: string
createdByProfile: #Person
hasCustomName: bool
isFavorite: bool
overviewNote: string
overviewNoteUpdatedAt: string
collectables: [...#Collectable] // +listType=atomic
viewMode: #ViewMode
}
}
}
}
}
// Type definition for investigation summaries
#InvestigationSummary: {
title: string
createdByProfile: #Person
hasCustomName: bool
isFavorite: bool
overviewNote: string
overviewNoteUpdatedAt: string
viewMode: #ViewMode
collectableSummaries: [...#CollectableSummary] // +listType=atomic
}
// Person represents a user profile with basic information
#Person: {
uid: string // Unique identifier for the user
name: string // Display name of the user
gravatarUrl: string // URL to user's Gravatar image
}
#ViewMode: {
mode: "compact" | "full"
showComments: bool
showTooltips: bool
}

View File

@@ -0,0 +1,37 @@
package investigations
investigationIndex: {
kind: "InvestigationIndex"
group: "investigations.grafana.app"
apiResource: {
groupOverride: "investigations.grafana.app"
}
pluralName: "InvestigationIndexes"
current: "v0alpha1"
versions: {
"v0alpha1": {
codegen: {
frontend: true
backend: true
options: {
generateObjectMeta: true
generateClient: true
k8sLike: true
package: "github.com/grafana/grafana/apps/investigations"
}
}
schema: {
spec: {
// Title of the index, e.g. 'Favorites' or 'My Investigations'
title: string
// The Person who owns this investigation index
owner: #Person
// Array of investigation summaries
investigationSummaries: [...#InvestigationSummary] // +listType=atomic
}
}
}
}
}

View File

@@ -0,0 +1,10 @@
package investigations
manifest: {
appName: "investigations"
groupOverride: "investigations.grafana.app"
kinds: [
investigation,
investigationIndex,
]
}

View File

@@ -0,0 +1,18 @@
package v0alpha1
import "k8s.io/apimachinery/pkg/runtime/schema"
const (
// Group is the API group used by all kinds in this package
Group = "investigations.grafana.app"
// Version is the API version used by all kinds in this package
Version = "v0alpha1"
)
var (
// GroupVersion is a schema.GroupVersion consisting of the Group and Version constants for this package
GroupVersion = schema.GroupVersion{
Group: Group,
Version: Version,
}
)

View File

@@ -2,7 +2,7 @@
// Code generated by grafana-app-sdk. DO NOT EDIT.
//
package v1alpha1
package v0alpha1
import (
"encoding/json"

View File

@@ -0,0 +1,28 @@
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
package v0alpha1
import (
time "time"
)
// metadata contains embedded CommonMetadata and can be extended with custom string fields
// TODO: use CommonMetadata instead of redefining here; currently needs to be defined here
// without external reference as using the CommonMetadata reference breaks thema codegen.
type InvestigationMetadata struct {
UpdateTimestamp time.Time `json:"updateTimestamp"`
CreatedBy string `json:"createdBy"`
Uid string `json:"uid"`
CreationTimestamp time.Time `json:"creationTimestamp"`
DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty"`
Finalizers []string `json:"finalizers"`
ResourceVersion string `json:"resourceVersion"`
Generation int64 `json:"generation"`
UpdatedBy string `json:"updatedBy"`
Labels map[string]string `json:"labels"`
}
// NewInvestigationMetadata creates a new InvestigationMetadata object.
func NewInvestigationMetadata() *InvestigationMetadata {
return &InvestigationMetadata{}
}

View File

@@ -2,7 +2,7 @@
// Code generated by grafana-app-sdk. DO NOT EDIT.
//
package v1alpha1
package v0alpha1
import (
"fmt"
@@ -16,10 +16,10 @@ import (
// +k8s:openapi-gen=true
type Investigation struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
Spec InvestigationSpec `json:"spec"`
InvestigationStatus InvestigationStatus `json:"status"`
metav1.TypeMeta `json:",inline" yaml:",inline"`
metav1.ObjectMeta `json:"metadata" yaml:"metadata"`
Spec InvestigationSpec `json:"spec" yaml:"spec"`
InvestigationStatus InvestigationStatus `json:"status" yaml:"status"`
}
func (o *Investigation) GetSpec() any {
@@ -224,9 +224,9 @@ var _ resource.Object = &Investigation{}
// +k8s:openapi-gen=true
type InvestigationList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []Investigation `json:"items"`
metav1.TypeMeta `json:",inline" yaml:",inline"`
metav1.ListMeta `json:"metadata" yaml:"metadata"`
Items []Investigation `json:"items" yaml:"items"`
}
func (o *InvestigationList) DeepCopyObject() runtime.Object {

View File

@@ -2,7 +2,7 @@
// Code generated by grafana-app-sdk. DO NOT EDIT.
//
package v1alpha1
package v0alpha1
import (
"github.com/grafana/grafana-app-sdk/resource"
@@ -10,7 +10,7 @@ import (
// schema is unexported to prevent accidental overwrites
var (
schemaInvestigation = resource.NewSimpleSchema("investigation.grafana.app", "v1alpha1", &Investigation{}, &InvestigationList{}, resource.WithKind("Investigation"),
schemaInvestigation = resource.NewSimpleSchema("investigations.grafana.app", "v0alpha1", &Investigation{}, &InvestigationList{}, resource.WithKind("Investigation"),
resource.WithPlural("investigations"), resource.WithScope(resource.NamespacedScope))
kindInvestigation = resource.Kind{
Schema: schemaInvestigation,

View File

@@ -0,0 +1,140 @@
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
package v0alpha1
// Person represents a user profile with basic information
// +k8s:openapi-gen=true
type InvestigationPerson struct {
// Unique identifier for the user
Uid string `json:"uid"`
// Display name of the user
Name string `json:"name"`
// URL to user's Gravatar image
GravatarUrl string `json:"gravatarUrl"`
}
// NewInvestigationPerson creates a new InvestigationPerson object.
func NewInvestigationPerson() *InvestigationPerson {
return &InvestigationPerson{}
}
// Collectable represents an item collected during investigation
// +k8s:openapi-gen=true
type InvestigationCollectable struct {
Id string `json:"id"`
CreatedAt string `json:"createdAt"`
Title string `json:"title"`
Origin string `json:"origin"`
Type string `json:"type"`
// +listType=atomic
Queries []InvestigationQuery `json:"queries"`
TimeRange InvestigationTimeRange `json:"timeRange"`
Datasource InvestigationDatasourceRef `json:"datasource"`
Url string `json:"url"`
LogoPath *string `json:"logoPath,omitempty"`
Note string `json:"note"`
NoteUpdatedAt string `json:"noteUpdatedAt"`
}
// NewInvestigationCollectable creates a new InvestigationCollectable object.
func NewInvestigationCollectable() *InvestigationCollectable {
return &InvestigationCollectable{
TimeRange: *NewInvestigationTimeRange(),
Datasource: *NewInvestigationDatasourceRef(),
}
}
// Query represents a data query
// +k8s:openapi-gen=true
type InvestigationQuery struct {
RefId string `json:"refId"`
QueryType string `json:"queryType"`
EditorMode string `json:"editorMode"`
SupportingQueryType string `json:"supportingQueryType"`
LegendFormat string `json:"legendFormat"`
Expr string `json:"expr"`
}
// NewInvestigationQuery creates a new InvestigationQuery object.
func NewInvestigationQuery() *InvestigationQuery {
return &InvestigationQuery{}
}
// TimeRange represents a time range with both absolute and relative values
// +k8s:openapi-gen=true
type InvestigationTimeRange struct {
From string `json:"from"`
To string `json:"to"`
Raw InvestigationV0alpha1TimeRangeRaw `json:"raw"`
}
// NewInvestigationTimeRange creates a new InvestigationTimeRange object.
func NewInvestigationTimeRange() *InvestigationTimeRange {
return &InvestigationTimeRange{
Raw: *NewInvestigationV0alpha1TimeRangeRaw(),
}
}
// DatasourceRef is a reference to a datasource
// +k8s:openapi-gen=true
type InvestigationDatasourceRef struct {
Uid string `json:"uid"`
}
// NewInvestigationDatasourceRef creates a new InvestigationDatasourceRef object.
func NewInvestigationDatasourceRef() *InvestigationDatasourceRef {
return &InvestigationDatasourceRef{}
}
// +k8s:openapi-gen=true
type InvestigationViewMode struct {
Mode InvestigationViewModeMode `json:"mode"`
ShowComments bool `json:"showComments"`
ShowTooltips bool `json:"showTooltips"`
}
// NewInvestigationViewMode creates a new InvestigationViewMode object.
func NewInvestigationViewMode() *InvestigationViewMode {
return &InvestigationViewMode{}
}
// spec is the schema of our resource
// +k8s:openapi-gen=true
type InvestigationSpec struct {
Title string `json:"title"`
CreatedByProfile InvestigationPerson `json:"createdByProfile"`
HasCustomName bool `json:"hasCustomName"`
IsFavorite bool `json:"isFavorite"`
OverviewNote string `json:"overviewNote"`
OverviewNoteUpdatedAt string `json:"overviewNoteUpdatedAt"`
// +listType=atomic
Collectables []InvestigationCollectable `json:"collectables"`
ViewMode InvestigationViewMode `json:"viewMode"`
}
// NewInvestigationSpec creates a new InvestigationSpec object.
func NewInvestigationSpec() *InvestigationSpec {
return &InvestigationSpec{
CreatedByProfile: *NewInvestigationPerson(),
ViewMode: *NewInvestigationViewMode(),
}
}
// +k8s:openapi-gen=true
type InvestigationV0alpha1TimeRangeRaw struct {
From string `json:"from"`
To string `json:"to"`
}
// NewInvestigationV0alpha1TimeRangeRaw creates a new InvestigationV0alpha1TimeRangeRaw object.
func NewInvestigationV0alpha1TimeRangeRaw() *InvestigationV0alpha1TimeRangeRaw {
return &InvestigationV0alpha1TimeRangeRaw{}
}
// +k8s:openapi-gen=true
type InvestigationViewModeMode string
const (
InvestigationViewModeModeCompact InvestigationViewModeMode = "compact"
InvestigationViewModeModeFull InvestigationViewModeMode = "full"
)

Some files were not shown because too many files have changed in this diff Show More