* extra data source read methods
* update tests
* more tests
* fix more tests; actually initialize retriever instead of sending nil
* moving GetAllDataSources isn't strictly required, so keep to minimal changes
* better name for retriever logger
Co-authored-by: Dafydd <72009875+dafydd-t@users.noreply.github.com>
* add compile-time check for DS retriever impl
---------
Co-authored-by: Dafydd <72009875+dafydd-t@users.noreply.github.com>
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
* Alerting: Display change message next to the rule version when exists
* Alerting: Update version history tests for message field
Updates test mocks and assertions to include message fields in version
history data. Adds three message examples to the mock handler and updates
test expectations to verify the Notes column displays correctly when
messages are present or absent.
---------
Co-authored-by: Konrad Lalik <konradlalik@gmail.com>
* feat(pyroscope): Exemplar support for series queries
use enum flag, add exemplar flag to explore
disable exemplars on explore as well
tests
feature toggle
fixing tests
* resolve conflicts
* lint
* Split best practices section
* Write Examples and Guides docs
* Move recording rule recommendations
* docs(alerting): new best practices guide
* fix vale errors
* Detail meaning of alert `escalation`
* Include the recovery threshold option
* Include lower severity channels for infrastructure alerts
* Remove timing options
* minor intro edits
* Rename heading to avoid gerunds
* Sparkline: Restore to a function component
* fix whitespace lint issue
* swap from clipPath to mask to help Safari
* Gauge: Fix SVG issues in Safari
* more steps in the right direction
* don't set filters which don't exist
* fix a couple other text and baseline stuff
* fix tests after changes
* clean up effects as follow-up to other PR
* fix issue with threshold bars, and also simplify non-gradient case
* Alerting: Update RuleGroupConfig definitions with missing fields
This update adds previously missing fields to the `RuleGroupConfig` structs to
ensure compatibility with external Prometheus-like rulers.
Includes:
- `labels`: per https://github.com/prometheus/prometheus/pull/11474
- `remote_write`: per https://github
.com/grafana/mimir/blob/56f33fed6254fee5a53bde1eab36c604863e3d5f/pkg/mimirtool/rules/rwrulefmt/rulefmt.go#L16
Note: This does not add full support in Grafana; it only allows these fields to
pass through the alerting proxy without causing unmarshal errors when using
external rulers.
* Update OpenAPI spec
* Secrets: changes to allow a 3rd party keeper / secret references
* fix test
* make gofmt
* lint
* fix tests
* assign aws secrets manager to @grafana/grafana-operator-experience-squad
* rename Keeper.Reference to Keeper.RetrieveReference
* rename ModelSecretsManager to ModelAWSSecretsManager
* validator: ensure that only one of keeper.Spec.Aws.AccessKey or keeper.Spec.Aws.AssumeRole are set
* move secrets manager dep / go mod tidy
* move secrets manager dep
* keeper validator: move 3rd party secret stores validation to their own functions
* add github.com/aws/aws-sdk-go-v2/service/secretsmanager pkg/extensions/enterprise_imports
* make update-workspace
* undo go.mod changes in /apps
* make update-workspace
* fix test
* add github.com/aws/aws-sdk-go-v2/service/secretsmanager to enterprise_imports
* make update-workspace
* gcworker: handle refs
* make update-workspace
* create toggle: FeatureStageExperimental
* allow features.IsEnabled for now
* format
* Plugins: Implement bug fix for loki label selectors w/ variable interpolation
* Chore: Add test to ensure result is interpolated
---------
Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
* dashboard library check added
* community dashboard section tests in progress
* tests added
* translations added
* pagination removed
* total pages removed
* test updated. pagination removed
* filters applied
* tracking event removed to be created in another pr
* slug added so url is correclty generated
* ui fix
* improvements after review
* improvements after review
* more tests added. new logic created
* fix
* changes applied
* tests removed. pattern updated
* preset of 6 elements applied
* Improve code comments and adjust variable name based on PR feedback
* Fix unit test and add extra case for regex pattern
* Fix interaction event, we were missing contentKind on BasicProvisioned flow and datasources types were not being send
---------
Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
Co-authored-by: alexandra vargas <alexa1866@gmail.com>
* Transformers: Add smoothing transformer
Added a smoothing transformer to help clean up noisy time series data.
It uses the ASAP algorithm to pick the most important data points while
keeping the overall shape and trends intact.
The transformer always keeps the first and last points so you get the
complete time range. I also added a test for it.
* Change category
Change category from Reformat to CalculateNewFields
* Remove first/last point preservation
* Fix operator recreation
* Simplify ASAP code
Include performance optimization as well
* Refactor interpolateFromSmoothedCurve
Break function into smaller focused functions and lift functions to the
top level
* Add isApplicable Check
Make sure the transformer is applicable for timeseries data
* Add tests for isApplicable check
* UI/UX improvements: Display effective resolution when limited by data points
Show "Effective: X" indicator when resolution is capped by the 2x data
points multiplier. Includes tooltip explaining the limit.
Memoizes calculation to prevent unnecessary recalculation on re-renders.
Example: With 72 data points and resolution set to 150, displays
"Effective: 144" since the limit is 72 x 2 = 144.
Plus added tests
* Improve discoverability by adding tags
* Preserve Original Data
Let's preserve original data as well, makes the UX so much better.
Changed from appending (smoothed) to frame names to use Smoothed frame name. This should match the pattern used by other transformers (e.g,. regression)
Updated tests accordingly
Updated tooltip note
* Add asap tests
Basic functionality:
* returns valid DataPoint objects
* Maintain x-axis ordering
Edge cases:
* Empty array
* single data point
* filter NaN values
* all NaN values
* sort unsorted data
* negative values
* Update dark and light images
* Clear state cache
* Add feature toggle
* Conditionally add new transformation to the registry
* chore: update and regenerate feature toggles
* chore: update yarn.lock
* chore: fix transformers and imports
* add support for skip TLS verify
* extract constructor for ExternalAMcfg and tests
* extract constructor for AlertmanagerConfig and tests
* add support for client cert auth
* chore(gdev-dashboard): minimal repro of escalation #19939 bug report
* fix(canvas): add branching logic to handle field mapping to icons case
* test(canvas): validate integration of canvas icon mappings
* refactor(resource-dimension): defensive against JS `undefined` in paths
* set panel level ds when converting from v2 to v1
* remove comment
* lint
* always set ds in sqr
* improve
* Apply suggestions from code review
Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>
---------
Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>
* Prometheus Dashboards: Use __rate_interval #110370 fix(prometheus): use in stats dashboard
* Added required changes to F:\grafana\public\app\plugins\datasource\prometheus\dashboards\prometheus_2_stats.json file
* removed empty line
* removed all steps
* OpenTSDB: Migrate metadata queries to data source backend
* OpenTSDB: Migrate annotations to the data source backend
* return errors for failed unmarshal
* remove trailing / from metadata requests
* remove console logs
* feat: add lock structure into bleve index files
* fix: another approach
* fix: new check
* fix: build in memory if index file already open
* fix: update workspace
* fix: add test
* refactor: update func signature
* fix: address comments
* fix: make const
* Suggestions: Add intermediate state to avoid unexpected saved states
* cleanup
* update and add e2es to confirm behavior
* fix some of the change dispatch
* codeowners
* fix js error that this exposed
* Apply suggestion from @fastfrwrd
* fix warning for VizRepeater styles
* Gauge: Update test dashboard to round two of the segment panels to whole numbers
* Gauge: E2E tests
* add test for sparklines
* Gauge: Change inner glow to be friendlier to our a11y tests
* remove unused CODEOWNER declaration
* expose text mode so that old displayName usage is somewhat preserved
* update migrations to use the value_and_text mode if displayName has a non-empty value
* more test cases
* update unit tests for fixture updates
* The builder query no longer runs if code mode query is empty. Remove checks for query being empty to run raw query.
* missed save
* prettier?
* Update public/app/plugins/datasource/elasticsearch/components/QueryEditor/BucketAggregationsEditor/state/reducer.ts
Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
---------
Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
* Clear selection on entering edit mode. Added test to verify selection is cleared when editing a panel.
* Update comment
---------
Co-authored-by: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com>
* Add helper function to format numeric values in alert rule history
* Use formatting function in LogRecordViewer
* Refactor numerical formatting logic
* Handle edge cases when counting decimal places
* Cleanup tests and numberFormatter code
* V2: Panel datasource is defined only for mixed ds
* if getDatasourceFromQueryRunner only returns ds.type, resolve to full ds ref throgh ds service
---------
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
* Dashboard: Add test case for BOM characters in link URLs
This test demonstrates the issue where BOM (Byte Order Mark) characters
in dashboard link URLs cause CUE validation errors during v1 to v2
conversion ('illegal byte order mark').
The test input contains BOMs in various URL locations:
- Dashboard links
- Panel data links
- Field config override links
- Options dataLinks
- Field config default links
* Dashboard: Strip BOM characters from URLs during v1 to v2 conversion
BOM (Byte Order Mark) characters in dashboard link URLs cause CUE
validation errors ('illegal byte order mark') when opening v2 dashboards.
This fix strips BOMs from all URL fields during conversion:
- Dashboard links
- Panel data links
- Field config override links
- Options dataLinks
- Field config default links
The stripBOM helper recursively processes nested structures to ensure
all string values have BOMs removed.
* Dashboard: Strip BOM characters in frontend v2 conversion
Add stripBOMs parameter to sortedDeepCloneWithoutNulls utility to remove
Byte Order Mark (U+FEFF) characters from all strings when serializing
dashboards to v2 format.
This prevents CUE validation errors ('illegal byte order mark') that occur
when BOMs are present in any string field. BOMs can be introduced through
copy/paste from certain editors or text sources.
Applied at the final serialization step so it catches BOMs from:
- Existing v1 dashboards being converted
- New data entered during dashboard editing
* add function to convert StateTransition to LokiEntry
* add QueryResultBuilder
* update backtesting to produce result similar to historian
* make shouldRecord public
* filter out noop transitions
* add experimental front-end
* add new fields
* move conversion of api model to AlertRule to validation
* add extra labels
* calculate tick timestamp using the same logic as in scheduler
* implement correct logic of calculating first evaluation timestamp
* add uid, group and folder uid they are needed for jitter strategy
* add JitterOffsetInDuration and JitterStrategy.String()
* add config `backtesting_max_evaluations` to [unified_alerting] (not documented for now)
* remove obsolete tests
* elevate permisisons for backtesting endpoint
* move backtesting to separate dir
What is this feature?
Add a config option to set data source to imported rules when X-Grafana-Alerting-Datasource-UID is not present.
Why do we need this feature?
Currently mimirtool requires passing --extra-headers 'X-Grafana-Alerting-Datasource-UID: {uid}' when used with Grafana. This config option allows to specify a default, which is used when the header is missing, making it easier to use and more similar to the case when it's used with Mimir.
* Gauge: Fit-and-finish tweaks to glows, text position, and sparkline size
* adjust text height and positions a little more
* cohesive no data handling
* more tweaks
* fix migration test
* Fix JSON formatting by adding missing newline
* remove new line
* Gauge: Add guide dots for rounded bars to help with accuracy
* 30% width
* remove spotlight, starting to make gradients a bit more predictable
* fix segmented
* update rotation of gauge color
* update i18n and migration tests
* fix spacing
* more fixture updates
* wip: using clip-path and CSS for drawing the gauge
* wip: overhaul color in gauge
* wip: progress on everything
* refactoring defs into utils
* its all working
* fixme comment
* fix backend migration tests
* remove any other mentions of spotlights
* one more tweak
* update gdev
* add lots of tests and reorganize the code a bit
* fix dev dashboard fixture
* more cleanup, optimization
* fix a couple of bugs
* fix bad import
* disable storybook test due to false positive
* a more sweeping disable of the color-contrast
* update backend tests
* update gradient for fixed color
* test all dark/light theme variants
* set opacity to 0.5 for dots
* move min degrees for start dot render to a const
* change endpoint marks to be configurable
* update gdev and fixtures
* i18n
* shore up testing a bit
* remove period for consistency
* hide glow at small angles
* more testing and cleanup
* addressing PR comments
* Update packages/grafana-ui/src/components/RadialGauge/colors.ts
Co-authored-by: Jesse David Peterson <jesdavpet@users.noreply.github.com>
* Update packages/grafana-ui/src/components/RadialGauge/colors.ts
Co-authored-by: Jesse David Peterson <jesdavpet@users.noreply.github.com>
* break out binary search stuff and write tests
* fix lint issues
---------
Co-authored-by: Jesse David Peterson <jesdavpet@users.noreply.github.com>
* error handling
* retry fetching suggestions
* add translation
* useAsyncRetry
* hasError test
* update error handling
* clean up the text panel stuff for the current version
* cleanup for loop
* some more tests for some failure cases
* fix lint issue
---------
Co-authored-by: Paul Marbach <paul.marbach@grafana.com>
* fix(legend-table): remove arbitrary 600px max width for full width cells
* test(legend-table): backfill test coverage for viz legend table
* test(legend-table): backfill test coverage for viz legend table item
* refactor(legend-table): use derived theme spacing, not hard-coded values
* update selected suggestion style
* update highlight styles for light theme, add inert to div
* remove commented-out original idea
---------
Co-authored-by: Paul Marbach <paul.marbach@grafana.com>
* Provisioning: Enable save for json model changes
* Do not pass props
* Simplify logic and fix warnings
* add tests
* Show diff for json changes
* Add try/catch
* Alerting: Add saved searches feature for alert rules page
Add ability to save, rename, delete, and apply search queries on the
Alert Rules page. Includes auto-apply default search on navigation
and UserStorage persistence.
Behind feature toggle `alertingSavedSearches` (disabled by default).
* Alerting: Add i18n translations for saved searches
* Alerting: Remove unused imports in saved searches
* Alerting: Add CODEOWNERS for e2e-playwright/alerting-suite
* Alerting: Add useSavedSearches mock to RulesFilter.v2 tests
* Alerting: Fix failing unit tests for saved searches
- Fix Jest mock hoisting issue in useSavedSearches.test.ts by configuring
UserStorage mock implementation after imports instead of inline
- Update SavedSearches.test.tsx to use findBy* queries for async popup content
- Fix tests to click apply button instead of text for applying searches
- Update maxLength test to verify attribute instead of trying to exceed it
* Alerting: Fix saved searches test mocking and assertions
- Fix UserStorage mock in useSavedSearches.test.ts by creating mock with
default Promise-returning functions inside jest.mock() factory, then
accessing the instance via getMockUserStorageInstance() helper
- Fix SavedSearches.test.tsx apply button tests to use correct accessible
name "Apply this search" (from tooltip) instead of dynamic aria-label
- Fix disabled button assertion to check native disabled attribute instead
of relying on aria-disabled which is set inconsistently by Button component
- Use findAllByRole for async popup content queries
* Alerting: Fix test query for disabled save button
Use findByText + closest instead of findByRole to find the disabled
"Save current search" button. The Grafana Button component renders
with conflicting accessibility attributes (disabled="" + aria-disabled="false")
which breaks role-based queries in React Testing Library.
* fix(alerting): preserve UserStorage mock reference before clearAllMocks
* fix(alerting): add missing test mocks for crypto and console
- Mock crypto.randomUUID for Node.js test environment
- Add console.error spy to tests expecting storage/parse errors
- Add console.warn spy to test expecting validation warnings
Fixes jest-fail-on-console failures and crypto.randomUUID TypeError.
* fix(alerting): add console.error spy to save failure test
* fix(alerting): address PR review feedback for saved searches
- Register alertingSavedSearches feature toggle in backend
- Extract shared types to SavedSearches.types.ts to fix circular dependencies
- Extract sub-components: InlineSaveInput, InlineRenameInput, SavedSearchItem
- Remove unused imports (IconButton, Input) and styles from SavedSearches.tsx
- Add try/catch for auto-apply default search error handling
- Remove maxLength validation and corresponding test
* fix(alerting): fix validation error display in saved searches
- Fix useEffect dependency array that was immediately clearing validation errors
- Remove error from deps so errors only clear when user types, not when set
- Run i18n-extract to remove unused error-name-too-long translation key
* fix(alerting): address PR review feedback for saved searches
- Replace toHaveBeenCalled assertions with UI verification using AppNotificationList
- Rename useSavedSearches.test.ts to .tsx for JSX support
- Update README documentation to reflect current test patterns
- Add test cleanup between E2E tests to prevent data leakage
* fix(alerting): remove unused import and fix test wrapper
- Remove unused locationService import from RulesFilter.v2.tsx
- Add missing bootData spread in useSavedSearches.test.tsx mock
- Add createWrapper to renderHook call for user-specific storage key test
* fix(alerting): add Redux wrapper to all useSavedSearches hook tests
All renderHook calls for useSavedSearches now include the createWrapper()
which provides the Redux Provider context required by useAppNotification.
* fix(alerting): use regex patterns in MSW handlers for UserStorage tests
MSW handlers now use regex patterns to match any namespace and user UID,
since UserStorage reads config values from internal imports that aren't
affected by jest.mock of @grafana/runtime.
* fix(alerting): mock UserStorage directly instead of using MSW
Replace MSW HTTP handlers with a direct mock of the UserStorage class.
The MSW approach failed because UserStorage evaluates config.namespace
at module load time, before jest.mock takes effect, causing the regex
patterns to not match the actual request URLs.
This follows the same pattern used in useFavoriteDatasources.test.ts.
* refactor(alerting): use react-hook-form and Dropdown for saved searches
- Migrate InlineRenameInput and InlineSaveInput to react-hook-form
- Replace custom PopupCard with Grafana Dropdown component
- Use useReducer for centralized dropdown state management
- Add stopPropagation handlers to prevent dropdown closing during form interactions
- Update tests to use real useSavedSearches hook with mocked UserStorage
- Consolidate and simplify saved searches test suite
* fix: resolve CI failures in SavedSearches component
- Fix TypeScript TS2540 errors by using MutableRefObject type for refs
- Fix form submission by using onClick instead of type="submit" on IconButton
(IconButton doesn't forward the type prop to the underlying button)
- Fix action menu tests by stopping click propagation on ActionMenu wrapper
- Fix Escape key handling by focusing the dialog element instead of the
potentially-disabled save button
* fix(alerting): add navTree to runtime mock in useSavedSearches tests
Add empty navTree array to the @grafana/runtime config mock to prevent
store initialization crash when buildInitialState() calls .find() on
undefined navTree.
* fix(alerting): add error handling for auto-apply default search
Wrap handleApplySearch call in try-catch to prevent unhandled exceptions
when auto-applying the default saved search on navigation.
* fix(alerting): prevent saved searches dropdown from closing when clicking action menu
The nested Dropdown components caused the outer SavedSearches dropdown to close
when clicking on action menu items (Set as default, Rename, Delete). This happened
because @floating-ui/react's useDismiss hook detected clicks on the inner Menu
(rendered via Portal) as "outside" clicks.
Fix: Replace the outer Dropdown with PopupCard and add custom click-outside
handling that explicitly excludes portal elements ([role="menu"] and
[data-popper-placement]). This matches the pattern used before the Dropdown
refactor.
Changes:
- SavedSearches.tsx: Use PopupCard instead of Dropdown, add click-outside handler
- SavedSearchItem.tsx: Add menuPortalRoot prop for action menu positioning
- RulesFilter.v2.tsx: Fix double analytics tracking on auto-apply
* fix(alerting): auto-apply default saved search on page navigation
The default saved search was not being applied when navigating to the
Alert rules page. This was caused by a race condition where `isLoading`
was `false` on initial render (status was 'not-executed'), causing the
auto-apply effect to run before saved searches were loaded.
Fix: Include the uninitialized state in the loading check so the effect
waits until data is actually loaded before attempting to auto-apply.
Also adds tests for the auto-apply functionality.
* fix(alerting): align action menu icon and improve saved search tests
- Fix vertical alignment of three-dot menu icon in saved search items
by adding flex centering to the wrapper div
- Add feature toggle setup/teardown in saved searches test suite
- Fix location mocking in test for URL search parameter handling
* refactor(alerting): improve saved searches validation and organization
- Rename SavedSearches.types.ts to savedSearchesSchema.ts
- Use react-hook-form's built-in validation instead of manual setError
- Change error handling to throw ValidationError instead of returning it
- Add type guard isValidationError for safe error checking
- Add alphabetical sorting for saved searches (default first)
- Replace console.warn/error with logWarning/logError for analytics
- Extract helper functions: sortSavedSearches, loadSavedSearchesFromStorage, hasUrlSearchQuery
* refactor(alerting): address PR review comments for saved searches (steps 9-12)
- Add comprehensive comment explaining useEffect double-render limitation
and potential future improvements for default search auto-apply (step 9)
- Add test documenting expected behavior when navigating back to alert list
after leaving the page - default filter is re-applied (step 10)
- Update RulesFilter.v2.test.tsx to use testWithFeatureToggles helper and
add MSW UserStorage handlers for future use (step 11)
- Update SavedSearches.test.tsx to use render from test/test-utils and
byRole selectors for menu items (step 12)
* test(alerting): update saved searches tests for refactored API
- Update mockSavedSearches order to match sorted output (default first, then alphabetically)
- Change validation error tests to use rejects pattern (saveSearch/renameSearch now throw)
- Add hasPermission mock to contextSrv for module-level permission check
* fix(alerting): fix CI failures for saved searches
- Update onRenameComplete type to match throw-based API (Promise<void>)
- Run i18n-extract to add missing translation keys
* fix(alerting): salvage valid entries when saved searches validation fails
Instead of returning an empty array when array validation fails,
iterate through each item and keep only the valid entries.
This prevents losing all saved searches if a single entry is corrupted.
* test(alerting): update test to expect valid entries to be preserved
Update the test assertion to match the new behavior where valid saved
search entries are preserved when some entries fail validation, rather
than discarding all entries.
* fix(alerting): eliminate double API request on saved search auto-apply
Move saved searches loading and auto-apply logic from RulesFilterV2 to
RuleListPage. This ensures the default search filter is applied BEFORE
FilterView mounts, preventing double API requests on initial page load.
- Load saved searches at RuleListPage level
- Gate RuleList rendering until saved searches are loaded
- Pass savedSearchesResult as prop to avoid duplicate hook calls
- Remove auto-apply tests from RulesFilter.v2.test.tsx (behavior moved)
* fix(alerting): mock useSavedSearches in RuleList.v2 tests
The useSavedSearches hook triggers async state updates that complete
after tests finish, causing React act() warnings. Mock the hook to
prevent async operations during tests.
* refactor(alerting): migrate saved searches tests to use MSW
Address code review feedback by migrating UserStorage tests from
jest.mock to MSW-based mocking:
- Add MSW helper functions (setAlertingStorageItem, getAlertingStorageItem)
to simplify test setup for UserStorage
- Migrate useSavedSearches.test.tsx to use MSW handlers instead of
jest.mock('@grafana/runtime/internal')
- Migrate RulesFilter.v2.test.tsx to use MSW handlers
- Update README documentation to accurately reflect how tests use MSW
- Add tests for default search auto-apply behavior in RuleListPage
- Simplify comments to be concise and accurate
* fix(alerting): mock UserStorage directly in useSavedSearches tests
The UserStorage class caches its storage spec at the instance level,
and the useSavedSearches hook creates the instance at module level.
This caused test isolation issues where cached state leaked between
tests, making all tests that depended on loading data fail.
Fix by mocking UserStorage class directly instead of relying on MSW
handlers. This gives each test explicit control over what getItem
and setItem return, ensuring proper isolation.
Also update persistence assertions to verify mock.setItem calls
instead of reading from MSW storage (which the mock bypasses).
* refactor(alerting): remove setup helper in SavedSearches tests
Replace the `setup()` helper function with direct `render()` calls
as suggested in PR review. This makes tests more explicit about
what component is being rendered and with what props.
* refactor(alerting): extract default search auto-apply into dedicated hook
Moves the default saved search auto-apply logic from useSavedSearches into
a new useApplyDefaultSearch hook. This improves separation of concerns by
keeping useSavedSearches focused on CRUD operations while the new hook
handles the page-level auto-apply behavior.
Key changes:
- Created useApplyDefaultSearch hook with session-based visit tracking
- Removed getAutoApplySearch method and user-specific session keys from useSavedSearches
- Exported loadDefaultSavedSearch utility for independent default search loading
- Simplified test mocks to use loadDefaultSavedSearch instead of full hook mocking
- Removed unused savedSearchesResult prop passing through component tree
* fix(alerting): improve default search auto-apply timing and test reliability
Replace react-use's auto-executing useAsync with internal useAsync hook
for better control over when default search is loaded. This prevents
race conditions and ensures the async operation only executes when needed.
Test improvements:
- Add proper session storage cleanup in beforeEach
- Use waitFor to handle async operations correctly
- Prevent visited flag from affecting subsequent tests
- Clear mock call history between tests
The internal useAsync hook doesn't auto-execute on mount, allowing us to
control exactly when the default search loads based on conditions rather
than relying on dependency array triggers.
---------
Co-authored-by: Konrad Lalik <konradlalik@gmail.com>
* feat(auth): add ExtraAudience option to RoundTripper
Add ExtraAudience option to RoundTripper to allow operators to include
additional audiences (e.g., provisioning group) when connecting to the
multitenant aggregator. This ensures tokens include both the target API
server's audience and the provisioning group audience, which is required
to pass the enforceManagerProperties check.
- Add ExtraAudience RoundTripperOption
- Improve documentation and comments
- Add comprehensive test coverage
* fix(operators): add ExtraAudience for dashboards/folders API servers
Operators connecting to dashboards and folders API servers need to include
the provisioning group audience in addition to the target API server's
audience to pass the enforceManagerProperties check.
* provisioning: fix settings/stats authorization for AccessPolicy identities
The settings and stats endpoints were returning 403 for users accessing via
ST->MT because the AccessPolicy identity was routed to the access checker,
which doesn't know about these resources.
This fix handles 'settings' and 'stats' resources before the access checker
path, routing them to the role-based authorization that allows:
- settings: Viewer role (read-only, needed by frontend)
- stats: Admin role (can leak information)
* fix: update BootstrapStep component to remove legacy storage handling and adjust resource counting logic
- Removed legacy storage flag from useResourceStats hook in BootstrapStep.
- Updated BootstrapStepResourceCounting to simplify rendering logic and removed target prop.
- Adjusted tests to reflect changes in resource counting and rendering behavior.
* Revert "fix: update BootstrapStep component to remove legacy storage handling and adjust resource counting logic"
This reverts commit 148802cbb5.
* provisioning: allow any authenticated user for settings/stats endpoints
These are read-only endpoints needed by the frontend:
- settings: returns available repository types and configuration for the wizard
- stats: returns resource counts
Authentication is verified before reaching authorization, so any user who
reaches these endpoints is already authenticated. Requiring specific org
roles failed for AccessPolicy tokens which don't carry traditional roles.
* provisioning: remove redundant admin role check from listFolderFiles
The admin role check in listFolderFiles was redundant (route-level auth already
handles access) and broken for AccessPolicy identities which don't have org roles.
File access is controlled by the AccessClient as documented in the route-level
authorization comment.
* provisioning: add isAdminOrAccessPolicy helper for auth checks
Consolidates authorization logic for provisioning endpoints:
- Adds isAdminOrAccessPolicy() helper that allows admin users OR AccessPolicy identities
- AccessPolicy identities (ST->MT flow) are trusted internal callers without org roles
- Regular users must have admin role (matching frontend navtree restriction)
Used in: authorizeSettings, authorizeStats, authorizeJobs, listFolderFiles
* provisioning: consolidate auth helpers into allowForAdminsOrAccessPolicy
Simplifies authorization by:
- Adding isAccessPolicy() helper for AccessPolicy identity check
- Adding allowForAdminsOrAccessPolicy() that returns Decision directly
- Consolidating stats/settings/jobs into single switch case
- Using consistent pattern in files.go
* provisioning: require admin for files subresource at route level
Aligns route-level authorization with handler-level check in listFolderFiles.
Both now require admin role OR AccessPolicy identity for consistency.
* provisioning: restructure authorization with role-based helpers
Reorganizes authorization code for clarity:
Role-based helpers (all support AccessPolicy for ST->MT flow):
- allowForAdminsOrAccessPolicy: admin role required
- allowForEditorsOrAccessPolicy: editor role required
- allowForViewersOrAccessPolicy: viewer role required
Repository subresources by role:
- Admin: repository CRUD, test, files
- Editor: jobs, resources, sync, history
- Viewer: refs, status (GET only)
Connection subresources by role:
- Admin: connection CRUD
- Viewer: status (GET only)
* provisioning: move refs to admin-only
refs subresource now requires admin role (or AccessPolicy).
Updated documentation comments to reflect current permissions.
* provisioning: add fine-grained permissions for connections
Adds connection permissions following the same pattern as repositories:
- provisioning.connections:create
- provisioning.connections:read
- provisioning.connections:write
- provisioning.connections:delete
Roles:
- fixed:provisioning.connections:reader (granted to Admin)
- fixed:provisioning.connections:writer (granted to Admin)
* provisioning: remove non-existent sync subresource from auth
The sync subresource doesn't exist - syncing is done via the jobs endpoint.
Removed dead code from authorization switch case.
* provisioning: use access checker for fine-grained permissions
Refactors authorization to use b.access.Check() with verb-based checks:
Repository subresources:
- CRUD: uses actual verb (get/create/update/delete)
- test: uses 'update' (write permission)
- files/refs/resources/history/status: uses 'get' (read permission)
- jobs: uses actual verb for jobs resource
Connection subresources:
- CRUD: uses actual verb
- status: uses 'get' (read permission)
The access checker maps verbs to actions defined in accesscontrol.go.
Falls back to admin role for backwards compatibility.
Also removes redundant admin check from listFolderFiles since
authorization is now properly handled at route level.
* provisioning: use verb constants instead of string literals
Uses apiutils.VerbGet, apiutils.VerbUpdate instead of "get", "update".
* provisioning: use access checker for jobs and historicjobs resources
Jobs resource: uses actual verb (create/read/write/delete)
HistoricJobs resource: read-only (historicjobs:read)
* provisioning: allow viewers to access settings endpoint
Settings is read-only and needed by multiple UI pages (not just admin pages).
Stats remains admin-only.
* provisioning: consolidate role-based resource authorization
Extract isRoleBasedResource() and authorizeRoleBasedResource() helpers
to avoid duplicating settings/stats resource checks in multiple places.
* provisioning: use resource name constants instead of hardcoded strings
Replace 'repositories', 'connections', 'jobs', 'historicjobs' with
their corresponding ResourceInfo.GetName() constants.
* provisioning: delegate file authorization to connector
Route level: allow any authenticated user for files subresource
Connector: check repositories:read only for directory listing
Individual file CRUD: handled by DualReadWriter based on actual resource
* provisioning: enhance authorization for files and jobs resources
Updated file authorization to fall back to admin role for listing files. Introduced checkAccessForJobs function to manage job permissions, allowing editors to create and manage jobs while maintaining admin-only access for historic jobs. Improved error messaging for permission denials.
* provisioning: refactor authorization with fine-grained permissions
Authorization changes:
- Use access checker with role-based fallback for backwards compatibility
- Repositories/Connections: admin role fallback
- Jobs: editor role fallback (editors can manage jobs)
- HistoricJobs: admin role fallback (read-only)
- Settings: viewer role (needed by multiple UI pages)
- Stats: admin role
Files subresource:
- Route level allows any authenticated user
- Directory listing checks repositories:read in connector
- Individual file CRUD delegated to DualReadWriter
Refactored checkAccessWithFallback to accept fallback role parameter.
* provisioning: refactor access checker integration for improved authorization
Updated the authorization logic to utilize the new access checker across various resources, including files and jobs. This change simplifies the permission checks by removing redundant identity retrieval and enhances error handling. The access checker now supports role-based fallbacks for admin and editor roles, ensuring backward compatibility while streamlining the authorization process for repository and connection subresources.
* provisioning: remove legacy access checker tests and refactor access checker implementation
Deleted the access_checker_test.go file to streamline the codebase and focus on the updated access checker implementation. Refactored the access checker to enhance clarity and maintainability, ensuring it supports role-based fallback behavior. Updated the access checker integration in the API builder to utilize the new fallback role configuration, improving authorization logic across resources.
* refactor: split AccessChecker into TokenAccessChecker and SessionAccessChecker
- Renamed NewMultiTenantAccessChecker -> NewTokenAccessChecker (uses AuthInfoFrom)
- Renamed NewSingleTenantAccessChecker -> NewSessionAccessChecker (uses GetRequester)
- Split into separate files with their own tests
- Added mockery-generated mock for AccessChecker interface
- Names now reflect identity source rather than deployment mode
* fix: correct error message case and use accessWithAdmin for filesConnector
- Fixed error message to use lowercase 'admin role is required'
- Fixed filesConnector to use accessWithAdmin for proper role fallback
- Formatted code
* refactor: reduce cyclomatic complexity in filesConnector.Connect
Split the Connect handler into smaller focused functions:
- handleRequest: main request processing
- createDualReadWriter: setup dependencies
- parseRequestOptions: extract request options
- handleDirectoryListing: GET directory requests
- handleMethodRequest: route to method handlers
- handleGet/handlePost/handlePut/handleDelete: method-specific logic
- handleMove: move operation logic
* security: remove blind TypeAccessPolicy bypass from access checkers
Removed the code that bypassed authorization for TypeAccessPolicy identities.
All identities now go through proper permission verification via the inner
access checker, which will validate permissions from ServiceIdentityClaims.
This addresses the security concern where TypeAccessPolicy was being trusted
blindly without verifying whether the identity came from the wire or in-process.
* feat: allow editors to access repository refs subresource
Change refs authorization from admin to editor fallback so editors can
view repository branches when pushing changes to dashboards/folders.
- Split refs from other read-only subresources (resources, history, status)
- refs now uses accessWithEditor instead of accessWithAdmin
- Updated documentation comment to reflect authorization levels
- Added integration test TestIntegrationProvisioning_RefsPermissions
verifying editor access and viewer denial
* tests: add authorization tests for missing provisioning API endpoints
Add comprehensive authorization tests for:
- Repository subresources (test, resources, history, status)
- Connection status subresource
- HistoricJobs resource
- Settings and Stats resources
All authorization paths are now covered by integration tests.
* test: fix RefsPermissions test to use GitHub repository
Use github-readonly.json.tmpl template instead of local folder,
since refs endpoint requires a versioned repository that supports
git operations.
* chore: format test files
* fix: make settings/stats authorization work in MT mode
Update authorizeRoleBasedResource to check authlib.AuthInfoFrom(ctx)
for AccessPolicy identity type in addition to identity.GetRequester(ctx).
This ensures AccessPolicy identities are recognized in MT mode where
identity.GetRequester may not set the identity type correctly.
* fix: remove unused authorization helper functions
Remove allowForAdminsOrAccessPolicy and allowForViewersOrAccessPolicy
as they are no longer used after refactoring to use authorizeRoleBasedResource.
* Fix AccessPolicy identity detection in ST authorizer
- Add check for AccessPolicy identities via GetAuthID() in authorizeRoleBasedResource
- Extended JWT may set identity type to TypeUser but AuthID is 'access-policy:...'
- Forward user ID token in X-Grafana-Id header in RoundTripper for aggregator forwarding
* Revert "Fix AccessPolicy identity detection in ST authorizer"
This reverts commit 0f4885e503.
* Add fine-grained permissions for settings and stats endpoints
- Add provisioning.settings:read action (granted to Viewer role)
- Add provisioning.stats:read action (granted to Admin role)
- Add accessWithViewer to APIBuilder for Viewer role fallback
- Use access checker for settings/stats authorization
- Remove role-based authorization functions (isRoleBasedResource, authorizeRoleBasedResource)
This makes settings and stats consistent with other provisioning resources
and works properly in both ST and MT modes via the access checker.
* Remove AUTHORIZATION_COVERAGE.md
* Add provisioning resources to RBAC mapper
- Add connections, settings, stats to provisioning.grafana.app mappings
- Required for authz service to translate K8s verbs to legacy actions
- Fixes 403 errors for settings/stats in MT mode
* refactor: merge access checkers with original fallthrough behavior
Merge tokenAccessChecker and sessionAccessChecker into a unified
access checker that implements the original fallthrough behavior:
1. First try to get identity from access token (authlib.AuthInfoFrom)
2. If token exists AND (is TypeAccessPolicy OR useExclusivelyAccessCheckerForAuthz),
use the access checker with token identity
3. If no token or conditions not met, fall back to session identity
(identity.GetRequester) with optional role-based fallback
This fixes the issue where settings/stats/connections endpoints were
failing in MT mode because the tokenAccessChecker was returning an error
when there was no auth info in context, instead of falling through to
session-based authorization.
The unified checker now properly handles:
- MT mode: tries token first, falls back to session if no token
- ST mode: only uses token for AccessPolicy identities, otherwise session
- Role fallback: applies when configured and access checker denies
* Revert "refactor: merge access checkers with original fallthrough behavior"
This reverts commit 96451f948b.
* Grant settings view role to all
* fix: use actual request verb for settings/stats authorization
Use a.GetVerb() instead of hardcoded VerbGet for settings and stats
authorization. When listing resources (hitting collection endpoint),
the verb is 'list' not 'get', and this mismatch could cause issues
with the RBAC service.
* debug: add logging to access checkers for authorization debugging
Add klog debug logs (V4 level) to token and session access checkers
to help diagnose why settings/stats authorization is failing while
connections works.
* debug: improve access checker logging with grafana-app-sdk logger
- Use grafana-app-sdk logging.FromContext instead of klog
- Add error wrapping with resource.group format for better context
- Log more details including folder, group, and allowed status
- Log error.Error() for better error message visibility
* chore: use generic log messages in access checkers
* Revert "Grant settings view role to all"
This reverts commit 3f5758cf36.
* fix: use request verb for historicjobs authorization
The original role-based check allowed any verb for admins. To preserve
this behavior with the access checker, we should pass the actual verb
from the request instead of hardcoding VerbGet.
---------
Co-authored-by: Charandas Batra <charandas.batra@grafana.com>
* Default to folder sync only and block new instance sync repositories
- Change default allowed_targets to folder-only in backend configuration
- Modify validation to only enforce allowedTargets on CREATE operations
- Add deprecation warning for existing instance sync repositories
- Update frontend defaults and tests to reflect new behavior
Fixes#619
* Update warning message: change 'deprecated' to 'not fully supported'
* Fix health check: don't validate allowedTargets for existing repositories
Health checks for existing repositories should treat them as UPDATE operations,
not CREATE operations, so they don't fail validation for instance sync target.
* Fix tests and update i18n translations
- Update BootstrapStep tests to reflect folder-only default behavior
- Run i18n-extract to update translation file structure
* Fix integration tests
* Fix tests
* Fix provisioning test wizard
* Fix fronted test
* feat: add Grafana logo to embedded panels
- Add Grafana logo watermark to solo panel view (embedded panels)
- Logo appears in top-right corner with subtle background container
- Logo hides on hover to avoid interfering with panel content
- Uses React state to track hover for reliable behavior across nested elements
* minor formatting
* update changes to match public dashboards styling
* match styles of public dashboards
* feat: add responsive Grafana branding to embedded panels
- Add 'Powered by Grafana' branding with text logo to solo panel view
- Implement responsive scaling based on panel dimensions (0.6x to 1.0x)
- Logo and text scale proportionally with panel size
- Branding hides on hover to avoid interfering with panel content
- Matches public dashboard branding pattern for consistency
- Uses ResizeObserver for efficient responsive updates
* feat: add Grafana branding to embedded solo panels
- Add 'Powered by Grafana' branding with text logo to embedded panels
- Create SoloPanelPageLogo component for reusable branding
- Implement responsive scaling based on panel dimensions
- Add hover-to-hide functionality to avoid content overlap
- Logo scales between 0.6x and 1.0x based on panel size
* refactor: move scale calculation into SoloPanelPageLogo component
- Move responsive scale calculation logic from SoloPanelRenderer to SoloPanelPageLogo
- Logo component now manages its own scaling based on container dimensions
- Improves separation of concerns and component encapsulation
* feat: add hideLogo query parameter to disable embedded panel branding
- Add hideLogo query parameter support to SoloPanelPage
- Logo can be hidden via ?hideLogo, ?hideLogo=true, or ?hideLogo=1
- Useful for customers who want to disable branding and for image rendering scenarios
- Update Props interface to include hideLogo in queryParams type
* feat: hide logo in panel image renderer URLs
- Add hideLogo=true parameter to image renderer URLs in ShareLinkTab
- Ensures logo is hidden when generating panel images through share feature
- Update test to expect hideLogo=true in render URL
* feat: hide logo in old dashboard sharing panel image URLs
- Add hideLogo=true parameter to buildImageUrl in ShareModal utils
- Ensures logo is hidden when generating panel images through old share modal
- Update all ShareLink tests to expect hideLogo=true in render URLs
* test: add comprehensive tests for SoloPanelPage and SoloPanelPageLogo
- Add SoloPanelPageLogo tests covering rendering, hover behavior, theme selection, and scaling
- Add SoloPanelPage tests covering logo visibility based on hideLogo prop
- Test logo hiding functionality (most important behavior)
- Test responsive scaling based on container dimensions
- Test ResizeObserver integration
- All 14 tests passing
* refactor: centralize hideLogo handling in SoloPanelPageLogo
Move hideLogo parsing and decision-making into SoloPanelPageLogo so SoloPanelPage/SoloPanelRenderer only pass through the raw query param value.
* chore: clean up solo logo test and share link params
Remove a duplicate SVG mock in SoloPanelPageLogo.test, and simplify ShareLinkTab image URL building without changing behavior.
* chore: revert ShareLinkTab image query refactor
Restore the previous image URL query-param mutation logic in ShareLinkTab to reduce risk.
* chore: set hideLogo once for ShareLinkTab image URLs
Avoid passing hideLogo twice when building the rendered image URL.
* fix: handle boolean hideLogo query param in SoloPanelPageLogo
Handle query params that are represented as booleans (e.g., ?hideLogo) and arrays, and avoid calling trim() on non-strings.
* fix i18n
* fix(dashboard-scene): address SoloPanelPageLogo review feedback
Avoid double-scaling logo margin, clarify scaling comments, and extend tests for null/array values and ResizeObserver cleanup.
* update margin left on logo to better match text spacing
* wip
* boop
* Base factor on data
* Add some basic option control
* Remove old comments
* Add feature flag
* Apply feature flag to axis options
* Turn factor calculation into exported function
* Simplify bucket factor function
* Clarify comments
* Fix cell sizing of pre-bucketed heatmaps with log
* Remove unnecessary category change
* Consolidate editor for calculate from data no
* Update bucket function sanity checks
* Wire up scale config from yBucketScale
* Hide bucket controls for heatmap cells
* Fix splits
* Add test coverage
* Fix failing test
* Add basic util test coverage
* Fix tooltip for legacy in linear
* Fix y bucket option width to be consistent
* Hide tick alignment for explicit scale modes
* Clarify comment
* Make sure units are passed properly for linear
* Remove null assertion operator
* Clean up nested ternary
* Add type protection to scaleLog
* Remove repeated code for ySize calcs
* Remove ternary for scaleDistribution
* Add test coverage for YBucketScaleEditor
* Add isHeatmapSparse function to tooltip utils
* Create calculateYSizeDivisor util function
* Fix y axis min and max options and extend to log
* Add toLogBase test coverage
* Create applyExplicitMinMax function
* Add additional test coverage for scale editor
* Run i18n-extract
* Update eslint suppressions
---------
Co-authored-by: Drew Slobodnjak <60050885+drew08t@users.noreply.github.com>
* Dashboard migration: preserve legacy string datasource references
Fix v1beta1 → v2alpha1 conversion to handle legacy string datasource
references in QueryVariable, AdhocVariable, and GroupByVariable.
Previously, string datasource references (both template variables like
"$datasource" and direct names/UIDs like "prometheus") were being
dropped during conversion, causing variable chaining to break.
The frontend's DatasourceSrv.getInstanceSettings() already handles
string references by trying uid → name → id lookup at runtime, so we
preserve the string in the uid field and let the frontend resolve it.
* trigger frontend ci tests when dashboard migration code changes
* v1: if string convert to DS ref
* Update migration testdata to fix template variable datasource references
* update
* wip; DrilldownControls
* use wrapper so that drilldown controls wrap inline
* keep labels on top when input expands vertically
* add clear all button
* add collapsible prop
* i18n
* Increase maxWidth for adhoc
* bump scenes for testing
* fix
* remove clear all button
* use new feature toggle; pass collapsible in v2
* update variable controls to use new feature flag
* cleanup
* wip (#115441)
* wip
* fix
* update wrapping on smaller screens
---------
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
* Filter out variables that are not in inControlsMenu
* filter out inControlsMenu vars, not hidden ones
* canary scenes
* fix
* cleanup
* canary scenes
* pass wideInput to groupby based on ff
* update var name and bump scenes
* bump scenes
* yarn lock
---------
Co-authored-by: Victor Marin <victor.marin@grafana.com>
* Fix Grafana App SDK logger log level
What
This commit fixes the hardcoded value of the app SDK logger log level
by properly setting it during the log manager initialization.
Why
To prevent app SDK logging from always logging at DEBUG.
Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
* Add missing argument to the logging test
Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
---------
Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
* move content and mode properties to options level
* move to angular section
* Update comments
* handle missing angular text panel
* re-generate test files
* angualr panels tests
* fixing test
* Update output files
* Update output for dev dashboard
* Spread options at the top panel level for migration
* linting issue
---------
Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
* Remove the default alpine & ubuntu versions so that the ones in Dockerfile are used
* set default to just 'alpine' or 'ubuntu'
* use defaults instead
* Provisioning: Add Git Sync limitations warning and migrate resources checkbox
- Update SynchronizeStep alert to use warning severity with comprehensive Git Sync limitations
- Add conditional warnings for instance sync (permissions loss, alerts/library panels loss)
- Add conditional warnings for folder sync (folder structure changes, manual cleanup needed)
- Add "Migrate existing resources" checkbox for folder sync mode
- Update useCreateSyncJob hook to handle migrateResources option for folder sync
- Extract i18n translations for new strings
* Simplify createSyncJob: calculate requiresMigration in caller
- Remove syncTarget and migrateResources parameters from useCreateSyncJob hook
- Calculate requiresMigration in SynchronizeStep based on sync target and checkbox value
- Pass requiresMigration as parameter to createSyncJob function
* Revert: Pass requiresMigration as hook parameter
- Calculate requiresMigration in SynchronizeStep using useMemo
- Pass requiresMigration to useCreateSyncJob hook
- Remove parameter from createSyncJob function call
* Revert "Revert: Pass requiresMigration as hook parameter"
This reverts commit 97e3b7107d.
* Fix TypeScript errors in ProvisioningWizard
- Remove requiresMigration from useCreateSyncJob call
- Pass requiresMigration parameter to createSyncJob call
- Remove unused Target import from SynchronizeStep
* Show migrate resources checkbox for instance sync (checked and disabled)
- Display checkbox for both instance and folder sync
- For instance sync: checkbox is checked and disabled with explanation
- For instance sync: automatically set migrateResources to true via useEffect
- Update description to explain instance sync requires all resources to be managed
* Extract i18n translations for instance-migrate-resources-description
* Rename 'Synchronization options' to 'Options'
* Update i18n translations: rename synchronization-options to options
* Remove unnecessary conditional check for sync target
* Add bodySmall variant to announcement banner TextLink
* Move requiresMigration calculation logic into useResourceStats hook
- Add migrateResources parameter to useResourceStats hook
- Calculate final requiresMigration in hook based on sync target and checkbox value
- Use watch instead of getValues to reactively get migrateResources value
- Simplify startSynchronization to use requiresMigration from hook
* build(frontend): enable custom condition for resolving source files during dev and build
* feat(packages): apply conditional name to export properties
* chore(packages): add standard exports to flamegraph and prometheus
* chore(packages): resolve main, module, types to built files
* build(packages): clean up prepare-npm-package for custom condition changes
* refactor(packages): reduce repetition in conditional exports
* build(storybook): add @grafana-app/source to conditionNames
* test(frontend): add grafana-app/source customCondition for jest tests
* refactor(frontend): remove nested package import paths
* chore(jest): use customExportConditions for source files and browser
* chore(i18n): use src for ./eslint-plugin export
* chore(packages): set packages tsconfigs to moduleResolution bundler
* chore(packages): fix rollup builds
* build(packages): build cjs as multiple files
* chore(sql): reference MonitoringLogger for moduleresolution bundler to pass typecheck
* chore(ui): add type refs for moduleresolution bundler to pass typecheck
* feat(schema): add exports for cleaner import paths
* refactor(frontend): clean up schema paths to point to exports instead of nested file paths
* build(storybook): hack the builder-manager for custom conditions to resolve
* build(decoupled-plugins): fix broken builds due to missing conditionNames
* chore(e2e): pass condition to playwright to resolve local packages
* build(frontend): fix failing build
* chore(select): fix typings
* style(frontend): clean up eslint suppressions
* chore(packages): fix type errors due to incorrect tsconfig settings
* build(generate-apis): use swc with ts-node and moduleResolution bundler
* chore(cypress): add conditionNames to resolve monorepo packages
* build(npm): update prepare to work with latest exports changes
* build(packages): fix prepare-npm-package script
* fix(e2e-selectors): update debugoverlay for data-testid change
* build(packages): stop editing package.json at pack n publish time
* rerun ci
* chore(api-clients): use moduleResolution: bundler for customConditions support
* chore(api-clients): fix generation
* build(packages): remove aliasing exports, remove exports with only customConditions
* Revert "refactor(frontend): clean up schema paths to point to exports instead of nested file paths"
This reverts commit 7949b6ea0e60e51989d2a8149b7a24647cd68916.
* revert(schema): remove exports from package so builds work
* build(api-clients): fix up api-clients exports and rollup config
* build(api-clients): Update generated package exports for api clients
* build(schema): add overrides to cjsOutput and esmOutput so built directory structure is correct
* fix(packages): use rootDirs to prevent types/src directories in built d.ts file paths
* build(packages): prevent empty exports added to package.json during pack
* docs(packages): update readme with custom conditions information
---------
Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
* `grafana-iam`: Add basic roles to the apis
* Fix validation
* chore: trigger CI
* Leave the hooks intact for now, moving them later
* Remove Role mention from the interface
* Refactor to use a NoopRest backend and Deny access
* fix(transformation): gray out transformation card on transformation tab
* fix(transformations): make data prop required in EmptyTransformationsMessage
This ensures TypeScript enforces that all call sites pass the data prop,
which is required for graying out inapplicable transformation cards.
- Changed data prop from optional to required in EmptyTransformationsProps
- Fixed TransformationsEditor.tsx to pass data (was missing in legacy code)
- Updated tests to pass the required data prop
---------
Co-authored-by: Sam Jewell <sam.jewell@grafana.com>
* refactor template service to contstruct notification template in one place, get provenance before creating and calculate resource version after.
* refactor get by UID and name
* introduce template kind in NotificationTemplate
* introduce includeImported flag and use in the k8s api
* support imported templates
* add kind to template uid
* tests for imported templates
* update API model
* set kind to default templates
* unified-storage: add `Keys` support to the sqlkv implementation
* add validation for sort option
* Revert sort order validation, assume desc when invalid
* adjust conversion file to include empty properties array in overrides
* fix lint error
* add test case for empty properties and fix incorrect regex to v1 conversion
* Deprecate Legacy Storage Migration in Backend
* Change the messaging around legacy storage
* Disable cards to connect
* Commit import changes
* Block repository creation if resources are in legacy storage
* Update error message
* Prettify
* chore: uncomment unified migration
* chore: adapt and fix tests
* Remove legacy storage migration from frontend
* Refactor provisioning job options by removing legacy storage and history fields
- Removed the `History` field from `MigrateJobOptions` and related references in the codebase.
- Eliminated the `LegacyStorage` field from `RepositoryViewList` and its associated comments.
- Updated tests and generated OpenAPI schema to reflect these changes.
- Simplified the `MigrationWorker` by removing dependencies on legacy storage checks.
* Refactor OpenAPI schema and tests to remove deprecated fields
- Removed the `history` field from `MigrateJobOptions` and updated the OpenAPI schema accordingly.
- Eliminated the `legacyStorage` field from `RepositoryViewList` and its associated comments in the schema.
- Updated integration tests to reflect the removal of these fields.
* Fix typescript errors
* Refactor provisioning code to remove legacy storage dependencies
- Eliminated references to `dualwrite.Service` and related legacy storage checks across multiple files.
- Updated `APIBuilder`, `RepositoryController`, and `SyncWorker` to streamline resource handling without legacy storage considerations.
- Adjusted tests to reflect the removal of legacy storage mocks and dependencies, ensuring cleaner and more maintainable code.
* Fix unit tests
* Remove more references to legacy
* Enhance provisioning wizard with migration options
- Added a checkbox for migrating existing resources in the BootstrapStep component.
- Updated the form context to track the new migration option.
- Adjusted the SynchronizeStep and useCreateSyncJob hook to incorporate the migration logic.
- Enhanced localization with new descriptions and labels for migration features.
* Remove unused variable and dualwrite reference in provisioning code
- Eliminated an unused variable declaration in `provisioning_manifest.go`.
- Removed the `nil` reference for dualwrite in `repo_operator.go`, aligning with the standalone operator's assumption of unified storage.
* Update go.mod and go.sum to include new dependencies
- Added `github.com/grafana/grafana-app-sdk` version `0.48.5` and several indirect dependencies including `github.com/getkin/kin-openapi`, `github.com/hashicorp/errwrap`, and others.
- Updated `go.sum` to reflect the new dependencies and their respective versions.
* Refactor provisioning components for improved readability
- Simplified the import statement in HomePage.tsx by removing unnecessary line breaks.
- Consolidated props in the SynchronizeStep component for cleaner code.
- Enhanced the layout of the ProvisioningWizard component by streamlining the rendering of the SynchronizeStep.
* Deprecate MigrationWorker and clean up related comments
- Removed the deprecated MigrationWorker implementation and its associated comments from the provisioning code.
- This change reflects the ongoing effort to eliminate legacy components and improve code maintainability.
* Fix linting issues
* Add explicit comment
* Update useResourceStats hook in BootstrapStep component to accept selected target
- Modified the BootstrapStep component to pass the selected target to the useResourceStats hook.
- Updated related tests to reflect the change in expected arguments for the useResourceStats hook.
* fix(provisioning): Update migrate tests to match export-then-sync behavior for all repository types
Updates test expectations for folder-type repositories to match the
implementation changes where both folder and instance repository types
now run export followed by sync. Only the namespace cleaner is skipped
for folder-type repositories.
Changes:
- Update "should run export and sync for folder-type repositories" test to include export mocks
- Update "should fail when sync job fails for folder-type repositories" test to include export mocks
- Rename test to clarify that both export and sync run for folder types
- Add proper mock expectations for SetMessage, StrictMaxErrors, Process, and ResetResults
All migrate package tests now pass.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* Update provisioning wizard text and improve resource counting display
- Enhanced descriptions for migrating existing resources to clarify that unmanaged resources will also be included.
- Refactored BootstrapStepResourceCounting component to simplify the rendering logic and ensure both external storage and unmanaged resources are displayed correctly.
- Updated alert messages in SynchronizeStep to reflect accurate information regarding resource management during migration.
- Adjusted localization strings for consistency with the new descriptions.
* Update provisioning wizard alert messages for clarity and accuracy
- Revised alert points to indicate that resources can still be modified during migration, with a note on potential export issues.
- Clarified that resources will be marked as managed post-provisioning and that dashboards remain accessible throughout the process.
* Fix issue with trigger wrong type of job
* Fix export failure when folder already exists in repository
When exporting resources to a repository, if a folder already exists,
the Read() method would fail with "path component is empty" error.
This occurred because:
1. Folders are identified by trailing slash (e.g., "Legacy Folder/")
2. The Read() method passes this path directly to GetTreeByPath()
3. GetTreeByPath() splits the path by "/" creating empty components
4. This causes the "path component is empty" error
The fix strips the trailing slash before calling GetTreeByPath() to
avoid empty path components, while still using the trailing slash
convention to identify directories.
The Create() method already handles this correctly by appending
".keep" to directory paths, which is why the first export succeeded
but subsequent exports failed.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* Fix folder tree not updated when folder already exists in repository
When exporting resources and a folder already exists in the repository,
the folder was not being added to the FolderManager's tree. This caused
subsequent dashboard exports to fail with "folder NOT found in tree".
The fix adds the folder to fm.tree even when it already exists in the
repository, ensuring all folders are available for resource lookups.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* Revert "Merge remote-tracking branch 'origin/uncomment-unified-migration-code' into cleanup/deprecate-legacy-storage-migration-in-provisioning"
This reverts commit 6440fae342, reversing
changes made to ec39fb04f2.
* fix: handle empty folder titles in path construction
- Skip folders with empty titles in dirPath to avoid empty path components
- Skip folders with empty paths before checking if they exist in repository
- Fix unit tests to properly check useResourceStats hook calls with type annotations
* Update workspace
* Fix BootstrapStep tests after reverting unified migration merge
Updated test expectations to match the current component behavior where
resource counts are displayed for both instance and folder sync options.
- Changed 'Empty' count expectation from 3 to 4 (2 cards × 2 counts each)
- Changed '7 resources' test to use findAllByText instead of findByText
since the count appears in multiple cards
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* Remove bubbletee deps
* Fix workspace
* provisioning: update error message to reference enableMigration config
Update the error message when provisioning cannot be used due to
incompatible data format to instruct users to enable data migration
for folders and dashboards using the enableMigration configuration
introduced in PR #114857.
Also update the test helper to include EnableMigration: true for both
dashboards and folders to match the new configuration pattern.
* provisioning: add comment explaining Mode5 and EnableMigration requirement
Add a comment in the integration test helper explaining that Provisioning
requires Mode5 (unified storage) and EnableMigration (data migration) as
it expects resources to be fully migrated to unified storage.
* Remove migrate resources checkbox from folder type provisioning wizard
- Remove checkbox UI for migrating existing resources in folder type
- Remove migrateExistingResources from migration logic
- Simplify migration to only use requiresMigration flag
- Remove unused translation keys
- Update i18n strings
* Fix linting
* Remove unnecessary React Fragment wrapper in BootstrapStep
* Address comments
---------
Co-authored-by: Rafael Paulovic <rafael.paulovic@grafana.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
* Added method for adding migrations for convering unique to primary key.
Based on existing migration for `file` table (in `db_file_storage.go`) migrations.
* Added better default migration names. Added ability to override migration name.
* Use ConvertUniqueKeyToPrimaryKey for cloud_migration_snapshot_partition table.
* Convert resource_version UQE to PK.
* Convert secret_encrypted_value UQE to PK.
* Removed extra test.
* Removed testdata.
* Remove support for renaming migrations for now. We can bring it in later, when we want to convert existing migrations for file, file_meta and setting tables.
* Revert removal of ColumnName to ease backporting, since this field is referenced from enterprise code.
* Use quoted identifiers in Postgres statement.
* Auth: Google OAuth consent prompt takes precedence when use_refresh_token is true
* Auth: Disable login prompt option for Google OAuth when use_refresh_token is true
* yarn run prettier:check --write
* feedback: validate login prompt when use_refresh_token is true
* Explore: Add custom text highlighting to logs panel
Add ability to select text in log lines and highlight all occurrences
with persistent colors. Highlights are stored in URL state and cycle
through the theme's visualization palette.
- Add CustomHighlight type to ExploreLogsPanelState
- Implement LogListHighlightContext for state management
- Generate custom highlight grammar using Prism.js tokens
- Add "Highlight occurrences" option to popover menu
- Add "Reset highlights" control when highlights exist
- Fix pruneObject to preserve colorIndex: 0 in URL state
* Fix CI failures: formatting and i18n extraction
- Run prettier on LogLine.tsx
- Run i18n-extract to update translation strings
* Fix lint errors
- Use theme.shape.radius.default instead of literal '2px' in LogLine.tsx
- Remove unnecessary type assertion in grammar.ts
* Fix TypeScript error in grammar.ts
Use Record<string, GrammarValue> type for dynamic grammar object to allow string indexing without type assertions.
* Replace hardcoded HIGHLIGHT_COLOR_COUNT with actual theme palette length
Use useTheme2() hook to dynamically get the palette length instead of
hardcoding it to 50. This ensures the color cycling works correctly
regardless of the actual theme palette size.
* Backtrack to a stable point and revert changes
* Implement using search
* New translations
* LogListSearch: refactor search state
* PopoverMenu: add divider
* LogLine: remove padding and update border radius
* LogListSearch: add missing tooltips
* Refactor keybindings
* More cleanup
* LogListSearch: don't autoscroll with filterLogs
---------
Co-authored-by: Matias Chomicki <matyax@gmail.com>
* deps(go): bump the k8s-io group across 2 directories with 2 updates
Bumps the k8s-io group with 1 update in the / directory: [k8s.io/kube-aggregator](https://github.com/kubernetes/kube-aggregator).
Bumps the k8s-io group with 1 update in the /hack directory: [k8s.io/code-generator](https://github.com/kubernetes/code-generator).
Updates `k8s.io/kube-aggregator` from 0.34.2 to 0.34.3
- [Commits](https://github.com/kubernetes/kube-aggregator/compare/v0.34.2...v0.34.3)
Updates `k8s.io/code-generator` from 0.34.2 to 0.34.3
- [Commits](https://github.com/kubernetes/code-generator/compare/v0.34.2...v0.34.3)
---
updated-dependencies:
- dependency-name: k8s.io/kube-aggregator
dependency-version: 0.34.3
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: k8s-io
- dependency-name: k8s.io/code-generator
dependency-version: 0.34.3
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: k8s-io
...
Signed-off-by: dependabot[bot] <support@github.com>
* update all
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* Alerting: Protect sensitive fields of contact points from
unauthorized modification
- Introduce a new permission alert.notifications.receivers.protected:write. The permission is granted to contact point administrators.
- Introduce field Protected to NotifierOption
- Introduce DiffReport for models.Integrations with focus on Settings. The diff report is extended with methods that return all keys that are different between two settings.
- Add new annotation 'grafana.com/access/CanModifyProtected' to Receiver model
- Update receiver service to enforce the permission and return status 403 if unauthorized user modifies protected field
- Update receiver testing API to enforce permission and return status 403 if unauthorized user modifies protected field.
- Update UI to disable protected fields if user cannot modify them
update rudderstack init logic
to rely on existence of old or new sdk config option being set and only defer to feature toggle if both or neither is set
* Alerting: Improve ASH Loki query efficiency by including folderUID
Previously, the folderUID label was only included when ruleUID was not specified
and the user did not have full alert rule read permissions.
To improve ASH Loki query efficiency, this PR includes the folderUID in the ASH
Loki query when ruleUID is specified, even if the user has full alert rule read
permissions.
Some non-obvious considerations:
- The naive implementation of just including the current folder UID would have
the unintended side-effect of no longer returning history after a rule is moved
between folders.
- The previous implementation made the trade-off of only checking RBAC on the
current folder, including any history from old folders that may exist.
To solve both of the above, we make an extra query to the database to check the
alert rule's previous versions so we can include any old folderUIDs, checking
RBAC at the same time.
The querying and inclusion of history from old folders is done best-effort, any
issues that might arise are logged and ignored so as not to prevent the current
folder history.
* Fix merge conflicts
* Reduce scanning on GetAlertRuleVersionFolders by grouping in query
* refactor: delegate authorization to access checker in dualwriter
- Remove role-based authorization checks (editor/admin role checks)
- Delegate all authorization to access checker which checks resource-level permissions
- Update authorizeCreateFolder to use access checker instead of role-based checks
- Add comprehensive authorization tests for viewer, editor, and admin roles
- Tests cover GET, POST, PUT, DELETE operations and folder creation
This change ensures that authorization is consistently handled through
the access checker, which checks resource-level permissions rather than
just organization roles.
* fix: format files_test.go
* fix: check error return value of resp.Body.Close()
* fix: grant permissions to all dashboards for editor role in authorization test
Use SetPermissions with wildcard to grant permissions to Editor user
for all dashboards, not just the initial one. This ensures that dashboards
created during tests (like in DELETE operations) have the necessary
permissions for the editor role.
* maybe better way to attach meta?
* chore(plugin-extensions): remove todo comment
---------
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
**What is this feature?**
Add `rule_matcher` filter to the Prometheus-compatible list rules API: `/api/prometheus/grafana/api/v1/rules`. It allows to filter rules by static labels (not by alert instance labels).
**Special notes:**
- Equality (`=`) and inequality (`!=`) matchers are pushed down to the database. Regex matchers (`=~`, `!~`) are applied in-memory at the API layer.
- SQLite: Uses GLOB pattern matching
- MySQL / PostgreSQL: Use JSON functions to compare label values
---------
Co-authored-by: Konrad Lalik <konradlalik@gmail.com>
Enhancement: Introduce optimized folder permission relations and new permission definitions
- Added `can_get_permissions` and `can_set_permissions` relations to enhance permission management.
- Implemented `FolderPermissionRelation` function to optimize permission checks for folder resources.
- Updated `checkTyped` and `listTyped` methods to utilize optimized relations for permission management.
- Introduced a new benchmark test file for performance evaluation of permission checks and listings.
* hide alerts tab for git synced folders
* add tests for alert tab visibility
* hide managed folders from folder picker
* update UI so managed folders are disabled in dropdown not hidden
* add folder d to folder tree
* include folder d in useFolderQuery hook tests
* update provisioned folders from disabled to hidden in the folder selector
* remove disabled logic from NestedFolderList
* init
* it works! but what a mess
* nil ptr bug
* split up client.go
* split up search_request.go
* split up data_query.go
* split up response_parser
* fix merge
* update handling request
* raw dsl agg parser
* change rawQuery to rawDSLQuery
* agg parser works but needs work
* clean up agg parser
* fix bugs with raw dsl parsers
* feature toggle
* fix tests
* editor type selector
* editor type added
* add fix builder vs code by not using same query field
* clean up
* fix lint
* pretty
* editor type selection should be behind ft
* adam's feedback
* prettier
* rows with hidden header should never be collapsed
* fix test
* shouldn't need to normalize this
* fix frontend conversion
* fix lint
* Update public/app/features/dashboard-scene/serialization/transformSaveModelToScene.ts
Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>
---------
Co-authored-by: oscarkilhed <oscar.kilhed@grafana.com>
Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>
fix: allow editors to POST jobs in provisioning API
Editors should be able to post jobs in the 'jobs' endpoint for syncing
repositories. This aligns with the requirement that syncing a repository
requires editor privileges.
- Separated 'jobs' subresource authorization from repository/test
- Allow both admins and editors to POST jobs
- Added integration tests to verify permissions
Fixes authorization bug where editors were incorrectly denied access.
* Provisioning: Deprecate single file/folder move and delete on configured branch
Reject individual file and folder move/delete operations on the configured
branch via the single files endpoints (HTTP 405 MethodNotAllowed). Users
must use the bulk operations API (jobs API) instead.
Motivation:
- Reconciliation for these operations is not reliable as it must be
recursive and cannot run synchronously since it could take a long time
- Simplifies authorization logic - fewer operations to secure and validate
- Reduces complexity and surface area for potential bugs
- Bulk operations via jobs API provide better control and observability
Operations on non-configured branches (e.g., creating PRs) continue to work
as before since they don't update the Grafana database.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* fix: remove trailing whitespace in test file
* Fix behaviour to match current behavior
* Revert changes for individual files
---------
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
* continued edits
* authentication updates
* added more info to configure doc
* started work on query editor
* reviewed the configure doc, consolidated sections
* fixed issue with headings
* fixed errors
* updates to the template variables doc
* created initial troubleshooting doc
* removed gerunds and fixed heading issues
* new annotations doc added
* more updates to query editor
* fixed spelling
* fixed some linter issues
* fixed flow for the intro doc
* updates to the intro doc
* fixed transformation links
* added review date to front matter
* ran prettier
* added a new alerting doc
* linter updates
* some final edits
* ran prettier again
* Update docs/sources/datasources/azure-monitor/configure/index.md
Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
* Update docs/sources/datasources/azure-monitor/configure/index.md
Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
* Update docs/sources/datasources/azure-monitor/troubleshooting/index.md
Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
* edits based on feedback
* removed all relative reference links
* ran prettier
---------
Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
* Gauge: Fit-and-finish tweaks to glows, text position, and sparkline size
* adjust text height and positions a little more
* cohesive no data handling
* more tweaks
* fix migration test
* Fix JSON formatting by adding missing newline
* remove new line
* FieldSelector: rename functions to be more explicit
* LogDetailsContext: calculate width based on field selector visibility
* LogLineDetails: Fix sidebar max width calculation
* Update functions usage
* Add regression and fix context calculation
Previous attempt to land this required this PR and a grafana-enterprise
PR to land at the ~same time.
This PR guards the use of `dsConfigHandlerRequestsDuration` with a nil
check, and doesn't change any existing APIs, so we can land it without
any timing issues with grafana-enterprise.
Once this has landed, we'll make a follow-up PR for grafana-enterprise.
## Summary
Fixes a regression where the `loaded` analytics event was not being tracked for the `BasicProvisionedDashboardsEmptyPage` component, which is the component shown in production when the `suggestedDashboards` feature toggle is disabled (i.e. community dashboards disabled but v1 of feature enabled)
## Problem
Regression introduced by https://github.com/grafana/grafana/pull/112808/changes#diff-3a19d2e887a3344cb0bcd2449b570bd50a7d78d1d473f4a3cf623f9fe40f35fc adding community dashboard support to `SuggestedDashboards`, the `BasicProvisionedDashboardsEmptyPage` component was missing the `loaded` event tracking. Component is mounted here: https://github.com/grafana/grafana/pull/112808/changes#diff-fba79ed6f8bfb5f712bdd529155158977a3e081d1d6a5932a5fa90fb57a243e6R82. This caused analytics discrepancies where in the past 7 days (note: issue has been present for last several weeks but here is sample of data from previous week):
- 106 provisioned dashboard items were clicked
- Only 1 `loaded` event was received (from `SuggestedDashboards` when the feature toggle is enabled)
- The `loaded` events are missing for the production v1 flow (when `suggestedDashboards` feature toggle is off)
## Root Cause
The `BasicProvisionedDashboardsEmptyPage` component (used in v1 flow in production) was never updated with the `loaded` event tracking that was added to `SuggestedDashboards` in PR #113417. Since the `suggestedDashboards` feature toggle is not enabled in production, users were seeing `BasicProvisionedDashboardsEmptyPage` which had no tracking, resulting in missing analytics events.
## Solution
Added the `loaded` event tracking to `BasicProvisionedDashboardsEmptyPage` using the same approach that was previously used (tracking inside the async callback when dashboards are loaded). This ensures consistency with the existing pattern and restores analytics tracking for the production flow.
## Changes
- Added `DashboardLibraryInteractions.loaded()` call in `BasicProvisionedDashboardsEmptyPage` when dashboards are successfully loaded
- Uses the same tracking pattern as the original implementation (tracking inside async callback)
- Matches the event structure used in `SuggestedDashboards` for consistency
## Testing
- Verified that `loaded` events are now tracked when `BasicProvisionedDashboardsEmptyPage` loads dashboards
- Confirmed the event includes correct `contentKinds`, `datasourceTypes`, and `eventLocation` values
- No duplicate events are sent (tracking only occurs once per load)
## Related
- Original analytics implementation: #113417
- Related PR: #112808
- Component: [`BasicProvisionedDashboardsEmptyPage.tsx`](https://github.com/grafana/grafana/blob/main/public/app/features/dashboard/dashgrid/DashboardLibrary/BasicProvisionedDashboardsEmptyPage.tsx)
* Fix race condition causing unhealthy repository message to be lost
This commit fixes a race condition in the provisioning repository controller
where the "Repository is unhealthy" message in the sync status could be lost
due to status updates being based on stale repository objects.
## Problem
The issue occurred in the `process` function when:
1. Repository object was fetched from cache with old status
2. `RefreshHealth` immediately patched the health status to "unhealthy"
3. `determineSyncStatusOps` used the stale object to check if unhealthy
message was already set
4. A second patch operation based on stale data would overwrite the
health status update
## Solution
Introduced `RefreshHealthWithPatchOps` method that returns patch operations
instead of immediately applying them. This allows batching all status updates
(health + sync) into a single atomic patch operation, eliminating the race
condition.
## Changes
- Added `HealthCheckerInterface` for better testability
- Added `RefreshHealthWithPatchOps` method to return patch ops without applying
- Updated `process` function to batch health and sync status updates
- Added comprehensive unit tests for the fix
Fixes the issue where unhealthy repositories don't show the "Repository is
unhealthy" message in their sync status.
* Fix staticcheck lint error: remove unnecessary nil check for slice
* `grafana-iam`: Fetch target parent folder
* WIP add different ParentProviders
* Add version
* Move code to a different file
* Instantiate resourceParentProvider
* same import name
* imports
* Add tests
* Remove unecessary test
* forgot wire
* WIP integration tests
* Add test to cover list
* Fix caching problem in integration tests
* comments
* Logger and comments
* Add lazy creation and caching
* Instantiate clients only once
* Rerun wire gen
* docs: add docs for displaying links in the dashboard-controls menu
* Update docs/sources/as-code/observability-as-code/schema-v2/links-schema.md
Co-authored-by: Anna Urbiztondo <anna.urbiztondo@grafana.com>
---------
Co-authored-by: Anna Urbiztondo <anna.urbiztondo@grafana.com>
* Suggestions: hashes on suggestions, update logic to select first suggestion
* fix types
* Suggestions: New UI style updates
* update some styles
* getting styles just right
* remove grouping when not on flag
* adjust minimum width for sidebar
* CI cleanups
* updates from ad hoc review
* add loading and error states to suggestions
* remove unused import
* update header ui for panel editor
* restore back button to vizpicker
* fix e2e test
* fix e2e
* add i18n update
* use new util for setVisualization operation
* Apply suggestions from code review
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
* comments from review
* updates from review
* Suggestions: Add keyboard support
* fix selector for PluginVisualization.item
---------
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
* Docs: Add grafanactl term to glossary
* Edit to adapt to Glossary def length
* Fix
* Real fix
* Fix link
---------
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
* Sync nav_scope_path with url
* Let the current active scope remain if it is a child of the selected subscope
* Remove location updates based on nav_scope_path to maintain expanded folders
* Fix folder tests
* Remove console logs
* Better mock for changeScopes
* Update test to support the new calls
* Update test with function inputs
* Fix failinging test
* Add tests and add isEqual check for fetching new subscopes
* fix(table): add HTML title attribute to make truncated headings legible
* fix(table): avoid redundant display name calculation
Co-authored-by: Paul Marbach <paul.marbach@grafana.com>
---------
Co-authored-by: Paul Marbach <paul.marbach@grafana.com>
Docs: Update provisioning docs to reflect kubernetesDashboards defaults to true
The kubernetesDashboards feature toggle now defaults to true, so users
don't need to explicitly enable it in their configuration. Updated
documentation and UI to reflect this:
- Removed kubernetesDashboards from configuration examples
- Added notes explaining it's enabled by default
- Clarified that users only need to take action if they've explicitly
disabled it
- Kept validation checks to catch explicit disables
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
* Dashboard: Make variables selectable in controls menu and improve spacing
- Add selection support for variables in controls menu (onPointerDown handler and selection classes)
- Add padding to variables and annotations in controls menu (theme.spacing(1))
- Reduce menu container padding from 1.5 to 1
- Remove margins between menu items
* fix: remove unused imports in DashboardControlsMenu
fix: update variable set state when variable hide property changes
When changing a variable's positioning to show in controls menu using the edit side pane, the state of dashboardControls does not immediately update. This makes it seem to the user that nothing was changed.
The issue was that when a variable's hide property changes, only the variable's state was updated, but not the parent SceneVariableSet state. Components that subscribe to the variable set state (like useDashboardControls) didn't detect the change because the variables array reference remained the same.
This fix updates the parent SceneVariableSet state when a variable's hide property changes, ensuring components that subscribe to the variable set will re-render immediately.
Co-authored-by: grafakus <marc.mignonsin@grafana.com>
* Fix the conversion shallowed error and normalize the conversion status
* Add unit tests to ensure all permutations data loss detection
* Fix counting issue
* Sparkline: Prevent infinite loop when rendering a sparkline with a single value
* some tests for this case
* refactor out utils, experiment with getting highlightIndex working
* add comments throughout for #112977
* remove unused import
* Update Sparkline.test.tsx
* fix points mode rendering
* Sparkline: Improve min/max logic to avoid issues for very narrow deltas
* spread all config
* defaults deep
* delete unused import
* remove go.work.sum delta
* line break at end of file
* Sparkline: Prevent infinite loop when rendering a sparkline with a single value
* some tests for this case
* refactor out utils, experiment with getting highlightIndex working
* add comments throughout for #112977
* remove unused import
* Update Sparkline.test.tsx
* fix points mode rendering
* feat: legacy ListIterator with batches
* chore: address code review
* chore: remove nil check in nextBatch
* chore: move close before count check
* chore: add err field to batchingIterator for its own errors
* chore: remove unused import
* fix: use dsIndexProvider cache on migrations
* chore: use same comment as before
* feat: org-aware TTL cache for schemaversion migration and warmup for single tenant
* chore: use LRU cache
* chore: change DefaultCacheTTL to 1 minute
* chore: address copilot reviews
* chore: use expirable cache
* chore: remove unused import
* Logs: Rename attributes field
* LogLine: emphasize log line body
* LogLine: improve light mode
* Lint
* Update tests
* Only override colors if displayed fields are used
* Fix small font size ignored with displayed fields
* Fix types
* Short Links: Change default expiration to never expire (-1)
Previously, short links defaulted to expiring after 7 days. This change
updates the default to -1 (never expire) to prevent automatic deletion
of shared dashboard links.
Changes:
- conf/defaults.ini: Set expire_time = -1 and update comment
- conf/sample.ini: Set expire_time = -1 and update comment
- pkg/setting/setting.go: Update MustInt default from 7 to -1
The cleanup logic already handles -1 correctly (only runs when > 0),
so no changes needed there.
This unblocks progress on short URL feature improvements by ensuring
shared links remain accessible indefinitely by default.
* fix go
* update docs / comments
* update missed comment in sample.ini
* Revert "fix go"
This reverts commit e0d099ae31.
* chore: update workspace dependencies
Run 'make update-workspace' to sync Go workspace dependencies.
This updates go.mod and go.sum files to match the current workspace state.
* chore: add modowner for apps/quotas dependency
Assign @grafana/grafana-search-and-storage as owner for apps/quotas
dependency to satisfy modowners CI check.
* initial generation
* went through doc to add new resource
* added dummy kind so grafana will run
* added dummy handler and custom route
* fix app name
* gets custom route working - still a dummy route
* adds groupOverride to manifest
* adds quotas to grpc client and server
* WIP - trying to get api recognized - not working
* Gets route working
* fixes group and resource vars
* expects group and resource as separate params
* set content-type header on response
* removes Quotas kind and regens
* Update grafana-app-sdk to v0.48.5
* Update codegen
* updates manifest
* formatting
* updates grafana-app-sdk version to 0.48.5
* regen ResourceClient mocks
* adds tests
* remove commented code
* uncomment go mod tidy
* fix tests and make update workspace
* adds quotas app to codeowners
* formatting
* make gen-apps
* deletes temp file
* fix generated folder code
* make gofmt
* make gen-go
* make update-workspace
* add COPY apps/quotas to Dockerfile
* fix test mock
* fixes undefined NewFolderStatus()
* make gen-apps, and add func for NewFolderStatus
* make gen-apps again
* make update-workspace
* regen folder_object_gen.go
* gofmt
* fix linting
* apps/folder make update-workspace
* make gen-apps
* make gen-apps
* fixes enterprise_imports.go
* go get testcontainers
* adds feature toggle
* make update-workspace
* fix go mod
* fix another client mock
---------
Co-authored-by: Steve Simpson <steve@grafana.com>
* Resolve path directly from leaf node
* Add childrenLoaded field
* Add tests and remove parentNodeId from changeScopes
* Move parentNodeId patameter order
* Resotre call order
* Undo superflous change
* Add comments
* Make sure childrenLoaded state is properly set default to false
* Reference parent path
* Look for parent in state and fetch scopeNode if it is not avilable
* Check for undefined
* Add mock to test
* Set scopeNodeId with recent scopes
* Improve test selector
* Add scope node endpoint to mocks
* Never set childrenLoaded to true when inserting
* Remove unused import
* Pass on the already set childrenLoaded value
* Fix test
* Reapply "K8s: read resource configs from API Enablement for API Builders" (#114475)
This reverts commit 4130bd9cd3.
* revert part that broke things
* FF service changes are gonna come later
* MTFF: allow viewers access to MTFF by enforcing runtime_config for custom routes
* unused var
* removed now
* pass the test, include defaults
* revert sample.ini change
* add legacy search (wip)
* fix search field name
* implement team search endpoint
* generate openapi spec
* generate endpoints for frontend
* minor fixes
* fix issues found while testing
* add more fields to search result
* add basic unit tests
* add more unit tests
* improve getColumns() func in legacy search
* configure search endpoint in team.cue
* add team search handler
* add the searchTeams endpoint to manifest.cue
* make gofmt
* update openapi spec
* generate frontend endpoints
* remove unused field
* move fields defiitions to separate builder
* fix legacy search
* fix unit tests
* fix unit test
* address feedback
* fix unit test
* update openapi specs
* yarn generate-apis
* add missing unit tests
* Reapply "K8s: read resource configs from API Enablement for API Builders" (#114475)
This reverts commit 4130bd9cd3.
* revert part that broke things
* FF service changes are gonna come later
* feat: add options to render under the controls menu
* fix: filter out hidden annotation layers from the dashboard-controls menu
* fix: adjust spacing between annotation controls in the dashboard-controls menu
* fix: e2e test for variables
* feat: move the menu button next to the variables
* fix: remove duplicate link controls
* fix: show dashboard controls when the dashboard is not saved
* fix(dashboard): prevent memory leak in CUE validation by using fresh contexts
Fixes#114344
The CUE validation was reusing a single cue.Context across all
validations, which caused unbounded memory growth due to CUE's internal
caching of intermediate computation results (disjunctions, unifications,
etc.).
Root Cause:
- A single cue.Context was created and reused via getValidator()
- Each validation added entries to the context's internal caches
- These caches grew unboundedly over time
- Memory could not be garbage collected because the context held references
Solution:
- Store the schema source string instead of a compiled cue.Value
- Create a fresh cuecontext.New() for each validation
- This allows the context and its caches to be garbage collected after
each validation completes
Performance Impact:
- ~2x slower due to schema recompilation per validation
- Acceptable trade-off to prevent memory leaks
- Memory usage stays bounded instead of growing unboundedly
* fix(dashboard): use periodic context recreation to prevent CUE memory leaks
Replace fresh context creation with periodic context recreation approach.
The context is reused for up to 100 validations, then recreated to allow
garbage collection of cached values while maintaining good performance.
This balances performance (only 19% slower than leaky approach) with memory
safety (stable at ~5 MB vs ~2 GB leak).
See https://github.com/grafana/grafana/issues/114344#issuecomment-3605562491
* refactor(cuevalidator): simplify to use mutex instead of atomic counter
Since CUE is not thread-safe, we need the mutex for the entire validation
operation anyway. Using a regular int counter protected by the mutex is
simpler and cleaner than using atomic operations.
* Add K8s API redirect for GET resource permissions
* wire
* move restconfig to options
* address comments
* fix helper after adding RestConfigProvider
* Revert K8s redirect changes for service accounts, teams, and receivers
Keep only dashboard and folder redirect functionality for this PR.
Service accounts, teams, and receivers will be handled in a separate PR.
* address comments
* lint
* unified-storage: create resource_events table and add key_path column to resource_history
* Update resource_history_insert template
* update test snapshots
* use latin encoding for key_path and bump size to 2048
Implements the /notification/query endpoint on the historian app. Note that it
does not apply any RBAC right now, that will be a follow up commit.
We have to use a go-kit logger in grafana/alerting, so an adapter is needed.
Going from go-kit to slog is a bit hairy but works well enough.
* Reapply "v1 to v2 conversion: Fix issue when Grafana datasource wouldn't be resolved correctly (#114555)"
This reverts commit db9cff8e2d.
* Update input and fix the failing test
* Update docs
* Remove 406 response since now it is converted
* fix linter
---------
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
* update documentation to mention protected fields
* alerting docs: add protected field info for grafana cloud
add protected field info for grafana cloud
* prettier
* link fix
---------
Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
* OnGoing
comment
* WIP on the wrapper
* Get before Delete
* WIP: add an unimplemented storage authorizer
* WIP implementing the resource permission authorize
* Implement beforeCreate
* Create, Delete, Update
* List
* Use a resource permissions wrapper
* Switch the main authorizer to service
* Add namespace
* Use compile for list
* Comment
* Remove unecessary comments
* fix bug with folder permissions
* Implement tests for List
* Test get
* List test small refactor
* Delete test
* Reorganize code
* imports
* Start splitting the tests
* test AfterDelete
* actually test beforeWrite
* Implement tests for wrapper create
* Test delete
* Test List and Get
* Fix List
* Remaining tests
* simplify
* Remove comments
* Reorder
* Change authorizer to allow access
[App Platform] Use the app-sdk's apiserver.KubernetesGenericAPIServer in the serverWrapper to ensure that any extra logic for handling WebServices is used.
* Update validation regex for symbol requirement
Fixes#114544
frontend: accept underscore as valid symbol in password validation
* test: add underscore symbol test for strong password policy
* chore(changelog): add changelog for #114571
* Delete changelog/114571.md
* fix: correct indentation in password test
* chore(workflows): skip OIDC steps for fork PRs
* chore(workflows): pass fork status to reusable workflow
* revert: remove workflow changes for fork detection
* revert: remove fork status parameter from workflow caller
* Fix formatting issues in PR patch check workflow
---------
Co-authored-by: Mihaly Gyongyosi <mgyongyosi@users.noreply.github.com>
* Alerting: Add expression type to webhook valueString
- Add Type field to NumberValueCapture struct
- Implement AlertQuery.GetExpressionType() method
- Update valueString format to include type information
* Alerting: Add expression type to webhook valueString
- Fix tests
* Alerting: Add expression type to webhook valueString
- Update default annotations in notifier templates to include type field
* Alerting: Add expression type to webhook valueString
- Add type='math' to webhook and email test expectations
* Suggestions: hashes on suggestions, update logic to select first suggestion
* fix types
* Suggestions: New UI style updates
* update some styles
* getting styles just right
* remove grouping when not on flag
* adjust minimum width for sidebar
* CI cleanups
* updates from ad hoc review
* add loading and error states to suggestions
* remove unused import
* update header ui for panel editor
* restore back button to vizpicker
* fix e2e test
* fix e2e
* add i18n update
* use new util for setVisualization operation
* Apply suggestions from code review
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
* comments from review
* updates from review
---------
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
* run annotation data migration in batches
* how could i miss it
* run in the background, starting from newest annotations
* update tests
* optionally pass batch size via env
* feat(provisioning): add generic version handling for dashboard export
- Update export job to handle any dashboard version generically (v0, v1, v2, v3, etc.)
- Dynamically construct GroupVersionResource for any stored version
- Cache version-specific clients for efficiency
- Add comprehensive table-driven unit tests for multiple versions
- Add integration test to verify version handling end-to-end
- Remove unnecessary version shim from clean operation (deletion works by name)
* test: add unit test for v2 dashboard version (no suffix)
* fix: add missing transformation for scenes -> save model v2
* fix: link placement transformation on the backend between schemas
* fix: update the openapi spec in the tests
* tes: add tests for `transformSceneToSaveModelSchemaV2`
* tests: extend conversion_test.go to cover link placements
Tests: Fix RuleEditorCloudRules test flakiness in CI
Mock the labels plugin as not installed to ensure consistent test behavior
across OSS and Enterprise environments. The labels plugin detection was
causing different API calls to be made in CI vs local, leading to snapshot
mismatches.
This test is focused on cloud rule creation, not label plugin functionality,
so explicitly disabling the plugin ensures the test remains stable.
* Suggestions: Deprecate previous API, enable external plugin suggestions behind flag
* fix types for deprecated builder
* restore some support for cloud-onboarding
* add support for cloud-onboarding usage, add test to ensure it keeps working
* refactor to not hardcode on 'core:'
* remove unused import
* Alerting: Notification history query API.
First cut at defining a namespace scoped route on the historian.alerting app
to query notification history.
* Address review comments
Change "Service Center" to "Service center" in navigation menu to follow
sentence case capitalization style consistently across the application.
Fixesgrafana/slo#3818🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
* annotation legacy store with api server, read only
* annotations are not addressable by ID for read operations
* add ownership for an app
* typo, of course
* fix go workspace
* update workspace
* copy annotation app in dockerfile
* experimenting with store interface
* finalising interfaces
* add tags as custom handler
* implement tags handler
* add missing config file
* mute linter
* update generated files
* update workspace
* add viridis and others, allow passing interpolator directly to FieldColorSchemeMode
* fix bug
* be more defensive when getting the fieldcolor
* backend changes
* add d3-scale-chromatic to list of esModules
* have dashboard links on the right side
* Lets try a compromise (#114389)
Try to compromise on white space. Having a lot of links will create unessecary empty space under the time controls, but it is necessary if we want to be able to have the links on the right
---------
Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com>
Co-authored-by: Sergej-Vlasov <sergej.s.vlasov@gmail.com>
* refactor ColorPicker to functional components
* don't need memo for these components
* convert CustomHeadersSettings to a functional component
* ignore Legacy form components
* ignore legacy forms in some lint rules
* convert JSONFormatter to a functional component
* convert WrapperWithState to a functional component
* convert StatsPicker to a functional component
* convert PopoverController to a functional component
* convert UnitPicker to a functional component
* fix linting
* fix flaky dashboardcontrolsmenu test
We have two historians in alerting - alert state and notification. The intention
of this app is to provide query capabilities for both.
In this initial commit, the existing /history API is simply cloned to the new
app. It is identical except that it will send Kubernetes-style error responses
instead of Grafana-style.
This approach was taken to implement the new app more iteratively - ideally we
would define a new API, but this requires quite a significant overhaul of the
backend code.
* Zanzana: Use team bindings write APIs on the client side
* fix linter
* remove unused code
* Apply suggestions from code review
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
* fix syntax
---------
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
* use exponential backoff in notifier
* Enhance BadgerDB configuration in REST options with memory table size and number of memtables
* Enhance BadgerDB configuration in REST options by adding value threshold for LSM vs value log storage
* first pass of adding quotas service resource server
* passes prom reg as param
init quota service as part of server params
* init quota service as part of server params
* adds config and only creates quota service when overrides file path is defined
* when quota service enabled, check quota on create and log result
* update log message
* adds tests for quota service
* adds tests for config reloading when the file changes
* fix linter errors
* fix comment
* use startAndAwaitRunning
* Simplifies quotas service. Call manager.GetConfig() when getting quota instead of watching for changes.
* adds tracing to quotas service
* adds nsr attributes to traces when getting quotas and resource stats
* update comment
* update comment
remove check for nil overrides since it will (should) never happen
* fix linter error
* refactors naming to overrides service
checks quotas in separate function
* fix quotas naming
* fixes more quotas -> overrides naming
* use logger from ctx
* linter - remove trailing whitespace
* log FromContext() when checking quotas
* adds events to spans instead of create new spans
updates tenant -> namespace naming
few other minor fixes
* SchemaV2: Convertion from v1beta1 to v2beta1
* Compare backend-frontend v1 convertion
* Compare backend-frontend v1 convertion
* Fix fe be diff
* Resolve DS issues
* Fix ds inconsistecnies
* fix legacy string value issues
* fix ds test
* fix layout issue
* update test
* Fix tests and issue with defaultConfig
* Update output
* Fix viz config convertion
* wip
* Fix v1 to v2 dashboard transformation differences
Major fixes implemented:
- Backend function names in conversion.go
- Backend group field logic for queries, annotations, and vizConfig
- Backend datasource resolution with map-based lookup
- Backend timezone handling (empty string vs browser)
- Backend annotation processing (empty array vs default annotation)
- Backend default values (editable, liveNow)
- Backend variable processing (definition, defaultKeys, refresh, refId)
- Backend panel layout (y position calculations)
- Backend VizConfig (Kind and Group fields, default values)
- Frontend snapshot issue (annotations not processing)
- Frontend datasource references (only when original has valid datasource)
Test results:
- annotation-conversions: PASSING (0 differences)
- dashboard-properties: 3 expected architectural differences
- panel-conversions: Multiple expected architectural differences
- variable-conversions: 7 expected architectural differences
All remaining differences are expected architectural choices between
backend persistence optimization and frontend UI consumption optimization.
* fix issues with panel and annotation queries with no datasource
* definition and regex
* Use proper v1beta1 resource when testing
* remove misc file
* fix ds provider test
* fix def ds test in response transformer
* fix remaining ResponseTransformers test
* timesettings, variable refresh, editable, liveNow, definition
* fix transformSceneToSaveModelSchemaV2 test
* revert legacyRow changes
* fix go lint issues
* normalize y coordinates when serializing a row
* clean up
* update tests
* use GetStringValue from schemaversion
* fix go lint - cyclomatic complexity
* update open api snapshot
* add migrated dashboards
* fix default panel type when panel type is not provided
* revert dash link changes for now
* fix
* fix nested panel issue and default ref in v1
* apply defaults to nested panels too
* update snapshots
* fix issues with annotations
* matchers, showLegend, annotations
* when converting also don't process queries that have only a refId
* fix issues with text var
* fix dash links
* default to collapse: false when serializing
* fix: filter refId from variable query specs in backend migration
- Add buildDataQueryKindForVariable function to filter refId for variables
- Remove default refId "A" in transformSingleQuery
- Only include __legacyStringValue for non-empty string queries
- Remove refId addition in transformSaveModelSchemaV2ToScene.getDataQueryForVariable
- Handle undefined queries gracefully in frontend and backend
- Ensure backend matches frontend behavior for query variable serialization
* fix: default variable refresh to 'never' to match frontend behavior
Change backend default for missing refresh field from 'onDashboardLoad'
to 'never' to match frontend defaultVariableRefresh() schema default
* fix: only include iconColor in annotations when it exists
- Frontend: Use defaultAnnotationQuerySpec().iconColor as fallback to match schema defaults
- Backend: Only set iconColor if it exists in v1 input (not using GetStringValue)
- Ensures iconColor is only included when present in original dashboard
* fix: use schema defaults for annotation enable, hide, and iconColor
- Use defaultAnnotationQuerySpec() to get schema defaults instead of hardcoded values
- Default enable to false (schema default) to match frontend behavior
- Use schema default for iconColor and hide fields
- Ensures consistency with frontend which uses defaultAnnotationQuerySpec() defaults
* fix: set collapse for hidden-header rows to match first explicit row
- When panels appear before the first explicit row, the hidden-header row's
collapse should match the first explicit row's collapsed value
- Matches frontend behavior where collapse: panel.collapsed uses the next
row panel's collapsed value
- Ensures consistency between frontend and backend when converting rows layout
* fix: handle constant variables with missing query value
- Frontend: Fix bug where undefined value was converted to string 'undefined'
- Now defaults to empty string when value is undefined: value ? String(value) : ''
- Backend: Match frontend fix - default to empty string for text/value when query is missing
- Ensures consistency when constant variable query is missing from v1 dashboard
* Fix interval variable handling when query is missing
- Extract intervals from options when query is missing/empty (matches backend behavior)
- Handle undefined/null query in getIntervalsFromQueryString
- Handle missing current object/value in getCurrentValueForOldIntervalModel
- Update interval variable refresh to use literal 'onTimeRangeChanged' in schema
- Use defaultIntervalVariableSpec() for interval variable serialization
- Backend: Generate query string from options when query is missing
* Fix corrupted dashboard with systemRef override
* don't resolve types for template variables in datasource refs on the backend
* fix annotation and ds issues
* fix range and special mappings
* fix datasource var pluginId and regex
* add __systemRef to schema
* update v15 migration annotation to have a ds type because v2 keeps track of if type is in the initial save model, and if it's not it removes it, but for frontendOuput we are running transformSaveModelToScene which will then assign the type
* add migration fields since the backend applies automigrations in collapsed rows
* filter out queries in ResponseTransformer that only have refId field
* lint
* v2: add default query if queries are empty to match v1 behavior
* fix single migration test
* tracking test should have a defined spec otherwise datasource is removed and won't be tracked
* initialize default with default ds ref
* wip
* Do not assign DS if ds group is empty
* cleanup
* revert change in setupTests.ts
* clean up TODO
* query with only refId should not expect to have a group
* refactor: extract v0alpha1 to v1beta1 conversion logic into atomic function
- Extract ConvertDashboard_V0_to_V1beta1 into v0alpha1_to_v1beta1.go
- Extract prepareV0ConversionContext and migrateV0Dashboard helper functions
- Standardize v0.go to match v1.go pattern with inline multi-step conversions
- Implement Convert_V0_to_V2alpha1 using atomic functions (v0->v1beta1->v2alpha1)
- Implement Convert_V0_to_V2beta1 using atomic functions (v0->v1beta1->v2alpha1->v2beta1)
- Remove non-atomic v0alpha1_to_v2alpha1.go file
* test: add version-specific test files for conversion error handling
- Extract v0 conversion tests into v0_test.go
- Extract v1 conversion tests into v1_test.go
- Add v2 conversion tests in v2_test.go
- Ensure all error handling paths in conversion functions are covered
- Add tests for Convert_V0_to_V2alpha1 and Convert_V0_to_V2beta1 error paths
- Add tests for Convert_V1beta1_to_V2alpha1 and Convert_V1beta1_to_V2beta1 error paths
- Add tests for Convert_V2alpha1_to_V2beta1 error handling
* Fix tests
* Fix linter
* Clean up
* feat(dashboard): Add automatic data loss detection for dashboard conversions
Implements comprehensive data loss detection for all dashboard API version conversions.
Components Tracked:
• Panels (visualization + library panels)
• Queries (data source queries, excludes row panel queries)
• Annotations
• Links
• Variables (template variables)
Features:
• Automatic detection via withConversionMetrics wrapper (zero code changes)
• Error type: 'conversion_data_loss_error'
• Logs: panelsLost, queriesLost, annotationsLost, linksLost, variablesLost
Bugs Found:
• Fixed critical bug: metrics.go was silently swallowing ALL errors (return nil → return err)
Testing:
• TestDataLossDetectionOnAllInputFiles - runs all conversions with detailed logging
• V2→V0/V1 downgrades write output for debugging then skip (not yet implemented)
• All tests passing
* Run dashboards on schema v2 E2Es
* reveret unintended changes
* cleanup
* Reset active manager correctly according to toggles config
* Fix new dashboard being serialized as v1
* Rename toggle
---------
Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
* Provisioning: Unify resources and files view
* Use interactive table
* Add tests
* Show status
* Omit root
* Fix status
* Fix link
* Tab spacing
* Cleanup
* Move funciton outside
* Add source link
* Hide source link for unsynced files
* Show folders sync status
* refactor
* Fix sync folder logic
* refactor
* fix unsynced files type
* Show external source link
* tweaks
* SHow pending for unsynced files
- Remove references to, and related private functions for, `updateNode` and `expandOrFilter`
- Remove obsolete tests
- Update all usages of `updateNode` to `filterNode`
- Integrate `expandOrFilter` functionality into `filterNode`
- Add profiler to `filterNode`
- Add `.claude` to `.gitignore` IDE junk section
- Unit tests for `toggleExpandedNode` and `filterNode`
- Add profiler to `toggleExpandedNode`
Fixes: https://github.com/grafana/grafana-operator-experience-squad/issues/1566
* provisioning: acquire server lock before provisioning dashboards+folders
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
---------
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Suggestions: Convert panels to use function supplier
* rework deaggregation
* BarGauge
* cleanup and make consistent the deaggregation in suggestions
* Candlestick
* Implement timeseries and clean up some things that can already be deleted
* spotted some typos in self-review
* restore PanelDataSummary deprecated fields, we wont delete till Grafana 13
* change deprecation message
* remove some unused imports
* run prettier
* update radialbar defaults logic
* update tests and logic to DRY up the reduceOptions a bit and more thoroughly test the output
* Trend: Improve suggestions
* updates from review
* add unique DataFrameType list to PanelDataSummary
* add histogram suggestions
* rework panelDataSummary to be a class, change some things
* further boil down PanelDataSummary
* Improve FlameGgraph suggestions
* geomap and other defaults
* reorder the single frame with string and number test
* Moving things around
* Update frontend to support CUA
* Add CUA support to backend
* Copy parseURL function to where it's used
* Update test
* Remove experimental-strip-types
* Docs
* A bit more of a refactor to reduce complexity
* Revert "Remove experimental-strip-types"
This reverts commit 70fbc1c0cd.
* Review
* Docs updates
* Another docs fix
* Logs: store sort order in the URL
* ToolbarExtensionPoint: pass sort order to extension
* Logs: send sort order in links
* ToolbarExtensionPoint: pass panelState instead of sortOrder
* Update test
* Remove condition
* Logs: initialize sort order and remove unnecessary check
* Set navigationScope if we have a subScope
* Proper URL sync
* Update unit test with dashboards service subscription handling
* Add a bunch of tests
* Update functionality to change scopes when clicking on icon
* Add test for TreeFolderItem
* Udpate test and remove errors
* Fix issues in test
* Use ScopeNavgiations by default in the ScopesDashboardService unit tests
* Remove misplaced test
Fix search for existing provisioned dashboards in modes 3+
The search query was not requesting the dashboard's "legacy ID". As a result,
the provisioning process would not find existing provisioned dashboards, making
copies of these dashboards every time there was a change in the provisioned
dashboard's definition.
* add retries to the setup enterprise action
* add fail pipeline after the last retry
* fix a dyslectic typo
* fix syntax errors in the script
* fix syntax errors in the script and the issue detected by zizmor
* cd to grafana enterprise dir
* update the go ws
Part 2 of adding version messages to the `alert_rule_version` able. This allows
setting the message via a header when using the Prometheus conversion API,
which can be useful for e.g. linking changes back to source control.
* newVizSuggestions feature toggle
* panel empty state
* add data check
* select first suggestion
* update text
* PanelEmptyState component
* add test
* ?
* remove fake translation
* Visualizations -> All visualizations
* updates
* move empty state to UnconfiguredPanel
* default tab to Suggestions; new tabs and content
* select first suggestion; apply button; removed search functionaility from suggestions
* extract hasData
* refactor
* cleanup
* fix default selection
* translation
* hasData test
* update e2e
* fix width of suggestions tabs
* make sure we only show a max of two columns
* useMeasure with a static gridTemplateColumns def
* Suggestions: hashes on suggestions, update logic to select first suggestion
* reorganize comments a little bit
* fix types
* add tests for hashes
---------
Co-authored-by: Paul Marbach <paul.marbach@grafana.com>
* bump i18next-cli to latest
* make it 1.24.22 while we're here
* Update extracted phrases after i18n-extract update
* yarn dedupe
---------
Co-authored-by: joshhunt <josh.hunt@grafana.com>
* fix: collate rule_group column as utf8mb4_bin
This ensures this column is sorted identically by the database and
golang, which should eliminate issues related to a mismatch in sort
order.
* chore: make test stricter
* fix: also add binary collation for postgres
* feat: add plugin extension point to SingleTopBar for setup guide integration
* feat: add plugin extension point for grafana-setupguide-app in MegaMenu
* feat: add TopBarExtensionPoint for grafana-setupguide-app integration
* feat: add MegaMenuExtensionPoint for grafana-setupguide-app integration
* feat: simplify MegaMenu and TopBar extension points by removing unused context checks
* feat: add MegaMenuAction and SingleTopBarAction to PluginExtensionPoints
* refactor: simplify return statement in MegaMenu and TopBar extension points
* feat: update extension point IDs in MegaMenu and TopBar components to use PluginExtensionPoints
* implement alerting for v2 schema
* clean up
* clarify
* add support for library panels
* comment
* include missing library panel when v1 returns v2; cleanup
* Use type union
* remove unneccesary check
* add AlertStatesDataLayer so that alert state is displayed next to panel title
* fix test
* cleanup undefined
To better observe and identify performance bottlenecks in the prometheus rules API.
The following spans were added:
- `api.prometheus.RouteGetRuleStatuses`
- `api.prometheus.PrepareRuleGroupStatusesV2`
The `api.prometheus.PrepareRuleGroupStatusesV2` includes attributes to capture the parameters used in the request to help with debugging and performance analysis.
* Deprecating features.IsEnabled
* add one more nolint
* add one more nolint
* Give better hints to devs in the deprecation message of IsEnabledGlobally
* adding more doc strings
* fix linter after rebase
* Extend deprecation message
* Unified Storage: allow rebuilding indexes for resource from a new grpc endpoint
* remove log line
* fix trace def
* lint
* fix after rebase
* addressing code review changes
* update with one channel per rebuild request
* other review suggestions
* update with review suggestions
* run mockery generate for MockResourceClient
* update tests
* update tests and lint
* fix test
* Secrets manager: create secure value using the active keeper
* SecureValueService.Update: fetch secure value from db to get the keeper
* fix keeper_store_test.go
* SecureValueService: fix bug in update where the current version keeper wasn't being passed to the createNewVersion method
* make gofmt
* remove outdated test
* update TestModel
* undo enterprise_imports changes
* use xkube.Namespace
* migrator: set secret_secure_value.keeper to 'system' when the column is null
* indent cue
* fix tests
* fix enterprise imports
* properly fix enterprise imports
* make update-workspace
* go mod tidy
---------
Co-authored-by: Matheus Macabu <macabu.matheus@gmail.com>
* refactor: extract logic
* directly use the setting.cfg in the middleware
* more granular config handling, per section
* fixed unit test
* refactor code to avoid lint error
* Add library panel repeat options to v2 schema during conversion
* use any instead of interface{}
* change to common.Unstructured instead of byte[] for model field
* Fix the tests and let the library panel behavior fetch repeat options in public and scripted dashboards
* fix library panel differences between backend and frontend conversion
* feat(toggle): new feature toggle for time range zoom keyboard shortcuts
* feat(keyboard-shortcuts): handle `t +` and `t -` key combinations
* test(keyboard-shortcuts): validate time range zoom with `t +`, and `t -`
* chore(i18n): update keyboard shortcut translations
* refactor(time-range): no-op when timespan is zero instead of defaulting
* Timeseries: More nuanced editing of linear threshold to avoid crashes
* remove useEffect import
* remove unused import
* update error and invalid field handling to call out error case
* `grafana-iam`: Use the UniStore as the default store
* Refactor all instantiations
* Remove enableDualWriter
* Nit. dw is clear enough
* Use the correct access control client
* feat: add retry logic for transient errors in Kubernetes client
Add retry wrapper for dynamic.ResourceInterface that automatically retries
transient errors using Kubernetes' wait.ExponentialBackoff utility.
- Implements retry logic with exponential backoff for all Kubernetes API operations
- Detects transient errors: ServiceUnavailable, ServerTimeout, TooManyRequests,
InternalError, Timeout, and network errors
- Uses wait.ExponentialBackoff from k8s.io/apimachinery/pkg/util/wait
- Respects context cancellation
- Includes comprehensive unit tests
Part of https://github.com/grafana/git-ui-sync-project/issues/634
* docs: add detailed documentation for defaultRetryBackoff
Document when retry attempts will happen, what errors trigger retries,
and the retry behavior (attempts, delays, exponential backoff, jitter).
* feat: add logging and increase retry attempts for Kubernetes client
- Add context logger to track retry attempts (Info for retries, Warn for exhaustion)
- Increase retry attempts from 5 to 8 steps (~10 seconds total retry window)
- Document when all retry attempts will fail:
* API server completely unavailable/unreachable
* Network connectivity issues persist beyond retry window
* Consistent transient errors for entire retry duration
* Context cancellation before retries complete
* chore: update retry client documentation
* fix: resolve linting issues in retry client
- Replace type assertions with errors.As for wrapped errors
- Remove deprecated Temporary() check (deprecated since Go 1.18)
- Update tests to remove temporary error test case
* fix: resolve staticcheck S1008 linting issue in retry_client.go
Simplify return statement to use errors.As directly instead of if-return pattern
* chore(deps): update nanogit to v0.3.0 in go.mod and go.sum files
* Add retry logic for nanogit client operations
- Configure retry logic in withGitContext to ensure all Git operations have retry support
- Use nanogit's ExponentialBackoffRetrier with 8 attempts (~10s retry window)
- Retry transient network errors and HTTP-specific server errors (5xx for GET/DELETE, 429 for all)
- Rename logger function to withGitContext to better reflect its responsibilities
* fix: resolve staticcheck S1008 linting issue in retry_client.go
Simplify return statement to use errors.As directly instead of if-return pattern
* Revert "fix: resolve staticcheck S1008 linting issue in retry_client.go"
This reverts commit bd367b5629.
* Prometheus: Hide 'Kick start your query' button for existing queries
* refactor: simplify query check logic in Prometheus editor
Remove unnecessary useMemo and buildVisualQueryFromString logic.
Just check query.expr directly to determine button visibility.
* fix: format code with prettier
* do not create sa with no expiration when day limit is set
* disable No expiration option if day limit is set
* make i18n-extract
* run prettier
* address feedback
* initial wip
* fixes
* Switching to context
* New button design
* Overflow ellipsis
* Changes to button
* initial resize work
* resize progress
* Update
* no reszier in tabs mode
* fixing text truncte, and tabs right position
* Minor story tweaks
* added unit test
* added unit test
* Minor change
* minor story fix
* Fixes
* Moving things around
* Copy parseURL function to where it's used
* Update test
* Remove experimental-strip-types
* Revert "Remove experimental-strip-types"
This reverts commit 70fbc1c0cd.
* Trigger build
This adds a `message` column to the `alert_rule_version` table. This follows the
pattern established for dashboards as closely as possible. A new type is
introduced internally for passing the new `message` field around in a type-safe
manner, but doing the same for the API types becomes very messy. In that case, a
new field is added with omitempty.
Note this PR is only:
- The column addition
- The "read" path; API for listing versions
Subsequent PRs will add code to actually set the message when updating rules.
* Add getDefaultExpressions tests
* Fix expression queries when building form values from a panel
* make query params empty and add some better types
* update snapshots
* fix tests
* Revert devenv changes
* update shapshot
---------
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
* chore: bump authlib/types to v0.0.0-20251119142549-be091cf2f4d4
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Update Go Workspace
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Stop supporting deprecated namespace format in TestExtendedJWT_Authenticate
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Update go mod
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
---------
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Chore: Add html_handler_requests metric for tracking requests handled by index.go
* make a member of HttpServer
* make it a histogram instead
* update test
* OAuth: Optionally make refresh tokens required if use_refresh_token is enabled
* make linter happy
* feedback: log missing refresh token during token refresh
* feedback: tweak wording in the message & change level
* Plugins: add card extension to nav-landing-page
* feat(nav-landing-page): update card extension to include category and onClick support
* feat(NavLandingPage): add setPluginLinksHook to test setup
* feat(NavLandingPageCard): refactor className handling using cx for better style management
* feat(NavLandingPage): update card extension targets to use plural form for consistency
* feat(NavLandingPage): add warning for mutually exclusive extension points
* remove feature toggle dataplaneFrontendFallback because GA
* remove feature toggle logic
* fix import
* fix toggle ownership from merging main
* merge main
* fix extra feature toggle
* Rework UI of SQL Transformation card
I made a few changes:
- Green - to indicate that this is DIFFERENT from the other transforms, not similar
- Command prompt, not a preview of the table input and output - to indicate that
- you code this yourself, and
- the output table format is not predictable - it's entirely outside of our control
I updated the card title to "Transform with SQL" because I felt this was more
indicative of what the user will be doing. It's a call to action.
* Reverse the change to the illustration
The changes to the illustration aren't ready yet,
As per PR feedback in comment: https://github.com/grafana/grafana/pull/114093#issuecomment-3547943167
* Update tests and code with new header text
* convert LoginCtrl to a functional component
* convert NumberInput to a functional component
* convert StringArrayEditor to a functional component
* convert TeamPicker to a functional component
* convert AddToOrgModal to a functional component
* don't set noMargin yet
* convert UserProfile to a functional component
* convert AnnotationFieldMapper to a functional component
* convert PanelHeaderCorner to a functional component
* convert ShareExport to a functional component
* convert ShareLink to a functional component
* convert RawPrometheusContainer to a functional component
* Alerting: Fix for fetching evaluation group in new filter
* WIP: Add async evaluation groups dropdown with 500 group limit
* Add text to query param if threshold limit reached
* update translations, remove group info tooltip
* resolve PR comment
* passes nsr to GetResourceStats instead of just namespace
* removes ns check
* fixes failing tests
* make update-workspace
* pass group and resource from rebuild request when getting resource stats
* Suggestions: Update ownership of core files and improve some types
* Suggestions: Proposed PanelPlugin API
* get rid of .useSuggestionsConfig
* update i18n
* iterate on TypeScript types, add example in radialbar
* tweak implementation, add commentary
* actually, suggestions really does not need panel defaults
* split suggestions handler into its own file and add tests for radialbar
* small comment revision
* fix test
* add ds.hasData check back for state-timeline
* restore a handful of comments that got lost in the merge shuffle
* more updated commnets
* remove pluginId from VisualizationSuggestion, whoops
* fix getAllSuggestions test
* update i18n
* might as well restore description here
* move fieldconfig back on radialbar
* call them suppliers, remove boolean return type in favor of internal util
* Update packages/grafana-data/src/panel/PanelPlugin.ts
* Update packages/grafana-data/src/panel/PanelPlugin.ts
* Update packages/grafana-data/src/panel/PanelPlugin.ts
* tweak return type for setSuggestionSupplier to be this
* wip
* wip
* wip
* wip
* wip
* wip
* removed array.from.
* using concat
* added more tests.
* renamed according to feedback.
* Update the getPluginExtensions to use the slice.
* fixed expect statements.
* Reverted the test app from the allow list.
* cleanded up tests.
* added generic tests for base functionality.
* removed unused iport.
* Tags can only be string array.
* Be more lenient when parsing dashboard. Parse what we can, don't error out easily.
* Check element before parsing, log unexpected types.
* Transformations: Add empty state placeholder with SQL expression and transformation cards
- Extract TransformationCard and SqlExpressionCard into separate reusable components
- Add new empty transformations placeholder UI behind transformationsEmptyPlaceholder feature toggle
- Add auto-scroll to SQL expression when navigating from transformations tab
- Add analytics tracking for transformation interactions
- Split EmptyTransformationsMessage into Legacy and New variants for easier toggle removal
* add tests
* Table: Clean up filter popover layout
* Table: Improve filter selection ux text
* remove unused ref
* update snapshot test
* whoops, we don't want to change the global input suffix padding
* Initial nested scope navigation
* Seperate sections for scope navigation vs groups
* Add ungrouped navigation items
* Create tree structure helper for mock scope navigations
* Improve generated folder structure and add link to change scope
* Update mocks
* DevEnv Navigations
* Remove mocks
* Update button position and add border
* Remove subScope from TreeLink
* Do unblocking async update
* Add loading state
* Allow '' for root groups
* Formatting
* Add unit and integration tests
* Update openapi spec
* Update tooltip for IconButton
* Update i18n
* Make code more DRY
* Update public/app/dev-utils.ts
* update folderUpdate type
* Remove isSubScope in facvor of checking subScopeName
* Do an early return
* Use subScopeName
* Remove use of isSubScope
* Prevent nested items with the same subScope
* Extract filder method to function
---------
Co-authored-by: Mariell Hoversholm <mariell@mardroemmar.dev>
* Remove addFieldFromCalculationStatFunctions feature toggle
The addFieldFromCalculationStatFunctions feature toggle was at GA stage
and enabled by default. This commit removes the toggle and makes the
cumulative and window functions permanently available in the add field
from calculation transformation.
Changes:
- Removed feature toggle definition from registry.go
- Updated CalculateFieldTransformerEditor to always include cumulative and window functions
- Removed unused config import
- Removed documentation entry
- Regenerated all generated files (toggles_gen.go, toggles_gen.csv, toggles_gen.json, featureToggles.gen.ts)
* fix merge conflicts
* Timeline: Add timeRangePan
* Add tests for state timeline
* Add tests for status history
* Fix state timeline test and use same dashboard
* Consolidate tests
* Optimize time range pan tests
* Create unit tests for communityDashboardHelper
* Add unit test for autoMapDatasources
* Create unit test for DashboardCard
* --wip-- [skip ci]
* Fix test
* fix linting
* Add unit test to the dashboardLibraryApi
* update codeowners for dashboard library code
* fix: improve test coverage and fix failing tests
- Fix image handling tests in DashboardCard to verify actual behavior
- Fix UID filtering test in autoMapDatasources to use correct mock data
- Add test for dimThumbnail prop
- Add test for undefined inputs edge case
- All 82 tests now passing
* render function modified
* merge with template dashboard modifications. tests modified
---------
Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
Co-authored-by: Juan Cabanas <juan.cabanas@grafana.com>
* Refactor rules filter to easily switch between frontend and backend filters
* Refactor getFilter functions to receive filters as an argument
* Move filter normalization to getFilter utils
* Transformers: Remove formatString feature toggle
The formatString feature toggle was in GA stage and enabled by default.
This change removes the feature toggle and makes the format string
transformer always available.
Changes:
- Remove formatString feature toggle definition from registry
- Remove conditional check in standardTransformers.ts
- Update feature toggle git log with deletion timestamp
- Regenerate feature toggle files
* fix lint errors
Remove groupToNestedTableTransformation feature toggle
The group to nested table transformation has reached GA and is now
enabled by default. This commit removes the feature toggle and makes
the transformation always available.
Changes:
- Removed feature toggle definition from registry.go
- Updated standardTransformers.ts to always include the transformation
- Updated feature toggles documentation
- Regenerated feature toggle files
Remove regressionTransformation feature toggle
The regression analysis transformation feature is now GA and no longer needs to be behind a feature toggle.
* Extend interpolate endpoint to support community dashboard json interpolation
Added unit tests
* Implement Frontend Side
- Show tabs
- Fetch Community dashboads
- basic cards for community
- Search bar for community
* Improve card community and show thumbnails
* quick poc with template dashboards
* better cards ui
* entry point conditional added. dashboard card improved
* dev dashboard for testing
* details removed in template dashboard modal
* improvement when loading the templates
* dashboard from template entry points
* interactions added
* tracking event improvements. card improvement
* unused import removed
* 90% Complete MVP community dashboards integraton
- Use DashboardCard component
- Search grafana dashboard in the community tab
- Make Tabs and pagination sticky
- Adjust titles to be scoped by datasource name/type
- Add skeleton loading for community tabs and pagination
- Add dashboard details tooltip
* Use DataSourcePicker for extra configuration page
* Fix suggested dashboard, don't use filter but slug and also add gcomURLink
* Implement badge, for now reuse Badge component
* translations added
* Refactor code, extract to utils function and clean up code
* refactor provisioned dashboards images
* add missing file
* Extract API functions
* standarize event handlers
* Auto select tab when provisioned or community are not present, also add empty state for provisioned tab
* use SecondaryAction iconButton for Details, and also use Tooltip
* For suggested dashboards change Grid for Stack to fix issue with less than 3 dashboards, also add the details next to
the main action
* Fix styling issue with description miss-aligment
* Change "use template" to use dashboard
* update i18n
* fix broken unit test
* FF added
* uid changed to make it work for both scenarios
* Apply PR feedback
- add eventLocation
- Fix description placeholder
- Fix issue with suggested dashboards card aligment, change to Grid
* use datasource type instead of name, extract i18n and fix linting
* Improve View on Grafana.com link
* remove console.log
* Fix issue with cards styling
* improvements
* Apply suggestion from @juanicabanas
Co-authored-by: Juan Cabanas <juan.cabanas@grafana.com>
* Use query params for modal state and reorder dashboard empty to keep suggestions in the middle
* extract common interpolate logic in new function
* fix linting
* rename loadTemplateDashboard function to loadSuggestedDashboard
* Improve automapping layout, add dashboard name to title and pipe the mappings
* Apply style guide for callback functions, and refactor constant inputs initialization wiht reduce
* Fix styling issues with focus border and pagination
* fix issue with card aligment
* use attach skeleton instead of custom css
* Adjust all i18n to use dashboard-library key
* Refactor mapping form to use one array to handle unmapped ds
* Update public/app/features/dashboard/dashgrid/DashboardLibrary/CommunityDashboardSection.tsx
Co-authored-by: Juan Cabanas <juan.cabanas@grafana.com>
* Refactor pagination, use api pagination data
* Remove unnecesary trim
* Fix issue with Stack height and justifyContent in modal
* Update public/app/features/dashboard/dashgrid/DashboardLibrary/SuggestedDashboards.tsx
Co-authored-by: Juan Cabanas <juan.cabanas@grafana.com>
* Add missing dependency
* Fix issue with mapping config form, make buttons to be aligned at the bottom
* Fix unit tests
* Add and refactor tracking interactions to support experiment KPIS
* rename unmappedInputs to unmappedDsInputs for clarity
* Update public/app/features/dashboard/dashgrid/DashboardLibrary/CommunityDashboardSection.tsx
Co-authored-by: Juan Cabanas <juan.cabanas@grafana.com>
* rename modal and move modal to section
* Simplify search params, extrack user selected dashboards to helper function, update pagination styles and use url based
pagination
* Move modal logic to the suggested dashboards component
* Fix tracking duplication on first load and revert change on pagination url persistence
* Extrac on preview community dashboard into utils
* Bring old datasource-provisioned box back and rely on new feature toggle for community dashboards
* change logic for showing suggested dashboards, we only need to enable that feature toggle
* update i18n
* Fix unit test for basic provisioned dashboard
* fix css
* Apply feedback
* Add suggested dashboards to endpoint
* Add missing feature toggle check in the backend to expose the interpolate api
* Add extra test case
* update swagger
* Update public/app/features/dashboard/dashgrid/DashboardEmpty/DashboardEmpty.tsx
Co-authored-by: Juan Cabanas <juan.cabanas@grafana.com>
* update swagger
* changes applied to retrieve templates dashboards from raintank
* translations
* Remove duplicated tracking and add gnet id to the save tracking action
* interactions
* improvements applied
* last improvements
* tracking events modified with merge. translations fixed
* tests fixed
* uid property removed from dto. new way of tracking the ds types added
* ds types from gnet dashboard removed
* fixes
* tracking changed
* tracking modified
---------
Co-authored-by: alexandra vargas <alexa1866@gmail.com>
Co-authored-by: Alexa Vargas <239999+axelavargas@users.noreply.github.com>
Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
* Start using adhoc filters component in trace view
* Migrate old span filters to adhoc filters
* Add support for duration filter
* Set placeholder in adhoc filters input
* Moved the span graph to the header, above the filters
* Update next and prev buttons, added filter pills, style fixes
* Fix types
* Use canary scenes version
* Remove copyright
* More duration operators
* Added tests for the controller
* More consistent spacing
* Remove unused container style from SpanGraph component
* Update scenes canary
* Update scenes to 6.42.0
* Fix all spans toggle
* Use InlineSwitch instead of Switch
* Fix critical path
* Fix duration filtering
* Add tooltips to filter pills
* Improve duration filter pill
* Improvements to backgrounds of span row. Fixed size of collapsible overview section
* Fix sticky trace view header
* Removed old span filters from panel options
* Migrate old filters to adhocfilters in panel. Use the adhoc filters component in panel options.
* i18n
* Fix tests
* Fix tests
Datasources: Apply default_manage_alerts_ui_toggle config to Loki datasource
- Update AlertingSettings component to use config.defaultDatasourceManageAlertsUiToggle
- Change from options.jsonData.manageAlerts !== false to nullish coalescing operator
- Add comprehensive tests for config behavior
- Ensures consistency with Prometheus datasource implementation from PR #98441
Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
* rename canvas class method so it's not falsely marked as a react class component
* also rename scene method
* rename render method in OptionsPaneCategoryDescriptor and OptionsPaneItemDescriptor
* rename render to setup in test scenario class
* Add optimistic concurrency
* add optimistic concurrency
* fix test
* nit
* fix tests for sql
* fix tests for sql
* rebase fix
* add one more check
* Implement GetLatestAndPredecessor method in datastore and add corresponding tests. This new functionality retrieves the latest resource version and its immediate predecessor, handling cases for single and non-existent resources. Update WriteEvent to utilize this method for improved optimistic concurrency control.
* Enhance optimistic concurrency control in WriteEvent method. Added checks for concurrent create operations to ensure only one succeeds, preventing race conditions. Updated tests to validate this behavior with multiple concurrent create attempts.
* lint
* Refactor optimistic concurrency check in WriteEvent method. Simplified the logic by removing unnecessary condition for single version existence, ensuring more robust handling of concurrent modifications.
* Provisioning: Remove image renderer note from PR comment template
Removes the 'NOTE: The image renderer is not configured' message from
the pull request comment template when image renderer is unavailable.
This addresses issue #656 in git-ui-sync-project.
- Updated commentTemplateMissingImageRenderer to be empty
- Updated testdata to reflect the change
- All unit tests pass
* Provisioning: Make image renderer note optional in PR comments
Make the image renderer note in pull request comments optional based on
the allowImageRendering configuration flag. When enabled, the note now
includes a link to the setup documentation.
- Add showImageRendererNote boolean field to commenter struct
- Update NewCommenter to accept showImageRendererNote parameter
- Update template to conditionally show note with documentation link
- Pass allowImageRendering from APIBuilder to commenter in register.go
- Update ProvidePullRequestWorker to use cfg.ProvisioningAllowImageRendering
- Add tests to verify note appears/disappears based on flag
Fixes https://github.com/grafana/git-ui-sync-project/issues/656
* Format code with go fmt
* Remove redundant text from image renderer note
Remove 'The image renderer is not configured.' from the note message.
The note now focuses on actionable guidance with the documentation link.
* Fix compilation error: use cfg.ProvisioningAllowImageRendering directly
Cannot access unexported field allowImageRendering from webhooks package.
Use cfg.ProvisioningAllowImageRendering directly since we have access to cfg.
* provisioning: detect stale sync status and trigger resync
When sync jobs expire and are cleaned up by the expired job cleanup
controller, the Repository sync status remains stuck in Pending or
Working state. This prevents new sync jobs from being queued because
shouldResync() blocks on these states.
This change adds detection logic in shouldResync() to check if a sync
job referenced in the sync status still exists. If the job doesn't exist
(NotFound), we trigger a resync to reconcile the stale state.
Fixesgrafana/git-ui-sync-project#626
* test: remove unused mocks and fix test case
- Remove unused mockRepositoryLister and mockRepositoryNamespaceLister types
- Remove unused imports (labels, listers)
- Remove test case for sync disabled scenario as we don't care about sync enabled state when detecting stale status
* add support for converting Mimir integrations to Integration
* implement imported config revision
* update service to load staged receivers if configured
* make sure non-Grafana origin cannot be mutated
* set access control metadata for imported origin
* set includeImported from feature flag. Disabled for service used by provisioning
* add tests for new functionality
* add snapshot-based integration test
* fix space under time controls by using floats instead of flex
* remove commented out styles
* adjust spacing: use marginBottom and reduce bottom padding
* make Add variable button float inline with variables
* feat(time-range): click and drag interaction to pan x-axis over time
* feat(timeseries): add x-axis interaction area uPlot plugin
* test(timeseries): validate x-axis pan with Playwright browser test
* refactor(uplot-config): simplify state management for x-axis panning
* refactor(uplot-config): plot state union type
* fix(time-range-pan): simplify calcs, mouse handler cleanup function
* Remove custom styles from ExtensionToolbarItemButton
* Use active ToolbarButton variant for ExtensionToolbarItemButton
* Use active ToolbarButton variant for HelpTopBarButton
* Simplify ExtensionToolbarItemButton conditional logic
* Replace nested ternary with iife
* refactor: Move job cleanup to separate controller and fix history write
- Created JobCleanupController in apps/provisioning/pkg/controller
- Separated cleanup logic from ConcurrentJobDriver
- Fixed bug where expired jobs were not written to history
- Added comprehensive tests with 93.8% coverage
- Removed cleanup interval parameter from ConcurrentJobDriver
- Cleanup now properly follows Complete + WriteJob pattern
Fixes expired jobs being lost instead of archived
* refactor: Update lease renewal interval to use jobExpiry variable
- Changed the lease renewal interval in the GetPostStartHooks method to utilize the jobExpiry variable for improved clarity and maintainability.
* Format code
* Fix Unix milliseconds
* fix: correct Unix timestamp assertions and remove duplicate test expectations
- Changed Unix() to UnixMilli() for correct millisecond timestamp validation
- Removed duplicate store.AssertExpectations(t) calls throughout tests
* Remove correlations feature toggle
The correlations feature toggle has been removed from the registry and all
usages throughout the codebase have been cleaned up. Correlations are now
always available.
* Provisioning: Improve logging and tracing in job processing
- Add comprehensive tracing with OpenTelemetry spans across all job operations
- Enhance logging with consistent style: lowercase, concise messages, appropriate log levels
- Use past tense for completed lifecycle events (e.g., 'stopped' vs 'stop')
- Add structured logging with contextual attributes for better searchability
- Handle graceful shutdowns without throwing errors on context cancellation
- Refactor Cleanup method into listExpiredJobs and cleanUpExpiredJob for better code quality
- Avoid double logging by only logging errors when handled locally
- Add tracing and logging to historyjob controller cleanup operations
Files modified:
- pkg/registry/apis/provisioning/jobs/driver.go: Add tracing spans and improve error handling for graceful shutdown
- pkg/registry/apis/provisioning/jobs/concurrent_driver.go: Add tracing and consistent logging
- pkg/registry/apis/provisioning/jobs/persistentstore.go: Add comprehensive tracing and logging to all public methods, refactor cleanup
- apps/provisioning/pkg/controller/historyjob.go: Add tracing and improve logging consistency
* Update pkg/registry/apis/provisioning/jobs/persistentstore.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Refactor logging in persistentstore.go
- Remove debug log statements at the start of job operations for cleaner output
- Maintain structured logging with contextual attributes for improved traceability
Files modified:
- pkg/registry/apis/provisioning/jobs/persistentstore.go: Clean up logging for job operations
* Enhance logging and tracing in provisioning job operations
- Introduce OpenTelemetry spans for better observability in job processing and webhook handling
- Improve structured logging with contextual attributes for key operations
- Remove unnecessary tracing spans in long-running functions to streamline performance
- Update error handling to record errors in spans for better traceability
Files modified:
- pkg/registry/apis/provisioning/controller/repository.go: Add tracing and structured logging to sync job operations
- pkg/registry/apis/provisioning/jobs/concurrent_driver.go: Remove tracing span from long-running function
- pkg/registry/apis/provisioning/jobs/driver.go: Enhance logging and tracing in job processing
- pkg/registry/apis/provisioning/webhooks/webhook.go: Implement tracing and structured logging for webhook connections
* Update pkg/registry/apis/provisioning/jobs/driver.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Improve error handling in ConcurrentJobDriver to differentiate between graceful shutdown and unexpected stops
* Remove unused import in driver.go to clean up code
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
The FlagGrafanaAPIServerWithExperimentalAPIs is only available when
`app_mode=development`. We have a more specific flag that is usable in
production, so use that.
Also, there was some old code constraining these APIs to a static list
of datasources. We don't need that anymore, so this PR removes it.
The FlagQueryServiceWithConnections is left as is, because there are
multiple existing tests that rely on this development-only, experimental
flag. I don't want to understand why that is.
* Explore: Ensure data source is part of query object in internal data links
Fixes#112945
* Fix tests
* Fix tests
* Update tests
* Update tests
* Add a safeguard for misconfigured links
* Update logic to update uid when only type or name is defined
Remove extractFieldsNameDeduplication feature toggle
The extractFieldsNameDeduplication feature has reached GA (General Availability),
so the feature toggle is no longer needed. The name deduplication behavior is
now permanently enabled.
Changes:
- Removed feature toggle definition from registry.go
- Removed feature toggle check in extractFields.ts (always deduplicate now)
- Updated tests to remove feature toggle manipulation
- Regenerated feature toggle files
If an alert rule with an invalid receiver is created it breaks the entire alertmanager configuration rather than preventing the save.
This fixes the issue by erroring on save and apply, and logging invalid receivers only when applying the config after an update.
Introduced in #111838
* Extend interpolate endpoint to support community dashboard json interpolation
Added unit tests
* Implement Frontend Side
- Show tabs
- Fetch Community dashboads
- Use DashboardCard component
- Search grafana dashboard in the community tab
- Make Tabs and pagination sticky
- Adjust titles to be scoped by datasource name/type
- Add skeleton loading for community tabs and pagination
- Add dashboard details tooltip
- Bring old datasource-provisioned box back and rely on new feature toggle for community dashboards
- update i18n
- update swagger
---------
Co-authored-by: Juan Cabanas <juan.cabanas@grafana.com>
Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
* UI: Fix Slider component to handle decimal inputs correctly
* format code and run eslint fix
* fix Slider to have:
- "single" source of truth for state
- state synchronization for controlled values
- clamp values to step
- disallow decimal values in input when min+step are integers
- tests for the new functionality
- design decision included in docs
- behavior notes in docs
* allow non-numeric characters all the time
always parse decimal numbers, stripping non-numerics
integer coercion is implicitly handled in clamping
---------
Co-authored-by: Harshada Gawas <harshadagawas95@gmail.com>
* Remove dashboardDsAdHocFiltering feature toggle
The dashboardDsAdHocFiltering feature toggle has been enabled by default
and is now in General Availability stage. This commit removes the feature
toggle and makes the AdHoc filtering functionality for the dashboard
datasource permanently available.
Changes:
- Remove feature toggle from registry.go
- Regenerate feature toggle files
- Remove conditional checks in frontend code
- Update tests to reflect permanent enablement
- Always show AdHoc Filters toggle in dashboard query editor
- Always enable dashboard datasource in DataSourcePicker for variables
* Remove unused imports
* Fix Prettier formatting issues
* Alerting: Fix support for converted Prometheus rules in app-platform apis
Retrieving converted Prometheus retrieval rules was not supported in the app-platform apis and was throwing a 500 error due to the provenance not being handled properly.
Also adds a test to cover converted Prometheus rules when getting rules.
Closes https://github.com/grafana/alerting-squad/issues/1200
* add test to confirm provenance compatibility
* feat(panel-zoom): change mouse cursor when zooming x-axis or y-axis
* test(panel-zoom): browser test mouse cursor change interactions
* fix(mouse-cursor-styles): no need for important
Fix: Include ref field in DELETE endpoint response for branch operations
When deleting a dashboard file via DELETE endpoint with a ref query parameter
(for branch operations), the response was missing the ref field. This caused
the frontend branch workflow success handler to fail silently.
The issue was an inverted boolean condition in the Delete method. The code
was setting file.Ref = opts.Ref when shouldUpdateGrafanaDB returned true
(main branch operations), but it should have been setting it when false
(branch operations), since we read the file with an empty ref.
Fixed by inverting the condition from:
if r.shouldUpdateGrafanaDB(opts, nil)
to:
if !r.shouldUpdateGrafanaDB(opts, nil)
This ensures the ref field is properly included in the ResourceWrapper
response for branch operations.
* API clients: Use open_snapshots for possibleOpenAPISpecs
* Tweak logic to throw error if we can't load openapi specs
---------
Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
* fix some anys in select styles
* remove anys from ModalsContext
* improve some types
* improve ArrayDataFrame
* restore behavior
* use unknown for Parser type
* feat(linter-rule): prevent cross plugin relative path imports
* docs(readme): document new grafana/no-plugin-external-import-paths rule
* chore(test): add an NPM script to run linter rule tests
* test(linter-rule): prevent cross plugin relative path imports
* docs(eslint-config): add a commented out example of new rule usage
This adds validating admission hooks to enforce the requirements on AlertRules and RecordingRules that are currently enforced through the provisioning service and storage mechanisms in preparation of a consistent validation in both legacy storage and unified storage. It also adds a mutating admission hook to the app to ensure that folder annotations and folder labels are kept in sync so we can perform label-selector lists.
* Validate Job Specs
* Add comprehensive unit test coverage for job validator
- Added 8 new test cases to improve coverage from 88.9% to ~100%
- Tests for migrate action without options
- Tests for delete/move actions with resources (missing kind)
- Tests for move action with valid resources
- Tests for move/delete with both paths and resources
- Tests for move action with invalid source paths
- Tests for push action with valid paths
Now covers all validation paths including resource validation and
edge cases for all job action types.
* Add integration tests for job validation
Added comprehensive integration tests that verify the job validator properly
rejects invalid job specifications via the API:
- Test job without action (required field)
- Test job with invalid action
- Test pull job without pull options
- Test push job without push options
- Test push job with invalid branch name (consecutive dots)
- Test push job with path traversal attempt
- Test delete job without paths or resources
- Test delete job with invalid path (path traversal)
- Test move job without target path
- Test move job without paths or resources
- Test move job with invalid target path (path traversal)
- Test migrate job without migrate options
- Test valid pull job to ensure validation doesn't block legitimate requests
These tests verify that the admission controller properly validates job specs
before they are persisted, ensuring security (path traversal prevention) and
data integrity (required fields/options).
* Remove valid job test case from integration tests
Removed the positive test case as it's not necessary for validation testing.
The integration tests now focus solely on verifying that invalid job specs
are properly rejected by the admission controller.
* Fix movejob_test to expect validation error at creation time
Updated the 'move without target path' test to expect the job creation
to fail with a validation error, rather than expecting the job to be
created and then fail during execution.
This aligns with the new job validation logic which rejects invalid
job specs at the API admission control level (422 Unprocessable Entity)
before they can be persisted.
This is better behavior as it prevents invalid jobs from being created
in the first place, rather than allowing them to be created and then
failing during execution.
* Simplify action validation using slices.Contains
Replaced manual loop with slices.Contains for cleaner, more idiomatic Go code.
This reduces code complexity while maintaining the same validation logic.
- Added import for 'slices' package
- Replaced 8-line loop with 1-line slices.Contains call
- All unit tests pass
* Refactor job action validation in ValidateJob function
Removed the hardcoded valid actions array and simplified the validation logic. The function now directly appends an error for invalid actions, improving code clarity and maintainability. This change aligns with the recent updates to job validation, ensuring that invalid job specifications are properly handled.
* Provisioning: Preserve in progress job data
* Refactor code and cover more situations
* Fix linting
* Fix issue with remove path operation for started time
* Cleanup
* prettier
---------
Co-authored-by: Roberto Jimenez Sanchez <roberto.jimenez@grafana.com>
What is this feature?
This PR implements compressed periodic save for alert state storage, providing a more efficient alternative to regular periodic saves by grouping alert instances by rule UID and storing them using protobuf and snappy compression. When enabled via the state_compressed_periodic_save_enabled configuration option, the system groups alert instances by their alert rule, compresses each group using protobuf serialization and snappy compression, and processes all rules within a single database transaction at specified intervals instead of syncing after every alert evaluation cycle.
Why do we need this feature?
During discussions in PR #111357, we identified the need for a compressed approach to periodic alert state storage that could further reduce database load beyond the jitter mechanism. While the jitter feature distributes database operations over time, this compressed periodic save approach reduces the frequency of database operations by batching alert state updates at explicitly declared intervals rather than syncing after every alert evaluation cycle.
This approach provides several key benefits:
- Reduced Database Frequency: Instead of frequent sync operations tied to alert evaluation cycles, updates occur only at configured intervals
- Storage Efficiency: Rule-based grouping with protobuf and snappy compression significantly reduces storage requirements
The compressed periodic save complements the existing jitter mechanism by providing an alternative strategy focused on reducing overall database interaction frequency while maintaining data integrity through compression and batching.
Who is this feature for?
- Platform/Infrastructure teams managing large-scale Grafana deployments with high alert cardinality
- Organizations looking to optimize storage costs and database performance for alerting workloads
- Production environments with 1000+ alert rules where database write frequency is a concern
* Script for setting up gdev scope objects
* Script for setting up gdev scope objects
* Format
* Update codeowners
* Do a feature flag check
* Formatting
* Remove FF check, because creation is explicit anyways
* Formatting
* Use fork of slog-gokit to fix data race
Replace github.com/tjhop/slog-gokit with fork that includes fix for data race in handler.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Update workspace
* Bump github.com/tjhop/slog-gokit to v0.1.5
* Update go.sum
---------
Co-authored-by: Claude <noreply@anthropic.com>
* Set the log group name when executing log queries from the frontend
* Add helper for a data source instance to check if its a monitoring account
* Execute log queries with log group identifiers only for monitoring account queries
* fix cloudwatch datasource.ts tests
* remove unneeded check
* LogDetailsContext: create component
* LogListContext: extract details out of context
* Refactor components to use new context provider
* More component updates
* Update currentLog implementation
* Use new context provider
* LogLineDetails: prevent cascade of listeners
* LogDetailsContext: sync currentLog with changes
* LogLine: use icon status to show the current log
* LogLineDetails: first tab is the last open log line
* LogLineDetailsLog: respect font size
* Update tests
* Update tests
* LogList: add integration test
* LogLine: use level to mark the current log
* Chore: only check uids, no need for references
* Fix duplicated hook usage
* chore: overflow auto
* LogList: consider field selector width
* Revert "LogLine: use level to mark the current log"
This reverts commit 2d5d54d9a7.
* LogLine: darken details displayed, font weight bold current
* LogLineMenu: icon when current log
* Differenciate contrast from light and dark themes
* Use angle-right for the active icon
* annotation legacy store with api server, read only
* Add a feature flag for annotations app
* implement list filters
* annotations are not addressable by ID for read operations
* fix registry apps test
* add ownership for an app
* disable linter
* typo, of course
* fix go workspace
* update workspace
* copy annotation app in dockerfile
* update workspace
---------
Co-authored-by: Tania B. <10127682+undef1nd@users.noreply.github.com>
* fix: use step output instead of !cancelled() in condition
We are uploading profile files without need otherwise
* fix: try using !cancelled() and output
Otherwise, step isn't triggered due to failure of the previous one
* Add IntersectionObserver to render rule viz panel only when visible
* Move data transformations to dataTransform file
* Add tests for data transform
* Use a new time series transformation algorithm
* Reduce the number of time series data conversion
* Memoize small components
* Update tests
* Remove some comments
* Use Box component for styling. Remove unnecessary effect dependency
* cleanup
* library panel via search
* test cleanup
* merge main
* add FindDashboards mock
* no matching dashbaords should return empty
* do not alllow name and libraryPanel query
* fix: delete folders using postorder
* chore: use helper function and do not add method to Folder store
- addresses other review comments fixing log messages and cleans up the unit tests
* chore: run library element tests on modes 2,3,5 only
* chore: adjust to folder.SortByPostorder(folders []*Folder)
* chore: run library panels tests in mode 2,3,5 only
* chore: run tests in all modes and increase timeout
- adjusting the modes and tweaking configs will be done separately
* fix: delete subfolder dangling panels and error if used
* chore: add observation about library panel DeleteInFolders
- logs folders UIDs on DeleteInFolders error
* chore: add integration test for blocking library panel deletion and handling dangling library panels
* chore: fix integration test on mode 4 and 5
* CommanPalette: Add Assistant integration for empty state
* Update assistant package and use new onClick pop
* i18n
* Update public/locales/en-US/grafana.json
Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
* Update public/app/features/commandPalette/CommandPalette.tsx
Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
* Update test
---------
Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
* Style tweaks of span bar row
* More tweaks
* More tweaks to span style
* 2px width for the service color border
* Refactor SpanBarRow to function component
* Refactor SpanDetailRow to function component
* Refactor SpanTreeOffset to function component
* eslint ignore
* Service name font weight to 500
* Don't render the last indentGuide if the span doens't have children
* Fix tests
Run the app runner in a goroutine in the post-start hook, as the '/readyz' endpoint for the API server waits for a non-nil error response from the post-start hook to mark it as ready.
The query which fetches alert rules in a paginated manner ordered by `rule_group` can result in strange and inconsistent ordering when the database uses a case-insensitive collation for the `rule_group` column. This can lead to scenarios where rules from different groups are interleaved in the results, making pagination unreliable and the returned number of rule_groups incorrect.
Related to #88990
* feat: add a placement property to annotations model v2
* chore: update scenes to `v6.42.1`
* chore: run `make gen-apps`
* fix: cater for cases when there is no data layer
* chore: swagger clean
* chore: update api clients
* fix: correct type guard
* fix: display control labels in the default renderer as well for DashboardDataLayerSet
* Provisioning: allow access check to proceed even when non access policy
* Provisioning: access checker needs this for MT
* add permissions registration
* remove scopes
* use in MT for now
* no need to document an internal flag here
* revert vscode change
* refactor the authZ permission evaluation and mapper code to allow evaluating unscoped actions beyond creation
* update wire
* gofmt
* add boolean to struct
---------
Co-authored-by: IevaVasiljeva <ieva.vasiljeva@grafana.com>
* Jaeger: Migrate Services and Operations to the gRPC Jaeger endpoint (#112384)
* add grpc feature toggle
* move types into types.go
* creates grpc client functions for services and operations
* Call grpc services function when feature flag is enabled for health check
* remove unnecessary double encoding
* check for successful status code before decoding response and return nil in case of successful response
* remove duplicate code
* use variable
* fix error type in testsz
* Jaeger: Migrate search and Trace Search calls to use gRPC endpoint (#112610)
* move all types into types package except for JagerClient
* move all helper functions into utils package
* change return type of search function to be frames and add grpc search functionality
* fix tests
* fix types and the way we check error response from grpc
* change trace name and duration unit conversion
* fix types and add tests
* support queryAttributes
* quick limit implementation in post processing
* add todo for attributes / tags
* make trace functionality ready to support grpc flow
* add functions to process search response for a specific trace and create the Trace frame
* tests for helper funtions
* remove grpc querying for now!
* change logic to be able to process and support multiple resource spans
* remove logic for gRPC from grpc_client.go
* add equivalent fields for logs and references
* add tests for grpcTraceResponse function
* fix types after merge with main
* fix status code checks and return nil for error on successful responses
* enable reading through config flag for trace search
* create sigle key value type since they are similar for OTLP and non OTLP based formats
* reference right type
* convert events and links into references and logs
* add status code, status message and kind to data frame
* fix tests to accomodate new format
* remove unused function and add more tests
* remove edit flag for jsonc golden test files
* add clarifying comment
* fix tests and linting
* fix golden files for testing
* fix typo
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fix typo
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fix typo
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* add clarifying comment
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* remove unnecessary logging statement
* fix downstream errors
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* use downstreamerrorf where applicable and add missing downstream eror sources.
* tests
---------
Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Enhance ScopesService to support scopeNodeId in URL parameters for improved backward compatibility. Update changeScopes method to accept scopeNodeId, allowing for better handling of scope nodes. Adjust ScopesInput to prioritize scope node titles and ensure loading states are managed correctly. Refactor related logic in ScopesSelectorService for consistent scope handling.
* Scopes: Add tests for scope_node URL sync and scopeNodeId handling
- Add ScopesService.test.ts with tests for URL parameter handling
- Test scope_node and scope_parent reading from URL
- Test scope_node writing to URL with scope_parent reset
- Test backward compatibility with legacy scope_parent
- Test URL sync when scopes and scopeNodeId change
- Add tests to ScopesSelectorService.test.ts for changeScopes
- Test scopeNodeId assignment (only first scope gets it)
- Test handling scopeNodeId without parentNodeId
- Test backward compatibility when only parentNodeId provided
All 13 new tests passing, maintaining 100% test coverage.
* Fix linting error
* Fix comments
* add depreacted width to instance details drawer
* prettier
* use percentage instead
* use width aligned with the left column in the parent
* clamp value for wide screen monitors
* refactor: use hook instead of function for calculations
* refactor: use context provider for right column for the calculation of the width
* remove unnecessary changes exporting styles values
* Secrets: Refactor data_key_id out of the encoded secure value payload (#111852)
* everything compiles
* tests pass
* remove file included by accident
* add entry to gitignore
* some scaffolding for the migration executor
* remove file
* implement and test the migration
* use xkube.Namespace in our interfaces
* add todo
* update wire deps
* add some logs
* fix wire dependency ordering
* create tests to validate error conditions during migrations
* only run the migration as an MT api server
* formatting issues
* change detection of secrets running as MT server
* add todo
* use more specific initializer flags
* make secrets playwright tests work
* set new properties to true by default
* remove developer mode flag
* fix unit tests
* docs: Update Logs Visualizations topic
* updated based on review comments
* Add log details options
* Updated main image, moved log details info to intro and added screenshot of menu
* Changed max width of log menu image
* Added screenshot with log line icons highlighted
* Replaced example image
---------
Co-authored-by: Isabel Matwawana <isabel.matwawana@grafana.com>
Return the SQL schema for all DS queries in request (to provide information to AI / Autocomplete for SQL expressions).
All DS queries are treated as if they were inputs to SQL expressions in terms of conversion, regardless if they are selected in a query or not.
Requires feature toggle queryService = true
Endpoint is apis/query.grafana.app/v0alpha1/namespaces/default/sqlschemas
---------
Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
* refactor ErrorBoundary so it doesn't trigger the lint rule
* refactor ErrorBoundaryAlert to functional component
* convert StatPanel to a functional component
* convert ServiceAccountPicker to a functional component
* convert UserPicker to a functional component
* don't need displayName when not memoized
* convert TimelineChart to a functional component
* convert UserLdapSyncInfo to a functional component
* convert UserOrgs to functional component
* convert OrgRow to a functional component
* convert UserSessions to a functional component
* convert TimePickerSettings to a functional component
* convert DataSourcePluginSettings to a functional component
* convert ExploreTimeControls to a functional component
* convert SearchBarInput to a functional component
* convert LiveConnectionWarning to a functional component
* convert ConcatenateTransformerEditor
* convert ConstantVariableEditor a functional component
* convert VariableInput to a functional component
* convert ConfigEditor to a functional component
* convert CSVWavesEditor to a functional component
* Provisioning: Show configured and last used branches
* Remove unused var
* Add hooks
* Extract branch logic
* remove type assertion
* fix tests
* Memoize descriptions
Use fork that does not have cgo as default, had to revert build tag method attempt since it broke things like running go test on macs (without the tag) #112289.
* Render UNSAFE hidden dashboard controls
* Remove unused imports
* Extract to function and write test
* Remove unnecessary context from test
* Remove exclamation
* add extension for drilldown to add to dashboard
* reuse configure add to dashboard function callback
* structure for drilldown add to dashboard
* fix imports
* fix tests
* expose as a component
* remove extension link
* get component ready to extend
* lazy load component
* add component to exposed component registry
* update folder structure to not work in explore folder
* keep dependencies clean
* nice structure to let folks know this is a drilldown integration
* update code owners for new file
* make exposed component more generic, step one, update component id
* step 2, expose add to dashboard form component
* add more explicit useAbsolutePath option to form
* remove old implementation code for drilldown specific component
* commit translation
* add comments to avoid breaking changes
* add e2e test for add to dashboard form component
* fix flaky test
* add exposed component id to e2e test app
* remove gridPos in buildPanel fallback fn
* add code comment for useAbsolutePath's purpose
* remove gridPos from e2e test
* Display subtitle and enable direct scopes apply
* Extract each type into its own component
* Fix unit integration test
* Fix fe linting
* Fix imports
* Import order
* Update generated type
* Update type generation
* Format go
* Add test case for radio button container selection
* Remove infra mock
* Remove non-existant imports
* Remove unused assertions
* Refactor tree item for a11y
* Add proper keyboard support for directly applying scope
* Update i18n
* Fix button selector
* Remove test code
* Fix race condition for seletion vs blur update
* Something is working
* Progress
* Update
* Update
* Update
* Some new unit tests
* Fix
* time shift fix
* Update
* Always show hidden toggle
* Update
* Table: Sparkline Cell inspect support
* update to better support FieldType.other structures
* clean up styling a bit for empty case
* fix test import
* add test for no x case for sparkline
* fix merge mistake
* fix test import
* Grafana: Add random walk configuration options to Grafana datasource
Add UI controls to configure random walk parameters (min, max, start value,
spread, noise, drop percent) to match TestData datasource functionality.
- Add RandomWalkEditor component with inline number inputs for all parameters
- Update GrafanaQuery type to include random walk configuration fields
- Update backend to parse and apply query parameters to RandomWalk function
- Configuration options match TestData datasource UX for consistency
* Grafana: Add series count support to random walk
Add ability to generate multiple random walk series in a single query
for complete parity with TestData datasource.
- Add seriesCount field to RandomWalkEditor
- Update backend to loop and generate multiple frames based on series count
- Default to 1 series if not specified for backward compatibility
* Grafana: Improve random walk editor UI with better organization and tooltips
Enhance the random walk configuration UI for better usability:
- Organize fields into two logical rows (core config vs fine-tuning)
- Add helpful tooltips to all fields explaining their purpose
- Increase label width to prevent text wrapping
- Group related fields visually for better comprehension
Row 1: Series count, Start value, Min, Max (basic shape and range)
Row 2: Spread, Noise, Drop % (randomness and variation controls)
This provides a cleaner, more intuitive experience compared to TestData's
single-row layout, making it easier for users to configure random walks.
* Grafana: Format RandomWalkEditor code
Apply consistent formatting to RandomWalkEditor component.
* Grafana: Add E2E tests for random walk configuration
Add comprehensive Playwright E2E tests to verify random walk functionality:
- Test that all configuration fields render correctly
- Test min/max value constraints
- Test multiple series generation
- Test spread and noise parameters
- Test drop percentage for simulating missing data
- Test that tooltips are present and functional
These tests ensure the random walk configuration works end-to-end from
UI input to data rendering in panels.
* Grafana: Fix E2E tests for random walk configuration
Fix Playwright test selectors and assertions to work reliably:
- Use specific element IDs to avoid selector conflicts
- Remove flaky dropPercent check from rendering test (covered separately)
- Simplify test assertions to focus on functional verification
- All 7 tests now passing consistently
Tests verify: field rendering, min/max constraints, series count,
spread/noise configuration, drop percentage, and tooltips.
* Grafana: Add advanced E2E tests for random walk
Add two additional tests for better coverage:
- Test configuration value persistence across interactions
- Test that series count actually generates the expected number of series
These tests verify deeper functionality beyond basic UI rendering,
ensuring the random walk feature works correctly end-to-end.
All 9 tests passing consistently (20.1s runtime).
* Grafana: Remove redundant Min/Max tooltips
Remove tooltips from Min and Max fields that just repeated the label text.
These fields are self-explanatory and don't need tooltip icons.
Keeps the UI cleaner while maintaining helpful tooltips on fields that
actually benefit from explanation (Series count, Start value, Spread,
Noise, Drop %).
* Grafana: Add CODEOWNERS entry for random walk E2E tests
Add codeowner assignment for the new grafana-datasource-random-walk.spec.ts
test file to @grafana/grafana-frontend-platform, matching the ownership of
the Grafana datasource code.
* Add dashboardTemplates feature toggle and put new changes behind this toggle to limit impact
* Grafana: Add unit tests for dashboardTemplates feature toggle
Add unit tests to verify RandomWalkEditor renders correctly based on
the dashboardTemplates feature toggle:
- Test that random walk editor renders when FF is enabled
- Test that random walk editor is hidden when FF is disabled
These tests ensure the feature toggle works as expected and prevents
the random walk configuration UI from appearing when the feature is disabled.
* revert previous codeowners change as not necessary
* Grafana: Remove redundant E2E test for feature flag disabled
Remove E2E test for dashboardTemplates feature flag disabled scenario
since it's already covered by unit tests and E2E environment can't
reliably control server-side feature flags.
Feature flag behavior is properly tested in QueryEditor.test.tsx unit tests.
E2E tests focus on functional validation when the feature is enabled.
* fix lint
* Integrate mt querier with query caching
* typo
* let the caller set cache status response header
* fix TestQueryAPI
* make gen-go
* handle CachingServiceClient being nil and make gen-go
* include namespace in cache key
* set signed in user namespace in query_test.go
* fix test
* remove commented out code
* undo services/query/query.go changes
* make gen-go
* remove namespace requirement
* fix tests
* fix test
* remove namespace from SignedInUser in tests
* make gen-go
* SaveProvisionedDashboardForm: Show preview banner when pushing to non-configured existing branch
* useProvisionedRequestHandler: use ref to prevent handler triggered twice
* refactor ungroup
* deleting last row/tab no longer ungroups
* Change test for deleting last row to not test for ungroup
* fix comment with correct pull request
* use isLayoutGroup instead
* fix implementations
* missing import
* feat: Improve prompt for open assistant
Existing prompt is not specific enough and uses a new visual tool, which will result in taking a screenshot to analyze the flame graph.
* Apply suggestion from @cyriltovena
less instructions for now.
---------
Co-authored-by: Cyril Tovena <cyril.tovena@gmail.com>
When creating silences in remote Alertmanager instances, all 4xx errors were treated as 500s.
This change ensures that 4xx errors are properly surfaced as bad payload errors, allowing callers to handle them appropriately.
* Add delete and update hooks for roles/core roles
no need to capture non reference types
small cleanup on vars
* fix ticket priming in hooks
* fix ticket priming in hooks
* Revert "fix ticket priming in hooks"
This reverts commit f8e953ca09.
* use old testing blocks
* protect runtime obj in go func
* update test for correctness
* separate files for test correctness. fix leaking goroutines in go tests
* go workspace fixes
* attribute owner
* clean up go mod
* [API Server] Add Example App for reference use.
* Remove Printlns.
* Upgrade app-sdk to v0.46.0, update apps to handle breaking changes.
* Only start the reconciler for the example app if the v1alpha1 API version is enabled.
* Some comment doc updates.
* Run make update-workspace
* Set codeowner for /apps/example
* Run make gofmt and make update-workspace
* Run prettier on apps/example/README.md
* Add COPY apps/example to Dockerfile
* Add an authorizer to the example app.
* Fix import ordering.
* Update apps/example/kinds/manifest.cue
Co-authored-by: Owen Diehl <ow.diehl@gmail.com>
* Run make update-workspace
* Re-run make gen-go for enterprise import updates
* Run make update-workspace
---------
Co-authored-by: Owen Diehl <ow.diehl@gmail.com>
- Added gms_pure_go build tags to disable cgo - (cgo was added to GMS since we last updated it)
- Docs note on regex limitations
---------
Co-authored-by: Matheus Macabu <macabu.matheus@gmail.com>
* StateTimeline: E2E tests for basic rendering, no data, and tooltip interactions
* Add tests for StateTimelineTooltip sub-component
* Remove unused import from state-timeline.spec.ts
* updates from PR review
* create navigateToAlertFormSchemaApi in restrictedGrafanaApis and use it in formDefaults.ts
* update alertingSchemaApi
* fix test
* move alertingSchemaApi.ts and the alerting section in README.md to a new alerting folder
* move cloud rules form schema outside restrictedGrafanaApis
* remove cloud fields in schema and use values from existing enums for some fields
* refactor RestrictedGrafanaApisContextTypeInternalenrichment type adding a high level entry for alerting
* refactor: change naming and come back to one single level in the RestrictedGrafanaApisContextType
* update README.md
* Fix inconsistency in command instructions between the Backend and Frontend section.
* Increase ulimit advice.
On a bare system I'm getting almost 6200 files from the given `find` command.
It's clear that this project has grown considerably since this line was added
to the onboarding docs.
* starting grafana is not explained in the devenv readme.
* AccessControl: Include hidden roles in service account role fetches
Add includeHidden=true parameter to role API calls to ensure service accounts
with hidden roles assigned properly display those roles in the UI.
Previously, service accounts with only hidden roles would appear to have no
roles assigned in the UI, even though the API showed they had roles when
queried with includeHidden=true.
This change affects both:
- Bulk role fetching for the service accounts list
- Individual user role fetching used by the role picker
* format
* Add enterprise hooks
* wip...
* undo
* update wire gen
* remove old hook thing
* move build info into seperate func
* align fs context middleware with grafana, setting SignedInUser
* Call IndexDataHooks to get modified build info
* update tests
* go workspace
* idk, reset workspace files or whatever
* conditionally mount license
* support loading decoupled plugins from cdn
---------
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* ProgressBar: progressbar nodes must have accsible name fix
* BrowseActions: Bulk move and delete drawwer a11y fix
* FolderActionsButton: Move and delete drawer a11y fix
* ConfigForm: a11y fix missing id
* GettingStarted: Skip img alt since its decorative
* JobContent: heading a11y fix
* StatusBadge: add displayOnly prop to avoid cursor pointer display when its not necessary
* RepositoryTypeCards: Card missing discernible text
* i18n
* input id fix
* wip
* wip
* wip
(cherry picked from commit 8cedf25892)
* Search seems to be working, the validation is still wip
* Use keyword.Name analyzer for Filterable fields
* Only string fields should be indexed with keyword analyzer
* Change search query for email and login fields to use term query
* Remove unnecessary Exact from the resource protobuf definitions
Co-Authored-By: Ryan McKinley <ryantxu@gmail.com>
* Add legacy search support to the API
* Tests for legacy search, validate and integration tests for user
* Lint
* Add snapshot tests to userDocumentBuilder
* Address CodeQL issues
* Improvements, handle Mode2, tests should pass
* Change default limit from 0 to 1 for requests
* Cleanup
* Add fixme
* Update pkg/registry/apis/iam/register.go
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
* Update pkg/registry/apis/iam/user/legacy_search.go
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
---------
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
* implement the update method for team bindings
* fix lint error
* add integration tests
* add integration test for non existing team binding
* try to fix lint error
As part of migrating Grafana's authorization system to Zanzana (OpenFGA), we need to ensure that role permissions defined in the IAM API are automatically synced to the authorization backend. Without this sync, roles created through the API would not be enforced by Zanzana, creating an inconsistency between defined permissions and actual authorization decisions.
This is a critical piece of the dual-write pattern during the migration to Zanzana, ensuring that:
Role permissions are immediately available for authorization checks
The legacy RBAC system and new Zanzana system remain in sync
Users experience consistent permission enforcement regardless of which backend is queried
safe to revert
* Skip informers if Provisioning disable controllers is enabled
* Hydrate requester correctly for Grafana Live
* revert to old code because eventualRestConfig provider issues
---------
Co-authored-by: Charandas Batra <charandas.batra@grafana.com>
* Coverage: Add some DX improvements to by codeowner script
* Potential fix for code scanning alert no. 3796: Shell command built from environment values
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* Potential fix for code scanning alert no. 3797: Shell command built from environment values
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* fix package.json and yarn lock
* reorder imports
* fix issue for frontend-platform: exclude files in any /test/ dir
* wip
* add ora spinner for codeowners manifest step
* cleanup
---------
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* fix: SQLite truncate with retry/backoff on busy/locked errors
* fix: use retryer package for retrying SQLite TruncateDBTables
* fix: use dskit/backoff package to return last error
* fix: do not log number of attempts
* go get github.com/grafana/grafana-plugin-sdk-go@v0.281.0
* make update-workspace
* updated failing unit test
* disable deprecation warnings
* datasources: allow underscore-prefixed local time range
* updated go.work.sum
* [APIServer] Add the method RegisterAPIInstaller to the APIRegistrar interface, and implement it in the builder. This allows new installer-based apps to register themselves in enterprise.
* Rename RegisterAPIInstaller to RegisterAppInstaller
* NewGauge: Fix segmented gauge with min value != 0
* update gdev dashboard to exercise case
* update gdev dashboard with panel to exercise
* update
---------
Co-authored-by: Paul Marbach <paul.marbach@grafana.com>
This is because MySQL doesn't support storing of NaN valuels, and therefore go-mysql-server isn't going to either.
Float fields/columns are always mapped to be nullable now, otherwise we would have to replace NaN/Inf with 0.
Hide error notifications in kiosk mode on dashboards
Suppress error alerts when dashboard is viewed in kiosk mode
Kiosk mode is typically used for TV displays without interaction
Other notification types (success, warning, info) remain visible
---------
Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
* Redirect to first available dashboard on select
* Check currently active url before redirecting
* Expand currently selected group on selection
* Add unit test
* Test group expansion on URL change
* Don't expand any group if the active item is already in an expanded one
* Mock dashboardsService better
* Fix linitng issue
* Add and remove subscrioption based on open state
* Extract scope navigation utils
* Fix import order
* Fix import path
* Add redirection tests to ScopesSelectorService
* Fix import order
* add check for prom dep auth check in grafana advisor
* remove non prom DS
* clean up and add grafana docs links
* lint
* tests
* Apply suggestions from code review
Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
* Thank you for your great feedback @andresmgot
* caching now resets on refresh. also check if plugin is installed
* remove unused errors
* add steps back sigh
* make naming clearer
---------
Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
Dashboard Migration: Fix v38 table panel overrides migration when defaults.custom is missing
The v38 migration was incorrectly skipping field config overrides processing
when fieldConfig.defaults.custom didn't exist. This caused custom.displayMode
properties in overrides to not be migrated to the new custom.cellOptions format.
The fix ensures migrateOverrides is always called for table panels, regardless
of whether defaults.custom exists.
Added comprehensive unit test covering this edge case to prevent regression.
Issue discovered through comprehensive migration testing infrastructure.
Fix v16 grid position calculation for fractional spans
Match frontend span-to-width conversion logic by flooring span first,
then multiplying by width factor, instead of multiplying first then flooring.
This fixes dashboard layout inconsistencies where panels with fractional
spans (e.g. 5.929860088365242) would have different widths between
backend and frontend migration paths.
- Backend old: Math.floor(5.93 * 2) = Math.floor(11.86) = 11
- Backend new: Math.floor(5.93) * 2 = 5 * 2 = 10 (matches frontend)
Includes comprehensive unit test to prevent regression.
* community contributions: update developers/contribute.md
* fix links
* guidance on comm channels
* changed order in no code contrib
* modifed help wanted label
* community: detail tech contributions section
* detailed tech contribution sections
* changed items in step by step
* modified list items
* formated sections
* added section for issues
* format-sections
* added-link
* prettier
* added guidance on comm channels
* Update CONTRIBUTING.md
Added "making technical contributions, with or without code" section in the introductory part to improve the flow of information
* header and link to github
* all pretty no pity
* Update CONTRIBUTING.md
Fixed formatting to avoid Prettier issues again
* changed order of items
* added links
* Update CONTRIBUTING.md
Co-authored-by: Simon Prickett <simon@crudworks.org>
* Update CONTRIBUTING.md
Co-authored-by: Simon Prickett <simon@crudworks.org>
* Update CONTRIBUTING.md
Co-authored-by: Simon Prickett <simon@crudworks.org>
* Update CONTRIBUTING.md
Co-authored-by: Simon Prickett <simon@crudworks.org>
* removed ordered list
---------
Co-authored-by: ewamag <eva.magiera@gmail.com>
Co-authored-by: Simon Prickett <simon@crudworks.org>
* Add rule index as a part of the rule matching process
* Refactor rule matching to use a dedicated RulePositionHash type
- Introduced a new `rulePositionHash.ts` file to define a branded type for rule positions.
- Updated rule matching logic to utilize the new `createRulePositionHash` function for generating rule position hashes.
- Adjusted related components and tests to ensure consistent handling of rule indices and positions.
* Docs: Add contact point specific text formatting examples to notification templates
* Add Slack formatting examples with *bold* and _italic_ syntax
* Clarify that text formatting depends on contact point type
* Docs: Add contact point specific text formatting examples to notification templates
* Reflect review that fix docs
* migrate to v2
* Fix tests
* graphite panels should be auto-migrated
* lint
* Provisioning: Fix dashboard export to preserve original API version
* Add error handling for the edge case where conversion fails but no
storedVersion is available.
* add /-/fe-boot-error endpoint to track errors starting the frontend service
* use promauto package
* move metric to root
* check error of r.Body.Close()
* Convert unique keys in file and file_meta tables into primary key.
* Fix panic.
* Fix comment.
* Always add migration to drop auto-generated PK.
* Drop and create PK for mysql in single statement.
* Drop my_row_id column too. (Please drop primary key column to be able to drop generated invisible primary key.)
* Annotations: Honor dashboardUID on dashboardsWithVisibleAnnotations
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
---------
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* implement create method for team bindings
* generate openapi specs
* enable dual writer for team bindings
* add validation rules
* generate openapi
* add integration tests and fix remaining issues
* fix validation test
* use UIDs instead of IDs to build team binding name
* use IDs when generating the TeamBinding name
* fix build error
* remove time truncate
* Remove default creator can Admin permissions for folders
* Actually, we only need to set permissions for root level folders
* Put back creator permission
* linting
* use FT for assessing what permissions to set
* fix tests
* migrate to v19
* migrate to v18
* Migration to be verified: v17 Convert minSpan to maxPerRow in panels
* Migration to be verified: 16 Grid layout migration
* Refactor v17 and v19 migrations to use shared helper functions
* Migration to be verified: 15 No-op migration for schema consistency
* Migration to be verified: 14 Shared crosshair to graph tooltip migration
* cleanup
* wip
* complete migration
* fix lint issues
* refactor and test with minimal graph config
* update tests
* migrate to v12
* extract defaults outside the func
* lint
* lint
* add missing showValues prop
* migrate to v11
* migrate to v10
* add test files
* update
* migrate to v9
* migrate to v8
* add context and fix latest version
* add context
* add context
* generate snapshots
* v13 should be no-op
* clean up
* fix tests
* add context
* snapshots
* generate snapshots
* update
* snapshots
* wip
* fix test
* remove nav when cleaning up defaults
* migrate to v6
* update comments
* migrate to v5
* remove v28
* remove singlestat migraiton from frontend migrator because this is an automigration
* remove unused function
* Remove v24 table plugin logic
* cleanup
* remove plugin version for automigrate as it was used only in v24 and v28 that have been removed
* cleanup
* update snapshot
* update snapshot
* update snapshot
* update snapshot
* update snapshot
---------
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
* migrate to v19
* migrate to v18
* Migration to be verified: v17 Convert minSpan to maxPerRow in panels
* Migration to be verified: 16 Grid layout migration
* Refactor v17 and v19 migrations to use shared helper functions
* Migration to be verified: 15 No-op migration for schema consistency
* Migration to be verified: 14 Shared crosshair to graph tooltip migration
* cleanup
* wip
* complete migration
* fix lint issues
* refactor and test with minimal graph config
* update tests
* migrate to v12
* extract defaults outside the func
* lint
* lint
* add missing showValues prop
* migrate to v11
* migrate to v10
* add test files
* update
* migrate to v9
* migrate to v8
* add context and fix latest version
* add context
* add context
* generate snapshots
* v13 should be no-op
* clean up
* fix tests
* add context
* snapshots
* generate snapshots
* update
* snapshots
* wip
* fix test
* remove nav when cleaning up defaults
* migrate to v6
* update comments
* remove v28
* remove singlestat migraiton from frontend migrator because this is an automigration
* remove unused function
* Remove v24 table plugin logic
* cleanup
* remove plugin version for automigrate as it was used only in v24 and v28 that have been removed
* cleanup
* update snapshot
* update snapshot
* update snapshot
* update snapshot
* remove test
---------
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
* Add basic drawers for rules and instances
* Add query visualization for instances
* Display threshold on graphs when available
* Add basic history state transitions
* Query and annotations chart for alert instance
* Use SceneDataNode to merge query and annotations
* Split drawer components into more files
* move the drawer to the workbench so we can persist its state with
pagination
updates the drawer contents to align closer to what we have for the
detail view
* Don't collapse summary on empty values
* Improve data loading in InstanceDetailsDrawer
* Refactor history data conversion
* Tidy up state history data conversion
* Replace rule name link with a dedicated drawer button
* remove filter text
* Improve history time series handling
* Improve rule details header
* Update translations
* Use custom filter function for instance series filtering
* Fix instances matching algorithm
* make very long rule names span multiple rows
---------
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
* docs: add comprehensive dashboard migration documentation
- Add detailed schema version migration guide with step-by-step instructions
- Reorganize main migration README to focus on conversion-level practices
- Add monitoring section with metrics, logging, and error handling
- Include comprehensive testing strategies for backend and frontend
- Provide clear separation between conversion practices and implementation details
* chore: update .gitignore
* Update .gitignore
* change parsing to allow binary expression as long as it is not between two number literals
* add clamp function to monaco editor so it can be highlighted
* remove warning being thrown for binary operations
* modify parsing logic to respect the order of binary operations
* fix logic for when to increment offset for binary operations
* fix typo in comment
* Update packages/grafana-prometheus/src/querybuilder/parsing.ts
Fix typo in comment
Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
---------
Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
* Dashboards: Add restricted extension point for empty state
* FeatureToggles: Regenerate files with new toggle
* Dashboards: Pass default empty UI as component, not children
* Dashboards: Expose hooks for empty state methods to extensions
* Dashboards: Move empty state button hooks to dedicated file
* Dashboards: Render loader while empty state plugin components loading
* Dashboards: Pass empty state default UI as method
* Dashboards: De-duplicate hook usages in empty state
* Dashboards: De-duplicate read-only repo check in empty state
* migrate to v19
* migrate to v18
* Migration to be verified: v17 Convert minSpan to maxPerRow in panels
* Migration to be verified: 16 Grid layout migration
* Refactor v17 and v19 migrations to use shared helper functions
* Migration to be verified: 15 No-op migration for schema consistency
* Migration to be verified: 14 Shared crosshair to graph tooltip migration
* cleanup
* wip
* complete migration
* fix lint issues
* refactor and test with minimal graph config
* update tests
* migrate to v12
* extract defaults outside the func
* lint
* lint
* add missing showValues prop
* migrate to v11
* migrate to v10
* add test files
* update
* migrate to v9
* migrate to v8
* add context and fix latest version
* add context
* add context
* generate snapshots
* v13 should be no-op
* clean up
* fix tests
* add context
* snapshots
* generate snapshots
* update
* snapshots
* wip
* fix test
* remove nav when cleaning up defaults
* remove v28
* remove singlestat migraiton from frontend migrator because this is an automigration
* remove unused function
* Remove v24 table plugin logic
* cleanup
* remove plugin version for automigrate as it was used only in v24 and v28 that have been removed
* cleanup
* update snapshot
* update snapshot
* update snapshot
* lint
---------
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
* migrate to v19
* migrate to v18
* Migration to be verified: v17 Convert minSpan to maxPerRow in panels
* Migration to be verified: 16 Grid layout migration
* Refactor v17 and v19 migrations to use shared helper functions
* Migration to be verified: 15 No-op migration for schema consistency
* Migration to be verified: 14 Shared crosshair to graph tooltip migration
* cleanup
* wip
* complete migration
* fix lint issues
* refactor and test with minimal graph config
* update tests
* migrate to v12
* extract defaults outside the func
* lint
* lint
* add missing showValues prop
* migrate to v11
* migrate to v10
* add test files
* update
* migrate to v9
* migrate to v8
* add context and fix latest version
* add context
* add context
* generate snapshots
* v13 should be no-op
* clean up
* fix tests
* add context
* snapshots
* generate snapshots
* update
* snapshots
* fix test
* remove v28
* remove singlestat migraiton from frontend migrator because this is an automigration
* remove unused function
* Remove v24 table plugin logic
* cleanup
* remove plugin version for automigrate as it was used only in v24 and v28 that have been removed
* cleanup
* update snapshot
* update snapshot
* update snapshot
---------
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
* migrate to v19
* migrate to v18
* Migration to be verified: v17 Convert minSpan to maxPerRow in panels
* Migration to be verified: 16 Grid layout migration
* Refactor v17 and v19 migrations to use shared helper functions
* Migration to be verified: 15 No-op migration for schema consistency
* Migration to be verified: 14 Shared crosshair to graph tooltip migration
* cleanup
* wip
* complete migration
* fix lint issues
* refactor and test with minimal graph config
* update tests
* migrate to v12
* extract defaults outside the func
* lint
* lint
* add missing showValues prop
* migrate to v11
* migrate to v10
* add test files
* update
* migrate to v9
* add context and fix latest version
* add context
* add context
* generate snapshots
* v13 should be no-op
* clean up
* fix tests
* add context
* snapshots
* generate snapshots
* update
* fix test
* remove v28
* remove singlestat migraiton from frontend migrator because this is an automigration
* remove unused function
* Remove v24 table plugin logic
* cleanup
* remove plugin version for automigrate as it was used only in v24 and v28 that have been removed
* cleanup
* update snapshot
* update snapshot
* update snapshot
---------
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
* Link to Grafana Pathfinder if available
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* refactor: `getComponentIdFromComponentMeta()` only receives the title
* Making sure we pass helpNode without Parents to the pathfinder app.
* minor refactoring to isolate the code.
* Fix tests
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* cleaned up the structure and exposing the helpNavItem via a hook
* added missing files.
* Add support for old and new pathfinder IDs
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Rename hook for consistency
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
---------
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
* Update targeting key to namespace
* Pass eval ctx attributes to frontend
* Add context config to the frontend
* Fix OF namespace not defined in e2e tests
* Set default namespace and targeting key
* remove e2e server config now that namespace is default
---------
Co-authored-by: joshhunt <josh.hunt@grafana.com>
* spike
* Improvements
* Let users choose what grid to convert to
* fix lint
* make sure we don't get multiple undo entries when ungrouping. Also move cancel button
* updates from review
* Clear parent when merging default grid
* migrate to v19
* migrate to v18
* Migration to be verified: v17 Convert minSpan to maxPerRow in panels
* Migration to be verified: 16 Grid layout migration
* Refactor v17 and v19 migrations to use shared helper functions
* Migration to be verified: 15 No-op migration for schema consistency
* Migration to be verified: 14 Shared crosshair to graph tooltip migration
* cleanup
* wip
* complete migration
* fix lint issues
* refactor and test with minimal graph config
* update tests
* migrate to v12
* extract defaults outside the func
* lint
* lint
* add missing showValues prop
* migrate to v11
* migrate to v10
* add test files
* update
* add context and fix latest version
* add context
* add context
* generate snapshots
* v13 should be no-op
* clean up
* fix tests
* add context
* snapshots
* generate snapshots
* fix test
* remove v28
* remove singlestat migraiton from frontend migrator because this is an automigration
* remove unused function
* Remove v24 table plugin logic
* cleanup
* remove plugin version for automigrate as it was used only in v24 and v28 that have been removed
* cleanup
* update snapshot
* update snapshot
---------
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
* migrate to v19
* migrate to v18
* Migration to be verified: v17 Convert minSpan to maxPerRow in panels
* Migration to be verified: 16 Grid layout migration
* Refactor v17 and v19 migrations to use shared helper functions
* Migration to be verified: 15 No-op migration for schema consistency
* Migration to be verified: 14 Shared crosshair to graph tooltip migration
* cleanup
* wip
* complete migration
* fix lint issues
* refactor and test with minimal graph config
* update tests
* migrate to v12
* extract defaults outside the func
* lint
* lint
* add missing showValues prop
* migrate to v11
* add test files
* update
* add context and fix latest version
* add context
* add context
* generate snapshots
* v13 should be no-op
* clean up
* fix tests
* snapshots
* fix test
* remove v28
* remove singlestat migraiton from frontend migrator because this is an automigration
* remove unused function
* Remove v24 table plugin logic
* cleanup
* remove plugin version for automigrate as it was used only in v24 and v28 that have been removed
* cleanup
* update snapshot
* es lint
---------
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
* migrate to v19
* migrate to v18
* Migration to be verified: v17 Convert minSpan to maxPerRow in panels
* Migration to be verified: 16 Grid layout migration
* Refactor v17 and v19 migrations to use shared helper functions
* Migration to be verified: 15 No-op migration for schema consistency
* Migration to be verified: 14 Shared crosshair to graph tooltip migration
* cleanup
* wip
* complete migration
* fix lint issues
* refactor and test with minimal graph config
* update tests
* migrate to v12
* extract defaults outside the func
* lint
* lint
* add missing showValues prop
* update
* add context and fix latest version
* add context
* generate snapshots
* v13 should be no-op
* clean up
* fix tests
* fix test
* remove v28
* remove singlestat migraiton from frontend migrator because this is an automigration
* remove unused function
* Remove v24 table plugin logic
* cleanup
* remove plugin version for automigrate as it was used only in v24 and v28 that have been removed
* cleanup
* es int
---------
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
SQLite dialect now checks column existence via PRAGMA table_info, enabling
IfColumnNotExistsCondition to work correctly. Previously, BaseDialect returned
empty SQL, so AddColumn ran unconditionally and could fail with
“duplicate column name” under parallel CI runs.
- Prevents duplicate-column errors in SQLite migrations (e.g. unified storage
adding previous_resource_version) when migration locking/logging don’t serialize
execution.
- No change for other dialects.
* name field must match either k8s regex or grafana legacy uid regex. Adds tests.
* moves invalid test to being valid
* uses new US naming validation for kv store validation
* fix function name and update key regex
* fix comment
* use correct errs var
* updates kv key tests
* migrate to v19
* migrate to v18
* Migration to be verified: v17 Convert minSpan to maxPerRow in panels
* Migration to be verified: 16 Grid layout migration
* Refactor v17 and v19 migrations to use shared helper functions
* Migration to be verified: 15 No-op migration for schema consistency
* Migration to be verified: 14 Shared crosshair to graph tooltip migration
* cleanup
* wip
* complete migration
* fix lint issues
* refactor and test with minimal graph config
* update tests
* extract defaults outside the func
* lint
* lint
* add missing showValues prop
* add context and fix latest version
* generate snapshots
* v13 should be no-op
* clean up
* remove v28
* remove singlestat migraiton from frontend migrator because this is an automigration
* remove unused function
* Remove v24 table plugin logic
* cleanup
* remove plugin version for automigrate as it was used only in v24 and v28 that have been removed
* cleanup
---------
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
* Use timestamps reported via GetResourceLastImportTimes to trigger index rebuilds.
* Add test for old last import time.
* Don't reindex after bulk-import. It is now done indirectly via LastImportTime on all instances that own the index.
* feat: add schema changes for a switch type of dashboard variable
* fix: generated go
* feat: add support for a switch type of dashboard variable
* chore: update `@grafana/scenes` to a canary version
* feat: add variable editor for the switch variable
* fix: remove unnecessary jest config change
* chore: remove commented out code
* LastImportTime for resource.
* Make StorageBackendImpl implement GetResourceLastImportTimes
* More missing implementations of GetResourceLastImportTimes
* Fix import.
* Skip TestGetResourceLastImportTime in TestBadgerKVStorageBackend.
* Implement GetResourceLastImportTimes by mockStorageBackend
* Bump test tolerance.
* Fix postgres query and timezone.
* Fix postgres query and timezone.
* Make linter happy.
* add basic theme-playground page
* basic theme playground
* generate schema
* sort of include the schema
* proper json schema
* add base theme
* bit of tidy up
* don't use appEvents.emit
* tidy up ThemeDemo
* extract translations
* add CODEOWNERS
* feat(script): generate a source file x teams manifest from CODEOWNERS
* feat(script): unit tests + coverage report only for files owned by team
* feat(script): calculate CODEOWNERS metadata
* refactor(script): export a pure codeowners manifest generation function
* refactor(script): export a pure test coverage by team function
* refactor(script): generate raw JSONL codeowners data from Node.js script
* feat(script): put codeowners manifest all together in one script
* refactor(scripts): group consistently with NPM script name
* refactor(scripts): deduplicate constants for file paths etc.
* refactor(scripts): make console output cute 💅✨
* refactor(tests): make coverage by "owner" directory more human readable
* refactor(scripts): use consistent naming "codeowner" instead of "team"
* chore(codeowners): mark DataViz as owners of scripts for now
* chore(todo): leave a note where coverage metrics should be emitted later
* fix(gitignore): ignore root codeowners-manifest directory not scripts/*
* refactor(script): rename manifest to generate for clarity
* docs(readme): add a brief README describing new scrips
* chore(linter): ignore temporary files in prettier, fix whitespace format
* refactor(script): simplify Jest config by using team files list directly
* refactor(script): simplify script, partition sourceFiles and testFiles
* refactor(script): simplify and parallelize manifest write operations
* fix(script): handle errors for JSONL line reader
* refactor(script): use Map instead of POJOs
* fix(script): handle errors when streaming raw JSONL output
* fix(script): add error handling, and use promise API for metadata check
* fix(reporter): suppress duplicate Jest CLI coverage report output
* refactor(script): simplify with fs promises API for consistency
* fix(script): error handling for cp spawn-ed process
* refactor(script): use Promise API for mkdir + exists
* refactor(script): use fs Promise API
* refactor(script): use fs Promise API
* fix(script): same allow list for sourceFilter and all Jest config rules
Co-authored-by: Paul Marbach <paul.marbach@grafana.com>
* fix(script): bust cache when new files are created also
---------
Co-authored-by: Paul Marbach <paul.marbach@grafana.com>
* started new configure doc
* updates to the configure doc
* worked on variables doc
* made edits
* query editor edits
* query editor updates
* continued with updates
* added updates
* additional updates, rewrite of auth doc
* finished query editor updates
* cleaned up the intro doc, added ref URIs to other docs
* some final edits
* more edits prior to PR creation
* ran prettier, added a screenshot
* linter fixes
* updates based on questions doc
* ran prettier
* updates based on feedback
* made more edits based on feedback
* more updates based on feedback
* updates based on feedback
* moved alerting under logs
* ran prettier
* Docs: Add a note about email being required and the usage of sub claim
* Update docs/sources/setup-grafana/configure-security/configure-authentication/generic-oauth/index.md
Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
---------
Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
* remove unused compat functions
* update to alerting module from pr
* replace IntegrationConfig with IntegrationSchemaVersion
* safely resolve a string into integration type
* change usages of integration config
* WIP column layout
* add columns on top of splitter
* small layout fixes
* WIP grouped items
* WIP
* WIP
* WIP
* small refactoring
* some more WIP
* WIP
* refactoring some functions
* use "unknown" state intstead of assuming "normal" state
* Add groupBy filter
* Add label-based filter
* Add basic displaying of grouped data
* lint
* Fix timeline alertstate selection
* Add AlertInstanceScene for displaying instances
* Add WorkbenchContext to pass column width and domain deeper into the tree
* Update single rule query, merge pending and firing metrics into one instance
* use area chart for summary
* Add not working rule summary
* step interpolation for summary chart
* Add rule state chart
* Update panel settings for alert rule summary
* Reactify SummaryChart component
* WIP react version
* Reactify AlertRuleDetails component
* Reactify AlertRuleSummary component
* refactor summary chart a bit
* clean up – Reactify
* set min y-scale for rule summary
* remove macro code
* small fixes
* remove line width for summary
* attempt to make the instances a native chart
* native chart for instances part 2
* sync cursor crosshair
* extract instance row into separate component
* Add minHeight for rows without labels
* Add Summary component
* Move scrolling to rows container
* Add lazy rendering of rows
* Use default page size
* minor layout tweaks
* typescript fixes
* simplify the grouping / data frame processing
* big cleanup of code
* split up rows components
* further split row components
* moving files around
* use text summary stats
* link to alert rule
* various eslint and typescript fixes
* do not compute common labels for single series
* small UI updates
* add depth support and colored labels
* simplify with props type
* Reuse Workbenck query to populate alert rule summaries
* add custom folder row component and set as default
* small UI tweaks
* remove unused sticky
* Hide triage page behind a feature toggle
* Add loading states to workbench and alert rows
* Update translations
* ✨
* Fix lint errors
* Fix EditorColumnHeader rendering, remove unused code
* Update translations
* Move EditorColumnHeader to shared components directory
* add type string for union discrimination of row
---------
Co-authored-by: Konrad Lalik <konradlalik@gmail.com>
* devenv: fix volumes section when sources don't contain one
* wip
* Working correctly with improvedExternalSessionHandling on
* Remove not needed lines
* Working with the old flow, tests
* Handle compatibility with the feature toggle, tests wip
* Tests
* Cleanup
* Address feedback
* Align tests
* Add comment
* Fix issue with session removal after the invalidation of tokens
* Remove commented out code
* clean up
* initial basic OpenFeature client for datasource class
* add dep
* update, use a wrapping function to enforce types
* move init OF to grafana-runtime
* docs
* Fix circular dependency causing tests to fail
* codeowners
* use toggle in datasourcewithbackend
* Fix CUJs group-by test
* Comments
* update docs, make default value mandatory
* revert using for queryServiceFromUI toggle
Fix span: 0 bug and panel ordering in v16 dashboard migration
Fix span: 0 handling to match frontend behavior by defaulting to DEFAULT_PANEL_SPAN.
Fix panel ordering issue by using stable sort instead of unstable sort.
Fix collapsed property handling to only set when input row has collapse property.
Add comprehensive test cases for span: 0 bug and collapsed property behavior.
Add sanitized test input file for span: 0 demo dashboard with generic values instead of internal Grafana infrastructure references.
All backend migration tests and frontend comparison tests pass.
* Don't update index more often than specified index_min_update_interval.
* Add artificial sleep at the end of write operations.
* Improve test: check for number of update calls, make diff check less flaky.
* Make test less flaky by allowing for higher diff variance.
* Make test less flaky by allowing for expected update calls variance.
* Add tracing to feature flags service
* Apply review feedback
* Apply suggestion from @hairyhenderson
Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
* Apply suggestion from @hairyhenderson
Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
* Apply suggestion from @hairyhenderson
Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
* Apply suggestion from @hairyhenderson
Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
* Apply suggestion from @hairyhenderson
Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
* Apply suggestion from @hairyhenderson
Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
* Fix issues
---------
Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
* everything compiles
* tests pass
* remove file included by accident
* add entry to gitignore
* some scaffolding for the migration executor
* remove file
* implement and test the migration
* use xkube.Namespace in our interfaces
* add todo
* update wire deps
* add some logs
* fix wire dependency ordering
* create tests to validate error conditions during migrations
* Don't error on recording rules without conditions
The provisioning model doesn't include conditions for recording rules.
Only return an error for a missing condition if the rule isn't a
recording rule.
Also, added a test case to show the failure.
This resolves#109398
* Run `go fmt` to fix whitespace issues
Migrate `spec.title` and `spec.name` fieldSelectors to use base64URL
encoded `metadata.name` selectors since the `spec` properties aren't
indexed and no longer searchable in the new app platform API.
* update alerting module
* replace compat with ones from alerting
* update type references Receiver and Integration to *Status
* update route in provisioning test that is invalid after recent change
* use right type for LINE ingtegration
* implement team update in legacy store
* add unit tests
* add integration test
* set permissions for user in integration tests
* add more integration tests for update
* update validations
* add unit tests for ValidateOnUpdate() func
* fix integration test
* docs(alerting): add settings for alert evaluation backoff retries
* docs(alerting): add mention of backoff settings on the Error state docs
* fix vale prose
s/time_series/timeseries and change from underscores to hyphens in numeric and ts types
This makes it more consistent with the other timeseries kind strings
* Revert "Alerting: Generate simplified routing routes with old fingerprint function (#111893)"
This reverts commit 0da9d49896.
* Add alertingUseNewSimplifiedRoutingHashAlgorithm flag
* Alerting: Add feature toggle to use the old simplified routing hash generation
Handle HTML response for functions endpoint
- If the endpoint starts with < return an error
- Update tests
- Catch error in FE and use default functions
* disable cgo by default for local builds, also set cgo variable in either case
* actually do not set the default value
* disable cgo for darwin, display sqlite driver in logs
* fix linter warning, although I do not fully agree with it
* Add feature flag for multiple scopes endpoint usage
* Add method to API client for fetching multiple ScopeNodes at the same time
* Add parent title to tree
* Get nodes from cache too
* Update test with new functionality
* Update test
* Fix linting issue
* Remove unapplied scope parents
* Recusively load nodes, and insert into tree
* Remove console.logs
* Simply functions
* Always show recent scopes category
* Fix issues with parent node remaining in URL
* Always display recent scopes
* Make sure chdilren are loaded when collapsing
* Add test cases for expanded items and imrpove a11y markup
* Remove recent scopes always showing and update tests
* Fix linting issue
* Move insertPathNodesIntoTree to treeUtils
* Add test for insertPathNodesIntoTree
* Remove comment
* also disable incremental querying when the dashboard is public
* add tests for disabling incremental querying if public dashboards are being used
* move public dashboard check earlier
* adding some logs to better understand what might be happening
* only focus this PR on improve logging in finalizer handling
* debug log before calling finalizers
* working on finalizers
* removing last todos, adding unit tests
* better use SupportedFinalizers name
* addressing comments
* wip: fix tests and add delete error in status
* chore: codegen
* chore: codegen openapi
* Merge remote-tracking branch 'origin/main' into provisioning-finalisers-fix-2
* update frontend client
* fix: errors in testing
* fix: breaking test
---------
Co-authored-by: Daniele Ferru <daniele.ferru@grafana.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
- Fix metricEditorMode logic to match frontend hasOwnProperty behavior
- Fix metricQueryType to only set when property doesn't exist
- Fix statistics processing to handle all types like frontend does
- Fix null statistic handling to match frontend behavior
- Fix object string representation to match JavaScript behavior
- Add comprehensive test coverage for all CloudWatch migration scenarios
- Achieve 100% backend-frontend consistency for v34 migration
* Fix v34 CloudWatch migration backend-frontend inconsistencies
- Fix metricEditorMode logic to match frontend hasOwnProperty behavior
- Fix metricQueryType to only set when property doesn't exist
- Fix statistics processing to handle all types like frontend does
- Fix null statistic handling to match frontend behavior
- Fix object string representation to match JavaScript behavior
- Add comprehensive test coverage for all CloudWatch migration scenarios
- Achieve 100% backend-frontend consistency for v34 migration
* Improve v34 CloudWatch migration test coverage
- Add targeted tests for hasOwnProperty logic coverage
- Add comprehensive getSuffixForStat coverage (all data types)
- Add generateNextRefId double letter generation tests
- Simplify test cases while maintaining full coverage
- Achieve 93%+ coverage on all critical v34 functions
- Remove redundant test cases for better maintainability
* Clean up v34 CloudWatch migration code
- Remove unnecessary comments and documentation
- Simplify function signatures and logic
- Maintain functionality while improving readability
- Keep essential logic intact with cleaner code
* Only remove unnecessary comments
What is this feature?
This PR implements a jitter mechanism for periodic alert state storage to distribute database load over time instead of processing all alert instances simultaneously. When enabled via the state_periodic_save_jitter_enabled configuration option, the system spreads batch write operations across 85% of the save interval window, preventing database load spikes in high-cardinality alerting environments.
Why do we need this feature?
In production environments with high alert cardinality, the current periodic batch storage can cause database performance issues by processing all alert instances simultaneously at fixed intervals. Even when using periodic batch storage to improve performance, concentrating all database operations at a single point in time can overwhelm database resources, especially in resource-constrained environments.
Rather than performing all INSERT operations at once during the periodic save, distributing these operations across the time window until the next save cycle can maintain more stable service operation within limited database resources. This approach prevents resource saturation by spreading the database load over the available time interval, allowing the system to operate more gracefully within existing resource constraints.
For example, with 200,000 alert instances using a 5-minute interval and 4,000 batch size, instead of executing 50 batch operations simultaneously, the jitter mechanism distributes these operations across approximately 4.25 minutes (85% of 5 minutes), with each batch executed roughly every 5.2 seconds.
This PR provides system-level protection against such load spikes by distributing operations across time, reducing peak resource usage while maintaining the benefits of periodic batch storage. The jitter mechanism is particularly valuable in resource-constrained environments where maintaining consistent database performance is more critical than precise timing of state updates.
* Rename this heading to match the link in 'Request Initiation'
* Fix link to 'Configure SAML using the Grafana configuration file' and make the link text match
* datasource(postgresql): add support of pgpass file
* remove `required` label for password field
* set `runPostgresTests` back to false
* fix after merge conflict
* add pgx_test
* set `runPostgresTests` back to `false`
* Add `no password` test case to the `pgx_test.go` as well
* fix `postgres_pgx_test.go`
* Update datasource docs
* docs wording
* docs: `datasource` -> `data source`
* Update docs/sources/datasources/postgres/configure/_index.md
Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
* run prettier - docs
---------
Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
* update tests to assert against snapshot
* remove channel_config package replaced by schemas from alerting module
* update references to use new schema
* implement delete in team API
* add unit tests for legacy sql
* add integration tests
* remove comment
* remove org_id from delete team sql command
* fetch team ID before deleting it
* feat(plugins): externalise jsx-runtime to prevent plugins bundling separate versions
* feat(plugins): provide react/jsx-dev-runtime to plugins to prevent prod only bugs
There was a [fix](https://github.com/grafana/grafana-google-sdk-go/pull/17) for lock in grafana-google-sdk-go v0.4.2.
It has not been incorporated in grafana core yet, and is causing
incidents:
#incident-2025-09-24-prod_us_central_0_google_monitoring_errors
* Modify index eviction mechanism such that unowned indexes are also evicted.
* Propagate OwnsIndex function to bleve backend
Fix tests.
Stop eviction goroutine when stopping backend.
Make linter happy.
Make sure we stop backend created by tests.
Review suggestion.
Removed newline.
* Add a CI step for checking app SDK codegen status
What
This commit adds a CI step for checking the status of code generated
with Grafana App SDK. The step fails if there is a git diff as a result
of the codegen step.
It also updates generated code to make sure we're starting from a
correct state.
Why
This ensures that when the schemas or the SDK version are updated, the
codegen mismatch is caught early at the PR stage.
Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
* Format generated code
Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
---------
Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
* Use the new authorizer for the User resource
* Use accessClient
* Update pkg/services/authz/rbac/mapper.go
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
---------
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
[apiserver] Fix appinstaller.serverWrapper.RegisteredWebServices() to return the RegisteredWebServices from the underlying apiserver's Handler's GoRestfulContainer, matching the logic in grafana-app-sdk's apiserver.KubernetesGenericAPIServer
* migrate to new manifest format
* rename app to alerting.notifications to not conflict with rules
* disable custom field selectors as they are not supported in appinstaller
* feat(investigations): add "Investigations" menu if loop enabled
* feat(investigations): move to `shouldIncludeInvestigations`
* feat(investigations): add issue link
* Base logic to show saved query buttons in annotations, v1 dashboards only
* Add support for v2
* remove unnecessary function
* add TODO for checking logic later and clean up code
* Fix issue on cross-datasource replacement
* remove unnecesary async
* refactor code, call the prepareAnnotation in savedQueryUtils instead of relying on verifyDatasource
* Add unit tests
* Refactor code, add comments for context
* Add missing unit tests
* Fix issue of skipping prepareAnnotation always, added skipping only for replace saved queries scenarios, added unit
tests
* implement datasource-agnostic query normalization
* Dashboard Scenes: Fix missing Ctrl+O keyboard shortcut for crosshair toggle
- Add missing mod+o keybind to dashboard scenes keyboard shortcuts
- Implement crosshair state cycling (Default -> Crosshair -> Tooltip -> Default)
- Add comprehensive unit tests for keyboard shortcuts functionality
- Add e2e test to verify shortcut works and prevents browser file dialog
- Fix ensures parity between legacy and scenes dashboard implementations
Fixes issue where Ctrl+O/Cmd+O was opening browser file dialog instead of
toggling shared crosshair modes in scenes-based dashboards.
* Remove waitForTimeout from e2e test
- Replace arbitrary timeouts with proper element waiting
- Use waitFor with visible state instead of setTimeout
- Improve test reliability and follow Playwright best practices
* Optimize e2e test for crosshair keyboard shortcut
- Remove unnecessary console logging and timeout settings
- Simplify assertions to only check the currently selected radio button
- Improve test performance by reducing DOM queries
- Focus on essential functionality verification
* Fix linting
* create new interaction profiler behaviour and also use it to measure scopes fetching times
* PR mods
* refactor
* add canary scenes
* refactor
* refactor
* canary version
* add config flag for scope measurements
* refactor
* fix
* chore: initial tweaks
* chore: remove shadow
* chore: add reduced motion support, clean up
* chore: clean
* chore: active states tweaks
* Buttons: Add active state / style
* Update ToolbarButton and IconButton
* Update
* Update
* Get rid of important on disabled styles
* Only color for active
* Remove transform bits
---------
Co-authored-by: Galen <galen.kistler@grafana.com>
* Add scopes search highlight with wildcard support
* Change so query is not being applied to parent
* Update e2e tests with more stable selectors
* Fix initial load query
* Use the Highlighter library instead
* Remove unused sanitization
* Remove undefined export
* make validateReceiver private
* make functions and type alias private
* move EncryptedReceivers and DecryptedReceivers to notifier package
to reduce exposure of definitions package via legacy_storage
* return receivers with Grafana origin after create\update
* add tests for ConfigRevision methods
* codegen fix
* Return user role from the legacy store
* Lint
* Add tests, gen openapi
* make generate
* revert go.mod, go.sum, go.work.sum changes
* Update go.mod and go.sum
* add isruleEditable check in per rule ui and details page
* add tests
* update translations
* revert logic for not editable rules => we will allow adding/deleting/updating enrichments per this rule
* update translations
* update test
* pr feedback
* lint
* initialize permissionstore if ignoring legacy storage
* pass through feature toggles
* extract repeated logic to method
* remove extra TODOs
* workspace
* fix path
* fetch depth
* fix missing env var
* limit fetch depth to just 100 commits
* specify version env var
* fix path
* set versions var
* update npm
* Initial npm-publish workflow
* Validate version type and version match, typecheck packages before building, set npm tag
* quote GITHUB_OUTPUT
* codeowners
* fix syntax in release-build
* only tag the latest version with latest
* don't require NPM_TOKEN env var to be set if using OIDC
* put comment back
* tighten script
* Codeowners
* Use workflow_call for canaries, Rename workflow to match release-build
* codeowners
* implement team creation for legacy store
* add generated code
* add basic integration test
* add new fields to get and list teams
* fix sql tests for teams
* register dual writer for team resource
* add generated code
* add more sql tests for team creation
* address feedback
* add integration tests
* Update query type
* Support metric tank queries
- Update tests
- Appropriately set URL parameter
* Support queries via the backend
- Add the filterQuery and applyTemplateVariables methods
- Separate the frontend query path into its own function
- Ensure format is always json
- Add method for building backend query objects (maintain the existing template replacement logic)
- Fix a bug in metric find queries
* Update tests
* Fix lint
* Update types
* add e2e test for custom grid repeats
* update codeowners file
* adjust embedded panel test to account for different base url
* replace waitFor
* run bookmark e2e consecutively
* add repeats e2e tests for auto grid
* clean up
* adjust e2e test
* add e2e test for custom grid repeats
* update codeowners file
* adjust embedded panel test to account for different base url
* replace waitFor
* run bookmark e2e consecutively
* Alerting: move AlertLabels to alerting package
* add story & test for AlertLabel
* export label component from alerting package
* rename Label to AlertLabel
* resolve PR comments
* update imports
* export types from internal
* run yarn i18n-extract
* align with WAI-ARIA standards
* export AlertLabels props
* update failing test
* move labels components to alerting unstable
* alertlabel updates
* update test props
* update types and props
* update test prop types
* update types and props
* add role list to AlertLabel parent
* update story
* ensure color contrast accessibility
* move findCommonLabels into AlertLabels component
* unset size as small for tag
* update logic to get readable colors
* make label and value fonts accessible
---------
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
* New logs panel: add basic show unique labels support
* LogList: switch to useMeasure to detect overflow
* LogList: remove debounce from size calculations reset
* Update test
* LogLine: keep unique labels expanded state between re-renders
* Remove hardcoded true
* LogListModel: add new property
* LogLine: switch to custom resize observer
* Revert removed changes
* Imports order
* Add missing function call in effect
* LogList: use improved debouncing for overflow
* LogLine: refactor resize listeners
* LogLine: mix observer with animation frame
* Prettier
* LogLabels: make button smaller
* LogLine: fix unwrapped unique labels
* Prettier
* LogListContext: sync mode only if not empty
* Revert "LogListContext: sync mode only if not empty"
This reverts commit 2b78249b35.
* module: remove default value
* generate schema for mimir integrations from schema on front-end
* review and fix the settings
* Update GetAvailableNotifiersV2 to return mimir as v0
* add version argument to GetSecretKeysForContactPointType
* update TestGetSecretKeysForContactPointType to include v0
* add type alias field to contain alternate types that different from Grafana's
* add support for msteamsv2
* update ConfigForIntegrationType to look for alternate type
* update IntegrationConfigFromType to use new result of ConfigForIntegrationType
* add reference to parent plugin to NotifierPluginVersion to allow getting plugin type by it's alias
* add tests to ensure consistency
* make API response stable
* add tests against snapshot + omit optional fields
* alerting docs: update list view filtering description
update the description of the list view filter on the view alert rules page.
* img
* Update view-alert-rules.md
* Update view-alert-rules.md
* edit via lauren
* fix(Dropdown): update the boundary to the `.main-view`
* apply floating-ui changes everywhere
* remove some unused imports
* up timeout on this test cause it's unbelievably slow
* don't spread when not necessary
* fix case in panel edit on small screens
---------
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* migrate search queries to the backend
* set duration unit to ms
* remove error log for debugging
* support nested frames and improve url handling
* formatting in search.go
* space
* run make update-workspace
* remove un-necessary fmt.Sprintf
* add support for span table format
* update fn names and re-order
* support raw format
* revert go.mod and go.sum
* remove frontend logic
* remove any types from typescript
* fix golint
* add tests
* fix golangci-lint
* refactor and implement suggestions
* fix tests
* update data frame type
* remove console log
* fix
* use fallthough to traceql type
* use tempo backend for traceql queries
* update tests
* fix golangci-lint
* Correct types for Fields, allow nulls
* add feature toggle definition
* put backend logic behind feature toggle
* Change toggle default to false
* Remove console.log. Fix crash from missing table type
* fix tests
* fix backend tests
---------
Co-authored-by: Andre Pereira <adrapereira@gmail.com>
* add origin to receiver
* populate origin of the receiver
* set CanUse to false if origin is not Grafana
* set provenance if origin is imported
* set Grafana origin by default in conversion API
* set canUse annotation
* reject update\delete operations on resources with origin other than Grafana
* fail to create with wrong origin
* Table: Styling from field
* fix mistake with gdev
* e2e for kitchen sink
* add counter-example in e2e for completeness
* unit tests for utils
* update to store style field per-column, replace util
* optimize branches column-level variables
* Migrate LdapPage from connect() to React-Redux hooks
* Convert LDAP debug page into a drawer and hook it into settings
* prettier
* Use the Text component and make the input and button look like they do on the main settings page.
* Bring back isLoading and put in a LoadingPlaceholder
* i18n-extract
* rejigger
* linter fix
* feat: Add Long Animation Frame API support to dashboard performance monitoring
* Update dashboard profiler integration for long frame detection
- Remove LongFrameConfig parameter from SceneRenderProfiler constructor
- Update documentation to reflect LoAF-first detection strategy with 50ms threshold
- Remove references to configurable thresholds and script attribution
- Update console output examples to match new structured logging format
- Add related documentation reference to scenes PR #1235
* Update to scenes canary version with long frame detection
- Upgrade @grafana/scenes to 6.33.1--canary.1235.17401388269.0
- Upgrade @grafana/scenes-react to 6.33.1--canary.1235.17401388269.0
- Includes long frame detection implementation from PR #1235
- Update yarn.lock with new dependencies
* feat(performance): add PanelPerformanceData interface for panel-level metrics
- Create comprehensive panel performance data structure
- Include timing metrics, performance counters, and context data
- Add pluginLoadedFromCache flag to track cache usage
- Part of panel-level performance attribution implementation
* scenes bump
* Revert "feat(performance): add PanelPerformanceData interface for panel-level metrics"
This reverts commit 8547701672.
* fix lock
* Fix lock
* Chore: Update authlib
* exclude incompatible version of github.com/grafana/gomemcache
* Update go-jose to v4
* fix jose imports
* remove jose v3 from go.mod
* fix tests
* fix serialize
* fix failing live tests
* add v1 of ES256 testkeys. Port tests to use ES256 instead of HS256
* accept more signature algs for okta and azuread
* azure social graph token sig
* accept more signature algs for oauth refresh and jwt auth
* update workspace
* add a static signer for inproc
* rebase and fix ext_jwt
* fix jwt tests
* apply alex patch on gomemcache
* update linting
* fix ext_jwt panic
* update workspaces
---------
Co-authored-by: Jo Garnier <git@jguer.space>
This renames `data` to `expressions` for clarity in the rules apis.
Also makes certain fields that are redundant optional in the case of pure expressions, so that users don't have to specify them when they are not needed (e.g. not datasource queries).
* Adds pruner for eventstore - default 24 hours. Adds tests.
* update comment
* remove delay on startup. formatting
* updates log message type and removes useless comment
* caller handles goroutine for runCleanupOldEvents()
* simplify timestamp extraction
* adds config for event pruning interval
* uses start and end key to get all expired events
* remove sort when listing keys in event pruner - order doesnt matter
* use snowflake constants
* log when we delete 0 rows
* pass time.Time to cleanup old events func
* update bump-version
* Add id-token: write
* update generate-token step
* pull-requests -> pull_requests
* clone with token and set right name
* bump version 12.3.0-pre
---------
Co-authored-by: Kevin Minehart <5140827+kminehart@users.noreply.github.com>
Co-authored-by: grafana-delivery-bot[bot] <grafana-delivery-bot[bot]@users.noreply.github.com>
* support panel actions
* refactor
* add test; move action transformer to utils
* refactor so v2 headers and queryParams are just a simple record
* update open api
* update actions to be same shape accross all dashboard schemas and add validation on the backend
* cleanup
* update snapshot
* add tests to validation
* first go at update implementation
* template tests
* SQL tests
* more tests
* set namespace for read resource permissions
* fix a bug with perms being removed right after they're added
* remove unwanted changes
* fix tests and check error
* PR feedback
* Update pkg/registry/apis/iam/resourcepermission/sql.go
---------
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
* Add sort order to keys func in datastore. Add test to not prune deleted events.
* include sort field in the ListRequestKey instead of it being a separate param
* fix: prevent Intl.DateTimeFormat crash with invalid locales like 'c'
- Add locale validation utilities to prevent crashes when LANG=c is set
- Filter out invalid locales from navigator.languages before creating DateTimeFormat
- Add fallback handling to use browser defaults when all locales are invalid
- Fixes issue #110494 where Grafana crashes with 'RangeError: Incorrect locale information provided'
- Maintains backward compatibility for valid locales
Signed-off-by: Akhil Singh <singhakhil69@gmail.com>
* refactor: simplify locale fix to use direct try-catch approach
- Remove locale-utils.ts and locale-utils.test.ts files
- Use simple try-catch in dates.ts files: try locale, fallback to 'en-US'
- Use Laura's suggested approach in formats.ts with explicit variable declaration
- Remove unused utility exports from index.ts
- Maintains same functionality with cleaner, simpler code
- Avoids adding to public API while still preventing crashes with invalid locales like 'c'
Signed-off-by: Akhil Singh <singhakhil69@gmail.com>
* style: run prettier to fix linting issues
- Format code according to project prettier configuration
- Fixes failing Lint Frontend check
Signed-off-by: Akhil Singh <singhakhil69@gmail.com>
---------
Signed-off-by: Akhil Singh <singhakhil69@gmail.com>
What
This commit refactors the logic to restore a dashboard from a version.
The logic is moved from the API handler to the dashboard versions service,
which now supports restoring dashboards of different API versions.
Why
To make sure that dashboard version restoration works with v2 dashboards
API, as well as future API versions.
Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
* AuthZ: Create without scope for resources outside of folders
* Make it explicit that create requires a scope check
* Update pkg/services/authz/rbac/service.go
* Use skipScope instead of ReqScope
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
* Explain why there is no need to skip scope for roles
---------
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
* Remove support for initMinSize.
Remove support for searchAfterWrite option, now it defaults to true.
* Remove reference to deprecated feature toggle.
* Remove feature toggle completely.
* Remove code related to indexing on watch events.
* Fix compilation error.
* Remove unused field.
* wip; public dashboards and snapshots work
* Chore: Fix example of major release (#110007)
baldm0mma/ fix example of major release
* CI: Push docker images to dockerhub on merges to main (#110056)
* support extracting queries in schema V2
* fix lint and test
* fix test
* clean up
* clean up
* apply feedback about early returns
* fix url issue when clicking open original dashboard in v1
* refactor to early returns
* fix api version comparison
---------
Co-authored-by: Jev Forsberg <46619047+baldm0mma@users.noreply.github.com>
Co-authored-by: Kevin Minehart <5140827+kminehart@users.noreply.github.com>
* added supported functions and alerting/recording rules
* added more to alerting and recording
* added LLM integration info, cleaned up some other language
* cleaned up some passive voice
* ran prettier
* added requested update to alert/recording rules
* added RefID definition
* Update docs/sources/panels-visualizations/query-transform-data/sql-expressions/index.md
Co-authored-by: Alex Spencer <52186778+alexjonspencer1@users.noreply.github.com>
* updates based on feedback
* updates based on feedback
* ran prettier
---------
Co-authored-by: Alex Spencer <52186778+alexjonspencer1@users.noreply.github.com>
* feat/add_observability_landing
* Add check for observability path
* Fix existing tests
* Test that we're rendering the component when in the correct path
* Reset all mocks after testing
* Check for extension only on observability route
* Undo changes to tests
* Extract strings to constants
* Remove unused validator
* Remove unnecesary ObservabilityLanding component
* Update subtitle for Observability section
* Use proper '
* Expose extension point, allow plugins to hook into it, and render received components
* Fix and test
* Remove no longer needed unit tests
* Readd validation checks, allow for regex like paths
* refactor(extensions): extract dynamic extension point ids to a separate enum
* Undo unwanted const to let change
* Update extension point id to better transmit intent and use
---------
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
This lets the prometheus api respect NoGroup query logic and treat non-grouped rules consistently.
Co-authored-by: William Wernert <william.wernert@grafana.com>
Rules created in the new api makes the rule have no group in the database, but the rule is returned in the old group api with a sentinel group name formatted with the rule uid for compatiblity with the old api.
This makes the UI continue to work with the rules without a group, and the ruler will continue to work with the rules without a group.
Rules are not allowed to be created in the provisioning api with a NoGroup sentinel mask, but NoGroup rules can be manipulated through both the new and old apis.
Co-authored-by: William Wernert <william.wernert@grafana.com>
The first version of the app platform apis for alerting rules, including AlertRule and RecordingRule definitions.
Co-authored-by: William Wernert <william.wernert@grafana.com>
* Add feature toggle and extension point
* Update ff name for enrichment per rule
* update translations
* wip
* remove wrong duplication after merging from main
* manage enrichments per rule drawer: add ruleUid to extension component
* remove folder
* move drawer to the list page
* update translations
* remove unused import
* add client cfg for containers
* remove unused code
* add field for skip host env for proto client
* add docker to Swagger ignore
* add to enterprise swagger gen
* undo go.mod changes
* pass container image
* propagate container image field
* WIP: List
* make toV0ResourcePermissions work with an ordered list of assignments to ensure consistency in the results
* Test templates
* Split list query in two. I clearly need scopePatterns
* Add pagination with offsets
* Remove unecessary comment
* implement listiterator
* add listiterator tests
* return the correct resource version
* use SkipIntegrationTestInShortMode
* No need for the extra check on pagination being correctly set
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
* Spec is out of date
* Remove wrong comment
* Add a test for the pagination token
---------
Co-authored-by: mohammad-hamid <mohammad.hamid@grafana.com>
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
* TimeSeries: Use exported time comparison function
* Add alignTimeRangeCompareData to grafana/data
* Simplify tooltip time text formatting
* Bump scenes version
* Add tests for alignTimeRangeCompareData
* TimeSeries: Improve time compare default styling
* Update Time Comparison panel option menu
* Add backwards compatibility for older scenes
* Update shouldAlignTimeCompare for typical query
* Fix styling when multiple RefId matches
* Update default dash to be smaller
* Fix tooltip for older versions of scenes
* Configurable repository types in monolith and operator
* Default to Github in operators
* Regenerate wire
* Fix and implement unit tests
* Same types for enterprise tests
* Remove unnecessary conversion
* Remove the issue with import cycles
* Move tags and tag values request to datasource backend
* Remove outdated test
* Fix tests
* lint
* Refactor to use handlers for CallResource request
* lint
* Fix nit
* FS: Move multiTenantFrontend evaluation to OpenFeature
* comment
* actually, just remove the toggle
* fix k8s prefs test using toggle
* replace frontend flag usage
* codeowners
* move isFrontendService just into core
* put back comment
* Replace remaining calls to testing.Short where possible.
* Update style guide.
* Revert change in TestAlertmanager_ExtraDedupStage, as it doesn't work.
* Make TestAlertRulePostExport into integration test.
* Provisioning: add webhook support in API Server
* updating Extra interface
* adding extra with workers interface
* reverting extraWithWorkers in RegisterAPIService
* adding extra job worker provider
* adding new extra job provider
* Wire things differently
* Remove unused GetJobs
* Pass url variable as string
* Support webhooks in controller
* Fix condition
* Change the naming
---------
Co-authored-by: Roberto Jimenez Sanchez <roberto.jimenez@grafana.com>
* get trace-view-scrolling working in playwright
* almost fix frontend-sandbox-datasource test
* properly fix frontend-sandbox-datasource tests
* convert migrate-to-cloud to playwright
* prometheus-variable-editor tests in playwright
* enable prometheus-config tests in playwright
* run on frontend changes
* skip test
* remove various-suite
* PostgreSQL: FIx multiple results handling
- Added tests for handling multiple result sets, including compatible and incompatible structures, ensuring no panics occur.
- Improved `convertResultsToFrame` function to validate column compatibility and handle null values correctly.
- Introduced a new helper function `convertPostgresValue` for converting raw PostgreSQL values to appropriate Go types.
- Added comprehensive unit tests for `convertResultsToFrame` covering various scenarios including row limits and mixed result types.
* Add more test case
* Plugin Extensions: consolidate logic
* chore: add specific error to tests
* chore: refactors out common parts to getExtensionValidationResults
* chore: updates after PR feedback
* chore: update after PR feedback
* TimeSeries: Use exported time comparison function
* Add alignTimeRangeCompareData to grafana/data
* Simplify tooltip time text formatting
* Bump scenes version
* Add tests for alignTimeRangeCompareData
* Add backwards compatibility for older scenes
* Update shouldAlignTimeCompare for typical query
* Fix tooltip for older versions of scenes
* support for multiple shifts
---------
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
tlsConfig -> tls_config
hmacConfig -> hmac_config
tls_config export still does not match TF provider, as the provider currently
treats tls_config as a schemaless map. Once this is improved, they will now
match.
* copying from secrets migration
* service runs and mig promds type
* creating data source check
* adding aws
* split into azure/aws service. feature flag. auto install
* add tests
* clean up
* lint
* add code owner
* imporvments from andres
* remove prom mig from http_server
* remove interface for testing
* add prom mig to provisining data sources so prov happens before mig
* fit into prov
* comment
* log debug instead of returning in update type
* Trigger Build
* feature flag being weird
* not public method
* copying from secrets migration
* service runs and mig promds type
* creating data source check
* adding aws
* add tests
* clean up
* imporvments from andres
* remove prom mig from http_server
* remove interface for testing
* add prom mig to provisining data sources so prov happens before mig
* fit into prov
* Trigger Build
* not public method
* remove logger import
* Table: Update UX for single-reducer use case in new footer
* all cases are working; unit tests pass
* style and code cleanup in SummaryCell
* remove e2e test for sum reducer label
* reorganize code, todo tests
* slight style cleanup
* one more little reorganization
* updates based on CI failures
* update tests and docs
* unused prop
* update table footer image
* alt text, lint issue
* update gdev to create footer dashboard and re-point e2es there, add a few new cases
* remove console.log
* WIP: Controller
* WIP: more changes
* Use patcher from new location
* Separate import
* Move operators to grafana/grafana
* Tidy go mod
* Remove duplicate TODO
* Wrapper for unified storage
* WIP: build unified storage client
* More attempts
* Revert update workspace
* Improve comment
* Fix linting
* Change signature of repository getter
* Add ticket numbers
* Remove question
* Read config from file for decrypt service
* Config struct for unified torage
* Add local config
* Fix compilation
* Try to configure it
* Fix linting
* Add FIXME comment
* Move reusable logic into controller config
* Remove unused
* More logic to be reused
* Extract workers into separate function
* Clean up unified storage client
* Revert a couple of files
* Remove secrets decrypter from this PR
* Revert enterprise imports
* Clean up unified storage setup logic
* Add TODO
* Revert some changes
* Remove file
* Use the expected clients
---------
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
* LogListControls: add dropdown menu for timestamps
* LogListControls: add dropdown menu for line wrapping
* Update styles
* Translations
* Update tests
* Update test
* LogListControls: all events
* make legacy store expose only model.Receiver
* use integration as provenance type provider
* use revision RenameReceiverInRoutes
* introduce function GetReceiversNames in config revision
---------
Co-authored-by: Matthew Jacobson <matthew.jacobson@grafana.com>
* Extract from #108753
Co-Authored-By: mohammad-hamid <mohammad.hamid@grafana.com>
* Tackle create
Co-Authored-By: mohammad-hamid <mohammad.hamid@grafana.com>
* WIP use identity store to resolve role names
* WIP
* create role
* Remove unecessary comments
* comments
* sql templates
* test role insert tplt
* Add tests 😅
* Test permission insert template
* Test permission delete template
* Test assignment_insert template
* Manually test insertion
* Remove delete permissions. This is a create case we don't have permissions for that resource
* generate name handled by the apiserver library
* Remove comment and conversion
* Small renaming nits
* changes from main
* Add storage backend tests
* Add test to sql
* Test role contains a unique permission
* linting
* Account for pr feedback
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
* Reuse mappers
* Move function to models
* Add check between name and spec resource
* Check if the resource does not already exist
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
* fix query
* Check basic roles
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
* Account for error
* Make struct names consistent
* Nit. I prefer createAndAssignManagedRole
* Remove notifyign
* log errors instead of returning them
* Fix exist query join
* Test errors
* Remove dup
---------
Co-authored-by: mohammad-hamid <mohammad.hamid@grafana.com>
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
• Add handling for type-only refs like {type: 'prometheus'} in getInstanceSettings()
• Ensure consistency with get() method behavior
• Add test case verifying both methods return same results for type-only refs
New Crowdin translations by GitHub Action
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* resource permissions get
* address review feedback
* address comments
- read using rp name
- narrow by scope and actionsets
- update sql tests
* align with verb simplification
* keep original format to avoid conflicts
* add sqltests
* cleanup
* Remove unecessary errors
* Move query template to queries
* Use splitN to make sure we have three parts
* Revert user permission management for now. We don't need it
* Revert error change
* group permissions by resource
* extract parse scope
* Move sql_test
* Move & test parseScope
* Add tests to getResourcePermission
* Linting
* Use namespace
* Add test to the backend
* Ongoing tests
* Remove pagination, fix query boolean, insert basic role binding
* Linting
* Straightened the created and updated times
* error handling and uniformization with other backend
* Restore comments to avoid later conflicts
* Integration testing
* switch to function, no need to make it a method
* isServiceAccount should default to FALSE instead of TRUE :surprised:
* PR feedback
* Sort spec permissions
* Shouldn't happen but double proofing
---------
Co-authored-by: Gabriel Mabille <gabriel.mabille@grafana.com>
* register exemplary alert rule extention into IRM extension point
* register AlertRuleHistory into IRM's extension point
* support more default filters
* lazy load alert rule extension
* simplify
* rename extension point
* use exposed component, put props type in grafana-data
* rename PluginExtensionPointsInPlugins to PluginExtensionExposedComponents
* Update public/app/features/alerting/unified/components/rules/central-state-history/CentralAlertHistorySceneExposedComponent.tsx
Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
* export new types from grafana/data and avoid relative import paths
* improve naming of exposed component
---------
Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
* fix infinite scroll when using folder tree view in dashboard page inside folders with more than 50 items
* fix off-by-one error when fetching in list view
* Table: Footer support for multiple reducers
* fix migrator test output due to required default value
* fix go migration test
* more go test fixes
* fix go tests for footer
* Merge #110062
* update migration dashboard
* Small docs fixes
* Small docs fix
* remove migration method in Go, update js unit test
* add migration dashboard for footer and clean up some issues with countAll
* Footer should always use og rows for calcs
* update footer to be unaffected by filtering and sorting
* more e2es
* add more complex footer to kitchen sink, migrate panel all the way up
* update codeowners for e2e
* relocate footer migration panels and e2es to main 12.2 migration dashboard
* go further with the migration; kill unused fields, rename reducer to reducers
* get the go code up to date, move enablePagination to its own option as well
* add a unit to one of the numeric columns with a footer in kitchen sink
* fix reducers override in kitchen sink migration table
---------
Co-authored-by: Paul Marbach <paul.marbach@grafana.com>
Co-authored-by: Isabel Matwawana <isabel.matwawana@grafana.com>
Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
* Add logic for groupby count and add tests
* remove skip
* Use better and accurate test naming
* deconstruct options, add test for group by / count
* Have different values for test
* Remove only and change variables to allow optional chaining based on field
* add back destructuring
* fix: add back missing edit button for panels for viewers-can-edit
* lint fix
* updated meta cansave function with config option
* cleanup
* lint
---------
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
* LogLineDetails: show border right when controls are disabled
* LogLineDetails: update styles
* Update types in test
* Update background, border, and shadow
* Close details: fix tooltip
* Update the Storybook docs for RadioButtonList where it was incorrectly referencing RadioButtonGroup in code examples
* Update the Storybook docs for RadioButtonList and RadioButtonGroup with more useful guidance for usage
* Refine the Storybook docs for RadioButtonGroup
* Fix listing and getting dashboard versions across different API versions
What
This commit updates dashboard version service to use API version aware
API client. The service now also supports parsing different API version
representation of dashboards.
The API version aware client is also updated to support listing across
versions.
Why
Currently listing or getting specific versions is broken for all v2
versions of the dashboard API, especially if the dashboard being checked
is still saved using v1 APIs.
Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
* Remove superfluous tracing spans
Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
---------
Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
* fixes the layout in a slightly naive way
does work in both chrome and firefox
* make panel and query sections individually have full viewport height
* allow wrapping in dashboard controls, and align time picker section correctly when wrapped
* use more fixed minimum widths and allow horizontal scroll for overflow
* remove collapsing when sizes are fixed, and fix inverted collapse state logic
* use new wrapper for reflow layout media query setup
replace the magic numbers with theme breakpoints
apply global styles conditionally and locally
fix left to right splitter collapse state so it's removed in small size
added betterer exception that will be removed in the next commit
* moved component definition outside of non-react class so react hook lint rule recognizes it's not a class component (betterer fixes)
* remove unused import
* nit fix
* move disabling useSnapperSplitter logic into the hook
simplify reflow hook to only use height, and use a fixed height unrelated to shared width breakpoints
* remove global style overrides
* prevent scrolling in editor
---------
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* fix(frontend-service): mount public/img dir, copy Canvas subdirs over
* fix(canvas): update icon selector to use enum type not magic string
* fix(canvas): update folder selector to use grafana path from window
* chore(todo): code comment on when/where to remove Dockerfile COPYing
* feat(resource-dimension): public asset URL should include build/ for CDN
* chore(todo): note where to remove -- Grafana -- ds dependency from later
* fix(canvas): update folder selector to use build/ in path to hit CDN
* test(resource-dimension): expect relative URLs to include build/ for CDN
* fix(geomap): load icons for legend from CDN friendly path as well
* chore(resource-dimensions): delete dead code
* Provisioning: Use merge patch instead of json path to release orphan resources
* rolling back to json Patch
* adding TODO for testing
* adding integration test
* using struct
* addressing comments on tests
Fixup on a misleading error being returned due to a missing return statement in the code. Was returning the error "conversion succeeded but no frames" even though there was an error.
* Alerting: Fix insights panel for Grafana missed iterations
Existing panel was copied from Mimir version, so it was using the
wrong metric as well as incorrect assumptions on the series labels
grafanacloud_instance_rule_group_iterations_missed_total ->
grafanacloud_grafana_instance_alerting_schedule_rule_evaluations_missed_total
parsing `rule_group` (ex. `/rules/12345/synthetic_monitoring;default`) ->
using `rule_title` directly
* Linting
* make cgo optional for sqlite
* update go.mod; check error code differently
* reduce api surface even more
* move test errors into sqlite package
* CGO_ENABLED=0 in unit tests
* disable for enterprise, too
* add driver name constant
* remove unused constants
* make test an integration one
* try integration tests without cgo
* implement error codes for modernc sqlite driver
* typo fix
* missing return
* use error pointer as an interface
* alias the driver
* update workspace, check for test errors too
* check error properly
* add missing driver after rebase
* fix missing import after rebase
* debugging, lets try again
* properly parse options, revert many previous changes
* remove another log
* better url parsing
* revert test rename, leave it for later
* revert reusedSession in unistore
* revert more code
* remove driver name
* revert formatting
* add integration test without cgo for sqlite
* remove tracing and logging
* bring driver alias back
* fix type
* wrong package
* LogLineDetailsLinks: create component
* Label: add space
* Comment
* LogLineDetailsLinks: show value in a toggletip
* LogLineDetailsLinks: add label
* Update tests
* update options type to promise, fetch only when dropdown is open
* add GMA/DMA section WIP
* remove rule manager radio
* use default no options found in dropdowns
* fix failing test
* resolve PR comments
* replace fetchPromNamespaces with fetchGrafanaGroups
* Url sync for tabs rehink
* Update
* Thinks are working pretty well
* wip: solve tab not found
* fix lint and tests
* adjust wait for repeats in getCurrentTab
* set currentTabSlug in useEffect
* set currentTabSlug on tab title change
---------
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
* Move repository package to apps
* Move operators to grafana/grafana
* Go mod tidy
* Own package by git sync team for now
* Merged
* Do not use settings in local extra
* Remove dependency on webhook extra
* Hack to work around issue with secure contracts
* Sync Go modules
* Revert "Move operators to grafana/grafana"
This reverts commit 9f19b30a2e.
* Unistore: Only Shadow Search Traffic when running on modes > 0
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
---------
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Add basic arrow key navigation support
* Add shortcut for applying scopes
* Support expanding nodes with arrow keys
* Make useEffect non-conditional
* Add a11y and error boundary
* Fix preventDefault
* Add test for keyboardinteractions
* Add tests and expanded status to treeitem
* Reset highlight when disabled and change styles
* Fix tests
* Update i18n
* Remove unused var
* Reset enterprise imports from main
* Move failing test to correct quite
* Remove test outside fo context
* Remove unused import
* Use highlitghted ID instead of index
* Extract all highlighing functionality into its own hook
* Remove unused imports
* Broken dash repro
* Fix V16 migration to preserve panels when rows array is empty
- Fixed bug where panels were deleted when migrating dashboards with empty rows array
- Updated v16.go to match frontend implementation behavior
- Added test case for empty rows scenario in v16_test.go
- Renamed test files to v16.empty-rows-and-panels-array.json for clarity
- All migration tests passing (419 test cases)
* ExtensionSidebar: Remove feature flag and enable by default
* ExtensionSidebar: Remove `isEnabled`
* ExtensionSidebar: Lint
* ExtensionSidebar: Lint
* ExtensionSidebar: Remove more FF
* i dont know why, but okay
* feat(plugins): add a way to expose core apis only to certain plugins
* review: update naming
* review: update the owners of the feature toggle
* feat: share the restricted apis with extensions
* fix: linters
* feat: remove the `addPanel` api
* chore: fix linting and betterer issue
* tests: use `@ts-expect-error` for more clarity
* Don't use transaction in ListModifiedSince.
To guarantee that we don't include events with RV > LatestRV, we include the check in SQL query instead.
* Fix integration test by converting SQL comments into template comments.
* Add state history config to frontend config object
* Add alertingTriage feature toggle
* Add Triage menu entry
* Add old state history config props for backward compatibility
* Table: Max height for wrapped content
* Docs: tableNG max cell height (#110069)
Co-authored-by: Paul Marbach <paul.marbach@grafana.com>
* change to Max row height instead of Max cell height
* fix unit test
* table utils codeowners
* Update packages/grafana-ui/src/components/Table/TableNG/utils.ts
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
* update docs
* fix docs
* Revert "fix unit test"
This reverts commit c46b0f1bec.
* fix unit test
* trade one important for another
* Tweaked wording
* hover overflow for max row height
* get rid of commented out section
* and we did it without important
* centralize overflow for max height assessment
* some alignment stuff was busted
* didn't end up using the max heigh arg for shouldTextOverflow
* make i18n path more consistent
* put some tooltip things back since they ultimately didnt change
* we can simplify the :not selector
* delete comment
* don't bother with :not
---------
Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
* LogLine: implement custom highlight renderer
* Log line: fully replace highlighted body with highlight tokens
* processing: update test
* Add unit test
* Add deeply nested JSON test
* processing: update clone function
* Scroll to log line: find by uid
* LogLineDetailsLog: check if the log contains ansi
* Prettier
* attempting to "fix" geomap
* copy gazetteer/maps folders into dockerfile for frontend service
* add TODO comments
* remove unused import
* conditionally use public cdn path
* fix unit tests
* try refactor e2e test for better stability
* Revert "try refactor e2e test for better stability"
This reverts commit d966d68e15.
* safer
* use grafana_public_path
* Skip query when ListModifiedSince cannot return anything.
* Only save listRV if it's different than sinceRV. This saves a disk access if not needed.
* Add test for ListModifiedSince with same RV.
* pyroscope: process sampling annotations
* Enable annotations in classic explore
* Run prettier
* Revert unneeded change to plugin.json
* Tweak wording in sampling annotation
* Fix test
* Disable annotations by default
* Explore: Remove Drilldowns banner
Removing banner added in https://github.com/grafana/grafana/pull/100409. It's been 6 months since it was added and we can remove it now.
* Update translations file
* remove build size from ci scripts, test adding a github action step
* generate pa11y results file
* setup node
* don't need grabpl
* get key from vault
* doublequote env var
* write node script for publishing
* update CODEOWNERS
* add some logging
* yarn install...
* tidy up
* only on main branch
* add VersionedNotifierPlugin and method that converts NotifierPlugin to it
* return new schema if query parameter version=2
* add version to k8s model of integration
* fix open api snapshot
* add version to IntegrationConfig
* use current version on conversion
* create versioned integrations for test
Recording rule fields were not being copied correctly when duplicating an alert rule. This manifests as missing `TargetDataSourceUID` fields from the `Record` part of the rule when rules in a group are re-ordered.
Added some additional tests to ensure we cover the generation of recording rules in tests and fixed the copying logic to ensure all fields are copied correctly.
Creates comprehensive guide for configuring recording rules with TraceQL metrics queries,
including Tempo-specific considerations for time ranges, evaluation delays, and examples.
Signed-off-by: Alex Bikfalvi <alex.bikfalvi@grafana.com>
Co-authored-by: Kim Nylander <kim.nylander@grafana.com>
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
* docs(openapi): Cleanup tag usage and minor fixes
* Add missing change
* More fixes
* make swagger-gen
* Remove unused documentation
* Update pkg/services/publicdashboards/api/query.go
Co-authored-by: Artur Wierzbicki <artur@arturwierzbicki.com>
* Run make swagger-gen
* Run make openapi3-gen
---------
Co-authored-by: Artur Wierzbicki <artur@arturwierzbicki.com>
* Added wrap text to table options and removed from multiple cell options
* Removed wrap text from cell options shared file
* Edited
* Edited
* Table: Migrate to field-level wrapText toggle
* migrate hidden -> hideFrom.viz as well
* more cleanup from rebase
* restore options that got killed in the rebase
* when wrap text is enabled for the whole table, exclude columns that do not make sense
* fix TableNG unit tests
* fix i18n
* unit tests for the migrations
* sort out e2e issue
* fix migration unit test
* fix backend migration test as well
* add a dashboard for the v12.2 table migrations
* update dev-dashboards.lisonnet
* make gen-jsonnet
* one of the panel versions didnt get updated
---------
Co-authored-by: Isabel Matwawana <isabel.matwawana@grafana.com>
* LogListControls: add third state to line wrapping
* LogListContext: decouple wrapLogMessage and prettifyJSON from state object
* Processing: reformat JSON according to prettifyJSON
* LogListControls: update class names and colors
* onLogOptionsChangeType: update type signature
* Update type
* Update tests
* Dont translate the plus sign
* Comments
sql_expression_query_length_limit
Set the maximum length of a SQL query that can be used in a SQL expression. Default is 10000 characters. A setting of 0 means no limit.
* remove feature toggle prometheusCodeModeMetricNamesSearch
* remove code that relies on prometheusCodeModeMetricNamesSearch feature toggle
* remove code that related to prometheusCodeModeMetricNamesSearch feature toggle
* remove commented code lines
* remove commented code line
* Put codeModeMetricNamesSuggestionLimit selector back
* remove redundant unit test
* Extract from #108753
Co-Authored-By: mohammad-hamid <mohammad.hamid@grafana.com>
* Tackle create
Co-Authored-By: mohammad-hamid <mohammad.hamid@grafana.com>
* WIP use identity store to resolve role names
* Commit empty service for now
* Clean
* For now only show name and created at
---------
Co-authored-by: mohammad-hamid <mohammad.hamid@grafana.com>
* Revert "Revert: "Accessibility: Ensure dashboard edit panel inputs have accessible labels" (#109984)"
This reverts commit 7331a2e8c3.
* revert test change that accidentally catches the issue
* use useId in some places
* make ID required
* fix some ids
* fix a couple more
* add ids to variables
Co-authored-by: Ashley Harrison <ashharrison90@gmail.com>
* add ids to get viz options
* add ids in getPanelFrameOptions
* add getFieldOverrideElements
* change name
* Replace other uuids with hard coded ids
* hoist useId out
* use some new selectors for table e2es
* commit betterer crimes
* use useId where we can
* Revert "use useId where we can"
This reverts commit 34090ac75d.
* fix some dashboard layouts tests
* rm AutoCellOptionsEditor
* idk try and fix tests
* restore fixed its for url state
---------
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: Ashley Harrison <ashharrison90@gmail.com>
Co-authored-by: Paul Marbach <paul.marbach@grafana.com>
* Table: Enable tableNextGen by default
* kill off tableNextGen feature flag
* i18n
* i18n
* i18n
* remove state beta from table panel
* fix migration for 0 decimals migration
* add explicit auto option bacjk
* match impl from previous migrations code
* try changing some selectors
* remove timezone test from Cypress
* fix PlaylistForm unit test
* fix some selectors
* clean up i18n, are these gridcells somehow?
* return a couple of selectors caught in the dragnet to being cell instead of gridcell
* fix i18n for en-US
* clean up gdevs now that wrapHeaderText has no default
* update role in e2e for when it is re-enabled
* Add better type handling when correlation is created from provisioning and fix documentation
* add external example
* change error when deprecated key is used
* Alerting: Add Extended List Query for Alert Rules w/pagination
This adds an extended query which allows filtering by the kind of rule (Recording or Alerting) and supports pagination.
Pagination tokens will allow us to list all rules paginated, regardless of the rule group.
---------
Co-authored-by: William Wernert <william.wernert@grafana.com>
* Table: Color text, color background, and apply to row can co-mingle
* fix test
* lean on existing memoization and utils more
* just make that method a prop of TableCellRenderer
* add prop to tooltip stuff as well
* fix another test
* update TableNG with apply to row mixed color cell table
* simplify color overrides table
* special case: apply to row transparent bg
* add unit test
* delete erroneous import
* update for readability
* add new dataquery field for identifying which histogram type
* run make gen-cue to update tempo dataquery
* add native histogram check function & look for dataquery flag
* remove console log
* check for native histograms in queryfield
* only run query when histograms have not been migrated yet
* use less resource intensive query, just check if series are there
* fix type issue
* use series as better for detecting existence of a metric, fix betterer things
* fix type
* fix import
* remove metric name from func
* use datasrource func and don't make a new one
* remove string for boolean check in service graph functions
* fix bug for switching tempo data sources
* handle race condition for unmounting before async call is completed
* fix imports
* add todo to implement getNativeHistograms in Prometheus data source
* add todo to remove automatic check once tempo fully migrates to native histograms
* add todo to remove the native histogram config option
* Capture error_type label on metrics/traces
* Make error messages more helpful to user
* Use errutil, categorized errors, and tie them to error_type (category in code)
* Misc trace fixes
* Add metric to track SQL input conversion
* Add samlCatalog metric
* Add samlCatalog metric to stats
* Define hook for successful SamlCatalog metrics
* Register new hook
* Add tests
* Rework the collected stats and split it into versions
* LogLineDetails: get link details from href
* links: create module
* LogList: pass time zone and time range to Details
* LogLineDetailsTrace: create component
* InlineLogDetails: pass time range and time zone
* LogLineDetailsTrace: show loading and error messages
* Update tests
* LogLineDetailsTrace: update message styles
* Prettier
* Add test
* LogLineDetails: add embedded metric test
* Prettier
* LogLineDetailsTrace: use unique request id
* LogLineDetailsTrace: reset state when props change
* Chore: rename
* Chore: rename
* links: add integration test
* Prettier
* Separate interfaces for writing and reading in job history
* Register the 2 writers
* Commit unsaved file
* Do not validate or mutate history jobs
* Change the TODOs
* migrate to v19
* migrate to v18
* Migration to be verified: v17 Convert minSpan to maxPerRow in panels
* Migration to be verified: 16 Grid layout migration
* Refactor v17 and v19 migrations to use shared helper functions
* Migration to be verified: 15 No-op migration for schema consistency
* Migration to be verified: 14 Shared crosshair to graph tooltip migration
* cleanup
---------
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
Co-authored-by: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com>
* Table: Button up re-created functions and arrays
* use the single styles object
* restore automatically adjusted line
* restore automatically adjusted line
* update computeColWidths to create a string to help compare col widths
* use compareArrayVals for widths comparisons
* satisfy linter
* whoops, had this backwards
* clean up case with frozen columns
* remove dep
* avoid unnecessary change to computeColWidths
* LogLineDetails: add open and close events
* LogLineContext: add interval picker
* Log Context: allow to customize the time window around the log
* Loki: support custom time window
* LogLineContext: implement variable time window
* Remove console
* LogLineContext: store and format options
* LogLineContext: replace radio with combobox
* LogLineContext: run time window on the first request
* InfiniteScroll: use loading to prevent fake events
* Chore: update old comment
* Minor reorg
* Clean up unnecessary styles
* LogLineContext: fix overflow and scroll
* LogList: fix loading prop
* Update comment
* Translations
* Update public/app/features/logs/components/panel/LogLineContext.tsx
* LogLineContext: move default to constant
* LogLineContext: add test
* Prettier
* New Logs Context: Generic DS support for time window option (#109934)
* chore: add supportsAdjustableWindow to logs context interface
* Build
---------
Co-authored-by: Galen Kistler <109082771+gtk-grafana@users.noreply.github.com>
* rename query library user interface text with "saved queries"
* add missing replacement on "Query history"
* fix unit test
* Fix test and apply PR feedback
* try React.memo
* Table: Rework the renderers file and some types
* more test cleanups
* remove for gauge for now
* memoize all of the renderers
* also memoize the Tooltip component
* memoize the TableCellActions
* memo useStyles2
* update useStyles2 usage in TableNG
* remove console.log
* add a test for the AutoCell fallback rendering case for testField
* style nit - update variable name to be more idiomatic
---------
Co-authored-by: Paul Marbach <paul.marbach@grafana.com>
* Table: Refactor row height to work in pxs instead of lines
* non-string pill value handling, internal cleanup on buildCellHeightMeasurers
* no need to round up to max line
* remove drone & dead code in pkg/build; update go modules
* remove .drone.star
* Remove drone scripts and drone references in Makefile
* make update-workspace
* remove deadcode tool
* Remove daggerbuild/scripts: deadcode
* Remove drone files / folders in CODEOWNERS
* make update-workspace
* remove more dead code
* migrate to v19
* migrate to v18
* Migration to be verified: v17 Convert minSpan to maxPerRow in panels
* Migration to be verified: 16 Grid layout migration
* Refactor v17 and v19 migrations to use shared helper functions
* Migration to be verified: 15 No-op migration for schema consistency
* Update v27.go
* Update v16.go
* cleanup
---------
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
Co-authored-by: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com>
* WIP added ListSinceModified to StorageBackend interface
* fix compile time check
* Fix method name
* Fix naming
* fix the rest of the ListSinceModified names
* Uses resource key without name field
* get latest rv from resource_version. Update test.
* adds moar tests
* adds method stub for ListModifiedSince to other StorageBackend implementations
* adds dummy impl to noop storage backend for ListModifiedSince
* skip tests for badger kv backend for now
* fixes tests and adds badgerkv impl for ListModifiedSince
* add badger kv impl
* adds test for new query
* adds test data for new query
* adds ListModifiedSince stub to mockStorageBackend
* uncomment tests
* refactors ListModifiedSince to return an iter.seq2 and handles deduplication. Updates tests. Updates query result sorting.
* remove comments
* remove folder from query (dont need it, yet?)
* regen test queries
* updates test
* updates function comment
* use resourcepb.ResourceKey instead of ModifiedResourceKey
* wrap seq in single transaction. Rollback transaction after 30s if iterator never used. Only track last seen event. Formatting.
* skip TestListModifiedSince for kv backend
* use WatchEvent_Type for action type
* remove redundant fields from order by clause and regen test data for query
* remove redundant fields from order by clause and regen test data for query
* Migration to be verified: v17 Convert minSpan to maxPerRow in panels
* Address review comments: use Go idiom for variable naming and sort.Ints for sorting
* Migration to be verified: 16 Grid layout migration
* Refactor v17 and v19 migrations to use shared helper functions
* Address reviews comments
---------
Co-authored-by: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com>
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
* Fix partition by values missing refId
* have partitioned refID include original refID
---------
Co-authored-by: Kristina Durivage <kristina.durivage@grafana.com>
Bug fix where when saving changes to dashboard, DashboardPreviewBanner is rendering backward banner between loaded from new resource vs new resource created on remote.
* refresh parent folder when resource is created or deleted
* bulk delete and bulk move job: after job success, refetch folders
* refresh parent on both branch and default workflow
* move after success logic into getRepositoryJobsWithPath
* MoveProvisionedDashboard: root folder error fix
* Remove provisioned badge when whole instance is provisioned, root folder checkbox fix
* If root level only have one provisioned folder, allow select all on subitems
* remove button tooltip and remove comment
* regenerate API clients after schema updates
---------
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
* add api client verification to lint step
* separate steps, clearer error messages
* make same change to non-enterprise version
* double-quote
* ignore conf
* update generated apis
* add names for steps
* fix comment
* Dashboards: New pathId concept to find panels not based on scene object key
* Minor fix
* fix test
* Fix test
* adding unit tests for pathId functions
* fix
* Fix link sharing to use new path
* fix
* Update
* No clone keys
* Remove all the clone keys complexity
* More changes
* update e2e test
* Progress
* fix auto grid item
* Finally working cannot move panel into clone row
* adjust how we find vizpanel for keyboard shortcuts
* Update
* Fix shortcuts
* Fix test
* fixing tests
* fix lint
* fix tests
* fix e2e
* adjust how outliine children are collected for auto and custom grids
* update
* Upgrade scenes
---------
Co-authored-by: oscarkilhed <oscar.kilhed@grafana.com>
Co-authored-by: Sergej-Vlasov <sergej.s.vlasov@gmail.com>
* Query Library: Connect QueryLibraryEditingHeader in QueryEditorRow
* Add unit test to queryn editor row
* Remove logic of "update query" save disk and add extra condition to prevent dragable action
* Add env support for different build environment targets
* Add NX target for dev builds
* Add option to build in dev mode
* skip immutable flag for dev builds
* GHA: Use equivalent self-hosted runners for BE unit tests Enterprise
* GHA: Use standard runners for BE unit tests OSS
* GHA: Use equivalent self-hosted runner for ephemeral env action
* GHA: Use self-hosted runners and adjust shards for BE integration tests
* GHA: Upgrade BE integration test Postgres from 12 to 17
* GHA: Upgrade BE integration test MySQL from 8.0.32 to 8.0.43
* fix: version history duplicating entries when navigation fails after restoring dashboard version
* fix navigation issue
---------
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
* add github workflow scaffolding
* update comments
* Add image and resource commands
* Add secrets paths
* Block workflow run for forks
* ignore via package.json, update CODEOWNERS
* fix workflow path
* remove old azure monitor test
* pull docker image first
* add permissions for docker pull step
* checkout first
* keep creds file
* try all in one job
* with creds...
* add cloud: 'azure'
* pass CLOUD to docker
* add -playwright
* actually use the env vars
* don't need to pass CLOUD env var
* remove commented out code and tidy up
* kick CI
* Update container names and set PLAYWRIGHT_CI
* Update path
* fix zizmor violation
* use bigger runner, add double quoting
* add separate command and increase timeout
* remove timeout
* parameterise the e2e command in CI
* move cloud-plugins-e2e-tests into normal e2e test workflow
* fix detect changes
* pass creds into dagger
* try remove quotes
* add a debug log
* exec playwright command after mounting file
* reassign e2eContainer, add change to check the tests fail correctly
* fix test
---------
Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
* Bare-bones mocked integration
* Create correct context based on the query
* Add data source name
* Do not bundle grafana/assistant with flame graph
* Rename component
* Add tests
* Mock grafana/assistant
* Update feature toggle and allow hiding the button
* Update deps
* Update types
* Update yarn.lock
* Fix typo in feature toggle description
* Enable grafanaAssistantInProfilesDrilldown by default
* Enable grafanaAssistantInProfilesDrilldown by default
* Show Analyze Flame Graph button only if there's context for the assistant
* Table: Get rid of ContextMenu on right click
* fix a scroll thing for expanded table, git rid of some conditional accessors
* remove context menu test
* remove context menu test
* i18n
* fix lint issue
* LogLine: don't run overflow check with unwrapped logs
* InfiniteScroll: don't listen to scroll events without scroll
* InfiniteScroll: minimize use of element.scrollHeight
* LogLineDetails: constrain to 95vw
* LogList: process logs while streaming
* Remove unused prop
* InfiniteScroll: update test
* Update test
* Inline Log Details: read max width from context
* Remove console
* Table: Tooltip by Field
* add colorization support
* more progress on customizing the tooltip based on cell customization
* configurable as an option
* tooltip triggered from a chip in the corner, pinning tooltip
* i18n
* use enum where appropriate
* correctly orient the tooltip to the cell - but at what cost
* clean up some console.logs
* e2e test for the tooltip
* fix global click stuff
* remove console.log
* refine the style of the caret
* caret placement on same-side as alignment to avoid collision with inspect hover
* some updates from self-review
* increase hit target of tooltip caret
* fix width and height auto-sizing especially for dynamic height
* reorganize to pre-calc the per-field stuff
* use linear gradient for triangle
* update e2e to reflect current behavior, that clicking caret multiple times doesn't toggle pinning
* clean up event handlers a bit
* restore test for toggle click
* alright, re-remove the toggle case
* cursor pointer
* remove optional root from Popover for now
* remove this ridiculous autogenerated file
* update some of the text
* kill the cellRefMatrix
* remove unused import
* extract a util for the predicateByName part
* skip the intermediary step for getCellColors
* Migration to be verified: v17 Convert minSpan to maxPerRow in panels
* Address review comments: use Go idiom for variable naming and sort.Ints for sorting
This reintroduces database pagination for the Prometheus API for rules.
Follow up for #109558 to use the new pagination format.
Note: This changes the sort-order to use `NamespaceUID` instead of the fully qualified Folder path. This also changes the cursor format to use the `NamespaceUID` instead of the Folder path and to be in a reverisble format.
* Table: Fix z-index conflict between DataLinksActionTooltip and ActionConfirmModal
* add an action to the kitchen sink Info column
* don't need the class for z-index
* fix this issue across a variety of viz types
* kill tooltip container in TableNG
---------
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* add tempo
* trying to debug trace propagation
* add extra header
* change header to inject
* very debug logging
* set GF_TRACING_OPENTELEMETRY_OTLP_PROPAGATION
* clean up config
* undo temp debug logging
* RepositoryResources: hide history button when repo type is pure git
* hide history button from file page
* hide history button from file page and file history detail page
Fix reusable workflow reference in release-comms
Use full repository path for create-security-branch workflow
to resolve linter errors about unable to find reusable workflow.
* update instantiations of OptionsPaneItemDescriptor to pass IDs - obvious changes
* update instantiations of OptionsPaneItemDescriptor to pass IDs - iffy changes
* update editors to pass ID through or note a missing label
* update playwright tests
* fix unit tests
* grafana ui components updated to pass ID through
* update components to pass ID through
* add missing input IDs
* better default ID handling
* remove TS note
* revert accidental non-html id change
* kick CI
* fix old-arch e2e tests
* change to plain useId calls
---------
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
This reintroduces store level pagination, without using it in the prometheus API yet.
Related to #108633
Co-authored-by: William Wernert <william.wernert@grafana.com>
* big WIP
* more WIP
* leftover changes after merge
* bug fix: prevent modal close onclick inside modal
* add logic to filter by data sources
* use MultiComboBox component instead of MultipleDataSourcePicker
* add namespace and evaluation group filtering logic
* remove header section of PopupCard
* set max width on popup
* add contact point field
* add contact point logic and tooltip
* add tracking to filter- track open, apply, clear and values submitted
* add plugins show/hide field
* add plugins show/hide field
* add tests for new filter
* test tracking works as expected
* check v2 filter only shows if feature toggle is on
* tidying up
* fix lint errors
* fix close-on-type bug
* use ContactPointSelector component
* fix close-on-click-outside issue
* Add label dropdown logic
* Add query string to search field
* add test to check filtering by search field updates the filter popup values
* clear search input onClear of filters
* fix lint issues
* add tooltips to search input and datasource fields
* Sort typing in ContactPointSelector
* update translation file
* Add logic to group and list view buttons & refactoring
* update failing test
* update test mocks
* fix failing tests
* fix typecheck errors
* resolve PR comments part 1
* update label dropdown to include info text
* Translation extraction
* resolving PR comments
* move autocomplete logic to reusable hook
* resolve PR comments
* fix typecheck
---------
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
Co-authored-by: Lauren Armstrong <laurenarmstrong@laurenskmacbook.home>
Co-authored-by: Lauren Armstrong <laurenarmstrong@mac.home>
Co-authored-by: Lauren Armstrong <laurenarmstrong@Laurens-Work-MacBook.local>
* set the boot data config correctly
* tighten up grafana/data types
* kick CI
* restore dashboard scopes props
* revert back to class
* add some comments
* kick CI
* add comment
* Update self instrumentation to use alloy and bump versions
* Update devenv/docker/blocks/self-instrumentation/config.alloy
Co-authored-by: Sam DeHaan <dehaansa@gmail.com>
* Add remote write receiver feature to Prometheus configuration in docker-compose.yaml
* Add example for plugin profiling to the doc
---------
Co-authored-by: Sam DeHaan <dehaansa@gmail.com>
* DashboardScenePageStateManager: Pass query params to loadDashboard when reloadDashboardsOnParamsChange enabled
- Extract query param processing into helper function
- Pass processed params to loadDashboard when toggle is on
- Add test coverage for query parameter handling
* review
* init: feature work
* chore: i18n
* feat: add run query + keyboard shortcuts
* chore: i18n
* chore: initial query formatted
* chore: resolve some issues
* chore: a bit of refactor to clean it up
---------
Co-authored-by: Kristina Durivage <kristina.durivage@grafana.com>
* Add log after jobs
* Use the same helper to create repository in export job
* Improve the logging
* Fix eventually conditions in helpers
* Fix export job tests
* Format code
* Fix linting
* Fix the format
* Fix linting issue
* Fix innefectual assignment
What is this feature?
This PR add the backend functionality to support viewing extra Alertmanager configurations (imported with the Prometheus conversion API) in the UI under the feature flag alertingImportAlertmanagerUI. The same flag will be used to enable this in the UI.
This is just the backend part, the full PoC PR is here: #109027
It uses a special datasource UID prefix __grafana-converted-extra-config-{identifier} to identify imported configurations. When the Alertmanager proxy handler detects this prefix:
GET requests are proxied to either the Grafana Alertmanager service (for alerts, silences, etc.) or the Prometheus conversion API to get the config
Write operations are not supported
* When creating a new continue token, it defaults to page 1. Also use constants for default limit and page number.
* Update tests for continue token.
* When listing legacy folders, the continue token will have all paging info in it. Simplifies paging logic and fixes bug when limit not specified.
* Adds regression test to ensure default page limit is enforced.
* remove test comment
New Crowdin translations by GitHub Action
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* add suport for queryLibraryRef in explore
* add feature flag check on badge
* add test for migrator
* Add QueryEditor.test and useStateSync test
* implement onCancelEditingQuery library
* run i18n extract
* push mod changes
* Revert "push mod changes"
This reverts commit 29c410f126.
* remove queryRef from the URL
* remove queryRef from url in explore page, keep redux logic
* restore tests and remove old queryRef from URL behaviour
* clean up test
* remove unnecessary useCallback from onCancelQueryLibraryEdit
* apply PR suggestions about naming of functions
* rename queryRef to queryLibraryRef
* update missing files with the new queryLibraryRef
* fix i18n check
* Disabled add query buttons when queryLibraryRef is present
* Add unit test to components
* add missing queryLibraryRef after merge
* add placeholder for highlighted code
* clear up queryLibraryRef after sucess update
* add monitoring
* remove unnecessary change
* remove placeholder and integrate highlightQuery
* change "Editing From Query Library" to "Update query from library"
* update tootlip text
* fix interaction importing issue
* updating i18n for query library editing badge
* update copy on saving actions
* keep copy short
---------
Co-authored-by: Juan Cabanas <juan.cabanas@grafana.com>
* When repo is read only, disable action buttons and display badge
* browse dashboards page, disable checkbox if repo is read only
* clean up
* clean up
* i18n
* added read only status to repository page
* i18n
* fix
* readonly tooltip added local provisioning message
* i18n
* BrowseActions: when selecting item from a provisioned folder, disable all items from other provisioned folder. Display a tooltip when checkbox is disabled.
Replace github.actor with github.event.pull_request.user.login to prevent
actor context spoofing in pull requests from forks. This ensures only
genuine Dependabot PRs can trigger the workspace update workflow.
Fixes zizmor security finding with Medium confidence level.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-authored-by: Claude <noreply@anthropic.com>
* Add URLs to Job spec
* Rename them as RefURLs
* Implement RefURLs for Github
* Add Ref URLs to Jobs
* Worker Test
* Create the branch in the staged writer
* Regenerate Git mock
* Format code
* Consolidate ResourceURLs and RefURLs into one
* Fix broken tests
* Add config provider and integrate with wire setup
* Refactor quota service to use config provider for configuration management
* Enhance OSSConfigProvider to include logging and update ProvideService to return an error. Refactor server initialization to handle potential errors from config provider. Remove unnecessary wire binding for OSSConfigProvider.
* Update CODEOWNERS to include the configprovider package under the grafana-backend-services-squad.
* Refactor quota service initialization to include context in multiple service providers. Update tests and service implementations to ensure proper context handling during service creation.
* Fix Unable to use self-signed CA for verification when adding influxdb data source (#105585)
* Update pkg/tsdb/influxdb/fsql/fsql.go
---------
Co-authored-by: Andrew Hackmann <5140848+bossinc@users.noreply.github.com>
* Add HistoryJob back to Spec
* Generate client
* Put back History Jobs
* Add a controller to remove historic jobs after some minutes
* Start only if Loki is not used
* Format code
* Update OpenAPI spec
* Change log level
* Fix condition
* Fix staticcheck
* Use provisioning identity
* Fix registration APIs
* Fix readonly issue
* Update OpenAPI
* processing: display nanoseconds if present
* Nanoseconds: add control in log line menu
* virtualization: adapt to timestamp format
* Translations
* LogLine: update test
* virtualization: update test
* LogLineMenu: update test
* LogListControls: add third state for new logs panel timestamps
* Logs Panel: expose as a new panel option
* Translations
* Logs Panel: set timestamp resolution from panel config
* Module: add default value
* LogLine: update test
* Spelling
* chore: rename setter
* LogListControls: use custom button for resolution
* Translations
* Translations
* Prettier
* Logs Panel: conditionally show timestamp and details options
* Add integration test
* Table: Frozen columns
* i18n extract
* clamp the frozen columns by the total number of cols visible
* future-proof a bit: frozenColumns.left, add to kitchenSink
* Chore: Apply proper database settings to integration tests
* add logging
* join host and port in database config to override default ports
* apply test fixes from the original pr
* host might contain port already
* increase timeout
* increase timeout even more
* even larger timeouts
* Use eventually for stats
* Use eventually also for listing settings as index takes some time
---------
Co-authored-by: Roberto Jimenez Sanchez <roberto.jimenez@grafana.com>
* More clean up around waiting for jobs
* Add comment to trigger enterprise integration tests
* Trigger integration tests
* Collect error
* Move tests in wrong spot
* Clean up test
* Remove Eventually
* Remove duplicate not nil check
* Delete comment in infra tests
* Helper to create repository
* Use helper for move
* Dashboard Migrations: V31 LabelsToFields-Merge Migration
* Dashboard Migrations: V32 No-op migration
* simplify
* Refactor to reduce nesting
* Dashboard Migrations: V30 value mappings and tooltip options
* Do not automigrate since graph is migrated in v27
* Refactor to reduce nesting
* Add test case for invalid mapping
* migrate to v29
* wip
* Fix tests
* fix output
* wip
* fix min version issue
* fix wire
* ignore gauge logic as it never get's executed
* add panel migration to test
* improvements
* update
* cleanup
* address mappings inconsistencies
* cleanup
* fix lint issues
* add cfg when initializing
* v27 migration
* migrate to v26
* preallocate array
* remove logic for grafana-singlestat because it's shared with stat logic; improve error handling and testing
* fix go lint
* don't preallocate; cleanup comments
* cleanup
* wip
* run internal provider function when getting a single panel
* clean up; add tests
* add tests for panel plugin service
* remove obsolete mock for getting panel plugin
* add tests for the whole pipeline
* fix test and lint
* migrate to v23
* migrate to v22
* refactor
* fix test
---------
Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
* TableNG: Markdown cell, plus custom row height
* tab indentation in cue file
* fix i18n
* trying an auto height with the updated RDG
* get auto cellHeight working
* i18n updates
* hoor disable_sanitize_html flag in MarkdownCell
* update react-data-grid version to attempt to support page up and down
* removing custom height
* use the latest experimental RDG with paging up and down
* TableNG: Wrap text for DataLinks and Pills; groundwork for max wrap length
* disable editing max wrapped lines for now
* disable wrap text line limit e2e
* new i18n extract after commenting out input
* wip
* kill max wrapped lines for now
* more cleanup
* remove targeting classes added for max wrapped lines
* fix Pill test
* couple more style cleanups
* Table: Move cell-specific styles out to their own methods
* move styles into their own file
* combine renderer and style declarations to make auto cells work better, complete cleanup of internal cell elements
* fix e2es given these updates
* add a couple tests
* wip: tests
* add tests
* bump up capital letters in lorem ipsum
* fix copy-pasta mistake
* whoops, mis-merged the selector
* use a local count instead of getCellLinks
* use react-data-grid on react-18 branch
* fix linting on test
* gdev dashboard and smoketest for Markdown table
* remove cellHeightCustom
* restore bugfix from adversarial AI-generated JSON
* reorganize in light of recent and upcoming changes
* cleanup
* override the whitespace for markdown
* what are these auto imports about...
* fix cell height selector from merge
* also remove cellHeightCustom
* i18n
* avoid the important override in markdown cell styles
* revert some betterer config autoformatting
* slight code cleanup
* s/cat/grot, add color link panel to kitchen sink, fix color link/image link style issues
* update panelid for empty table panel test
* link styles outside of cell style setup
* flesh out kitchen sink examples, update ImageCell and applyToRow
* clean up some inconsistent states
* fix lint issue
* gdev update
* format JSON to satisfy linter
* shortening the text in the long text field
---------
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
* Unistore/dualwriter: delegate SetDefaultPermissions to Unified on Mode3
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
---------
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Dashboard Migrations: V31 LabelsToFields-Merge Migration
* Dashboard Migrations: V32 No-op migration
* simplify
* Refactor to reduce nesting
* Dashboard Migrations: V30 value mappings and tooltip options
* Do not automigrate since graph is migrated in v27
* Refactor to reduce nesting
* Add test case for invalid mapping
* migrate to v29
* wip
* Fix tests
* fix output
* wip
* fix min version issue
* fix wire
* ignore gauge logic as it never get's executed
* add panel migration to test
* improvements
* update
* cleanup
* address mappings inconsistencies
* cleanup
* fix lint issues
* add cfg when initializing
* v27 migration
* migrate to v26
* preallocate array
* remove logic for grafana-singlestat because it's shared with stat logic; improve error handling and testing
* fix go lint
* don't preallocate; cleanup comments
* cleanup
* wip
* run internal provider function when getting a single panel
* clean up; add tests
* add tests for panel plugin service
* remove obsolete mock for getting panel plugin
* add tests for the whole pipeline
* fix test and lint
* fix test
* Fix missing scenarios
---------
Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
* add the plan
* feat: Add plugin extension points for DataSource configuration components
- Add DataSourceConfigActions and DataSourceConfigStatus extension points
- Add PluginExtensionDataSourceConfigActionsContext and PluginExtensionDataSourceConfigStatusContext types
- Update EditDataSourceActions.tsx with plugin extension support and allowlist filtering
- Update DataSourceTestingStatus.tsx with dual extension point support (new + backward compatible)
- Create getDataSourceExtensionConfigs.tsx with example core extensions
- Update getCoreExtensionConfigurations.ts to include datasource extensions
- Implement grafana-owned plugin allowlist for security and quality control
- Support context-aware extensions based on datasource type and testing status
- Maintain backward compatibility with existing DataSourceConfigErrorStatus extension point
- Add proper TypeScript types and export them in index.ts
This enables grafana-owned plugins to provide contextual actions and status-specific integrations
within the datasource configuration workflow while maintaining security through plugin filtering.
* docs: Update specs.md with implementation status and lessons learned
- Add comprehensive implementation status section with completed features
- Document critical lessons learned during implementation:
* Translation limitations in extension configurations
* Plugin security through allowlist filtering
* Extension registration timing constraints
* TypeScript context type patterns
- Update implementation checklist with actual completion status
- Add detailed next steps and recommendations
- Include plugin development guidelines (do's and don'ts)
- Document architectural insights and patterns discovered
- Transform specs from theoretical design to practical implementation guide
This update serves as both historical record and developer guide for future
plugin extension work in Grafana.
* Add comprehensive tests for DataSource plugin extensions
- Add EditDataSourceActions.test.tsx with 12 tests covering:
* Core Grafana actions functionality and permissions
* Plugin extension rendering and interaction
* Plugin allowlist filtering and security
* Context passing and URL generation
- Add getDataSourceExtensionConfigs.test.tsx with 14 tests covering:
* Core extension configurations for both extension points
* Context filtering logic (datasource type, severity)
* Error handling and graceful failures
* Extension structure validation and type safety
Total: 26 tests passing, providing comprehensive coverage of the
DataSourceConfigActions and DataSourceConfigStatus extension points
implemented in previous commits.
* Update specs.md to reflect completed test implementation
- Mark unit testing phase as complete (26 tests added)
- Add comprehensive Test Implementation section documenting:
* Test file details and coverage areas
* Testing challenges and solutions discovered
* Performance metrics and execution strategy
* Command examples for running tests
- Update Success Metrics with concrete testing validation
- Update Next Steps to reflect testing completion
- Document new test files in Files Modified section
The plugin extensions implementation now has complete unit test
coverage for both DataSourceConfigActions and DataSourceConfigStatus
extension points with 26 passing tests.
* rm specs file
* lint
* refactor: replace 'any' types with proper TypeScript types in datasource extension tests
* tsc
* prettier: fix
* Fix datasource extension path format to resolve CI test failure
The troubleshooting link extension was using an invalid path format
'/docs/troubleshooting/datasources' which caused console.error during
test execution. Updated to proper Grafana core extension path format
'/a/grafana/docs/troubleshooting/datasources' to comply with plugin
extension validation rules.
* fix: DataSourceTestingStatus test failures
- Fix incorrect data-testid expectations to use proper e2e selectors
- Add contextSrv mock for hasAccessToExplore() dependency
- Create proper plugin links mock handling different extension points
- Update plugin link tests to use allowed plugin IDs
- Fix test logic to match actual component behavior for status/error links
- Add test coverage for non-allowed plugin filtering
All 10 tests now pass successfully.
* lint fix
* refactor: replace any types with proper TypeScript types in DataSourceTestingStatus test
- Replace any[] with PluginExtensionLink[] for statusLinks and errorLinks parameters
- Replace any with UsePluginLinksOptions for setPluginLinksHook callback parameter
- Add proper imports for PluginExtensionLink and UsePluginLinksOptions
- Improve type safety and IntelliSense support in tests
* rm brittle tests
* DataSource: Replace individual buttons with dropdown menu in EditDataSourceActions
- Convert LinkButton components to dropdown with Menu.Item components
- Add conditional rendering: show simple button when only one action, dropdown when multiple
- Use LinkButton for navigation and Button with dropdown icon for menu trigger
- Replace Trans components with t() function calls for Menu.Item labels
- Prevent PageHeader crowding when multiple plugin extensions are registered
- Maintain all existing functionality and tracking calls
* refactor: use configure() for dynamic datasource extension URLs
- Replace onClick handler with configure() function for dynamic path generation
- Use context to build monitoring tool URL with datasource UID
- Follows extension system design patterns for declarative configuration
- Removes manual window.open() in favor of automatic path handling
* refactor: use DataSourceConfigErrorStatus extension point for troubleshooting guide
Use the specific DataSourceConfigErrorStatus extension point instead of
DataSourceConfigStatus with conditional logic in configure function.
This simplifies the code by leveraging the right abstraction level.
* extract i18n
* lint:fix
* Revert "lint:fix"
This reverts commit 23cdb39672.
* lint:fix
* fix: mock plugin extensions registry in variables utils test
Fixes console.error calls during test execution caused by plugin extension
registration failures. The test was failing on CI because the extensions
registry was trying to register link extensions with invalid configurations
during module import.
Solution: Mock the entire plugin extensions registry setup to prevent
side effects from interfering with the test execution.
* fix: mock plugin extensions registry in explore query test
Fixes console.error calls during test execution caused by plugin extension
registration failures. The test was failing on CI because the extensions
registry was trying to register link extensions with invalid configurations
during module import.
This applies the same fix as the variables utils test - mocking the entire
plugin extensions registry setup to prevent side effects from interfering
with the test execution.
* better fix
* Fix EditDataSourceActions test by mocking utils and handling dropdown UI
- Add missing mock for constructDataSourceExploreUrl from ../utils
- Update tests to interact with dropdown menu structure instead of expecting direct text
- Fix test logic to match component behavior: Actions dropdown when user has explore rights
* lint:fix
* refactor: extract duplicated allowedPluginIds to single source of truth
- Add ALLOWED_DATASOURCE_EXTENSION_PLUGINS constant to constants.ts
- Remove duplicate allowedPluginIds arrays from DataSourceTestingStatus and EditDataSourceActions
- Update both components to import and use the shared constant
- Improves maintainability and ensures consistency across datasource config components
* refactor: update datasource extension link configurations
- Change title and description for the metrics drilldown link to improve clarity
- Update the path for the metrics drilldown link to reflect the new routing structure
- Remove the troubleshooting guide link configuration to streamline the extension options
* removing unused config
* better dropdown
* fix: update EditDataSourceActions tests to match component implementation
- Fixed tests to expect core actions as separate buttons instead of dropdown
- Updated plugin extension tests to use 'Extensions' dropdown instead of 'Actions'
- Added test for Extensions dropdown visibility logic
- All 12 tests now passing
* lint:fix
* remove extra check
* Update ALLOWED_DATASOURCE_EXTENSION_PLUGINS documentation to clarify plugin contributions to datasource configuration pages
* feat: Convert Explore data button to dropdown when extensions are available
- When hasActions is empty: shows normal Explore data and Build dashboard buttons
- When hasActions is not empty: converts Explore data to dropdown with angle-down icon
- First dropdown item: 'Open in Explore View'
- Following items: extension links
- Build dashboard button remains unchanged
- Maintains existing tracking functionality and internationalization
* test: Update EditDataSourceActions tests for new dropdown implementation
- Update tests to work with new Explore data dropdown that includes extensions
- Replace references to 'Extensions' button with 'Explore data' dropdown
- Add test for 'Open in Explore View' menu item in dropdown
- Verify correct behavior when extensions are present vs absent
- All 13 tests now passing
* test: Add comprehensive test coverage for dropdown explore functionality
- Add test to verify explore action href when extensions are present
- Ensure both dropdown and direct link behaviors are tested
- Complete test coverage for new dropdown implementation
* translation
* compass icon for the explore item
* feat: refactor AlertSuccessMessage to accept extension links as props
- Move extension links from inline definition to props for better reusability
- Add proper TypeScript support for PluginExtensionLink types
- Improve component architecture by separating concerns
- Add extensionLinks styling to getStyles function for consistency
- Support both real extension links and custom link rendering in success messages
This improves the component's flexibility while maintaining type safety.
* lint:fix
* remove invite user button from quick add menu as redundant with top nav invite user button
* clean up final invite user experiment
* remove invite user button from megamenu, clean up and consolidate usage of util functions across top nav and command palette
* add some basic tests to util functions
* fix tests / jest mock conflicts
* address PR feedback
* Update dependency eslint-webpack-plugin to v5
* set failOnError: false to match previous behaviour
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* Add setting to disable username based brute force login protection
* Use new DisableUsernameLoginProtection setting in tests where appropriate
* Update documentation for other brute force directives
* Avoid unecessary database calls
* Add test cases for username and IP protection settings
* Show refIds if nothing is recovered
* Add test
* Preserve function returning undefined if there are no recovered or selected refIDs
* cuter
* add context and remove testing by sibling
---------
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
* Add /children endpoint
* Update folder client
* Add comment
* Add feature toggle
* Add new version of useFoldersQuery
* Error handling
* Format
* Rename feature toggle
* Remove options and move root folder constant
* Fix feature toggle merge
* Add feature toggle again
* Rename useFoldersQuery files
* Update API spec
* Fix test
* Add test
* Migrate delete folder button
* useGetFolderQueryFacade
* Use getFolder facade hook
* Recreate legacy getFolder from the APIs
* Fix imports
* Add comment
* Rename function
* Simulate virtual folders in the API client
* Translations
* Update test
* Move the hook out of the index file
* Fix undefined in test
* Better status combining
* Use real access api for virtual folders
* Add basic test for the hook
* Remove commented import
* Remove the access control api and use legacy api for it
* Update tests
* Moved delete folder into facade hook
* Remove namespace attribute from virtual folders
* go lint
---------
Co-authored-by: Clarity-89 <homes89@ukr.net>
* Secrets: Update proto inline secure values to take variadic names on delete
* Secrets: Update inline delete when owned to take multiple names
* trigger CI
* TestUtils: Add helper to create certs
* InlineSecureValue: Move to its own package rather than service
* Settings: Rename decrypt server configs to grpc prefixed as it is more generic
* InlineSecureValue: Add gRPC client
* InlineSecureValue: Add service provider grpc/local depending on setting.Cfg
* Wire: Add ProvideInlineSecureValueService to basic wireset
* InlineSecureValue: Re-export in root secret pkg and generate mocks for interface
* Settings: Unify decrypt+inline setting into generic grpc client
* Read and write recent scopes
* Store entire ScopeNode, load from localSotrage
* Load nodes form localStorage on init
* Add runtime type validation
* Add tests
* Remove unused import
* Add parentNode name to selector integration test
* Deep clone
* Schema validation with zod
* Add comment
* Use zod for schema validation of scope object
* Update type validation of recent scope nodes
* Add comment
* Add expect ts error
* Fix nit
* ensure button must have tooltip/aria-label when no children
* fix violations
* restore some unnecessarily removed labels
* use types instead of interfaces as before
* further fixes
* fix unit test
* commit translations and fix unit test
* upgrade plugin-ui to 0.10.8
* set aria-label + unit tests
**What is this feature?**
Implement `getFiltersApplicability()` on the `--Dashboard--` data source
Also refactor some existing code to use this new approach to naming
This follows some previous work to implement AdHoc filtering on the `--Dashboard--` data source in PR #108011
**Why do we need this feature?**
See https://github.com/grafana/grafana/pull/107775 and https://github.com/grafana/grafana/pull/106756
> We want to see, when carrying filters from one dashboard to another, which of them are still applicable and which are not
Additionally I think @mdvictor is hoping to see more consistency in our approach across the codebase. But maybe he can confirm this.
**Who is this feature for?**
Everyone
* feat: compare legacy and unified search results via histogram
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com>
* fix: handle cases where request type is not set
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com>
* fix: use struct instead of bool because it's more memory efficient
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com>
* fix: calculate recall percentage rather than union between legacy and unified
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com>
---------
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com>
* add equivalent dashboard-time-zone test
* remove cypress dashboards-suite
* modify tests to work with schema-v2 + update workflow to run playwright instead
* fix package.json
* update CODEOWNERS
* fix start-server to include ARCH
* remove frontend-platform as owners of public/app/core
* assign some things...
* more delegating
* assign more CODEOWNERS
* assign more CODEOWNERS
* assign more CODEOWNERS
* assign some more CODEOWNERS
* delete some unused files
* remove LocalStorageValueProvider and assign more CODEOWNERS
* remove WithFeatureToggle and assign more CODEOWNERS
* remove ticks as it's not used, assign more CODEOWNERS
* restore ticks, more CODEOWNERS
* finish assigning CODEOWNERS
* fix squad name
* fix: Avoid redundant formatting
Avoid formatting `secondaryUnitString` if it's not going to be used.
Signed-off-by: martincostello <martin@martincostello.com>
* fix: Fix date formatting when rounded
Fix issue where rounded secondary units would not be carried over to the primary unit when they are a whole multiple of that unit (e.g. `"4m 60s"` instead of `"5m"`).
Signed-off-by: martincostello <martin@martincostello.com>
---------
Signed-off-by: martincostello <martin@martincostello.com>
* Extract functions to util and utilize in both transforms
* Fix mistaken label and add better null logic to transpose
* Add a new row and add a blurb to docs about the new setting
* Update public/app/features/transformers/docs/content.ts
Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>
* Update docs content, simplify null logic
* Add test, clarify empty logic
---------
Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>
* Secrets: Add service name as explicit parameter for Decrypt
* Apply suggestions from code review
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
---------
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
* TableNG: Markdown cell, plus custom row height
* tab indentation in cue file
* fix i18n
* trying an auto height with the updated RDG
* get auto cellHeight working
* i18n updates
* hoor disable_sanitize_html flag in MarkdownCell
* update react-data-grid version to attempt to support page up and down
* removing custom height
* use the latest experimental RDG with paging up and down
* TableNG: Wrap text for DataLinks and Pills; groundwork for max wrap length
* disable editing max wrapped lines for now
* disable wrap text line limit e2e
* new i18n extract after commenting out input
* wip
* kill max wrapped lines for now
* more cleanup
* remove targeting classes added for max wrapped lines
* fix Pill test
* couple more style cleanups
* fix e2es given these updates
* add a couple tests
* wip: tests
* add tests
* bump up capital letters in lorem ipsum
* fix copy-pasta mistake
* whoops, mis-merged the selector
* use a local count instead of getCellLinks
* use react-data-grid on react-18 branch
* fix linting on test
* gdev dashboard and smoketest for Markdown table
* remove cellHeightCustom
* reorganize in light of recent and upcoming changes
* remove one more reference to cellHeightCustom
* put getDefaultRowHeight back into a util
* clean up test
* swap cell height back to a radio
* revert ImageCell change, we'll do it in the getStyles PR
* don't memo defaultRowHeight
* final couple of style cleanups
* different approach to managing the auto height part of this
* kill console.log
* update i18n
* reorganized once more
* i18n
* guard against rowHeight being auto for virtualization
* may as well memoize the defaultRowHeight
* get rid of the enableVirtualization initializer thing
* fixes from CI
* fix test
* fix test
* just omit third arg for that test
* remove nonsensical test case
* this file didn't get re-gen'd
* fixes from review
* row expander doesn't need height
* remove console.log
* fix e2e after we fixed pagination toggle bug
* TableNG: Wrap text for DataLinks and Pills; groundwork for max wrap length
* disable editing max wrapped lines for now
* disable wrap text line limit e2e
* new i18n extract after commenting out input
* wip
* kill max wrapped lines for now
* more cleanup
* remove targeting classes added for max wrapped lines
* fix Pill test
* couple more style cleanups
* fix e2es given these updates
* add a couple tests
* wip: tests
* add tests
* bump up capital letters in lorem ipsum
* fix copy-pasta mistake
* use a local count instead of getCellLinks
* fix linting on test
* Update test utils package with mock folder + search endpoints
* Add dashboards v0alpha1 api client
* Update hook to use app platform search API
* Update tests and fixtures
* LogLineContext: initial support
* LogLineContext: infinite scroll bottom
* LogLineContext: clean up styles and support both scrolls
* InfiniteScroll: support top scrolling
* LogLineContext: support center matched line
* LogLineContext: read options from storage
* LogLineContext: move padding container
* LogLineContext: reset on ui change
* LogLineContext: improve sort order and fix open in split
* LogLineContext: show log line
* Translations
* LogsPanel: integrate new context component
* LogLineContext: add unit test
* Prettier
* Remove unused import
* InfiniteScroll: add "scroll to load more" top
* LogLineContext: rename collapsible
* Update tests
* LogLineContext: refactor center button
* LogLineContext: handle overflow in small viewports
* LogLineContext: format referenced log line
* Memoize
* LogLineContext: make modal bigger
* LogList: improve a11y
* LogLineContext: flexbox magic
* LogLineContext: revert center button change
* LogsPanel: hide overflow
* LogLineContext: responsive min-height
* LogLineContext: fix wrap log message
* InfiniteScroll: improve direction handling
* Add feature flag
* Implement feature flag
* InfiniteScroll: report direction
* Skip export on already managed resources
* Add integration test
* Add integration test
* Handle nothing to commit error
* Fix leaky abstraction issue
* Handle the no commit error on commit and not on push
* Fix linting
* Some fixes for integration test
* Improve tree to work with a root
* Some fixes with hacks
* Add additional checks
* Fix comment
* Fix path problems in test
* Fix more stuff
* Revert to use empty tree
* Remove changes in tree
* Finally fix the tests work
* Remove stale comment
* Fix linting
* Revert changes in test
* Fix error message for folder not found in resource tree
Co-authored-by: roberto.jimenez <roberto.jimenez@grafana.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
We removed the "Filter for/out value" tooltips when we reimplemented the Table panel. We don't want to reimplement these, so we're improving the icons instead, to look more like "Filter" and less like "Zoom in/out"
* fix(canvas): style linter issue
* feat(canvas): update infinite viewer root element
* fix(canvas): resize element on moving
* fix(canvas): global element position
* fix(canvas): connection anchor position
* fix(canvas): connection position
* fix(canvas): connection coordinates calculation
* cleaning
* fix(canvas): calculation connection coordinates
* fix(canvas): initial connections svg position
* fix(canvas): align connection with new coordinates system
* fix(canvas): temporary element position fix
* comment
* Canvas: Fix canvas selecto (#104621)
* fix(canvas): get context back
* fix(canvas): selecto containers
* clean up
* Canvas: Fix jumpy elements behaviour on select and drag (#104641)
fix(canvas): jumpy elements behaviour on select and drag
* fix(canvas): connection regression (#104682)
* Canvas pan + zoom: Updated mouse interactions (#104648)
* feat: canvas panel pan + zoom key binds
* feat: panning when right click + ctrl
* chore: some cleanup
* chore: adjust mouse move delta by canvas scale
* Canvas: Zoom to content (#104950)
feat(canvas): zoom to content
* Canvas pan + zoom: Unique key for canvas panel elements (#104947)
fix: unique keys
* Canvas: Placement adjustment (#105117)
* feat(canvas): top/left placement migration
* feat(canvas): adjust constraint system for pan and zoom usage
* feat(canvas): support other constraints
* Canvas: Align connection anchors and element rotation (#106002)
* feat(canvas): align connection anchors and element rotation
* clean up
* clean-up math
* Canvas: Disable pan when pan+zoom toggle is false (#106224)
chore: no pan when pan+zoom toggle is disabled
* Canvas: Fix desync between scene and InfiniteViewer zoom/position on element addition (#106655)
feat(canvas): keep pan and zoom state to re-apply
* Canvas: Clicking on metricValue dropdown does not work; right-click triggers context menu instead (#106701)
fix(canvas): metricValue left click dropdown
* Canvas: Double-click on canvas should reset scale and position (#106709)
fix(canvas): dblclick to reset zoom
* Canvas: Put new canvas pan and zoom under feature toggle (#107001)
* feat(canvas): put pan and zoom under FF
* clean-up
* clean-up
* fix(canvas): clear selection on scene manipulation
* fix(canvas): any types
* Canvas: Fix canvas apply styles (#107404)
* fix(canvas): apply styles
* remove deps
* Canvas: E2E test coverage (#107474)
* betterer
* feat(canvas): sceneAbleManagement tests
* feat(canvas): playwright tests
* chore(canvas): add draft e2e tests
* chore(canvas): clean draft e2e tests
* chore(canvas): fix draft e2e tests
* chore(canvas): todo comments
* chore(canvas): update e2e tests
* chore(canvas): delete scene unit tests
* chore(canvas): delete sceneAbleManagement unit tests
* chore(canvas): delete sceneAbleManagement unit tests
* chore(canvas): linter
* chore(canvas): locales
* chore(canvas): remove flag checking
* Fix canvas connection point z-indexing bug (#107223)
fix(canvas): hoist connect points one level higher in DOM to fix z-index
* Revert "Fix canvas connection point z-indexing bug" (#108146)
Revert "Fix canvas connection point z-indexing bug (#107223)"
This reverts commit e419cb164a.
* Canvas: Set canvas zoom range (#108318)
* chore(canvas): set zoom range
* chore(canvas): naming
* Canvas: Fix infinite-viewer connections viewport values (#108315)
chore(canvas): infinite-viewer connections viewport values
* Canvas: Fix z-indices order and explicit pointer events (#108284)
* fix(canvas-connection-points): z-indices order, explicit pointer events
* chore(canvas): remove user select
* chore(canvas): naming
* chore(canvas): create ConnectionAnchor2 component
---------
Co-authored-by: Ihor Yeromin <yeryomin.igor@gmail.com>
* Canvas: Hide anchors on panel resize (#108588)
chore(canvas): hide anchors on panel resize
* Canvas: Center & scale select, resize, zoom bugs (#108749)
* Canvas: Fix center and scale constraint with zoom
* Remove unused resize flag
* Consolidate and clean up
* fix(canvas): re-size scale and center elements
---------
Co-authored-by: Ihor Yeromin <yeryomin.igor@gmail.com>
* Canvas: Fix on constraint change during zoom (#108947)
* Canvas: Ensure correct panel size during edit (#108953)
* chore(canvas): re-gen cue
---------
Co-authored-by: drew08t <drew08@gmail.com>
Co-authored-by: Sven Grossmann <svennergr@gmail.com>
Co-authored-by: Alex Spencer <52186778+alexjonspencer1@users.noreply.github.com>
Co-authored-by: Jesse David Peterson <jesdavpet@users.noreply.github.com>
Co-authored-by: Drew Slobodnjak <60050885+drew08t@users.noreply.github.com>
* wip so far. need to prove rebuilds work
* build common runner image
* glibc support
* ubuntu
* add conditional
* add support for cross-os builds
* format
* don't use zig by default on macos
* use postgres
* tidy up
* more tidy
* update readme
* remove errant changes
* ensure we build the grafana binary as part of the playwright server startup
* only build if binary isn't there
* add comments
* handle building the binary in the start-server script
* list all encrypted values and count
* separate interfaces
* add time filter to global queries
* initial secrets consolidation
* Revert defaults
* consolidate grpc proto
* More verbose description of the operation
* Add consolidation tests and tracing
* Fix lint
* Revert debug log
* Move buf to top level, regenerate
* Update Makefile buf generate
* Add fixtures and mock handlers for legacy teams API
* Fix teams betterer issues and error handling
* Refactor CreateTeams tests
* Update .betterer.results
* created config doc
* updated the config doc
* updates to the configure doc
* updates to configure doc
* updated the templates doc
* more query editor edits
* final edit on templates doc
* final query editor edits and new screenshots
* added tables to configure
* final edits
* final edits
* final edits
* added admonition and updates based on feedback
* ran prettier
* Display group and use + as separator
* Set/get parent node from URL
* Add hook useScopeNode
* Add loading state and Skeleton
* Add preload and actually commit hook
* Add preload
* Add feature flag
* Update test
* Fix test
* Fix tree test
* update CreateGrafanaAlertmanagerConfig to accept UserGrafanaConfig move construction logic to alertmanager
* consolidate building UserGrafanaConfig into buildConfig
* use config to determine whether it needs to be send calculate hash of the entire request struct rather than configuration
* list all encrypted values and count
* separate interfaces
* add time filter to global queries
* initial secrets consolidation
* Revert defaults
* More verbose description of the operation
* Add consolidation tests and tracing
* Fix lint
* Revert debug log
* make cgo optional for sqlite
* update go.mod; check error code differently
* reduce api surface even more
* move test errors into sqlite package
* add a comment
* chore: add documentation on unified search
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com>
* fix: add additional needed feature flags for unified search
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com>
* fix: add docs about index_min_count and index_max_count
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com>
* fix: add documentation about sortable fields and the discrepancy with search/sortable
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com>
* fix: kubernetesClientDashboardsFolders feature flag is no more, remove it from the docs
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com>
* fix: simplify request flow diagrams
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com>
---------
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com>
* Fix scoped contact point permission check
* Use annotations permissions for k8s API and globals permissions for external AMs
* Fix scoped permission check for GrafanaReceiverForm
* Add details to tracing spans when creating index.
* Log reason for building index.
* Log reason for building index.
* Remove initialization of labels to avoid unnecessary metrics.
* Track succcessful, failed and skiped index builds. Track index build time for individual index, not all indexes.
* Revert removal of labels initialization.
* implement special dashboard fallback logic when dashboard data has invalid json behind feature flag
---------
Co-authored-by: Will Assis <william@williamassis.com>
* Revert "Revert: Future-proofing query and data source model in Dashboard Sche… (#107985)"
This reverts commit 13a89d4ae3.
* Revert "Revert "Schema V2: Simplify annotations v1<->v2 conversions" (#107984)"
This reverts commit 2b8c5bea1a.
* make gen apps
* e2e update
* Use v2alpha2 by default (#108177)
* Use v2alpha2 by default
* Apply only DS changes to alpha2
* Use v2alpha2 by default except to query
* Create a v2 index in @grafana/schema
* Update path and apply lint
* Update tests
* Update imports to v2 status
* Fix failing openapi test
* Schemav2 breaking changes: conversion implementation (#108224)
* provision v2alpha1 dashboard
* Run conversions for DS refactor
* Run snapshot testing on conversions
* Normalize output name
* Update snapshots to include all panel and variable cases
* fix lint
* fix lint
* fix test and go lint
* more go lint
---------
Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
* Schema v2: Introduce group/datasource convention to GroupBy and AdHoc variable (#108237)
* Schema v2: Introduce group/datasource convention to GroupBy and AdHoc variables
* add conversion
* App Installer: Authorizer support (#108419)
* Chore: use `satisfies` and remove a load of `any`s (#108397)
use satisfies and remove a load of anys
* improve logging and fail unified-storage migration with more than 0 errors (#108471)
improve logging and fail unified-storage migration with more than 0 errors
* fix conversion test
* Secrets: Create more granular fixed roles for SecureValues (#108382)
* Provisioning: Fix bug in job progress recording (#108440)
Fix bug in job progress recording
* Provisioning: Fix ImportAllPanelsFromLocalRepository test (#108441)
* Provisioning: Skip flaky test
* Fix flaky provisioning test
* Fix lint
---------
Co-authored-by: Roberto Jimenez Sanchez <roberto.jimenez@grafana.com>
* BulkDeleteProvisionedResource: Move progress bar into a second step (#108417)
* Move progress bar into a second step
---------
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
* [Dashboard Schema Codegen] Move dashboard CUE codegen block back up into kind body (#108476)
[Dashboard Schema Codegen] Move dashboard CUE codegen block back up into kind body to make sure new versions have the same settings.
---------
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: Will Assis <35489495+gassiss@users.noreply.github.com>
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
Co-authored-by: Roberto Jiménez Sánchez <jszroberto@gmail.com>
Co-authored-by: Roberto Jimenez Sanchez <roberto.jimenez@grafana.com>
Co-authored-by: Yunwen Zheng <yunwen.zheng@grafana.com>
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
Co-authored-by: Austin Pond <IfSentient@users.noreply.github.com>
Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
* Dashboard Schema V2: Refactor VizConfigKind to follow DataQueryKind convention (#108148)
* Dashboards API: Register v2alpha2 API
* Prepare conversion functions
* Fix test
* Refactor VizConfigKind to follow DataQueryKind convention
* fix tests
* use new dataquerykind convention alpha 2
* add conversion
* fix tests
* fix tests
* fix another test
* Fix merge
---------
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
* fix k8s codegen
* Update e2e-playwright/dashboards/TestV2Dashboard.json
* Update e2e/dashboards/TestV2Dashboard.json
* revert app generation for non-related apps
* try again
* another try
* also revert folder and secret app generation
* v2alpha1 provisioned dashboard
* Fix kind
* Fix conversion snapshots
* Update API discovery registry
* Rename to v2beta1
* Rename migrations
* Update apps/dashboard/pkg/apis/dashboard/v2beta1/doc.go
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
* Ensure conditional rendering and other non changed properties
---------
Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: Will Assis <35489495+gassiss@users.noreply.github.com>
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
Co-authored-by: Roberto Jiménez Sánchez <jszroberto@gmail.com>
Co-authored-by: Roberto Jimenez Sanchez <roberto.jimenez@grafana.com>
Co-authored-by: Yunwen Zheng <yunwen.zheng@grafana.com>
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
Co-authored-by: Austin Pond <IfSentient@users.noreply.github.com>
Co-authored-by: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com>
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
* feat(test-utils): move the toEmitValue/s jest matchers to test-utils and add test script
* chore(jest): update configs to use matchers from test-utils package
* ci(frontend-tests): hook up packages tests
* fix(test-utils): re-export matchers from index.ts so packages that include setupTests don't error
* ci(pr-frontend-unit-tests): add frontend-packages-unit-tests to list of required unit tests
* Update packages/grafana-test-utils/README.md
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
---------
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
* Update index.md
Adjusted codeblock formatting from yaml syntax rather than bash.
* Ran 'yarn prettier write' in index.md to ensure formatting was correct after completing prior changes.
* feat(explore): implement compact mode feature
This commit implements compact mode for Grafana Explore to address issue #102867.
Features implemented:
- URL parameter support: ?compact=true or ?compact=1 activates compact mode
- Query rows auto-collapse: Query editors start collapsed showing summary line
- Content outline auto-collapse: Sections start collapsed to save space
- Single DrilldownAlertBox: Shows single banner in split view (no duplicates)
Changes:
- Added compactMode to ExploreState interface and selectors
- Added URL parameter parsing in useStateSync hook
- Modified QueryRows and QueryEditorRow components to support compact mode
- Updated DrilldownAlertBox logic to prevent duplicates in split view
- Fixed test files to use proper mock state objects
Fixes#102867
* Move compact mode to pane state and sync with URL
* Clean up
* Show Drilldown alert box only when not splitted
* Rename and clean up
* Clean up
* Add missing props
* Add missing props
* Add missing translations
---------
Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
**What is this feature?**
Allow AdHoc filters to be set from Tooltips when clicking on bars in the BarChart panel.
**Why do we need this feature?**
We're trying to implement a "Panel to Panel" filtering behaviour, similar to what is possible in Tableau and Looker. We're using AdHoc filters, as these scale well across panels and across dimensions in the data.
We expect this PR will work well in tandem with #108011 to allow panel-to-panel filtering of data coming from BigQuery.
---------
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
* Extract fuzzySearch to separate files and add fuzzy search to the listV2 filter
* Use the new fuzzy helpers in the old list view
* Extract more code to common fuzzy functions
* Update tests
* Add comments explaining outOfOrder parameter, improve tests
* Migrate the alerting fuzzySearch to @grafana/data fuzzySearch
* Add resource reference to spec
* Add FindResourcePath
* Fix formatting
* Use ForKind client
* Add unit test for new method
* Format code
* Add integration tests
* Fix unit tests
* Fix formatting
* Find out preferred version based on group and kind
* Handle trailing slash for folders
* Format code
* Fix linting
* Add integration test for folder bulk deletion
* Format code
* Format discovery file
* Deduplicate paths for deletion
* Alerting: Move some tests to full integration tests
* add back two error handling tests
* imports
---------
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* Dashboards: Add undo/redo actions for several template variable options
Also refactors some existing undo/redo code
* Run `make i18n-extract`
* formatting
* fix some a11y issues with the stories
* fix lockfile
* fix tests
* put aria-label on <Icon>
* add aria-describedby
* undo changes to VizLegendTable
* use useID for image id
* TableNG: Simplify row height calculation and make more extensible
* add a cache for the results of rowHeight when it's a function
* JSDoc comment for util
* from the other branch, copy the related code and tests
* rework the line counters a bit, limit line counting to string fields
* add test for string case for buildRowLineCounters
* add the concept of estimates vs. counts
* add a comment
* ceil, not floor
* try to be as terse as possible
* test for estimates
* comment the type
* more comment in test
* swap
* fix#108804
* convert em letter spacing to px for avgCharWidth calculation
* tweak whee em-to-px math happens, and force count to occur on every row when wrap is on to avoid short row issues
* update test
* update to clamp single-line estimation using a hardcoded value (0.85)
* add assertion for not calling counter in that case
* uwrap 0.1.2
* fix betterer issues
* fix typography ctx extra import
---------
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
* create a set of acceptance tests to run with bench
* move tests back, fix login tests to work with supplied credentials:
* rename files again
* rename skip message
* Pyroscope: Remove LegacyForms from ConfigEditor
* Pyroscope: Align fields in form
* Pyroscope: Add id to input and label for a11y
* Update public/app/plugins/datasource/grafana-pyroscope-datasource/ConfigEditor.tsx
---------
Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
Co-authored-by: Joey <joey.tawadrous@grafana.com>
* chore: adds documentation around the dual writer
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com>
* fix: innacuracies in error returned, disambiguate (validation) and move table upwards for more clarity
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com>
---------
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com>
* replace new mapper additional code with new rangeUtil.describeTimeRange
* add some function descriptions
* add regression tests for timezone-respecting range mapping
* remove unused import
* disable auto fetch
* add partially written metric name situation
* add new limit
* add new methods
* rename methods
* implement auto complete after typing at least three letters
* betterer
* cosmetic changes
* partial or full trigger
* cleaner approach
* lint
* fix
* review feedback
* add dev mechanism for making backend unavailable
* handle unavailable backend in html
* fix ordering of /-/ routes
* Add new loader to index.html
* tweak light colours
* fix readme
* add error handling and error state
* use setTimeout for the retry loop
* easier on the comments:
* Remote Alertmanager: Use the same struct for Grafana stat and Mimir full state
* Alertmanager: Add methods to merge nflog and silences
* update grafana/alerting version
* make update-workspace
* update mocks
* remove unnecesary methods from the remote Alertmanager implementation, create separate StateMerger interface
* (WIP) Remote Alertmanager: Optionally merge remote state before starting the internal Alertmanager
* cleanup ngalert.go
* restore defaults.ini
* move state parsing logic to 'remote' package, clean up ngalert.go
* remove GetBase, implement MegeNflog and MergeSilences
* delete fmt.Println
* FetchRemoteState -> GetRemoteState
* UserGrafanaState -> UserState
* remove duplicate clusterpb import
* reorder MimirClient interface
* use general getState() method for Grafana state and Mimir full state
* remove unnecessary state merging methods from the Alertmanager interface
* remove pullState field
* reduce diff
* add info log after merging
* merge silences and nflog entries in the same method
* merge the remote state in the forked AM
* reduce diff
* update remote AM mock
* tests
* make error more specific
* typo
* Cloud migrations: store snapshots in the database
* update github.com/grafana/grafana-cloud-migration-snapshot to v1.9.0
* make update-workspace
* use new field name in test
* return error after call to fmt.Errorf
* create methods for readability / fix session deletiong not deleting snapshots
* remove debugging changes
* update sample.ini
* update tests to include OrgID in ListSnapshotsQuery
* lint
* lint
* Update pkg/services/cloudmigration/cloudmigrationimpl/snapshot_mgmt.go
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
* remove TODO
* Update pkg/services/cloudmigration/cloudmigrationimpl/snapshot_mgmt.go
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
* remove one of the debug logs
---------
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
* add undo/redo for group and base actions
* add undo/redo for rules
* adjust circular dependency issue
* add itemType translations
* adjust how we get rendering group
* fix: separate dashboard api tests
* fix: typo
* refactor: revert file rename
* fix: compilable
* fix: trial
* fix: remove unused func
* Pass the right value for kubernetesDashboardsEnabled flag
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Enable mode 3 for remaining tests
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Disable integration tests for MySQL and Postgres
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Run go work use
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Update go.mod
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Remove TODO comment
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Revert to go 1.24.5
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* go.mod
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Remove duplicated block
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Experiment without reusing client
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Reenable integration tests on Postgres and MySQL
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Revert "Experiment without reusing client"
This reverts commit 0126e321a0.
* Reapply "Experiment without reusing client"
This reverts commit 5368b4c531.
* Refactor how we get an adminClient
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Add TODO comments
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
---------
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
Co-authored-by: Maicon Costa <maiconscosta@gmail.com>
* TimeComparison: Add time comparison option
* Display control conditionally based on option
* Provide timeCompare option to panels that opt in
* Only render time compare if panel supports it
* Create a custom time range compare component
* Move custom component
* Remove button checked
* Move time compare options out of field config
* Fix types and remove from fieldConfigProperty enum
* Remove from field config registry
* Add headerActions to V2 schema
* Remove dependency on timeCompare support registry
* Add feature flag
* Subscribe to options change in wrapper
* Remove custom rendering to simplify wrapper
* Bump scenes version
* Hide checkbox
* Remove unneeded query refresh during disable
* Fix import order in timeseries module
* Add util tests
* Support time comparison toggle for new viz panels
* Revert grafana-app-sdk and manifest changes
* Revert yarn lock
* Add ref option to stage options
* Fix the issue with ref in export worker
* Add unit tests for export stage options
* Do not fail if ref is equal to the stage branch
* Format code again
* fix test
---------
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
* deduplicate config preparation logic squashes config preparation in 3 places into a single method buildConfiguration
* remove copying config from decrypt because we already use copy
* move logic from decryptConfiguration to buildConfiguration
* move logic from mergeExtraConfigs to buildConfiguration
* load default config with buildConfiguration method and skip if fails
---------
Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>
* add test runner and start experimenting with storybook a11y tests
* skip currently failing a11y tests
* first attempt at github action
* fix CODEOWNERS, fix copy assets
* no caching?
* make wait-on better
* increase timeout and add verbose logging
* kick CI
* remove verbose logging, try different runner
* remove commented out code in copyAssets
* try maxWorkers 2
* turn on verbose logging, run as part of same step
* test storybook verify
* try setting LANG
* tidy up
* add betterer test
* fix action buttons flickering in the old list view
* prettier
* address review coments
* remove duplication
* add canCreateGrafanaRules check for ai button
* fix(plugins): match decoupled plugin path in fe plugin loader cache
* chore(devenv): update local_cdn to work with latest changes in core
* refactor(plugins): improve legibility by splitting regexs into two
* revert(devenv): revert -oss removal in local_cdn rewrite path
A breaking change was introduced by this grafana-app-sdk PR: https://github.com/grafana/grafana-app-sdk/pull/795
This PR refactors the definition of our CUE files (manifest and kinds) to match the new model in the latest version of grafana-app-sdk.
* Span Details: Redesign span details header
* Update translations
* Add max width to operation name
* Test update
We don't show the spanId anymore, just the "share" label for each trace
* TableNG: Footer should render summary value in first column if present
* fix issue where empty fields array meant no calcs were shown
* fix a bug related to hidden fields
* go away from fieldmatcher to use a simple inline solution
* First draft autocomplete
* Better naming
* Change suggestion to table/column population
* Remove all suggestions, just use table/column population but trigger on space
* Gate feature flag behind a feature flag
* Reorganize and add function list
* Add blurb about autocomplete to docs
* Update public/app/features/expressions/utils/metaSqlExpr.ts
Co-authored-by: Alex Spencer <52186778+alexjonspencer1@users.noreply.github.com>
* Add try catch, remove promise resolve
---------
Co-authored-by: Alex Spencer <52186778+alexjonspencer1@users.noreply.github.com>
* Table: Style cleanups (minus DataLinkCell word wrap)
* kill JSONCell in favor of a custom display method and style overrides at TableNG
* remove unused type for JSONCellProps
* add increased specificity to CSS selector
* remove inherit and rely on undefined
* fix tests
* shrink and optimize DataLinkCell
* maybe
* format files
* better
* classname
* add Pills and DataLink cells to kitchen sink
* add comment about align + justify, simplify datalinks targeting
* simplify?
* poke
* tweak
* revert
* fix one more z-index conflict
* clean up alignment tests
* a couple more tests
* make TableNG e2e tests more resilient to changes to the gdev dashboard
---------
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
What is this feature?
This PR further improves concurrent updates to the provenance table (a follow-up for #101688). The fix explicitly checks for a provenance record using SELECT ... FOR UPDATE for the databases that support it before performing either an update or upsert operation. This preemptive locking reduces the possibility of deadlocks in MySQL.
This works only with the alertingProvenanceLockWrites feature flag enabled.
Why do we need this feature?
The current implementation (directly performing upserts without prior locking) may still encounter deadlocks because of the gap and insert-intention locks in some configurations, for example, with repeatable-read transaction isolation level in MySQL+InnoDB.
---------
Co-authored-by: William Wernert <william.wernert@grafana.com>
* Add warning job status
* Different strictness for export than for pulling
* Fix some unit tests
* Fix unit tests
* Update frontend to display the warning status
* Fix status badge
* Add missing return statement
* Improve text in alert
* Add test
* BrowseDashboards: Separate folder and dashboard permission checks
* Extract type
* Check for edit permissions
* Prettier
* Refactor test
* Update canEditItemType
* Update render check
* Update the check
* FrontendService: Add tracing and logging middleware
* tests!
* middleware tests
* context middleware test
* revert http_server back to previous version
* fix lint
* fix test
* use http.NotFound instead of custom http handler
* use existing tracer for package
* use otel/trace.Tracer in request_tracing middleware
* tidy up tracing in contextMiddleware
* fix 404 test
* remove spans from contextMiddleware
* comment
* mark up units
* remaining category markup
* prometheus translations...
* load prom resources in core
* more prom markup
* don't load prometheus resources directly in core
* isolate @grafana/data import in jest-setup to prevent side effects in tests
* directly use tz
* Dashboards API: v2alpha2 missing pieces
* Fix issue with dashboard client scope for alpha versions
As we now have 2 different alpha versions for v2 we need to store the
clients separately.
* Improve debuggability of provisioning export test
- Add a helper function to print the tree structure.
- Be explicit about the expected file names expected in each case.
* Update pkg/registry/apis/dashboard/mutate.go
* Update pkg/services/authz/zanzana/server/server.go
Co-authored-by: Igor Suleymanov <radiohead@users.noreply.github.com>
* Review
* go lint
---------
Co-authored-by: Roberto Jimenez Sanchez <roberto.jimenez@grafana.com>
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
Co-authored-by: Igor Suleymanov <radiohead@users.noreply.github.com>
* Context: Clean up contexthandler.Middleware spans
* seperate the middleware span from the rest of the request
* shuffle
* put of back
* span name
* Update pkg/services/contexthandler/contexthandler.go
Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
---------
Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
* Alerting: Contact point export snapshot test
* Fix Jira.fields hcl export type to allow map[string]any
Since gohcl does not support this type, we marshal as a string instead
which will be handled in the TF provider.
* mapToJSONStringCodec encoder needed for
TestContactPointFromContactPointExports
* fix: handle dashboards without version entries in migration
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com>
* fix: adds AllowFallback flag to enable COALESCE logic explicitly during migrations
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com>
* fix: update dependencies
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com>
* fix: maintain original behavior when not using AllowFallback option
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com>
---------
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com>
* LogLine: optionally highlight search based on syntax highlighting state
* Log Details: support multiple details open
* Translations
* Add test
* LogLine: allow to highlight frontend searches
* LogLine: improve hover vs details displayed colors
* LogLineDetails: add scroll to log line option and improve toggling behavior
* Translations
* LogLineDetails: prevent sidebar re-rendering
* LogLineDetails: more tests
* Add frontend redirect to login
* Make Login topnav link do a page transition to login page
* Force AppChromeState update when route changes to get new isChromeless state
* Add base url to SignInLink, and add tests
* wrap login page in <Page />
* comment, test
* fix loginPage test
* rejigger signin check, remove chrome from deps
* Add time range to tags and tag value requests
* Prettier
* Change timeRangeForTags to number and dropdown with options
* Listen to changes and update docs
* Update docs
* Prettier
* Text updates
* Extract getOptionsV2 params to type
* Use this.tagsForTimeRange
* Docs and move section up
* Prettier
* Update docs
* reimplement original design
* update button with responsive design that matches other elements in top bar; add comprehensive unit tests
* add a basic call out in docs for new button
* remove doc changes
* Table: Force tableNextGen to be true for Playwright and false for Cypress
* RDG query for body text contains the headers too
* add some simple tests for row height
* dial in the row height test a little more
* more updates
* filters, pagination
* try this on CI
* more updates to the tests
* more tests
* wait for some sort stuff to flush
* replace class selectors for rdg
* target the click to the anchor in the header
* Basic implementation of inline library panel
* modify the warning message, we support the export partially by converting regular panels the library panels
* Improve message around the conversion, keep it concise
* Fix linting
* Refactor conversion, extract existing logic into new funcition and reuse it
* remove unnecesary comment
* show error notification when library panel does not load
* Apply PR feedback, remove unnecesary try catch and return json with error, don't throw
* Add unit tests
* Fix monitoring report, add case when v2 is loaded originally or when transformed from v1
* Add unit tests for detect libraryPanels, relevant for ensure monitoring is correct
* Move .git to repository packages
* Bump nanogit 2025-07-17
This version handles `.git` extension internally so that the client
doesn't have to worry about it
* Put back mutation for Github
* Mutate also git URL for clarity
* Register usage stats after lister is created
For enterprise where metrics are collected more frequently and in
different ways the collection was happening before the listing was
initialized.
* Move usage to separate package
* New Logs Panel: Add events for Panel and Details
* Logs Panel: add noInteractions property
* New Logs Panel: conditionally report interactions
* Test
* parse via sse
I need to figure out how to handle the pipeline.execute with our own
client. I think this is important for MT reasons, just like using our
own cache (via legacy) is important.
parsing is done though!
* WIP nonsense
* horrible code but i think it works
* Add support for sql expressions config settings
* Cleanup:
- remove spew from nodes.go
- uncomment out plugin context and use in single tenant flow
- make code more readable and add comments
* Cleanup:
- create separate file for mt ds client builder
- ensure error handling is the same for both expressions and regular queries
- other cleanup
* not working but good thoughts
* WIP, vector not working for non sse
* super hacky but i think vectors work now
* delete delete delete
* Comments for future ref
* break out query handling and start test
* add prom debugger
* clean up: remove comments and commented out bits
* fix query_test
* add prom debugger
* create table-driven tests with testsdata files
* Fix test
* Add test
* go mod??
* idk
* Remove comment
* go enterprise issue maybe
* Fix codeowners
* Delete
* Remove test data
* Clean up
* logger
* Remove go changes hopefully
* idk go man
* sad
* idk i ran go mod tidy and this is what it wants
* Fix readme, with much help from adam
* some linting and testing errors
* lint
* fix lint
* fix lint register.go
* another lint
* address lint in test
* fix dead code and linters for query_test
* Go mod?
* Struggling with go mod
* Fix test
* Fix another test
* Revert headers change
* Its difficult to test this in OSS as it depends on functionality defined in enterprise, let's bring these tests back in some form in enterprise
* Fix codeowners
---------
Co-authored-by: Adam Simpson <adam@adamsimpson.net>
* Update dependency @reduxjs/toolkit to v2.8.2
* update types to work with new rtk-query version
* kick CI
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* alerting docs: activate active timing time
rough draft: documentation for active timing feature.
* purdier
* more tweaks
* edits via yuri advice
* prettier
* Use provider in Webhooks registration
* First stab at using the new client
* Simplify mock
* Able to generate graph in OSS
* Remove line already ensured by provider
* Handle the K8s not found error as well
* Commit regenerated wire file
* Add the hack also for deletion
* Fix secrets test util
* Format file
* test(frontend): ignore azuremonitor tests in root jest config
* test(loki): increase waitfor in monacofieldwrapper test
* feat(plugin-configs): introduce jest config
* feat(azuremonitor): add jest config and test scripts
* ci(pr-frontend-unit-tests): introduce separate decoupled plugin test job
* ci(pr-frontend-unit-tests): run decoupled-plugin tests regardless of fork
* Wip
* test(decoupled-plugins): decouple tests in all plugins except loki and mssql
* test(frontend): ignore decoupled plugins that run their own tests
* test(stackdriver): update snapshot due to reactinlinesvg mock difference
* chore(yarn): update lock file
* chore(plugin-configs): remove create-plugin comments
* ci(frontend-unit-tests): make them run on pr or merge to main
* chore(decoupled-plugins): add plugin:test:ci command for locally running all tests
* ci(frontend-unit-tests): run test:ci instead of calling nx directly
* chore(decoupled-plugins): fix jest-dom types for loki and testdata
* add prompt param to AzureAD oauth config
* yarn i18n-extract
* validate auth prompt value
* make login_prompt available for all SSO providers
* use base authCodeURL for azure and google
* add docs for the new field for azure and generic oauth
* fix typo
* fix frontend unit test
* add prompt parameter to docs for the other providers
* remove prompt from okta
* add unit tests for the other providers
* address feedback
* add back translations for prompt labels
* Add Create for User + DualWriter setup
* Add delete User
* Fix delete + access check
* Add tests for delete user
* Add tests for create user
* Fixes
* Use sqlx session to fix database locked issues
* wip authz checks
* legacyAccessClient
* Update legacyAccessClient, add tests for create user
* Close rows before running other queries
* Use ExecWithReturningId
* Verify deletion in the tests
* Add Validate and Mutate
* Other changes
* Address feedback
* Update tests
---------
Co-authored-by: Gabriel Mabille <gabriel.mabille@grafana.com>
* refactor(explore/spanFilters): move default filters and search props to shared folders
chore: ammend with refactor commit
chore: ammend, fix type errors
* feat(explore): add spanFilters to global state on explore
* feat(explore/spanFilters): sync span filters with global redux state
* feat(explore): sync spanFilters with URL state
* Moved span filters to panel state
* Fix types
* Fix tests in useSearch
* Fix TraceView tests
* Remove console.warn
* fix(test/trace-view-container): add span filter context to intial state
* refactor(traceview): use generic redux action
* fix(traceview): prune array objects correctly to preserve tag state in URL
---------
Co-authored-by: André Pereira <adrapereira@gmail.com>
* Secrets: Add single tenant SecureValueClient
* SecureValueClient: Rename file
* SecureValueClient: Move original type to contracts package and export it by aliasing
Update grafana/alerting to 8eef376f49f8
Includes support for OAuth2 in most notifiers but does not enable that support
yet in FE. Fixes tests related to the change.
* wip
* docker compose dev setup
* commit new tilt stuff
* move files into own dir
* reset files back to main
* use just one nginx container for both gateway and cdn
* update proxy service name
* make it all work when in subdir
* rename more things
* reset more changes
* fix config
* add makefile command, fix ws upgrade
* add local check script
* tidy
* tidy up, comments, readyme
* codeowners
* change cdn host to localhost to avoid adding host.docker.internal to /etc/hosts
* route POST /login to backend
* Build nginx container with config baked in so it can be live_update-ed
* fix headers
* OTel: create formats service
* LogListContext: use OTel service to resolve the default displayed fields
* Create otelLogsFormatting feature flag
* LogListContext: conditionally use otel format based on feature flag
* OTel logs: reformat body and improve displayed fields
* formats: remove duplicated scope name
* Update formats.ts
* format: use regex rules to exclude fields
* Add tests
* Formatting
* LogsPanel: expose setDisplayedFields
* LogListContext: refactor otel displayed fields
* Prettier
* format: optimize identifyOTelLanguages
* feat: introduce a Github workflow that is notifying on extension related changes
* review: fix review notes
* review: remove broken heart
* fix: use a new version of the send-slack-message action
* Dashboards API: Register v2alpha2 API
* Prepare conversion functions
* Fix test
* Move to the bottom the v2aplha2 until is ready
---------
Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
* Dashboard: Add Monitoring to v1 and v2 export flow, including library panels interaction
* fix error with v2 transformed dashboard not having haslibraryPanels
* apply PR suggestions, extract as const and refactor for readability
* Add unit test for the new functions
- Add hooks to git, github and github webhooks to remove the.
- Implement deletion in secrets package.
- Add `Mutator` interface and hooks so that we can register any mutator.
- Add unit test coverage to those mutators.
- Move provider specific mutation from the massive `register.go` to the respective packages (e.g. `git` , `github`, etc).
- Add integration test for removal.
- Change the decryption fallback to simply check for the repository prefix.
* Use my fork for testing
* set gzip: false
* use push-to-gcs@main
* use my branch for testing
* use main for login and push to gcs?
* Use push-to-gcs/v0.2.1
* use main; set gzip to false
* use main instead of my branch
* Dashboard Migrations: V31 LabelsToFields-Merge Migration
* Dashboard Migrations: V32 No-op migration
* simplify
* Refactor to reduce nesting
* Dashboard Migrations: V30 value mappings and tooltip options
* Do not automigrate since graph is migrated in v27
* Refactor to reduce nesting
* Add test case for invalid mapping
* migrate to v29
---------
Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
* Unistore: Fix dualwriter mode 3
Fallback to legacy if Unified is the main store and we get an error when
reading from it
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
---------
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
- Provisioning: Begin using secrets store
- Refactor integration with secrets store
- Add back the legacy service
- Separate concerns for encrypt and decrypt
- Handle update within Encrypt function
- Add interface for secure value service
- Add feature flag for using secrets service
- Add the dual service for temporary solution.
* Add first integration tests for encrypted tokens
* Add integration test for app platform secrets
* Validate it has the name or not
* Create wire provider
* Always save to the secret if provided secret
---------
Co-authored-by: Roberto Jimenez Sanchez <roberto.jimenez@grafana.com>
Co-authored-by: Roberto Jiménez Sánchez <jszroberto@gmail.com>
* Add a feature toggle
* Disable alerting when the toggle is switched off
* Update tests
* Update tests
* Update tests
* Simplify ReadPluginJSON as it's used by enterprise
* Update test
* Update test
* Add the toggle check to loader.go
* Move the logic to plugins integration pipeline
* when localeFormatPreference toggle is enabled, always use a common datetime format in TimeRangePicker
* fix lint issue
improve comment
* test printing datetime input format
* adds tests for entering dates in inputs to be parsed
adds will-be redundant tests to ensure system date format is or isn't respected when appropriate
feat(alerting): Add forwardRef to MetaText component
This change introduces forwardRef to the MetaText component, allowing parent components to gain direct access to the underlying div element. This is particularly useful for scenarios where the parent needs to measure the component's dimensions, manage focus, or integrate with other libraries that require a DOM element reference.
* return calculatedMinStep in first frame of the response
* update test files
* make the custom metadata as type of map[string]any
* append calculatedMinStep to custom metadata
* fix exemplar frame checking
* static options for query variable
* add toggle
* fix and add tests
* run the hack codegen thing
* more test fixes
* make betterer happier
* also make typecheck happy
* make betterer happier
* fix i18n key
* tranalte static variables sort label
* gen translations
* update snapshot
* Secrets: delete unused FakeKeeper
* Secrets: encrypted value storage stores versions
* add version to span
* trigger build
* remove ineffectual assignment
* lint
* drop secret_encrypted_value.uid / add name and version columns
* feat(extensions): don't allow core grafana extension point ids in plugins
* feat(extensions): log more specific errors if extension point id validation fails
* chore: move the ExtensionSidebar ext. point id to grafana-data
* review: remove type assertion
* Add types for other repositories
* Inject the types from extras
* Fix go-lint
* Fix typecheck
* Add it to the tests
---------
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
* Secrets: add state machine test for CRUDL+decrpt operations
* make update-workspace
* make update-workspace
* make enterprise-dev
* make update-workspace
* fix go.mod
* make update-workspace
* fix gomod
* make update-workspace
---------
Co-authored-by: Matheus Macabu <macabu.matheus@gmail.com>
* Secrets: Add v1beta1 API using CUE
* Secrets: Generate spec with app-sdk
* Secrets: Generate decrypt proto
* Secrets: Add manual files to help transition
* CalculateFieldTransformerEditor
* more CalculateFieldTransformer
* ConcatenateTransformerEditor
* ConfigFromQueryTransformerEditor
* mark up other transformations
* few things spotted manually
* mark up variable types
* mark up annotation stuff
* mark up TagsInput placeholder
* mark up validation messages
* mark up required error
* Mark up metrics explorer modal
* separate playwright into its own folder
* better separation
* add login scenario, add tags
* remove ui option
* update CODEOWNERS
* add a panels suite test
* migrate queries test to playwright
* rename + add dashlist test
* add panelEdit_base
* add geomap map controls test
* add geomap-layer-types
* add geomap-spatial-operations tests
* add frontend-sandbox-panel tests
* add smoke-tests-suite
* add comment about adding datasource
* add dashboard-browse-nested
* add dashboard-browse
* add dashboard-export-json
* add dashboard-keybindings test
* remove @wip tag
* turn on screenshots and add comment for why this test fails
* add dashboard-links-without-slug test
* try adding permissions in the test as well
* add dashboard-live-streaming
* context in the test doesn't work - sad
* create dashboard-public-templating
* add dashboard-public-create and make live streaming more resilient
* add share externally test
* add dashboard-share-internally
* add share-snapshot-create test
* add dashboard-templating
* add timepicker tests
* add embedded-dashboard test
* add general_dashboards test
* add import-dashboard test
* add load-options-from-url test
* add new-constant-variable test
* add custom-variable test
* add new-datasource-variable test
* add new-interval-variable test
* add text-box-variable test
* add new-query-variable test
* add horizontal repeat test
* add panel-vertical-repeat test
* add empty-row-repeat test
* add set-options-from-ui test
* add snapshot-create test
* add templating test
* add textbox-variables test
* add cloud-plugins-suite
* add storybook verification tests
* add playwright storybook verification workflow
* add playwright browsers
* update CODEOWNERS
* test change to trigger storybook verification workflows
* try container instead
* get the version right...
* go back to installing - less chance of forgetting to update
* Basic Github Actions
Squashed commit of the following:
commit f84c650a71
Author: joshhunt <josh.hunt@grafana.com>
Date: Tue Jul 1 13:23:46 2025 +0100
add arg for sharding, but not using it yet
commit 7bcf0512c6
Author: joshhunt <josh.hunt@grafana.com>
Date: Tue Jul 1 12:30:30 2025 +0100
less newline
commit b643911882
Author: joshhunt <josh.hunt@grafana.com>
Date: Tue Jul 1 12:24:31 2025 +0100
less logs
commit 38f871e9c2
Author: joshhunt <josh.hunt@grafana.com>
Date: Tue Jul 1 10:00:26 2025 +0100
fix yaml
commit db9a773136
Author: joshhunt <josh.hunt@grafana.com>
Date: Tue Jul 1 09:57:47 2025 +0100
clean up files
commit c0525f41fa
Author: joshhunt <josh.hunt@grafana.com>
Date: Tue Jul 1 09:44:56 2025 +0100
gha workflow
commit 895bea7c52
Author: joshhunt <josh.hunt@grafana.com>
Date: Mon Jun 30 19:33:08 2025 +0100
working dagger
commit cea1f84437
Author: joshhunt <josh.hunt@grafana.com>
Date: Mon Jun 30 16:17:46 2025 +0100
wip
* shard gha
* some tidy up
* add flags for exporting results, and a gha step to merge runs
* fix shard gha
* add dashboard-duplicate-panel test
* add dashboard-outline test
* add dashboards-add-panel
* remove some commented out code
* add dashboards-title-description test
* add dashboards-remove-panel
* don't install cypress
* gha: check playwright results
* add dashboards-edit-adhoc-variables test
* fix check-jobs
* add dagger cloud token
* add dagger cloud token
* add edit-datasource-variable test
* update CODEOWNERS
* add dashboards-edit-group-by-variables (skipped for now)
* add dashboards-edit-panel-title-description test
* add dashboards-edit-transparent-bg test
* add dashboards-edit-query-variables test
* run with 8 shards
* add dashboards-edit-variables
* tidy up gha
* add dashboard-group-panels
* fix action
* try to cache the grafana build
* fix missing action becuase no checkout, use builtin continue-on-error instead
* fix missing id
* cat out.txt
* debug build cache
* fix debug build cache
* add dashboards-panel-layouts test
* tidy up
* no more debug
* fix grafana dir
* add dashboards-move-panel test
* skip some failing tests
* mark up plugins tests with @plugins tag, only run @plugins tests in drone
* Hackathon/Playwright Conversion - Various Suite (#107516)
* Playwright Migration: Various Suite tests
* skipping bad tests
* fix some tests that can fail
* fix uid
* separate user for the verify-i18n test
* build test plugins for grafana server
* properly blur input fields
* login manually
* get dashboardPage from goto
* ignore a couple of type assertions
* remove a couple of timeouts
* remove timeouts on dashboard-share-internally
* use toBeHidden
* make dashboard-share-internally more stable
* remove TEMP_DAGGER_TOKEN
* clean up visaulization-suggestions
* unskip gauge test
* unskip trace-view-scrolling
* attempt to make create variable utils stable
* unskip loki tests
* make go linter happy
* unskip edit-group-by-variables test
* unskip move panel tests
* isolate dashboard-timepicker tests with separate user
* create data source as part of smoke test
* make sure we're awaiting in dashboard-edit-adhoc-variables
* make dashboards-edit-variables test more robust
* Hackathon Playwright: Dashboards Search (#107580)
* Hackathon Playwright: Dashboards Search
* Feedback changes
* make trace-view-scrolling more stable
* add json report and bench step
* fix bench version
* move fail step to after the playwright report so we can report test failures
* fix output file name
* fix typo
* try wrap in expect.poll
* stability
* bit more tidy up
* fix dashboard-new-layouts tests
* move test-plugins to e2e-playwright
* fix go code for drone e2e run
* move loki plugin-e2e test
* make v2 dashboards work again
---------
Co-authored-by: joshhunt <josh.hunt@grafana.com>
Co-authored-by: Josh Hunt <joshhunt@users.noreply.github.com>
Co-authored-by: Collin Fingar <collin.fingar@grafana.com>
Co-authored-by: Jeff Levin <jeff@levinology.com>
* Remove noisy log line
* Add IsProvisioned field to UpdateUserCommand
* Update user store to include the new IsProvisioned field
* Update store tests to include the new IsProvisioned field
Align with option names in contact point.
To avoid confusion, ensure that the documentation aligns with the option names used in the Jira contact point.
This PR fixes an error when reading STRING_VIEW columns by correctly mapping STRING_VIEW in the newField factory and by adding a dedicated test to validate copyData’s handling of both nullable and non‐nullable STRING_VIEW arrays. This enables the Distinct Value Cache feature of InfluxDB v3 Enterprise for use.
* Run TestIntegrationFoldersApp for all dualwriter modes on sqlite only
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
---------
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Get ResourceStats before indexing
* Replaced localcache.CacheService to handle expiration faster (localcache.CacheService / gocache.Cache only expires values at specific interval, but we need to close index faster)
* singleflight getOrBuildIndex for the same key
* expire only in-memory indexes
* file-based indexes have new name on each rebuild
* Sanitize file path segments, verify that generated path is within the root dir.
* Add comment and test for cleanOldIndexes.
* Auth: Add functional option for static requester methods
Initially supporting WithServiceIdentityName to set a ServiceIdentity
inside the Claims.Rest object, so that Secrets Manager can parse
the service requesting secret decryption.
On Secret creation, the service will have to pass its identity
(which is a freeform string) to the SecureValues' Decrypters object.
This field gates which services are allowed to decrypt the SecureValue.
And upon decryption, the service should build a static identity with
that same service identity name when calling the decrypt service.
* StaticRequester: Put secret decrypt permission in access token claims
* StaticRequester: Inline getTokenPermissions function
* NewProvisionedFolderForm: pass in empty title for new folder form
* NewProvisionedFolderForm: preview folder name
* i18n, fix test
* Added test
* added todo
* PR comment
* i18n
* open cell inspect in code mode for JSON panels
* increase opacity of TableCellActions background for legibility in overlap cases
* fix nested grid width calculation
* fix 'jumping' on hover overflow
* route transparency through (needs a scenes update)
* base row hover color on transparency
* update the colors for table
* remove console.log
* reinstate header toggle for nested row transformation
* fix#59474 - graceful handling when subtable has no rows
* fix i18n
* use TABLE.LINE_HEIGHT
* change nestedData back to const
* replace PostableUserConfig with GrafanaAlertmanagerConfig to decouple from internal Grafana models
* update alertmanager + tests
* calculate hash of the GrafanaAlertmanagerConfig
* Folders: disable TestIntegrationFoldersGetAPIEndpointK8S
it's breaking the enteprise CI pipeline
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Run only against sqlite
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* noop: force backend change
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
---------
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* PoC: check if testing.Short is called from integration tests only.
* Rename helper function.
* Fix logic.
* Remove skipping of integration tests from non-integration tests.
* Remove skipping of integration tests from non-integration tests.
* Fix import.
* Secrets: make operations sync
* k8s gen / update query to list secure values to include the version
* always store new version of a secret
* make update-workspace
* go mod tidy
* update queries
* update queries
* improve and use testutils in decrypt_store_test
* fix broken test
* make update-workspace
* ./hack/update-codegen.sh secret
* update Test_SecureValueMetadataStorage_CreateAndRead
* undo dependency changes
* linter: fix remaining errors
---------
Co-authored-by: Matheus Macabu <macabu.matheus@gmail.com>
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
* Bump nanogit 2025-07-09
This version contains significant performance improvements in memory and
CPU thanks to optimizing buffers, using a faster zlib library and using
streaming instead of loading everything in memory.
* feat(plugin-configs): update configs to work with nodes strip-types feature
* build(parca): use nodes experimental-strip-types so build works with node 22 - 24
* build(decoupled-plugins): support nodes strip types feature for webpack builds
* build(e2e-test-plugins): update build scripts and config to work with node strip types
* style(plugin-configs): fix import/order lint errors
* refactor(plugins): use allowImportingTsExtensions in favour of ts-ignore comments
* refactor(plugin-configs): clean up ts-ignore and ts-expect-error comments in webpack.config
* refactor(plugin-configs): fix up changes for nodes strip-types flag
* chore(loki): fix up build command for node 24 support
* feat: reconfigure expression button for improved UX
* chore: fix broken test
* chore: refactor to use improved UX + combine another UI PR.
* chore: i18n
* chore: memoize options + add data test ids for tracking
* chore: common component for expression dropdown
* chore: streamline common component
* chore: add event tracking
* chore: put event tracking in its own PR
* v2 of pills for tables
* cleanup bettererrrrr
* cleanup pretty
* i18n changes
* add in the option for value mapping
* value mapping
* change to just use the value mapping from the table component
* tests fixed
* betterer all better now
* fix pretty
* i18n
* fix gen issue
* i18n
* fix merge issue
* Refactor pillcell to an interface for said pill, cleanup tests
* mind the space says prettier
* Update dependency chance to v1.1.13
* use same version of chance everywhere
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: joshhunt <josh.hunt@grafana.com>
* Folders: reenable unit test TestFoldersCreateAPIEndpointK8S
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* reenable unit test TestFoldersGetAPIEndpointK8S
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
---------
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Add access token as third source for user info extraction
- Add extractFromAccessToken method to extract user info from JWT access tokens
- Mutualize code by creating parseUserInfoFromJSON helper method
- Rename methods for clarity: extractFromToken -> extractFromIDToken, retrieveRawIDToken -> retrieveRawJWTPayload
- Update test suite to include comprehensive access token retrieval scenarios
- Support three sources in priority order: ID token, API response, access token
- Maintain backward compatibility while adding new functionality
* Update Generic OAuth documentation to reflect access token support
- Add access token as a third source for user information extraction
- Update configuration sections to mention access tokens alongside ID tokens and UserInfo endpoint
- Document the priority order: ID token → UserInfo endpoint → access token
- Update configuration option descriptions to reflect new functionality
- Maintain consistency with implementation changes
* Refactor access token test cases to use parameter instead of hardcoded logic
- Add AccessToken field to test case struct for explicit access token specification
- Remove hardcoded string matching logic that determined access token based on test name
- Update all access token test cases to include the AccessToken field with appropriate JWT values
- Improve test maintainability and clarity by making access tokens explicit parameters
- Remove unused strings import that was only needed for the hardcoded logic
* fix doc lint
* reduce cyclomatic complexity
* Use panel.id from the dashboard to filter alterts properly
* add unit test
* Fix linting
* add fix back
* fix betterer in test, use same pattern as DashboardDatasourceBehaviour
* Dashboard: Add ability to search by folder name in library panels
* restore to main to fix linting issues
* restore from main to avoid go linting issues
* add logic to the writers.go that search by folder title if folder is not passed
* add missing left joing from the folder table
* Add extra logic to prevent folder searches without permission
* fix go linting issue about memory
* Add test when searching by folder name
* Refactor tests to include a bit more validation
* apply feedback and use SearchFolder from search folder service
* clean up comments
* Update pkg/services/libraryelements/database.go
Co-authored-by: Ezequiel Victorero <ezequiel.victorero@grafana.com>
* Fix logic of early return
* Extract into a function and remove the left join
* Apply feedback to be aligned with idiomatic go
* Apply suggestion from @evictorero
Co-authored-by: Ezequiel Victorero <ezequiel.victorero@grafana.com>
* fix liting
---------
Co-authored-by: Ezequiel Victorero <ezequiel.victorero@grafana.com>
* Tidy up storybook a little bit
* change sort order, delete some stories
* More tidy up of actions
* More tidy up of actions
* tweak story sorting, again
* Make all internal stories public
* fix sort
* Add ESLint rule to enforce storybook titles
* update verify storybook test
* simplify glob
* BrowseDashboardsPage: added ProvisionedFolderPreviewBanner to display new provisioned folder on branch alert
* add comment
* fix test
* i18n
* Added test for PreviewBannerViewPR
* fix test, i18n fix
* PublicDashboards: Use API to render public dashboard badge
* i18n
* Keine console bitte
* Update public/app/features/dashboard-scene/scene/NavToolbarActions.tsx
* Update tests
* Update dependency react-calendar to v6
* add esmodules to jest config
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* Update dependency marked to v16
* mark marked as esmodule for jest
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* introduce ExtraConfigsCrypto
* delete getLastConfiguration and move all code into method Get
* update legacy store to encrypt ExtraConfigs same way we do in MultiOrgAlertmanager
* update legacy store init
* delete PersistConfig
* remove unnecessary unmarshalling
* add better error
* add tests for legacy store
* add tests that cover extra config validation
* add integration test for conflicting routes
---------
Signed-off-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
* mark up and add confirmText to lint rule
* mark up and add ariaLabel to lint rule
* add confirmText to propertiesToCheck
* mark up and add body to propsToCheck
* mark up latest
* mark up 'Dashboard saved'
* mark up filterbyvalue options
* mark up tooltip options
* mark up and add lint rules for noOptionsMessage/loadingMessage
* mark up 'Convert field type'
* mark up placeholderText/noOptionsMessage
* mark up run query
* mark up variable editor fields
* mark up week start options
* mark up dashboard link options
* mark up prom options
* mark up builder/code toggles
* make CI happy
* kick CI
* fix(plugin_loader): don't import an app plugin twice
* review: extract IIFE to a separate function (async part of plugin loading)
* fix: remove code for testing
* feat(grafana-data): expose PluginContext
This is aimed to be used in the `PluginErrorBoundary` (which is a class component, and cannot use the hook.)
* feat(PluginErrorBoundary): add an error boundary for plugins
* feat(ExtensionsErrorBoundary): add an error boundary for extensions)
* feat(Extensions/Utils): wrap components with error boundaries
* feat(Plugins): wrap root plugin page with an error boundary
* fix: Fallback component should always be visible for onClick() modals
* review: use object arguments instead of positional ones for `renderWithPluginContext()`
* review: update `wrapWithPluginContext()` to receive args as an object
* refactor(AppChromeExtensionPoint): remove the error boundary
We have an error boundary on the extensions-framework level now
* refactor(ExtensionSidebar): remove the ErrorBoundary from the extensions
This is handled on the extensions-framework level now.
* test(ExtensionSidebar): add tests
* chore: translation extraction
* chore: prettier formatting
* fix(PluginErrorBoundary): remove unnecessary type casting
* compare dashboard updated at while fetching
* test added
* added created field in dashboard dto meta object for k8s api. fixed cache updation check
* code refactor
* code formatting with prettier
* added created at field in DashboardPageProxy.test.tsx
* wip
* Add working actions for GMA rules based on Prom-only API
* Remove Ruler-loader related code for Grafana rules
Co-authored-by: Sonia Augilar <sonia.aguilar@grafana.com>
* Remove outdated tests
* add some comments
* remove commented code
* remove showLocation property
* Add missing mocks in tests
* Add showLocation to GrafanaRuleListItem, improve useAbilities, address PR feedback
* Enhance GrafanaGroupLoader tests: Add permission checks and More button functionality
- Introduced user permission grants for alerting actions in tests.
- Added tests for rendering the More button with action menu options.
- Verified that each rule has its own action buttons and handles permissions correctly.
- Ensured the edit button is not rendered when user lacks edit permissions.
- Confirmed the correct menu actions are displayed when the More button is clicked.
* Update translations
---------
Co-authored-by: Sonia Aguilar <soniaaguilarpeiron@gmail.com>
Co-authored-by: Sonia Augilar <sonia.aguilar@grafana.com>
* Add scopes to queries in DataSourceWithBackend
* Remove Prometheus-specific solution
* Readd prometheus support
* move scopes reordering ti loki ds
* Add tests and logQLScope feature flag
* Move featureToggles to before/after each
* Remove irrelevant file change
* wip
* Use serviceaccount model from /apps/iam
* revert version update
* Add tembinding, userteam, other improvements
* Change serviceaccounttoken spec
* Revert the change of ServiceAccountToken
* Revert the change of UserTeam
* Clean up
* Remove files that are not needed for now
* Lint
* Update sql query's integration tests
* Fix tests
* update openapi spec
* Move LastSeenAt to the annotations
* Updte openapi_snapshots
* Change lastSeenAt annotation name
* TableNG: wrapped header text option
* reorganize variable names and code for easier reuse
* refine height math
* move empty string check to after null check
* add tests for useHeaderHeight
* maybe a bit faster
* cleanup to avoid creating fns and objects all the time, some tests
* fix unit test
* cell was using panel height
* add borders between header cells to make resizing more obvious
* fix tests
* changes from mob review
* jk
---------
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
* wip: trying to understand how to get the ds info from migrator
* add datasource info provider
* Use DS service to fetch DS data
* add more tests cases to match with migrator cases
* Add snapshots
* Non-existing DS
* Add different DS for snapshots
* fix import
* Fix tests: guard against double initialization
* don't use full datasource package in test
* min version should be 35
* fix test
* fix conversion test
* Dashboards: Support schemaVersion v35 migration in backend
* Dashboards: Support schemaVersion v34 migration in backend
* Dashboards: Support schemaVersion v33 migration in backend
* Apply suggestions from code review
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
* Apply feedback
* Remove unused parameters
* Refactor to follow Go patterns
* Update logic
* Only write final migration result as output
* Compare backend and frontend results
* Improve snapshots to cover all possible use cases
* Linter
* wip make it consistent v33
* apply feedback
* Return default when the ref cannot be found
* Update apps/dashboard/pkg/migration/schemaversion/v33.go
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
* apply feedback
* Use same mocks backend/frontend
* restore migrations
* update snapshots
* Adapt migration tests to use min versions
* Ensure v40-v41 works
* Ensure v39-v40 works
* Simplify the naming of the files
* adjust jest to new input convention
* Ensure every migration v36-v41 works
* Improve v38 naming
* Ensure v36 migrates correctly
* Skip v36 refs migrations on rows
* Treat rows as frontend and ensure same results for v36
* Ensure v34 runs with the same logic than the frontend
* Leave empty stadistics as valid option
* ensure v33 is working as the frontend
* Update tests
* Undo frontend changes for legend handling
* Remove filtering by version in the frontend
* linter
* Clean up v33 input JSON
---------
Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
* Remove dbProviderFunc function.
This removes one extra indirection that made the code bit more difficult to navigate.
* Remove indirection function types implementing single-method interfaces.
This streamlines the code and makes it bit easier to navigate.
* Update pkg/storage/unified/sql/sqltemplate/dialect_mysql.go
Co-authored-by: Mustafa Sencer Özcan <32759850+mustafasencer@users.noreply.github.com>
---------
Co-authored-by: Mustafa Sencer Özcan <32759850+mustafasencer@users.noreply.github.com>
* Add more unit tests to cover dashboardv2 and cross version unmarshalling
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com>
* Change import name of meta v1
* Rename TestLargeDashboardSupport since there are tests for multiple versions
* Simplify TestLargeDashboardSupportV2
* Use v1 in TestLargeDashboardSupportCrossVersion, simplify original dash
* Marshal spec in TestLargeDashboardSupportCrossVersion
* Remove TestLargeDashboardSupportCrossVersion
---------
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com>
Co-authored-by: Bruno Abrantes <bruno@brunoabrantes.com>
* Alerting: Fix notification policy conflicts originating from provenance mismatch
Sometimes the provenance field on the notification policy route can mismatch with the actual provenance in the provenance store.
This leads to 409s when trying to update the notification policy via the k8s apis.
We avoid this by ignoring the provenance field when calculating the fingerprint.
Co-authored-by: Matt Jacobson <matthew.jacobson@grafana.com>
* fix tests which validate stability
---------
Co-authored-by: Matt Jacobson <matthew.jacobson@grafana.com>
* Zanzana: Add detailed instructions for running and instrumenting
* Running Zanzana standalone server WIP
* Describe how to run zanzana server
* Fix readme link
* Update cli info
* update how to run postgres
* LogLine: remove new lines in unwrapped mode
* Displayed fields: fix displayed fields when the body is included
* LogLine: prevent overflows from extremely long lines with incorrect width measurement
* Update tests
* virtualization: test calculateFieldDimensions
* getGridTemplateColumns: consider displayed fields to set the grid sizes
* LogList: hide overflowing fields in unwrapped mode
* processing: extract regex
* LogLine: improve hover and selected state
* virtualization: strip ansi color codes for measurement
* Update tests
* LogLine: improve log line pre-resize state
* Revert "LogLine: improve log line pre-resize state"
This reverts commit a6b4ddded5.
* LogLine: improve hover/active color
* initial edits
* edits to config doc
* query editor updates
* ran prettier
* updates
* made more updates
* final edits
* ran prettier, updated some descriptions
* a few more quick edits
* one more definition
* add generated tags to wire
* add enterprise wire gen target to makefile
* make gen-go invoke enterprise
* change go:generate command
* handle empty genTags properly
* update golden files for wire
* use build tag for swagger generator
* fix comments
* Plugins: Fix and encode invalid gRPC header values
* Rename the method
* Run sanitizeHTTPHeaderValueForGRPC only if string includes utf8
* Update test
* Simplify
* Update
* do not double encode encoded characters
* Update test
* Update
* Add test case based on review
* Update test
* Fix organization deletion error messages
- Improve error message clarity when attempting to delete active organization
- Fix incorrect 'Failed to update organization' message to 'Failed to delete organization'
- Update comment to be more precise about the check being performed
Fixes#92792
* Improve error handling in organization deletion service
- Add contextual error message when dashboard deletion fails during org deletion
- Include organization ID in error message for better debugging
- Import fmt package for error formatting
This helps administrators understand which specific organization failed
during the deletion process when dashboard cleanup encounters issues.
* Fix typo in unified resource access error message
Change 'Namespace missmatch' to 'Namespace mismatch' for correct spelling.
* Plugins: adds basic PopupExtension point
* Simplify the extension point.
* Excluding the app chrome extension to be rendered on login/signup pages.
* Added feature toggle to be able to disable the app chrome extensions.
* Adding an error boundary around the extension point.
* Changed the way we use the feature toggle.
* moved to use the helper function instead of filtering.
* removed duplace info.
* chore: remove leftover useMemo
---------
Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
* automatically rename integration tests to follow the common convention
* name tests differently
* alter column type to bigint
* update another column to bigint
* add another alter
* fix subquery for mysql
* Add ofrep pkg
* api server: Use namespace from request in case user is not authenticated
* Add handlers to ofrep api builder
* Add NewOpenFeatureService to initialize mt apiserver
* allow specifying CA and insecure
* Compare namespace with eval ctx stackID
* Organize ofrep package
* Implement AllowedV0Alpha1Resources
* Revert folderimpl changes
* Handle default namespace
* Fix extracting stack id from eval ctx
* Add more logs
* Update pkg/registry/apis/ofrep/register.go
Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
* Update pkg/registry/apis/ofrep/register.go
Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
* Apply review feedback
* Replace contexthandler with types
* Fix identifying authed request
* Refactor checks in the handlers
* Remove anonymous from isAuthenticatedRequest check
---------
Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
Co-authored-by: Gabriel Mabille <gabriel.mabille@grafana.com>
Co-authored-by: Charandas Batra <charandas.batra@grafana.com>
Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
* fix: use fieldConfig.defaults.noValue in barchart and statetimeline
* change name of test
* remove todo comment
* lean on PanelDataErrorView in the case where no fields are present
* update StateTimeline and StatusHistory to use PanelDataErrorView
* fix test
* self-review cleanup
* WIP
* Update yarn.lock
* Align uuid dependency
* Add e2e test and update
* Update cue version
* Fix lint
* Update snapshot test
* Fix test that was importing from coupled module
* Fix lint
* Update public/app/plugins/datasource/loki/package.json
Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
---------
Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
* Add max count config for indexing
* Build empty index when max count is exceeded
* Address linting
* Refactor buildIndexes
* Add test for max count threshold
* Update test doc comments
* Refactor TestBuildIndexes_MaxCountThreshold to not use mock framework
* Rename mocks used in TestBuildIndexes_MaxCountThreshold
* Refactor mockResourceIndex
* Test setting of indexing threshold configs
* Tweak comments, log
* Fix logging in buildEmptyIndex
* Export and reuse TestDocumentBuilderSupplier
* Reuse MockResourceIndex
* Restore dashboards: Enable search and filtering
* Remove sorting
* Configurable sort
* Move cache to a separate file
* Get tags
* Reset cache on delete
* Use store
* Add sort
* Use fuzzyFind for search
* Move fuzzy search to grafana/data
* Move @leeoniya/ufuzzy package
* Use the new util
* Improve sort
* Error handling
* IAM: Register CoreRole apis
* one line store instantiation
* Small refactor for readability
* Add authorizer for CoreRole
* Nit
* Error strings should not end with punctiation
* Account for error
* Switch to use the local resource client
* error should not start with upper casing
* noopStorageErr should have a name starting with err
* Update workspace
* I don't know why I don't have the same output as the CI 🤷
* Dependency xOwnership
* imports
* Import order
* Rename alias to make it clear this is legacy
* add flag for running zanzana server insecurely
* Only allow insecure connections in dev environment
Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>
---------
Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>
* InfluxDB: Add an optional time range filter for tag queries in the query panel autocomplete
* Betterer updates
* Update test
---------
Co-authored-by: Nikolay Tsvetkov <nikolay.cvetkov@gmail.com>
* CI: Remove concurrency from release-build.yml
* CI: Remove concurrency from release-build.yml
* remove artifacts-list publish because it is already being published
Bump Nanogit
This version includes multiple fixes:
- Properly parsing side-band errors.
- Handle multiple matches in GetRef .
- Properly sort tree entries with folders based on git specification.
* grpc: wrapContext should not replace existing metadata, but append to it.
* Add test for wrapContext if there's no previous metadata.
* Rename encodeIdentityInMetadata to encodeIdentityInMetadataPairs
* fix: mark apps as preloaded after being preloaded
* move marking as preloaded into `preload`
* add tests
* refactor: make it reuse promises of already loaded plugins
* fix: review notes
---------
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
* apiserver/folders: use exact match on GetFolderByTitle in legacy
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
---------
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* dispatch GE release build when this one is triggered
* Add publish-artifact workflow
* workflow_call is its own job
* add needs section in publish
* fix workflow reference
* fix permissions
* Use pattern arg instead of name
* fix artifacts path
* log in to docker hub in build job
* remove duplicate key
* bucket_path -> bucket-path
* remove 'parent' input
* PATH -> ARTIFACT_PATH
* use find instead of rsync
* set min/maxdepth
* use cp -r
* Add publish-artifact.yml to CODEOWNERS
* refer to the workflow on main specifically
* fix: increase login_attempt.ip_address column length for IPv6 support
- Expand ip_address column from VARCHAR(30) to VARCHAR(50) to accommodate IPv6 addresses
- Add database migration with support for PostgreSQL, MySQL, and SQLite
- Add comprehensive integration tests for various IPv6 address formats
- Resolves 500 errors when login fails over IPv6, now returns proper 401 errors
Fixes#106362
* test: add missing test skip to TestIntegrationIPv6AddressSupport
Skip integration test when running with -short flag to separate unit and integration tests
* Update pkg/services/sqlstore/migrations/login_attempt_mig.go
Co-authored-by: Victor Cinaglia <victor@grafana.com>
* fix missing bracket
* fix: resolve PostgreSQL timestamp overflow in IPv6 test
- Use controlled time mock instead of time.Now() to avoid timestamp conversion issues
- Follow existing test patterns with xormStore and mock time functions
- Add proper Since parameter to GetIPLoginAttemptCount query
- Fixes PostgreSQL error: 'pq: value "-62135596800" is out of range for type integer'
* fix: resolve PostgreSQL UTF-8 encoding error in IPv6 test
Replace string(rune(i)) with fmt.Sprintf to avoid null bytes (0x00)
when i=0, which caused 'invalid byte sequence for encoding UTF8' error
---------
Co-authored-by: Victor Cinaglia <victor@grafana.com>
* Add kvstore interface
* add owner
* go lint
* remove comment
* update comment
* remove GetOptions
* add sortorder unspecified
* nit
* nit
* nit
* move txn
* use io.reader
* use io.reader
* change again the default order + comments
* change again the default order + comments
* use readcloser for Save
* markup timeseries panel edit
* mark up matchers ui
* mark up bar chart
* mark up stat panel
* mark up gauge
* mark up bar gauge
* mark up table component
* mark up pie chart
* mark up state timeline
* mark up heatmap
* mark up status history
* mark up histogram
* mark up text panel
* mark up alert list
* mark up dashboard list
* mark up news panel
* mark up annolist
* mark up logs panel
* mark up node-graph
* mark up traces
* mark up trend
* mark up xychart
* fix build
* wip
* use initScenesTranslations
* comment
* use just plain resource loaded from scenes lib
* update to the published scenes version
* rename loadPluginResources to loadNamespacedResources
* XYChart: Add support for x=time
* prettier
* Add time axis demo to provisioned dashboard for XY
* Add details about time fields to the documentation
---------
Co-authored-by: Kristina Durivage <kristina.durivage@grafana.com>
* LogList: memoize styles
* virtualization: refactor to support multiple instances
* LogList: refactor to support multiple virtualization instances
* Update tests
* LogLine: unfocus test
* virtualization: refactor class to use the provided font size
* LogLine: split component to reduce re-renders
Several niche bugs have surfaced as a result of the decrypt code Grafana uses in receivers API being different than what is used to decrypt secrets before sending to remote AM. Example:
- Dingding notifier not abiding by new Patching added to local AM, thus causing missing url errors.
* noop refactor to simplify decryptConfiguration
* Move compat function package
* Use new receiver models to encrypt/decrypt in remote AM
* make viz colors configurable when creating the theme
* fix bug with palette not showing last color
* attempt to constrain the types better
* better generics
* remove reverseMap
* ensure there's an empty options default
* Fix docs
* Remove first time field from sorting for consistent indexing, add margin to radio
* integrate in with sort
* find first
* Move lonely test to proper block, add test for logic change, refine logic
* bonus points
* Chore: Change Library Panels CODEOWNERS to sharing
* change auto triage for library panels to redirect to sharing squad
* move sharing squad to appropiate section
* Bump nanogit library
This version of nanogit will be optimized for performance, specially for
bulk writes. It will store packfiles in a temporary file if there are
too many and clean up after push or when the writer is removed.
* Format code in nanogit/git.go
* feat: Implement optional URL path sanitization in BackendSrv methods
* add comment
* revert
* remove namespace import from backendsrv
* change method to validatePath, remove query params and fragments
* Moved validatePath call into fetch and make it throw an error instead
* update pluginSettings tests
* prettier
* Update public/app/features/plugins/pluginSettings.ts
Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
* change name to validatePath
* fix other tests
* rename property in backend_srv tests
* rename to validatePath in backend_srv, add extra tests
* Move path validation into parseUrlFromOptions
* fix
* Add additional check
* Add test
---------
Co-authored-by: joshhunt <josh.hunt@grafana.com>
Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
* Add tracing to live calls.
Clients using /api/live/ws use long-running request and post various commands via the request. This PR adds tracing span to each client-initiated action like subscribing/unsubscribing to/from channel, RPC call, publishing an event.
Server-initiated messages are not included in the trace yet.
* Fix for repeated row variables
* Add unit tests
* Do not recursively replace queries that self-reference
---------
Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
* wip: trying to understand how to get the ds info from migrator
* add datasource info provider
* Use DS service to fetch DS data
* add more tests cases to match with migrator cases
* Add snapshots
* Non-existing DS
* Add different DS for snapshots
* fix import
* Fix tests: guard against double initialization
* don't use full datasource package in test
* min version should be 35
* fix test
* fix conversion test
* Dashboards: Support schemaVersion v35 migration in backend
* Dashboards: Support schemaVersion v34 migration in backend
* Apply suggestions from code review
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
* Apply feedback
* Remove unused parameters
---------
Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
* DeleteProvisionedDashboardDrawer: delete provisioned dashboard flow set up with drawer
* clean up
* add tests
* more test and clean up
* revert endpoint change
* adjust tests
* remove unuse codes
* fix type, fix test, add read only message
* small changes
* fix test, i18n fix
* comments
* Fix bug for file deletion using a branch
* PR comments update
* Use the provided ref for parser so that URLs work
* call useDeleteRepositoryFilesWithPathMutation in delete drawer component directly
* remove console log
* Update public/app/features/dashboard-scene/components/Provisioned/DashboardEditFormSharedFields.test.tsx
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
* PR comments
* use string for fields
* extract handle request logic from save form and delete form and put into one hook
* Add test for useProvisionedRequestHandler
* Update public/app/features/dashboard-scene/components/Provisioned/DashboardEditFormSharedFields.test.tsx
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
* Update public/app/features/dashboard-scene/components/Provisioned/DashboardEditFormSharedFields.test.tsx
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
* Update public/app/features/dashboard-scene/components/Provisioned/DashboardEditFormSharedFields.test.tsx
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
* Update public/app/features/dashboard-scene/components/Provisioned/DashboardEditFormSharedFields.test.tsx
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
* Update public/app/features/dashboard-scene/settings/DeleteProvisionedDashboardForm.test.tsx
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
* Update public/app/features/dashboard-scene/settings/DeleteProvisionedDashboardForm.tsx
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
* use drawer close in both save form and delete form
* Add back panelEditor onDiscard
* add panelEditor onDiscard to delete flow
* Update public/app/features/dashboard-scene/settings/DeleteProvisionedDashboardForm.tsx
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
---------
Co-authored-by: Roberto Jimenez Sanchez <roberto.jimenez@grafana.com>
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
* Drone: Remove verify_storybook pipeline
Already exists in GitHub Actions.
* Drone: Remove lint_backend pipeline
Already exists in GHA.
* Drone: Remove backend tests
These already exist in GitHub Actions.
* Drone: Remove shellcheck pipeline
* Drone: Remove unused images
* Drone: Remove lint_frontend pipeline
Already in GHA.
* Drone: Remove test_frontend pipeline
Already exists in GHA.
* Drone: Remove integration_benchmarks pipeline
This was last used in January. GHA does not have it, but it is relatively trivial to run locally.
* refactor language provider
* update tests
* more tests
* betterer and api endpoints
* copilot updates
* betterer
* remove default value
* prettier
* introduce new methods
* provide unit tests for labelValues
* update metadata fetch
* move all cache related stuff in caching.ts
* provide interface
* provide deprecation messages
* unit tests for new interface
* separation of concerns
* update tests
* fix unit test
* fix some types
* Revert "fix some types"
This reverts commit 7e64b93b5f.
* revert interface usage
* betterer
* use PrometheusLanguageProviderInterface in everywhere
* introduce resource clients
* unit tests
* act accordingly with the feature toggle
* some more unit tests
* add feature toggle
* Revert "add feature toggle"
This reverts commit 5c93ac324f.
* remove feature toggle
* update tests
* backward compatibility
* fix scope issues
* comment update
* stronger types
* prettier
* betterer
* use new methods in metrics browser and query field
* always return data
* Revert "always return data"
This reverts commit 38e493c189.
* Revert "Revert "always return data""
This reverts commit b5d3b5d2b0.
* handle error
* lint
* use new method in query builder
* fix metrics modal tests too
* use labelValues method while searching in combobox
* update metrics modal regex search
* lint
* fix unit test
* introduce resource clients and better refactoring
* prettier
* type fixes
* betterer
* no empty matcher for series calls
* better matchers
* add additional tests
* proper match string for series
* introduce series cache
* introduce series cache for series label values
* lint
* cache values too
* utf8 safe label values query with series endpoint
* fix unit tests
* caching for labels api client
* betterer
* support new language provider methods in variable editor
* use queries and adhoc filters to extract matchers
* filter out __name__
* improve match string in series query label value calls
* update unit tests
* betterer
* use new language provider methods in completions and query hints
* betterer
* refactor language provider
* update tests
* more tests
* betterer and api endpoints
* copilot updates
* betterer
* remove default value
* prettier
* introduce new methods
* provide unit tests for labelValues
* update metadata fetch
* move all cache related stuff in caching.ts
* provide interface
* provide deprecation messages
* unit tests for new interface
* separation of concerns
* update tests
* fix unit test
* fix some types
* Revert "fix some types"
This reverts commit 7e64b93b5f.
* revert interface usage
* betterer
* use PrometheusLanguageProviderInterface in everywhere
* introduce resource clients
* unit tests
* act accordingly with the feature toggle
* some more unit tests
* add feature toggle
* Revert "add feature toggle"
This reverts commit 5c93ac324f.
* remove feature toggle
* update tests
* backward compatibility
* fix scope issues
* comment update
* stronger types
* prettier
* betterer
* use new methods in metrics browser and query field
* always return data
* Revert "always return data"
This reverts commit 38e493c189.
* Revert "Revert "always return data""
This reverts commit b5d3b5d2b0.
* handle error
* lint
* use new method in query builder
* fix metrics modal tests too
* use labelValues method while searching in combobox
* update metrics modal regex search
* lint
* fix unit test
* introduce resource clients and better refactoring
* prettier
* type fixes
* betterer
* no empty matcher for series calls
* better matchers
* add additional tests
* proper match string for series
* introduce series cache
* introduce series cache for series label values
* lint
* cache values too
* utf8 safe label values query with series endpoint
* fix unit tests
* caching for labels api client
* betterer
* support new language provider methods in variable editor
* use queries and adhoc filters to extract matchers
* filter out __name__
* improve match string in series query label value calls
* update unit tests
* betterer
* betterer
* refactor language provider
* update tests
* more tests
* betterer and api endpoints
* copilot updates
* betterer
* remove default value
* prettier
* introduce new methods
* provide unit tests for labelValues
* update metadata fetch
* move all cache related stuff in caching.ts
* provide interface
* provide deprecation messages
* unit tests for new interface
* separation of concerns
* update tests
* fix unit test
* fix some types
* Revert "fix some types"
This reverts commit 7e64b93b5f.
* revert interface usage
* betterer
* use PrometheusLanguageProviderInterface in everywhere
* introduce resource clients
* unit tests
* act accordingly with the feature toggle
* some more unit tests
* add feature toggle
* Revert "add feature toggle"
This reverts commit 5c93ac324f.
* remove feature toggle
* update tests
* backward compatibility
* fix scope issues
* comment update
* stronger types
* prettier
* betterer
* use new methods in metrics browser and query field
* always return data
* Revert "always return data"
This reverts commit 38e493c189.
* Revert "Revert "always return data""
This reverts commit b5d3b5d2b0.
* handle error
* lint
* use new method in query builder
* fix metrics modal tests too
* use labelValues method while searching in combobox
* update metrics modal regex search
* lint
* fix unit test
* introduce resource clients and better refactoring
* prettier
* type fixes
* betterer
* no empty matcher for series calls
* better matchers
* add additional tests
* proper match string for series
* introduce series cache
* introduce series cache for series label values
* lint
* cache values too
* utf8 safe label values query with series endpoint
* fix unit tests
* caching for labels api client
* betterer
* fix errors
* refactor language provider
* update tests
* more tests
* betterer and api endpoints
* copilot updates
* betterer
* remove default value
* prettier
* introduce new methods
* provide unit tests for labelValues
* update metadata fetch
* move all cache related stuff in caching.ts
* provide interface
* provide deprecation messages
* unit tests for new interface
* separation of concerns
* update tests
* fix unit test
* fix some types
* Revert "fix some types"
This reverts commit 7e64b93b5f.
* revert interface usage
* betterer
* use PrometheusLanguageProviderInterface in everywhere
* introduce resource clients
* unit tests
* act accordingly with the feature toggle
* some more unit tests
* add feature toggle
* Revert "add feature toggle"
This reverts commit 5c93ac324f.
* remove feature toggle
* update tests
* backward compatibility
* fix scope issues
* comment update
* stronger types
* prettier
* betterer
* use new methods in metrics browser and query field
* always return data
* Revert "always return data"
This reverts commit 38e493c189.
* Revert "Revert "always return data""
This reverts commit b5d3b5d2b0.
* handle error
* lint
* introduce resource clients and better refactoring
* prettier
* type fixes
* betterer
* no empty matcher for series calls
* better matchers
* add additional tests
* proper match string for series
* introduce series cache
* introduce series cache for series label values
* lint
* cache values too
* utf8 safe label values query with series endpoint
* fix unit tests
* import fixes
* more import fixes
* fix unit tests
* refactor language provider
* update tests
* more tests
* betterer and api endpoints
* copilot updates
* betterer
* remove default value
* prettier
* introduce new methods
* provide unit tests for labelValues
* update metadata fetch
* move all cache related stuff in caching.ts
* provide interface
* provide deprecation messages
* unit tests for new interface
* separation of concerns
* update tests
* fix unit test
* fix some types
* Revert "fix some types"
This reverts commit 7e64b93b5f.
* revert interface usage
* betterer
* use PrometheusLanguageProviderInterface in everywhere
* introduce resource clients and better refactoring
* prettier
* type fixes
* betterer
* no empty matcher for series calls
* better matchers
* import fixes
* refactor language provider
* update tests
* more tests
* betterer and api endpoints
* copilot updates
* betterer
* remove default value
* prettier
* introduce resource clients and better refactoring
* prettier
* type fixes
* betterer
* no empty matcher for series calls
* better matchers
* addressing the review feedback
What is this feature?
Implements the POST endpoint for deleting imported Mimir Alertmanager configurations:
POST /api/convert/api/v1/alerts
The API endpoint creates the extra Alertmanager configuration with the provided identifier and matchers.
**What is this feature?**
This PR implements a new Prometheus historian backend that allows Grafana alerting to write alert state history as Prometheus-compatible `ALERTS` metrics to remote Prometheus-compatible data sources.
The metric includes a few additional labels:
* `grafana_alertstate`: Grafana's full alert state, more granular than Prometheus.
* `grafana_rule_uid`: Grafana's alert rule UID.
Grafana states are included in the `grafana_alertstate` label also mapped to Prometheus-compatible `alertstate` values:
| Grafana alert state | `alertstate` | `grafana_alertstate` |
|---------------------|-----------------------|-----------------------|
| `Alerting` | `firing` | `alerting` |
| `Recovering` | `firing` | `recovering` |
| `Pending` | `pending` | `pending` |
| `Error` | `firing` | `error` |
| `NoData` | `firing` | `nodata` |
| `Normal` | _(no metric emitted)_ | _(no metric emitted)_ |
* Logs Panel: remove default value to it's taken from local storage code
* processing: do not remove newlines, let truncation handle
* LogList: check and pass unescaped content to context
* LogLine: prevent mutation of searchWords
* grammar: use parseFlags
* grammar: escape regex
Adds a new "Allow as recording rules target" toggle to Prometheus datasource configuration that controls whether the datasource can be selected as a target for writing recording rules.
---------
Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
Co-authored-by: Konrad Lalik <konradlalik@gmail.com>
* add native histogram dropdown to tempo config for service graph
* add docs for configuring native histograms
* add config native histogram options to types
* add native histogram metric to graph transform
* add native histogram to service map query for links
* add native histogram duration metric for duration queries
* use native histogram for duration queries
* export for tests
* add tests for native histogram links, queries and dataframes
* update tempo devenv to use native histograms
* use union for histogramType
* run prettier
* remove comment
* Add nanogit package
* Add nanoGit feature flag
* Put logger into nanogit context
* Commit go mod and go sum updates
* Add more stuff around logging
* Nanogit also in extra one
* Add owner to dependency
This adds the ability to filter rules with the prometheus compatible api using:
1. `receiver_name` to filter by contact point name
2. `health` to filter by the health status of the rule (one of `ok`, `error`, `nodata`, or `unknown`)
This also ensures that groups with no rules (due to filters) are not returned.
* capture errors on metrics
* rename seconds to sql_command_duration_milliseconds to match unit that has been captured, and update buckets
* rename sql_command_errors_total to sql_command_count
* docs: minor k8s inspired doc changes
* docs: revert to v1 as recommended first major
* Update contribute/architecture/k8s-inspired-backend-arch.md
Co-authored-by: Igor Suleymanov <radiohead@users.noreply.github.com>
---------
Co-authored-by: Igor Suleymanov <radiohead@users.noreply.github.com>
* I18n: Allow pseudo-locale to be enabled in production builds
* fix tests now that pseudo is around
* remove psuedo locale from i18n package
* load en-us from plugin resources for pseudo
* fix tests + remove 'hidden' option
---------
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* Add grafana-build action and workflow
* Fix the --verify flag stalling on tar.gz builds
* Add event sources for main / release branches
* Update CODEOWNERS
* WIP - time filtering
* Replace variable test
* Change tests
* Validator is already tested
* Change test to match evaluation
* Add line to docs
* Revert "Add line to docs"
This reverts commit 783f247c33.
* Put transformations docs update in the right place, cannot build without an update, WIP
* Run build
* Use regex test and rewind
* Does this help
* make config optional
* Document `remote_cache` is only used if a remote database is used
* Update _index.md
---------
Co-authored-by: Jacob Valdez <jacob.valdez@grafana.com>
* Don't show result from other parents
* Use global search hook for scopes even inside scopes category
* Remove console.log
* Move code to separate files
* Add tests
* Renamed utils file
* datasources: querier: more robust error handling, and report no error for st
* do not leak error details out
* apply the change to the real file, not just to the test
* Dashboards: Add undo/redo actions for changing dashboard title
* Run make i18n-extract
* Dashboards: Add undo/redo support for dashboard description
* fix typo
* Add tests for DashboardTitleInput & DashboardDescriptionInput
* WIP for improved hover state for calendar range
* TimeRangePicker: Add hover state when selecting a date range
* reorder styles to reduce duplication
* oops that wasn't supposed to go in
* ignore border radius false positive
* Update dependency @grafana/llm to v0.22.0
* mark some packages as esm for jest
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* declare dingding url as secret
patch raw settings before parsing because DingDing's config parser does not know about secrets
* fix integration test
---------
Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
* LogList: add key bindings hook
* LogListContext: add search support
* LogList: create and integrate LogListSearch
* useKeyBindings: close search with escape
* LogListSearch: implement go to results
* LogLine: support highlight in logs with ansi colors
* LogListSearchContext: extract from LogListContext
* LogListSearch: highlight matches in ansi logs
* LogListSearch: fix count
* LogListSearch: implement optional results filtering
* Translations
* LogListSearch: display within the panel and add tooltip
* Translations
* LogList: highlight search words and search matches
* LogListSearch: remove ufuzzy
Unfortunately we can't highlight ufuzzy matches
* LogListSearch: clean up removed ufuzzy implementation
* Prettier
* LogListSearch: search in displayed fields
* useKeyBindings: switch to native event listeners
* LogListSearch: fix effect loop
* LogListSearch: remove character so people don't think this text comes from AI
* LogLine: add text search test cases
* LogList: add integration test case
* LogListSearch: use uncontrolled input and react transitions
* LogListSearch: import t from i18n
* LogListControls: add search control
* LogListSearch: escape regexes
* Add to available channels
* Export
* Fix bug in deeply nested secrets
BE: Slice re-use bug when traversing deeply.
FE: Only at most one level of nesting was being taken into account
when determining secureFields keys. This change adds a new field on
NotificationChannelOption: secureFieldKey. This is populated on API GET via
transform. This change gives us the option to hardcode secureFieldKey in the
backend and no longer calculate the key via settings topology.
* Update grafana/alerting to 3e20fda3b872
* Prettier
* Linting
* Fix IntegrationConfig test to catch secure field mismatch
* fix(#92944): add StateTimeline Null+NaN handling
* chore: remove console.warns from debugging
* test: initialize a couple of simple tests
* test: more tests for hasMappedNaN and hasMappedNull
* chore: revert some of the let-const syntax cleanup for a later PR
* chore: rename should draw method
* chore: fix comment typo
* refactor(timeline-chart-utils): un-nest hasSpecialMappedValue() helper
* test(timeline-chart-utils): unit test hasSpecialMappedValue() helper
* chore: fix code comment typos in changed files
* refactor(timeline-chart): reduce helper DRY-ness for better performance
* fix(timeline-chart): check Y value for truthiness, not if it is finite
* test(state-timeline): additional gdev test panels with null + NN values
* fix(timeline-chart): allow Y value of zero in checks
---------
Co-authored-by: Jesse David Peterson <jesdavpet@users.noreply.github.com>
Co-authored-by: Adela Almasan <adela.almasan@grafana.com>
* Docs: adding information on adjusting short link expiration time in Grafana cloud
* changing admonition and adding info on changing config for cloud
* adjusting wording
* fixing typo
* Update docs/sources/setup-grafana/configure-grafana/_index.md
Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>
---------
Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>
If you tried to migrate alerts from two differente sources/on-prem instances,
the autoincremented numeric id would be the same, and since we were creating
the resource in cloud with that same id (the API accepts it), it would
return an error "conflicting alert rule found" because that id is the primary key on the table.
We simply omit the numeric id now and let the API for the cloud instance generate it.
* Dashboard: ValueFormat - add custom 'financial' currency format without abbreviations
- Add fullCurrency formatter function that displays complete numeric values
- Apply performance suggestions from old PR
- Add unit tests
- Update documentation
* remove unnecesary `true` format support
* chore(packages): remove rollup dts plugin
* build(packages): add rollup copy plugin settings to copy ts declarations to esm and cjs builds
* build(packages): remove copy settings as result doesnt pass attw cli checks
* build(packages): use single types output in dist/types directory
* ci(packages): update prepare and validate scripts for single type builds
* fix(grafana-schema): copy raw types to dist/esm directory for grafana/scenes support
* add test
* make it fail
* get test work reliably
* get or create db section
* remove unnecessary code
* move test to first
* add comment
* apply PR feedback
* Dashboards: Add restore endpoints to the API
* Fix unified api
* Fix resource version
* Add tests
* Update api
* Update type guards
* Update comments
* Add missing type
* Cleanup
* Move spec checking logic to v1 client
* Handle mixed versions in deleted dbs list
* Update tests
* comment
* type
* grafana-flamegraph: Fix bug for function names that conflict with JavaScript object prototype properties
The bug occurs in the flamegraph data transformation logic where function names from profiling data are used as object
keys without proper prototype pollution protection.
Fixes#106232#101551
Co-authored-by: vinayteki95 <vinayteki95@users.noreply.github.com>
* Fix top table calculations
---------
Co-authored-by: vinayteki95 <vinayteki95@users.noreply.github.com>
Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
* Don't show result from other parents
* Use global search hook for scopes even inside scopes category
* Remove console.log
* Don't show non leaf scopes in global search
* Revert "pkgs/tsdb/[grafana-pyroscope-datasource|parca]: Fix use of request headers in responses"
This reverts commit 8bac68e906.
* Profiles: Stop passing request/response headers to the backend
* Docs: Adding clarification for resetting adming password with CLI with external DB
* adjusting bulleted points
* Cutting unneeded wording
* adjusting wording to avoid Grafana being possessive
* Changing Postgres to PostgreSPQL
* experiment v2 to v1 in exporting
* refactor code to export to v1 resource
* Add unit test and fix linting
* fix typescript
* fix linting
* handle error gracefully when is not possible to convert to v1
* feat(sql): allow custom table names in TableSelector
Restores the ability to enter custom table names not present in the database
by adding `allowCustomValue` to the Select component. This matches previous
functionality where users could manually specify table names not returned
by db.tables().
fixes: #106348
* empty line 45
* Add group and namespace filtering for GMA rules
* Add group and namespace filtering for DMA rules
* Fix view mode handling
* Preserve group and namespace filters when switching views
* update "no rules" logic for Grafana managed rules
* use groupFilter function for filter logic
* Add populateCache docs, tidy up api consts
* Fix imports in tests
* Fix failing import tests
---------
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
* docs(alerting): Import to Grafana-managed rules
* apply latest evaluation changes
* Add additional conversion details to How it works section
* fix ref link
* fix Data source input name
* more details about the `Target data source` input
* RepeatRowSelect: Use Combobox instead of deprecated Select component
* Add test (broken)
* Don't disable combobox if repeat is set
* Run i18n-extract
* add mockGetBoundingClientRect to combobox test
---------
Co-authored-by: Sergej-Vlasov <sergej.s.vlasov@gmail.com>
* refactor(grafana-ui): move all exports from components barrel file to entry point
* refactor(grafana-ui): move all exports from types barrel file to entry point
* refactor(grafana-ui): explict exports for utils
* refactor(grafana-ui): move themes to explicit exports
* refactor(grafana-ui): use explicit exports for options, slate-plugins and schema
* fix(grafana-ui): put back missing components
* chore(grafana-ui): delete first level barrel files
* refactor(grafana-ui): update all internal barrel file imports
* refactor(grafana-ui): start fixing storybook mdx files
* style(grafana-ui): fix linting issues, update betterer result
* chore(grafana-ui): delete nested component barrel files
* refactor(grafana-ui): update imports to use non-barrel files
* refactor(grafana-ui): update imports to non-barrel files for story and test
* fix(grafana-ui): put back missing FileListItem component and types
* refactor(grafana-ui): update mdx to use direct imports
* fix(grafana-ui): align exports with grafana 12
* LogList: create font size option
* LogList: prevent option fontSize bouncing
* LogListContext: fix stored container size bigger than container
* LogList: render smaller font size
* virtualization: adjust to variable font size
* virtualization: strip white characters of at the start successive long lines
* LogList: add font size to log size cache
* LogList: use getters instead of fixed constants
* LogLine: prevent unnecessary overflow calls
* virtualization: strip ansi color codes before measuring
* LogListDetails: adjust size on resize and give logs panel a min width
* LogsPanel: add showControls as a dashboard option
* virtualization: update test
* virtualization: add small test case
* processing: update font size
* LogListControls: update test
* Extract translations
* Logs Panel: enable controls by default
* LogListContext: update mock
* ControlledLogRows: add missing prop
* LogLine: remove height ref
* LogList: dont touch the debounced function on successive calls
* LogLine: update test
* LogsPanel: make controls default to false again
* LogsPanel: make controls default to false again
* LogLineDetails: fix height resizing and make close button sticky
* LogLine: memo log component
* LogLineDetails: fix close button position
* New Logs Panel: Add Popover Menu support (#106394)
* LogList: add popover menu support
* LogList: test popover menu
* Chore: remove unnecessary optional chain op
* LogLinedDetails: fix close button position with and without scroll
* Alerting: Use default_datasource_uid as the default target for recording rules
* Add tests
---------
Co-authored-by: Konrad Lalik <konradlalik@gmail.com>
* Add pills in search bar for context
* Add scope actions
* Add selection functionality
* Show selected scope on secondary row
* Fix selected scope titles
* Add some basic tests
* Test for toggle by name
* Remove unnecessary mocking
* Small cleanups
* Lint fixes
* Fix test
* Update public/app/features/scopes/selector/ScopesSelectorService.ts
Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>
* Bump input and breadcrumbs test
* Change breadcrumbs color
* Makes the breacrumb spacing consistent
* Add basic global search
* Change scope selector data structures
* Fix scope selector functionality
* Fix errors in selector and cmdk actions
* Fix cmdk actions
* Fix global search in cmdk
* Fix some merge edits
* merge diffs
* Small merge fixes
* Fix ScopesSelectorService.test.ts
* Fix tests
* Remove unrelated lint fixes
* Move ScopesTreeItemList.tsx into separate file
* Simplify if condition
* Use node.title in the scopesRow
* Use better dependency array for actions
* Make recentScopes more robust
* Fix beterrer
* Update betterer file
* Add test for changeScopes early return
* Fix input tooltip title access
---------
Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>
pkgs/tsdb/[grafana-pyroscope-datasource|parca]: Fix use of request headers in responses
In the parca and the grafana-pyroscope-datasource we were wrongly using the request headers instead of the response
header when communication the results to the backend.
This PR fixes this bug.
Was reported by an user via community slack, who faced issues, with a request header of `content-length: 0` being
inserted by a intermediate proxy.
What is this feature?
Ensures that resolved notifications are sent when alert states transition from Error to Normal after the configured number of evaluation intervals: Missing series evaluations to resolve.
Why do we need this feature?
Before this change, when an alert was transitioning from Error to Normal, in case when the labels on the new Normal alert instance are the same, Grafana would not send resolved notifications for the Error alert state. The alert would be resolved after a few evaluation intervals automatically in the alertmanager, following the endsAt.
With this change the resolved notification is sent after the configured number of evaluation intervals: Missing series evaluations to resolve.
The help text for active timings on an alert was confusing, indicating that the time range would cause the alert not to
notify, when it actually works as the only time the alert would notify.
* SCIM: fix provisioned user role assignment from SAML assertion
* revert org_sync_test changes
* clean up tests
* skip user lookup during org sync
* sanitize log output
* only log non-sensitive fields
* grafana-data: Fix error when field values are null
* Slightly terser
* update frame test to have falsy value that should be kept
remove null string output from null value test
* handle falsy frame values as non-null
---------
Co-authored-by: samsch <git@samsch.org>
What is this feature?
Fixes a bug when group-level query_offset and labels parameters are ignored and not saved
Why do we need this feature?
In the import API Prometheus YAML rule definitions are supported:
groups:
- name: group-1
interval: 1m
query_offset: 10m
labels:
severity: "warning"
rules:
- alert: Alert 0 > 0
expr: vector(0) > 0
But applying group-level labels and query_offset is broken and they are not saved right now because during the conversion of the API model to PrometheusRuleGroup they aren't saved to the new structure.
* Zanzana: Split client and server logs
* Zanzana: Improve error handling and logging
* log internal error at the server side
* refactor
* improve errors for list request
* update go modules
* handle errors for read and write
* refactor
* reset go.mod changes
* Alerting: Optimize prometheus api permission checks
This improves the performance of the Prometheus API by performing the permission checks for rule read permission in a folder upfront, rather than checking permissions for each rule group individually. This reduces the number of permission checks and should speed up the API response time.
* refactor vars
---------
Co-authored-by: Konrad Lalik <konradlalik@gmail.com>
When a rule configured with `ExecErrState` state of `Alerting`, has an instance which is Alerting then has a data source error, then successfully evaluates and continues to be Alerting, the cached instance keeps the error cached until it is no longer firing.
This is unexpected and leads to misleading results.
* docs(alerting): new notification template example: link to a dashboard with time range
* remind configuring the `MyDashboardURL` annotation
* Update docs/sources/alerting/configure-notifications/template-notifications/examples.md
Co-authored-by: Matthew Jacobson <matthew.jacobson@grafana.com>
---------
Co-authored-by: Matthew Jacobson <matthew.jacobson@grafana.com>
* docs(alerting): remove admonition to an outdated tutorial
* amended note and link to new tutorial
* link
* minor copy changes
* run prettier
* update copy
---------
Co-authored-by: tonypowa <tonypowa@gmail.com>
* Alerting docs: document ability to import rules to GMA from Prometheus YAML
documentation for prom YAML import feature.
- took out reference that said users can't import prometheus rules in the tool.
- added the More > Import alert rules UI path to the tool
- added a step for the YAML file upload button.
* 💅prettier✨
* Update _index.md
* Add export folder action to the new list view
* merge folder actions in one more button
* fix checking permissions
* remove commented code
* early return when no bulkactions are allowed
* fix css width
* address review comments
* move BulkActions component outside the parent component
* remove unnecessary check
* bring back accidentally removed code
* remove duplicated modal
* TraceView: Resource attributes links extension point
* Add data source info to context
* Remove console log
* Removing unused linkGetters and more
* More tests
* Fixing last todos
* Fixing
* Fixing
* Change link style
* Rename extension context
* Fix lint error
* LogsPanel: integrate new panel via feature flag
* Log Line: move sampled/errors/deduplication count outside of log line body
* LogList: increase overscan count
* Logs Panel: enable deduplication for infinite scrolling
* Logs Panel: remove margin overflowing drilldown
* Logs Panel: add missing dependency to effect
* Logs Panel: pass missing callback
* Remove console log
* LogLine: show cursor pointer only when interactable
* LogLineDetails: make resize handler more obvious
* LogsPanel: add missing props to from panel
* LogLineMenu: add support for custom items
* LogsPanel: pass custom menu items to LogList
* Fix imports
* Chore: comments and missing argument
* LogLineMenu: pass log to event listener
* LogListContext: filter log details when no longer present in the new response
* chore: log
* LogsPanel: conditionally show options per feature flag status
* LogLine: align logs when some of them are sampled or with errors
* Chore: update tests
* LogLineMenu: test custom options
* LogsSamplePanel: show controls
* LogsPanel: move return after hooks to prevent bugs
* ds-querier: add new metric for the total request
Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>
* fix logger and trace
Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>
* ds-querier: rewrite downstream 500s to 400
---------
Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>
What is this feature?
This PR fixes the MissingSeriesEvalsToResolve behavior when it's set to more than 4 evaluation intervals.
Why do we need this feature?
The MissingSeriesEvalsToResolve setting was not working correctly due to alerts being auto-resolved by Alertmanager after 4 evaluation intervals (via the endsAt field).
Before we had deleteStaleStatesFromCache method that was returning only stale states that had to be resolved. Non-stale states for which the current evaluation does not have a series never had endsAt updated and were never resend to the Alertmanager, so they were automatically resolved after 4 evaluations regardless of the setting.
The new processMissingSeriesStates returns state for each missing series on every evaluation, and resolves the stale ones. This guarantees that alerts without series still alert for the configured number of evaluations.
* re-organize folders regarding import feature
* Revert folder changes
* Add Yaml import input fields
* Set recording rules target if empty
* wip
* Convert YAML content to RulerRulesConfigDTO and use this for the import payload
* fixing some issues
* wip
* add tracking
* use yaml filename for namespace in case is not specified in the yaml content
* refactor
* add alertingImportYAMLUI ff check for yaml option
* Add test for parseYamlToRulerRulesConfigDTO
* move import feature to the More menu at the top
* add test for filterRulerRulesConfig, and fix the function
* extract parseYamlToRulerRulesConfigDTO to a separate file
* Add permission check for the import button
* Change data flow in import form, add basic tests for the import form
* remove commented code
* Add yaml import form test
* Add more tests
* Tidy up, remove type assertions in yaml converter
* Improve yaml file validation in the form
* Fix lint issues
* Fix lint
* use only Admin role for checking if the feature is available for the user
* Fix parsing recording rules
* Fix file re-selection in YAML import
* prettier
* refactor
* Remove FileReader, add more explanation to file upload reset
---------
Co-authored-by: Konrad Lalik <konradlalik@gmail.com>
* update TableNG to use the grafana fork of react-data-grid, which supports React 18
* react-data-grid got rid of their CJS
* fix jest.config formatting
* Docs: Adding info on configuring cors via reverse proxy
* Adding info regarding grafana.ini CORS configuration
* some clarification and typo fixes
* expanding the instructions
* run prettier
* fixing indentation
* adjusting an admonition
* adjusting information based on review
* Pyroscope: Add annotations frame to series response
* Adapt to API change, add tests
* Run make lint-go
* Fix conflicts after rebase
* Add annotation via a separate data frame
* Process annotations fully at the datasource
* Add mod owner for go-humanize
* Pyroscope: Annotations in Query Response can be optional
---------
Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
* first
* second
* third"
* 4th
* format
* typo
* $labels
* all pretty no pity
* order
* order2
* typo
* order4
* link renamign
* titles
* test without title heading
* test with colon in h1
* removed H1s
* save transparent setting
* make sure we test both transparent and non transparent
* no more legacy rows
* schema changes
* Add testing, fix first row offset
* Remove legacy row from transform test
* Remove panel that's not present in layout
* Remove expects after removing the row, fix lint issues
* Remove unused commit
* update codegen
* update openapi snapshot
* Fix snapshot
* add missing default prop
* Fix repeating, fix first row, fix not flushing last row
* Use correct repeater
* fix lint, remove unused empty check
* update codegen
* update openapi test snapshot
* Create libpqToPGX feature toggle
* Refactor PostgreSQL datasource to support PGX with feature toggle
- Updated `ProvideService` to accept feature toggles for enabling PGX.
- Modified integration tests to use the new PGX connection method.
- Introduced new functions for handling PGX connections and queries.
- Enhanced TLS configuration handling for PostgreSQL connections.
- Updated existing tests to ensure compatibility with PGX and new connection methods.
* Update PostgreSQL datasource to enhance connection pooling and error handling
- Increased `MaxOpenConns` to 10 in integration tests for improved connection management.
- Refactored connection handling in `newPostgresPGX` to return a connection pool instead of a single connection.
- Updated health check error handling to utilize context and feature toggles for better error reporting.
- Adjusted `DisposePGX` method to close the connection pool properly.
- Enhanced query execution to acquire connections from the pool, ensuring efficient resource usage.
* Cleanup
* Revert postgres_test unnecessary changes
* Rename feature toggle from `libpqToPGX` to `postgresDSUsePGX`
* Add null check to dispose method
* Fix lint issues
* Refactor connection string generation
* Address comment in health check file
* Rename p to pool
* Refactor executeQueryPGX and split into multiple functions
* Fix lint issues
* The returning error message from PGX is enough no need to separate the error code.
* Move TLS handling to newPostgresPGX function
* Disable ssl for integration tests
* Use MaxIdleConns option
* Remove old feature toggle
* Rename`generateConnectionConfigPGX` to `generateConnectionStringPGX`
* Add back part of the error messages
* Don't show max idle connections option when PGX enabled
* Address comments from Sriram
* Add back Sriram's changes
* PostgreSQL: Rework tls manager to use temporary files instead (#105330)
* Rework tls manager to use temporary files instead
* Lint and test fixes
* Update pkg/tsdb/grafana-postgresql-datasource/postgres.go
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
* Update betterer
---------
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
---------
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
* use -C when go-mod-dir is provided
* remove unused target variable
* use my branch for testing
* fix syntax?
* use condition in bash instead
* dagger-for-github doesn't support multiline command
* just skip using the composite action
* update setup-go
* add missing space
* grafana-main -> .grafana-main
* use 'patch' as version
* use generated token for cloning / pushing
* colons in wrong place
* update generate-token action
* reduce permissions needed
* add org prefix to repositories list
* ok the repo names did not work like that
* pull-request -> pull_request
* add workflows: write permission
* push branch on dry_run
* Add missing DRY_RUN flag
* initialize LATEST_FLAG as array
* use RELEASE_BRANCH as the base branch
* use workflow in main
* done testing; use main
* LogList: add version with no scroll
* LogList: fix support for permalinked and pinned logs
* LogLineDetails: improve resizable
* LogList: improve height adjustment when details are open
* LogList: let the people select text
* Revert "LogList: add version with no scroll"
This reverts commit f26cdce696.
* LogList: update test
* New Logs Panel: rename permalinkedRowId to permalinkedLogId
* LogListContext: update mock
* ControlledLogRows: implement custom scrollIntoView
* Logs Panel: fix re-render regression
* LogLine: tweak hover and expanded colors
* Update API docs for team groups search
* update team sync doc
* remove param block
---------
Co-authored-by: Gabriel Mabille <gabriel.mabille@grafana.com>
* feat: map GF_INSTALL_PLUGINS to use preinstall plugins feature
* ref: process GF_INSTALL_PLUGINS as sync install
* fix: check GF_INSTALL_PLUGINS_FORCE in the docker run
* ref: use preinstall_sync for GF_INSTALL_PLUGINS
* ref: logs and deprecation msg for GF_INSTALL_PLUGINS
* chore: deprecated log formatting
* Home: update setup guide link/title to Getting Started Guide
* Home: check plugin presence to show getting started guide
* Home: remove now unused homeSetupGuide feature toggle
* Home: use sentence case for Getting started guide item
* Fix static handler redirect logic to ensure proper clean up URLs before redirection.
(cherry picked from commit f50ec8e0d10c24fd79f6c454974a2fc6e9694ef2)
* make serializer a single source of truth for passing k8s props on save
* remove resourceVersion when updating
* don't pass result.version to resourceVersion
* remove k8s update on saveCompleted from dash scene
* Authz: Define app resources
* Add coreroles and cluster roles
* Restore CODEOWNERS from main
* ManagedPermissions -> ResourcePermissions
* Rework changes
* Update apps/authz/kinds/v0alpha1/rolebindingspec.cue
Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>
* Update apps/authz/kinds/v0alpha1/rolespec.cue
Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>
* Make
* WIP first set of comments
* typox
* Copy folder Makefile
* Remove uid
* Rename authz -> iam
* Rename to iam
* Dockerfile
* Remove name
* Mv up
* Try with postprocess
* linting
* Use same version
* apimachinery v0.32.3
* update-workspace
---------
Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>
* add script for tooling
* add to make
* not to forget
* reworked go tools
* add tool installation script
* adding readme
* updating readme
* updating readme
* cleanup install.sh and makefile
* update the readme file
* cleanup scripts
* switch variables.mk to lazy evaluation
* add tools ache to gitignore
* get rid of absolute path in hte Variables.mk file
* switch to reusable function for path generation
* add debug statements
* add create cache tool dir
* add debuig statements to make file
* drop tool cache
* fix race condition n ci
* fix race condition n ci
* cleanup workspace
* add lefthook.rc to codeowners
* copy .citools folder to docker image
* switch back to main branch of grafana-build
* Add .citools to the drone builder
* fix wording in generate.sh and README.md
* Add empty state handling for GMA rules
* Add handing empty states for Grafana and Datasource rules
* Update translations, fix lint errors
* Add empty state translation
* WIP layout update
* implement hover styles
* update pagination
* fix list item indent
* clean up actions part 1
* only apply text fill to v2 list view
* add missing returnTo for rule viewer
* fix list styles for list view
* i18n
* update bulk actions to regular folder actions for list v2
* fix a few tests
* simplify paginated loaders for new list view
* i18n
* more UI feedback
* fix test
* comment
---------
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
* Dashboards E2E - edit pane - query variable
* update test to use gdev cloudwatch; remove duplicate label and mocks
* wait for the api call to fetch the editor options
* Rename Annotations 'Options' to 'legacyOptions'
* use new legacyOptions in StandardAnnotationQueryEditor
* use new legacyOptions in transformSaveModelSchemaToScene
* use legacyOptions in transformSceneToSaveModelSchemaV2
* Fix bug with ds query editors not taking the latest state
* update snapshot
* update unified storage README with instructions on how to run the distributor locally and fix race condition causing the server to crash on startup randomly
When we have labels selected and want to refresh the list of metrics that match this grafana would use an expensive
/api/v1/series call instead of /api/v1/label/__name__/values with matchers, even if the datasource is configured to be
ble to use matchers in label values calls.
Signed-off-by: Michael Hoffmann <mhoffmann@cloudflare.com>
* Dashboards/E2E: Add test validating panel title and description modification
* Use component selector for headerContainer
* Add flows for changing panel title and description
* setup distributor module
* move lifecycler into resource server provider
* remove ring/client pool setup from distributor module and use the same ring/client pool between storage server module and distributor module
* implement resourcestore server methods
* make healthcheck fail if ring is not running
* fix filesChanged command
* try this instead
* try again...
* try again...
* AGAIN
* maybe?
* maybe?
* just trying this up, im pretty sure this is what it was originally
* Revert "just trying this up, im pretty sure this is what it was originally"
This reverts commit a036cbb32f.
* directly use crowdin-download output
---------
Co-authored-by: joshhunt <josh.hunt@grafana.com>
* Provisioning: Refactor createOnCacheEntryAdded
* Use custom list resource type
* add generated types and transformers
* Switch to type guards
* Do not create new array
* replace usage of folder guardians with access control evaluators
* remove NewByFolderUID guardian
* bring up to date
* fix test
* more test fixes, and don't fetch the folder before evaluating lib element access
* change what error is returned
* fix alerting test
* try to fix linter errors
* replace the use of newByFolder guardian with direct access control evaluator checks
* remove newByFolder guardian
* get rid of dashboard and folder guardians
* undo unwanted change
* undo unwanted change
* undo unwanted change
* update code owners
* docs: edits for alerting learning content
edits for alerting learning content
* vale'd
* left nav change
* final adjustments
link fixes and the like
* Update _index.md
docs: remove content for legacy graph panel
Given the legacy panel is not compatible with G12 - our current docs should not cover it and we can remove from the page
* add pr-patch-check-event workflow_call
* remove unneded permission
* sender -> sender_login
* Add my branch as a target for testing
* fix branch name
* use pull_request event
* fix repo in list
* maybe repositories not prefixedby org?
* fix permissions
* remove my branch
* Missing @
* Add missing CODEOWNER entry
* call workflow from my branch and add oidc debugger
* add my branch to list for testing
* remove my branch; use workflow from main; remove oidc debug
* retrigger CI
* replace usage of folder guardians with access control evaluators
* remove NewByFolderUID guardian
* bring up to date
* fix test
* more test fixes, and don't fetch the folder before evaluating lib element access
* change what error is returned
* fix alerting test
* try to fix linter errors
* replace the use of newByFolder guardian with direct access control evaluator checks
* remove newByFolder guardian
* remove unintentional changes
* remove unintentional changes
* undo unwanted change
* ds-querier: handle execute errors better
* fix: change how GetResponseCode works to return 418 if rsp is nil
418 is a bit of an easter egg which in this case works since we don't
have an rsp but we do know something went wrong, so a 200 won't work.
Also changed this to return the code in the frame, not sure why we
weren't.
* tests: fix GetResponseCode tests
* log no rsp case
* bring back og error log
* feat: preinstall_sync config - process and installation logic
* ref: add preinstall_sync list to preinstalled plugins of frontendsettings
* fix: conf blank line for sections
* ref: remove plugins async flag, and rename PreinstallPlugins
* docs: default installed plugin list
* move preserve to scenePage level, fix issues with restoring variables and failing to reload dd
* refactor and fix preserve/reload url state
* cleanup
* lint
* lint
* reference this PR in comment
* feat: remove kube-aggregator for OSS and provide injection points with runner iface
* upgrade authlib to support expiresIn
* new FT
* new FT again
* update go.mod
* get rid of the slice implementation
* reconcile conflicts
* gracefully handle enterprise not being linked situation with kubeAggregator FT true
* allow dataplane agg and kube agg to both be added to delegate chain
* make update-workspace
* address feedback
* revert go.mod changes
* go.mod updates
* elaborate on why and how of skipping the Ready channel handling
* after rebase and make run
* replace usage of folder guardians with access control evaluators
* remove NewByFolderUID guardian
* bring up to date
* fix test
* more test fixes, and don't fetch the folder before evaluating lib element access
* change what error is returned
* fix alerting test
* try to fix linter errors
* we don't assign general folder write permissions, reverting to the previous logic for general folders
* start marking up azuremonitor
* more markup
* finish mark up
* add package and correct imports
* convert to functional component + use correct t import
* fix duplicate key + typo
* add extract config + fake french translations to test
* run prettier and fix unit tests
* use nx
* enable i18n lint rules for azure monitor
* remove fake french translations
* await initPluginTranslations
* top level await breaks unit tests
* leave as class component for now
* Dependencies: Bump github.com/getkin/kin-openapi from v0.131.0 to v0.132.0
* Dependencies: Bump github.com/openfga/openfga from v1.8.6 to v1.8.12
* Dependencies: Bump golang.org/x to latest
* docs(alerting): Add two common examples in `Learn` section
* Update docs/sources/alerting/learn/examples/multi-dimensional-alerts.md
Co-authored-by: Johnny Kartheiser <140559259+JohnnyK-Grafana@users.noreply.github.com>
* Update docs/sources/alerting/learn/examples/multi-dimensional-alerts.md
Co-authored-by: Johnny Kartheiser <140559259+JohnnyK-Grafana@users.noreply.github.com>
* mention `summary` annotation in multi-dimensional alerts example
* Remove note about alert grouping
* minor edits to section: `Differences with time series`
* minor grammar change
---------
Co-authored-by: Johnny Kartheiser <140559259+JohnnyK-Grafana@users.noreply.github.com>
* update docs on how to configure SCIM with okta
* fix enterprise link
* add introductory paragraph under "Configure provisioning settings"
This paragraph has been added to avoid stacked headings that break the flow of the documentation and hurt SEO
* split SCIM connector base URL config for cloud and onprem
---------
Co-authored-by: Irene Rodríguez <irene.rodriguez@grafana.com>
* chore(e2e): update plugin-e2e to canary version for testing
* chore(e2e): bump playwright/test to 1.52.0
* empty commit
* chore: bump to major version
* Trigger build
---------
Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
* Dependencies: Bump github.com/openfga/openfga from v1.8.6 to v1.8.12
* Linter: Replace x/exp/rand with math/rand/v2
* NGAlert: Fix test after linter fixes
Adds settings for SQL expressions:
sql_expression_cell_output_limit
Set the maximum number of cells that can be returned from a SQL expression. Default is 100000.
sql_expression_timeout
The duration a SQL expression will run before being cancelled. The default is 10s.
Grafana frontend code sends adhoc filters to the backend in both the
`tags` and `adhocFilters` params.
The values in `tags` have dashboard variables interpolated, while those
in `adhocFilters` don't. This PR updates the frontend code to
also interpolate variables into the `adhocFilters` param.
The duplicated values are left as they are in `tags`, in case some other
spooky code at a distance relies on that.
* Table: Avoid creating links in cells when data links have empty href
* Copy logic to TableNG
* Do not add non-clickable links to context menu
* Don’t pass if undefined
* Add tests to cover datalink logic changes
* Trigger Build
---------
Co-authored-by: Kristina Durivage <kristina.durivage@grafana.com>
Co-authored-by: Adela Almasan <adela.almasan@grafana.com>
* Ignore locales files more generically
* Use `ignore-path` for prettier
If we don't specify this, it will use `.gitignore` as well, which will ignore enterprise files.
This means that the code in enterprise will drift and easily ends up with prettier issues
* add e2e for grouping into tabs and rows
* enable kubernetesDashboards feature toggle for e2e tests
* remove unnecessary kubernetesDashboard feature flag enablement
* refetch when series limit is changed
* when series limit is empty use the default series limit
* tests for timerange handling
* attempt to reduce the test file size
* remove ineffective memory tests
* update test
* clearer tests
* update help text
* update limit tooltip
* rename /mtfe route to /femt to match project name
* set correct navTree JSON property name
* call GetWebAssets in the request handler to prevent stale assets during development
* Call /bootdata and render grafana
* set nonce on script
* write csp header in index handler
* write report-only csp as well
* debug stuff
* more debug logging
* move importing app into a seperate, async-loaded module
* Clean up comments
* make /femt redirect to / in the frontend
* remove console.log
* remove stale commented code
* call __grafana_load_failed if bootstrap fails
* comment for __grafana_boot_data_promise
* remove console.log
* remove blank newline
* codeowners
* Spike: Extras
* Attempt to wire it up
* Hack
* Fix issue with jobs
* Wire more things up
* Fix more wiring stuff
* Remove webhook secret key from main registration
* Move secret encryption also outside register
* Add TODOs in code
* Add more explanations
* Move connectors to different package
* Move pull request job into webhooks
* Separate registration
* Remove duplicate files
* Fix missing function
* Extract webhook repository logic out of the core github repository
* Use status patcher in webhook connector
* Fix change in go mod
* Change hooks signature
* Remove TODOs
* Remove Webhook methos from go-git
* Remove leftover
* Fix mistake in OpenAPI spec
* Fix some tests
* Fix some issues
* Fix linting
Adds ability to set notifications settings using the Prometheus conversion API.
The API now supports a new optional header: X-Grafana-Alerting-Notification-Settings which can be used to specify notification settings.
The value of the header is the AlertRuleNotificationSettings structure in JSON:
mimirtool rules load alerts.yaml --extra-headers 'X-Grafana-Alerting-Notification-Settings: {"receiver": "my-webhook", "group_by": ["cluster", "pod"]}'
set folder permissions to "view"
alerts are allowed to be created in folders where the user only has the
"read" permission, "write" permissions is not required and is only used
to allow creating new folders.
When interpolating variables in the frontend, we want to be sure to
escape special characters if the variable is used in a regex.
We used a regex to find regexes in raw queries, which contained a bug.
The regex treated any `/` character as the start of a regex. However,
InfluxQL (and most sql dialects) support using `/` as a division
operator.
This PR adds a check for `=~` or `!~` immediately preceding `/` as the
beginning of a regex, as per the InfluxQL spec for regexes:
https://docs.influxdata.com/influxdb/v2/reference/syntax/influxql/spec/#regular-expressions
Fixes https://github.com/grafana/support-escalations/issues/16219
provision Prometheus: added example field how to set the scrape interval
When using Prometheus as a datasource Grafana can optionally know the scrape interval of Prometheus. In the GUI it is easy to spot, however when provisioning the datasource the example was lacking this information.
This commit adds this missing field as an example.
* Update grafana alerting from de176b4a0309 to 83b6de6b0a35
Includes:
- https://github.com/grafana/alerting/pull/319
- https://github.com/grafana/alerting/pull/317
* Remove unused SendWebhook method from sender struct
grafana/alerting hasn't used the grafana webhook sender for a while now,
so this method is no longer used anywhere.
- Removed SendWebhook from the sender struct and rename it to emailSender
so that its use is clearer.
- Also, for similar reasons, the Webhook method on Grafana's
webhook sender `sendWebRequestSync` should not call grafana/alerting code for
NewTLSClient. The previous grafana/alerting function is vendored into grafana.
* Use BuildReceiverIntegrations new func signature
* Mark labels and annotations as optional in Grafana ruler DTO
* Refactor AlertsFolderView to use folder-specific endpoint for rules loading
* Improve tests for BrowserFolderAlertingPage
* Update translations
* Revert go changes
* update gen files
---------
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
* query variable editor
* add regex, sort, refresh
* make the label and spacing consistent
* add test for changing datasource
* make the preview label consistent with all labels on the editor
* Remote Alertmanager: Consider auto-gen routes when flagging a config as 'default'
* remove always-nil error from isDefaultConfiguration
* remove unnecessary context.Background() in test
* pass orgID to autogenFn call during AM creation
* fix test
* make update-workspace
* Fix incorrect country for Asia/Singapore timezone
* Add test
* link to gh issue
* skip test
---------
Co-authored-by: joshhunt <josh.hunt@grafana.com>
* remove deprecated annotation support and introduce the new one
* create annotations.test.ts
* convert the old annotations to new format
* don't override query if it has necessary fields
* a better implementation
* remove comment
* fix
* fix react errors
* unit tests for annotation query editor
* two more tests
* add active_time_intervals to route model
* update k8s compat layer
* update notification policies service to validate active time intervals
* update integration tests
* update openapi
* add active time interval to model
* update route generator to include active time interval
* Update storage list and rename methods to handle active intervals
* update api model
* update provisioning and export models
* update ui to allow active timing config
* update i18n
* fix snapshots for ui tests
* run prettier
* Alerting: Active time intervals UI naming (#104402)
* update naming in UI
* update naming in the edit page title
* update translations
* update alerting module
---------
Signed-off-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
Co-authored-by: Sonia Aguilar <33540275+soniaAguilarPeiron@users.noreply.github.com>
Co-authored-by: Sonia Aguilar <soniaaguilarpeiron@gmail.com>
* refactor: remove unused code in the function
* test: add unit tests for admission handler
* Revert "refactor: remove unused code in the function"
This reverts commit b8f48dbdbf.
* revert: added again due to incorrectly made test scenario
* test: add unit tests for admission handler
* Re-enable `jsx-a11y` recommended rules
* apply rule in correct place, couple of fixes
* fix up some a11y issues
* add ignore for keyboard a11y for now
* readd testid
* close carousel on backdrop click
* use type="button"
---------
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* Stop appending subpath in onNavigateToExplore function old-arch
* we are using assureBaseUrl inside getExploreUrl function
* adjust test to ensure subPath is not added to the url
* fix linting
* Add pause/unpause bulk actions button in the alert list view
* add delete bulk action
* Add tracking and refactor FolderActionMenuItem
* update translations and text
* update text
* add finally
* use ability for delete action
* don't show bulk actions if no action is allowed
* invalidate tags for delete action
* revert invalidating and redirect to list page instead
* redirect when pausing/unpausing
* add pause/unpause endpoints
* add translations
* add folder name in delete modal
* address pr review
* disable pause/unpause
* update redirect
* remove unnecessary prop
* rename FolderActionMenuItem component to PauseUnpauseActionMenuItem
* address review comments
* fetch rules before redirecting in list view 1
---------
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
Co-authored-by: Mariell Hoversholm <mariell.hoversholm@grafana.com>
* jaeger backend migration
* move processing to JaegerClient.Search
* fix upload query error source type
* suggestions
* lint
* fix link to traceid query
* fix tests
* fix tests
* use consistent types
* add tests for TransformSearchResponse fn
* test search function
* fix filtering using tags
* suggestion
* remove unnecessary arguments
* use logfmt parser for tags
* test
* test
* use logfmt for query tags
* update
* go fmt
* run backend for all queryTypes
* run make update-workspace
* assign owner to logfmt pkg in go.mod
* apply suggestions
* update tests
* trigger workflows?
* Docs: SAML docs refactoring
* Cleanup the root page
* Update the root file
* Refactor Azure AD guide
* Change the order of the tree
* Remove the index file again, back from main
* SAML UI page review and editing
* Review and edit SAML config options page
* SAML signing and encryption edit/review
* Remaining pages and aliases
* Fix PR comments
* More fixes
* Update _index.md
* Update _index.md
* Update _index.md
* Apply suggestions from code review
Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
* Handle PR comments
---------
Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
* LogLine: introduce truncation limit
* Processing: turn LogListModel into a class
* LogLine: introduce collapsed/expanded state and read from model
* Virtualization: correct extra line for controls in size
* LogLine: fix collapsed state initialization
* Add new criteria to define long lines to truncate
* Virtualization: better truncation limit
* Check collapsed state based on container size
* Update function name
* Extract translations
* LogLine: update unit test
* virtualization: add unit test
* processing: update unit test
* Fix focused test
* processing: process fields on demand
* Logs: consider loading state from explore
* LogList: improve resize and recalculation
* chore: build?
* feat: filter and sort sub tables
* chore: extract row processing into it's own function for filtering and sorting
---------
Co-authored-by: Adela Almasan <adela.almasan@grafana.com>
* add tag handler for snowflake ids
* add snowflake generator
* fill snowflake id back to the bean
* table driven test, mockable snowflake generator
* use math/rand/v2
* snowflake without time.sleep
* more explicit bitwise modulo
* rename snowflake to randomid
* use push event instead of pull_request_target
* pull request sha -> push sha
* remove PR specific stuff from pr-patch-check
* use my branch for testing
* use main now that it's working
* initial updates
* additional updates - index and config dos
* made edits, renamed the index files.
* Close unclosed shortcode
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* updated main and config docs
* edits to query editor and templates
* final edits to landing page
* added updates
* made a few additional edits
* edits
* final edits and changes per dev feedback
* reviewed titles and headings; ran prettier
* added ref URIs
* Update docs/sources/datasources/prometheus/template-variables/_index.md
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update docs/sources/datasources/prometheus/configure/_index.md
Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
* Update docs/sources/datasources/prometheus/template-variables/_index.md
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* updates based on feedback
* ran prettier
* updates due to feedback
---------
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
* add set/get feature toggles functions to grafana/ui
* configure grafana/ui feature toggle localeFormatPreference in app init
* revert more complex approach and use contained access to global
* Bring back contact points filter
* Use GMA Prometheus endpoint as main source of truth on the list page
* refactor: improve error handling in GrafanaRuleLoader
* Refactor ChannelOptions and related components for improved secure field handling
- Updated ChannelOptions to utilize integrationPrefix for path management.
- Introduced getOptionMeta for dynamic option metadata handling.
- Enhanced ChannelSubForm to manage secure fields and subform deletions.
- Refactored OptionField and SubformField to support new secure field logic.
- Adjusted types for better clarity and integration with the form context.
* Fix Combobox sizing
* Refactor ChannelSubForm and ChannelOptions for improved field handling
- Updated ChannelOptions to enhance secure field management.
- Refactored ChannelSubForm to replace Select with Combobox for better user experience.
- Adjusted type options handling in ChannelSubForm to align with new Combobox implementation.
- Cleaned up unused code and improved overall readability.
* Refactor contact point components for improved secure field handling and remove obsolete secure settings field
- Removed secureSettings from various components and tests to streamline the receiver configuration.
- Updated GrafanaReceiverForm to manage secure fields more effectively.
- Enhanced test cases for Slack contact points to ensure proper field behavior based on user input.
- Introduced a factory for creating mock Grafana contact points and receiver configurations for better test coverage.
* Improve conversion from form values to grafana receivers
* Revert Combobox migration and bring back Select for contact point type selector
* Update Grafana OnCall to Grafana IRM in notifier settings and enhance test coverage for SNS contact points
- Renamed notifier settings from 'Grafana OnCall' to 'Grafana IRM' in mockGrafanaNotifiers.
- Updated test cases in GrafanaReceiverForm to handle SNS contact points, including secure field management.
- Improved test assertions and added new tests for SNS integration to ensure correct behavior and state management.
- Refactored related components for better clarity and maintainability.
* Add secret fiels removal tests
* Fix mocks, remove Combobox changes
* Update snapshots
* Remove obsolete snapshot
* feat: pass read-only props to extension components
This initial commit is used to verify that things are broken in case
the datasource object is not cloned before passed in as a prop.
* chore: update tests
---------
Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
* Add pills in search bar for context
* Add scope actions
* Add selection functionality
* Show selected scope on secondary row
* Fix selected scope titles
* Add some basic tests
* Test for toggle by name
* Remove unnecessary mocking
* Small cleanups
* Lint fixes
* Fix test
* Update public/app/features/scopes/selector/ScopesSelectorService.ts
Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>
* Bump input and breadcrumbs test
* Change breadcrumbs color
* Makes the breacrumb spacing consistent
---------
Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>
* ci(levitate): remove backticks and escaping to fix json parsing
* ci(levitate): use code tag over escaping backticks - HTML FTW
* chore(prometheus-package): dummy commit to test levitate changes
* ci(levitate): use actions/github-script@v7 everywhere
* Add format validation for allowed_organizations and allowed_groups
* Refactor, introduce ListFormatValidation
* Add tests
* Update apps/advisor/pkg/app/checks/authchecks/list_format_validation.go
Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
* Update apps/advisor/pkg/app/checks/authchecks/list_format_validation.go
Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
* Use one step instead of multiple separate ones
---------
Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
* Update dependency downshift to v9.0.9
* change conditional typing to error on the onChange property with an easier to read error instead of on the component
add workaround for type script not being able to infer when onChange can accept null
add type test
* better Combobox types!
* remove unused import
* make type changes more backwards compatible
* improve comment
* even better comments
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: samsch <git@samsch.org>
* chore: row index is source index so just use that
* chore: fix better cause why not
---------
Co-authored-by: Adela Almasan <adela.almasan@grafana.com>
Co-authored-by: Sven Grossmann <svennergr@gmail.com>
* replace xorm.io/xorm imports
* replace xorm from other go.mod files
* clean up workspace
* nolint does not make sense anymore as it is not a module
* try if nolint directive helps
* use nolint:all for xorm
* add more nolints
* try to skip xorm in linter config
* exclude xorm differently
* retrigger ci
* Fix TestIntegrationUpdatingProvisionionedDashboards* tests when running on Spanner by fixing case-insensitive search for dashboard title.
* Fix use of case-insensitive LIKE when running on Spanner.
* Fix use of LikeStr in anonstore.
* Fix use of LikeStr in ngalert/store and org/orgimpl.
* Fix use of LikeStr in queryhistory search.
* Fix use of LikeStr in serviceaccounts.
* Fix use of LikeStr in serviceaccounts.
* Fix use of LikeStr in services/team.
* Remove LikeStr method.
* convert to ts
* fix path
* add yarn install step
* revert to commonjs for now
* weird syntax...
* test task creation
* just use workflow step id
* update workflow
* get workflow step id from crowdin
* testing...
* final test
* tidy up
* typescript with type assertion until upstream is fixed
* fix CODEOWNERS
* Fix: do not map when identifying default grafana ds
* add also datasource type
* Refactor code, add unit test
* Fix types references and linting
* Update public/app/features/manage-dashboards/state/actions.test.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Chore: Fix remaining levitate zizmur issues and move to use vault
* Levitate CI: Remove secrets usage for WIF identity provider and SA (#104783)
---------
Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>
* introduce alerting notification app
* move code as is and remove from old registry
* update api server registration
* update make file and remove unnecessary args, copy some useful make commands from dashboards
* update codeowners
* move constants inside module and remove dependency from grafana
* add support for selectors to the app builder
* tweak ringKey/ringName for consistency and allow us to configure memberlist cluster label config
* allow setting memberlist cluster label verification disabled field
---------
Co-authored-by: Peter Štibraný <pstibrany@gmail.com>
* Add some clone tests
* Add case to create ref if it doesn't not exist
* Add unit tests for context cancellation
* Bare repository not needed
* Make tests work without git command
Delete epic-add-to-platform-ux-parent-project.yml
This is an old workflow which is no longer used.
Co-authored-by: Mihaela Maior <mihaela.maior@grafana.com>
* Updates the instrumentation_server service to use mux instead of the builtin router, and have it store the router in the module server: this is so we can register the /ring endpoint to check the status of the ring
* Create a new Ring service that depends on the instrumentation server and declares it as a dependency for the storage server
* Create standalone MemberlistKV service for Ring service to use
* Update the storage server Search and GetStats handler to distribute requests if applicable
* adding ml items to main navigation if plugin is installed
* undoing testing change
* updating based on feedback and fixing role to be specific to access to ml plugin
* cleanup unneeded constants
* cleanup diff
* updateing GetOrgID call
* adding greyscale ml logo and using that for consistency
* use currentColor
---------
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* New Crowdin translations by GitHub Action
* kick CI
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* Sanitize paths before evaluating access to route
* use util.CleanRelativePath
---------
Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
* make sure that user permission cache is cleared after new dashboard and folder creation
* more test fixes
* Update pkg/services/dashboards/service/dashboard_service.go
* check identity type in SetDefaultPermissionsAfterCreate, set default permissions for service accounts
* set SA permissions for folders as well
* fix tests
* feat(add): datasources:query support for using the authlib/authzservice
* added test for datasources
* refactor to create the translation right away
* Update pkg/services/authz/rbac/mapper.go
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
* fix tests
---------
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
* create the most basic frontend-server module
* expose prom metrics??
* add todo list
* move frontend-service to its own folder in services
* check error from writer.Write
* reword comment, add launch config
* Alerting: Add extended definition to prometheus alert rules api
This adds `isPaused` and `notificationSettings` to the paginated rules api to enable the paginated view of GMA rules.
refactor: make alert rule status and state retrieval extensible
This lets us get status from other sources than the local ruler.
* update swagger spec
* add safety checks in test
* Add unit test for unimplemented methods
* Add unit test for GoGitRepo_Read
* Add tests for Delete
* Add more tests
* Add unit test for GoGitRepo_Push
* Add unit test for ReadTree
* Add test for GitHubRepository_LatestRef
* Add test for GitHubRepository_LatestRef
* Add test for GitHubRepository_CommentPullRequest
* Add remaining tests for GitHubRepository
* Add remaining tests for GitHubRepository
* Fix linting
* Refactor current solution
* Run traceid queries with enabled node graph through backend
* Update test
* Fix lint
* Uodate based on feedback, don't spread
* replace and return the builtin variables
* don't parse the expression twice
* improve the replacement logic
* better code with more tests
* lint
* betterer
* rename the test suite
* Add unit tests IsAuthenticated
* Add unit tests RepoExists
* Add unit tests GetContents
* Add initial unit tests GetTree
* Add unit tests for CreateFile
* Add unit test UpdateFile
* Add unit tests DeleteFile
* Add unit tests for Commits
* Add unit tests for helpers
* Add unit test CompareCommits
* Add GetBranch tests
* Add unit tests BranchExists and CreateBranch
* Add unit tests Webhooks
* Remove unused code
* Add unit tests CommentPullRequest
* Add more cases for GetTree
* Complete coverage
* Fix linting
* remove prometheusUsesCombobox feature toggle
* betterer
* fix the unit test
* create MetricsLabelsSection unit tests
* fix unit tests
* fix unit tests in PromQueryBuilder.test.tsx
* prettier
* remove timeouts
* Revert "remove timeouts"
This reverts commit 84af1fd46b.
* Test validate
* Complete tests for validate
* Add tests for validate
* Add unit tests Read
* Add unit tests ReadTree
* Add unit tests Create
* More specific on apierrors
* Improve coverage
* Add unit tests for Update
* Add unit tests for Write
* Add tests for deletion
* Add test for recursion error
* Add unit tests History
* Add basic scenarios webhook method
* Add cases for push
* Add unit tests for pull request event
* Remove addressed FIXME
* Meta import
* Use sha256
* Fix linting error use of As
* Dashboard: SchemaV2 Fix mapping ds for variables and annotations
* process annotations and vars ds inputs so they can be selected
* clean up so async works
* Add basic unit test for v2 dashboards mapping
* clean up tests
* linting
---------
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
* Add FiredAt field to the State
* Update featuretoggle files
* Fix lint errors
* Fix test compilation
* Remove random print line + formatting
* Address PR comments
* remove unused part of xorm
* remove onlytodb and onlyfromdb tags
* only keep snapemapper, since we always assumed it is the only one available in xorm
* SQLTemplates: Add helper to ensure all templates have a test-case associated
* UnifiedStorage: Add missing sql template test case
* LegacyDashboards: Add sql templates fs to test cases for exhaustiveness check
* RBACStore: Add sql templates fs to test cases for exhaustiveness check
* LegacyIAM: Add missing sql template test cases
* Add user-facing feature toggle functionality for the new alerting list view
- Implemented `useFeatureToggle` hook to manage feature toggles using local storage.
- Added unit tests for `useFeatureToggle` to verify behavior for various toggle states.
- Updated `RuleList` components to utilize the new feature toggle for alerting list view.
- Introduced `RuleListPageTitle` component to handle toggling between list views with a badge indicator.
* Add tests
* Fix imports and remove unused code
* Add a new feature flag for list v2 preview button
* Hide v2 preview button behind the new feature flag
* Update list v2 feature toggle stage
* Alerting: List view feature toggle button PR review (#104161)
* Add test for undefined feature toggles case
* Tweak tests to use test utils and user
* Add i18n for toggle button and tweak props spreading
* Update translations
---------
Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
* Ensure field validators return the proper type
This ensures correct error propagation through services up to
the API layer.
* Move error wrapping up to call site
* Add recent scopes to command palette
* Remove parent action
* Support updating select set of scopes
* Filter out currently selected scope
* Add recent scopes to drawer
* Add expandable section
* Add recent scopes component
* Only show recommended for leaf nodes
* Small style fixes
* Always write to recent after fetching new scopes
* Add feature toggle check for command palette
* Use i18n
* Remove unused prop
* Add test cases for recent scopes in selector
* Add more test cases
* Add clear test action
* Remove unused imports
* Geomap: Tooltip for multiple features same coord
* Add basic test coverage
* Be explicit with sorting to avoid truthiness error
* Add sorting to tests and clean up
* Check again for duplicates
* WIP: Separate signature package
* Add some unit tests
* Test factory
* Finish unit test coverage signature package
* Fix register
* Add FIXME
* Add more coverage
* Add more coverage
* Fix migrate tests
* Fix unit tests
* convert it to functional component
* useReducer
* usePromQueryFieldEffects
* clean up the code
* remove localStorage provider
* introduce usePromQueryFieldEffects.test.ts
* simpler state management
* remove mocks
* linting + betterer
* Split PrometheusMetricsBrowser into small functional components
* remove /series endpoint usages for Metrics Browser
* add time ranges
* remove unused file
* fix unit test
* use limit
* re-fetch labels when a label value is selected
* reset the label keys when selector is empty
* select multiple labelValue
* fix unit tests
* add comments
* don't show unpresented labelKeys
* don't clear out selected label keys that are in local storage
* show values properly
* fix clearing
* don't discard already selected label values when a new label value selected
* remove unnecessary unit test
* clear all selections
* if metrics list is empty remove all label keys too
* re-populate values when all label selections are removed
* safety
* more comments
* updating the whole fetching mechanism
* buildSafeSelector
* loadSelectedLabelsFromStorage
* fetchMetrics
* fetchLabelKeys
* fetchLabelValues
* more unit test and comment
* timeRange changes will trigger re-fetch
* some more comments
* fix the unit test
* lint
* fix unit tests
* fix timerange causing problem
* remove fethcing message
* proper initialization
* fix value fetching during metric selection
* fix value fetching
* fix unit tests
* fix a bug
* comments
* some precaution
* fix the test
* fetch metrics when metric selection is changed
* trigger initialize when seriesLimit is change
* Revert "trigger initialize when seriesLimit is change"
This reverts commit c6cbbc1386.
* remove redundant comments
* e2e: improves flakiness
* Chore: refactor flaky test
* e2e: more refactor
* e2e: do not keep successfull test run videos
* e2e: do not log selectors
* chore: updates after pr feedback
* chore: updates after pr feedback
* chore: adds retries to flaky e2e test
* e2e: skip flaky tests
* e2e: skip flaky tests
* e2e: revert back to timeout
* chore: removes all the skips
Throw errors when trying to call List in legacy with an RV specified
Change ResourceVersion to microseconds
Co-authored-by: Marco de Abreu <18629099+marcoabreu@users.noreply.github.com>
* Alerting: Update docs for RBAC
This updates the documentation for RBAC to match the changes from 032299011a
* add note about RBAC permissions with datasource permissions
* writers toolkit update
* Rename and make folder migrator public
* Move skipRepo out of tree
* Move folder logic out of worker
* Use wrapper function for clone
* Introduce storage swapper
* Use RepositoryResources interface
* Add TODO
* Signature with option
* Use plural for folders
* Split more logic out of worker
* Refactor further
* Remove todo
* Refactor further
* Test worker
* Add test for unified storage
* Add mock for bulk store
* Clean line
* Test more about storage
* Happy path storage test
* Finish storage tests
* Add more interfaces
* Add some tests legacy
* Complete test coverage legacy
* Complete coverage legacy
* Fix compilation
* Add initial folders tests
* Finish coverage for folders
* Test namespace cleaner
* Fix typo
* Add some tests for resources
* Finish coverage migrate package
* Update tests
* Fix jobs tests
* Unit test users
* Convert user tests to table tests
* Fix linting in tests
* Fix typo
* Use PreloadAllUserInfo
* Add FIXME
* SQL Expressions: Bump GMS for STDDEV(), VARIANCE()
Bump Go MySQL Server to the latest version, to get support for STDDEV()
and VARIANCE() functions, and their aliases.
See https://github.com/dolthub/go-mysql-server/pull/2928
* Update app-code to comply with latest GMS version
* Run `go mod tidy`
* Update test which had depended on STDDEV being missing
* Run `make update-workspace`
* DataData DS: Add Frame type to Random Walk queries
* Time column should not be nullable
Conversion for the SQL (server-side) expression was failing with:
`failed to convert data frames to long format for sql: missing time field`
Because we weren't seeing a match at:
`if f.Type() == data.FieldTypeTime {`]
here:
acb0e6b609/pkg/expr/convert_to_full_long.go (L155)
The DataPlane docs (https://grafana.com/developers/dataplane/timeseries)
state that:
> - The Time field(s):
> - Should have no null values
So making the fix here
Alerting: fix flaky tests
Some test conditions introduced in #103403 are flaky because they rely on random behavior of the generator.
Sometimes rules are generated with an updated by (which warrants the lookup of the users). This makes it so those tests which are checking the user lookup always have rules with updated by.
What is this feature?
Send resolved notifications not only when an alert state becomes stale (series is missing) and transitions from Alerting to Normal, but also from Error, NoData and Recovering.
Why do we need this feature?
Previously, when an alert state became stale or was deleted, it would transition to Normal but wouldn't trigger resolved notifications to the Alertmanager. This meant we relied on the Alertmanager to send resolved notifications when the alert expires. However, if the Alertmanager state is lost, these resolved notifications would never be sent, leaving users with firing alerts in their notification channels. This PR ensures that any transition from a firing state (Alerting, Error, NoData, Recovering) to Normal triggers a resolved notification.
This adds more checks on the type of errors returned from InfluxDB
fsql datasource queries. The Grpc error code `Unavailable` is mapped
to a downstream error source.
* Remove POST config for Grafana Alertmanager
* Delete auth + test for removed path
* Alerting: Remove check for `alertingApiServer` toggle in UI (#103805)
* Remove check for alertingApiServer in UI
* Update tests to no longer care about alertingApiServer
* Add contact points handlers now that we use alertingApiServer all the time
* Fix test broken from removing camelCase for UIDs
---------
Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
* Activate schema validation and align underlying systems
* update to save as v0 if not the right schema version
* Resolve merge conflicts
* Move RequireApiErrorStatus to tests package
* Add mutation tests
* Fix lint
* Only do min version check if dashboard is v1
* Fix lint and disable provisioning test
* Revert provisioning changes
* Revert more tests and add schema test
* Reran gen
* SQL Dashboard save
* Adjust APIVERSION
* Fixed mutation test
* Add logging on downgrade
---------
Co-authored-by: Marco de Abreu <18629099+marcoabreu@users.noreply.github.com>
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
* wip
* fix the async bug
* Fix tests
* support library panels
* Update comment
* clean up
* refactor, use multi resource kind
* uncomment
* return only the spec
* simplify templateizing logic
* update dashboardkind
* revert imprtable requirements to use the current interface
* tests and fixes
* add panel configs to required; more tests;
* everything in elements should be processed
* clean up
* clean up
* rename for clarity; clean up tests
* export resource v spec
* i18n
* clean unused
* fix library panels
* revert comments
* revert lefthook.rc
* don't support lib panels
* another lefhook revert
* remove lib panel in test
* Remove library panels on external export; show warning if dash contains library panels
* fix tests
* Support old export mode
* clean up
* rely on dash shape vs feature toggle, add spacing to alert, update message
* lint
* typo fix
* make makeExportable part of dashboard serializer; clean up old exporter
* clean up
* more cleanup
* gem file cleanup
* remove unused function
* remove unused selector
* don't remove ds refs that use ds template variable
* clean up
* Dashboards: SchemaV2 - Fix stateless queries for mixed ds
* Add uni test for new utils function
* Add extra condition to validate we have datasources configured in the grafanaBootData
* Refactor code
* remove unnecessary test
* Template editor syntax highlighting when preview is json-like
* Add new template editor language examples, snippets, and functions
* Use updated NewTemplate function
* Add new fields to webhook notifier
- CustomPayload
- ExtraHeaders
* Documentation
* Update grafana/alerting to in-progress PR (needs updating after merge)
* Fix integration test
* Remove docs reference to .Extra template context
No longer exists, was part of a previous iteration
* make update-workspace
* Update grafana/alerting to actual merged commit
* docs: add documentation for keep_firing_for and Recovering state
add documentation for keep_firing_for and Recovering state
* updated image, added procedure step, added new state info
updated image, added procedure step, added new state info
* vale'd
* Update docs/sources/alerting/alerting-rules/create-grafana-managed-rule.md
Co-authored-by: Sonia Aguilar <33540275+soniaAguilarPeiron@users.noreply.github.com>
* edits with gratitude to pepe
* impage update
image
---------
Co-authored-by: Sonia Aguilar <33540275+soniaAguilarPeiron@users.noreply.github.com>
* run e2e tests as a matrix
* add old-suite/
* remove old-arch input
* run without quotes
* Update codeowners
* remove e2e-suite-various from codeowners
* ?
* role based fallback
* disable permissions cache with provisioning
* fallback to role based
* test with editor (not admin)
* test with editor (not admin)
* fix imports
* lint
* editor can create folders
* alerting docs: update alert rules history limit documentation
the documentation for the alert rules version history has been updatedto specify that the rules apply to enterprise/OSS customers.
the rules should also be explicated for cloud documentation.
* Update view-alert-rules.md
API Changes:
- Fixes validation in template CRUD API to be closer to how the running
alertmanager will use the template. Should remove some incorrect
validation errors.
- Adds some missing default placeholder labels to receiver testing that
are used during template testing but missing during receiver testing
Template Preview:
- Replaced basic preview with a readonly CodeEditor for better whitespace
and alignment clarity (also adds support for future syntax highlighting
in template previews for upcoming webhook payload templates)
Template Selector (Receiver Form):
- Refactored to use same components as Template editor for preview.
- Fixed preview to work with multi-definition templates
- Fixed copy to correctly copy the template contents instead of
{{ template "<name>" . }}.
Template Editor:
- Fixed detection of when to display functions vs snippets in multi-line
expressions
* Implement basic behavior of stateless annotation
* Fix ds defined getting lost
* Fix linter
* adjust test to be aligned with datasources not automatically being assigned to the model
* Add unit test for annotations
---------
Co-authored-by: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com>
Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>
* switch to useLayoutEffect so queries run after url correction
* add comment
* suparate useEffects to avoid update on slug change
* add url correction for missing slug
* account for slug change during dashboard rename
* simplify fix
* add e2e test for data link without slug
* remove old comment
* remove newly added path from useEffect dependencies
* Move filtering code to generators for performance reasons
Discarding rules and groups early in the iterable chain limits the number of promises we need to wait for which improves performance significantly
* Add error handling for generators
* Add support for data source filter for GMA rules
* search WIP fix
* Fix datasource filter
* Move filtering back to filtered rules hook, use paged groups for improved performance
* Add queriedDatasources field to grafana managed rules and update filtering logic to rely on it
- Introduced a new field `queriedDatasources` in the AlertingRule struct to track data sources used in rules.
- Updated the Prometheus API to populate `queriedDatasources` when creating alerting rules.
- Modified filtering logic in the ruleFilter function to utilize the new `queriedDatasources` field for improved data source matching.
- Adjusted related tests to reflect changes in rule structure and filtering behavior.
* Add FilterView performance logging
* Improve GMA Prometheus types, rename queried datasources property
* Use custom generator helpers for flattening and filtering rule groups
* Fix lint errors, add missing translations
* Revert test condition
* Refactor api prom changes
* Fix lint errors
* Update backend tests
* Refactor rule list components to improve error handling and data source management
- Enhanced error handling in FilterViewResults by logging errors before returning an empty iterable.
- Simplified conditional rendering in GrafanaRuleLoader for better readability.
- Updated data source handling in PaginatedDataSourceLoader and PaginatedGrafanaLoader to use new individual rule group generator.
- Renamed toPageless function to toIndividualRuleGroups for clarity in prometheusGroupsGenerator.
- Improved filtering logic in useFilteredRulesIterator to utilize a dedicated function for data source type validation.
- Added isRulesDataSourceType utility function for better data source type checks.
- Removed commented-out code in PromRuleDTOBase for cleaner interface definition.
* Fix abort controller on FilterView
* Improve generators filtering
* fix abort controller
* refactor cancelSearch
* make states exclusive
* Load full page in one loadResultPage call
* Update tests, update translations
* Refactor filter status into separate component
* hoist hook
* Use the new function for supported rules source type
---------
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
This makes it so that it is:
- No longer required to have datasource permissions to delete a rule.
- No longer required to have datasource permissions to update non-query related fields of a rule.
* Add function for retrieving logs table plan
- Add URL builder method
- Add types
* Add auto-switching for basic logs tables
* Set dashboardTime property
* Ensure useEffect doesn't run on every query change
* Fix basicLogs property
* Add isLoading for schema
* wip
* Add prom flavor support for data source variables and export/import dashboards (#103321)
* add dashboard and data source var selection
* use match plugin id instead
* use updated matchpluginid
* formatting
* cleanup
* regex anchor
* update error msg
* Alerting: Clean up prometheus-flavored types and functions (#103703)
* clean up types and utility functions for dealing with
prometheus-flavored data sources
* Refactor alerting datasource types to use constants as source of truth
* Alerting: Clean up prometheus-flavored types and functions on the bac… (#103716)
Alerting: Clean up prometheus-flavored types and functions on the backend
* add matchPluginId tests
* Update matchPluginId func to bidirectional (#103746)
* update matchpluginid func to bidirectional
* lint
* formatting
* use actual isSupportedExternalRulesSourceType in test
* add tests in datasource_srv
* betterer
* remove type assertion
* remove unnecessary case
* use satisifies to not have to convert tuple to an array of string
* add prometheus_flavor test
---------
Co-authored-by: Andrew Hackmann <5140848+bossinc@users.noreply.github.com>
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
Co-authored-by: Alexander Akhmetov <me@alx.cx>
* LogLabels: add displayMax property
* MetaInfoText: prevent label wrapping
* LogsMetaRow: remove unescaped content and max characters
* LogsMetaRow: use font weight normal
* LogLabels: add button to collapse back
* LogsMetaRow: set line height
* LogsMetaRow: save common logs state
* LogsMetaRow: update unit tests
* LogLabels: update unit test
* LogListContext: add forceEscape option
* LogListContext: move forceEscape and hasUnescapedContents
* LogListControls: move forceEscape to controls
* LogList: read forceEscape from context
* i18n
* LogListControls: test new control
* Update betterer
* logsModel: update test
* LogLabels: replace characters with icons
* Prettier
* LogLabels: add aria labels
* i18n
* Update tests
* Update test
* detect target folder rules and show warning
* show detected rules in target folder in a collapsed section
* fix detecting rules that might be overwritten
* refactor
* remove undefined
* fix text
* Split in multiple files
* Refactor sync even further
* Move more things between RepositoryResources
* Add status patcher
* Interface for sync functions
* Interface for compare function
* Add syncer back
* Move interfaces
* Move execute complete
* Return currentRef in syncer
* Add repository status test
* Add initial sync tests
* Fix a couple of spots
* Make initial sync tests work
* Fix register.go
* Add initial tests for sync worker
* Finish tests for sync
* Add incremental tests
* Add TODO
* Finish incremental tests
* Move folder creation to full sync
* Move interfaces
* Add initial full sync tests
* Update tests
* Reshape things
* Add changes test
* Fix register
* Add some tests
* Add more tests
* Add test
* WIP
* WIP: delete test
* Add more full test
* More tests
* Add tests for folder creation
* Add folder tests full sync
* Full coverage full sync
* Clean up tests
* Add more tests for changes function
* Enhance tests for Changes function to cover error scenarios and empty paths
- Added test cases for handling empty file paths and folder resources.
- Updated error message formatting in the Compare function for clarity.
* Add unit tests
* Failed initial patch
* Add tests failed repository resources
* Add test failed getting client
* Test for successful and unsuccessful syncs
* Add final tests for worker
* Fix existing tests
* Add missing test
* Fix spelling mistake
* Fix flake in changes test
* change copy configuration
* comma and this token after token creation
* securely migrate and you'll need token
* add caret and modify steps
* period after check failed resources
* learn about migrating v1
* building snapshot reduce text
* right caret connect to a cloud stack
* building snapshot reduce text v2
* make i18n-extract after merge
* CloudMigrations: Enable snapshot resource type configuration
* ConfigureSnapshot: Update resource type order
* ConfigureSnapshot: Add compile-time check for all resource types
* Fix trickier merge conflicts
* E2E: Fix intercept calls to get snapshot results to match new query params for sorting
* ConfigureSnapshot: Break text into newline
* ConfigureSnapshot: Add spacing on resources list
* Chore: Run betterer
* ConfigureSnapshot: Make secondary text bold
* ConfigureSnapshot: Update copy which resources to migrate
* ConfigureSnapshot: Add tooltip near build snapshot button with ETA
* Anonymous access: Allow setting org role in new authz service
* back out change that is not needed; rename struct
* cleanup
* Fix tests
---------
Co-authored-by: Gabriel Mabille <gabriel.mabille@grafana.com>
* test disable metrics reporting
* Show overlay on hidden tabs
* Fix accidental inclusion
* hide overlay when not editing, this can happen if a user navigates to a hidden tab by url
* Fix lint
* Extra confirmation before deleting tab with content
* also confirm rows
* make i18n-extract
* remake how the confirm works
* reset panel menu behavior
* update i18n, fix missing event
* fix lint
* Fix annotations losing queries when saving v1 with dynamic dashboards enabled
* Add extra options property to the DashboardAnnotationQuerySpec to catch all field datasource-specific properties
* Add options to the v2Alpha1 schema and run make gen-apps
* Add unit test and clean up console.logs
Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>
* Docs: removing docs debt in install docs
* cleaning up set up docs debt
* fixing some vale errors
* fixing broken admonition shortcode
* fixing broken shortcode
* fixing broken shortcode
* working to the grafana authentication config
* updating some more files
* editing down to ldap in the repo
* editing ldap doc except final section with link needed
* Finishing doc debt cleanup through configure authetication
* fixing shortcodes reverted by merge conflict fix
* fixing admonition
* fixing more broken shortcodes
* adjusting some wordings ot make vale happy
* updating feature toggle info
* Jaeger: Run traceID query through backend with feature toggle enabled
* Reorganize
* Update comments and test
* Fix snapshot test
* Only pass time params if enabled in cofig
* Rename applyVariables to applyTemplateVariables
* Rename transformResponse to transformTraceResponse
* Update comment
* create permissions
* add key
* lint
* structure as a delayed callback
* legacy API hook
* merge main
* wired up
* and folders
* watch repos
* missing return statement
* Set the correct permissions
* add TestAfterCreatePermissionCreator
* do not add perms on folder create
* fix tests
* add annotation on create
* lint
* lint
* ensure we set permissions when the FT is disabled
* remove custom folder_storage
* fix lint
* change default
* lint
* lint
* fix: annotation
* ensure permissions are added on folder legacy
* remove folderstorage again
* fix tests
* add FT
* undo change to folder
* dashboard on create
* remove annotation for folder
* fix tests
* fix prepare after rebase
* fix tests
* fix tests
* fix tests
* lint
* address comments
* add test for prepareObjectForStorage
* add again skipIfMode as per comment
---------
Co-authored-by: Georges Chaudy <chaudyg@gmail.com>
* Add repository resources interface for export worker
* Add mocks for repository resources
* Add unit tests for ExportWorker's IsSupported method
* Add unit tests for ExportWorker's Process method, covering scenarios for missing export settings, write permissions, branch restrictions, and client creation failures.
* Fix unit tests
* Single function
* Add more unit tests
* Add test for failed folder
* Fail export folder errors
* Add another test
* Positive folder export
* Too many folder export errors
* Too many errors on folder export
* Partial folder errors
* Add test for nested folder
* Add test dashboard export
* More cases
* Ignore existing dashboards
* Fix folder tests
* Fix clonable test
* Add clone failure test
* Add test clean up without push
* Working tests
* Use mock clonable
* Add unit tests for IsWriteAllowed
* Add behaviour to cover ref equal to configured branch
* Fix worker test
* Fix linting
* Split clone and push
* Wrapper for clone and push
* Separate methods for resources export
* Separate folder export
* Simplify single signature
* Refactor a bit more
* Separate folder export function
* Split it into different files
* Add FIXME
* Export function mock
* Export Resources tests
* Add test for cannot find client
* Check for branch
* Fix registry
* Move folder export tests
* Pass wrapper function
* Add worker tests
* Fail if branch is passed for clonable repositories
* Fix merge issues
* Add hook to validate access for users based on provisioning logic
* Wire the hook
* Add tests
* declare new variables for errors
* rework the authorization flow for provisioned users
* Add scim feature to testinfra opts
* Grant access if the identity doesn't have associated a user
* skip external uid check for subsequent calls
* Update tests
* Revert "CloudWatch: Import new grafana-aws-sdk with PDC fix (#103249)"
This reverts commit f2b5b4e0c0.
* Revert "CloudWatch: Migrate to aws-sdk-go-v2 (#103106)"
This reverts commit a65cc0df93.
* make update-workspace
* Added config options heading and bumped other heading levels
* Restructured xy options section
* Fixed links
* Formatted xy chart options using tabs
* Finalized structure of xy chart options section
* Corrected and restructured tooltip options
* Made to do note
* Added to do note
* Replaced screenshots
* Replaced axis options with shared file
* moved transform section
* Moved non-config sections and fixed heading level
* Removed incorrect options from xy chart and commented out image in shared axis file
* Wording edits
* Updated axis options
* Fixed wording
* Added Value mappings and thresholds and other minor edits
* Fixed table
* feat: text wrap table g12
* chore: remove stale comment
* tests: skipping - can't figure out how to test right now
* move text wrap stuff to table new
* chore: make table stuff untouched. only in table new
* wrap text stuff only in table-new
* unbreak RT wrapping
* skip tests for now
* cleanup
* fix bad merge
* revert some stuffs
* maybe
* tweaks
* uwrap 0.1.1
* fix: cell width fixes for overrides
* chore: fix column width
* fix: update hover logic
* fix: utils.test.ts
* chore: mock uWrap and remove tests for now
* chore: adjust width
* chore: clean
* chore: width passed to uwrap account for border
* chore: width changes
* adjust
* no descr
---------
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
* add group to role DisplayName to make searching easier
* clean up more role names; add filtered display text when fetching
* pass filter state into role menu to decide how to display role name
* prop name better describes what it does
* Use logging from app sdk in the resource mod
* make update-workspace
* Use app-sdk logging in SQL backend
* Use grafana-app logging in tests
* make update-workspace
* make update-workspace
* make update-workspace
* Use default logging
* Remove dependency on grafana/grafana
* Fix imports
* skip rules that are managed by plugins when importing from data source rules to GMA
* update translations
* update text
* update translations
* handle no rules to import
* filter out rules instead of groups
* Reuse skipped rules alert
* update translations keys
* fix filter
---------
Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
* implement sorting
* swagger gen
* minor fixes
* clean up param reading
* add todo
* add errors only prop
* codegen stuff
* fix copy paste error
* forgot the api gen
* implement sorting on the frontend
* remove unused enums
* cleanup
* remove tests that are obe
* fix merge
* change page length based on checked box
* cleanup
* fix test
* i18n-extract
* var name tweaks
* use switch and conditional rendering instead of checkbox
* i18n-extract
* use initial sort
* fix type
* fix layout
* fix bugs
* make betterer happy
* fix var names
* Add repository resources interface for export worker
* Add mocks for repository resources
* Add unit tests for ExportWorker's IsSupported method
* Add unit tests for ExportWorker's Process method, covering scenarios for missing export settings, write permissions, branch restrictions, and client creation failures.
* Fix unit tests
* Single function
* Add more unit tests
* Add test for failed folder
* Fail export folder errors
* Add another test
* Positive folder export
* Too many folder export errors
* Too many errors on folder export
* Partial folder errors
* Add test for nested folder
* Add test dashboard export
* More cases
* Ignore existing dashboards
* Fix folder tests
* Fix clonable test
* Add clone failure test
* Add test clean up without push
* Working tests
* Use mock clonable
* Add unit tests for IsWriteAllowed
* Add behaviour to cover ref equal to configured branch
* Fix worker test
* Fix linting
* Split clone and push
* Wrapper for clone and push
* ReloadDashboard: Unified manager should delegate to the right manager
* Throw only when dashboard version error is detected
---------
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
* restrict provisioned teams from being updated and deleted
* check if team is provisioned before update and delete
* add function getTeamDTOByID()
* check if team is provisioned in access control
* fix TestDeleteTeamMembersAPIEndpoint
* add unit tests
* add function for validating a team
* SQL Expressions: Allow many more functions and nodes
* Also allow the `REGEXP_SUBSTR` function
* Add window functions
* add more JSON support, remove now and current time (for now)
---------
Co-authored-by: Kyle Brandt <kyle@grafana.com>
* Use authlib repo. Use otel
* Use interceptors on the provider level
* Create a new wire set with otel
* Lint
* Fix test
* make update-workflow
* make update-workspace
* make update-workspace. Try to add authlib as enterprise imports
* make update-workspace
* Run validation on config updates
* Refactor code
* Add debug lines
* Remove test check on admission
* Organize imports
* Delegate events to the API client
* Extend error notification
* Deep copy default data
---------
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: Clarity-89 <homes89@ukr.net>
The tool is unmaintained. Most useful rules have been ported to Vale.
The remaining rules often exhibit false positives.
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
The new behavior is discussed in https://github.com/grafana/website/pull/25064.
The behavior lets writers include block elements like lists and continue the list in the including source.
I've removed the `panels` `ref` URI to fix the link in learning journeys.
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Add reqAction for alert manager routes
* Add endpoints from Prometheus Alertmanager API
* use notifications reader for alertmanager/api/v2/status
* use viewer for GET api/v1/alerts
* add POST DELETE for api/v1/alerts
* duplicate paths to cover upstream Alertmanager
* add fallback rule to catch all GET
* Update reqAction for GET api/v1/alerts
* require Admin for all wildcard paths
---------
Signed-off-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
* ColorPicker: fixed height when switching tabs
Fixed the component's height by setting a consistent height and adding margin.
Also added a test to ensure the component heights remain nearly identical when switching tabs.
Fix#99675
* ColorPickerPopover: Fixed height for popover content and allowed overflow. #99675
* ColorPickerPopover : Fix formatting suggested by linter.
* ColorPickerPopover: Remove redundant height test when switching tabs
* ColorPickerPopover: Remove overflowY style from popover container
* ColorPicker: Remove unnecessary marginTop from SpectrumPalette styles
* Update styling of import warning
* Update logic for picking recording rule target datasource, and default to chosen DS
* Add CreateNewFolder component
* Reuse folder creation logic inside alert rule form
* Update betterer and tweak jsdoc
* Add translation to folder selector and tidy up imports
* Allow specifying data source UID in query param
* Add import button to new list view on appropriate data sources
* Fix CI failures
* Update translation keys
* LogListNavigation: create component
* LogListNavigation: make it optional
* Refactor Navigation into Controls
* Explore Logs: hide old panel options
* LogListControls: add more controls and apply new styles
* LogListControls: update width
* Remove console log
* LogList: wrap component in context
* LogListContext: make it stateful
* LogListControls: connect with context
* LogListContext: sync displayed fields
* LogListContext: add syntax highlighting control
* LogLine: improve color with highlighting off
* LogListControls: improve button styles
* LogListControls: add sort order option
* LogListControls: add dedup strategy
* LogListContext: sync prop changes with state
* LogList: add option change callback
* LogListContext: sync external changes only when showControls is disabled
* LogListContext: unify sync effect
* LogListControls: improve buttons active css
* LogListContext: add optional storage support
* LogList: make syntaxHighlighting and read from store or default to true
* LogsPanel: add support for new options
* Generated file
* Update tests
* New Logs Panel: add showControls option
* LogList: make eventBus optional
* LogsPanel: expose syntaxHighlighting
* LogsPanel: expose grammar to plugins
* Remove incorrect legacy file
* LogListControls: allow options change with controls enabled in panel editor
* LogLine: apply no-highlighting class to ansi wrapper
* LogListControls: add frontend level filtering
* LogList: filter by filterLevels
* LogListControls: allow filterLevels in dashboards
* LogLine: update unit tests
* LogLineMenu: update unit test
* LogListControls: add unit test
* Revert
* LogList: add unit test
* LogList: add onLogRowHover support
* LogList: test hover events
* LogsPanel: add unit test
* LogLine: use theme color for errors
* LogLine: minor tweak to hover state
* Chore: fix test case name
* LogListControls: add border
* LogListControls: prevent default on wrap toggle click
* LogLine: switch info and debug colors
* ContentOutline + LogControls: sync displayed levels and minor outline improvements
* LogListContext: sync with external filterLevel changes
* Logs: work with arrays of LogLevel and not plain strings
* Fix type
* LogListControl: increase controls size
* Use interface for factories
* Add most mocks to unit test jobs
* Generate more mocks for main jobs package
* Interface for parser
* Use clients directly without parser
* Regenerate mock
* Eliminate resource clients from Parser
* Interface for folder tree
* first attempt to have info function
* unit test for query modeller
* enable info function in devenv
* fix unit test
* add unit test for info function
* throw error when trying to visualize the info function
* remove visual query support
* Update packages/grafana-prometheus/src/promql.ts
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
* Update packages/grafana-prometheus/src/querybuilder/parsing.test.ts
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
* update info function detail
---------
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
* Separate DryRun into separate method
* Fix linting
* Remove errors
* Remove checks in dualwriter
* Fix unit tests
* Add TODOs
* Dry Run as non-critical error
* Add TODOs
* Address TODO
* Fix tests
* Fix linting
* Deprecate dashboard name from path completely
* Use MissingName error also in parser
* Return 206 for non-critical errors
* Remove TODOs for previous dry-run
* add columns external_id and is_provisioned to the team table
* generate openapi specs
* rename column to external_uid
* generate open api specs
* increase limit for external_uid to 256
* Added config options heading and bumped other heading levels
* Reordered headings and added missing ones
* Nested candlestick options under heading
* Added graph styles and axis content
* Added candlestick options to table
* Refactored and edited candlestick options section
* Replaced shared file with manual tooltip section
* Added missing intro sentences to candlestick options section
* Added a graph styles shared file
* Replaced body text with graph styles shared file in candlestick and time series files
* Added content from time series file to shared axis options file
* replaced shared file in candlestick file with axis content
* Updated option descriptions in axis options shared file
* Updated axis options section of candlestick
* Fixed typos
* Ran prettier
* Replaced some screenshots with higher res, up to date versions
* Wording edits
* Added contributor notes and a missing command
* Fixed typo
* Fixed typo
* Ran prettier
* Removed note from axis options all file
* Renamed axis options file
* Renamed shared file adn updated link in time series page
* Added axix options file and renamed another one, updated links in other files
* Ran prettier
Fix getDataQueryKind to properly detect datasource type from multiple sources
- Add unit tests for the improved function
- Fix typo in schema editor drawer subtitle
* fix: cell inspect + filter at the field level, not defaults
* chore: defensive against missing custom config
* chore: reconfigure tests
* hide inspect block if nothing to show
---------
Co-authored-by: Adela Almasan <adela.almasan@grafana.com>
Co-authored-by: Ihor Yeromin <yeryomin.igor@gmail.com>
* add feature toggle alertingMigrationUI
* wip
* wip
* wip2
* add button to export in alert list and add target folder in the form
* update namings
* protext migration route with alertingMigrationUI feature toggle
* remove unused error style
* add namspace and group filter
* fix translations and prettier
* fix duplication
* use the new endpoint
* update right roles for the FE route
* refactor
* notify success
* address feedback
* fix translations
* Simplify migration UI for alert rules to GMA format
Extracts migration button component and reuses it in banner for better
code organization and consistency.
* Fix root folder check in import alert rules UI
Replace hardcoded empty string check with lodash isEmpty for folder UID
validation
* Add collapsible section for import rule options
* address feedback
* Split useAlertRuleSuggestions, one for labels, and other for namespaces
* refactor splited hooks
* Alerting: (PR review) Redesign slightly + use combobox (#102614)
Redesign slightly + use combobox
* udpate naming
* remove eslint-disable-next-line @grafana/no-untranslated-strings and add hasDataSourcesConfigured as a condition to render the banner
* use button instead of banner
* fix routes
* use new api
* update api
* remove query params
* update translations
* update ff files
* skip subpath when redirecting to the alert list view with filters
* prettier
* disable provenance
* prettier
* Don't send target forlder uid in the payload as undefined if it's not selected
* prettier
* add confirmation modal with a preview
* remove unnecessary export
* Add target datasource UID for recording rules
* Use skipToken
* Add recording rule datasource and update designs
* Use different hook to fetch rulerRules
---------
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
* Enable running a CodeQL check whenever someone opens a PR (for Go code)
* Fetch main in the GHA so CodeQL can properly compare code changes
* Try to fetch more of main to see if CodeQL can compare changes
* Also trigger on push
* Rename GHA
* Use only one workflow for all languages that runs on each puch hook
* Rename GHA
* Removing owner from deleted GHA
* Temporarily mark this GHA as not required for a PR to get merged
* Always run the workflow
* Mark action as non blocking
What is this feature?
This PR fixes a state transition issue where alerts transitioning from the Recovering state back to the Alerting state incorrectly entered the Pending state first if the rule had a For duration configured.
Why do we need this feature?
When an alert goes from Alerting to Recovering (when using the Keep firing for) and then back to Alerting, the existing logic would incorrectly put the alert into Pending state while it should be alerting and still sending notifications to the Alertmanager.
* Add e2e dagger pipeline
* various-suite not various suite
* upload videos dir
* produce e2e videos even on failure
* nil ref
* sync doesn't return container
* fix quotes
* try without flags first?
* try without quoting?
* use two dashes in flags
* update CODEOWNERS
* make update-workspace
* go work sync
* make update-workspace
* add newline
* Support PDC for Influx SQL
* Correctly set the gRPC transport creds dial option
* Logging and refactor
* Allow URLs with no scheme
* Use passthrough resolver for socks proxy
* Update comment
* Extract url parsing and add test
* Check err
* Docs: Create a landing page for SCIM provisioning
* Fix docs warnings
* Update docs/sources/setup-grafana/configure-security/configure-scim-provisioning/_index.md
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
* Update docs/sources/setup-grafana/configure-security/configure-scim-provisioning/_index.md
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
* Apply suggestions from code review
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
* Address some of the feedback and simplify few parts
* Remove repetitive wording
* Don't use possessive form, again
* Address the feedback from PR
* Docs: Manage users and teams via SCIM (#102478)
* Docs: Manage users and teams via SCIM
* Docs: Manage users and teams via SCIM
* Refactor managing users parts
* Add team sync docs
* Update _index.md
* Apply suggestions from code review
Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>
* Clarify how user identity linking is working
* Fix formatting
* Docs: Configure SCIM with Azure and Okta (#102582)
* Docs: Configure SCIM with Azure and Okta
* Apply suggestions from code review
Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
---------
Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
---------
Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>
Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
* Add a warning about migration from team sync
* Remove the SAML setup instructions from SCIM docs
* Update _index.md
* Update _index.md
* Apply suggestions from code review
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: Sarah Constant <sarahleejane@users.noreply.github.com>
* Address PR feedback
* Stop using possessive form
* Add a note mentioning that users/teams can not be manually deleted
* Update _index.md
* Docs: SCIM configuration options (#103085)
* Add a section to clarify how SCIM works with other IdPs
* Update _index.md
* Update _index.md
---------
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>
Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
Co-authored-by: Sarah Constant <sarahleejane@users.noreply.github.com>
Initial support for alerting with SQL expressions
- When `format` is set to `alerting`, SQL expressions output in a format suitable for alerting evaluation.
- Outstanding TODOs:
- Deduplicate output rows
- Add more tests
- Fix broken alerting UI rendering (likely due to shape change to undocumented full-long format)
- Basic usage:
- SQL must return one numeric column and one or more string columns.
- Each row may become an alert.
- The alert fires if the numeric value is non-zero.
- String columns are treated as labels.
---------
Co-authored-by: Konrad Lalik <konradlalik@gmail.com>
Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
Co-authored-by: Sam Jewell <sam.jewell@grafana.com>
This adds more checks on the type of errors returned from InfluxDB fsql
datasource queries. Grpc errors with code `InvalidArgument`, `PermissionDenied`
and `NotFound` are mapped to downstream errors.
* copy paste tab row works
* refactor to hook
* add buttons to canvas
* make i18n
* remove paste from add pane and refactor
* pasting auto grid panel works
* add paste for default grid
* set height/width and postion for auto grid items moving to default grid
* clean up
* Provisioning: Display badge for all manager kinds
* Show the badge for folders
* Fix switch / case syntax to display correct manager kind
Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
---------
Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
Co-authored-by: Igor Suleymanov <igor.suleymanov@grafana.com>
This is more in preparation for the snapshot configuration option,
to avoid having to duplicate the functions that would:
- Find an icon based on resource type
- Find a label based on resource type
Since we use those for other components, I figured we could just
make a helper function to reuse them.
* Convert pkg/apis to a module
* Update apistore module to use apis go module
* Add module to dependabot
* Group go dependencies
* Add guidelines for adding a new gomod
* Prettier
* Only convert apis/folder to a module for now
* Add replace directive
* Add missing go mod
* Record webhook pinged event
* Add TODO for webhook creation updated
* Hack to wire client
* Revert accidental change in controller
* Wire the client
* Use factory method
* Remove omit empty
* Regenerate client
* Fix compilation
* Every 30 seconds if not pinged
* Move lines around
* Use different approach
* Added as part of the controller
* Exponential backoff for waiting for ping
* More stuff
* Revert changes in controller
* Add separate webhook section in overview
* Change order of translations
* Update ping within 1 minute
* Last event update
* Extract translation
* Display last event in frontend
* Refactor the logic around update
* Fix the type to marshal
* Added configuration options heading and bumped other heading levels
* Moved dashboard list options into table
* Further restructured dashboard list options and made wording edits
* Added semantic line breaks
* Replaced screenshot with high res image
* Wording edits
- Add frame type So SQL expressions knows how to convert it
- No FrameType version so how other expressions do not change how they handle it, and continue to catch the special graphite handling in SSE convert
Fixes#100545
Streaming queries/metrics do not work if TLS is enabled and basic auth is not.
"Save & test" while adding/editing a tempo datasource throw `e.data is undefined` in the ui.
Gafana server logs report:
> logger=grafana-apiserver t=2025-02-12T17:55:29.131036665Z level=info msg="[core] [Channel #42 SubChannel #43]grpc:
> addrConn.createTransport failed to connect to {Addr: \"tempo:3200\", ServerName: \"tempo:3200\", }. Err: connection
> error: desc = \"error reading server preface: read tcp 127.0.0.1:55432->127.0.0.1:3200: read: connection reset by
> peer\""
> logger=grafana-apiserver t=2025-02-12T17:55:36.835523455Z level=info msg="[core] [Channel #31 SubChannel #32]grpc:
> addrConn.createTransport failed to connect to {Addr: \"tempo:3200\", ServerName: > \"tempo:3200\", }. Err: connection
> error: desc = \"error reading server preface: EOF\""
Fix by using TLS when enabled regardless of basic auth settings.
Co-authored-by: André Pereira <adrapereira@gmail.com>
* NestedFoldeList: remove nested folder dupe during save
* Change solution for loading/pending check in useFoldersQuery
* moved pending string to constant
* Moved last page loading logic to proper func
* Updated comment to reflect func changes
* Add group actions menu
* Refactor modals to accept raw ruler group
* Use prometheus and ruler responses to dispaly GMA rules in the hierarchical view
* Add groups loader component for data source managed rules
* Improve rules matching algorithm for the search results
* Use plus and minus icons for reconciliation state
* loading spinner WIP for operations / transactions
* update comment
* Use ruler rules order when displaying a group, change rurler preload behaviour
* Add ruler-based ordering for GMA rules
* Refactor ruler API mocking
* Refactor rule components to accept ruler only rules
* Add tests for GrafanaGroupLoader
* Add tests for vanilla prom groups
* Unify data matching code, add tests for DS groups loader
* Fix errors after rebasing
* Improve handling of ruler group absence
* Fix cache key
* Add group action buttons for the new group pages
* Add new rule action buttons to the new list page
* Address PR feeback, component renaming, missing translations
* Unify groups and rules links and actions
* Fix new rule button
* Add rule list action buttons tests
* Fix lint errors
* Add redirect to rule details page on save
* Update FilterView tests
* Fix imports and remove unused code
* Improve type definitions, add pooling to Prom hooks, add inline docs
* Remove unused code of group modals
* Update translations
* Disable cache population for filter-view generators
* Add consistency check Alert to the RuleViewer when V2 list is enabled
* Disable UI errors in prom generator
* Improve missing datasouce handling
* Add missing translations
* Improve group loader tests, remove unused code
* Enhance Prometheus API query to include notification options
* Improve error handling, remove consistency check for vanilla prom data sources
* Address PR feedback, add new version of the useHasRuler hook
---------
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
* feat(Extensions): expose an observable API for added links and components
* refactor: make `getObservablePluginExtensions()` more RxJS style
* refactor(getPluginExtensions): remove unnecessary types
* fix(getPluginExtensions): remove unused imports
* Apply suggestions from code review
Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
* refactor(getPluginExtensions): stop using `shareReply()`
* fix(grafana-runtime/extensions): typo in error messages
---------
Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
* fix: mark `exploreMetricsUseExternalAppPlugin` as not frontend-only
* docs: explicitly show feature toggle in docs
* Revert "docs: explicitly show feature toggle in docs"
This reverts commit 292ce7f7e8.
* Added config options section and bumped heading levels
* Added level offset
* Restructured Status history options and removed screenshot from Value mappings section
* Replaced screenshot and updated example text
* Fixed heading level in legend options 2 shared file
* Initial API client for ScopesNavigation
* Display scopes navigation items and group them
* Remove refactored component
* Fix link highlighting
* Underline on focus
* Set icons based un URL path
* Remove explicit icon names
* Add links to copy
* Map dashboardbinding to scopeNavigation in folder generation
* Consolidate dashboardbindings and scopenavigations to a single way of handling
* Let fetchDashboards handle all fetching
* Move endpoint types to core
* Remove comments
* Fix import
* Rename name to id
* Update translation
* Add feature toggle
* Fix tests
* Fix go.mod for some reason
---------
Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
* Added Config options section, bumped heading levels, added missing options, and restructured Text options section
* Moved variables content
* Replaced screenshot
* Moved sentence
* Used previous wording
* test commit
* Revert test commit
* Ran prettier
* Unified Storage: Don't read before create
* test: use the existing test infra
* fix: support pq
We use pgx, but it seems to be wrapped in a pq driver shim, causing the errors to be remapped to pq's type. Weird
situation.
* feat: support CDK backend
* revert: there is a postgres_tests block
* fix(CDK): only check existence on ADDED updates
* fix(CDK): use ReadResource to deal with deleted files
* Move to new repository
* Rename it to dual writer
* Rename the function
* Rename the methods
* Rename to exportResource
* Clean up logic in migrate and add TODOs
* Add TODOs
* Use generic client for unprovisioned
* ForEachResource
* More consolidation
* Refactor more around client
* Consolidate constants
* ForEachFolder
* More use of constants
* Add FIXME notes
* Use more constant
* Remove Dashboard
* Pass tree to folder manager
* Replicate tree
* Reduce export complexity
* More refactoring
* Use the ForEach for loading users
* Limit in-memory folders
* Isolate the object
* Improve the export function
* Move resources to resources package
* Move delete operation
* Move more logic
* More consolidation
* More renaming
* Fix more issues
* Ensure path exists when created a resource
* Simply append error
* Fix receiver lint issue
* Fix cyclomatic complexity
* Fix linting
* Remove folder path creation
* Improve data source error message when stackID
* Update comment
* Revert "Update comment"
This reverts commit 48922bc552.
* Revert "Improve data source error message when stackID"
This reverts commit 4bf0a2f7b7.
* Make public messagic configurable based on context
* Update, simplify
* Update
* Update getting stack
* Update pkg/plugins/errors.go
Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
* Refactor test to test for when context has stack value
* Remove duplicated test
* Fix error checking logic
---------
Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
* implement sorting
* swagger gen
* minor fixes
* clean up param reading
* add todo
* add errors only prop
* codegen stuff
* fix copy paste error
* forgot the api gen
* cleanup
* remove tests that are obe
* fix test
* fixes: sort persistence, sort trigger panel dirty state, use field display names
* fix: for nested tables, use column.name for header text
* chore: fix location of cache display names
* Create ListByIdOrUID in user service
* create UnstructuredToLegacyFolderList
* update GetFolders to use list parser
* update GetDescendants to use list parser
* update UnstructuredToLegacyFolder to also make a single call to the user service
---------
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
* Tracing: chore: make insecure option configurable
In case of insecure set to false, default system cert pool will be used to create otlpgrpc client.
* test: add tracing/insecure config checks
This is to verify whether insecure configuration is properly parsed.
* chore: update configura Grafana docs with new setting
* chore: also update comment in the ini files
---------
Co-authored-by: Matheus Macabu <macabu.matheus@gmail.com>
* Dashboard: Scroll element into view when selecting from outline
* fix import
* Switch to tab when selected via outline
* Update
---------
Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com>
* placeholder commit
* Complete function in api_convert_prometheus.go
* MVP before extensive testing
* Cleanup
* Updated tests
* cleanup
* Fix random logs and lint
* Remove comment
* Fix errors after rebase
* Update test
* Update swagger
* swagger
* Refactor to accept groups in body
* Fix auth tests and some cleanup
* Some cleanup before refactoring
* Remove unnecessary fields
* Also refactor RouteConvertPrometheusPostRuleGroup
* Remove unused code
* Rebase + cleanup
* Update authorization_test
* address comments
* Regen swagger files
* Remove namespace and group filters
* Final comments
* Dashboard: Only auto focus new objects
* fix outline issue
* Also set isNew when adding row below/above and tab before/after
---------
Co-authored-by: oscarkilhed <oscar.kilhed@grafana.com>
* add column guid to alert rule table and rule_guid to rule version table
+ populate the new field with UUID
* update storage and domain models
* patch GUID
* ignore GUID in fingerprint tests
* get alert rule versions by GUID
* update rule delete to reset uid in history instead of deleting rows
* add test
* Update delete rule to require UserUID, remove all versions and create "delete" version
that holds information about who and when deleted the rule
* update usages of the delete method
* add list deleted rules to store
* list api to support deleted query parameter
* add list deleted rules to store
^ Conflicts:
^ pkg/services/ngalert/store/alert_rule_test.go
* list api to support deleted query parameter
* Restore deleted rules
* fix recovering manually recording rules
* update role control for the trash route
* add alertingRuleRecoverDeleted feature toggle enabled by default
* fix access control for trash menu item in the navtree
* Add alertingRuleRecoverDeleted feature toggle,
add Delete permanently alert rule menu option
* hide remove permanently functionality in the UI until we have the api available for it
* discard wrong changes after merging
* Reverted changes in pkg/apis/dashboard_manifest.go after fixing conflicts
* Reverted changes in go.work.sum after fixing conflicts
* Reverted changes in pkg/apis/dashboard_manifest.go after fixing conflicts
* Reverted changes in pkg/services/ngalert/models/alert_rule.go after fixing conflicts
* Reverted changes in pkg/apis/dashboard_manifest.go after fixing conflicts
* restore delete permanently and add the queryparam for it
* update snapshots
* fix translations
* protect trash route by the feature toggles
* use the new rulerRuleType for checks
* revert ability to delete permanently and alert rule from the ui
* remove unnecessary update after reverting
* fix ff
* add tracking
* use recently deleted instead of trash
* create isRecoverDeletedRulesEnabled for checking ffs
* address pr feedback 1
* include alert rule uid in getRowId
* use RulerGrafanaRulesConfigDTO for deleted rules response
* use isLoading in the AlertingPageWrapper
* fix wrong check for recording rules type
* add test for restoring manually through the alert rule form
* add test for restoring deleted rule
* use importAlertingComponent
* udpate mock
* address pr feedback
* update translations
* address feedback
* address feedback 2
* address feedback 3
* address feedback 4
* move transformation of the response to the endpoint
* fix typo
* refactor grafanaRuleDtoToFormValues
* update translations
* use guid for identifying rows
* prettier
* use ONLY the guid for identifying rows
* Add provides/invalidates tags for deleted rules
---------
Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
We should not write after the context is cancelled. This causes tests to fail as they are trying to clean up. To try to
accommodate this, we'll need to listen to the context in any loop where we don't immediately get other instructions from
e.g. trying to do an HTTP request.
* SQL Expressions: Add Null-literal node
* Retain some order in the code - put NullVal with BoolVal
* Add support for `IN` keyword
* Add GROUP_CONCAT keyword
* Add COLLATE keyword
From Claude:
The test case demonstrates a simple use of COLLATE with a string
literal, but in real MySQL queries, COLLATE is often used in more
complex scenarios like:
1. String comparisons:
`SELECT * FROM table WHERE name COLLATE utf8mb4_bin = 'John'`
2. Sorting:
`SELECT * FROM table ORDER BY name COLLATE utf8mb4_unicode_ci`
3. JOINs:
`SELECT * FROM table1 JOIN table2 ON table1.name COLLATE utf8mb4_bin = table2.name`
The COLLATE clause is particularly useful when you need case-sensitive
comparisons (utf8mb4_bin) or specific language-aware sorting rules.
* CI: Allow Bench conversion to fail
We shouldn't mark PRs and commits as X if they fail to convert logs with Bench.
* Fix: Prints should always include new lines
* fix: remove unused import
* docs: add note about alert migration
added note about alert migration in 11.6.0.
* docs: add note about alert migration
adding documentation about the migrations to the performance limitation docs
* title edit
<-- vale = NO -->
* remove feature flag alertingAlertmanagerExtraDedupStage
* use most recent version of fork of alertmanager
---------
Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
* Create basic logic for stateless variables
* Refactor function to get DS from queries and variables
* Simplify code, remove unnecessary wrappers
* Fix typo
* improve naming
* Add unit test for variables
* Fix tests
* Add extra logic to keep backwards compatibility, variables can be used without dashboard scene
* Adjust logic for variables ds
* Refactor code, pass dsReferenceMap
* Fix CodeQL warnings
* Also validate if path is a file above the safe dir
* Lint
* [REVIEW] reduce possibility of exploits
* Comment
* Remove test scenario
* FlameGraph: Added units standard option (#89815)
* FlameGraph: Added decimals, and cleaned up module plugin configuration
* Added missing colon
Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
---------
Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
* Unified Storage: Return an already exists error
When inserting a resource that already exists (i.e. race condition), we can safely catch UNIQUE constraint violations
and transform them into a `k8s.io/apimachinery/pkg/api/errors` error that stands the test of `errors.IsAlreadyExists`.
* feat: clarify existing conflict error
* chore: make update-workspace
* feat: make new package for backend error
* fix: assign dependency owner
* feat: use dialect for checking error type
* chore: go generate
* revert: to 5af369166d
To receive this bug-fix:
- https://github.com/dolthub/go-mysql-server/pull/2853
Which merged to main on Feb 17th 2025
I picked a commit on `main` from March 19th 2025:
```console
go get github.com/dolthub/go-mysql-server@8c915e51131f1e867ad873f8e827abf858d65dce/testdata
```
Then
```
make run
```
* Add behavior for hidden
* Rename to IsFilePathSupported
* Modify sync
* Revert renaming
* Fix the tests
* Add more tests
* Maintain empty folders until next full pulling
* Fix wording
* Consider the file as ignored
* Handle folder creation in sync
* Record folder creation / update
* Fix in manual test
* Ensure / slash for folders
* Refactor the tests
* Keep safe path
* Fix some cases
* Remove log lines
What is this feature?
A follow-up for #101184, adds AlertRule.MissingSeriesEvalsToResolve to the APIs.
missing_series_evals_to_resolve must be specified too and it must be > 0.
POST /api/ruler/grafana/api/v1/rules/{folderUID} works in the following way:
If missing_series_evals_to_resolve is not sent or null, the rule keeps its existing value
If missing_series_evals_to_resolve > 0: updates to that value
If missing_series_evals_to_resolve = 0: resets to default (nil).
AlertRule.MissingSeriesEvalsToResolve can't be 0, so I used it to reset
In the Provisioning API, the value is just set if present and > 0. Otherwise it's reset:
PUT to /api/v1/provisioning/alert-rules/{UID}:
If missing_series_evals_to_resolve is nil, it's reset to the default value
If missing_series_evals_to_resolve > 0, it's updated
InfluxDB Flux queries can return a http.Error type that we can use to
assign errorsource to.
This PR checks for that type of error, and uses our errorsource
machinery to assign an errorsource.
This is part of https://github.com/grafana/data-sources/issues/377
What is this feature?
Prometheus conversion: ensures that AlertRule.Data queries always have default parameters set (intervalMs, maxDataPoints). Without this, updates of the same rule can cause version increments.
Why do we need this feature?
Currently, when converting Prometheus rules to Grafana alerts, some default parameters are not explicitly set in the query model. This creates a problem during rule updates:
When a user updates a rule that hasn't changed, we still detect differences in the AlertQuery.Model because the newly converted rules are missing the default fields, such as intervalMs and maxDataPoints. This causes unnecessary version increments of alert rules.
What is this feature?
This PR changes the behavior of the $value and .Value variables in alerting templating to be more compatible with Prometheus templating. When a single datasource is used in the alerting rule, these variables will now return the numeric value from the query instead of the evaluation string.
Why do we need this feature?
It makes Grafana templating more compatible with Prometheus templates. In Prometheus, $value returns the numeric value of the query, but in Grafana it's the evaluation string: [ var='A' labels={instance=instance1} value=81.234 ]. This is because in Grafana multiple datasources can be used in the alert rule, and it's not always possible to get a single value.
This change makes Grafana's behavior consistent with Prometheus when a single datasource is used, and in case when multiple datasources are used in the query, it keeps the old behaviour.
Both $value and .Value are not recommended to use (documentation), and it's better to use .Values instead.
* Add `recordingRulesEnabled` to grafanaBootData
* Check for recording rules being enabled, as well as feature toggle
* Remove unnecessary config line
* Move recording rules check to featureToggles file
* Update NoRulesCTA.tsx
* Update dashboard app to use app SDK v0.35.0
What
This change updates dashboard app to use app SDK v0.35.0 and adds new
Makefile target for running codegen for all apps, in opt-in manner.
Currently only dashboards app is opted in.
Additionally, this changes dashboard app Makefile to properly install
and update app SDK versions when generating code, with app SDK version
pinned in the Makefile itself.
Why
The upgrade addresses issues with `DeepCopy` methods, while the Makefile
targets ensure that codegen is easy to run and uses reproducible
environments.
Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
* Run make update-workspace
Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
* Fix deepcopy methods
Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
* Re-run CUE codegen to satisfy the CI
Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
* Run make update-workspace
Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
* Update to v0.35.1
Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
---------
Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
* Added Config options heading and bumped heading levels
* Added empty Text size options section and updated Value options
* Updated bar gauge section
* Added missing options and removed screenshot
* Fixed Bar gauge options
* Added descriptions for Text size section
* Added links to text size section
* Fixed text size section
* feat: align frontend more with designs
* feat: remove unnecessary fields
* chore: remove imports
* chore: move imports
* fix: make label not spit out undefined
* feat: update title of nav item
* chore: make update-workspace
* fix: don't wrap text with span unless required
---------
Co-authored-by: Roberto Jimenez Sanchez <roberto.jimenez@grafana.com>
* auto markup users/variables/visualization features
* mark up transformers feature
* betterer + translations
* markup trails
* mark up service accounts + translations + betterer
* undo ServiceAccountProfileRow change for now
* dedupe a little
* fix: go git migration should pretend the path is the repo root
The migration was broken due to its having the path already in the repository, then adding it once more. This now
pretends the path is the repository root as intended.
* chore: remove test log
* fix: reduce permissions of directory
* chore: make update-workspace
* refactor(frontend): rename all @grafana/data/src imports to @grafana/data
* feat(grafana-data): introduce internal entrypoint for sharing code only with grafana
* feat(grafana-data): add test entrypoint for data test utils usage in core
* refactor(frontend): update import paths to use grafana/data exports entrypoints
* docs(grafana-data): update comment in internal/index.ts
* refactor(frontend): prefer public namespaced exports over re-exporting via internal
* chore(frontend): fix a couple more weird paths that typescript complains about
* Provisioning: Gracefully handle AlreadyExists errors
When this occurs, the job is already in the store. The vast majority of use-cases (which currently is all of them!) will
be fine with just accepting that as an OK.
* chore: make update-workspace
* fix: return error, but expect it in tests
* Add json mapping for user.isProvisioned
* Retrieve the isProvisioned value from database
* Add a Provisioned label to pages that list users
* Update swagger definitions
* Add changes to User Admin pages
* [Provisioning] Pay back some technical debt (#100720)
* Handle pagination in github client
* Add some unit test coverage
* Remove unknown repository
* Remove unknown leftover
* Revert "Add some unit test coverage"
This reverts commit 420c9674d2.
* Revert "Revert "Add some unit test coverage""
This reverts commit f7eca41957.
* Revert unit tests in github package
* Remove S3 case as it's now deprecated
* [Provisioning] Consolidate job status report in JobProgressRecorder (#100718)
* Log also successful operation
* Consolidate stop logic under TooManyErrors
* Use error for TooManyErrors
* Pass the progress recorder
* Define JobProgressRecorder interface
* Do not expect workers to return status
* Remove scenarios due to pointers
* Use recorder to manage the entire state
* Provisioning: Support rotating secrets (#100705)
* Provisioning: Refactor webhook to another interface (#100733)
* POC/Provisioning: Remove S3 references (#100734)
* Remove unused script
* Remove s3 references
* Provisioning: Keep the existing k8s name if it is specified in metadata (#100672)
* keep name
* keep name
* Revert "keep name"
This reverts commit 29f87bcaeb.
* Commit stale go.mod
* Keep name also for sync deletions
---------
Co-authored-by: Roberto Jimenez Sanchez <roberto.jimenez@grafana.com>
* Update preview banner copy
* Query Library: Move backend to enterprise (#100371)
* Fix wire
* Fix jobs table re-renders
* Provisioning: Refactor history to its own interface (#100735)
* Provisioning: Refactor history to its own interface
* refactor: use VersionedRepository
* Update API
* Provisioning: Test the GitHub client directly (#100808)
* Provisioning: Test the GitHub client directly
Instead of mocking the abstracted client, test it as well by mocking the underlying GitHub client. This also lets us
remove the mock for the abstracted client.
* refactor: move out helpers
* chore: set dependency owner
* Provisioning: Better clone/push error support (#100854)
* Provisioning: Replace searcher with one that knows about modes (#100857)
* Provisioning: Start in "mode5" when nothing exists in legacy (#100862)
* [Provisioning] Fix duplicate sync jobs triggered in controller (#100870)
* Improve logging on reasons why the controller triggered
* Fix messaging for sync job
* fix lint
* Provisioning: Move legacy export/import into a single migrate job (#100865)
* [Provisioning] Miscellanenous bug fixes and improvements (#100976)
* Error if found duplicate ID
* Fix issue with manual test button
* Fix issue with health errors not going away
* Display status in sync overview
* Use patch operations instead
* Trigger sync job after status update
* Convert Export Tab into modal
* Remove unused FieldSet import
* Only last 8 jobs
* Remove Links card
* Use button for Github Source Code
* Add actions to resources page
* Add resource column to Repository Resources
* Display Job Spec in RecentJobs
* Display dates in history page
* Display Avatar if available
* Improve styling of the avatar
* Update betterer
* Remove duplicate history header in history
* Commit betterer
* Address code styling issues
* update flags
* github v69
* v69
* POC/Provisioning: Add wizard (#100596)
* Chore: make update-workspace
* Chore: Fix lints (#101039)
* Provisioning: Workflows as write access (#101031)
* workflow as write access
* workflow as write access
* workflow as write access
* Update pkg/registry/apis/provisioning/repository/test.go
Co-authored-by: Mariell Hoversholm <mariell.hoversholm@grafana.com>
* POC/Provisioning: Add wizard (#100596)
* update refs
* update refs
* lint fix
* lint fix
* lint fix
* default everythign to read only
* reuse form components
* remove main
---------
Co-authored-by: Mariell Hoversholm <mariell.hoversholm@grafana.com>
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
* merge main
* Fix workflow types
* Betterer
* [Provisioning] Fix webhook and finalizer issues (#101052)
Fix webhook and finalizer issue
The maximum number of webhooks per repository is 20
* [Provisioning] Fix issue with last ref (#101056)
* Fix issue with last ref
* Update frontend code
* Fix the local tmp test
* Use lastRef
* POC/Provisioning: Simplify connect step (#101064)
* Fix sending workflows
* Use write for local
* Move connect action to the next step
* Remove wizard props
* Typo
* Redirect to wizard
* Show repo link after successful export
* Provisioning: Avoid starting sync jobs when using legacy storage (#101114)
* avoid starting sync jobs on legacy
* newlines
* Provisioning: Onboarding landing page (#101112)
* add landing page before wizard
* Update onboarding page
* Update URL
* Remove unused
* Add deleteAll button
* Improved text
* betterer
---------
Co-authored-by: Clarity-89 <homes89@ukr.net>
* Provisioning: use the sync job to finish the migrate job (#101107)
* Provisioning: Show progress more often (#101128)
* show progress bar earlier
* show progress bar earlier
* update wording to be less specific
* POC/Provisioning: Enable sync (#101131)
* update preview banner
* actualy remove and don't crash without provisioning flag
* Update db banner
* Provisioning: Export oldest items first (#101189)
* Provisioning: better branch handling (#101188)
* add missing file
* Provisioning: Fix tests (#101197)
* Provisioning: Refactor tests to be multiple functions
* Provisioning: Fix tests
* fix: make github-example sync
* fix misspell
* Provisioning: avoid migration wizard if things are already in unified storage (#101204)
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
* more lint
* POC/Provisioning: Handle connect step errors (#101192)
* Provisioning: Unify status handling in repository and migrate steps
* Refactor: Move WorkflowsField outside RepositoryStep and use proper type
* Refactor: Improve repository verification error handling and UI
* Refactor: Simplify repository verification error handling
* Refactor: Simplify RepositoryStep component structure
* Refactor: Improve error handling in RepositoryStep
* Refactor: Remove redundant repository creation logic from ProvisioningWizard
* Refactor: Simplify RequestErrorAlert component
* show github error
* now will verify
* test .git
* recover from bad config
* Update error handling
* Remove unused prop
* merge upstream
* Show migration summary
* Update text
* Improve text
* Betterer
* [Provisioning] Review controller changes (#101216)
* Review health check conditions
* Move down the logic to set up the sync status
* Skip if it's only a health check rerun
* Fix health check conditions
* Preserve last ref
* Format code
* Rename to shouldSkipSync
---------
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: Roberto Jiménez Sánchez <roberto.jimenez@grafana.com>
* fix promotion step
* In the promotion pipeline, publish should depend on build
* fix promotion pipeline
* [Provisioning] Use smaller methods to process repository events (#101240)
* update codegen
* merge main
* Provisioning: Avoid localhost error loop (#101253)
* Provisioning: Update the recent jobs formatting (#101250)
format history
* [Provisioning] Refactor Pull Request & Lint worker (#101273)
* Refactor the code
* Refactor into separate files
* Consolidate linter flag in one spot
* Use global feature flags
* Commit betterer
* Remove from JSON the intermidiate flag
* Use again spec
* Clean up
* Revert changes in test
* POC/Provisioning: Remove sync confirm modal (#101281)
* [Provisioning] Remove linting from MVP (#101286)
* Remove Linting backend
* Re-generate client
* POC/Provisioning: Unify tags (#101218)
* Unify tags
* add both tags
* add tag types
* Check for the redirect only once
* Add fetch settings with delay hook
* Refetch settings
* Split hooks into separate files
* Cleanup
* Prettier
* Prettier
* Remove lint code
* Betterer
---------
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* Provisioning: Update token instructions (#101280)
* Provisioning: Use blob storage rather than local file system to save images (#101298)
* [Provisioning] Add more explicit setup warnings if webhook integration and image rendering are disabled (#101304)
* Setup warnings if renders or webhooks are not possible
* Improve display
* Use a single Alert
* Make design more compact
* Only display local config is missing critical feature toggles
* Improve styling of required flags
* Add file name to the custom ini itself
* Add copy button
* Add FeatureSection Component
* Commit betterer
* Use an interactive table
* Use a modal for instructions
* Use the same modal for example config
* Improve setup steps
* Improve stepper
* Copy code ctrl + c
* Make it more compact
* Select feature to enable
* Improve the height of alerts
* Separate components
* Better warnings
* Improve the page
* Improve the cards
* Improve cards even more
* Improve cards
* Improve cards
* Optional copy in code block
* Add side bar with steps
* Improve styling
* Style modal
* Clean up Code
* Remove index file
* Simplify Step Component
* Commit betterer
* Simplify components
* Use CodeEditor and Clipboard components
* Do not show scrollback on minimum size
* Fix positioning of footer
* Separate Component for Feature
* Use different styling
* Commit betterer
* Use more Grafana components in the FeatureCard
* Separate sidebar into own components
* Simplify sidebar code
* Commit betterer
* Remove connector
* Simplify styling further
* Use cards
* Improve code
* Use more grafana component in InstructionsModal
* Further simplify
* Simplify the code
* Simplify style
* Clean up
* Simplify the Wizard
* Use little icons
* Improve feature cards
* Improve cards
* Commit betterer
* Add description to feature setup
* Improve instructions for snapshot preview
* Move all files into Setup folder
* Commit betterer
* Clean up the warnings code
* Improve coding
* Move sidebar item to separate fiel
* Rename components
* Fix issues
* Use stack instead
* Improve style
* Don't show setup button if configured already
* Simplify again CSS
* Use secondary actions
* Style a bit more
* Improve wording
* Update warning
* Refer to docs in Image Renderer
* More clean up
* Revert changes in generated client
* Fix typos and imports
* Fix lint errors
* Provisioning: better error support (#101490)
* update openapi snapshot
* fix build
* Provisioning: Only show setup page when feature toggles are missing (#101502)
* form fixing
* form fixing
* always send UID
* Same onboarding page regarless of migration (#101557)
* backend building... frontend still broken
* rename sync with main
* Provisioning: Update dashboard badge (#101599)
* Rename to push / pull everything user-facing (#101577)
* Rename to push / pull all everything user-facing
* Use automatic pulling wording
* Provisioning: Migrate when using unified storage (#101572)
* migrate when not unified
* Update pkg/registry/apis/provisioning/register.go
Co-authored-by: Roberto Jiménez Sánchez <roberto.jimenez@grafana.com>
* variables
* merge main
---------
Co-authored-by: Roberto Jiménez Sánchez <roberto.jimenez@grafana.com>
* Add tabs and features tab to listing page (#101570)
* List features in onboarding page (#101558)
* merge main
* POC/Provisioning: Check if the instance is provisioned (#101601)
* Check if the instance is provisioned
* Fix lints
* Fix getting config for new dashboard
* Fixes after merge
* More fixes
* Show success message
* Fix default value
* Add test
* Fix lints
* Provisioning: Include URLs in ResourceWrapper response (#101511)
* Convert Migrate wizard into a Connection Wizard (#101575)
* Convert Migrate wizard into a Connection Wizard
* Remove duplicate empty state
* Allow users to select target in the first step
* Remove file created by merge
* Select target based on existing connections
* Default option for targets and explainatory alert
* Do not display connect button if single connection
* Display target as tag in repository card
* Add Pull Step
* Fix linting
* User decides if migrate or connect
* Improve style based based on review
* Provisioning: Return upsert resource when writing (#101574)
* [Provisioning] Getting Started Page and Tab (#101701)
* merge main
* fix go.mod
* Provisioning: Redirect to the new URL after save (#101757)
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
* POC/Provisioning: create folder (#101619)
* Add NewProvisionedFolderForm
* Cleanup
* Add folder api
* Register API
* Do not show provisioned badge for instances
* Enable saving
* Show saved alert
* Fixes
* Fix deps
* Cleanup
* Add test
* Add test
* Updates
* Fix test
* Fix import
* [Provisioning] Display instance connection directly in home (#101720)
* Show tabs directly in home page for instance sync
* Display actions also in the home page
* Add delete button to actions
* Fix issue with files tab
* Display tabs also in instant sync
* Generate connection name for instance sync
* Fix issues when no repositories
* Set active tab
* Remove leftover
* Rename component for listing folder repository
* Fix linting issues
* Fix merge error
* Rename to HomePage
* Split folder list into separate component
* Create own component for repository card
* Improve RepositoryCard readability
* Improve RepositoryCard styling
* Make view primary button
* Fix syntax
* Fix generateName
* merge main
* Provisioning: Move folder management into its own helper (#101864)
* folder
* update folder links
* Fix test
* update
* cleanup
---------
Co-authored-by: Clarity-89 <homes89@ukr.net>
* fixed folder issue
* POC/Provisioning: Create folder from root (#101921)
* Enable creating folder at the root
* Fix test
* Add interceptor
* Provisioning: Expose stats (#101927)
* [Provisioning] Unified onboarding wizard (#101952)
* Spike the solution
* More work
* Add more situations
* Attempt to display count of dashboards and folders
* Attempt with file count
* Do not display options if not possible
* Improve styling resources
* Use another API
* Fix issue with selection
* Style a bit
* Fix more issues
* Make the sync step work
* Improve links
* Use LinkButton
* Start pull automatically
* Start migration automatically
* Fix issue with options
* Fix issues
* Fix loading error
* Improve more things
* Improve styling
* Improve messaging
* Set the autofocus
* Fix some issues
* Fix issue with disabled options
* Only resources
* Finish settings depending on configuration
* Move title to wizard
* Fix title
* Improve styling
* Badge
* Explain on hover
* Improve styling
* Disabled at the bottom
* History & identifiers
* Improve wording
* Add padding left and right disable options
* Delete repository
* Improve buttons
* Give index time to catch up
* Improve buttons
* Handle steps with only forms
* Fix issue with initial migrate or pull
* Commit betterer
* Error messages
* Use memo
* Revampt that a bit
* Attempt to simplify the state and components
* Improve the component for Migrate
* Commit betterer
* Fix issue in next button
* Clean up more
* Start for boostrap step
* Fix issue with running status
* Fix issue with loading bootstrapping
* Improve loading
* Improve more the loading
* Fix issue with loading
* Empty tree
* Handle error
* Fix issue with looping
* Remove commented out lines
* Add comment
* Remove accidental file
* Fix imports
* Improve MigrateStep and PullStep
* Use hook for step status
* JobStep component
* Refactor data fetching
* Validate with Github
* Fix issue with failed error
* Fix next on success
* Address small comments
* Separate file for WizardContent
* Fix linting
* Use step approach also for bootstrap
* Make the logic for moving between steps clearer
* Fix navigation issue
* Clean up some logic
* Use useAsync for JobStep steps
* Revert "Use useAsync for JobStep steps"
This reverts commit 242a275cc9.
* Provisioning: use service to get counts (#101972)
counts
* must migrate when using legacy storage
* Revert "Revert "Use useAsync for JobStep steps""
This reverts commit a420d0ac36.
* Fix async conditions
* Organize imports
* Separate component for BootstrapOptionCard
* BootstrapOptionsList
* Remove duplicate definitions
---------
Co-authored-by: Clarity-89 <homes89@ukr.net>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* Merge
* Fix utils
* POC/Provisioning: Fix folder path for dashboard (#101997)
* Provisioning: Fix folder path for dashboards
* Fix isNew
* Update test
* Fix any error
* Betterer
* [Provisioning] Improve progress recording and updates (#102035)
* do not validate on delete
* Provisioning: Implement authorizer for remaining resources (#101945)
* feat: implement authorizer for remaining resources
* fix: don't allow viewers to write files
* security: harden blob id fetching
* add integration test for admin vs viewer
* feat: only Get is a valid verb for reads in our subresources
Co-Authored-By: Ryan McKinley <ryantxu@gmail.com>
* feat: allow render for all requests
* refactor: use guards
Not changing code that goes `if a { } else if b { } else { }` as the semantic meaning of the different branches is
easier to parse.
---------
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* POC/Provisioning: Improve wizard setup (#102066)
* wizard actions
* workign better
* remove more memo
* show polling interval
* cleanup
* finalizers
* Update public/app/features/provisioning/Wizard/BootstrapStep.tsx
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
* Update public/app/features/provisioning/Wizard/BootstrapStep.tsx
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
* Update public/app/features/provisioning/Wizard/BootstrapStep.tsx
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
* Update public/app/features/provisioning/Wizard/BootstrapStep.tsx
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
* Update public/app/features/provisioning/Wizard/BootstrapStep.tsx
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
* Update public/app/features/provisioning/Wizard/WizardContent.tsx
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
* Update public/app/features/provisioning/Wizard/WizardContent.tsx
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
* Update public/app/features/provisioning/Wizard/BootstrapStep.tsx
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
* updates from alex
* updates from alex
* Simplify actions
* Extract props
* history supported form legacy only (for now)
* More refactor
* change order
* Fix cleanup finalizer
* show kinds
* fix lint
---------
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
Co-authored-by: Clarity-89 <homes89@ukr.net>
Co-authored-by: Roberto Jimenez Sanchez <roberto.jimenez@grafana.com>
* Fix resource condition (#102086)
* Fix job summary stats issue (#102084)
* merge main
* Repository link should point to configured branch (#102092)
* Add getRepoHref
* Fix random string generation
* Redirect to Home on repository deletion (#102096)
* Fix extra commas in pull request comment (#102108)
* Fix image rendering endpoint (#102107)
* POC/Provisioning: Support migrate... when starting with unified storage (#102097)
* use same clone
* now using upsert
* Fix lint
---------
Co-authored-by: Roberto Jimenez Sanchez <roberto.jimenez@grafana.com>
* Clean up unprovisioned resources after unified storage migration (#102126)
* Clean up unprovisioned resources after migrate
* Clean up unprovisioned resources after migrate
* Update pkg/registry/apis/provisioning/jobs/migrate/resources.go
* Reset summary between export and pull (#102101)
* Reset summary between export and pull
* Add reset results to unified storage migration
* Provisioning: always dirty (#102151)
* fix test version
* log the watch line
* POC/Provisioning: Disable repository list watch (#102169)
* Disable watch for repo list endpoint
* Add comment
* Remove another watch
* Provisioning: Avoid calling test on every update (#102161)
test less often
* Provisioning: Support prefixes in GitHub repositories (#101969)
* feat: add a Prefix property to GitHub repo spec
* feat: make nested folders work properly
* feat: use subdir for go-git export
* fix: placeholder for prefix should be grafana/
* feat: rename prefix to path
* fix: json name should be path, too
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* chore: regen apis
* fix: copy 'path'
---------
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* Merge
* Fix duplicate type
* Provisioning: Test export functionality (#101336)
* Provisioning: Test export functionality
* fix: use context.Background
* test: add more cases for local repo path resolving
* test: rework test inputs
* test: try to make github test work
* fix: clear global state
* Update api client imports
* Fix import
* Fix test
* Update codegen
* Provisioning: Make it green (#102271)
* chore: remove unused functions
* chore: update betterer results
* chore: update openapi spec
* chore: yarn generate-apis
* fix: specify default false if undefined
* Use AnnoKeyManagerIdentity
* Add manager kind
* POC/Provisioning: Update component structure (#102297)
* Update project structure
* Update imports
* Remove unused components
* Copy fixes
* Typo
* More copy fixes
* Betterer
* Update test
* merge main
* Provisioning: Replace hardcoded clients with discovery client (#101918)
* disco client
* discovery client
* merge main
* merge main
* keep factory
* keep factory
* find preffered version for delete factory
* use same folders request
* merge main
* with integration test
* POC/Provisioning: Compare spec in test rather than raw JSON (#102352)
* compare spec not json
* compare spec not json
* [Provisioning] Add in-code TODOs in API Server area (#102360)
* Add TODOs for files endpoint
* Add TODO history endpoint
* Add TODO to move files logic to resource package
* Add TODO to not use private fields directly
* Remove unnecessary checks in list connector
* Add pagination TODO in lister
* Add TODO to rename resources
* Add todo about cloning too early
* Add TODO to propose to merge sync and migrate endpoints
* Add TODOs in register
* Add more TODOs in connectors & routes
* Add TODOs about prefix
* Change it to remove
* Update pkg/registry/apis/provisioning/test.go
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
---------
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* POC/Provisioning: Switch folders to use managedBy (#102362)
* Folders: Switch to managedBy
* Fix create folder
* Fix tests
* Do not allow changing folder from dashboard settings
* Update imports
* Update provisioned meta
* Do not show provisioned badge for child folders
* Fix folder title
* Update folder actions
* Update new provisioned folder form
* Remove unused code
* Fix condition
* Reset default values on change
* Remove duplicate nav item
* Add managedBy to DashboardQueryResult
* Provisioning: support watch over live (in feature branch) (#102408)
* Provisioning: watch cleanup (#102424)
* fix lint
* Provisioning: Add basic usage stats (#102405)
* [Provisioning] Add limitations to Github Repository (#102451)
* Put limits to Github
* File is too large
* Move constants
* Embed ListOptions again
* Remove TODO
* Provisioning: Pick a better default title (#102516)
better title
* Provisioning: sanitize pull request urls (#102517)
* [Provisioning] Clean up clone after export and migrate (#102467)
* Remove clone directory on clone failure
* Defer remove clones
* Log error if removal fails
---------
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* [Provisioning] Limit path length and depth in APIs (#102472)
* Limit filepath length in files API calls
* Add common utility to deal with paths
* Use the existing function
* Fix import
* Update pkg/registry/apis/provisioning/safepath/limit.go
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* Fix issue after website commit
* Fix linting issue in test
---------
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* Add timeout, JSON check and max body size to endpoints (#102443)
* Add timeout, JSON check and max body size to endpoints
* Use http.MaxBytesReader instead
* Use MaxBytesReader also for reading the entire body
* Add empty line
* Add unit tests
* Fix integration tests
* Update pkg/registry/apis/provisioning/render.go
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* Do not use utils :)
* Fix comment on unmarshalJSON
* 25MB for webhook events
* Remove content type check for files write
---------
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* fix imports
* Provisioning: Remove export option from the UI (#102511)
* [Provisioning] Remove unused checkout method in go-git (#102460)
* [Provisioning] Limit max number of repositories to 10 (#102542)
* Limit to maximum 10 repositories in backend
* Change messaging
* Do not display connect button if more than 10
* Only fetch settings once
* watch repos
---------
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* [Provisioning] Limit size and time to git clone and push in go-git (#102458)
* Limit git clone and push time and size
* Fix linting
* Use transport instead to limit
* Remove not supported
* Add TODO to make timeout configurable
* chore: make update-workspace
* Provisioning: Implement a new job queue (#102446)
* feat: implement a new job queue
Outstanding problems:
* Status isn't saved.
* Progress updates don't work (due to status not being saved probably?).
* feat: properly save status
* chore: document label
* chore: assumptions do hold
* fix: support multi-tenant job drivers
* fix: use namespace=*
* fix: set resource back to pointer when updating job progress
If we don't do this, we start rejecting job progress updates as the version falls out of sync.
* feat: make job APIs read-only
* fix: complete job when worker returns
* fix: set namespace on requests from controller
* test: check historic jobs
* chore: regen apis
* feat: start augmenting frontend
* feat: add jobs to authorizer
* feat: use watch from input
* fix: make frontend subscribe to historic jobs
* fix: lint
* chore: yarn prettier:write
* fix: frontend lints
* test: allow for empty state in historicjobs
* test: set content type for export request
* fix: always set job name on insert
* fix: import
* fix: use dashes not colons
* fix: job status should expect a historic job transition
* fix: allow PR jobs from multiple PRs
* feat: same name for sync and migrate jobs
* feat: generate a job name in the store
* refactor: rename to persistentStore
* feat: remove status subresources on jobs
* feat: join jobs into one card
* chore: regen openapi snapshot
---------
Co-authored-by: Roberto Jimenez Sanchez <roberto.jimenez@grafana.com>
* Provisioning: Use a complete storage for jobs (#102605)
* feat: add a complete strategy to apiserver
* feat: use the complete storage strategy for jobs
* test: behaviour changed in main
* [Provisioning] Consolidate file path handling (#102617)
* Add more cases for validation
* Call the method dir
* Clean files endpoint
* Simplify further
* Fix issues with folder
* Add Dir function
* Use walk function in folders
* Move things from ID
* Fix some tests
* Add tree
* Sync worker and changes
* Add more TODOs
* Add normal join
* Remove things in local
* Consolidate single Join
* Call it safe
* Add new IsPathSupported action
* Move the depth to resources
* Add more cases
* Improve trie implementation
* Add tests trie
* Fix trie tests
* Improve trie tests
* Add tests for walk
* Fix linting
* Add unit tests filepath
* Remove TODO
* Remove another TODO
* Unsupported file extension error
* Add documentation for IsPathSupported
* Filepath unit tests
* Use safepath to validate github path
* Remove TODO in wrapper
* Use trailing slash in folder internal object
* Fix changes test
* Include dot
* Add TODO to explore own type for path
* Fix frontend lint
* Fix unit tests
* Fix provisioning integration tests
---------
Co-authored-by: Roberto Jiménez Sánchez <roberto.jimenez@grafana.com>
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: Clarity-89 <homes89@ukr.net>
Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
Co-authored-by: Kevin Minehart <kmineh0151@gmail.com>
When querying metric data (non-table data) with SQL Expressions, we need to convert the data to table format. This is alternative format which does not have the same issues with sparse data.
There is now a __metric_name__ column and one __value__ column. Also a __display_name__ column if there is DisplayNameFromDS metadata.
---------
Co-authored-by: Adam Simpson <adam@adamsimpson.net>
* feat(datasource/Tempo): Report timerange to Rudderstack
This adds another parameter to the Rudderstack instrumentation,
reporting the query time range in seconds.
Signed-off-by: Alex Bikfalvi <alex.bikfalvi@grafana.com>
* Update public/app/plugins/datasource/tempo/datasource.ts
Co-authored-by: Andre Pereira <adrapereira@gmail.com>
* Update public/app/plugins/datasource/tempo/datasource.ts
---------
Signed-off-by: Alex Bikfalvi <alex.bikfalvi@grafana.com>
Co-authored-by: Andre Pereira <adrapereira@gmail.com>
This is directory which stores Go modules with pinned buildable package that is used within this repository, managed by https://github.com/bwplotka/bingo.
* Run `bingo get` to install all tools having each own module file in this directory.
* Run `bingo get <tool>` to install <tool> that have own module file in this directory.
* For Makefile: Make sure to put `include .bingo/Variables.mk` in your Makefile, then use $(<upper case tool name>) variable where <tool> is the .bingo/<tool>.mod.
* For shell: Run `source .bingo/variables.env` to source all environment variable for each tool.
* For go: Import `.bingo/variables.go` to for variable names.
* See https://github.com/bwplotka/bingo or -h on how to add, remove or change binaries dependencies.
# Due to a race condition, after initial call to `go tool` golang may report a wrong binary location pointing to the invalid `/tmp/go-buildXXX` directory
definecompile_tool
$(shell \
(cd$(src_dir)/$(1) \
&& GOWORK=offgotool -n$(2) > /dev/null \
&& GOWORK=offgotool -n$(2)) | sed 's/^[[:space:]]*//g'; \
tools_dir := $(shell cd $(dir $(lastword $(MAKEFILE_LIST))) && pwd)
src_dir := $(tools_dir)/src
# Due to a race condition, after initial call to `go tool` golang may report a wrong binary location pointing to the invalid `/tmp/go-buildXXX` directory
define compile_tool
$(shell \
(cd $(src_dir)/$(1) \
&& GOWORK=off go tool -n $(2) > /dev/null \
&& GOWORK=off go tool -n $(2)) | sed 's/^[[:space:]]*//g'; \
"comment":" please add one or more appropriate labels. Here are some tips:\r\n\r\n- if you are making an issue, TODO, or reminder for yourself or your team, please add one label that best describes the product or feature area. Please also add the issue to your project board. :rocket:\r\n\r\n- if you are making an issue for any other reason (docs typo, you found a bug, etc), please add at least one label that best describes the product or feature that you are discussing (e.g. `area/alerting`, `datasource/loki`, `type/docs`, `type/bug`, etc). [Our issue triage](https://github.com/grafana/grafana/blob/main/contribute/ISSUE_TRIAGE.md#3-categorize-an-issue) doc also provides additional guidance on labeling. :rocket:\r\n\r\n Thank you! :heart:"
# This workflow depends on the ./actionlint-format.txt file. It is MIT licensed (thanks, rhysd!): https://github.com/rhysd/actionlint/blob/2ab3a12c7848f6c15faca9a92612ef4261d0e370/testdata/format/sarif_template.txt
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.
Since you've added the `What's New` or a breaking change label, consider drafting a [What's new note](https://admin.grafana.com/content-admin/#/collections/whats-new/new) for this feature.
# "The comma-separated list of experimental checks that should be executed. By default, all experimental checks are turned off. Possible values: notowned,avoid-shadowing"
experimental_checks:"notowned,avoid-shadowing"
# The repository path in which CODEOWNERS file should be validated."
repository_path:"."
@@ -35,4 +41,4 @@ jobs:
owner_checker_allow_unowned_patterns:"false"
# Specifies whether only teams are allowed as owners of files.
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
name:"CodeQL"
name:"CodeQL checks"
on:
workflow_dispatch:
push:
branches:[main, v*.*.*]
branches:
- main
- release-*.*.*
paths-ignore:
- '**/*.cue'
- '**/*.json'
- '**/*.md'
- '**/*.txt'
- '**/*.yml'
- pkg/storage/unified/sql/db/dbimpl/db.go# Ignoring warnings on the whole file for now while inline comments is not supported in Go (https://github.com/github/codeql/issues/11427)
If this change introduces user-facing configuration options or modifies existing ones, please remember to update [`docs/sources/setup-grafana/configure-grafana/_index.md`](https://github.com/grafana/grafana/blob/main/docs/sources/setup-grafana/configure-grafana/_index.md).
If this change is internal-only (experimental flags, internal refactoring, etc.), you can ignore this reminder.
Questions? Reach out to the #docs channel on Slack.
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.