Compare commits

...

117 Commits

Author SHA1 Message Date
Grot (@grafanabot)
bc353e4b2d Release: Bump version to 9.5.1 (#852)
"Release: Updated versions in package to 9.5.1"
2023-04-24 11:27:01 -05:00
Ricky Whitaker
54bfe7f887 Merge branch 'v9.5.x' of github.com:grafana/grafana-private-mirror into v9.5.x 2023-04-24 11:10:24 -05:00
Misi
26f6191b1d Chore: Update SAML lib (#824)
Update saml lib
2023-04-24 11:05:36 -05:00
Jo
df81ebba34 AuthJWT: Fix JWT query param leak (CVE-2023-1387) (#825)
fix JWT query param leak

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
Co-authored-by: Kalle Persson <kalle.persson@grafana.com>
2023-04-24 11:05:36 -05:00
dsotirakis
57dbd0b18a Geomap: Sanitize the attribution string (#745)
* SAML: Update grafana/saml library (#691)

Co-authored-by: jguer <joao.guerreiro@grafana.com>

* SVG: Add dompurify preprocessor step (#698)

* add sanitized SVG component

* add sanitize

* Fix frontend build

* Remove unnecessary yarn.lock changes

* Fix formatting

* Re-add yarn.lock message as I guess it is needed

---------

Co-authored-by: dsotirakis <dimitrios.sotirakis@grafana.com>
Co-authored-by: jguer <joao.guerreiro@grafana.com>
Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
Co-authored-by: Drew Slobodnjak <60050885+drew08t@users.noreply.github.com>
2023-04-24 11:05:36 -05:00
Misi
80de6d6d02 Chore: Update SAML lib (#824)
Update saml lib
2023-04-24 12:58:32 -03:00
Jo
7a1a8b7a86 AuthJWT: Fix JWT query param leak (CVE-2023-1387) (#825)
fix JWT query param leak

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
Co-authored-by: Kalle Persson <kalle.persson@grafana.com>
2023-04-24 12:58:31 -03:00
dsotirakis
5790ba49c2 Geomap: Sanitize the attribution string (#745)
* SAML: Update grafana/saml library (#691)

Co-authored-by: jguer <joao.guerreiro@grafana.com>

* SVG: Add dompurify preprocessor step (#698)

* add sanitized SVG component

* add sanitize

* Fix frontend build

* Remove unnecessary yarn.lock changes

* Fix formatting

* Re-add yarn.lock message as I guess it is needed

---------

Co-authored-by: dsotirakis <dimitrios.sotirakis@grafana.com>
Co-authored-by: jguer <joao.guerreiro@grafana.com>
Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
Co-authored-by: Drew Slobodnjak <60050885+drew08t@users.noreply.github.com>
2023-04-24 12:58:30 -03:00
Grot (@grafanabot)
02e1181c3b [v9.5.x] Cloudwatch Logs: Clarify Cloudwatch Logs Limits (#67101)
Cloudwatch Logs: Clarify Cloudwatch Logs Limits (#67072)

Clarify Cloudwatch Logs Limits

(cherry picked from commit 5f16cd5124)

Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>
2023-04-24 11:07:09 -04:00
Torkel Ödegaard
827cc6f1c8 Scenes: Backport of upgrade to v6 to gain access to new UrlEncode format (#67115) 2023-04-24 16:17:53 +02:00
Grot (@grafanabot)
fa1bd24b47 [v9.5.x] Rendering: Fix panel rendered count on error (#67087)
Rendering: Fix panel rendered count on error (#67027)

Rendering: fix panel rendered count on error
(cherry picked from commit fe5a07f336)

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>
2023-04-24 10:54:08 +02:00
Grot (@grafanabot)
8357ceae7b [v9.5.x] Alerting: fix condition to distinguish multiple datasources type in dropdown (#67066) 2023-04-23 13:17:59 +00:00
Grot (@grafanabot)
dda934678d [v9.5.x] AzureMonitor: Correct series name accounting for dimensions (#67068)
AzureMonitor: Correct series name accounting for dimensions (#67050)

Correct displayName accounting for dimensions

(cherry picked from commit a2b97547a6)

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
2023-04-21 21:42:08 +03:00
Grot (@grafanabot)
8bc2a7144a [v9.5.x] Nested folders: Fix error response codes (#66975)
Nested folders: Fix error response codes (#66943)

* Nested folders: Fix error response codes

Fix error handling

(cherry picked from commit 24696d593b)

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2023-04-21 15:15:14 +00:00
Grot (@grafanabot)
6c0aeb452d [v9.5.x] Fix: Hide invite when disabled login form is set (#67042)
Fix: Hide invite when disabled login form is set (#67031)

* FIX: Hide Invite Button with external user management

* Hide also when login form is disabled

* add tests and readability

---------

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
(cherry picked from commit b7f047c8dd)

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2023-04-21 13:23:40 +01:00
Grot (@grafanabot)
38fdfd6bfc [v9.5.x] Alerting: Fix filtering when panel variables are in use (#67038)
Alerting: Fix filtering when panel variables are in use (#66977)

Fix alert instances filtering when panel variables are in use

(cherry picked from commit 9f1fe51edc)

Co-authored-by: Konrad Lalik <konrad.lalik@grafana.com>
2023-04-21 14:16:32 +02:00
Grot (@grafanabot)
900c18ef5b [v9.5.x] AzureMonitor: Update ARG Subscription selection (#67037)
AzureMonitor: Update ARG Subscription selection (#66890)

* Update ARG Subscription selection

- Filter out queries that do not contain at least one subscription
- Refactor SubscriptionField component
- Display error if no subscriptions are selected
- Update tests

* Fix test

(cherry picked from commit f3dbb7b34a)

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
2023-04-21 13:30:39 +03:00
Ashley Harrison
ae716112dc Navigation IA: Update Monitoring to Observability (#66963) (#67023)
* update monitoring -> observability

* update backend test

(cherry picked from commit 1f193f1bad)
2023-04-21 10:40:15 +01:00
Grot (@grafanabot)
d153c50454 [v9.5.x] Plugins: Fix width for README pages with tables (#67025)
Plugins: Fix width for README pages with tables (#66872)

(cherry picked from commit 29aaf429ad)

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
2023-04-21 11:38:18 +03:00
Grot (@grafanabot)
7694ea28e5 [v9.5.x] Stats Inspector: Prevent long stats from being hidden (#66980)
Stats Inspector: Prevent long stats from being hidden (#66866)

* Stats Inspector: Prevent stats from being hidden

* Inspect stats: inline container styles

(cherry picked from commit c11baa3ead)

Co-authored-by: Matias Chomicki <matyax@gmail.com>
2023-04-20 17:14:39 +02:00
Grot (@grafanabot)
32869c96df [v9.5.x] Alerting: Fix DatasourceUID and RefID missing for DatasourceNoData alerts (#66962)
Alerting: Fix DatasourceUID and RefID missing for DatasourceNoData alerts (#66733)

This commit fixes a bug where DatasourceUID and RefID annotations are
missing for DatasourceNoData alerts in Grafana 9.5. This bug affects
datasource plugins that have moved to using the data plane contract.

(cherry picked from commit 35342a3c76)

Co-authored-by: George Robinson <george.robinson@grafana.com>
2023-04-20 16:56:53 +03:00
Grot (@grafanabot)
2ed30e9831 [v9.5.x] docs: add migration guide and notes for upcoming react 18 upgrade (#66952)
docs: add migration guide and notes for upcoming react 18 upgrade (#66656)

* add information to what's new about upcoming react 18 upgrade

* update structure

* Apply suggestions from code review

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

* add docs to plugin migration guide

* add link to forum discussion

* apply suggestions from review

---------

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
(cherry picked from commit 1917857186)

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2023-04-20 12:26:07 +00:00
Grot (@grafanabot)
5bb4a9c89f [v9.5.x] Docs: updates time ranges and alert rule doc (#66945)
Docs: updates time ranges and alert rule doc (#66760)

(cherry picked from commit 4d2570ad72)

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
2023-04-20 14:19:56 +03:00
Grot (@grafanabot)
dcc5190620 [v9.5.x] Expressions/threshold: Fix incorrect thresholds args length (#66926)
Expressions/threshold: Fix incorrect thresholds args length (#66859)

(cherry picked from commit 350de3f3bf)

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2023-04-20 13:15:59 +02:00
Grot (@grafanabot)
006cea2192 [v9.5.x] Docs: adds legacy wording to api docs (#66942)
Docs: adds legacy wording to api docs (#66937)

adds legacy wording to api docs

(cherry picked from commit 9b529ef0cd)

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
2023-04-20 11:12:51 +00:00
Grot (@grafanabot)
384a21d03c [v9.5.x] Alerting: Add tests for Evaluate (#66930)
Alerting: Add tests for Evaluate (#66739)

(cherry picked from commit 883dcc81c0)

Co-authored-by: George Robinson <george.robinson@grafana.com>
2023-04-20 13:42:18 +03:00
Grot (@grafanabot)
71ebf83dd0 [v9.5.x] Elasticsearch: Handle multiple annotation structures (#66924)
Elasticsearch: Handle multiple annotation structures (#66762)

elastic: fix annotation handling
(cherry picked from commit 82ac2bae5f)

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2023-04-20 10:02:58 +00:00
Grot (@grafanabot)
581cbe4295 [v9.5.x] Tempo: TraceQL query builder QoL improvements (#66927)
Tempo: TraceQL query builder QoL improvements (#66865)

* Remove focus on duration inputs to match the other selects

* Allow users to create options while they load

* Options without type default to not have quotes around them

* Fix #66571 - set query type to traceql when linking from logs to traces

* Fix test

(cherry picked from commit 6e8b17efd8)

Co-authored-by: Andre Pereira <adrapereira@gmail.com>
2023-04-20 12:58:51 +03:00
Grot (@grafanabot)
3133aa135d [v9.5.x] AzureMonitor: Ensure dimension labels are consistent (#66874)
AzureMonitor: Ensure dimension labels are consistent (#66783)

Ensure dimension labels are consistent

(cherry picked from commit c161b28f29)

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
2023-04-20 00:30:14 +03:00
Grot (@grafanabot)
e9b2eb1607 [v9.5.x] Chore: Update @grafana/e2e (#66880)
Chore: Update @grafana/e2e (#66365)

* Update e2e package

- Ensure health request is monitored for addDatasource flow
- Add custom timeout to configurePanel flow

* Make health check optional

(cherry picked from commit b2e32a70b9)

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
2023-04-19 22:44:23 +03:00
Grot (@grafanabot)
e6eb1df488 [v9.5.x] Chore: Update AddPanel selectors for top nav (#66896)
Chore: Update AddPanel selectors for top nav (#65871)

* Update add panel selectors for top nav

* trigger build

(cherry picked from commit 61599de32c)

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
2023-04-19 22:30:41 +03:00
Grot (@grafanabot)
f0ae1b41b5 [v9.5.x] [docs] remove auth/saml alias from team sync page (#66856)
[docs] remove auth/saml alias from team sync page (#66796)

removed auth/saml alias from team sync page

(cherry picked from commit 60e6ff1038)

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
2023-04-19 10:01:12 -04:00
Emil Tullstedt
ad9dd6a1dd Chore: Upgrade Go to 1.20.3 (#66831)
Backport of #66264
2023-04-19 13:58:57 +02:00
Grot (@grafanabot)
0315b911ef [v9.5.x] Catalog: Show install error with incompatible version (#66817)
Catalog: Show install error with incompatible version (#65059)

(cherry picked from commit 98778289cb)

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
2023-04-19 10:51:07 +02:00
Grot (@grafanabot)
33ff08215c [v9.5.x] CloudMonitor: Correctly re-render VisualMetricQueryEditor on TimeRange updates (#66787)
CloudMonitor: Correctly re-render `VisualMetricQueryEditor` on `TimeRange` updates (#66756)

Compare string value rather than object

(cherry picked from commit adf12d0e90)

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
2023-04-18 16:35:46 +00:00
Grot (@grafanabot)
6a1a71f8bd [v9.5.x] Build: Add optional build-args for COMMIT_SHA and BUILD_BRANCH (#66759)
Build: Add optional build-args for COMMIT_SHA and BUILD_BRANCH (#66672)

* Remove .git from .dockerignore

* Revert "Remove .git from .dockerignore"

This reverts commit 5a4658f270.

* Add optional COMMIT_SHA and BUILD_BRANCH environment variables

(cherry picked from commit 614427c602)

Co-authored-by: Guilherme Caulada <guilherme.caulada@grafana.com>
2023-04-18 12:58:46 -03:00
Grot (@grafanabot)
826e500bf2 [v9.5.x] Alerting: Fix share URL for Prometheus rules on subpath (#66773)
Alerting: Fix share URL for Prometheus rules on subpath (#66752)

(cherry picked from commit 2cec402647)

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2023-04-18 14:11:23 +00:00
Grot (@grafanabot)
3fb37e26b5 [v9.5.x] Alerting: Allow provenance disable in alerting provisioning API (#66761)
Alerting: Allow provenance disable in alerting provisioning API (#63650)

* Allow provenance None in alert rule update and rule group replace

* Allow provenance None in contact point update

* Allow updating policies to none by sending x-disable-provenance header

* Allow mute timings to disable provenance with x-disable-provenance header

* Allow disabling provenance by using x-disable-provenance header

* Add provenance helper to lower the cyclomatic complexity

* Do not downgrade provenance except un ReplaceRuleGroup

* Add function explanation and change error handling

* Add docs for x-disable-provenance changes (#66300)

* Add docs for x-disable-provenance changes

* Apply suggestions from code review

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

* Update _index.md

---------

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

* Update docs/sources/alerting/set-up/provision-alerting-resources/_index.md

Co-authored-by: George Robinson <george.robinson@grafana.com>

* Add error message check in tests

* Change docs

---------

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
Co-authored-by: George Robinson <george.robinson@grafana.com>
(cherry picked from commit f64a89727e)

Co-authored-by: Alex Moreno <alexander.moreno@grafana.com>
2023-04-18 15:34:44 +02:00
Grot (@grafanabot)
81b78f3af4 [v9.5.x] Annotations: Ignore unique constraint violations for tags (#66757)
(cherry picked from commit 948131aac3)

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
2023-04-18 14:48:16 +02:00
Grot (@grafanabot)
9afddd77bd [v9.5.x] Update index.md (#66718)
Update index.md (#66698)

The useful links were down as they were using /docs/grafana/next/ instead of /docs/grafana/latest/ in the path

(cherry picked from commit 58e3b3a90e)

Co-authored-by: Sébastien Dauphin <dauphin.sebastien@gmail.com>
2023-04-18 14:02:08 +02:00
Grot (@grafanabot)
760146aeab [v9.5.x] Annotations: Improve get tags query performance (#66744)
Annotations: Improve get tags query performance (#66182)

* Add benchmark

* Add fix

(cherry picked from commit 04370f92dc)

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2023-04-18 13:47:13 +03:00
Grot (@grafanabot)
bd63388bc5 [v9.5.x] Docs: Un-draft 'Configure Integrations' docs (#66715)
Docs: Un-draft 'Configure Integrations' docs (#66699)

* Docs: Un-draft 'Configure Integrations' docs

* fix typo

(cherry picked from commit a113d94bbb)

Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>
2023-04-18 08:59:57 +02:00
Grot (@grafanabot)
c035abf529 [v9.5.x] SQL Datasources: Update Max Connection and Max Idle Connection Defaults to 100 and add auto mode (#66651)
* SQL Datasources: Update Max Connection and Max Idle Connection Defaults to 100 and add auto mode (#65834)

* Update connection configuration for SQL datasources

* Working auto state for connection numbers

* Add migration

* Use defaults from constants file

* Remove dead code

* Add tests and restructure useMigrateDatabaseField

* Update function names

* Update docs

* Make sure we don't continually issue updates

* Update docs

* Use onOptionsChnage in ConnectionLimits

* Update docs

* Clean up docs

* Update migration

* Fix default values in docs

* Fix spacing issue

* Fix test

* Update default values for SQL connections

* Include consts

* Allow override for default SQL datasource connection parameters

* Fix linter errors

* Remove extra @ts-ignore

* Centralize logic for default values

* Remove debugging

* Remove unecessary function

* Update configuration docs

* minor suggested change

* Fix comment misspelling

* Remove unecessary default setting code

* Update docs to indicate that code was included for backport version

* Remove dead code

---------

Co-authored-by: lwandz13 <larissa.wandzura@grafana.com>
(cherry picked from commit 92d92187d9)

* Add brackets around property name so that it's dynamic

---------

Co-authored-by: Kyle Cunningham <codeincarnate@users.noreply.github.com>
Co-authored-by: Kyle Cunningham <kyle@codeincarnate.com>
2023-04-17 21:53:12 +07:00
Grot (@grafanabot)
68d2179aa2 [v9.5.x] docs: add missing alias (#66676)
docs: add missing alias (#66621)

added missing alias

(cherry picked from commit 2b7f41f4df)

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
2023-04-17 10:09:08 -04:00
Grot (@grafanabot)
08f57ef45c [v9.5.x] removed duplicate query data source section (#66682)
removed duplicate query data source section (#66605)

(cherry picked from commit 1e53b29eee)

Co-authored-by: lwandz13 <126723338+lwandz13@users.noreply.github.com>
2023-04-17 06:51:41 -07:00
Grot (@grafanabot)
7f1a840f36 [v9.5.x] Navigation: Redirect to root page when switching organization (#66658)
Navigation: Redirect to root page when switching organization (#66655)

* just redirect to root when switching org

* remove old orgswitcher modal

(cherry picked from commit 90f0b1c6e2)

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2023-04-17 14:07:59 +03:00
Grot (@grafanabot)
5e07346da9 [v9.5.x] GRPC: Document GRPC flags to allow overriding env vars (#66631) 2023-04-15 11:48:38 +00:00
Piotr Jamróz
c5352a10fe [v9.5.x] Explore: Allow supplementary query data provider to be undefined for mixed data sources (#66422) (#66577)
Explore: Allow supplementary query data provider to be undefined for mixed data sources (#66422)

* Switch back to the API where data provider for a supplementary query can be undefined

* Promote exploreMixedDatasource to beta

* Revert "Promote exploreMixedDatasource to beta"

This reverts commit a3bc167d1c.

* Resolve data source in parallel

* Do not modify function params

* Reorganize code for better readability

* Improve readability

* Simplify code

* Stop using a deprecated error property

(cherry picked from commit b5e2b0d14c)

# Conflicts:
#	public/app/features/explore/state/query.ts
2023-04-14 20:23:08 +02:00
Grot (@grafanabot)
1433fcb9b2 [v9.5.x] Google Cloud Monitoring: Fix project variable (#66603)
Google Cloud Monitoring: Fix project variable (#66524)

Google Cloud Monitoring: fix project variable

Also fix typo found while debugging

(cherry picked from commit 02951e8a26)

Co-authored-by: Adam Simpson <adam@adamsimpson.net>
2023-04-14 15:29:44 +00:00
Grot (@grafanabot)
4cd346e66c [v9.5.x] InfluxDB: Fix querying with hardcoded retention policy (#66588)
InfluxDB: Fix querying with hardcoded retention policy (#66466)

* Use default retention policy instead of hardcoded retention policy

* Load retention policies for the editor

* Fix the typo

* Add more comment line

* Update comment

* Better error message

* Put back getTagKeys and getTagValues

* Fix unit test

(cherry picked from commit 6d53c87862)

Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
2023-04-14 13:53:43 +00:00
Grot (@grafanabot)
84850f4553 [v9.5.x] Dashboards: Fix broken internal data links (#66581)
Dashboards: Fix broken internal data links (#66567)

* In dashboards splitOpenFn is not passed, instead "href" link is used. When we added tracking we changed the behaviour so onClickFn is always passed when generating the model. To bring back the previous behaviour we skip the onClickFn if the split function is not provided.

* Fix test and add a task to re-check the logic

(cherry picked from commit 4f5b80095e)

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
2023-04-14 15:14:58 +02:00
Grot (@grafanabot)
5bcc35298f [v9.5.x] Docs: Add distributed tracing plugin developer guide (#66558)
Docs: Add distributed tracing plugin developer guide (#65898)

* Docs: Add plugin developer guide on distributed tracing

* Docs: Fix typo

* Docs: Plugins: Tracing: Address TODOs and other changes

* Docs: Plugins: Tracing: Fix typo

* Docs: Plugins: Tracing: Add note about min SDK version and update command

* Docs: Plugins: Tracing: Fix some typos, rephrase some sentences

* Docs: Plugins: Traacing: Removed manual instance management instructions

* Update docs/sources/developers/plugins/add-distributed-tracing-for-backend-plugins.md

Co-authored-by: Joseph Perez <45749060+josmperez@users.noreply.github.com>

* Docs: Plugins: Tracing: Use markdown instead of HTML

---------

Co-authored-by: Joseph Perez <45749060+josmperez@users.noreply.github.com>
(cherry picked from commit d1f1beaef9)

Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>
2023-04-14 12:32:08 +02:00
Grot (@grafanabot)
ac7eecdb47 [v9.5.x] Loki Variable Query Editor: Fix bug when the query is updated (#66536)
Loki Variable Query Editor: Fix bug when the query is updated (#66509)

* Variable Query Editor: Remove options override in effect

* Add regression test

(cherry picked from commit 46742f6d96)

Co-authored-by: Matias Chomicki <matyax@gmail.com>
2023-04-14 11:24:25 +03:00
Grot (@grafanabot)
2fda756320 [v9.5.x] E2E: Fixed so openPanelMenuItem flow works with new/old panel chrome without breaking changes (#66540)
E2E: Fixed so openPanelMenuItem flow works with new/old panel chrome without breaking changes (#66118)

Fixed so the openPanelMenuItem works with both angular and react panels.

(cherry picked from commit c3fee5881f)

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
2023-04-14 10:22:49 +03:00
Grot (@grafanabot)
12c2bbfc56 [v9.5.x] Prometheus: Fix ad-hoc filters (#66534)
Prometheus: Fix ad-hoc filters (#66521)

* refactor label names back to getTagKeys to fulfill contract with parent class required for ad-hoc functionality

(cherry picked from commit 4a7f27489e)

Co-authored-by: Galen Kistler <109082771+gtk-grafana@users.noreply.github.com>
2023-04-13 15:34:23 -05:00
Grot (@grafanabot)
6b68549bb4 [v9.5.x] Put the numbers before dashboard elements. (#66530)
Put the numbers before dashboard elements. (#65749)

* Put the numbers before dashboard elements.

Putting the numbers before the dashboard elements will make finding these easier for our customers as the first thing most people will do is look for the number that corresponds with the number in the photo.

* fixed icon name

---------

Co-authored-by: Isabel Matwawana <isabel.matwawana@grafana.com>
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
(cherry picked from commit d208324331)

Co-authored-by: samu6851 <samuel.oswalt@grafana.com>
2023-04-13 15:55:11 -04:00
Grot (@grafanabot)
0b9ef6d3f4 [v9.5.x] docs: nav update notes for videos (#66519)
docs: nav update notes for videos (#66506)

* nav related notes for videos

* wording edit

Co-authored-by: Eve Meelan <81647476+Eve832@users.noreply.github.com>

* wording edits

Co-authored-by: Eve Meelan <81647476+Eve832@users.noreply.github.com>

---------

Co-authored-by: Eve Meelan <81647476+Eve832@users.noreply.github.com>
(cherry picked from commit 1b46d2f5bd)

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
2023-04-13 14:57:27 -04:00
Grot (@grafanabot)
014b77bb79 [v9.5.x] docs: nav updates for exemplars (#66473)
docs: nav updates for exemplars (#66469)

* nav-related image upates

* resized some images

(cherry picked from commit 0d06aef5f7)

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
2023-04-13 13:05:24 -04:00
Grot (@grafanabot)
61fe7dccb8 [v9.5.x] Docs: Fix a type in support bundles (#66491)
Docs: Fix a type in support bundles (#66481)

(cherry picked from commit 694b48660b)

Co-authored-by: Vardan Torosyan <vardants@gmail.com>
2023-04-13 17:52:06 +02:00
Grot (@grafanabot)
abd9543c14 [v9.5.x] Alerting: Hide mute timing actions when dealing with vanilla prometheus (#66460)
Alerting: Hide mute timing actions when dealing with vanilla prometheus (#66457)

(cherry picked from commit 03f95d6e98)

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2023-04-13 15:14:21 +03:00
Grot (@grafanabot)
3369033d74 [v9.5.x] Alerting: Allow Rules to Schedule to be filtered by Rule Group (#66458)
Alerting: Allow Rules to Schedule to be filtered by Rule Group (#59990)

* Alerting: Allow Rules to Schedule to be filtered by Rule Group

(cherry picked from commit 2bbf0c9de4)

Co-authored-by: gotjosh <josue.abreu@gmail.com>
2023-04-13 15:13:17 +03:00
Grot (@grafanabot)
b5cb0e5cc6 [v9.5.x] Docs: Add docs for [plugin.plugin_id].tracing config key (#66454)
Docs: Add docs for [plugin.plugin_id].tracing config key (#65900)

* Docs: Add docs for [plugin.plugin_id].tracing config key

* Docs: Changes after PR review

* PR review changes

* PR review changes

(cherry picked from commit 93c252e0fe)

Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>
2023-04-13 14:07:16 +02:00
Grot (@grafanabot)
d40a837d5c [v9.5.x] Dashboards: Prevent template variables from resolving twice (#66452)
Dashboards: Prevent template variables from resolving twice (#66372)

(cherry picked from commit 38ee910e39)

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
2023-04-13 14:08:40 +03:00
Grot (@grafanabot)
0f4a76c9de [v9.5.x] Plugins: Fix module.js file not being closed when loading plugins (#66435)
* Plugins: Fix module.js file not being closed when loading plugins (#66288)

* Plugins: Loader: Fix module.js file not being closed

* Plugins: LocalFS: Add comments, ensure same Read() behaviour as os.File's

* Changed comment for Close()

* Add tests for LocalFS

* "Fix" linter error

* "Fix" linter error again

(cherry picked from commit 1c3ad81826)

* trigger ci

---------

Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>
Co-authored-by: Giuseppe Guerra <to@nyo.zz.mu>
2023-04-13 12:41:26 +02:00
Grot (@grafanabot)
0f10b98202 [v9.5.x] Cloudwatch: Pass refId from query for expression queries (#66434)
Co-authored-by: Shirley <4163034+fridgepoet@users.noreply.github.com>
Co-authored-by: Isabella Siu <Isabella.siu@grafana.com>
(cherry picked from commit 6309d3fae6)
2023-04-13 12:37:46 +02:00
Grot (@grafanabot)
fde8d81de3 [v9.5.x] Alerting: Fix creating a recording rule when having multiple datasources (#66448)
Alerting: Fix creating a recording rule when having multiple datasources (#66415)

Fix creating recording rules when having multiple datasources

(cherry picked from commit 2991d4c213)

Co-authored-by: Virginia Cepeda <virginia.cepeda@grafana.com>
2023-04-13 12:18:40 +02:00
Grot (@grafanabot)
12d121a1fc [v9.5.x] Auth: Remove the session cookie only if it's invalid or revoked (#66431)
Auth: Remove the session cookie only if it's invalid or revoked (#65984)

Remove the cookie if it's invalid or revoked

(cherry picked from commit 4cac95d1c2)

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
2023-04-13 09:54:23 +02:00
Grot (@grafanabot)
c956cd2a32 [v9.5.x] remove duplicate exemplars section (#66405)
remove duplicate exemplars section (#66398)

(cherry picked from commit 5197fca70c)

Co-authored-by: lwandz13 <126723338+lwandz13@users.noreply.github.com>
2023-04-12 18:08:05 -04:00
Grot (@grafanabot)
c52f932025 [v9.5.x] Table Panel: Fix panel migration for options cell type (#66406)
Table Panel: Fix panel migration for options cell type (#66305)

(cherry picked from commit b83627a661)

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2023-04-12 20:00:11 +03:00
ismail simsek
522598d650 [v9.5.x] Prometheus: Show initial hint on builder mode when metric lookup disabled (#66400)
Prometheus: Show initial hint on builder mode when metric lookup disabled (#65827)

* Show initial hint on builder mode when metric lookup disabled

* Disable MetricEncyclopedia and label request when metric lookup is disabled

(cherry picked from commit 08727b7d6c)
2023-04-12 18:26:38 +02:00
Grot (@grafanabot)
f26e56bc43 [v9.5.x] docs: nav updates for enterprise and reports (#66395)
docs: nav updates for enterprise and reports (#66389)

nav-related text updates

(cherry picked from commit 4025927f7d)

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
2023-04-12 11:31:08 -04:00
Grot (@grafanabot)
348ced74b4 [v9.5.x] InfluxDB: Fix Interpolation when querying variables (#66392)
InfluxDB: Fix Interpolation when querying variables (#65875)

Interpolate variables with InfluxQueryModel

(cherry picked from commit 4e71c91cfd)

Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
2023-04-12 17:59:18 +03:00
Grot (@grafanabot)
1ad3ee4255 [v9.5.x] Expressions: Fix expression load with legacy UID -100 (#66388)
Expressions: Fix expression load with legacy UID -100 (#65950)

* Fix expressions instance settings loading

* Introduce a new method to get name or uid

* Update public/app/features/plugins/datasource_srv.ts

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>

* Move getNameOrUid method outside the class

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
(cherry picked from commit d4bd024951)

Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
2023-04-12 16:52:56 +02:00
Grot (@grafanabot)
a38b4cf3b0 [v9.5.x] AccessControl: Allow editors to access GET /api/datasources (#66376)
AccessControl: Allow editors to access GET /api/datasources (#66343)

Allow editors to access GET /datasources

(cherry picked from commit 2c21090931)

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
2023-04-12 15:56:01 +02:00
Grot (@grafanabot)
f09b60467e [v9.5.x] docs: What's New & Upgrade Guide 9.5 (#66377)
docs: What's New & Upgrade Guide 9.5 (#64168)

* added what's new and upgrade guide 9.5 and updated whats new index page

* Added new nav and nested folders.

* added empty dashboard state and dashboards section

* fixed caption

* fixed formatting of link and UI element

* Add: onlyExternalOrgRoleSync

* Adds Alerting entries

* Adds alerting screenshots

* More alerting screenshots

* add dashboard panel redesign

* Update _index.md

* Adds search to notification policy entry

* deletes old line

* Removed nested folders (will be private preview and not part of what's new)

* Docs: support bundle section for 9.5 What's New (#65641)

* support bundle section for 9.5 what's new

* Update whats-new-in-v9-5.md

* Update docs/sources/whatsnew/whats-new-in-v9-5.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* doc feedback

---------

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Influxdb database field deprecation notice

* Update reasoning

* fixed typo

* Docs: what's new API keys UI update (#65720)

* API keys deprecation

* Update docs/sources/whatsnew/whats-new-in-v9-5.md

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

* Update docs/sources/whatsnew/whats-new-in-v9-5.md

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

---------

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

* Docs: API keys UI updates (#65723)

update

* Docs: add dashboard previews deprecation notice (#65692)

* previews deprecation notice

* Apply suggestions from code review

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

---------

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

* we set the FF emptyDashboardPage ON by default, so it's available by default

* Update docs/sources/whatsnew/whats-new-in-v9-5.md

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

* add whats new toggle for prom browser cache feature

* Prometheus: metric encyclopedia feature toggle

* spell check

* Product editorial pass

Adds hyperlinks, notes release stages, updates intro, Adds content to upgrade guide

* add blurb for prom query cache

* Add more context to org role sync

Add more context to organization role sync about the ability to change a user's organization role even then sync is enabled. Also outlined why this is valuable and when it should be used.

* copy edit of upgrade guide

* copy edit and link fixes

* Update docs/sources/whatsnew/whats-new-in-v9-5.md

Makes it clear what can happen after sign in.

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

* Update docs/sources/whatsnew/whats-new-in-v9-5.md

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

* Update docs/sources/whatsnew/whats-new-in-v9-5.md

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

* Apply suggestions from code review

* fixes link

* Adds dark screenshot for alerting

* fixes alerting title

* Update whats-new-in-v9-5.md

* added missing quotation mark

* trigger linting

* small change to trigger linting

* fix title to follow pattern

* Update whats-new-in-v9-5.md

* Clearer explanation

* wording edits

* fixed heading levels

* fix title wording

* wording edit and availability fix

* remove extra space

* final copy edit

---------

Co-authored-by: Zsofia <zsofia.komaromi@gmail.com>
Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
Co-authored-by: Artur Wierzbicki <artur.wierzbicki@grafana.com>
Co-authored-by: polinaboneva <polina.boneva@grafana.com>
Co-authored-by: Galen <galen.kistler@grafana.com>
Co-authored-by: bohandley <brendan.ohandley@gmail.com>
Co-authored-by: Mitchel Seaman <mitchel.seaman@gmail.com>
Co-authored-by: danielkenlee <115471695+danielkenlee@users.noreply.github.com>
Co-authored-by: Chris Moyer <chris.moyer@grafana.com>
Co-authored-by: Fabrizia Rossano <117294258+frossano-grafana@users.noreply.github.com>
(cherry picked from commit f9fdeafe35)

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
2023-04-12 09:43:57 -04:00
Grot (@grafanabot)
122a38543c [v9.5.x] Revert "Prometheus: Reduce allocations parsing exemplars" (#66374)
Revert "Prometheus: Reduce allocations parsing exemplars" (#66367)

Revert "Prometheus: Reduce allocations parsing exemplars (#58959)"

This reverts commit a1f2d0e205.

(cherry picked from commit d830591cdc)

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2023-04-12 15:28:12 +02:00
Grot (@grafanabot)
8f9edf19a3 [v9.5.x] Docs: Add example to extract a specific label value (#66360)
Docs: Add the index function

(cherry picked from commit a39190b613)

Co-authored-by: Simon Crute <simonc6372@users.noreply.github.com>
2023-04-12 14:39:33 +02:00
Dimitris Sotirakis
fe530beebd [v9.5.x] CI: Split /bin/build artifacts * subcommand (#66005) (#66345)
CI: Split `/bin/build artifacts *` subcommand (#66005)

* Split go files

* Modify publishartifacts.go

* Split main

* FIXME: Temp add GCSCopy to gcloud/storage

* Fix lint

* Exported flags

* Update starlark - make drone

* Further backend lint fixes

* Add fallback_test.go

* Fix go imports order

* make drone

* Remove GCSCopy from static assets

* Remove GCSCopy from storybook

* Fix lint

* Remove GCSCopy

* Remove success logline

* drone yaml cleanup

* Add artifacts-editions flag

* Fix starlark

* Add default sting slice in artifacts packages command

(cherry picked from commit 24d348f804)

# Conflicts:
#	.drone.yml
2023-04-12 12:24:34 +03:00
Grot (@grafanabot)
2e866faac4 [v9.5.x] CloudWatch Logs: Document logs data protection (#66322)
CloudWatch Logs: Document logs data protection (#65967)

* CloudWatch Logs: Document logs data protection

* fix href

(cherry picked from commit c235ad67e7)

Co-authored-by: Kevin Yu <kevinwcyu@users.noreply.github.com>
2023-04-11 23:45:41 +03:00
Grot (@grafanabot)
f5063b3805 [v9.5.x] docs: update broken link (#66319)
docs: update broken link (#66317)

* docs: update broken link

Updates link to Community page that no longer exists.

* fix linting

(cherry picked from commit 0cf7774193)

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
2023-04-11 15:17:53 -04:00
Grot (@grafanabot)
97164ed37e [v9.5.x] Plugins: Fix plugin signature calculation not working on Windows (#66302)
Plugins: Fix plugin signature calculation not working on Windows (#66273)

* Plugins: Fix plugin signature calculation not working on Windows

* Plugins: Added test for NTFS path separators in signature verification

* Use filepath.ToSlash and replace its implementation in tests

* Fix typo

(cherry picked from commit facd4eca7e)

Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>
2023-04-11 17:46:37 +02:00
Grot (@grafanabot)
1ef8c02d19 [v9.5.x] Library panels: Ensure pagination controls are always correctly displayed (#66279)
Library panels: Ensure pagination controls are always correctly displayed (#65283)

correctly count library panels in the general folder

(cherry picked from commit fda38de293)

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2023-04-11 16:35:28 +03:00
Grot (@grafanabot)
345909d74b [v9.5.x] SQL Datasources: Fix variable throwing error if query returns no data (#66275)
SQL Datasources: Fix variable throwing error if query returns no data (#65937)

* Fix SQL query variable throwing error if query returns no data

* Tests to verify that metricFindQuery returns properly and doesn't throw error

* Fix all codepaths that might throw errors because of undefined backendSrv response

(cherry picked from commit 02a8bc76d2)

Co-authored-by: Victor Marin <36818606+mdvictor@users.noreply.github.com>
2023-04-11 16:02:14 +03:00
Grot (@grafanabot)
ba3f3ec59d [v9.5.x] Navigation: Scrolled hamburger menu links now navigate correctly in Safari (#66270)
Navigation: Scrolled hamburger menu links now navigate correctly in Safari (#66261)

overlayProps/dialogProps need to go inside FocusScope

(cherry picked from commit 0aa301e251)

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2023-04-11 15:12:54 +03:00
Grot (@grafanabot)
37883ed9ef [v9.5.x] Remove "Open source" label from all "RBAC" pages (#66248)
Remove "Open source" label from all "RBAC" pages (#66129)

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
(cherry picked from commit dec3361331)

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
2023-04-11 11:39:37 +03:00
Grot (@grafanabot)
c1136a48b2 [v9.5.x] Remove "Open source" label from "Recorded queries" page (#66252)
Remove "Open source" label from "Recorded queries" page (#66127)

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
(cherry picked from commit a5499bbf70)

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
2023-04-11 11:38:28 +03:00
Grot (@grafanabot)
acf9030e26 [v9.5.x] docs: nav related updates for data sources (#66142)
docs: nav related updates for data sources (#66080)

* nav related text updates for data sources

* fixed table rows

(cherry picked from commit 6a91f1a9b4)

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
2023-04-11 09:33:57 +01:00
Grot (@grafanabot)
cf31c0b7bd [v9.5.x] docs: nav updates for dashboards (#66143)
docs: nav updates for dashboards (#66078)

* navigation related text and image updates in dashboards topics

* fix typo

* fixed style and formatting issues

(cherry picked from commit 3725463c43)

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
2023-04-11 09:33:31 +01:00
Grot (@grafanabot)
7159c79069 [v9.5.x] Docs: updates to error handling (#66236)
Docs: updates to error handling (#65599)

* Docs: updates to error handling

* ran prettier

(cherry picked from commit a164b794ce)

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
2023-04-11 09:21:03 +02:00
Grot (@grafanabot)
7dab288d64 [v9.5.x] fixed broken links (#66179)
fixed broken links (#66153)

(cherry picked from commit ce00465d9b)

Co-authored-by: lwandz13 <126723338+lwandz13@users.noreply.github.com>
2023-04-07 11:06:53 -05:00
Grot (@grafanabot)
2f550d1f03 [v9.5.x] Docs: removes start server content, updates links (#66175)
Docs: removes start server content, updates links (#66172)

removes start server content, updates links

(cherry picked from commit 4a2d86750e)

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
2023-04-07 18:19:25 +03:00
Grot (@grafanabot)
5aecd7cf1f [v9.5.x] Docs: updates Grafana installation for Red Hat, Fedora, RHEL, SUSE, and OpenSUSE (#66169)
Docs: updates Grafana installation for Red Hat, Fedora, RHEL, SUSE, and OpenSUSE (#65232)

* removes references to CentOS

* starts reorg

* complete restructure

* updates alias

* Update docs/sources/setup-grafana/installation/rpm/index.md

* Apply suggestions from code review

Co-authored-by: Dan Cech <dcech@grafana.com>

* incorporates review feedback

* adds install on suse/opensuse

* updates aliases

* Apply suggestions from code review

Co-authored-by: Dan Cech <dcech@grafana.com>

* removes start server content from both topics; adds link to start server docs in Next steps

* Apply suggestions from code review

Co-authored-by: Dan Cech <dcech@grafana.com>

* incorporates review feedback

* Apply suggestions from code review

* typo fix

---------

Co-authored-by: Dan Cech <dcech@grafana.com>
(cherry picked from commit fcdbb7a86f)

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
2023-04-07 08:52:16 -05:00
Grot (@grafanabot)
1bb827d634 [v9.5.x] Alerting: Fix explore link in alert detail view (#66166)
Alerting: Fix explore link in alert detail view (#66106)

(cherry picked from commit cb8a5b2c96)

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2023-04-07 14:35:03 +02:00
Grot (@grafanabot)
3b67cebd40 [v9.5.x] Alerting: Fix docs link when creating or editing rules (#66164)
Alerting: Fix docs link when creating or editing rules (#66019)

(cherry picked from commit 3e12b72f58)

Co-authored-by: George Robinson <george.robinson@grafana.com>
2023-04-07 14:42:55 +03:00
Grot (@grafanabot)
8dac8ab37b [v9.5.x] Query Splitting: Fix for handling queries with no requestId (#66162)
Query Splitting: Fix for handling queries with no requestId (#66161)

Loki query splitting fix for when there's no request id

(cherry picked from commit 5dc529a55d)

Co-authored-by: Domas <domasx2@gmail.com>
2023-04-07 14:08:52 +03:00
Grot (@grafanabot)
c92d8591cb [v9.5.x] docs: nav updates for use dashboard topic (#66154)
docs: nav updates for use dashboard topic (#66151)

* updated main image and supporting text

* fixed icon name

* updated nav path

(cherry picked from commit 8600a8ce2e)

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
2023-04-06 16:50:31 -04:00
Grot (@grafanabot)
ab8994183d [v9.5.x] Docs: Small fixes for Template Variables Doc (#66139)
Docs: Small fixes for Template Variables Doc (#65947)

* Docs: Small fixes for Template Variables Doc

* Docs: Minor fix to Variables Docs

- Added missing word

* Update docs/sources/dashboards/variables/add-template-variables/index.md

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

* empty commit to trigger linting

* small change to trigger linting

---------

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
Co-authored-by: Isabel Matwawana <isabel.matwawana@grafana.com>
(cherry picked from commit 3685dd56e1)

Co-authored-by: sarah-spang <86264026+sarah-spang@users.noreply.github.com>
2023-04-06 14:34:44 -05:00
Grot (@grafanabot)
e47e901618 [v9.5.x] Alerting: Tiny refactor on the eval and schedule packages (#66133)
Alerting: Tiny refactor on the eval and schedule packages (#66130)

* Alerting: Tiny refactor on the eval and schedule packages

two very small things:

- We had a constructor on something called a `Context` which is not a `context.Context` so let's just name that constructor `NewContext`
- The user that we use to run query evaluations is the same (with some variation) abstract it to a function so that it can be re-used when necessary.

* Update pkg/services/ngalert/schedule/schedule.go

Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>

* Update pkg/services/ngalert/schedule/schedule.go

Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>

---------

Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
(cherry picked from commit 1c3ce0735f)

Co-authored-by: gotjosh <josue.abreu@gmail.com>
2023-04-06 18:56:53 +03:00
Grot (@grafanabot)
c9eff57efe [v9.5.x] Chore: remove console.log from search (#66128)
Chore: remove console.log from search (#66124)

(cherry picked from commit a6a4326820)

Co-authored-by: Josh Hunt <joshhunt@users.noreply.github.com>
2023-04-06 16:27:53 +03:00
Grot (@grafanabot)
5f73666f54 [v9.5.x] Docs: Add content to what's new 9.4 (#66123)
Docs: Add content to what's new 9.4 (#65895)

* Docs: Add content to what's new 9.4

* Update docs/sources/whatsnew/whats-new-in-v9-4.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/whatsnew/whats-new-in-v9-4.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

---------

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
(cherry picked from commit 75f5cb061e)

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2023-04-06 07:50:49 -05:00
Grot (@grafanabot)
a63d1714b5 [v9.5.x] docs: fixes link (#66069)
docs: fixes link (#66051)

* fixes link

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

Co-authored-by: melGL <81323402+melgl@users.noreply.github.com>

---------

Co-authored-by: melGL <81323402+melgl@users.noreply.github.com>
(cherry picked from commit 421b911c45)

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
2023-04-06 07:22:18 -05:00
mikkancso
9c7b4e0f3f [v9.5.x] Admin/Plugins: Change alert about Connections to subtitle (#65991)
Admin/Plugins: Change alert about Connections to subtitle  (#65913)

* change ConnectionRedirectNotice to a subtitle on Admin/Plugins

* cleanup ConnectionsRedirectNotice a bit
2023-04-06 14:07:50 +02:00
Grot (@grafanabot)
a013ee7be4 [v9.5.x] Plugins: Skip instrumenting plugin build info for core and bundled plugins (#66113)
Plugins: Skip instrumenting plugin build info for core and bundled plugins (#66105)

* only instrument plugin build for non core/bundled plugins

* fix import

(cherry picked from commit 7808e74260)

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2023-04-06 14:11:25 +03:00
Grot (@grafanabot)
734fb8a3e5 [v9.5.x] docs: fix broken data source tables (#66043)
fixe broken data source tables  (#66042)

fixed tables

(cherry picked from commit a378e34250)

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
2023-04-06 09:31:11 +01:00
Grot (@grafanabot)
ec109a913b [v9.5.x] Table: Fix migrations from old angular table for cell color modes (#66085)
Table: Fix migrations from old angular table for cell color modes  (#65760)

* Table: Fix migrations from old angular table

* Update defaults

(cherry picked from commit 3843c73162)

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2023-04-06 10:30:45 +03:00
Grot (@grafanabot)
7104dc3fef [v9.5.x] PieChart: Show long labels properly (#66083)
PieChart: Show long labels properly (#65699)

Fix label hidden when overflowing

(cherry picked from commit 91a61f1e0d)

Co-authored-by: Victor Marin <36818606+mdvictor@users.noreply.github.com>
2023-04-06 09:20:56 +02:00
Grot (@grafanabot)
a6a9e4e0ed [v9.5.x] XYChart: Add all dataset columns in tooltip (#66065)
XYChart: Add all dataset columns in tooltip (#65027)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
(cherry picked from commit df62bba354)

Co-authored-by: Victor Marin <36818606+mdvictor@users.noreply.github.com>
2023-04-05 15:55:53 -05:00
Grot (@grafanabot)
62e0b45067 [v9.5.x] PublicDashboards: fix collapsed rows queries (#66030)
PublicDashboards: fix collapsed rows queries (#66014)

(cherry picked from commit 232834f455)

Co-authored-by: Ezequiel Victorero <ezequiel.victorero@grafana.com>
2023-04-05 10:54:28 -03:00
Grot (@grafanabot)
0f0e2664cc [v9.5.x] Fix: DataLinks from data sources override user defined data link (#66031)
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
Co-authored-by: Alexa V <239999+axelavargas@users.noreply.github.com>
Fix: DataLinks from data sources override user defined data link (#65996)
2023-04-05 16:53:05 +03:00
Grot (@grafanabot)
1dc26665f3 [v9.5.x] PluginExtensions: Adding full targets to the panel menu context (#66020)
PluginExtensions: Adding full targets to the panel menu context (#65861)

* Making sure we add the whole query to the dashboard panel context.

* Adding some more tests.

* Synced with main.

(cherry picked from commit c8ecd0679b)

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
2023-04-05 15:14:44 +02:00
Grot (@grafanabot)
b68716e9eb [v9.5.x] Docs: Updated Grafana OSS Introduction (#66025)
Docs: Updated Grafana OSS Introduction (#66004)

* Added Phlare and added static data sources to intro instead of it just being TSDB sources

* Update docs/sources/introduction/_index.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/introduction/_index.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

---------

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
(cherry picked from commit e8813916c9)

Co-authored-by: Alex Close <alex.kirtley-close@grafana.com>
2023-04-05 08:14:16 -05:00
Grot (@grafanabot)
638a277364 [v9.5.x] PluginExtensions: Fixed issue in typings for the onClick link callback (#65979)
PluginExtensions: Fixed issue in typings for the onClick link callback (#65978)

* Fixed bug with event being forced.

* Made onClick undefinable in the config as well.

* Fixed some more type issues.

(cherry picked from commit 9719ee9bd3)

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
2023-04-05 09:05:51 +03:00
Grot (@grafanabot)
c7cc68649d [v9.5.x] Alerting: Use a completely isolated context for state history writes (#65969)
Alerting: Use a completely isolated context for state history writes (#64989)

* Add fresh context with timeout and same log properties, re-derive logger

* Unify timeout constants

* Move ctx after shortcut that got added through rebasing

* Unify timeouts

* Port opentracing's SpanFromContext and ContextFromSpan to the grafana tracing package

* Support both opentracing and otel variants

* Better document why we're creating a new ctx

* Add new func to FakeSpan which was added after rebase

* Support grafana-specific traceID key in both tracer implementations

(cherry picked from commit fb520edd72)

Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
2023-04-04 17:12:30 -05:00
Grot (@grafanabot)
119fb76938 [v9.5.x] Docs: Added note to contact Support (#65959)
Docs: Added note to contact Support (#65235)

* Added note to contact Support

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

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

* makes prettier

* Apply suggestions from code review

---------

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
Co-authored-by: Chris Moyer <chris.moyer@grafana.com>
(cherry picked from commit 445734888b)

Co-authored-by: melGL <81323402+melgl@users.noreply.github.com>
2023-04-04 13:41:24 -05:00
Grot (@grafanabot)
fbb66e6b9f [v9.5.x] Loki Query Splitting: Fix bug for mixed split durations (#65928)
Loki Query Splitting: Fix bug for mixed split durations (#65925)

* Query splitting: fix next request group pointer calculation

* Update unit test

(cherry picked from commit 44beef2e41)

Co-authored-by: Matias Chomicki <matyax@gmail.com>
2023-04-04 16:28:03 +02:00
Grot (@grafanabot)
ea8d17009f [v9.5.x] PluginExtensions: Fixed issue with incorrect type being exposed when configuring an extension (#65914)
PluginExtensions: Fixed issue with incorrect type being exposed when configuring an extension (#65910)

Fixed issue with wrong type required in configureExtensionLink

(cherry picked from commit 68796a9f31)

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
2023-04-04 15:40:19 +03:00
Grot (@grafanabot)
f34d0df862 Release: Bump version to 9.5.0 (#65888)
"Release: Updated versions in package to 9.5.0"
2023-04-04 09:43:02 +02:00
307 changed files with 6611 additions and 2645 deletions

View File

@@ -3139,27 +3139,20 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
[0, 0, 0, "Do not use any type assertions.", "2"],
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
[0, 0, 0, "Do not use any type assertions.", "4"],
[0, 0, 0, "Do not use any type assertions.", "5"],
[0, 0, 0, "Do not use any type assertions.", "6"],
[0, 0, 0, "Unexpected any. Specify a different type.", "4"],
[0, 0, 0, "Unexpected any. Specify a different type.", "5"],
[0, 0, 0, "Unexpected any. Specify a different type.", "6"],
[0, 0, 0, "Unexpected any. Specify a different type.", "7"],
[0, 0, 0, "Do not use any type assertions.", "8"],
[0, 0, 0, "Do not use any type assertions.", "9"],
[0, 0, 0, "Unexpected any. Specify a different type.", "10"],
[0, 0, 0, "Do not use any type assertions.", "11"],
[0, 0, 0, "Unexpected any. Specify a different type.", "9"],
[0, 0, 0, "Do not use any type assertions.", "10"],
[0, 0, 0, "Unexpected any. Specify a different type.", "11"],
[0, 0, 0, "Do not use any type assertions.", "12"],
[0, 0, 0, "Do not use any type assertions.", "13"],
[0, 0, 0, "Unexpected any. Specify a different type.", "14"],
[0, 0, 0, "Do not use any type assertions.", "14"],
[0, 0, 0, "Unexpected any. Specify a different type.", "15"],
[0, 0, 0, "Unexpected any. Specify a different type.", "16"],
[0, 0, 0, "Unexpected any. Specify a different type.", "17"],
[0, 0, 0, "Unexpected any. Specify a different type.", "18"],
[0, 0, 0, "Do not use any type assertions.", "19"],
[0, 0, 0, "Unexpected any. Specify a different type.", "20"],
[0, 0, 0, "Do not use any type assertions.", "21"],
[0, 0, 0, "Unexpected any. Specify a different type.", "22"],
[0, 0, 0, "Unexpected any. Specify a different type.", "23"],
[0, 0, 0, "Do not use any type assertions.", "24"]
[0, 0, 0, "Do not use any type assertions.", "17"]
],
"public/app/features/plugins/importPanelPlugin.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"]

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@
ARG BASE_IMAGE=alpine:3.17
ARG JS_IMAGE=node:18-alpine3.17
ARG JS_PLATFORM=linux/amd64
ARG GO_IMAGE=golang:1.20.1-alpine3.17
ARG GO_IMAGE=golang:1.20.3-alpine3.17
ARG GO_SRC=go-builder
ARG JS_SRC=js-builder
@@ -31,6 +31,8 @@ RUN yarn build
FROM ${GO_IMAGE} as go-builder
ARG COMMIT_SHA=""
ARG BUILD_BRANCH=""
ARG GO_BUILD_TAGS="oss"
ARG WIRE_TAGS="oss"
ARG BINGO="true"
@@ -62,7 +64,9 @@ COPY pkg pkg
COPY scripts scripts
COPY conf conf
COPY .github .github
COPY .git .git
ENV COMMIT_SHA=${COMMIT_SHA}
ENV BUILD_BRANCH=${BUILD_BRANCH}
RUN make build-go GO_BUILD_TAGS=${GO_BUILD_TAGS} WIRE_TAGS=${WIRE_TAGS}

View File

@@ -176,6 +176,8 @@ build-docker-full: ## Build Docker image for development.
--build-arg BINGO=false \
--build-arg GO_BUILD_TAGS=$(GO_BUILD_TAGS) \
--build-arg WIRE_TAGS=$(WIRE_TAGS) \
--build-arg COMMIT_SHA=$$(git rev-parse --short HEAD) \
--build-arg BUILD_BRANCH=$$(git rev-parse --abbrev-ref HEAD) \
--tag grafana/grafana$(TAG_SUFFIX):dev \
$(DOCKER_BUILD_ARGS)
@@ -187,8 +189,10 @@ build-docker-full-ubuntu: ## Build Docker image based on Ubuntu for development.
--build-arg BINGO=false \
--build-arg GO_BUILD_TAGS=$(GO_BUILD_TAGS) \
--build-arg WIRE_TAGS=$(WIRE_TAGS) \
--build-arg COMMIT_SHA=$$(git rev-parse --short HEAD) \
--build-arg BUILD_BRANCH=$$(git rev-parse --abbrev-ref HEAD) \
--build-arg BASE_IMAGE=ubuntu:20.04 \
--build-arg GO_IMAGE=golang:1.20.1 \
--build-arg GO_IMAGE=golang:1.20.3 \
--tag grafana/grafana$(TAG_SUFFIX):dev-ubuntu \
$(DOCKER_BUILD_ARGS)

View File

@@ -90,6 +90,14 @@ read_timeout = 0
#exampleHeader1 = exampleValue1
#exampleHeader2 = exampleValue2
#################################### GRPC Server #########################
[grpc_server]
network = "tcp"
address = "127.0.0.1:10000"
use_tls = false
cert_file =
key_file =
#################################### Database ############################
[database]
# You can configure the database connection by specifying type, host, name, user and password
@@ -405,6 +413,21 @@ default_home_dashboard_path =
# Upper limit of data sources that Grafana will return. This limit is a temporary configuration and it will be deprecated when pagination will be introduced on the list data sources API.
datasource_limit = 5000
################################### SQL Data Sources #####################
[sql_datasources]
# Default maximum number of open connections maintained in the connection pool
# when connecting to SQL based data sources
max_open_conns_default = 100
# Default maximum number of idle connections maintained in the connection pool
# when connecting to SQL based data sources
max_idle_conns_default = 100
# Default maximum connection lifetime used when connecting
# to SQL based data sources.
max_conn_lifetime_default = 14400
#################################### Users ###############################
[users]
# disable user signup / registration

View File

@@ -91,6 +91,14 @@
#exampleHeader1 = exampleValue1
#exampleHeader2 = exampleValue2
#################################### GRPC Server #########################
;[grpc_server]
;network = "tcp"
;address = "127.0.0.1:10000"
;use_tls = false
;cert_file =
;key_file =
#################################### Database ####################################
[database]
# You can configure the database connection by specifying type, host, name, user and password

View File

@@ -70,8 +70,8 @@ title: Grafana documentation
<h4>Provisioning</h4>
<p>Learn how to automate your Grafana configuration.</p>
</a>
<a href="{{< relref "whatsnew/whats-new-in-v9-4/" >}}" class="nav-cards__item nav-cards__item--guide">
<h4>What's new in v9.4</h4>
<a href="{{< relref "whatsnew/whats-new-in-v9-5/" >}}" class="nav-cards__item nav-cards__item--guide">
<h4>What's new in v9.5</h4>
<p>Explore the features and enhancements in the latest release.</p>
</a>

View File

@@ -46,7 +46,8 @@ By default, data sources in an organization can be queried by any user in that o
You can assign data source permissions to users, teams, and roles which will allow access to query or edit the data source.
1. Navigate to **Administration > Data sources**.
1. Click **Connections** in the left-side menu.
1. Under Your connections, click **Data sources**.
1. Select the data source to which you want to assign permissions.
1. On the Permissions tab, click **Add a permission**.
1. Select **User**, **Team**, or **Role**.
@@ -58,7 +59,8 @@ You can assign data source permissions to users, teams, and roles which will all
### Edit data source permissions for users, teams, or roles
1. Navigate to **Administration > Data sources**.
1. Click **Connections** in the left-side menu.
1. Under Your connections, click **Data sources**.
1. Select the data source for which you want to edit permissions.
1. On the Permissions tab, find the user, team, or role permission you want to update.
1. Select a different option in the **Permission** dropdown.
@@ -67,7 +69,8 @@ You can assign data source permissions to users, teams, and roles which will all
### Remove data source permissions for users, teams, or roles
1. Navigate to **Administration > Data sources**.
1. Click **Connections** in the left-side menu.
1. Under Your connections, click **Data sources**.
1. Select the data source from which you want to remove permissions.
1. On the Permissions tab, find the user, team, or role permission you want to remove.
1. Click the **X** next to the permission.
@@ -122,9 +125,10 @@ You must be an Org admin or Grafana admin to enable query caching for a data sou
By default, data source queries are not cached. To enable query caching for a single data source:
1. On the left-side menu, click **Administration > Data sources**.
1. Click **Connections** in the left-side menu.
1. Under Your Connections, click **Data sources**.
1. In the data source list, click the data source that you want to turn on caching for.
1. Open the Cache tab.
1. Go to the Cache tab.
1. Click **Enable**.
1. (Optional) Choose custom TTLs for the data source's queries and resources caching. If you skip this step, then Grafana uses the default TTL.
@@ -140,9 +144,10 @@ To configure global settings for query caching, refer to the [Query caching sect
To disable query caching for a single data source:
1. On the left-side menu, click **Administration > Data sources**.
1. Click **Connections** in the left-side menu.
1. Under Your Connections, click **Data sources**.
1. In the data source list, click the data source that you want to turn off caching for.
1. In the Cache tab, click **Disable**.
1. On the Cache tab, click **Disable**.
To disable query caching for an entire Grafana instance, set the `enabled` flag to `false` in the [Query caching section of Enterprise Configuration]({{< relref "../../setup-grafana/configure-grafana/enterprise-configuration/#caching" >}}). You will no longer see the Cache tab on any data sources, and no data source queries will be cached.
@@ -152,7 +157,8 @@ If you experience performance issues or repeated queries become slower to execut
> **Note:** This action impacts all cache-enabled data sources. If you are using Memcached, the system clears all data from the Memcached instance.
1. On the left-side menu, click **Administration > Data sources**.
1. Click **Connections** in the left-side menu.
1. Under Your Connections, click **Data sources**.
1. In the data source list, click the data source that you want to clear the cache for.
1. In the Cache tab, click **Clear cache**.

View File

@@ -52,8 +52,8 @@ There is more than one way to add the license to a Grafana instance:
This is the preferred option for single instance installations of Grafana Enterprise.
1. Sign in as a Grafana server administrator.
1. Navigate to **Server Admin > Upgrade** within Grafana.
1. Click **Upload license token file**.
1. Click **Administration > Stats and license** in the side navigation menu.
1. Click **Upload a new token**.
1. Select your license file, and upload it.
#### Put the `license.jwt` file into the data directory of Grafana
@@ -205,7 +205,7 @@ To determine the number of active users:
1. Sign in to Grafana Enterprise as a System Administrator.
1. Click **Administration** in the left-side menu.
1. Click **Administration** in the side navigation menu.
1. Click **Stats and license**.

View File

@@ -32,9 +32,9 @@ You can use AWS Marketplace to make the following modifications to your Grafana
1. Sign in to Grafana as a Server Administrator.
1. Click **Administration** in the left-side menu, and then **Stats and license**.
1. Click **Administration** in the side navigation menu, and then **Stats and license**.
1. In the **Token** section under **Enterprise License**, click **Renew License**.
1. In the **Token** section under **Enterprise License**, click **Renew token**.
This action retrieves updated license information from AWS.

View File

@@ -72,18 +72,20 @@ The Plugin catalog allows you to browse and manage plugins from within Grafana.
</video>
</div>
_Video shows the Plugin catalog in a previous version of Grafana._
In order to be able to install / uninstall / update plugins using plugin catalog, you must enable it via the `plugin_admin_enabled` flag in the [configuration]({{< relref "../../setup-grafana/configure-grafana/#plugin_admin_enabled" >}}) file.
Before following the steps below, make sure you are logged in as a Grafana administrator.
<a id="#plugin-catalog-entry"></a>
- Administrators can find the Plugin catalog at **Configuration > Plugins**.
Administrators can find the Plugin catalog at **Administration > Plugins**.
### Browse plugins
To browse for available plugins:
1. In Grafana, [navigate to the Plugin catalog](#plugin-catalog-entry) to view installed plugins.
1. In Grafana, click **Administration > Plugins** in the side navigation menu to view installed plugins.
1. Click the **All** filter to browse all available plugins.
1. Click the **Data sources**, **Panels**, or **Applications** buttons to filter by plugin type.
@@ -91,7 +93,7 @@ To browse for available plugins:
To install a plugin:
1. In Grafana, [navigate to the Plugin catalog](#plugin-catalog-entry) to view installed plugins.
1. In Grafana, click **Administration > Plugins** in the side navigation menu to view installed plugins.
1. Browse and find a plugin.
1. Click on the plugin logo.
1. Click **Install**.
@@ -102,7 +104,7 @@ When the update is complete, you see a confirmation message that the installatio
To update a plugin:
1. In Grafana, [navigate to the Plugin catalog](#plugin-catalog-entry) to view installed plugins.
1. In Grafana, click **Administration > Plugins** in the side navigation menu to view installed plugins.
1. Click on the plugin logo.
1. Click **Update**.
@@ -112,7 +114,7 @@ When the update is complete, you see a confirmation message that the update was
To uninstall a plugin:
1. In Grafana, [navigate to the Plugin catalog](#plugin-catalog-entry) to view installed plugins.
1. In Grafana, click **Administration > Plugins** in the side navigation menu to view installed plugins.
1. Click on the plugin logo.
1. Click **Uninstall**.

View File

@@ -7,6 +7,10 @@ keywords:
- query
- queries
- recorded
labels:
products:
- cloud
- enterprise
title: Recorded queries
weight: 300
---

View File

@@ -3,6 +3,11 @@ aliases:
- ../../enterprise/access-control/
- ../../enterprise/access-control/about-rbac/
- ../../enterprise/access-control/roles/
cascade:
labels:
products:
- cloud
- enterprise
description: Role-based access control (RBAC) provides a standardized way of granting,
changing, and revoking access so that users can view and modify Grafana resources,
such as users and reports.

View File

@@ -31,7 +31,8 @@ In [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}})
> **Note:** Service accounts can only act in the organization they are created for. If you have the same task that is needed for multiple organizations, we recommend creating service accounts in each organization.
{{< vimeo 742056367 >}}
<br>
_Video shows service accounts in Grafana v9.1. Refer to [Create a service account in Grafana]({{< relref "#create-a-service-account-in-grafana" >}}) for current instructions._
## Service account tokens

View File

@@ -19,6 +19,8 @@ Grafana Alerting is available for Grafana OSS, Grafana Enterprise, or Grafana Cl
Watch this video to learn more about Grafana Alerting: {{< vimeo 720001629 >}}
_Video shows Alerting in Grafana v9.0. Refer to [Manage your alert rules]({{< relref "../alerting/alerting-rules/" >}}) for current instructions._
## Overview
The following diagram gives you an overview of how Grafana Alerting works and introduces you to some of the key concepts that work together and form the core of our flexible and powerful alerting engine.

View File

@@ -8,30 +8,45 @@ keywords:
- guide
- rules
- create
title: Create Grafana managed alert rules
title: Create Grafana-managed alert rules
weight: 400
---
# Create a Grafana managed alerting rule
# Create Grafana-managed alert rules
Grafana allows you to create alerting rules that query one or more data sources, reduce or transform the results and compare them to each other or to fixed thresholds. When these are executed, Grafana sends notifications to the contact point. For information on Grafana Alerting, see [About Grafana Alerting]({{< relref "../" >}}) which explains the various components of Grafana Alerting. We also recommend that you familiarize yourself with some of the [fundamental concepts]({{< relref "../fundamentals/" >}}) of Grafana Alerting.
Grafana-managed rules are the most flexible alert rule type. They allow you to create alerts that can act on data from any of our supported data sources. In addition to supporting multiple data sources, you can also add expressions to transform your data and set alert conditions. Using images in alert notifications is also supported. This is the only type of rule that allows alerting from multiple data sources in a single rule definition.
Multiple alert instances can be created as a result of one alert rule (also known as a multi-dimensional alerting).
For information on Grafana Alerting, see [Introduction to Grafana Alerting](/docs/grafana/next/alerting/fundamentals/), which explains the key concepts and features of Grafana Alerting.
Watch this video to learn more about creating alerts: {{< vimeo 720001934 >}}
## Add Grafana managed rule
_Video shows Alerting in Grafana v9.0. Refer to [Add Grafana managed rule]({{< relref "#add-grafana-managed-rule" >}}) (following) for current instructions._
To create a Grafana-managed alert rule, complete the following steps.
1. In the left-side menu, click **Alerts & IRM** and then **Alerting**.
1. Click **Alert rules**.
1. Click **+ Create alert rule**. The new alerting rule page opens where the **Grafana managed alerts** option is selected by default.
1. In Step 1, add the rule name.
2. Click **Alert rules**.
3. Click **+ Create alert rule**. The new alert rule page opens where the **Grafana managed alerts** option is selected by default.
4. In Step 1, add the rule name.
- In **Rule name**, add a descriptive name. This name is displayed in the alert rule list. It is also the `alertname` label for every alert instance that is created from this rule.
1. In Step 2, add queries and expressions to evaluate, and then select the alert condition.
5. In Step 2, add queries and expressions to evaluate, and then select the alert condition.
- For queries, select a data source from the dropdown.
- Specify a [time range](/docs/grafana/latest/dashboards/use-dashboards/?pg=blog&plcmt=body-txt#time-units-and-relative-ranges).
**Note:**
Grafana Alerting only supports fixed relative time ranges, for example, `now-24hr: now`.
It does not support absolute time ranges: `2021-12-02 00:00:00 to 2021-12-05 23:59:592` or semi-relative time ranges: `now/d to: now`.
- Add one or more [queries]({{< relref "/docs/grafana/latest/panels-visualizations/query-transform-data#add-a-query" >}}) or [expressions]({{< relref "/docs/grafana/latest/panels-visualizations/query-transform-data/expression-queries" >}}).
- For each expression, select either **Classic condition** to create a single alert rule, or choose from the **Math**, **Reduce**, and **Resample** options to generate separate alert for each series. For details on these options, see [Single and multi dimensional rule](#single-and-multi-dimensional-rule).
- Click **Run queries** to verify that the query is successful.
- Next, select the query or expression for your alert condition.
1. In Step 3, specify the alert evaluation interval.
6. In Step 3, specify the alert evaluation interval.
- From the **Condition** dropdown, select the query or expression to trigger the alert rule.
- For **Evaluate every**, specify the frequency of evaluation. Must be a multiple of 10 seconds. For examples, `1m`, `30s`.
@@ -44,17 +59,17 @@ Watch this video to learn more about creating alerts: {{< vimeo 720001934 >}}
You can pause alert rule evaluation to prevent noisy alerting while tuning your alerts. Pausing stops alert rule evaluation and does not create any alert instances. This is different to mute timings, which stop notifications from being delivered, but still allow for alert rule evaluation and the creation of alert instances.
1. In Step 4, add the storage location, rule group, as well as additional metadata associated with the rule.
7. In Step 4, add the storage location, rule group, as well as additional metadata associated with the rule.
- From the **Folder** dropdown, select the folder where you want to store the rule.
- For **Group**, specify a pre-defined group. Newly created rules are appended to the end of the group. Rules within a group are run sequentially at a regular interval, with the same evaluation time.
- Add a description and summary to customize alert messages. Use the guidelines in [Annotations and labels for alerting]({{< relref "../fundamentals/annotation-label/" >}}).
- Add Runbook URL, panel, dashboard, and alert IDs.
1. In Step 5, add custom labels.
8. In Step 5, add custom labels.
- Add custom labels selecting existing key-value pairs from the drop down, or add new labels by entering the new key or value .
1. Click **Save** to save the rule or **Save and exit** to save the rule and go back to the Alerting page.
1. Next, create a for the rule.
9. Click **Save** to save the rule or **Save and exit** to save the rule and go back to the Alerting page.
10. Next, create a for the rule.
### Single and multi dimensional rule
### Single and multi-dimensional rule
For Grafana managed alerts, you can create a rule with a classic condition or you can create a multi-dimensional rule.
@@ -62,7 +77,9 @@ For Grafana managed alerts, you can create a rule with a classic condition or yo
Use the classic condition expression to create a rule that triggers a single alert when its condition is met. For a query that returns multiple series, Grafana does not track the alert state of each series. As a result, Grafana sends only a single alert even when alert conditions are met for multiple series.
**Multi dimensional rule**
For more information, see [expressions documentation]({{< relref "/docs/grafana/latest/panels-visualizations/query-transform-data/expression-queries" >}}).
**Multi-dimensional rule**
To generate a separate alert for each series, create a multi-dimensional rule. Use `Math`, `Reduce`, or `Resample` expressions to create a multi-dimensional rule. For example:
@@ -73,22 +90,24 @@ To generate a separate alert for each series, create a multi-dimensional rule. U
> **Note:** Grafana does not support alert queries with template variables. More information is available at <https://community.grafana.com/t/template-variables-are-not-supported-in-alert-queries-while-setting-up-alert/2514>.
#### Rule with classic condition
### Configure no data and error handling
For more information, see [expressions documentation]({{< relref "/docs/grafana/latest/panels-visualizations/query-transform-data/expression-queries" >}}).
Configure alerting behavior when your alert rule evaluation returns no data or an error.
### No data and error handling
**Note:** Alert rules that are configured to fire when an evaluation returns no data or error only fire when the entire duration of the evaluation period has finished. This means that rather than immediately firing when the alert rule condition is breached, the alert rule waits until the time set as the **For** field has finished and then fires, reducing alert noise and allowing for temporary data availability issues.
Configure alerting behavior in the absence of data using information in the following tables.
If your alert rule evaluation returns no data, you can set the state on your alert rule to appear as follows:
| No Data Option | Description |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| No Data | Create a new alert `DatasourceNoData` with the name and UID of the alert rule, and UID of the datasource that returned no data as labels. |
| Alerting | Set alert rule state to `Alerting`. This option will respect the configured **Evaluate for** pending period. |
| Ok | Set alert rule state to `Normal`. |
| No Data | Description |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| No Data | Creates a new alert `DatasourceNoData` with the name and UID of the alert rule, and UID of the datasource that returned no data as labels. |
| Alerting | Sets alert rule state to `Alerting`. The alert rule waits until the time set in the **For** field has finished before firing. |
| Ok | Sets alert rule state to `Normal`. |
| Error or timeout option | Description |
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| Error | Create a new alert `DatasourceError` with the name and UID of the alert rule, and UID of the datasource that returned no data as labels. |
| Alerting | Set alert rule state to `Alerting`. This option will respect the configured **Evaluate for** pending period. |
| OK | Set alert rule state to `Normal` |
If your evaluation returns an error, you can set the state on your alert rule to appear as follows:
| Error | Description |
| -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| Error | Creates an alert instance `DatasourceError` with the name and UID of the alert rule, and UID of the datasource that returned no data as labels. |
| Alerting | Sets alert rule state to `Alerting`. The alert rule waits until the time set in the **For** field has finished before firing. |
| Ok | Sets alert rule state to `Normal`. |

View File

@@ -30,6 +30,8 @@ Grafana allows you to create alerting rules for an external Grafana Mimir or Lok
Watch this video to learn more about how to create a Mimir managed alert rule: {{< vimeo 720001865 >}}
_Video shows Alerting in Grafana v8.5. Refer to [Add a Grafana Mimir or Loki managed alerting rule]({{< relref "#add-a-grafana-mimir-or-loki-managed-alerting-rule" >}}) (following) for current instructions._
> **Note:** If you do not want to manage alerting rules for a particular Loki or Prometheus data source, go to its settings and clear the **Manage alerts via Alerting UI** checkbox.
## Add a Grafana Mimir or Loki managed alerting rule

View File

@@ -54,6 +54,6 @@ The following table lists the contact point integrations supported by Grafana.
## Useful links
[Manage contact points](/docs/grafana/next/alerting/manage-notifications/create-contact-point/)
[Manage contact points](/docs/grafana/latest/alerting/manage-notifications/create-contact-point/)
[Create and edit notification templates](/docs/grafana/next/alerting/manage-notifications/create-message-template/)
[Create and edit notification templates](/docs/grafana/latest/alerting/manage-notifications/template-notifications/create-notification-templates/)

View File

@@ -1,6 +1,5 @@
---
description: Configure integrations
draft: true
keywords:
- Grafana
- alerting
@@ -14,7 +13,7 @@ weight: 100
# Configure integrations
Configure integrations in Grafana to select your preferred communication channel for receiving notifications when your alert rules are fire. Each integration has its own configuration options and setup process. In most cases, this involves providing an API key or a Webhook URL.
Configure integrations in Grafana to select your preferred communication channel for receiving notifications when your alert rules are firing. Each integration has its own configuration options and setup process. In most cases, this involves providing an API key or a Webhook URL.
Once configured, you can use integrations as part of your contact points to receive notifications whenever your alert changes its state. In this section, we'll cover the basic steps to configure your integrations, so you can start receiving real-time alerts and stay on top of your monitoring data.

View File

@@ -71,6 +71,16 @@ The name of the annotation is {{ .Name }}, and the value is {{ .Value }}
{{ end }}
```
## The index function
To print a specific annotation or label use the `index` function.
```
{{ range .Alerts }}
The name of the alert is {{ index .Labels "alertname" }}
{{ end }}
```
## If statements
You can use if statements in templates. For example, to print `There are no alerts` if there are no alerts in `.Alerts` you would write the following:

View File

@@ -24,22 +24,21 @@ There are three options to choose from:
For more information on the Alerting Provisioning HTTP API, refer to [Alerting provisioning API](https://grafana.com/docs/grafana/latest/developers/http_api/alerting_provisioning/).
**Note:**
Typically, you cannot edit API-provisioned alert rules from the Grafana UI.
In order to enable editing, add the x-disable-provenance header to the following requests when creating or editing your alert rules in the API:
POST /api/v1/provisioning/alert-rules
PUT /api/v1/provisioning/alert-rules/{UID}
1. Provision your alerting resources using Terraform.
**Note:**
Currently, provisioning for Grafana Alerting supports alert rules, contact points, mute timings, and templates. Provisioned alerting resources using file provisioning or Terraform can only be edited in the source that created them and not from within Grafana or any other source. For example, if you provision your alerting resources using files from disk, you cannot edit the data in Terraform or from within Grafana.
To allow editing of provisioned resources in the Grafana UI, add the `X-Disable-Provenance` header to the following requests in the API:
- `POST /api/v1/provisioning/alert-rules`
- `PUT /api/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}` (calling this endpoint will change provenance for all alert rules within the alert group)
- `POST /api/v1/provisioning/contact-points`
- `POST /api/v1/provisioning/mute-timings`
- `PUT /api/v1/provisioning/policies`
- `PUT /api/v1/provisioning/templates/{name}`
**Useful Links:**
[Grafana provisioning](/docs/grafana/latest/administration/provisioning/)

View File

@@ -25,8 +25,8 @@ When you create a library panel, the panel on the source dashboard is converted
1. Open a panel in edit mode.
1. In the panel display options, click the down arrow option to bring changes to the visualization.
{{< figure src="/static/img/docs/library-panels/create-lib-panel-from-edit-8-0.png" class="docs-image--no-shadow" max-width= "800px" caption="Screenshot of the edit panel" >}}
1. Click the **Library panels** option, and then click **Create library panel** to open the create dialog.
{{< figure src="/media/docs/grafana/panels-visualizations/screenshot-create-lib-panel-from-edit-9-5.png" class="docs-image--no-shadow" max-width= "800px" >}}
1. Click **Library panels**, and then click **+ Create library panel** to open the create dialog.
1. In **Library panel name**, enter the name.
1. In **Save in folder**, select the folder to save the library panel.
1. Click **Create library panel** to save your changes.
@@ -34,14 +34,16 @@ When you create a library panel, the panel on the source dashboard is converted
Once created, you can modify the library panel using any dashboard on which it appears. After you save the changes, all instances of the library panel reflect these modifications.
{{< figure src="/static/img/docs/library-panels/create-from-more-8-0.png" class="docs-image--no-shadow" max-width= "900px" caption="Screenshot of the edit panel" >}}
You can also create a library panel directly from the edit menu of any panel.
{{< figure src="/media/docs/grafana/panels-visualizations/screenshot-create-from-more-9-5.png" class="docs-image--no-shadow" max-width= "900px" >}}
## Add a library panel to a dashboard
Add a Grafana library panel to a dashboard when you want to provide visualizations to other dashboard users.
1. Click **Dashboards** in the left-side menu.
1. Click **New** and select **New Dashboard**.
1. Click **New** and select **New Dashboard** in the dropdown.
1. On the empty dashboard, click **+ Import library panel**.
You will see a list of your library panels.
@@ -60,6 +62,7 @@ Unlink a library panel when you want to make a change to the panel and not affec
1. Hover over any part of the panel to display the actions menu on the top right corner.
1. Click the menu and select **Edit**.
1. Click **Unlink** on the top right corner of the page.
1. Click **Yes, unlink**.
## View a list of library panels
@@ -69,7 +72,7 @@ You can view a list of available library panels and search for a library panel.
1. Click **Library panels**.
You can see a list of previously defined library panels.
{{< figure src="/static/img/docs/library-panels/library-panel-list-8-0.png" class="docs-image--no-shadow" max-width= "900px" caption="Screenshot of the edit panel" >}}
{{< figure src="/media/docs/grafana/panels-visualizations/screenshot-library-panel-list-9-5.png" class="docs-image--no-shadow" max-width= "900px" >}}
1. Search for a specific library panel if you know its name.

View File

@@ -17,7 +17,7 @@ weight: 400
Whenever you save a version of your dashboard, a copy of that version is saved so that previous versions of your dashboard are never lost. A list of these versions is available by entering the dashboard settings and then selecting "Versions" in the left side menu.
<img class="no-shadow" src="/static/img/docs/v50/dashboard_versions_list.png">
![Dashboards versions list](/media/docs/grafana/dashboards/screenshot-dashboard-versions-list.png)
The dashboard version history feature lets you compare and restore to previously saved dashboard versions.
@@ -25,20 +25,18 @@ The dashboard version history feature lets you compare and restore to previously
To compare two dashboard versions, select the two versions from the list that you wish to compare. Once selected, the "Compare versions" button will become clickable. Click the button to view the diff between the two versions.
<img class="no-shadow" src="/static/img/docs/v50/dashboard_versions_select.png">
![Dashboard versions selected](/media/docs/grafana/dashboards/screenshot-dashboard-versions-select.png)
Upon clicking the button, you'll be brought to the diff view. By default, you'll see a textual summary of the changes, like in the image below.
<img class="no-shadow" src="/static/img/docs/v50/dashboard_versions_diff_basic.png">
![Dashboards versions diff](/media/docs/grafana/dashboards/screenshot-dashboard-versions-diff-basic.png)
If you want to view the diff of the raw JSON that represents your dashboard, you can do that as well by clicking the "View JSON Diff" button at the bottom.
If you want to restore to the version you are diffing against, you can do so by clicking the "Restore to version \<x\>" button in the top right.
If you want to view the diff of the raw JSON that represents your dashboard, you can do that as well by clicking the expand icon for the View JSON Diff section at the bottom.
## Restoring to a previously saved dashboard version
If you need to restore to a previously saved dashboard version, you can do so by either clicking the "Restore" button on the right of a row in the dashboard version list, or by clicking the "Restore to version \<x\>" button appearing in the diff view. Clicking the button will bring up the following popup prompting you to confirm the restoration.
If you need to restore to a previously saved dashboard version, you can do so by either clicking the "Restore" button on the right of a row in the dashboard version list, or by clicking the **Restore to version \<x\>** button appearing in the diff view. Clicking the button will bring up the following popup prompting you to confirm the restoration.
<img class="no-shadow" src="/static/img/docs/v50/dashboard_versions_restore.png">
![Restore dashboard version](/media/docs/grafana/dashboards/screenshot-dashboard-versions-restore.png)
After restoring to a previous version, a new version will be created containing the same exact data as the previous version, only with a different version number. This is indicated in the "Notes column" for the row in the new dashboard version. This is done simply to ensure your previous dashboard versions are not affected by the change.

View File

@@ -26,21 +26,22 @@ Use the information in this section to access existing playlists. Start and cont
### Access a playlist
1. Hover your cursor over Grafanas side menu.
1. Click **Playlists**. You will see a list of existing playlists.
1. Click **Dashboards** in the left-side menu.
1. Click **Playlists** to see a list of existing playlists.
### Start a playlist
You can start a playlist in five different view modes. View mode determine how the menus and navigation bar appear on the dashboards.
You can start a playlist in five different view modes. View modes determine how the menus and navigation bar appear on the dashboards.
By default, each dashboard is displayed for the amount of time entered in the Interval field, which you set when you create or edit a playlist. After you start a playlist, you can control it with the navbar at the top of the page.
1. [Access](#access-playlist) the playlist page to see a list of existing playlists.
1. Find the playlist you want to start, then click **Start playlist**. The start playlist dialog opens.
1. Select one of the five playlist modes available based on the information in the following table.
1. Click **Start <playlist name>**.
1. Click **Dashboards** in the left-side menu.
1. Click **Playlists** to see a list of existing playlists.
1. Find the playlist you want to start, then click **Start playlist**.
1. In the modal that opens, select one of the five playlist modes available, based on the information in the table below.
1. Click **Start \<playlist name\>**.
The playlist displays each dashboard for the time specified in the `Interval` field, set when creating or editing a playlist. Once a playlist starts, you can [control](#control-a-playlist) it using the navbar at the top of your screen.
The playlist displays each dashboard for the time specified in the **Interval** field, set when creating or editing a playlist. Once a playlist starts, you can [control](#control-a-playlist) it using the navbar at the top of your screen.
| Mode | Description |
| --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -67,7 +68,9 @@ You can control a playlist in **Normal** or **TV** mode after it's started, usin
You can create a playlist to present dashboards in a sequence, with a set order and time interval between dashboards.
1. In the playlist page, click **New playlist**. The New playlist page opens.
1. Click **Dashboards** in the left-side menu.
1. Click **Playlists** to see a list of existing playlists.
1. Click **New playlist**. The New playlist page opens.
1. In the **Name** text box, enter a descriptive name.
1. In the **Interval** text box, enter a time interval. Grafana displays a particular dashboard for the interval of time specified here before moving on to the next dashboard.
1. In Dashboards, add existing dashboards to the playlist using **Add by title** and **Add by tag** drop-down options. The dashboards you add are listed in a sequential order.
@@ -82,8 +85,8 @@ You can create a playlist to present dashboards in a sequence, with a set order
You can save a playlist and add it to your **Playlists** page, where you can start it. Be sure that all the dashboards you want to appear in your playlist are added when creating or editing the playlist before saving it.
1. To access the Playlist feature, hover your cursor over Grafana's side menu.
1. Click **Playlists**.
1. Click **Dashboards** in the left-side menu.
1. Click **Playlists** to see a list of existing playlists.
1. Click on the playlist.
1. Edit the playlist.
1. Ensure that your playlist has a **Name**, **Interval**, and at least one **Dashboard** added to it.
@@ -95,36 +98,47 @@ You can edit a playlist by updating its name, interval time, and by adding, remo
### Edit a playlist
1. In the playlist page, click **Edit playlist**. The Edit playlist page opens.
1. Click **Dashboards** in the left-side menu.
1. Click **Playlists** to see a list of existing playlists.
1. Find the playlist you want to update and click **Edit playlist**.
1. Update the name and time interval, then add or remove dashboards from the playlist using instructions in [Create a playlist](#create-a-playlist).
1. Click **Save** to save your changes.
### Delete a playlist
1. Click **Playlists**.
1. Next to the Playlist you want to delete, click **Remove[x]**.
1. Click **Dashboards** in the left-side menu.
1. Click **Playlists** to see a list of existing playlists.
1. Find the playlist you want to remove.
1. Click **Delete playlist**.
### Rearrange dashboard order
1. Next to the dashboard you want to move, click the up or down arrow.
1. Click **Dashboards** in the left-side menu.
1. Click **Playlists** to see a list of existing playlists.
1. Find the playlist you want to update and click **Edit playlist**.
1. Click and drag the dashboards into your desired order.
1. Click **Save** to save your changes.
### Remove a dashboard
1. Click **Remove[x]** to remove a dashboard from the playlist.
1. Click **Dashboards** in the left-side menu.
1. Click **Playlists** to see a list of existing playlists.
1. Find the playlist you want to update and click **Edit playlist**.
1. Click **\[x\]** on the name of the dashboard you want to remove from the playlist.
1. Click **Save** to save your changes.
## Share a playlist in a view mode
You can share a playlist by copying the link address on the view mode you prefer, and pasting the URL to your destination.
1. From the Dashboards submenu, click **Playlists**.
1. Next to the playlist you want to share, click **Start playlist**.
1. In the dropdown, right click the view mode you prefer.
1. Click **Copy Link Address** to copy the URL to your clipboard.
1. Click **Dashboards** in the left-side menu.
1. Click **Playlists** to see a list of existing playlists.
1. Click the share icon of the playlist you want to share.
1. Select the view mode you prefer.
1. Click **Copy** next to the Link URL to copy it to your clipboard.
Example: The URL for the first playlist on the Grafana Play site in Kiosk mode will look like this:
For example, the URL for the first playlist on the Grafana Play site in Kiosk mode will look like this:
[https://play.grafana.org/playlists/play/1?kiosk](https://play.grafana.org/playlists/play/1?kiosk).
[https://play.grafana.org/playlists/play/1?kiosk](https://play.grafana.org/playlists/play/1?kiosk).
1. Paste the URL to your destination.
1. Paste the URL to your destination.

View File

@@ -43,10 +43,11 @@ When [RBAC]({{< relref "../../administration/roles-and-permissions/access-contro
Only organization administrators can create reports by default. You can customize who can create reports with [Role-based access control]({{< relref "../../administration/roles-and-permissions/access-control/" >}}).
1. Click on the Reports icon in the side navigation menu.
1. Click **Dashboards > Reports** in the side navigation menu.
The Reports tab allows you to view, create, and update your reports. The report form has a multi-step layout. The steps do not need to be completed in succession and can be skipped over by clicking a step name.
The Reports page allows you to view, create, and update your reports. The report form has a multi-step layout. The steps do not need to be completed in succession and can be skipped over by clicking a step name.
1. Click **+ Create a new report**.
1. Select report dashboard.
- **Source dashboard:** Select the dashboard from which you want to generate the report.
- **Time range:** (optional) Use custom time range for the report. For more information, refer to [Report time range]({{< relref "#report-time-range" >}}).
@@ -183,7 +184,7 @@ You can generate and save PDF files of any dashboard.
> **Note:** Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) version 6.7 and later, and [Grafana Cloud Pro and Advanced](/docs/grafana-cloud/).
1. In the upper-right corner of the dashboard that you want to export as PDF, click the **Share dashboard** icon.
1. In the dashboard that you want to export as PDF, click the **Share dashboard** icon.
1. On the PDF tab, select a layout option for the exported dashboard: **Portrait** or **Landscape**.
1. Click **Save as PDF** to render the dashboard as a PDF file.
@@ -230,7 +231,7 @@ font_italic = DejaVuSansCondensed-Oblique.ttf
> **Note:** Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) version 7.2 and later, and [Grafana Cloud Pro and Advanced](/docs/grafana-cloud/).
You can configure organization-wide report settings in the **Settings** tab on the **Reporting** page. Settings are applied to all the reports for current organization.
You can configure organization-wide report settings in the **Settings** under **Dashboards > Reporting**. Settings are applied to all the reports for current organization.
You can customize the branding options.

View File

@@ -48,14 +48,16 @@ Folders help you organize and group dashboards, which is useful when you have ma
**To create a dashboard folder:**
1. Sign in to Grafana and on the side menu, click **Dashboards > New folder**.
1. Sign in to Grafana.
1. Click **Dashboards** in the left-side menu.
1. On the Dashboards page, click **New** and select **New folder** in the dropdown.
1. Enter a unique name and click **Create**.
When you save a dashboard, you can either select a folder for the dashboard to be saved in or create a new folder.
## Manage dashboards
On the **Manage dashboards and folders** page, you can:
On the Dashboards page, you can:
- create a folder
- create a dashboard
@@ -65,17 +67,17 @@ On the **Manage dashboards and folders** page, you can:
### Dashboard folder page
You can complete the following tasks on the **Dashboard Folder** page:
You can complete the following tasks on a dashboard folder page:
- Move or delete dashboards in a folder
- Rename a folder (available under the **Settings** tab)
- Rename a folder (available on the Settings tab)
- Assign permissions to folders (which are inherited by the dashboards in the folder)
To navigate to the dashboard folder page, click the cog appears when you hover over a folder in the dashboard search result list or the **Manage dashboards and folders** page.
To navigate to the dashboard folder page, hover over the name of the folder and click **Go to folder** in the dashboard search result list or on the Dashboards page.
### Dashboard permissions
You can assign permissions to a folder. Any permissions you assign are inherited by the dashboards in the folder. An Access Control List (ACL) is used where **Organization Role**, **Team** and a **User** can be assigned permissions.
You can assign permissions to a folder. Any permissions you assign are inherited by the dashboards in the folder. An Access Control List (ACL) is used where **Organization Role**, **Team**, and a **User** can be assigned permissions.
For more information about dashboard permissions, refer to [Dashboard permissions]({{< relref "../../administration/roles-and-permissions/#dashboard-permissions" >}}).
@@ -87,10 +89,11 @@ You can use the Grafana UI or the [HTTP API]({{< relref "../../developers/http_a
The dashboard export action creates a Grafana JSON file that contains everything you need, including layout, variables, styles, data sources, queries, and so on, so that you can later import the dashboard.
1. Click **Dashboards** in the left-side menu.
1. Open the dashboard you want to export.
2. Click the **Share** icon.
3. Click **Export**.
4. Click **Save to file**.
1. Click the **Share** icon.
1. Click **Export**.
1. Click **Save to file**.
Grafana downloads a JSON file to your local machine.
@@ -102,7 +105,8 @@ A template variable of the type `Constant` will automatically be hidden in the d
### Import a dashboard
1. Click **Dashboards > Import** in the side menu.
1. Click **Dashboards** in the left-side menu.
1. Click **New** and select **Import** in the dropdown menu.
1. Perform one of the following steps:
- Upload a dashboard JSON file
@@ -118,7 +122,7 @@ The import process enables you to change the name of the dashboard, pick the dat
Find dashboards for common server applications at [Grafana.com/dashboards](https://grafana.com/dashboards).
{{< figure src="/static/img/docs/v50/gcom_dashboard_list.png" max-width="700px" >}}
{{< figure src="/media/docs/grafana/dashboards/screenshot-gcom-dashboards.png" >}}
## Troubleshoot dashboards

View File

@@ -52,10 +52,11 @@ You can share a dashboard as a direct link or as a snapshot. You can also export
> **Note:** If you change a dashboard, ensure that you save the changes before sharing.
1. Navigate to the home page of your Grafana instance.
1. Click on the share icon in the top navigation.
1. Click **Dashboards** in the left-side menu.
1. Click the dashboard you want to share.
1. Click the share icon at the top of the screen.
The share dialog opens and shows the **Link** tab.
The share dialog opens and shows the Link tab.
### Share a direct link
@@ -73,7 +74,8 @@ A dashboard snapshot shares an interactive dashboard publicly. Grafana strips se
You can publish snapshots to your local instance or to [snapshots.raintank.io](http://snapshots.raintank.io). The latter is a free service provided by Grafana Labs that enables you to publish dashboard snapshots to an external Grafana instance. Anyone with the link can view it. You can set an expiration time if you want the snapshot removed after a certain time period.
1. Click **Local Snapshot** or **Publish to snapshots.raintank.io**.
1. Click the **Snapshot** tab.
1. Click **Publish to snapshots.raintank.io** or **Local Snapshot**.
Grafana generates a link of the snapshot.
@@ -91,7 +93,9 @@ You can generate and save PDF files of any dashboard.
> **Note:** Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}).
1. In the upper-right corner of the dashboard that you want to export as PDF, click the **Share dashboard** icon.
1. Click **Dashboards** in the left-side menu.
1. Click the dashboard you want to share.
1. Click the share icon at the top of the screen.
1. On the PDF tab, select a layout option for the exported dashboard: **Portrait** or **Landscape**.
1. Click **Save as PDF** to render the dashboard as a PDF file.
@@ -101,8 +105,8 @@ You can generate and save PDF files of any dashboard.
You can share a panel as a direct link, as a snapshot, or as an embedded link. You can also create library panels using the **Share** option on any panel.
1. Click a panel title to open the panel menu.
1. Click **Share**.
1. Hover over any part of the panel to display the actions menu on the top right corner.
1. Click the menu and select **Share**.
The share dialog opens and shows the **Link** tab.
@@ -139,8 +143,8 @@ A panel snapshot shares an interactive panel publicly. Grafana strips sensitive
You can publish snapshots to your local instance or to [snapshots.raintank.io](http://snapshots.raintank.io). The latter is a free service provided by [Grafana Labs](https://grafana.com), that enables you to publish dashboard snapshots to an external Grafana instance. You can optionally set an expiration time if you want the snapshot to be removed after a certain time period.
1. In the **Share Panel** dialog, click **Snapshot** to open the tab.
1. Click **Local Snapshot** or **Publish to snapshots.raintank.io**.
1. In the **Share Panel** dialog, click **Snapshot** to go to the tab.
1. Click **Publish to snapshots.raintank.io** or **Local Snapshot**.
Grafana generates the link of the snapshot.

View File

@@ -27,27 +27,28 @@ The dashboard user interface provides a number of features that you can use to c
The following image and descriptions highlights all dashboards features.
{{< figure src="/static/img/docs/v91/dashboard-features/dashboard-features.png" width="700px" >}}
{{< figure src="/media/docs/grafana/dashboards/screenshot-dashboard-annotated-9-5-0.png" width="700px" >}}
- **Grafana home** (1): Click the Grafana home icon to be redirected to the home page configured in the Grafana instance.
- **Dashboard title** (2): When you click the dashboard title you can search for dashboard contained in the current folder.
- **Share dashboard** (3): Use this option to share the current dashboard by link or snapshot. You can also export the dashboard definition from the share modal.
- **Add a new panel** (4): Use this option to add a panel, dashboard row, or library panel to the current dashboard.
- **Dashboard settings** (5): Use this option to change dashboard name, folder, and tags and manage variables and annotation queries. For more information about dashboard settings, refer to [Modify dashboard settings]({{< relref "../build-dashboards/modify-dashboard-settings/" >}}).
- **Time picker dropdown** (6): Click to select relative time range options and set custom absolute time ranges.
- (1) **Grafana home**: Click **Home** in the breadcrumb to be redirected to the home page configured in the Grafana instance.
- (2) **Dashboard title**: When you click the dashboard title you can search for dashboard contained in the current folder.
- (3) **Share dashboard or panel**: Use this option to share the current dashboard or panel by link or snapshot. You can also export the dashboard definition from the share modal.
- (4) **Add**: Use this option to add a panel, dashboard row, or library panel to the current dashboard.
- (5) **Save dashboard**: Click to save changes to your dashboard.
- (6) **Dashboard insights**: Click to view analytics about your dashboard including information about users, activity, query counts.
- (7) **Dashboard settings**: Use this option to change dashboard name, folder, and tags and manage variables and annotation queries. For more information about dashboard settings, refer to [Modify dashboard settings]({{< relref "../build-dashboards/modify-dashboard-settings/" >}}).
- (8) **Time picker dropdown**: Click to select relative time range options and set custom absolute time ranges.
- You can change the **Timezone** and **fiscal year** settings from the time range controls by clicking the **Change time settings** button.
- Time settings are saved on a per-dashboard basis.
- **Zoom out time range** (7): Click to zoom out the time range. For more information about how to use time range controls, refer to [Common time range controls]({{< relref "#common-time-range-controls" >}}).
- **Refresh dashboard** (8): Click to immediately trigger queries and refresh dashboard data.
- **Refresh dashboard time interval** (9): Click to select a dashboard auto refresh time interval.
- **View mode** (10): Click to display the dashboard on a large screen such as a TV or a kiosk. View mode hides irrelevant information such as navigation menus. For more information about view mode, refer to [How to Create Kiosks to Display Dashboards on a TV](https://grafana.com/blog/2019/05/02/grafana-tutorial-how-to-create-kiosks-to-display-dashboards-on-a-tv/).
- **Dashboard panel** (11): The primary building block of a dashboard is the panel. To add a new panel, dashboard row, or library panel, click **Add panel**.
- (9) **Zoom out time range**: Click to zoom out the time range. For more information about how to use time range controls, refer to [Common time range controls]({{< relref "#common-time-range-controls" >}}).
- (10) **Refresh dashboard**: Click to immediately trigger queries and refresh dashboard data.
- (11) **Refresh dashboard time interval**: Click to select a dashboard auto refresh time interval.
- (12) **View mode**: Click to display the dashboard on a large screen such as a TV or a kiosk. View mode hides irrelevant information such as navigation menus. For more information about view mode, refer to [How to Create Kiosks to Display Dashboards on a TV](https://grafana.com/blog/2019/05/02/grafana-tutorial-how-to-create-kiosks-to-display-dashboards-on-a-tv/).
- (13) **Dashboard panel**: The primary building block of a dashboard is the panel. To add a new panel, dashboard row, or library panel, click **Add panel**.
- Library panels can be shared among many dashboards.
- To move a panel, drag the panel header to another location.
- To resize a panel, click and drag the lower right corner of the panel.
- **Graph legend** (12): Change series colors, y-axis and series visibility directly from the legend.
- **Search** (13): Click **Search** to search for dashboards by name or panel title.
- **Dashboard row** (14): A dashboard row is a logical divider within a dashboard that groups panels together.
- (14) **Graph legend**: Change series colors, y-axis and series visibility directly from the legend.
- (15) **Dashboard row**: A dashboard row is a logical divider within a dashboard that groups panels together.
- Rows can be collapsed or expanded allowing you to hide parts of the dashboard.
- Panels inside a collapsed row do not issue queries.
- Use [repeating rows]({{< relref "../build-dashboards/create-dashboard/#configure-repeating-rows" >}}) to dynamically create rows based on a template variable.
@@ -129,7 +130,7 @@ Hover your cursor over the field to see the exact time stamps in the range and t
Click the current time range to change it. You can change the current time using a _relative time range_, such as the last 15 minutes, or an _absolute time range_, such as `2020-05-14 00:00:00 to 2020-05-15 23:59:59`.
<img class="no-shadow" src="/static/img/docs/time-range-controls/change-current-time-range-7-0.png" max-width="900px">
<img class="no-shadow" src="/media/docs/grafana/dashboards/screenshot-change-current-time-range.png" max-width="900px">
#### Relative time range

View File

@@ -44,17 +44,17 @@ weight: 100
The following table lists the types of variables shipped with Grafana.
| Variable type | Description |
| :---------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Query | Query-generated list of values such as metric names, server names, sensor IDs, data centers, and so on. [Add a query variable]({{< relref "#add-a-query-variable" >}}). |
| Custom | Define the variable options manually using a comma-separated list. [Add a custom variable]({{< relref "#add-a-custom-variable" >}}). |
| Text box | Display a free text input field with an optional default value. [Add a text box variable]({{< relref "#add-a-text-box-variable" >}}). |
| Constant | Define a hidden constant. [Add a constant variable]({{< relref "#add-a-constant-variable" >}}). |
| Data source | Quickly change the data source for an entire dashboard. [Add a data source variable]({{< relref "#add-a-data-source-variable" >}}). |
| Interval | Interval variables represent time spans. [Add an interval variable]({{< relref "#add-an-interval-variable" >}}). |
| Ad hoc filters | Key/value filters that are automatically added to all metric queries for a data source (InfluxDB, Prometheus, and Elasticsearch only). [Add ad hoc filters]({{< relref "#add-ad-hoc-filters" >}}). |
| Global variables | Built-in variables that can be used in expressions in the query editor. Refer to [Global variables]({{< relref "#global-variables" >}}). |
| Chained variables | Variable queries can contain other variables. Refer to [Chained variables]({{< relref "#chained-variables" >}}). |
| Variable type | Description |
| :---------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Query | Query-generated list of values such as metric names, server names, sensor IDs, data centers, and so on. [Add a query variable]({{< relref "#add-a-query-variable" >}}). |
| Custom | Define the variable options manually using a comma-separated list. [Add a custom variable]({{< relref "#add-a-custom-variable" >}}). |
| Text box | Display a free text input field with an optional default value. [Add a text box variable]({{< relref "#add-a-text-box-variable" >}}). |
| Constant | Define a hidden constant. [Add a constant variable]({{< relref "#add-a-constant-variable" >}}). |
| Data source | Quickly change the data source for an entire dashboard. [Add a data source variable]({{< relref "#add-a-data-source-variable" >}}). |
| Interval | Interval variables represent time spans. [Add an interval variable]({{< relref "#add-an-interval-variable" >}}). |
| Ad hoc filters | Key/value filters that are automatically added to all metric queries for a data source (Prometheus, Loki, InfluxDB, and Elasticsearch only). [Add ad hoc filters]({{< relref "#add-ad-hoc-filters" >}}). |
| Global variables | Built-in variables that can be used in expressions in the query editor. Refer to [Global variables]({{< relref "#global-variables" >}}). |
| Chained variables | Variable queries can contain other variables. Refer to [Chained variables]({{< relref "#chained-variables" >}}). |
## Enter General options
@@ -194,7 +194,7 @@ Ad hoc filters are one of the most complex and flexible variable options availab
Interpolating a variable with multiple values selected is tricky as it is not straight forward how to format the multiple values into a string that is valid in the given context where the variable is used. Grafana tries to solve this by allowing each data source plugin to inform the templating interpolation engine what format to use for multiple values.
> **Note:** The **Custom all value** option on the variable must be blank for Grafana to format all values into a single string. If leave it blank, then the Grafana concatenates (adds together) all the values in the query. Something like `value1,value2,value3`. If a custom `all` value is used, then instead the value will be something like `*` or `all`.
> **Note:** The **Custom all value** option on the variable must be blank for Grafana to format all values into a single string. If it is left blank, then Grafana concatenates (adds together) all the values in the query. Something like `value1,value2,value3`. If a custom `all` value is used, then instead the value will be something like `*` or `all`.
#### Multi-value variables with a Graphite data source
@@ -281,6 +281,8 @@ This variable is the `$__interval` variable in milliseconds, not a time interval
This variable is only available in the Singlestat panel and can be used in the prefix or suffix fields on the Options tab. The variable will be replaced with the series name or alias.
> **Note:** The Singlestat panel is no longer available from Grafana 8.0.
### $\_\_org
This variable is the ID of the current organization.
@@ -398,7 +400,7 @@ apps.fakesite.web_server_01.cpu.*
#### InfluxDB example
In this example, you have several data centers. Each data center has a different subset of hosts. It is based on the [InfluxDB Templated](https://play.grafana.org/d/000000002/influxdb-templated?orgId=1).
In this example, you have several data centers. Each data center has a different subset of hosts. It is based on the [InfluxDB Templated](https://play.grafana.org/d/000000002/influxdb-templated?orgId=1) dashboard.
In this example, when the user changes the value of the `datacenter` variable, it changes the dropdown options returned by the `host` variable. The `host` variable uses the **Multi-value** option and **Include all option**, allowing users to select some or all options presented at any time. The `datacenter` does not use either option, so you can only select one data center at a time.
@@ -407,7 +409,7 @@ In this example, when the user changes the value of the `datacenter` variable, i
The query for this variable basically says, "Give me all the data centers that exist."
```
SHOW TAG VALUES WITH KEY = "datacenter"
SHOW TAG VALUES WITH KEY = "datacenter"
```
The values returned are `America`, `Africa`, `Asia`, and `Europe`.

View File

@@ -28,24 +28,25 @@ When using Prometheus, contact points and notification policies are read-only in
## Configure the data source
**To access the data source configuration page:**
To configure basic settings for the data source, complete the following steps:
1. Select the **Data sources** section from the **Administration** menu
2. Select the **Alertmanager** data source
1. Click **Connections** in the left-side menu.
1. Under Your connections, click **Data sources**.
1. Enter `Alertmanager` in the search bar.
1. Click **Alertmanager**.
Set the data source's basic configuration options carefully:
The **Settings** tab of the data source is displayed.
| Name | Description |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Name** | Sets the name you use to refer to the data source |
| **Default** | Sets whether the data source is pre-selected for new panels and queries |
| **Alertmanager** | |
| **Implementation** | Alertmanager implementation. **Mimir**, **Cortex,** and **Prometheus** are supported |
| **Receive Grafana Alerts** | When enabled the Alertmanager receives alert instances from Grafana-managed alert rules. **Important:** It works only if Grafana alerting is configured to send its alert instances to external Alertmanagers |
| **HTTP** | |
| **URL** | Sets the HTTP protocol, IP, and port of your Alertmanager instance, such as `https://alertmanager.example.org:9093` |
| **Access** | Only **Server** access mode is functional |
| | |
1. Set the data source's basic configuration options:
| Name | Description |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Name** | Sets the name you use to refer to the data source |
| **Default** | Sets whether the data source is pre-selected for new panels and queries |
| **Alertmanager Implementation** | Alertmanager implementation. **Mimir**, **Cortex,** and **Prometheus** are supported |
| **Receive Grafana Alerts** | When enabled the Alertmanager receives alert instances from Grafana-managed alert rules. **Important:** It works only if Grafana alerting is configured to send its alert instances to external Alertmanagers |
| **HTTP URL** | Sets the HTTP protocol, IP, and port of your Alertmanager instance, such as `https://alertmanager.example.org:9093` |
| **Access** | Only **Server** access mode is functional |
## Provision the Alertmanager data source

View File

@@ -31,11 +31,12 @@ Once you've added the data source, you can [configure it]({{< relref "#configure
## Configure the data source
**To access the data source configuration page:**
1. Click **Connections** in the left-side menu.
1. Under Your connections, click **Data sources**.
1. Enter `CloudWatch` in the search bar.
1. Click **CloudWatch**.
1. Hover the cursor over the **Configuration** (gear) icon.
1. Select **Data Sources**.
1. Select the CloudWatch data source.
The **Settings** tab of the data source is displayed.
### Configure AWS authentication
@@ -375,3 +376,7 @@ For more information, refer to the AWS documentation for [Service Quotas](https:
The CloudWatch plugin enables you to monitor and troubleshoot applications across multiple regional accounts. Using cross-account observability, you can seamlessly search, visualize and analyze metrics and logs without worrying about account boundaries.
To use this feature, configure in the [AWS console under Cloudwatch Settings](https://aws.amazon.com/blogs/aws/new-amazon-cloudwatch-cross-account-observability/), a monitoring and source account, and then add the necessary IAM permissions as described above.
## CloudWatch Logs data protection
CloudWatch Logs can safeguard data by using log group data protection policies. If you have data protection enabled for a log group, then any sensitive data that matches the data identifiers you've selected will be masked. In order to view masked data you will need to have the `logs:Unmask` IAM permission enabled. See the AWS documentation on how to [help protect sensitive log data with masking](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/mask-sensitive-log-data.html) to learn more about this.

View File

@@ -24,26 +24,29 @@ Once you've added the Graphite data source, you can [configure it]({{< relref "#
## Configure the data source
**To access the data source configuration page:**
To configure basic settings for the data source, complete the following steps:
1. Hover the cursor over the **Configuration** (gear) icon.
1. Select **Data Sources**.
1. Select the Graphite data source.
1. Click **Connections** in the left-side menu.
1. Under Your connections, click **Data sources**.
1. Enter `Graphite` in the search bar.
1. Click **Graphite**.
Set the data source's basic configuration options carefully:
The **Settings** tab of the data source is displayed.
| Name | Description |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| **Name** | Sets the name you use to refer to the data source in panels and queries. |
| **Default** | Sets whether the data source is pre-selected for new panels. You can set only one default data source per organization. |
| **URL** | Sets the HTTP protocol, IP, and port of your graphite-web or graphite-api installation. |
| **Auth** | For details, refer to [Configure Authentication]({{< relref "../../setup-grafana/configure-security/configure-authentication/" >}}). |
| **Basic Auth** | Enables basic authentication to the data source. |
| **User** | Sets the user name for basic authentication. |
| **Password** | Sets the password for basic authentication. |
| **Custom HTTP Headers** | Click **Add header** to add a custom HTTP header. |
| **Header** | Defines the custom header name. |
| **Value** | Defines the custom header value. |
1. Set the data source's basic configuration options:
| Name | Description |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| **Name** | Sets the name you use to refer to the data source in panels and queries. |
| **Default** | Sets whether the data source is pre-selected for new panels. You can set only one default data source per organization. |
| **URL** | Sets the HTTP protocol, IP, and port of your graphite-web or graphite-api installation. |
| **Auth** | For details, refer to [Configure Authentication]({{< relref "../../setup-grafana/configure-security/configure-authentication/" >}}). |
| **Basic Auth** | Enables basic authentication to the data source. |
| **User** | Sets the user name for basic authentication. |
| **Password** | Sets the password for basic authentication. |
| **Custom HTTP Headers** | Click **Add header** to add a custom HTTP header. |
| **Header** | Defines the custom header name. |
| **Value** | Defines the custom header value. |
You can also configure settings specific to the Graphite data source:

View File

@@ -41,14 +41,13 @@ To configure basic settings for the data source, complete the following steps:
1. Set the data source's basic configuration options carefully:
| Name | Description |
| Name | Description |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Name** | Sets the name you use to refer to the data source in panels and queries. We recommend something like `InfluxDB-InfluxQL`. |
| **Default** | Sets whether the data source is pre-selected for new panels. |
| **URL** | The HTTP protocol, IP address, and port of your InfluxDB API. InfluxDB's default API port is 8086. |
| **Min time interval** | _(Optional)_ Refer to [Min time interval]({{< relref "#configure-min-time-interval" >}}). |
| **Max series** | _(Optional)_ Limits the number of series and tables that Grafana processes. Lower this number to prevent abuse, and increase it if you have many small time series and not all are shown. Defaults to 1,000. |
| **Name** | Sets the name you use to refer to the data source in panels and queries. We recommend something like `InfluxDB-InfluxQL`. |
| **Default** | Sets whether the data source is pre-selected for new panels. |
| **URL** | The HTTP protocol, IP address, and port of your InfluxDB API. InfluxDB's default API port is 8086. |
| **Min time interval** | _(Optional)_ Refer to [Min time interval]({{< relref "#configure-min-time-interval" >}}). |
| **Max series** | _(Optional)_ Limits the number of series and tables that Grafana processes. Lower this number to prevent abuse, and increase it if you have many small time series and not all are shown. Defaults to 1,000. |
You can also configure settings specific to the InfluxDB data source. These options are described in the sections below.

View File

@@ -14,7 +14,7 @@ weight: 300
# Loki query editor
The Loki data source's query editor helps you create [log]({{< relref "#create-a-logs-query" >}}) and [metric]({{< relref "#create-a-metrics-query" >}}) queries that use Loki's query language, [LogQL](/docs/loki/latest/logql/).
The Loki data source's query editor helps you create [log]({{< relref "#create-a-log-query" >}}) and [metric]({{< relref "#create-a-metric-query" >}}) queries that use Loki's query language, [LogQL](/docs/loki/latest/logql/).
This topic explains querying specific to the Loki data source.
For general documentation on querying data sources in Grafana, see [Query and transform data]({{< relref "../../../panels-visualizations/query-transform-data" >}}).

View File

@@ -41,19 +41,20 @@ To configure basic settings for the data source, complete the following steps:
1. Set the data source's basic configuration options:
| Name | Description |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Name** | Sets the name you use to refer to the data source in panels and queries. |
| **Default** | Sets the data source that's pre-selected for new panels. |
| **Host** | Sets the IP address/hostname and optional port of your MS SQL instance. Default port is 0, the driver default. You can specify multiple connection properties, such as `ApplicationIntent`, by separating each property with a semicolon (`;`). |
| **Database** | Sets the name of your MS SQL database. |
| **Authentication** | Sets the authentication mode, either using SQL Server Authentication or Windows Authentication (single sign-on for Windows users). |
| **User** | Defines the database user's username. |
| **Password** | Defines the database user's password. |
| **Encrypt** | Determines whether to negotiate a secure SSL TCP/IP connection with the server, or to which extent. Default is `false`. |
| **Max open** | Sets the maximum number of open connections to the database. Default is `unlimited`. |
| **Max idle** | Sets the maximum number of connections in the idle connection pool. Default is `2`. |
| **Max lifetime** | Sets the maximum number of seconds that the data source can reuse a connection. Default is `14400` (4 hours). |
| Name | Description |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Name** | Sets the name you use to refer to the data source in panels and queries. |
| **Default** | Sets the data source that's pre-selected for new panels. |
| **Host** | Sets the IP address/hostname and optional port of your MS SQL instance. Default port is 0, the driver default. You can specify multiple connection properties, such as `ApplicationIntent`, by separating each property with a semicolon (`;`). |
| **Database** | Sets the name of your MS SQL database. |
| **Authentication** | Sets the authentication mode, either using SQL Server Authentication or Windows Authentication (single sign-on for Windows users). |
| **User** | Defines the database user's username. |
| **Password** | Defines the database user's password. |
| **Encrypt** | Determines whether to negotiate a secure SSL TCP/IP connection with the server, or to which extent. Default is `false`. |
| **Max open** | Sets the maximum number of open connections to the database. Default is `100`. |
| **Max idle** | Sets the maximum number of connections in the idle connection pool. Default is `100`. |
| **Auto (max idle)** | If set will set the maximum number of idle connections to the number of maximum open connections (Grafana v9.5.1+). Default is `true`. |
| **Max lifetime** | Sets the maximum number of seconds that the data source can reuse a connection. Default is `14400` (4 hours). |
You can also configure settings specific to the Microsoft SQL Server data source. These options are described in the sections below.
@@ -122,8 +123,9 @@ datasources:
user: grafana
jsonData:
database: grafana
maxOpenConns: 0 # Grafana v5.4+
maxIdleConns: 2 # Grafana v5.4+
maxOpenConns: 100 # Grafana v5.4+
maxIdleConns: 100 # Grafana v5.4+
maxIdleConnsAuto: true # Grafana v9.5.1+
connMaxLifetime: 14400 # Grafana v5.4+
connectionTimeout: 0 # Grafana v9.3+
secureJsonData:

View File

@@ -35,20 +35,19 @@ Administrators can also [configure the data source via YAML]({{< relref "#provis
1. Set the data source's basic configuration options.
### Data source options
| Name | Description |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Name` | The data source name. This is how you refer to the data source in panels and queries. |
| `Default` | Default data source means that it will be pre-selected for new panels. |
| `Host` | The IP address/hostname and optional port of your MySQL instance. |
| `Database` | Name of your MySQL database. |
| `User` | Database user's login/username |
| `Password` | Database user's password |
| `Session Timezone` | Specify the time zone used in the database session, such as `Europe/Berlin` or `+02:00`. This is necessary, if the timezone of the database (or the host of the database) is set to something other than UTC. Set the value used in the session with `SET time_zone='...'`. If you leave this field empty, then the time zone is not updated. For more information, refer to the [MySQL documentation](https://dev.mysql.com/doc/refman/8.0/en/time-zone-support.html). |
| `Max open` | The maximum number of open connections to the database, default `unlimited` (Grafana v5.4+). |
| `Max idle` | The maximum number of connections in the idle connection pool, default `2` (Grafana v5.4+). |
| `Max lifetime` | The maximum amount of time in seconds a connection may be reused, default `14400`/4 hours. This should always be lower than configured [wait_timeout](https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_wait_timeout) in MySQL (Grafana v5.4+). |
| Name | Description |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Name** | The data source name. This is how you refer to the data source in panels and queries. |
| **Default** | Default data source means that it will be pre-selected for new panels. |
| **Host** | The IP address/hostname and optional port of your MySQL instance. |
| **Database** | Name of your MySQL database. |
| **User** | Database user's login/username |
| **Password** | Database user's password |
| **Session Timezone** | Specify the time zone used in the database session, such as `Europe/Berlin` or `+02:00`. This is necessary, if the timezone of the database (or the host of the database) is set to something other than UTC. Set the value used in the session with `SET time_zone='...'`. If you leave this field empty, then the time zone is not updated. For more information, refer to the [MySQL documentation](https://dev.mysql.com/doc/refman/8.0/en/time-zone-support.html). |
| **Max open** | The maximum number of open connections to the database, default `100` (Grafana v5.4+). |
| **Max idle** | The maximum number of connections in the idle connection pool, default `100` (Grafana v5.4+). |
| **Auto (max idle)** | If set will set the maximum number of idle connections to the number of maximum open connections (Grafana v9.5.1+). Default is `true`. |
| **Max lifetime** | The maximum amount of time in seconds a connection may be reused, default `14400`/4 hours. This should always be lower than configured [wait_timeout](https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_wait_timeout) in MySQL (Grafana v5.4+). |
### Min time interval
@@ -107,8 +106,9 @@ datasources:
user: grafana
jsonData:
database: grafana
maxOpenConns: 0 # Grafana v5.4+
maxIdleConns: 2 # Grafana v5.4+
maxOpenConns: 100 # Grafana v5.4+
maxIdleConns: 100 # Grafana v5.4+
maxIdleConnsAuto: true # Grafana v9.5.1+
connMaxLifetime: 14400 # Grafana v5.4+
secureJsonData:
password: ${GRAFANA_MYSQL_PASSWORD}
@@ -127,8 +127,9 @@ datasources:
jsonData:
tlsAuth: true
database: grafana
maxOpenConns: 0 # Grafana v5.4+
maxIdleConns: 2 # Grafana v5.4+
maxOpenConns: 100 # Grafana v5.4+
maxIdleConns: 100 # Grafana v5.4+
maxIdleConnsAuto: true # Grafana v9.5.1+
connMaxLifetime: 14400 # Grafana v5.4+
secureJsonData:
password: ${GRAFANA_MYSQL_PASSWORD}
@@ -150,8 +151,9 @@ datasources:
tlsAuth: true
skipTLSVerify: true
database: grafana
maxOpenConns: 0 # Grafana v5.4+
maxIdleConns: 2 # Grafana v5.4+
maxOpenConns: 100 # Grafana v5.4+
maxIdleConns: 100 # Grafana v5.4+
maxIdleConnsAuto: true # Grafana v9.5.1+
connMaxLifetime: 14400 # Grafana v5.4+
secureJsonData:
password: ${GRAFANA_MYSQL_PASSWORD}

View File

@@ -18,16 +18,25 @@ Grafana ships with built-in support for Parca, a continuous profiling OSS databa
## Configure the Parca data source
To access Parca settings, click the **Configuration** (gear) icon, then click **Data Sources** > **Parca**.
To configure basic settings for the data source, complete the following steps:
| Name | Description |
| ------------ | ------------------------------------------------------------------ |
| `Name` | A name to specify the data source in panels, queries, and Explore. |
| `Default` | The default data source will be pre-selected for new panels. |
| `URL` | The URL of the Parca instance, e.g., `http://localhost:4100` |
| `Basic Auth` | Enable basic authentication to the Parca data source. |
| `User` | User name for basic authentication. |
| `Password` | Password for basic authentication. |
1. Click **Connections** in the left-side menu.
1. Under Your connections, click **Data sources**.
1. Enter `Parca` in the search bar.
1. Click **Parca**.
The **Settings** tab of the data source is displayed.
1. Set the data source's basic configuration options:
| Name | Description |
| ------------ | ------------------------------------------------------------------ |
| `Name` | A name to specify the data source in panels, queries, and Explore. |
| `Default` | The default data source will be pre-selected for new panels. |
| `URL` | The URL of the Parca instance, e.g., `http://localhost:4100` |
| `Basic Auth` | Enable basic authentication to the Parca data source. |
| `User` | User name for basic authentication. |
| `Password` | Password for basic authentication. |
## Querying

View File

@@ -18,17 +18,26 @@ Grafana ships with built-in support for Phlare, a horizontally scalable, highly-
## Configure the Phlare data source
To access Phlare settings, click the **Configuration** (gear) icon, then click **Data Sources** > **Phlare**.
To configure basic settings for the data source, complete the following steps:
| Name | Description |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Name` | A name to specify the data source in panels, queries, and Explore. |
| `Default` | The default data source will be pre-selected for new panels. |
| `URL` | The URL of the Phlare instance, e.g., `http://localhost:4100` |
| `Basic Auth` | Enable basic authentication to the Phlare data source. |
| `User` | User name for basic authentication. |
| `Password` | Password for basic authentication. |
| `Minimal step` | Similar to Prometheus, Phlare scrapes profiles at certain intervals. To prevent querying at smaller interval use Minimal step same or higher than your Phlare scrape interval. |
1. Click **Connections** in the left-side menu.
1. Under Your connections, click **Data sources**.
1. Enter `Phlare` in the search bar.
1. Click **Phlare**.
The **Settings** tab of the data source is displayed.
1. Set the data source's basic configuration options:
| Name | Description |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Name` | A name to specify the data source in panels, queries, and Explore. |
| `Default` | The default data source will be pre-selected for new panels. |
| `URL` | The URL of the Phlare instance, e.g., `http://localhost:4100` |
| `Basic Auth` | Enable basic authentication to the Phlare data source. |
| `User` | User name for basic authentication. |
| `Password` | Password for basic authentication. |
| `Minimal step` | Similar to Prometheus, Phlare scrapes profiles at certain intervals. To prevent querying at smaller interval use Minimal step same or higher than your Phlare scrape interval. |
## Querying

View File

@@ -33,23 +33,23 @@ To configure basic settings for the data source, complete the following steps:
1. Set the data source's basic configuration options:
| Name | Description |
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Name** | The data source name. This is how you refer to the data source in panels and queries. |
| **Default** | Default data source means that it will be pre-selected for new panels. |
| **Host** | The IP address/hostname and optional port of your PostgreSQL instance. _Do not_ include the database name. The connection string for connecting to Postgres will not be correct and it may cause errors. |
| **Database** | Name of your PostgreSQL database. |
| **User** | Database user's login/username |
| **Password** | Database user's password |
| **SSL Mode** | Determines whether or with what priority a secure SSL TCP/IP connection will be negotiated with the server. When SSL Mode is disabled, SSL Method and Auth Details would not be visible. |
| **SSL Auth Details Method** | Determines whether the SSL Auth details will be configured as a file path or file content. Grafana v7.5+ |
| **SSL Auth Details Value** | File path or file content of SSL root certificate, client certificate and client key |
| **Max open** | The maximum number of open connections to the database, default `unlimited` (Grafana v5.4+). |
| **Max idle** | The maximum number of connections in the idle connection pool, default `2` (Grafana v5.4+). |
| **Max lifetime** | The maximum amount of time in seconds a connection may be reused, default `14400`/4 hours (Grafana v5.4+). |
| **Version** | Determines which functions are available in the query builder (only available in Grafana 5.3+). |
| **TimescaleDB** | A time-series database built as a PostgreSQL extension. When enabled, Grafana uses `time_bucket` in the `$__timeGroup` macro to display TimescaleDB specific aggregate functions in the query builder (only available in Grafana 5.3+). For more information, see [TimescaleDB documentation](https://docs.timescale.com/timescaledb/latest/tutorials/grafana/grafana-timescalecloud/#connect-timescaledb-and-grafana). |
| Name | Description |
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Name** | The data source name. This is how you refer to the data source in panels and queries. |
| **Default** | Default data source means that it will be pre-selected for new panels. |
| **Host** | The IP address/hostname and optional port of your PostgreSQL instance. _Do not_ include the database name. The connection string for connecting to Postgres will not be correct and it may cause errors. |
| **Database** | Name of your PostgreSQL database. |
| **User** | Database user's login/username |
| **Password** | Database user's password |
| **SSL Mode** | Determines whether or with what priority a secure SSL TCP/IP connection will be negotiated with the server. When SSL Mode is disabled, SSL Method and Auth Details would not be visible. |
| **SSL Auth Details Method** | Determines whether the SSL Auth details will be configured as a file path or file content. Grafana v7.5+ |
| **SSL Auth Details Value** | File path or file content of SSL root certificate, client certificate and client key |
| **Max open** | The maximum number of open connections to the database, default `100` (Grafana v5.4+). |
| **Max idle** | The maximum number of connections in the idle connection pool, default `100` (Grafana v5.4+). |
| **Auto (max idle)** | If set will set the maximum number of idle connections to the number of maximum open connections (Grafana v9.5.1+). Default is `true`. |
| **Max lifetime** | The maximum amount of time in seconds a connection may be reused, default `14400`/4 hours (Grafana v5.4+). |
| **Version** | Determines which functions are available in the query builder (only available in Grafana 5.3+). |
| **TimescaleDB** | A time-series database built as a PostgreSQL extension. When enabled, Grafana uses `time_bucket` in the `$__timeGroup` macro to display TimescaleDB specific aggregate functions in the query builder (only available in Grafana 5.3+). For more information, see [TimescaleDB documentation](https://docs.timescale.com/timescaledb/latest/tutorials/grafana/grafana-timescalecloud/#connect-timescaledb-and-grafana). |
### Min time interval
@@ -141,8 +141,9 @@ datasources:
jsonData:
database: grafana
sslmode: 'disable' # disable/require/verify-ca/verify-full
maxOpenConns: 0 # Grafana v5.4+
maxIdleConns: 2 # Grafana v5.4+
maxOpenConns: 100 # Grafana v5.4+
maxIdleConns: 100 # Grafana v5.4+
maxIdleConnsAuto: true # Grafana v9.5.1+
connMaxLifetime: 14400 # Grafana v5.4+
postgresVersion: 903 # 903=9.3, 904=9.4, 905=9.5, 906=9.6, 1000=10
timescaledb: false

View File

@@ -45,40 +45,28 @@ To configure basic settings for the data source, complete the following steps:
1. Set the data source's basic configuration options:
| Name | Description |
| Name | Description |
| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Name` | The data source name. This is how you refer to the data source in panels and queries. |
| `Default` | Default data source that is pre-selected for new panels. |
| `URL` | The URL of your Prometheus server, for example, `http://prometheus.example.org:9090`. |
| `Access` | Only Server access mode is functional. If Server mode is already selected this option is hidden. Otherwise change to Server mode to prevent errors. |
| `Basic Auth` | Enable basic authentication to the Prometheus data source. |
| `User` | User name for basic authentication. |
| `Password` | Password for basic authentication. |
| `Manage alerts via Alerting UI` | Toggle whether to enable Alertmanager integration for this data source. |
| `Scrape interval` | Set this to the typical scrape and evaluation interval configured in Prometheus. Defaults to 15s. |
| `HTTP method` | Use either POST or GET HTTP method to query your data source. POST is the recommended and pre-selected method as it allows bigger queries. Change this to GET if you have a Prometheus version older than 2.1 or if POST requests are restricted in your network. |
| `Type` | The type of your Prometheus server; `Prometheus`, `Cortex`, `Thanos`, `Mimir`. When selected, the **Version** field attempts to populate automatically using the Prometheus [buildinfo](https://semver.org/) API. Some Prometheus types, such as Cortex, don't support this API and must be manually populated. |
| `Version` | The version of your Prometheus server, note that this field is not visible until the Prometheus type is selected. |
| `Disable metrics lookup` | Checking this option will disable the metrics chooser and metric/label support in the query field's autocomplete. This helps if you have performance issues with bigger Prometheus instances. |
| `Custom query parameters` | Add custom parameters to the Prometheus query URL. For example `timeout`, `partial_response`, `dedup`, or `max_source_resolution`. Multiple parameters should be concatenated together with an '&amp;'. |
| **Exemplars configuration** | |
| `Internal link` | Enable this option is you have an internal link. When you enable this option, you will see a data source selector. Select the backend tracing data store for your exemplar data. |
| `Data source` | You will see this option only if you enable `Internal link` option. Select the backend tracing data store for your exemplar data. |
| `URL` | You will see this option only if the `Internal link` option is disabled. Enter the full URL of the external link. You can interpolate the value from the field with `${__value.raw }` macro. |
| `URL Label` | (Optional) add a custom display label to override the value of the `Label name` field. |
| `Label name` | Add a name for the exemplar traceID property. |
**Exemplars configuration:**
| Name | Description |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Internal link** | Enable this option if you have an internal link. When enabled, this reveals the data source selector. Select the backend tracing data store for your exemplar data. |
| **Data source** | _(Visible only if you enable `Internal link`)_ Selects the backend tracing data store for your exemplar data. |
| **URL** | _(Visible only if you disable `Internal link`)_ Defines the external link's full URL. You can interpolate the value from the field by using the [`${__value.raw}` macro]({{< relref "../..//panels-visualizations/configure-data-links/#value-variables" >}}). |
| **URL label** | _(Optional)_ Adds a custom display label to override the value of the `Label name` field. |
| **Label name** | Adds a name for the exemplar traceID property. |
| `Name` | The data source name. This is how you refer to the data source in panels and queries. |
| `Default` | Default data source that is pre-selected for new panels. |
| `URL` | The URL of your Prometheus server, for example, `http://prometheus.example.org:9090`. |
| `Access` | Only Server access mode is functional. If Server mode is already selected this option is hidden. Otherwise change to Server mode to prevent errors. |
| `Basic Auth` | Enable basic authentication to the Prometheus data source. |
| `User` | User name for basic authentication. |
| `Password` | Password for basic authentication. |
| `Manage alerts via Alerting UI` | Toggle whether to enable Alertmanager integration for this data source. |
| `Scrape interval` | Set this to the typical scrape and evaluation interval configured in Prometheus. Defaults to 15s. |
| `HTTP method` | Use either POST or GET HTTP method to query your data source. POST is the recommended and pre-selected method as it allows bigger queries. Change this to GET if you have a Prometheus version older than 2.1 or if POST requests are restricted in your network. |
| `Type` | The type of your Prometheus server; `Prometheus`, `Cortex`, `Thanos`, `Mimir`. When selected, the **Version** field attempts to populate automatically using the Prometheus [buildinfo](https://semver.org/) API. Some Prometheus types, such as Cortex, don't support this API and must be manually populated. |
| `Version` | The version of your Prometheus server, note that this field is not visible until the Prometheus type is selected. |
| `Disable metrics lookup` | Checking this option will disable the metrics chooser and metric/label support in the query field's autocomplete. This helps if you have performance issues with bigger Prometheus instances. |
| `Custom query parameters` | Add custom parameters to the Prometheus query URL. For example `timeout`, `partial_response`, `dedup`, or `max_source_resolution`. Multiple parameters should be concatenated together with an '&amp;'. |
| **Exemplars configuration** | |
| `Internal link` | Enable this option if you have an internal link. When enabled, this reveals the data source selector. Select the backend tracing data store for your exemplar data. |
| `Data source` | _(Visible only if you enable `Internal link`)_ Selects the backend tracing data store for your exemplar data. |
| `URL` | _(Visible only if you disable `Internal link`)_ Defines the external link's full URL. You can interpolate the value from the field by using the [`${__value.raw}` macro]({{< relref "../..//panels-visualizations/configure-data-links/#value-variables" >}}). |
| `URL Label` | _(Optional)_ Adds a custom display label to override the value of the `Label name` field. |
| `Label name` | Adds a name for the exemplar traceID property. |
### Provision the data source
@@ -113,12 +101,6 @@ datasources:
url: 'http://localhost:3000/explore?orgId=1&left=%5B%22now-1h%22,%22now%22,%22Jaeger%22,%7B%22query%22:%22$${__value.raw}%22%7D%5D'
```
## Query the data source
The Prometheus query editor includes a code editor and visual query builder.
For details, see the [query editor documentation]({{< relref "./query-editor" >}}).
## View Grafana metrics with Prometheus
Grafana exposes metrics for Prometheus on the `/metrics` endpoint.

View File

@@ -38,15 +38,14 @@ To configure basic settings for the data source, complete the following steps:
1. Set the data source's basic configuration options:
| Name | Description |
| Name | Description |
| -------------- | ------------------------------------------------------------------------ |
| **Name** | Sets the name you use to refer to the data source in panels and queries. |
| **Default** | Sets the data source that's pre-selected for new panels. |
| **URL** | Sets the URL of the Tempo instance, such as `http://tempo`. |
| **Basic Auth** | Enables basic authentication to the Tempo data source. |
| **User** | Sets the user name for basic authentication. |
| **Password** | Sets the password for basic authentication. |
| **Name** | Sets the name you use to refer to the data source in panels and queries. |
| **Default** | Sets the data source that's pre-selected for new panels. |
| **URL** | Sets the URL of the Tempo instance, such as `http://tempo`. |
| **Basic Auth** | Enables basic authentication to the Tempo data source. |
| **User** | Sets the user name for basic authentication. |
| **Password** | Sets the password for basic authentication. |
You can also configure settings specific to the Tempo data source. These options are described in the sections below.

View File

@@ -33,11 +33,10 @@ To configure basic settings for the data source, complete the following steps:
The **Settings** tab of the data source is displayed. The data source doesn't provide any settings beyond the most basic options common to all data sources:
| Name | Description |
| Name | Description |
| ----------- | ------------------------------------------------------------------------ |
| **Name** | Sets the name you use to refer to the data source in panels and queries. |
| **Default** | Defines whether this data source is pre-selected for new panels. |
| **Name** | Sets the name you use to refer to the data source in panels and queries. |
| **Default** | Defines whether this data source is pre-selected for new panels. |
## Create mock data

View File

@@ -38,15 +38,14 @@ To configure basic settings for the data source, complete the following steps:
1. Set the data source's basic configuration options:
| Name | Description |
| Name | Description |
| -------------- | ------------------------------------------------------------------------ |
| **Name** | Sets the name you use to refer to the data source in panels and queries. |
| **Default** | Defines whether this data source is pre-selected for new panels. |
| **URL** | Sets the URL of the Zipkin instance, such as `http://localhost:9411`. |
| **Basic Auth** | Enables basic authentication for the Zipkin data source. |
| **User** | Defines the user name for basic authentication. |
| **Password** | Defines the password for basic authentication. |
| **Name** | Sets the name you use to refer to the data source in panels and queries. |
| **Default** | Defines whether this data source is pre-selected for new panels. |
| **URL** | Sets the URL of the Zipkin instance, such as `http://localhost:9411`. |
| **Basic Auth** | Enables basic authentication for the Zipkin data source. |
| **User** | Defines the user name for basic authentication. |
| **Password** | Defines the password for basic authentication. |
### Trace to logs

View File

@@ -13,9 +13,9 @@ keywords:
title: 'Alerting HTTP API '
---
# Alerting API
# Legacy Alerting API
> **Note:** Starting with v9.0, the Alerting HTTP API is deprecated. It will be removed in a future release.
> **Note:** Starting with v9.0, the Legacy Alerting HTTP API is deprecated. It will be removed in a future release.
This topic is relevant for the [legacy dashboard alerts](https://grafana.com/docs/grafana/v8.5/alerting/old-alerting/) only.

View File

@@ -14,7 +14,9 @@ keywords:
title: 'Alerting Notification Channels HTTP API '
---
# Alerting Notification Channels API
# Legacy Alerting Notification Channels API
> **Note:** Starting with v9.0, the Legacy Alerting Notification Channels API is deprecated. It will be removed in a future release.
This page documents the Alerting Notification Channels API.

View File

@@ -96,9 +96,10 @@ DELETE /api/v1/provisioning/alert-rules/{UID}
#### Parameters
| Name | Source | Type | Go type | Separator | Required | Default | Description |
| ---- | ------ | ------ | -------- | --------- | :------: | ------- | -------------- |
| UID | `path` | string | `string` | | ✓ | | Alert rule UID |
| Name | Source | Type | Go type | Separator | Required | Default | Description |
| -------------------- | -------- | ------ | -------- | --------- | :------: | ------- | -------------- |
| UID | `path` | string | `string` | | ✓ | | Alert rule UID |
| X-Disable-Provenance | `header` | string | `string` | | | | |
#### All responses
@@ -637,9 +638,10 @@ POST /api/v1/provisioning/contact-points
#### Parameters
| Name | Source | Type | Go type | Separator | Required | Default | Description |
| ---- | ------ | ----------------------------------------------- | ----------------------------- | --------- | :------: | ------- | ----------- |
| Body | `body` | [EmbeddedContactPoint](#embedded-contact-point) | `models.EmbeddedContactPoint` | | | | |
| Name | Source | Type | Go type | Separator | Required | Default | Description |
| -------------------- | -------- | ----------------------------------------------- | ----------------------------- | --------- | :------: | ------- | ----------- |
| X-Disable-Provenance | `header` | string | `string` | | | | |
| Body | `body` | [EmbeddedContactPoint](#embedded-contact-point) | `models.EmbeddedContactPoint` | | | | |
#### All responses
@@ -678,9 +680,10 @@ POST /api/v1/provisioning/mute-timings
#### Parameters
| Name | Source | Type | Go type | Separator | Required | Default | Description |
| ---- | ------ | --------------------------------------- | ------------------------- | --------- | :------: | ------- | ----------- |
| Body | `body` | [MuteTimeInterval](#mute-time-interval) | `models.MuteTimeInterval` | | | | |
| Name | Source | Type | Go type | Separator | Required | Default | Description |
| -------------------- | -------- | --------------------------------------- | ------------------------- | --------- | :------: | ------- | ----------- |
| X-Disable-Provenance | `header` | string | `string` | | | | |
| Body | `body` | [MuteTimeInterval](#mute-time-interval) | `models.MuteTimeInterval` | | | | |
#### All responses
@@ -762,11 +765,12 @@ PUT /api/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}
#### Parameters
| Name | Source | Type | Go type | Separator | Required | Default | Description |
| --------- | ------ | ----------------------------------- | ----------------------- | --------- | :------: | ------- | ----------- |
| FolderUID | `path` | string | `string` | | ✓ | | |
| Group | `path` | string | `string` | | ✓ | | |
| Body | `body` | [AlertRuleGroup](#alert-rule-group) | `models.AlertRuleGroup` | | | | |
| Name | Source | Type | Go type | Separator | Required | Default | Description |
| -------------------- | -------- | ----------------------------------- | ----------------------- | --------- | :------: | ------- | ----------- |
| FolderUID | `path` | string | `string` | | ✓ | | |
| Group | `path` | string | `string` | | ✓ | | |
| X-Disable-Provenance | `header` | string | `string` | | | | |
| Body | `body` | [AlertRuleGroup](#alert-rule-group) | `models.AlertRuleGroup` | | | | |
#### All responses
@@ -805,10 +809,11 @@ PUT /api/v1/provisioning/contact-points/{UID}
#### Parameters
| Name | Source | Type | Go type | Separator | Required | Default | Description |
| ---- | ------ | ----------------------------------------------- | ----------------------------- | --------- | :------: | ------- | ------------------------------------------ |
| UID | `path` | string | `string` | | ✓ | | UID is the contact point unique identifier |
| Body | `body` | [EmbeddedContactPoint](#embedded-contact-point) | `models.EmbeddedContactPoint` | | | | |
| Name | Source | Type | Go type | Separator | Required | Default | Description |
| -------------------- | -------- | ----------------------------------------------- | ----------------------------- | --------- | :------: | ------- | ------------------------------------------ |
| UID | `path` | string | `string` | | ✓ | | UID is the contact point unique identifier |
| X-Disable-Provenance | `header` | string | `string` | | | | |
| Body | `body` | [EmbeddedContactPoint](#embedded-contact-point) | `models.EmbeddedContactPoint` | | | | |
#### All responses
@@ -847,10 +852,11 @@ PUT /api/v1/provisioning/mute-timings/{name}
#### Parameters
| Name | Source | Type | Go type | Separator | Required | Default | Description |
| ---- | ------ | --------------------------------------- | ------------------------- | --------- | :------: | ------- | ---------------- |
| name | `path` | string | `string` | | ✓ | | Mute timing name |
| Body | `body` | [MuteTimeInterval](#mute-time-interval) | `models.MuteTimeInterval` | | | | |
| Name | Source | Type | Go type | Separator | Required | Default | Description |
| -------------------- | -------- | --------------------------------------- | ------------------------- | --------- | :------: | ------- | ---------------- |
| name | `path` | string | `string` | | ✓ | | Mute timing name |
| X-Disable-Provenance | `header` | string | `string` | | | | |
| Body | `body` | [MuteTimeInterval](#mute-time-interval) | `models.MuteTimeInterval` | | | | |
#### All responses
@@ -889,9 +895,10 @@ PUT /api/v1/provisioning/policies
#### Parameters
| Name | Source | Type | Go type | Separator | Required | Default | Description |
| ---- | ------ | --------------- | -------------- | --------- | :------: | ------- | ---------------------------------------- |
| Body | `body` | [Route](#route) | `models.Route` | | | | The new notification routing tree to use |
| Name | Source | Type | Go type | Separator | Required | Default | Description |
| -------------------- | -------- | --------------- | -------------- | --------- | :------: | ------- | ---------------------------------------- |
| X-Disable-Provenance | `header` | string | `string` | | | | |
| Body | `body` | [Route](#route) | `models.Route` | | | | The new notification routing tree to use |
#### All responses
@@ -930,10 +937,11 @@ PUT /api/v1/provisioning/templates/{name}
#### Parameters
| Name | Source | Type | Go type | Separator | Required | Default | Description |
| ---- | ------ | ------------------------------------------------------------- | ------------------------------------ | --------- | :------: | ------- | ------------- |
| name | `path` | string | `string` | | ✓ | | Template Name |
| Body | `body` | [NotificationTemplateContent](#notification-template-content) | `models.NotificationTemplateContent` | | | | |
| Name | Source | Type | Go type | Separator | Required | Default | Description |
| -------------------- | -------- | ------------------------------------------------------------- | ------------------------------------ | --------- | :------: | ------- | ------------- |
| name | `path` | string | `string` | | ✓ | | Template Name |
| X-Disable-Provenance | `header` | string | `string` | | | | |
| Body | `body` | [NotificationTemplateContent](#notification-template-content) | `models.NotificationTemplateContent` | | | | |
#### All responses

View File

@@ -52,6 +52,7 @@ Improve an existing plugin with one of our guides:
- [Add support for Explore queries]({{< relref "add-support-for-explore-queries.md" >}})
- [Add support for variables]({{< relref "add-support-for-variables.md" >}})
- [Add a query editor help component]({{< relref "add-query-editor-help.md" >}})
- [Add distributed tracing for backend plugins]({{< relref "add-distributed-tracing-for-backend-plugins.md" >}})
- [Build a logs data source plugin]({{< relref "build-a-logs-data-source-plugin.md" >}})
- [Build a streaming data source plugin]({{< relref "build-a-streaming-data-source-plugin.md" >}}/)
- [Error handling]({{< relref "error-handling.md" >}})

View File

@@ -0,0 +1,123 @@
---
title: Add distributed tracing for backend plugins
---
# Add distributed tracing for backend plugins
> **Note:** This feature requires at least Grafana 9.5.0, and your plugin needs to be built at least with
> grafana-plugins-sdk-go v0.157.0. If you run a plugin with tracing features on an older version of Grafana,
> tracing will be disabled.
## Introduction
Distributed tracing allows backend plugin developers to create custom spans in their plugins, and send them to the same endpoint
and with the same propagation format as the main Grafana instance. The tracing context is also propagated from the Grafana instance
to the plugin, so the plugin's spans will be correlated to the correct trace.
## Configuration
> **Note:** Only OpenTelemetry is supported. If Grafana is configured to use a deprecated tracing system (Jaeger or OpenTracing),
> tracing will be disabled in the plugin. Please note that OpenTelemetry + Jaeger propagator is supported.
OpenTelemetry must be enabled and configured for the Grafana instance. Please refer to [this section](
{{< relref "../../setup-grafana/configure-grafana/#tracingopentelemetry" >}}) for more information.
As of Grafana 9.5.0, plugins tracing must be enabled manually on a per-plugin basis, by specifying `tracing = true` in the plugin's config section:
```ini
[plugin.myorg-myplugin-datasource]
tracing = true
```
## Implementing tracing in your plugin
> **Note:** Make sure you are using at least grafana-plugin-sdk-go v0.157.0. You can update with `go get -u github.com/grafana/grafana-plugin-sdk-go`.
When OpenTelemetry tracing is enabled on the main Grafana instance and tracing is enabeld for a plugin,
the OpenTelemetry endpoint address and propagation format will be passed to the plugin during startup,
which will be used to configure a global tracer.
1. The global tracer is configured automatically if you use <code>datasource.Manage</code> or <code>app.Manage</code> to run your plugin.
This also allows you to specify custom attributes for the default tracer:
```go
func main() {
if err := datasource.Manage("MY_PLUGIN_ID", plugin.NewDatasource, datasource.ManageOpts{
TracingOpts: tracing.Opts{
// Optional custom attributes attached to the tracer's resource.
// The tracer will already have some SDK and runtime ones pre-populated.
CustomAttributes: []attribute.KeyValue{
attribute.String("my_plugin.my_attribute", "custom value"),
},
},
}); err != nil {
log.DefaultLogger.Error(err.Error())
os.Exit(1)
}
}
```
1. Once tracing is configured, you can access the global tracer with:
```go
tracing.DefaultTracer()
```
this returns an [OpenTelemetry trace.Tracer](https://pkg.go.dev/go.opentelemetry.io/otel/trace#Tracer), and can be used to create spans.
For example:
```go
func (d *Datasource) query(ctx context.Context, pCtx backend.PluginContext, query backend.DataQuery) (backend.DataResponse, error) {
ctx, span := tracing.DefaultTracer().Start(
ctx,
"query processing",
trace.WithAttributes(
attribute.String("query.ref_id", query.RefID),
attribute.String("query.type", query.QueryType),
attribute.Int64("query.max_data_points", query.MaxDataPoints),
attribute.Int64("query.interval_ms", query.Interval.Milliseconds()),
attribute.Int64("query.time_range.from", query.TimeRange.From.Unix()),
attribute.Int64("query.time_range.to", query.TimeRange.To.Unix()),
),
)
defer span.End()
log.DefaultLogger.Debug("query", "traceID", trace.SpanContextFromContext(ctx).TraceID())
// ...
}
```
Refer to the [OpenTelemetry Go SDK](https://pkg.go.dev/go.opentelemetry.io/otel) for in-depth documentation about all the features provided by OpenTelemetry.
If tracing is disabled in Grafana, `backend.DefaultTracer()` returns a no-op tracer.
### Tracing GRPC calls
A new span is created automatically for each GRPC call (`QueryData`, `CheckHealth`, etc), both on Grafana's side and
on the plugin's side.
This also injects the trace context into the `context.Context` passed to those methods.
This allows you to retrieve the [trace.SpanContext](https://pkg.go.dev/go.opentelemetry.io/otel/trace#SpanContext) by using `tracing.SpanContextFromContext` by passing the original `context.Context` to it:
```go
func (d *Datasource) query(ctx context.Context, pCtx backend.PluginContext, query backend.DataQuery) (backend.DataResponse, error) {
spanCtx := trace.SpanContextFromContext(ctx)
traceID := spanCtx.TraceID()
// ...
}
```
### Tracing HTTP requests
When tracing is enabled, a `TracingMiddleware` is also added to the default middleware stack to all HTTP clients created
using the `httpclient.New` or `httpclient.NewProvider`, unless custom middlewares are specified.
This middleware creates spans for each outgoing HTTP request and provides some useful attributes and events related to the request's lifecycle.
## Complete plugin example
You can refer to the [datasource-http-backend plugin example](https://github.com/grafana/grafana-plugin-examples/tree/main/examples/datasource-http-backend) for a complete example of a plugin that has full tracing support.

View File

@@ -0,0 +1,26 @@
---
description: Guide for migrating plugins from Grafana v9.x to v10.x
keywords:
- grafana
- plugins
- migration
- plugin
- documentation
title: Migrating plugins from Grafana 9.x to 10.x
menutitle: v9.x to v10.x
weight: 1900
---
# Migrating plugins from Grafana version 9.x to 10.x
## Verifying plugin behaviour with React 18
Grafana 10 includes our upgrade to React 18 and use of the new React client rendering API. These changes were delivered to the core `grafana` repo with [PR 64428](https://github.com/grafana/grafana/pull/64428).
Whilst this brings us many significant benefits, there's a potential for this to impact the way your plugin works. In particular, there could be unintended side effects caused by the changes around improving consistency with `useEffect` timings and automatic batching of state updates.
Recommended actions:
- Review the React 18 [upgrade docs](https://react.dev/blog/2022/03/08/react-18-upgrade-guide)
- Test your plugins against one of the latest [grafana-dev docker images](https://hub.docker.com/r/grafana/grafana-dev/tags?page=1) (for example, [this one](https://hub.docker.com/layers/grafana/grafana-dev/10.0.0-111404pre/images/sha256-ac78acf54b44bd2ce7e68b796b1df47030da7f35e53b02bc3eec3f4de05f780f?context=explore))
- Add a comment to the [forum discussion](https://community.grafana.com/t/grafana-10-is-upgrading-to-react-18/86051) if your plugin is impacted in any way. Either to socialise the changes needed for your plugin or to reach out and ask for help yourself.

View File

@@ -26,7 +26,7 @@ Support for exemplars is available for the Prometheus data source only. Once you
Grafana shows exemplars alongside a metric in the Explore view and in dashboards. Each exemplar displays as a highlighted star. You can hover your cursor over an exemplar to view the unique traceID, which is a combination of a key value pair. To investigate further, click the blue button next to the `traceID` property.
{{< figure src="/static/img/docs/v74/exemplars.png" class="docs-image--no-shadow" max-width= "750px" caption="Screenshot showing the detail window of an Exemplar" >}}
{{< figure src="/media/docs/grafana/exemplars/screenshot-exemplars.png" class="docs-image--no-shadow" max-width= "750px" caption="Screenshot showing the detail window of an exemplar" >}}
Refer to [View exemplar data]({{< relref "#view-exemplar-data" >}}) for instructions on how to drill down and view exemplar trace details from metrics and logs. To know more about exemplars, refer to the blogpost [Intro to exemplars, which enable Grafana Tempos distributed tracing at massive scale](https://grafana.com/blog/2021/03/31/intro-to-exemplars-which-enable-grafana-tempos-distributed-tracing-at-massive-scale/).
@@ -42,11 +42,11 @@ To examine the details of an exemplar trace:
1. Place your cursor over an exemplar (highlighted star). Depending on your backend trace data source, you will see a blue button with the label `Query with <data source name>`. In the following example, the tracing data source is Tempo.
{{< figure src="/static/img/docs/basics/exemplar-details.png" class="docs-image--no-shadow" max-width= "275px" caption="Screenshot showing Exemplar details" >}}
{{< figure src="/media/docs/grafana/exemplars/screenshot-exemplar-details.png" class="docs-image--no-shadow" max-width= "350px" caption="Screenshot showing exemplar details" >}}
1. Click the **Query with Tempo** option next to the `traceID` property. The trace details, including the spans within the trace are listed in a separate panel on the right.
{{< figure src="/static/img/docs/basics/exemplar-explore-view.png" class="docs-image--no-shadow" max-width= "750px" caption="Explorer view with panel showing trace details" >}}
{{< figure src="/media/docs/grafana/exemplars/screenshot-exemplar-explore-view.png" class="docs-image--no-shadow" max-width= "900px" caption="Explorer view with panel showing trace details" >}}
For more information on how to drill down and analyze the trace and span details, refer to the [Analyze trace and span details](#analyze-trace-and-spans) section.
@@ -56,11 +56,11 @@ You can also view exemplar trace details from the Loki logs in Explore. Use rege
To view the details of an exemplar trace:
1. Expand a log line and scroll down to the `Detected fields` section. Depending on your backend trace data source, you will see a blue button with the label `<data source name>`.
1. Expand a log line and scroll down to the `Fields` section. Depending on your backend trace data source, you will see a blue button with the label `<data source name>`.
1. Click the blue button next to the `traceID` property. Typically, it will have the name of the backend data source. In the following example, the tracing data source is Tempo. The trace details, including the spans within the trace are listed in a separate panel on the right.
{{< figure src="/static/img/docs/basics/exemplar-loki-logs.png" class="docs-image--no-shadow" max-width= "750px" caption="Explorer view with panel showing trace details" >}}
{{< figure src="/media/docs/grafana/exemplars/screenshot-exemplar-loki-logs.png" class="docs-image--no-shadow" max-width= "750px" caption="Explorer view with panel showing trace details" >}}
For more information on how to drill down and analyze the trace and span details, refer to the [Analyze trace and span details](#analyze-trace-and-spans) section.
@@ -84,4 +84,4 @@ This panel shows the details of the trace in different segments.
This displays additional metadata associated with the span. The metadata itself is initially shown in a narrow strip but you can see more details by clicking the metadata strip.
{{< figure src="/static/img/docs/basics/exemplar-span-details.png" class="docs-image--no-shadow" max-width= "750px" caption="Span details" >}}
{{< figure src="/media/docs/grafana/exemplars/screenshot-exemplar-span-details.png" class="docs-image--no-shadow" max-width= "600px" caption="Span details" >}}

View File

@@ -8,7 +8,7 @@ weight: 5
# Grafana OSS
[Grafana open source software](https://grafana.com/oss/) enables you to query, visualize, alert on, and explore your metrics, logs, and traces wherever they are stored. Grafana OSS provides you with tools to turn your time-series database (TSDB) data into insightful graphs and visualizations.
[Grafana open source software](https://grafana.com/oss/) enables you to query, visualize, alert on, and explore your metrics, logs, and traces wherever they are stored. Grafana OSS provides you with tools to turn your time-series database (TSDB) data into insightful graphs and visualizations. The Grafana OSS plugin framework also enables you to connect other data sources like NoSQL/SQL databases, ticketing tools like Jira or ServiceNow, and CI/CD tooling like GitLab.
After you have [installed Grafana]({{< relref "../setup-grafana/installation/" >}}) and set up your first dashboard using instructions in [Getting started with Grafana]({{< relref "../getting-started/build-first-dashboard.md" >}}), you will have many options to choose from depending on your requirements. For example, if you want to view weather data and statistics about your smart home, then you can create a [playlist]({{< relref "../dashboards/create-manage-playlists/" >}}). If you are the administrator for an enterprise and are managing Grafana for multiple teams, then you can set up [provisioning]({{< relref "../administration/provisioning/" >}}) and [authentication]({{< relref "../setup-grafana/configure-security/configure-authentication/" >}}).
@@ -71,3 +71,5 @@ In addition to Grafana, Grafana Labs also provides the following open source pro
**Grafana Tempo:** Grafana Tempo is an open source, easy-to-use and high-volume distributed tracing backend. For more information, refer to [Grafana Tempo documentation](https://grafana.com/docs/tempo/latest/?pg=oss-tempo&plcmt=hero-txt/).
**Grafana Mimir:** Grafana Mimir is an open source software project that provides a scalable long-term storage for Prometheus. For more information about Grafana Mimir, refer to [Grafana Mimir documentation](https://grafana.com/docs/mimir/latest/).
**Grafana Phlare:** Grafana Phlare is an open-source software project for aggregating continuous profiling data. Continuous profiling is an observability signal that enables you to understand your workload's resource (CPU, memory, etc.) usage to the exact line number. For more information about using Grafana Phlare, refer to [Grafana Phlare documentation](https://grafana.com/docs/phlare/latest/).

View File

@@ -6,6 +6,7 @@ aliases:
- ../panels/add-panels-dynamically/about-repeating-panels-rows/
- ../panels/add-panels-dynamically/configure-repeating-panels/
- ../panels/add-panels-dynamically/configure-repeating-rows/
- ../panels/working-with-panels/
- ../panels/working-with-panels/add-panel/
- ../panels/working-with-panels/navigate-inspector-panel/
- ../panels/working-with-panels/navigate-panel-editor/

View File

@@ -75,7 +75,7 @@ rendering_ignore_https_errors = true
enable = newNavigation
```
You can override them on Linux machines with:
You can override variables on Linux machines with:
```bash
export GF_DEFAULT_INSTANCE_NAME=my-instance
@@ -730,6 +730,22 @@ Path to the default home dashboard. If this value is empty, then Grafana uses St
<hr />
## [sql_datasources]
### max_open_conns_default
For SQL data sources (MySql, Postgres, MSSQL) you can override the default maximum number of open connections (default: 100). The value configured in data source settings will be preferred over the default value.
### max_idle_conns_default
For SQL data sources (MySql, Postgres, MSSQL) you can override the default allowed number of idle connections (default: 100). The value configured in data source settings will be preferred over the default value.
### max_conn_lifetime_default
For SQL data sources (MySql, Postgres, MSSQL) you can override the default maximum connection lifetime specified in seconds (default: 14400). The value configured in data source settings will be preferred over the default value.
<hr/>
## [users]
### allow_sign_up
@@ -2020,6 +2036,20 @@ ha_engine_address = 127.0.0.1:6379
<hr>
## [plugin.plugin_id]
This section can be used to configure plugin-specific settings. Replace the `plugin_id` attribute with the plugin ID present in `plugin.json`.
Properties described in this section are available for all plugins, but you must set them individually for each plugin.
### tracing
> **Note**: Available in Grafana v9.5.0 or later, and [OpenTelemetry must be configured as well](#tracingopentelemetry).
If `true`, propagate the tracing context to the plugin backend and enable tracing (if the backend supports it).
<hr>
## [plugin.grafana-image-renderer]
For more information, refer to [Image rendering]({{< relref "../image-rendering/" >}}).

View File

@@ -19,6 +19,7 @@ weight: 900
The enhanced LDAP integration adds additional functionality on top of the [LDAP integration]({{< relref "ldap/" >}}) available in the open source edition of Grafana.
> **Note:** Available in [Grafana Enterprise]({{< relref "../../../../introduction/grafana-enterprise/" >}}) and [Grafana Cloud Advanced](/docs/grafana-cloud).
> If you are a Grafana Cloud customer, please [open a support ticket in the Cloud Portal](/profile/org#support) to request this feature.
> To control user access with role-based permissions, refer to [role-based access control]({{< relref "../../../../administration/roles-and-permissions/access-control/" >}}).

View File

@@ -1,6 +1,5 @@
---
aliases:
- ../../auth/saml/
- ../../auth/team-sync/
- ../../enterprise/team-sync/
description: Learn how to use Team Sync to synchronize between your authentication

View File

@@ -5,6 +5,7 @@ aliases:
- ../installation/installation/
- ../installation/requirements/
- /docs/grafana/v2.1/installation/install/
- ./rpm/
description: Installation guide for Grafana
title: Install Grafana
weight: 100
@@ -22,8 +23,9 @@ Grafana relies on other open source software to operate. For a list of open sour
Grafana supports the following operating systems:
- [Debian / Ubuntu]({{< relref "debian/" >}})
- [RPM-based Linux (Fedora, SUSE/OpenSUSE, RedHat)]({{< relref "rpm/" >}})
- [Debian/Ubuntu]({{< relref "debian/" >}})
- [Red Hat/RHEL/Fedora]({{< relref "redhat-rhel-fedora/" >}})
- [SUSE/OpenSUSE]({{< relref "suse-opensuse/" >}})
- [macOS]({{< relref "mac/" >}})
- [Windows]({{< relref "windows/" >}})

View File

@@ -80,79 +80,6 @@ Complete the following steps to install Grafana using DEB or the standalone bina
1. Depending on which system you are running, click the **Linux** or **ARM** tab on the download page.
1. Copy and paste the code from the installation page into your command line and run.
## 2. Start the server
The following sections provide instructions for starting the `grafana-server` process as the `grafana` user, which was created during the package installation.
If you installed with the APT repository or `.deb` package, then you can start the server using `systemd` or `init.d`. If you installed a binary `.tar.gz` file, then you need to execute the binary.
> **Note:** The following subsections describe three methods of starting the Grafana server: with systemd, initd, or by directly running the binary. You should follow only one set of instructions, depending on how your machine is configured.
### Start the Grafana server with systemd
Complete the following steps to start the Grafana server with systemd and verify that it is running:
1. To start the service, run the following commands:
```bash
sudo systemctl daemon-reload
sudo systemctl start grafana-server
sudo systemctl status grafana-server
```
1. To verify that the service is running, run the following command:
```
sudo systemctl status grafana-server
```
1. To configure the Grafana server to start at boot, run the following command:
```bash
sudo systemctl enable grafana-server.service
```
#### Serve Grafana on a port < 1024
{{< docs/shared "systemd/bind-net-capabilities.md" >}}
### Start the server with init.d
Complete the following steps to start the Grafana service and verify that it is running:
1. To start the Grafana server, run the following commands:
```bash
sudo service grafana-server start
sudo service grafana-server status
```
1. To verify that the service is running, run the following command:
```
sudo service grafana-server status
```
1. To configure the Grafana server to start at boot, run the following command:
```bash
sudo update-rc.d grafana-server defaults
```
### Start the server using the binary
The `grafana-server` binary .tar.gz needs the working directory to be the root install directory where the binary and the `public` folder are located.
To start the Grafana server, run the following command:
```bash
./bin/grafana-server
```
## Upgrade Grafana
While the process for upgrading Grafana is similar to installing Grafana, there are important backup tasks you should perform. Refer to [Upgrade Grafana]({{< relref "../../../upgrade-guide/" >}}) for guidance on updating an existing installation.
## Next steps
- [Start the Grafana server]({{< relref "../../start-restart-grafana/" >}})

View File

@@ -57,10 +57,6 @@ To install Grafana on macOS using the standalone binaries, complete the followin
./bin/grafana-server
```
## Upgrade Grafana
While the process for upgrading Grafana is very similar to installing Grafana, there are important backup tasks you should perform. Refer to [Upgrade Grafana]({{< relref "../../../upgrade-guide/" >}}) for guidance on updating an existing installation.
## Next steps
- [Start the Grafana server]({{< relref "../../start-restart-grafana/" >}})

View File

@@ -0,0 +1,102 @@
---
description: Install guide for Grafana on Red Hat, RHEL, and Fedora.
title: Install Grafana on Red Hat, RHEL, or Fedora
menuTitle: Redhat, RHEL, or Fedora
weight: 400
---
# Install Grafana on Red Hat, RHEL, or Fedora
This topic explains how to install Grafana dependencies, install Grafana on Redhat, RHEL, or Fedora, and start the Grafana server on your system.
You can install Grafana using a YUM repository, using RPM, or by downloading a binary `.tar.gz` file.
If you install via RPM or the `.tar.gz` file, then you must manually update Grafana for each new version.
## Install Grafana from the YUM repository
If you install from the YUM repository, then Grafana is automatically updated every time you run `sudo yum update`.
| Grafana Version | Package | Repository |
| ------------------ | ------------------ | ------------------------- |
| Grafana Enterprise | grafana-enterprise | `https://rpm.grafana.com` |
| Grafana OSS | grafana | `https://rpm.grafana.com` |
> **Note:** Grafana Enterprise is the recommended and default edition. It is available for free and includes all the features of the OSS edition. You can also upgrade to the [full Enterprise feature set](https://grafana.com/products/enterprise/?utm_source=grafana-install-page), which has support for [Enterprise plugins](https://grafana.com/grafana/plugins/?enterprise=1&utcm_source=grafana-install-page).
To install Grafana using a YUM repository, complete the following steps:
1. Add a file to your YUM repository using the method of your choice.
The following example uses `nano` to add a file to the YUM repo.
```bash
sudo nano /etc/yum.repos.d/grafana.repo
```
```bash
[grafana]
name=grafana
baseurl=https://rpm.grafana.com
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://rpm.grafana.com/gpg.key
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
```
1. To prevent beta versions from being installed, add the following exclude line to your `.repo` file.
```bash
exclude=*beta*
```
1. To install Grafana OSS, run the following command:
```bash
sudo yum install grafana
```
1. To install Grafana Enterprise, run the following command:
```bash
sudo yum install grafana-enterprise
```
## Install the Grafana RPM package manually
If you install Grafana manually using YUM or RPM, then you must manually update Grafana for each new version. This method varies according to which Linux OS you are running.
**Note:** The RPM files are signed. You can verify the signature with this [public GPG key](https://rpm.grafana.com/gpg.key).
1. On the [Grafana download page](https://grafana.com/grafana/download), select the Grafana version you want to install.
- The most recent Grafana version is selected by default.
- The **Version** field displays only finished releases. If you want to install a beta version, click **Nightly Builds** and then select a version.
1. Select an **Edition**.
- **Enterprise** - Recommended download. Functionally identical to the open source version, but includes features you can unlock with a license if you so choose.
- **Open Source** - Functionally identical to the Enterprise version, but you will need to download the Enterprise version if you want Enterprise features.
1. Depending on which system you are running, click **Linux** or **ARM**.
1. Copy and paste the RPM package URL and the local RPM package information from the installation page into the pattern shown below, then run the commands.
```bash
sudo yum install -y <rpm package url>
```
## Install Grafana as a standalone binary
Complete the following steps to install Grafana using the standalone binaries:
1. Navigate to the [Grafana download page](https://grafana.com/grafana/download).
1. Select the Grafana version you want to install.
- The most recent Grafana version is selected by default.
- The **Version** field displays only tagged releases. If you want to install a nightly build, click **Nightly Builds** and then select a version.
1. Select an **Edition**.
- **Enterprise:** This is the recommended version. It is functionally identical to the open-source version but includes features you can unlock with a license if you so choose.
- **Open Source:** This version is functionally identical to the Enterprise version, but you will need to download the Enterprise version if you want Enterprise features.
1. Depending on which system you are running, click the **Linux** or **ARM** tab on the download page.
1. Copy and paste the code from the installation page into your command line and run.
## Next steps
Refer to [Start the Grafana server]({{< relref "../../start-restart-grafana/" >}}).

View File

@@ -1,232 +0,0 @@
---
aliases:
- ../../installation/installation/rpm/
- ../../installation/rpm/
description: Grafana Installation guide for RPM-based Linux, such as Centos, Fedora,
OpenSuse, and Red Hat.
title: Install on RPM-based Linux
weight: 400
---
# Install on RPM-based Linux (CentOS, Fedora, OpenSuse, Red Hat)
This topic explains how to install Grafana dependencies, download and install Grafana, get the service up and running on your RPM-based Linux system, and the installation package details.
## Repository migration (November 8th 2022)
From that date, Grafana packages will be served from a new repository (<packages.grafana.com/rpm/{product}> -> <rpm.grafana.com>). The new repository serves, from a single YUM/DNF configuration, all Grafana OSS products, as well as Grafana Enterprise.
The old URLs will still work, serving the content from the new repository, but you may encounter warnings about some repository attributes changing.
## Note on upgrading
While the process for upgrading Grafana is very similar to installing Grafana, there are some key backup steps you should perform. Read [Upgrading Grafana]({{< relref "../../../upgrade-guide/" >}}) for tips and guidance on updating an existing installation.
## 1. Download and install
You can install Grafana from a YUM repository, manually using YUM, manually using RPM, or by downloading a binary `.tar.gz` file.
### Install from YUM repository
If you install from the YUM repository, then Grafana is automatically updated every time you run `sudo yum update`.
| Grafana Version | Package | Repository |
| ------------------ | ------------------ | ------------------------- |
| Grafana Enterprise | grafana-enterprise | `https://rpm.grafana.com` |
| Grafana OSS | grafana | `https://rpm.grafana.com` |
> **Note:** Grafana Enterprise is the recommended and default edition. It is available for free and includes all the features of the OSS Edition. You can also upgrade to the [full Enterprise feature set](https://grafana.com/products/enterprise/?utm_source=grafana-install-page) and has support for [Enterprise plugins](https://grafana.com/grafana/plugins/?enterprise=1&utcm_source=grafana-install-page).
Add a new file to your YUM repo using the method of your choice. The command below uses `nano`.
```bash
sudo nano /etc/yum.repos.d/grafana.repo
```
```bash
[grafana]
name=grafana
baseurl=https://rpm.grafana.com
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://rpm.grafana.com/gpg.key
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
```
Optionally, add an exclude line to your `.repo` file to prevent beta versions from being installed.
```bash
exclude=*beta*
```
Install Grafana with one of the following commands
> We recommend all users to install the Enterprise Edition of Grafana, which can be seamlessly upgraded with a Grafana Enterprise [subscription](https://grafana.com/products/enterprise/?utm_source=grafana-install-page).
```bash
sudo yum install grafana
# or
sudo yum install grafana-enterprise
```
### Install manually with YUM
If you install manually with YUM, then you will need to manually update Grafana for each new version. To enable automatic updates for your Grafana installation please use the instructions below to install via our YUM repository.
1. On the [Grafana download page](https://grafana.com/grafana/download), select the Grafana version you want to install.
- The most recent Grafana version is selected by default.
- The **Version** field displays only finished releases. If you want to install a beta version, click **Nightly Builds** and then select a version.
1. Select an **Edition**.
- **Enterprise** - Recommended download. Functionally identical to the open source version, but includes features you can unlock with a license if you so choose.
- **Open Source** - Functionally identical to the Enterprise version, but you will need to download the Enterprise version if you want enterprise features.
1. Depending on which system you are running, click **Linux** or **ARM**.
1. Copy and paste the code from the installation page into your command line and run. It follows the pattern shown below.
```bash
wget <rpm package url>
sudo yum localinstall <local rpm package>
```
You can also install Grafana using YUM directly:
```bash
sudo yum install <rpm package url>
```
### Install with RPM
If you install with RPM, then you will need to manually update Grafana for each new version. This method varies according to which Linux OS you are running. Read the instructions fully before you begin.
**Note:** The .rpm files are signed, you can verify the signature with this [public GPG key](https://rpm.grafana.com/gpg.key).
1. On the [Grafana download page](https://grafana.com/grafana/download), select the Grafana version you want to install.
- The most recent Grafana version is selected by default.
- The **Version** field displays only finished releases. If you want to install a beta version, click **Nightly Builds** and then select a version.
1. Select an **Edition**.
- **Enterprise** - Recommended download. Functionally identical to the open source version, but includes features you can unlock with a license if you so choose.
- **Open Source** - Functionally identical to the Enterprise version, but you will need to download the Enterprise version if you want Enterprise features.
1. Depending on which system you are running, click **Linux** or **ARM**.
1. Copy and paste the .rpm package URL and the local .rpm package information from the installation page into the pattern shown below, then run the commands.
**On CentOS, Fedora, Red Hat, or RHEL:**
```bash
sudo yum install initscripts urw-fonts wget
wget <rpm package url>
sudo rpm -Uvh <local rpm package>
```
**On OpenSUSE or SUSE:**
```bash
wget <rpm package url>
sudo rpm -i --nodeps <local rpm package>
```
### Install from binary .tar.gz file
Download the latest [`.tar.gz` file](https://grafana.com/grafana/download?platform=linux) and extract it. The files are extracted into a folder named after the Grafana version that you downloaded. This folder contains all files required to run Grafana. There are no init scripts or install scripts in this package.
```bash
wget <tar.gz package url>
sudo tar -zxvf <tar.gz package>
```
## 2. Start the server
This starts the `grafana-server` process as the `grafana` user, which was created during the package installation. The systemd commands work in most cases, but some older Linux systems might require init.d. The installer should prompt you with the correct commands.
If you installed with an `.rpm` package, then you can start the server using `systemd` or `init.d`. If you installed a binary `.tar.gz` file, then you need to execute the binary.
### Start the server with systemd
To start the service and verify that the service has started:
```bash
sudo systemctl daemon-reload
sudo systemctl start grafana-server
sudo systemctl status grafana-server
```
Configure the Grafana server to start at boot:
```bash
sudo systemctl enable grafana-server
```
> **SUSE or OpenSUSE users:** You might need to start the server with the systemd method, then use the init.d method to configure Grafana to start at boot.
#### Serving Grafana on a port < 1024
{{< docs/shared "systemd/bind-net-capabilities.md" >}}
#### Serving Grafana behind a proxy
When serving Grafana behind a proxy, you need to configure the `http_proxy` and `https_proxy` environment variables.
##### Centos 6
If you are on Centos 6, add the following lines to the `/etc/sysconfig/grafana-server` file.
```
export no_proxy=internal.domain,127.0.0.1
export http_proxy=http://proxy.domain:3128/
export https_proxy=http://proxy.domain:3128/
```
##### Centos 7
If you are on Centos 7, add the following lines to the `/etc/sysconfig/grafana-server` file.
```
http_proxy=http://proxy.domain:3128/
https_proxy=http://proxy.domain:3128/
no_proxy=internal.domain,127.0.0.1
```
### Start the server with init.d
To start the service and verify that the service has started:
```bash
sudo service grafana-server start
sudo service grafana-server status
```
Configure the Grafana server to start at boot:
```bash
sudo /sbin/chkconfig --add grafana-server
```
### Execute the binary
The `grafana-server` binary needs the working directory to be the root install directory where the binary and the `public` folder are located.
Start Grafana by running:
```bash
./bin/grafana-server web
```
## Package details
- Installs binary to `/usr/sbin/grafana-server`
- Copies init.d script to `/etc/init.d/grafana-server`
- Installs default file (environment vars) to `/etc/sysconfig/grafana-server`
- Copies configuration file to `/etc/grafana/grafana.ini`
- Installs systemd service (if systemd is available) name `grafana-server.service`
- The default configuration uses a log file at `/var/log/grafana/grafana.log`
- The default configuration specifies an sqlite3 database at `/var/lib/grafana/grafana.db`
## Next steps
Refer to the [Getting Started]({{< relref "../../../getting-started/build-first-dashboard/" >}}) guide for information about logging in, setting up data sources, and so on.
## Configure Grafana
Refer to the [Configuration]({{< relref "../../configure-grafana/" >}}) page for details on options for customizing your environment, logging, database, and so on.

View File

@@ -0,0 +1,84 @@
---
description: Install guide for Grafana on SUSE or OpenSUSE.
title: Install Grafana on SUSE or OpenSUSE
menuTitle: Redhat, RHEL, or Fedora
weight: 450
---
# Install Grafana on SUSE or OpenSUSE
This topic explains how to install Grafana dependencies, install Grafana on SUSE or OpenSUSE and start the Grafana server on your system.
You can install Grafana using a YUM repository, using RPM, or by downloading a binary `.tar.gz` file.
If you install via RPM or the `.tar.gz` file, then you must manually update Grafana for each new version.
## Install Grafana from the YUM repository
If you install from the YUM repository, then Grafana is automatically updated every time you run `sudo zypper update`.
| Grafana Version | Package | Repository |
| ------------------ | ------------------ | ------------------------- |
| Grafana Enterprise | grafana-enterprise | `https://rpm.grafana.com` |
| Grafana OSS | grafana | `https://rpm.grafana.com` |
> **Note:** Grafana Enterprise is the recommended and default edition. It is available for free and includes all the features of the OSS edition. You can also upgrade to the [full Enterprise feature set](https://grafana.com/products/enterprise/?utm_source=grafana-install-page), which has support for [Enterprise plugins](https://grafana.com/grafana/plugins/?enterprise=1&utcm_source=grafana-install-page).
To install Grafana using a YUM repository, complete the following steps:
1. Use zypper to add the grafana repo.
```bash
sudo zypper addrepo https://rpm.grafana.com grafana
```
1. To install Grafana OSS, run the following command:
```bash
sudo zypper install grafana
```
1. To install Grafana Enterprise, run the following command:
```bash
sudo zypper install grafana-enterprise
```
## Install the Grafana RPM package manually
If you install Grafana manually using YUM or RPM, then you must manually update Grafana for each new version. This method varies according to which Linux OS you are running.
**Note:** The RPM files are signed. You can verify the signature with this [public GPG key](https://rpm.grafana.com/gpg.key).
1. On the [Grafana download page](https://grafana.com/grafana/download), select the Grafana version you want to install.
- The most recent Grafana version is selected by default.
- The **Version** field displays only finished releases. If you want to install a beta version, click **Nightly Builds** and then select a version.
1. Select an **Edition**.
- **Enterprise** - Recommended download. Functionally identical to the open source version, but includes features you can unlock with a license if you so choose.
- **Open Source** - Functionally identical to the Enterprise version, but you will need to download the Enterprise version if you want Enterprise features.
1. Depending on which system you are running, click **Linux** or **ARM**.
1. Copy and paste the RPM package URL and the local RPM package information from the installation page into the pattern shown below, then run the commands.
```bash
sudo zypper install initscripts urw-fonts wget
wget <rpm package url>
sudo rpm -Uvh <local rpm package>
```
## Install Grafana as a standalone binary
Complete the following steps to install Grafana using the standalone binaries:
1. Navigate to the [Grafana download page](https://grafana.com/grafana/download).
1. Select the Grafana version you want to install.
- The most recent Grafana version is selected by default.
- The **Version** field displays only tagged releases. If you want to install a nightly build, click **Nightly Builds** and then select a version.
1. Select an **Edition**.
- **Enterprise:** This is the recommended version. It is functionally identical to the open-source version but includes features you can unlock with a license if you so choose.
- **Open Source:** This version is functionally identical to the Enterprise version, but you will need to download the Enterprise version if you want Enterprise features.
1. Depending on which system you are running, click the **Linux** or **ARM** tab on the download page.
1. Copy and paste the code from the installation page into your command line and run.
## Next steps
Refer to [Start the Grafana server]({{< relref "../../start-restart-grafana/" >}}).

View File

@@ -54,10 +54,6 @@ Start Grafana by executing `grafana-server.exe`, located in the `bin` directory,
Port `8080` should not require extra Windows privileges.
## Upgrade Grafana
While the process for upgrading Grafana is very similar to installing Grafana, there are important backup tasks you should perform. Refer to [Upgrade Grafana]({{< relref "../../../upgrade-guide/" >}}) for guidance on updating an existing installation.
## Next steps
- [Start the Grafana server]({{< relref "../../start-restart-grafana/" >}})

View File

@@ -105,9 +105,9 @@ To upgrade Grafana installed from the binary `.tar.gz` package, complete the fol
1. Extract the downloaded package and overwrite the existing files.
### CentOS or RHEL
### RPM or YUM
To upgrade Grafana running on CentOS or RHEL, complete the following steps:
To upgrade Grafana installed using RPM or YUM complete the following steps:
1. In your current installation of Grafana, save your custom configuration changes to a file named `<grafana_install_dir>/conf/custom.ini`.
@@ -115,13 +115,19 @@ To upgrade Grafana running on CentOS or RHEL, complete the following steps:
1. Perform one of the following steps based on your installation.
- If you [downloaded an RPM package](https://grafana.com/grafana/download) to install Grafana, then complete the steps documented in [Install on RPM-based Linux]({{< relref "../../setup-grafana/installation/rpm/" >}}) to upgrade Grafana.
- If you [downloaded an RPM package](https://grafana.com/grafana/download) to install Grafana, then complete the steps documented in [Install Grafana on Red Hat, RHEL, or Fedora]({{< relref "../../setup-grafana/installation/redhat-rhel-fedora/" >}}) or [Install Grafana on SUSE or OpenSUSE]({{< relref "../../setup-grafana/installation/suse-opensuse/" >}}) to upgrade Grafana.
- If you used the Grafana YUM repository, run the following command:
```bash
sudo yum update grafana
```
- If you installed Grafana on OpenSUSE or SUSE, run the following command:
```bash
sudo zypper update
```
### Docker
To upgrade Grafana running in a Docker container, complete the following steps:

View File

@@ -57,6 +57,6 @@ sudo yum install freetype*
sudo yum install urw-fonts
```
## FAQs
## More help
Check out the [FAQ section](https://community.grafana.com/c/howto/faq) on the Grafana Community page for answers to frequently asked questions.
Check out the [Grafana Community](https://community.grafana.com/) for more troubleshooting help (you must be logged in to post or comment).

View File

@@ -90,7 +90,7 @@ Ensure [age](https://github.com/FiloSottile/age#installation) is installed on yo
Add the public key to the `public_keys` setting in the `support_bundle` section of the Grafana configuration file.
```ini
[support_bundle]
[support_bundles]
public_keys = "age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p"
```
@@ -100,7 +100,7 @@ public_keys = "age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p"
Example:
```ini
[support_bundle]
[support_bundles]
public_keys = "age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p age1yu8vzu554pv3klw46yhdv4raz36k5w3vy30lpxn46923lqngudyqvxacer"
```

View File

@@ -0,0 +1,31 @@
---
description: Guide for upgrading to Grafana v9.5
keywords:
- grafana
- configuration
- documentation
- upgrade
title: Upgrade to Grafana v9.5
menuTitle: Upgrade to v9.5
weight: 1800
---
# Upgrade to Grafana v9.5
{{< docs/shared "upgrade/upgrade-common-tasks.md" >}}
## Technical notes
### InfluxDB provisioning change
Beginning in v9.5, the InfluxDB data source deprecates the `database` field in provisioning files.
The `dbName` field under `jsonData` must be used to store the database information.
For more information and examples, please refer to [InfluxDB Provisioning]({{< relref "../../datasources/influxdb/#provision-the-data-source" >}}).
### Dashboard previews deprecation notice
We are deprecating the [Dashboard previews]({{< relref "../../search/dashboard-previews" >}}) feature and will remove it in Grafana v10. We've started exploring alternative ways of adding visual previews using the Scenes framework, and we'll share more information about it in the future.
### Migrate your API keys to service accounts
We are upgrading Grafana [API keys]({{< relref "../../administration/api-keys/" >}}) to service accounts. Service accounts are a superset of API keys that include token rotation and compatibility with [Role-based access control]({{< relref "../../administration/roles-and-permissions/access-control/" >}}). In a future release, we'll automatically migrate all existing API keys to service accounts. All of your existing tokens will continue to work; they will simply be migrated to service accounts. You can preempt this change by migrating your existing API keys to service accounts using Grafana's UI or API. Learn how to do this in the [API keys documentation]({{< relref "../../administration/api-keys/#migrate-api-keys-to-grafana-service-accounts" >}}).

View File

@@ -72,6 +72,7 @@ For a complete list of every change, with links to pull requests and related iss
## Grafana 9
- [What's new in 9.5]({{< relref "whats-new-in-v9-5/" >}})
- [What's new in 9.4]({{< relref "whats-new-in-v9-4/" >}})
- [What's new in 9.3]({{< relref "whats-new-in-v9-3/" >}})
- [What's new in 9.2]({{< relref "whats-new-in-v9-2/" >}})
@@ -86,12 +87,3 @@ For a complete list of every change, with links to pull requests and related iss
- [What's new in 8.2]({{< relref "whats-new-in-v8-2/" >}})
- [What's new in 8.1]({{< relref "whats-new-in-v8-1/" >}})
- [What's new in 8.0]({{< relref "whats-new-in-v8-0/" >}})
## Grafana 7
- [What's new in 7.5]({{< relref "whats-new-in-v7-5/" >}})
- [What's new in 7.4]({{< relref "whats-new-in-v7-4/" >}})
- [What's new in 7.3]({{< relref "whats-new-in-v7-3/" >}})
- [What's new in 7.2]({{< relref "whats-new-in-v7-2/" >}})
- [What's new in 7.1]({{< relref "whats-new-in-v7-1/" >}})
- [What's new in 7.0]({{< relref "whats-new-in-v7-0/" >}})

View File

@@ -296,6 +296,10 @@ We've added support for JWT authentication.
We've added support for custom session parameters.
## Postgres, MySQL, and MSSQL data sources
The `database` property is now under the `jsonData` key in the data source configuration. This change is backward compatible, and existing configurations will continue to work.
## Before you upgrade
There are no known breaking changes associated with this version of Grafana.

View File

@@ -0,0 +1,204 @@
---
description: Feature and improvement highlights for Grafana v9.5
keywords:
- grafana
- new
- documentation
- '9.5'
- release notes
title: What's new in Grafana v9.5
weight: -33
---
# Whats new in Grafana v9.5
Welcome to Grafana 9.5! We're excited to share some major updates to Grafana's navigation, tons of usability improvements to Alerting, and some promising experiments to help you query your Prometheus metrics. Also, read on to learn about our continued migration from API keys to service accounts, as well as deprecation of plugins that use Angular and a field in the InfluxDB data source.
For more detail about all the changes in this release, refer to the [changelog](https://github.com/grafana/grafana/blob/master/CHANGELOG.md). For the specific steps we recommend when you upgrade to v9.5, check out our [Upgrade Guide]({{< relref "../upgrade-guide/upgrade-v9.5/index.md" >}}).
<!-- Template below
## Feature
[Generally available | Available in experimental/beta] in Grafana [Open Source, Enterprise, Cloud Free, Cloud Pro, Cloud Advanced]
Description. Include an overview of the feature and problem it solves, and where to learn more (like a link to the docs).
> **Note:** You must use relative references when linking to docs within the Grafana repo. Please do not use absolute URLs. For more information about relrefs, refer to [Links and references](/docs/writers-toolkit/writing-guide/references/).-->
## Grafana's new navigation is generally available
_Generally available in all editions of Grafana._
The navigation in Grafana has been updated with a new design and an improved structure to make it easier for you to access the data you need. With this update, you can quickly navigate between pages, giving you full visibility into the health of your systems.
As Grafana evolved from a visualization platform to a comprehensive observability solution, we added numerous tools to support users throughout the software development life cycle. These tools focus on preventing incidents, monitoring applications or infrastructure, and aiding incident response. However, the added functionality must be easily discoverable and navigable to be truly helpful. These key updates to Grafanas navigation experience help address this:
- A redesigned navigation menu that groups related tools together for easy access.
- A command palette you can use to take actions in Grafana, like creating a dashboard or navigating to an app or page.
- Updated layouts featuring breadcrumbs and a sidebar, allowing you to quickly jump between pages.
- A new header that appears on all pages in Grafana, which includes a search function.
Join the [discussion on GitHub](https://github.com/grafana/grafana/discussions/58910) and share your feedback.
{{< figure src="/media/docs/grafana/navigation-9-4.png" max-width="750px" caption="Grafana new navigation" >}}
## Dashboards and visualizations
### Redesigned empty dashboard state
_Generally available in all editions of Grafana._
Dashboards have been updated so that its easier to begin building from scratch. The options displayed when you add a new dashboard—adding a visualization, a row, or importing panels—each include brief explanations of what those steps will do, so you can begin building with confidence.
Also, a text **Add** dropdown with these options has replaced the previous "+" icon at the top of the dashboard. This makes it clearer that this element allows you not only to add new panels, but to take all the actions associated with building a new dashboard.
{{< figure src="/media/docs/grafana/screenshot-empty-dashboard-whats-new-9-5.png" max-width="750px" caption="Dashboard without any visualizations added" >}}
### Redesigned dashboard panel is generally available
_Generally available in all editions of Grafana._
Dashboard panels contain a lot of information, some of which is difficult to discover or access from the dashboard. With our redesigned panels, we've improved accessibility and made it easier to understand the status of a panel by adding and moving key elements.
Weve improved panels without titles, made panel descriptions and errors more succinct, and linked key actions from the header of the panel. All of these are laid out from left to right in a row, so there are no overlapping, unusable components.
Grafanas new panel design is available only for React-based panels. No Angular-based panels, like the legacy Graph and Worldmap panels, are redesigned. As a reminder, Angular is deprecated in Grafana and will be removed in a future release. See our [deprecation docs]({{< relref "../developers/angular_deprecation/" >}}) for more information.
{{< figure src="/media/docs/grafana/panel-redesign-whats-new-9.5.png" max-width="750px" caption="Panel header with open menu" >}}
## Prometheus performance and usability improvements
### Prometheus metric encyclopedia
_Experimental in all editions of Grafana._
When you have thousands (or millions) of Prometheus metrics, it can be hard to find the exact one you're looking for. Enable feature toggle `prometheusMetricEncyclopedia` to replace the basic metric select dropdown in the Prometheus query builder with a paginated and searchable metric _encyclopedia_.
Here's what you can do with the metric encyclopedia:
- Fuzzy search for metrics by name, type, and description
- Filter metrics by Prometheus types (gauge, counter, histogram, summary)
- Display metrics in a paginated list, sort the results, and choose a number of results per page, so that you don't wait a long time for search results
- View metric details, like type and description
- [Expert feature] Search metric names by regex using the backend only
### Prometheus browser cache
_Experimental in all editions of Grafana._
New feature toggle `prometheusResourceBrowserCache` provides the ability to cache Prometheus editor API calls in the Prometheus data source configuration.
This improves Prometheus query editor performance, with the biggest performance improvements seen by users with high cardinality Prometheus instances.
## Removal of API key creation from the UI
With this update we are going one step further in deprecating API keys in favor of [service accounts]({{< relref "../administration/service-accounts/" >}}). We've removed the button for creating new API keys through Grafana's user interface, and now only allow the creation of API keys using our HTTP API. We recommend that you migrate your existing API keys to service accounts, and opt for new service accounts instead of new API keys. This change is part of our long-term strategy for sunsetting API keys.
Learn more about the deprecation strategy for API keys and how to manage them in our [Sunsetting API keys](https://github.com/grafana/grafana/issues/53567) GitHub issue.
## Resolve Grafana issues faster with support bundles
_Generally available in all editions of Grafana._
Support bundles provide a simple way to collect information about your Grafana instance through Grafana's user interface. In a few clicks, you can create a support bundle containing data about migrations, plugins, settings, and more. Once you've created a support bundle, you can either examine it yourself, or share it with your colleagues or Grafana engineers to aid in troubleshooting of your Grafana instance.
Learn more about support bundles and how to configure them in our [support bundle documentation]({{< relref "../troubleshooting/support-bundles/" >}}).
{{< figure src="/static/img/docs/troubleshooting/support-bundle.png" max-width="750px" caption="Create a support bundle to resolve issues faster" >}}
## Alerting
_All Alerting improvements are generally available in all editions of Grafana._
### Search for alert rules from multiple data sources
Search for and display alert rules for multiple data sources at the same time.
### Fuzzy search on the Alert rule list view
Search for namespaces or folders, evaluation groups, and alert rule names on the Alert rules list view with immediate results, and regardless of typos.
### Access an alert rule from a dashboard or a panel
Navigate to an alert rule directly from a dashboard or a panel to easily access the alert rule details.
{{< figure src="/media/docs/alerting/alert-rule-dashboard.png" max-width="750px" caption="Access an alert rule from a dashboard or a panel" >}}
### Access a dashboard or panel from an alert rule
Navigate from an alert rule straight to a dashboard or a panel associated with the alert rule to visualize your alerting data.
{{< figure src="/media/docs/alerting/dashboard-alert-rule-2.png" max-width="750px" caption="Access a dashboard or panel from an alert rule" >}}
### Preview queries for recording rules
Visualize queries when creating or editing recording rules, so you can see the results of your query before saving your recording rule.
{{< figure src="/media/docs/alerting/preview-queries-recording-rule.png" max-width="750px" caption="Preview queries for recording rules" >}}
### Updated alert behavior when an evaluation returns no data
Alert rules that are configured to fire when an evaluation returns no data now only fire when the entire duration of the evaluation period has finished. This means that rather than immediately firing when the alert rule condition is breached, the alert rule waits until the time set in the **For** field has finished and then fires, reducing alert noise and allowing for temporary data availability issues.
### Improved Notification policies view
Updates to the Notification policies view make it easier to use and manage in the following ways:
- View default policy and nested policies at a glance
- New tab for mute timings
- View alert instances for each policy
- View contact points and which integrations are configured for each policy
- View inherited properties on nested policies
- Search for label matchers and for contact points to see which notifications are going where
{{< figure src="/media/docs/alerting/notification-policies-view.png" max-width="750px" caption="Improved Notification policies view" >}}
### Guidance for configuring your Alertmanager
Get additional help while configuring your Alertmanager. If you enter an invalid Alertmanager configuration, an error message displays, and you can choose from a previous working configuration to restart it.
## InfluxDB plugin database field deprecation
The `database` field in the provisioning file has been deprecated.
This information will be stored in the `jsonData` field using the `dbName` property.
The `database` field will be removed in the future to make InfluxDB consistent with other data sources.
For more information and examples please refer to the [InfluxDB Provisioning docs]({{< relref "../datasources/influxdb/#provision-the-data-source" >}}).
## Auth: Lock organization roles synced from auth providers
_Generally available in all editions of Grafana._
Grafana v9.4 provided the ability to configure synchronization of organization roles for each OAuth provider. With synchronization on, the organization role was applied to the user from the OAuth provider upon signing in. However, after the user signed in, you could still change the users organization role during the session.
With this release, we are reinforcing organization role syncing behavior by introducing a new feature toggle called `onlyExternalOrgRoleSync`. Once enabled, users signing in to Grafana cannot change organization roles that have been synchronized from an external authentication provider, like Active Directory or Google OAuth. This can help ensure the right users maintain the right level of access at all times.
This feature should be used if you want to enforce strict role synchronization from your auth provider to the organization roles.
To use this feature, enable the `onlyExternalOrgRoleSync` feature toggle. If youre using Grafana Cloud and would like to enable this feature, please contact customer support. We'll also be automatically enabling this feature for Grafana Cloud instances over the upcoming weeks.
You can also _prevent_ the synchronization of organization roles from a given authentication provider. Learn more in our [skip org role sync]({{< relref "../setup-grafana/configure-grafana/#authgrafana_com-skip_org_role_sync/" >}}) documentation.
## Reporting UI adapted to match the new navigation style
_Generally available in Grafana Enterprise, Cloud Pro, and Cloud Advanced._
We updated the reporting UI to better fit the new navigation style, adding a horizontal slider and moving the **Preview** and **Send** buttons to the Action section in the page. We also fixed the alignment of the different sections.
{{< figure src="/media/docs/grafana/Screenshot-newUI-report.png" max-width="750px" caption="New Grafana report UI" >}}
## Experimental support for using JWTs as auth method
_Experimental in Grafana Open Source and Enterprise._
This feature adds support for using JWT tokens to store rendering keys instead of relying on “remote caching”. It covers most rendering use cases, though some still rely on the remote cache as a store. You can enable this by enabling the feature flag `renderAuthJWT` in the `custom.ini` configuration file.
## Note for plugin developers
One of the major changes coming in Grafana 10 will be our upgrade to React 18 and use of the new React client rendering API. There are many significant benefits we gain from this: access to new React features like [transitions](https://react.dev/reference/react/useTransition) and concurrent rendering, as well as other general performance and security improvements. These changes have now been delivered to the core `grafana` repo with [PR 64428](https://github.com/grafana/grafana/pull/64428).
As with any major upgrade, there's a potential for this to impact the way your plugin works. In particular, there could be unintended side effects caused by the changes around improving consistency with `useEffect` timings and automatic batching of state updates.
Recommended actions:
- Review the React 18 [upgrade docs](https://react.dev/blog/2022/03/08/react-18-upgrade-guide)
- Test your plugins against one of the latest [grafana-dev docker images](https://hub.docker.com/r/grafana/grafana-dev/tags?page=1) (for example, [this one](https://hub.docker.com/layers/grafana/grafana-dev/10.0.0-111404pre/images/sha256-ac78acf54b44bd2ce7e68b796b1df47030da7f35e53b02bc3eec3f4de05f780f?context=explore))
- Add a comment to the [forum discussion](https://community.grafana.com/t/grafana-10-is-upgrading-to-react-18/86051) if your plugin is impacted in any way. Either to socialise the changes needed for your plugin or to reach out and ask for help yourself.

View File

@@ -50,6 +50,7 @@ function provisionAzureMonitorDatasources(datasources: AzureMonitorProvision[])
expectedAlertMessage: 'Successfully connected to all Azure Monitor endpoints',
// Reduce the timeout from 30s to error faster when an invalid alert message is presented
timeout: 10000,
awaitHealth: true,
});
}

View File

@@ -13,7 +13,7 @@ e2e.scenario({
e2e.flows.openDashboard({ uid: 'TkZXxlNG3' });
e2e().wait('@query');
e2e.flows.openPanelMenuItem(e2e.flows.PanelMenuItems.Edit, PANEL_UNDER_TEST, true);
e2e.flows.openPanelMenuItem(e2e.flows.PanelMenuItems.Edit, PANEL_UNDER_TEST);
// New panel editor opens when navigating from Panel menu
e2e.components.PanelEditor.General.content().should('be.visible');

View File

@@ -37,7 +37,7 @@ e2e.scenario({
e2e.flows.openDashboard({ uid: 'wfTJJL5Wz' });
// testing opening inspect drawer directly by clicking on Inspect in header menu
e2e.flows.openPanelMenuItem(e2e.flows.PanelMenuItems.Inspect, PANEL_UNDER_TEST, true);
e2e.flows.openPanelMenuItem(e2e.flows.PanelMenuItems.Inspect, PANEL_UNDER_TEST);
expectDrawerTabsAndContent();
@@ -49,7 +49,7 @@ e2e.scenario({
expectSubMenuScenario('Query');
expectSubMenuScenario('Panel JSON', 'JSON');
e2e.flows.openPanelMenuItem(e2e.flows.PanelMenuItems.Edit, PANEL_UNDER_TEST, true);
e2e.flows.openPanelMenuItem(e2e.flows.PanelMenuItems.Edit, PANEL_UNDER_TEST);
e2e.components.QueryTab.queryInspectorButton().should('be.visible').click();

2
go.mod
View File

@@ -400,7 +400,7 @@ require (
)
// Use fork of crewjam/saml with fixes for some issues until changes get merged into upstream
replace github.com/crewjam/saml => github.com/grafana/saml v0.4.13-0.20230203140620-5f476db5c00a
replace github.com/crewjam/saml => github.com/grafana/saml v0.4.13-0.20230331080031-67cbfa09c7b6
// Thema's thema CLI requires cobra, which eventually works its way down to go-hclog@v1.0.0.
// Upgrading affects backend plugins: https://github.com/grafana/grafana/pull/47653#discussion_r850508593

4
go.sum
View File

@@ -1284,8 +1284,8 @@ github.com/grafana/phlare/api v0.1.3 h1:mYTaE9mLsAW/uzPXlW/PQSLsZ4ojBFA+oAMfR/PD
github.com/grafana/phlare/api v0.1.3/go.mod h1:29vcLwFDmZBDce2jwFIMtzvof7fzPadT8VMKw9ks7FU=
github.com/grafana/prometheus-alertmanager v0.25.1-0.20230308154952-78fedf89728b h1:VQOGGGJ2lKcVPANyzIESKYhSeA0QIvUQwfA3CbrkDfA=
github.com/grafana/prometheus-alertmanager v0.25.1-0.20230308154952-78fedf89728b/go.mod h1:MnBfDPXJqXmmfPwQlCLvVUdqfnvrAw+hSPtDeaaFwj4=
github.com/grafana/saml v0.4.13-0.20230203140620-5f476db5c00a h1:aWSTt/pTOI4uGY9DhBMG1l0GOnGjIYtaqxzYR3/q82o=
github.com/grafana/saml v0.4.13-0.20230203140620-5f476db5c00a/go.mod h1:igEejV+fihTIlHXYP8zOec3V5A8y3lws5bQBFsTm4gA=
github.com/grafana/saml v0.4.13-0.20230331080031-67cbfa09c7b6 h1:oHn/OOUkECNX06DPHksS7R3UY5Qdye04b/sBj2/OJ5E=
github.com/grafana/saml v0.4.13-0.20230331080031-67cbfa09c7b6/go.mod h1:igEejV+fihTIlHXYP8zOec3V5A8y3lws5bQBFsTm4gA=
github.com/grafana/sqlds/v2 v2.3.10 h1:HWKhE0vR6LoEiE+Is8CSZOgaB//D1yqb2ntkass9Fd4=
github.com/grafana/sqlds/v2 v2.3.10/go.mod h1:c6ibxnxRVGxV/0YkEgvy7QpQH/lyifFyV7K/14xvdIs=
github.com/grafana/thema v0.0.0-20230302221249-6952e4a999b7 h1:XOxaBjhozlleshff3mKNdp55ul74nXJEX3wz8ckjTpc=

View File

@@ -1,6 +1,8 @@
{
"npmClient": "yarn",
"useWorkspaces": true,
"packages": ["packages/*"],
"version": "9.5.0-pre"
"packages": [
"packages/*"
],
"version": "9.5.1"
}

View File

@@ -3,7 +3,7 @@
"license": "AGPL-3.0-only",
"private": true,
"name": "grafana",
"version": "9.5.0-pre",
"version": "9.5.1",
"repository": "github:grafana/grafana",
"scripts": {
"build": "yarn i18n:compile && NODE_ENV=production webpack --progress --config scripts/webpack/webpack.prod.js",
@@ -266,7 +266,7 @@
"@grafana/lezer-logql": "0.1.2",
"@grafana/monaco-logql": "^0.0.7",
"@grafana/runtime": "workspace:*",
"@grafana/scenes": "^0.2.0",
"@grafana/scenes": "^0.6.0",
"@grafana/schema": "workspace:*",
"@grafana/ui": "workspace:*",
"@kusto/monaco-kusto": "5.3.6",

View File

@@ -2,7 +2,7 @@
"author": "Grafana Labs",
"license": "Apache-2.0",
"name": "@grafana/data",
"version": "9.5.0-pre",
"version": "9.5.1",
"description": "Grafana Data Library",
"keywords": [
"typescript"
@@ -36,7 +36,7 @@
},
"dependencies": {
"@braintree/sanitize-url": "6.0.2",
"@grafana/schema": "9.5.0-pre",
"@grafana/schema": "9.5.1",
"@types/d3-interpolate": "^3.0.0",
"d3-interpolate": "3.0.1",
"date-fns": "2.29.3",

View File

@@ -441,6 +441,124 @@ describe('setFieldConfigDefaults', () => {
}
`);
});
it('applies field config defaults correctly when links property exist in field config and no links are defined in panel', () => {
const dsFieldConfig: FieldConfig = {
links: [
{
title: 'Google link',
url: 'https://google.com',
},
],
};
const panelFieldConfig: FieldConfig = {};
const context: FieldOverrideEnv = {
data: [],
field: { type: FieldType.number } as Field,
dataFrameIndex: 0,
fieldConfigRegistry: customFieldRegistry,
};
// we mutate dsFieldConfig
// @ts-ignore
setFieldConfigDefaults(dsFieldConfig, panelFieldConfig, context);
expect(dsFieldConfig).toMatchInlineSnapshot(`
{
"custom": {},
"links": [
{
"title": "Google link",
"url": "https://google.com",
},
],
}
`);
});
it('applies field config defaults correctly when links property exist in panel config and no links are defined in ds field config', () => {
const dsFieldConfig: FieldConfig = {};
const panelFieldConfig: FieldConfig = {
links: [
{
title: 'Google link',
url: 'https://google.com',
},
],
};
const context: FieldOverrideEnv = {
data: [],
field: { type: FieldType.number } as Field,
dataFrameIndex: 0,
fieldConfigRegistry: customFieldRegistry,
};
// we mutate dsFieldConfig
// @ts-ignore
setFieldConfigDefaults(dsFieldConfig, panelFieldConfig, context);
expect(dsFieldConfig).toMatchInlineSnapshot(`
{
"custom": {},
"links": [
{
"title": "Google link",
"url": "https://google.com",
},
],
}
`);
});
it('applies a merge strategy for links when they exist in ds config and panel', () => {
const dsFieldConfig: FieldConfig = {
links: [
{
title: 'Google link',
url: 'https://google.com',
},
],
};
const panelFieldConfig: FieldConfig = {
links: [
{
title: 'Grafana',
url: 'https://grafana.com',
},
],
};
const context: FieldOverrideEnv = {
data: [],
field: { type: FieldType.number } as Field,
dataFrameIndex: 0,
fieldConfigRegistry: customFieldRegistry,
};
// we mutate dsFieldConfig
setFieldConfigDefaults(dsFieldConfig, panelFieldConfig, context);
expect(dsFieldConfig).toMatchInlineSnapshot(`
{
"custom": {},
"links": [
{
"title": "Google link",
"url": "https://google.com",
},
{
"title": "Grafana",
"url": "https://grafana.com",
},
],
}
`);
});
});
describe('setDynamicConfigValue', () => {

View File

@@ -293,6 +293,11 @@ export function setDynamicConfigValue(config: FieldConfig, value: DynamicConfigV
// config -> from DS
// defaults -> from Panel config
export function setFieldConfigDefaults(config: FieldConfig, defaults: FieldConfig, context: FieldOverrideEnv) {
// For cases where we have links on the datasource config and the panel config, we need to merge them
if (config.links && defaults.links) {
// Combine the data source links and the panel default config links
config.links = [...config.links, ...defaults.links];
}
for (const fieldConfigProperty of context.fieldConfigRegistry.list()) {
if (fieldConfigProperty.isCustom && !config.custom) {
config.custom = {};

View File

@@ -97,7 +97,7 @@ export class AppPlugin<T extends KeyValue = KeyValue> extends GrafanaPlugin<AppP
return this._extensionConfigs;
}
configureExtensionLink<Context extends object>(extension: Exclude<PluginExtensionLinkConfig<Context>, 'type'>) {
configureExtensionLink<Context extends object>(extension: Omit<PluginExtensionLinkConfig<Context>, 'type'>) {
this._extensionConfigs.push({
...extension,
type: PluginExtensionTypes.link,

View File

@@ -1,3 +1,5 @@
import { DataQuery } from '@grafana/schema';
import { RawTimeRange, TimeZone } from './time';
// Plugin Extensions types
@@ -18,7 +20,7 @@ export type PluginExtension = {
export type PluginExtensionLink = PluginExtension & {
type: PluginExtensionTypes.link;
path?: string;
onClick?: (event: React.MouseEvent) => void;
onClick?: (event?: React.MouseEvent) => void;
};
// Objects used for registering extensions (in app plugins)
@@ -43,7 +45,7 @@ export type PluginExtensionLinkConfig<Context extends object = object> = PluginE
Context,
Pick<PluginExtensionLink, 'path'> & {
type: PluginExtensionTypes.link;
onClick?: (event: React.MouseEvent, helpers: PluginExtensionEventHelpers<Context>) => void;
onClick?: (event: React.MouseEvent | undefined, helpers: PluginExtensionEventHelpers<Context>) => void;
}
>;
@@ -73,7 +75,7 @@ export type PluginExtensionPanelContext = {
timeRange: RawTimeRange;
timeZone: TimeZone;
dashboard: Dashboard;
targets: Target[];
targets: DataQuery[];
};
type Dashboard = {
@@ -81,8 +83,3 @@ type Dashboard = {
title: string;
tags: string[];
};
type Target = {
pluginId: string;
refId: string;
};

View File

@@ -2,7 +2,7 @@
"author": "Grafana Labs",
"license": "Apache-2.0",
"name": "@grafana/e2e-selectors",
"version": "9.5.0-pre",
"version": "9.5.1",
"description": "Grafana End-to-End Test Selectors Library",
"keywords": [
"cli",

View File

@@ -2,7 +2,7 @@
"author": "Grafana Labs",
"license": "Apache-2.0",
"name": "@grafana/e2e",
"version": "9.5.0-pre",
"version": "9.5.1",
"description": "Grafana End-to-End Test Library",
"keywords": [
"cli",
@@ -63,7 +63,7 @@
"@babel/core": "7.20.5",
"@babel/preset-env": "7.20.2",
"@cypress/webpack-preprocessor": "5.17.0",
"@grafana/e2e-selectors": "9.5.0-pre",
"@grafana/e2e-selectors": "9.5.1",
"@grafana/tsconfig": "^1.2.0-rc1",
"@mochajs/json-file-reporter": "^1.2.0",
"babel-loader": "9.1.2",

View File

@@ -14,6 +14,7 @@ export interface AddDataSourceConfig {
skipTlsVerify: boolean;
type: string;
timeout?: number;
awaitHealth?: boolean;
}
// @todo this actually returns type `Cypress.Chainable<AddDaaSourceConfig>`
@@ -40,8 +41,15 @@ export const addDataSource = (config?: Partial<AddDataSourceConfig>) => {
skipTlsVerify,
type,
timeout,
awaitHealth,
} = fullConfig;
if (awaitHealth) {
e2e()
.intercept(/health/)
.as('health');
}
e2e().logToConsole('Adding data source with name:', name);
e2e.pages.AddDataSource.visit();
e2e.pages.AddDataSource.dataSourcePluginsV2(type)
@@ -76,6 +84,10 @@ export const addDataSource = (config?: Partial<AddDataSourceConfig>) => {
e2e.pages.DataSource.saveAndTest().click();
if (awaitHealth) {
e2e().wait('@health', { timeout: timeout ?? e2e.config().defaultCommandTimeout });
}
// use the timeout passed in if it exists, otherwise, continue to use the default
e2e.pages.DataSource.alert()
.should('exist')

View File

@@ -34,6 +34,7 @@ interface ConfigurePanelOptional {
panelTitle?: string;
timeRange?: TimeRangeConfig;
visualizationName?: string;
timeout?: number;
}
interface ConfigurePanelRequired {
@@ -80,6 +81,7 @@ export const configurePanel = (config: PartialAddPanelConfig | PartialEditPanelC
timeRange,
visitDashboardAtStart,
visualizationName,
timeout,
} = fullConfig;
if (visitDashboardAtStart) {
@@ -91,15 +93,15 @@ export const configurePanel = (config: PartialAddPanelConfig | PartialEditPanelC
e2e.components.Panels.Panel.headerItems('Edit').click();
} else {
try {
e2e.components.PageToolbar.item('Add panel').should('be.visible');
e2e.components.PageToolbar.item('Add panel').click();
e2e.components.PageToolbar.itemButton('Add panel button').should('be.visible');
e2e.components.PageToolbar.itemButton('Add panel button').click();
} catch (e) {
// Depending on the screen size, the "Add panel" button might be hidden
e2e.components.PageToolbar.item('Show more items').click();
e2e.components.PageToolbar.item('Add panel').last().click();
e2e.components.PageToolbar.item('Add panel button').last().click();
}
e2e.pages.AddDashboard.addNewPanel().should('be.visible');
e2e.pages.AddDashboard.addNewPanel().click();
e2e.pages.AddDashboard.itemButton('Add new visualization menu item').should('be.visible');
e2e.pages.AddDashboard.itemButton('Add new visualization menu item').click();
}
if (timeRange) {
@@ -161,7 +163,7 @@ export const configurePanel = (config: PartialAddPanelConfig | PartialEditPanelC
e2e().wait('@chartData');
// Wait for RxJS
e2e().wait(500);
e2e().wait(timeout ?? e2e.config().defaultCommandTimeout);
if (matchScreenshot) {
let visualization;

View File

@@ -7,26 +7,51 @@ export enum PanelMenuItems {
Extensions = 'Extensions',
}
export const openPanelMenuItem = (menu: PanelMenuItems, panelTitle = 'Panel Title', isReactPanel = false) => {
export const openPanelMenuItem = (menu: PanelMenuItems, panelTitle = 'Panel Title') => {
// we changed the way we open the panel menu in react panels with the new panel header
if (isReactPanel) {
e2e.components.Panels.Panel.menu(panelTitle).click({ force: true }); // force click because menu is hidden and show on hover
e2e.components.Panels.Panel.menuItems(menu).should('be.visible').click();
} else {
// this is the old way of opening the panel menu from the title
e2e.components.Panels.Panel.title(panelTitle).should('be.visible').click();
e2e.components.Panels.Panel.headerItems(menu).should('be.visible').click();
}
detectPanelType(panelTitle, (isAngularPanel) => {
if (isAngularPanel) {
e2e.components.Panels.Panel.title(panelTitle).should('be.visible').click();
e2e.components.Panels.Panel.headerItems(menu).should('be.visible').click();
} else {
e2e.components.Panels.Panel.menu(panelTitle).click({ force: true }); // force click because menu is hidden and show on hover
e2e.components.Panels.Panel.menuItems(menu).should('be.visible').click();
}
});
};
export const openPanelMenuExtension = (extensionTitle: string, panelTitle = 'Panel Title') => {
e2e.components.Panels.Panel.title(panelTitle).should('be.visible').click();
e2e.components.Panels.Panel.headerItems(PanelMenuItems.Extensions)
.should('be.visible')
.parent()
.parent()
.invoke('addClass', 'open');
e2e.components.Panels.Panel.headerItems(extensionTitle).should('be.visible').click();
const menuItem = PanelMenuItems.Extensions;
// we changed the way we open the panel menu in react panels with the new panel header
detectPanelType(panelTitle, (isAngularPanel) => {
if (isAngularPanel) {
e2e.components.Panels.Panel.title(panelTitle).should('be.visible').click();
e2e.components.Panels.Panel.headerItems(menuItem)
.should('be.visible')
.parent()
.parent()
.invoke('addClass', 'open');
e2e.components.Panels.Panel.headerItems(extensionTitle).should('be.visible').click();
} else {
e2e.components.Panels.Panel.menu(panelTitle).click({ force: true }); // force click because menu is hidden and show on hover
e2e.components.Panels.Panel.menuItems(menuItem).trigger('mouseover', { force: true });
e2e.components.Panels.Panel.menuItems(extensionTitle).click({ force: true });
}
});
};
function detectPanelType(panelTitle: string, detected: (isAngularPanel: boolean) => void) {
e2e.components.Panels.Panel.title(panelTitle).then((el) => {
const isAngularPanel = el.find('plugin-component.ng-scope').length > 0;
if (isAngularPanel) {
Cypress.log({
name: 'detectPanelType',
displayName: 'detector',
message: 'Angular panel detected, will use legacy selectors.',
});
}
detected(isAngularPanel);
});
}

View File

@@ -1,7 +1,7 @@
{
"name": "@grafana/eslint-plugin",
"description": "ESLint rules for use within the Grafana repo. Not suitable (or supported) for external use.",
"version": "9.5.0-pre",
"version": "9.5.1",
"main": "./index.cjs",
"author": "Grafana Labs",
"license": "Apache-2.0",

View File

@@ -2,7 +2,7 @@
"author": "Grafana Labs",
"license": "Apache-2.0",
"name": "@grafana/runtime",
"version": "9.5.0-pre",
"version": "9.5.1",
"description": "Grafana Runtime Library",
"keywords": [
"grafana",
@@ -37,10 +37,10 @@
"postpack": "mv package.json.bak package.json"
},
"dependencies": {
"@grafana/data": "9.5.0-pre",
"@grafana/e2e-selectors": "9.5.0-pre",
"@grafana/data": "9.5.1",
"@grafana/e2e-selectors": "9.5.1",
"@grafana/faro-web-sdk": "1.0.2",
"@grafana/ui": "9.5.0-pre",
"@grafana/ui": "9.5.1",
"@sentry/browser": "6.19.7",
"history": "4.10.1",
"lodash": "4.17.21",

View File

@@ -307,6 +307,8 @@ describe('DataSourceWithBackend', () => {
expect(isExpressionReference('Expression')).toBeTruthy(); // Name
expect(isExpressionReference({ type: '__expr__' })).toBeTruthy();
expect(isExpressionReference({ type: '-100' })).toBeTruthy();
expect(isExpressionReference(null)).toBeFalsy();
expect(isExpressionReference(undefined)).toBeFalsy();
});
});
});

View File

@@ -2,7 +2,7 @@
"author": "Grafana Labs",
"license": "Apache-2.0",
"name": "@grafana/schema",
"version": "9.5.0-pre",
"version": "9.5.1",
"description": "Grafana Schema Library",
"keywords": [
"typescript"

View File

@@ -2,7 +2,7 @@
"author": "Grafana Labs",
"license": "Apache-2.0",
"name": "@grafana/toolkit",
"version": "9.5.0-pre",
"version": "9.5.1",
"description": "Grafana Toolkit",
"keywords": [
"grafana",
@@ -51,10 +51,10 @@
"@babel/preset-env": "7.18.9",
"@babel/preset-react": "7.18.6",
"@babel/preset-typescript": "7.18.6",
"@grafana/data": "9.5.0-pre",
"@grafana/data": "9.5.1",
"@grafana/eslint-config": "5.1.0",
"@grafana/tsconfig": "^1.2.0-rc1",
"@grafana/ui": "9.5.0-pre",
"@grafana/ui": "9.5.1",
"@jest/core": "27.5.1",
"@types/command-exists": "^1.2.0",
"@types/eslint": "8.4.1",

View File

@@ -2,7 +2,7 @@
"author": "Grafana Labs",
"license": "Apache-2.0",
"name": "@grafana/ui",
"version": "9.5.0-pre",
"version": "9.5.1",
"description": "Grafana Components Library",
"keywords": [
"grafana",
@@ -49,10 +49,10 @@
"dependencies": {
"@emotion/css": "11.10.6",
"@emotion/react": "11.10.6",
"@grafana/data": "9.5.0-pre",
"@grafana/e2e-selectors": "9.5.0-pre",
"@grafana/data": "9.5.1",
"@grafana/e2e-selectors": "9.5.1",
"@grafana/faro-web-sdk": "1.0.2",
"@grafana/schema": "9.5.0-pre",
"@grafana/schema": "9.5.1",
"@leeoniya/ufuzzy": "1.0.6",
"@monaco-editor/react": "4.4.6",
"@popperjs/core": "2.11.6",

View File

@@ -392,7 +392,7 @@ func (hs *HTTPServer) registerRoutes() {
idScope := datasources.ScopeProvider.GetResourceScope(ac.Parameter(":id"))
uidScope := datasources.ScopeProvider.GetResourceScopeUID(ac.Parameter(":uid"))
nameScope := datasources.ScopeProvider.GetResourceScopeName(ac.Parameter(":name"))
datasourceRoute.Get("/", authorize(reqOrgAdmin, ac.EvalPermission(datasources.ActionRead)), routing.Wrap(hs.GetDataSources))
datasourceRoute.Get("/", authorize(reqEditorRole, ac.EvalPermission(datasources.ActionRead)), routing.Wrap(hs.GetDataSources))
datasourceRoute.Post("/", authorize(reqOrgAdmin, ac.EvalPermission(datasources.ActionCreate)), quota(string(datasources.QuotaTargetSrv)), routing.Wrap(hs.AddDataSource))
datasourceRoute.Put("/:id", authorize(reqOrgAdmin, ac.EvalPermission(datasources.ActionWrite, idScope)), routing.Wrap(hs.UpdateDataSourceByID))
datasourceRoute.Put("/uid/:uid", authorize(reqOrgAdmin, ac.EvalPermission(datasources.ActionWrite, uidScope)), routing.Wrap(hs.UpdateDataSourceByUID))

View File

@@ -469,6 +469,10 @@ func (hs *HTTPServer) InstallPlugin(c *contextmodel.ReqContext) response.Respons
if errors.Is(err, plugins.ErrInstallCorePlugin) {
return response.Error(http.StatusForbidden, "Cannot install or change a Core plugin", err)
}
var archError repo.ErrArcNotFound
if errors.As(err, &archError) {
return response.Error(http.StatusNotFound, archError.Error(), nil)
}
return response.Error(http.StatusInternalServerError, "Failed to install plugin", err)
}

View File

@@ -217,12 +217,22 @@ func ldflags(opts BuildOpts) (string, error) {
return "", err
}
commitSha := getGitSha()
if v := os.Getenv("COMMIT_SHA"); v != "" {
commitSha = v
}
buildBranch := getGitBranch()
if v := os.Getenv("BUILD_BRANCH"); v != "" {
buildBranch = v
}
var b bytes.Buffer
b.WriteString("-w")
b.WriteString(fmt.Sprintf(" -X main.version=%s", opts.version))
b.WriteString(fmt.Sprintf(" -X main.commit=%s", getGitSha()))
b.WriteString(fmt.Sprintf(" -X main.commit=%s", commitSha))
b.WriteString(fmt.Sprintf(" -X main.buildstamp=%d", buildStamp))
b.WriteString(fmt.Sprintf(" -X main.buildBranch=%s", getGitBranch()))
b.WriteString(fmt.Sprintf(" -X main.buildBranch=%s", buildBranch))
if v := os.Getenv("LDFLAGS"); v != "" {
b.WriteString(fmt.Sprintf(" -extldflags \"%s\"", v))
}

View File

@@ -51,4 +51,22 @@ var (
Name: "tag",
Usage: "Grafana version tag",
}
securityFlag = cli.BoolFlag{
Name: "security",
Usage: "Security release",
}
srcFlag = cli.StringFlag{
Name: "src-bucket",
Value: "grafana-prerelease",
Usage: "Google Cloud Storage bucket",
}
securityDestBucketFlag = cli.StringFlag{
Name: "security-dest-bucket",
Usage: "Google Cloud Storage bucket for security packages (or $SECURITY_DEST_BUCKET)",
}
destFlag = cli.StringFlag{
Name: "dest-bucket",
Value: "grafana-downloads",
Usage: "Google Cloud Storage bucket for published packages",
}
)

View File

@@ -198,42 +198,31 @@ func main() {
Usage: "Handle Grafana artifacts",
Subcommands: cli.Commands{
{
Name: "publish",
Usage: "Publish Grafana artifacts",
Action: PublishArtifactsAction,
Name: "storybook",
Usage: "Publish Grafana storybook",
Action: PublishStorybookAction,
Flags: []cli.Flag{
&editionFlag,
&cli.BoolFlag{
Name: "security",
Usage: "Security release",
},
&tagFlag,
&srcFlag,
&cli.StringFlag{
Name: "security-dest-bucket",
Usage: "Google Cloud Storage bucket for security packages (or $SECURITY_DEST_BUCKET)",
},
&cli.StringFlag{
Name: "tag",
Usage: "Grafana version tag",
},
&cli.StringFlag{
Name: "src-bucket",
Value: "grafana-prerelease",
Usage: "Google Cloud Storage bucket",
},
&cli.StringFlag{
Name: "dest-bucket",
Value: "grafana-downloads",
Usage: "Google Cloud Storage bucket for published packages",
},
&cli.StringFlag{
Name: "enterprise2-dest-bucket",
Value: "grafana-downloads-enterprise2",
Usage: "Google Cloud Storage bucket for published packages",
},
&cli.StringFlag{
Name: "enterprise2-security-prefix",
Usage: "Bucket path prefix for enterprise2 security releases (or $ENTERPRISE2_SECURITY_PREFIX)",
Name: "storybook-bucket",
Value: "grafana-storybook",
Usage: "Google Cloud Storage bucket for storybooks",
},
},
},
{
Name: "static-assets",
Usage: "Publish Grafana static assets",
Action: PublishStaticAssetsAction,
Flags: []cli.Flag{
&editionFlag,
&securityFlag,
&securityDestBucketFlag,
&tagFlag,
&srcFlag,
&destFlag,
&cli.StringFlag{
Name: "static-assets-bucket",
Value: "grafana-static-assets",
@@ -243,10 +232,32 @@ func main() {
Name: "static-asset-editions",
Usage: "All the editions of the static assets (or $STATIC_ASSET_EDITIONS)",
},
},
},
{
Name: "packages",
Usage: "Publish Grafana packages",
Action: PublishArtifactsAction,
Flags: []cli.Flag{
&editionFlag,
&securityFlag,
&securityDestBucketFlag,
&tagFlag,
&srcFlag,
&destFlag,
&cli.StringSliceFlag{
Name: "artifacts-editions",
Value: cli.NewStringSlice("oss", "enterprise", "enterprise2"),
Usage: "Editions for which the artifacts should be delivered (oss,enterprise,enterprise2), (or $ARTIFACTS_EDITIONS)",
},
&cli.StringFlag{
Name: "storybook-bucket",
Value: "grafana-storybook",
Usage: "Google Cloud Storage bucket for storybooks",
Name: "enterprise2-dest-bucket",
Value: "grafana-downloads-enterprise2",
Usage: "Google Cloud Storage bucket for published packages",
},
&cli.StringFlag{
Name: "enterprise2-security-prefix",
Usage: "Bucket path prefix for enterprise2 security releases (or $ENTERPRISE2_SECURITY_PREFIX)",
},
},
},

View File

@@ -3,60 +3,16 @@ package main
import (
"fmt"
"log"
"os"
"os/exec"
"path/filepath"
"strings"
"github.com/grafana/grafana/pkg/build/env"
"github.com/grafana/grafana/pkg/build/gcloud"
"github.com/grafana/grafana/pkg/build/versions"
"github.com/grafana/grafana/pkg/build/gcloud/storage"
"github.com/urfave/cli/v2"
)
type publishConfig struct {
tag string
srcBucket string
destBucket string
enterprise2DestBucket string
enterprise2SecurityPrefix string
staticAssetsBucket string
staticAssetEditions []string
storybookBucket string
security bool
}
// requireListWithEnvFallback first checks the CLI for a flag with the required
// name. If this is empty, it falls back to taking the environment variable.
// Sadly, we cannot use cli.Flag.EnvVars for this due to it potentially leaking
// environment variables as default values in usage-errors.
func requireListWithEnvFallback(cctx *cli.Context, name string, envName string) ([]string, error) {
result := cctx.StringSlice(name)
if len(result) == 0 {
for _, v := range strings.Split(os.Getenv(envName), ",") {
value := strings.TrimSpace(v)
if value != "" {
result = append(result, value)
}
}
}
if len(result) == 0 {
return nil, cli.Exit(fmt.Sprintf("Required flag (%s) or environment variable (%s) not set", name, envName), 1)
}
return result, nil
}
func requireStringWithEnvFallback(cctx *cli.Context, name string, envName string) (string, error) {
result := cctx.String(name)
if result == "" {
result = os.Getenv(envName)
}
if result == "" {
return "", cli.Exit(fmt.Sprintf("Required flag (%s) or environment variable (%s) not set", name, envName), 1)
}
return result, nil
}
// Action implements the sub-command "publish-artifacts".
// PublishArtifactsAction Action implements the sub-command "publish-artifacts".
func PublishArtifactsAction(c *cli.Context) error {
if c.NArg() > 0 {
if err := cli.ShowSubcommandHelp(c); err != nil {
@@ -65,17 +21,23 @@ func PublishArtifactsAction(c *cli.Context) error {
return cli.Exit("", 1)
}
staticAssetEditions, err := requireListWithEnvFallback(c, "static-asset-editions", "STATIC_ASSET_EDITIONS")
security := c.Bool("security")
var securityDestBucket, enterprise2SecurityPrefix string
artifactsEditions, err := env.RequireListWithEnvFallback(c, "artifacts-editions", "ARTIFACTS_EDITIONS")
if err != nil {
return err
}
securityDestBucket, err := requireStringWithEnvFallback(c, "security-dest-bucket", "SECURITY_DEST_BUCKET")
if err != nil {
return err
}
enterprise2SecurityPrefix, err := requireStringWithEnvFallback(c, "enterprise2-security-prefix", "ENTERPRISE2_SECURITY_PREFIX")
if err != nil {
return err
if security {
securityDestBucket, err = env.RequireStringWithEnvFallback(c, "security-dest-bucket", "SECURITY_DEST_BUCKET")
if err != nil {
return err
}
enterprise2SecurityPrefix, err = env.RequireStringWithEnvFallback(c, "enterprise2-security-prefix", "ENTERPRISE2_SECURITY_PREFIX")
if err != nil {
return err
}
}
if err := gcloud.ActivateServiceAccount(); err != nil {
@@ -87,10 +49,7 @@ func PublishArtifactsAction(c *cli.Context) error {
destBucket: c.String("dest-bucket"),
enterprise2DestBucket: c.String("enterprise2-dest-bucket"),
enterprise2SecurityPrefix: enterprise2SecurityPrefix,
staticAssetsBucket: c.String("static-assets-bucket"),
staticAssetEditions: staticAssetEditions,
storybookBucket: c.String("storybook-bucket"),
security: c.Bool("security"),
security: security,
tag: strings.TrimPrefix(c.String("tag"), "v"),
}
@@ -98,114 +57,56 @@ func PublishArtifactsAction(c *cli.Context) error {
cfg.destBucket = securityDestBucket
}
err = copyStaticAssets(cfg)
gcs, err := storage.New()
if err != nil {
return err
}
err = copyStorybook(cfg)
if err != nil {
return err
}
err = copyDownloads(cfg)
if err != nil {
return err
}
err = copyEnterprise2Downloads(cfg)
if err != nil {
return err
for _, edition := range artifactsEditions {
switch edition {
case "oss", "enterprise":
err = copyArtifacts(c, gcs, cfg, edition)
if err != nil {
return err
}
case "enterprise2":
err = copyEnterprise2Artifacts(c, gcs, cfg)
if err != nil {
return err
}
default:
log.Printf("unrecognised artifacts edition: %s\n", edition)
}
}
return nil
}
func copyStaticAssets(cfg publishConfig) error {
for _, edition := range cfg.staticAssetEditions {
log.Printf("Copying static assets for %s", edition)
srcURL := fmt.Sprintf("%s/artifacts/static-assets/%s/%s/*", cfg.srcBucket, edition, cfg.tag)
destURL := fmt.Sprintf("%s/%s/%s/", cfg.staticAssetsBucket, edition, cfg.tag)
err := gcsCopy("static assets", srcURL, destURL)
if err != nil {
return fmt.Errorf("error copying static assets, %q", err)
}
func copyArtifacts(c *cli.Context, gcs *storage.Client, cfg publishConfig, edition string) error {
bucket := gcs.Bucket(cfg.destBucket)
destURL := edition
if !cfg.security {
destURL = filepath.Join(destURL, "release")
}
log.Printf("Successfully copied static assets!")
return nil
}
func copyStorybook(cfg publishConfig) error {
if cfg.security {
log.Printf("skipping storybook copy - not needed for a security release")
return nil
}
log.Printf("Copying storybooks...")
srcURL := fmt.Sprintf("%s/artifacts/storybook/v%s/*", cfg.srcBucket, cfg.tag)
destURL := fmt.Sprintf("%s/%s", cfg.storybookBucket, cfg.tag)
err := gcsCopy("storybook", srcURL, destURL)
if err != nil {
return fmt.Errorf("error copying storybook. %q", err)
}
stableVersion, err := versions.GetLatestVersion(versions.LatestStableVersionURL)
if err != nil {
log.Printf("Copying downloads for %s, from %s bucket to %s bucket", edition, cfg.srcBucket, destURL)
if err := gcs.CopyRemoteDir(c.Context, gcs.Bucket(cfg.srcBucket), fmt.Sprintf("artifacts/downloads/v%s/%s/release", cfg.tag, edition), bucket, destURL); err != nil {
return err
}
isLatest, err := versions.IsGreaterThanOrEqual(cfg.tag, stableVersion)
if err != nil {
return err
}
if isLatest {
log.Printf("Copying storybooks to latest...")
srcURL := fmt.Sprintf("%s/artifacts/storybook/v%s/*", cfg.srcBucket, cfg.tag)
destURL := fmt.Sprintf("%s/latest", cfg.storybookBucket)
err := gcsCopy("storybook (latest)", srcURL, destURL)
if err != nil {
return fmt.Errorf("error copying storybook to latest. %q", err)
}
}
log.Printf("Successfully copied storybook!")
return nil
}
func copyDownloads(cfg publishConfig) error {
for _, edition := range []string{
"oss", "enterprise",
} {
destURL := fmt.Sprintf("%s/%s/", cfg.destBucket, edition)
srcURL := fmt.Sprintf("%s/artifacts/downloads/v%s/%s/release/*", cfg.srcBucket, cfg.tag, edition)
if !cfg.security {
destURL = filepath.Join(destURL, "release")
}
log.Printf("Copying downloads for %s, from %s bucket to %s bucket", edition, srcURL, destURL)
err := gcsCopy("downloads", srcURL, destURL)
if err != nil {
return fmt.Errorf("error copying downloads, %q", err)
}
}
log.Printf("Successfully copied downloads.")
return nil
}
func copyEnterprise2Downloads(cfg publishConfig) error {
func copyEnterprise2Artifacts(c *cli.Context, gcs *storage.Client, cfg publishConfig) error {
bucket := gcs.Bucket(cfg.enterprise2DestBucket)
var prefix string
if cfg.security {
prefix = cfg.enterprise2SecurityPrefix
}
srcURL := fmt.Sprintf("%s/artifacts/downloads-enterprise2/v%s/enterprise2/release/*", cfg.srcBucket, cfg.tag)
destURL := fmt.Sprintf("%s/enterprise2/%srelease", cfg.enterprise2DestBucket, prefix)
log.Printf("Copying downloads for enterprise2, from %s bucket to %s bucket", srcURL, destURL)
err := gcsCopy("enterprise2 downloads", srcURL, destURL)
if err != nil {
return fmt.Errorf("error copying ")
}
return nil
}
func gcsCopy(desc, src, dest string) error {
args := strings.Split(fmt.Sprintf("-m cp -r gs://%s gs://%s", src, dest), " ")
// nolint:gosec
cmd := exec.Command("gsutil", args...)
out, err := cmd.CombinedOutput()
if err != nil {
return fmt.Errorf("failed to publish %s: %w\n%s", desc, err, out)
destURL := fmt.Sprintf("enterprise2/%srelease", prefix)
log.Printf("Copying downloads for enterprise2, from %s bucket to %s bucket", cfg.srcBucket, destURL)
if err := gcs.CopyRemoteDir(c.Context, gcs.Bucket(cfg.srcBucket), fmt.Sprintf("artifacts/downloads-enterprise2/v%s/enterprise2/release", cfg.tag), bucket, destURL); err != nil {
return err
}
return nil
}

View File

@@ -0,0 +1,13 @@
package main
type publishConfig struct {
tag string
srcBucket string
destBucket string
enterprise2DestBucket string
enterprise2SecurityPrefix string
staticAssetsBucket string
staticAssetEditions []string
storybookBucket string
security bool
}

View File

@@ -0,0 +1,51 @@
package main
import (
"fmt"
"strings"
"github.com/grafana/grafana/pkg/build/env"
"github.com/grafana/grafana/pkg/build/gcloud"
"github.com/grafana/grafana/pkg/build/gcloud/storage"
"github.com/urfave/cli/v2"
)
// PublishStaticAssetsAction Action implements the sub-command "artifacts static-assets".
func PublishStaticAssetsAction(c *cli.Context) error {
if c.NArg() > 0 {
if err := cli.ShowSubcommandHelp(c); err != nil {
return cli.Exit(err.Error(), 1)
}
return cli.Exit("", 1)
}
staticAssetEditions, err := env.RequireListWithEnvFallback(c, "static-asset-editions", "STATIC_ASSET_EDITIONS")
if err != nil {
return err
}
if err := gcloud.ActivateServiceAccount(); err != nil {
return fmt.Errorf("error connecting to gcp, %q", err)
}
cfg := publishConfig{
srcBucket: c.String("src-bucket"),
staticAssetsBucket: c.String("static-assets-bucket"),
staticAssetEditions: staticAssetEditions,
tag: strings.TrimPrefix(c.String("tag"), "v"),
}
gcs, err := storage.New()
if err != nil {
return err
}
bucket := gcs.Bucket(cfg.staticAssetsBucket)
for _, edition := range staticAssetEditions {
if err := gcs.CopyRemoteDir(c.Context, gcs.Bucket(cfg.srcBucket), fmt.Sprintf("artifacts/static-assets/%s/%s", edition, cfg.tag), bucket, fmt.Sprintf("%s/%s", edition, cfg.tag)); err != nil {
return err
}
}
return nil
}

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