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).
* 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
* 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>
* 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>
* 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>
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>
* 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
* 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
* 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
* 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>
* LogListControls: add dropdown menu for timestamps
* LogListControls: add dropdown menu for line wrapping
* Update styles
* Translations
* Update tests
* Update test
* LogListControls: all events
• 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>
* 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>
* 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
* 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
* 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
* 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>
* 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
* 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
* 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
* 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
* 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
* 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 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
* 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
Support syntax highlighting and autocompletion for:
* `compare(...)` TraceQL metrics function
* `with(...)` query hint
Partially fixes: https://github.com/grafana/grafana/issues/103764
Signed-off-by: Alex Bikfalvi <alex.bikfalvi@grafana.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>