update config form+better
This commit is contained in:
commit
b70219b345
49 files changed
+4670
-339
No files matched your search
+3
-9
@@ -3403,14 +3403,11 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "5"]
|
||||
],
|
||||
"public/app/features/dashboard-scene/saving/provisioned/DashboardPreviewBanner.tsx:5381": [
|
||||
[0, 0, 0, "No untranslated strings in text props. Wrap text with <Trans /> or use t()", "0"],
|
||||
[0, 0, 0, "No untranslated strings in text props. Wrap text with <Trans /> or use t()", "1"],
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "0"],
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "1"],
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "2"],
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "3"],
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "4"],
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "5"],
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "6"],
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "7"]
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "4"]
|
||||
],
|
||||
"public/app/features/dashboard-scene/saving/provisioned/SaveProvisionedDashboard.tsx:5381": [
|
||||
[0, 0, 0, "No untranslated strings in text props. Wrap text with <Trans /> or use t()", "0"],
|
||||
@@ -5958,9 +5955,6 @@ exports[`better eslint`] = {
|
||||
"public/app/features/provisioning/api/types.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/features/query-library/api/query.ts:5381": [
|
||||
[0, 0, 0, "\'@grafana/runtime/src/services/backendSrv\' import is restricted from being used by a pattern. Import from the public export instead.", "0"]
|
||||
],
|
||||
"public/app/features/query/components/QueryEditorRow.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
||||
|
||||
@@ -498,6 +498,7 @@ playwright.config.ts @grafana/plugins-platform-frontend
|
||||
/public/app/features/explore/ @grafana/observability-traces-and-profiling
|
||||
/public/app/features/expressions/ @grafana/observability-metrics
|
||||
/public/app/features/folders/ @grafana/grafana-frontend-platform
|
||||
/public/app/features/iam/ @grafana/grafana-frontend-platform
|
||||
/public/app/features/inspector/ @grafana/dashboards-squad
|
||||
/public/app/features/invites/ @grafana/grafana-frontend-platform
|
||||
/public/app/features/library-panels/ @grafana/dashboards-squad
|
||||
|
||||
+25
-17
@@ -1,13 +1,19 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
# to maintain formatting of multiline commands in vscode, add the following to settings.json:
|
||||
# "docker.languageserver.formatter.ignoreMultilineInstructions": true
|
||||
|
||||
ARG BASE_IMAGE=alpine:3.20
|
||||
ARG JS_IMAGE=node:22-alpine
|
||||
ARG JS_PLATFORM=linux/amd64
|
||||
ARG GO_IMAGE=golang:1.23.5-alpine
|
||||
|
||||
# Default to building locally
|
||||
ARG GO_SRC=go-builder
|
||||
ARG JS_SRC=js-builder
|
||||
|
||||
FROM --platform=${JS_PLATFORM} ${JS_IMAGE} as js-builder
|
||||
# Javascript build stage
|
||||
FROM --platform=${JS_PLATFORM} ${JS_IMAGE} AS js-builder
|
||||
|
||||
ENV NODE_OPTIONS=--max_old_space_size=8000
|
||||
|
||||
@@ -32,7 +38,8 @@ COPY emails emails
|
||||
ENV NODE_ENV=production
|
||||
RUN yarn build
|
||||
|
||||
FROM ${GO_IMAGE} as go-builder
|
||||
# Golang build stage
|
||||
FROM ${GO_IMAGE} AS go-builder
|
||||
|
||||
ARG COMMIT_SHA=""
|
||||
ARG BUILD_BRANCH=""
|
||||
@@ -97,7 +104,8 @@ ENV BUILD_BRANCH=${BUILD_BRANCH}
|
||||
|
||||
RUN make build-go GO_BUILD_TAGS=${GO_BUILD_TAGS} WIRE_TAGS=${WIRE_TAGS}
|
||||
|
||||
FROM ${BASE_IMAGE} as tgz-builder
|
||||
# From-tarball build stage
|
||||
FROM ${BASE_IMAGE} AS tgz-builder
|
||||
|
||||
WORKDIR /tmp/grafana
|
||||
|
||||
@@ -109,8 +117,8 @@ COPY ${GRAFANA_TGZ} /tmp/grafana.tar.gz
|
||||
RUN tar x -z -f /tmp/grafana.tar.gz --strip-components=1
|
||||
|
||||
# helpers for COPY --from
|
||||
FROM ${GO_SRC} as go-src
|
||||
FROM ${JS_SRC} as js-src
|
||||
FROM ${GO_SRC} AS go-src
|
||||
FROM ${JS_SRC} AS js-src
|
||||
|
||||
# Final stage
|
||||
FROM ${BASE_IMAGE}
|
||||
@@ -145,19 +153,19 @@ RUN if grep -i -q alpine /etc/issue; then \
|
||||
fi
|
||||
|
||||
# glibc support for alpine x86_64 only
|
||||
# docker run --rm --env STDOUT=1 sgerrand/glibc-builder 2.40 /usr/glibc-compat > glibc-bin-2.40.tar.gz
|
||||
ARG GLIBC_VERSION=2.40
|
||||
|
||||
RUN if grep -i -q alpine /etc/issue && [ `arch` = "x86_64" ]; then \
|
||||
wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
|
||||
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r0/glibc-2.35-r0.apk \
|
||||
-O /tmp/glibc-2.35-r0.apk && \
|
||||
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r0/glibc-bin-2.35-r0.apk \
|
||||
-O /tmp/glibc-bin-2.35-r0.apk && \
|
||||
apk add --force-overwrite --no-cache /tmp/glibc-2.35-r0.apk /tmp/glibc-bin-2.35-r0.apk && \
|
||||
rm -f /lib64/ld-linux-x86-64.so.2 && \
|
||||
ln -s /usr/glibc-compat/lib64/ld-linux-x86-64.so.2 /lib64/ld-linux-x86-64.so.2 && \
|
||||
rm -f /tmp/glibc-2.35-r0.apk && \
|
||||
rm -f /tmp/glibc-bin-2.35-r0.apk && \
|
||||
rm -f /lib/ld-linux-x86-64.so.2 && \
|
||||
rm -f /etc/ld.so.cache; \
|
||||
wget -qO- "https://dl.grafana.com/glibc/glibc-bin-$GLIBC_VERSION.tar.gz" | tar zxf - -C / \
|
||||
usr/glibc-compat/lib/ld-linux-x86-64.so.2 \
|
||||
usr/glibc-compat/lib/libc.so.6 \
|
||||
usr/glibc-compat/lib/libdl.so.2 \
|
||||
usr/glibc-compat/lib/libm.so.6 \
|
||||
usr/glibc-compat/lib/libpthread.so.0 \
|
||||
usr/glibc-compat/lib/librt.so.1 && \
|
||||
mkdir /lib64 && \
|
||||
ln -s /usr/glibc-compat/lib/ld-linux-x86-64.so.2 /lib64; \
|
||||
fi
|
||||
|
||||
COPY --from=go-src /tmp/grafana/conf ./conf
|
||||
|
||||
@@ -19,66 +19,41 @@ title: Create and manage reports
|
||||
description: Generate and share PDF reports from your Grafana dashboards
|
||||
weight: 600
|
||||
refs:
|
||||
repeat-panels-or-rows:
|
||||
change-ui-theme:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/panels-visualizations/configure-panel-options/#configure-repeating-panels
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/administration/organization-preferences/#change-grafana-ui-theme
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/visualizations/panels-visualizations/configure-panel-options/#configure-repeating-panels
|
||||
http-apis:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/developers/http_api/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/developers/http_api/
|
||||
image-rendering:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/setup-grafana/image-rendering/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/setup-grafana/image-rendering/
|
||||
rbac:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/administration/roles-and-permissions/access-control/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/administration/roles-and-permissions/access-control/
|
||||
permission:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/administration/roles-and-permissions/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/administration/roles-and-permissions/
|
||||
role-based-access-control:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/administration/roles-and-permissions/access-control/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/administration/roles-and-permissions/access-control/
|
||||
configuration:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/setup-grafana/configure-grafana/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/setup-grafana/configure-grafana/
|
||||
image-rendering:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/setup-grafana/image-rendering/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/setup-grafana/image-rendering/
|
||||
templates-and-variables:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/variables/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/visualizations/dashboards/variables/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/administration/organization-preferences/#change-grafana-ui-theme
|
||||
grafana-enterprise:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/introduction/grafana-enterprise/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/introduction/grafana-enterprise/
|
||||
configuration:
|
||||
image-rendering:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/setup-grafana/image-rendering/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/setup-grafana/image-rendering/
|
||||
max-size-configuration:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/setup-grafana/configure-grafana/enterprise-configuration/#max_attachment_size_mb
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/setup-grafana/configure-grafana/enterprise-configuration/#max_attachment_size_mb
|
||||
log-filters:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/setup-grafana/configure-grafana/#filters
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/setup-grafana/configure-grafana/#filters
|
||||
time-range-controls:
|
||||
permission:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/use-dashboards/#set-dashboard-time-range
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/administration/roles-and-permissions/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/visualizations/dashboards/use-dashboards/#set-dashboard-time-range
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/administration/roles-and-permissions/
|
||||
rbac:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/administration/roles-and-permissions/access-control/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/administration/roles-and-permissions/access-control/
|
||||
send-report:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/developers/http_api/reporting/#send-a-report
|
||||
@@ -94,62 +69,61 @@ refs:
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/setup-grafana/configure-grafana/#temp_data_lifetime
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/setup-grafana/configure-grafana/#temp_data_lifetime
|
||||
rendering-configuration:
|
||||
templates-and-variables:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/create-reports/report-settings/#rendering-configuration
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/variables/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/create-reports/report-settings/#rendering-configuration
|
||||
reporting-configuration:
|
||||
destination: /docs/grafana-cloud/visualizations/dashboards/variables/
|
||||
time-range-controls:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/setup-grafana/configure-grafana/enterprise-configuration/#reporting
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/use-dashboards/#set-dashboard-time-range
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/setup-grafana/configure-grafana/enterprise-configuration/#reporting
|
||||
|
||||
destination: /docs/grafana-cloud/visualizations/dashboards/use-dashboards/#set-dashboard-time-range
|
||||
---
|
||||
|
||||
# Create and manage reports
|
||||
|
||||
**Reporting** allows you to automatically generate PDFs from any of your dashboards and have Grafana email them to interested parties on a schedule. This is available in Grafana Cloud and in Grafana Enterprise.
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
If you have [Role-based access control](ref:role-based-access-control) enabled, for some actions you would need to have relevant permissions.
|
||||
Refer to specific guides to understand what permissions are required.
|
||||
{{< /admonition >}}
|
||||
|
||||
Any changes you make to a dashboard used in a report are reflected the next time the report is sent. For example, if you change the time range in the dashboard, then the time range in the report also changes, unless you've configured a custom time range.
|
||||
**Reporting** allows you to send automated and scheduled emails from any of your dashboards.
|
||||
You can configure several elements of these reports and generate PDFs, CSV files, and embedded images.
|
||||
Any changes you make to a dashboard used in a report are reflected the next time the report is sent.
|
||||
|
||||
## Requirements
|
||||
|
||||
- SMTP must be configured for reports to be sent. Refer to [SMTP](ref:smtp) in [Configuration](ref:configuration) for more information.
|
||||
- The Image Renderer plugin must be installed or the remote rendering service must be set up. Refer to [Image rendering](ref:image-rendering) for more information.
|
||||
For Grafana Enterprise, the Reporting feature has the following requirements:
|
||||
|
||||
- SMTP must be configured for reports to be sent. Refer to [SMTP configuration documentation](ref:smtp) for more information.
|
||||
- The [Grafana image renderer plugin](/grafana/plugins/grafana-image-renderer) (v3.10+) must be installed or the remote rendering service must be set up. Refer to [Image rendering](ref:image-rendering) for more information.
|
||||
|
||||
### Rendering configuration
|
||||
|
||||
When generating reports, each panel renders separately before being collected in a PDF. You can configure the per-panel rendering timeout and number of concurrently rendered panels.
|
||||
By default, attachments (PDFs, CSV files, and embedded images) larger than 10 MB are not sent, which keeps email servers from rejecting the email.
|
||||
You can increase or decrease this limit by configuring the [`max_attachment_size_mb`](ref:max-size-configuration) setting in your `ini` file.
|
||||
|
||||
To make a panel more legible, you can set a scale factor for the rendered images. However, a higher scale factor increases the file size of the generated PDF.
|
||||
|
||||
You can also specify custom fonts that support different Unicode scripts. The DejaVu font is the default used for PDF rendering.
|
||||
|
||||
These options are available in the [reporting configuration](ref:reporting-configuration) of the `ini` file for Enterprise Grafana.
|
||||
When a report file is generated, it's temporarily written to the corresponding folder (`csv`, `pdf`, `png`) in the Grafana `data` folder.
|
||||
A background job runs every 10 minutes and removes temporary files.
|
||||
You can set how long a file should be stored before being removed by configuring the [`temp_data_lifetime`](ref:temp-data-lifetime) setting in your `ini` file.
|
||||
|
||||
## Access control
|
||||
|
||||
When [RBAC](ref:rbac) is enabled, you need to have the relevant [Permissions](ref:permission) to create and manage reports.
|
||||
Only organization administrators can create reports by default.
|
||||
You can customize who can create reports with [role-based access control (RBAC)](ref:rbac).
|
||||
|
||||
When [RBAC](ref:rbac) is enabled, you need to have the relevant [permissions](ref:permission) to create and manage reports.
|
||||
Refer to specific guides to understand what permissions are required.
|
||||
|
||||
## Create a report
|
||||
|
||||
Only organization administrators can create reports by default. You can customize who can create reports with [Role-based access control](ref:role-based-access-control).
|
||||
The report creation process is multi-step, but you don't need to complete these steps in order and you can skip steps by clicking a step name at the top of the page.
|
||||
|
||||
The report creation process is multi-step, but you don't need to complete these steps in order and you can skip steps by clicking a step name at the top of the page:
|
||||
You can also save the report as a draft at any step in the process:
|
||||
|
||||

|
||||
|
||||
To create a report, follow these steps:
|
||||
|
||||
1. Click **Dashboards > Reporting** in the main menu.
|
||||
1. In the main menu, click **Dashboards > Reporting**.
|
||||
1. Click **+ Create a new report**.
|
||||
1. Complete the report steps, as needed; you don't need to complete these steps in order and you can skip steps by clicking a step name at the top of the page:
|
||||
1. Complete the report steps, as needed:
|
||||
- [Select dashboard](#1-select-dashboard)
|
||||
- [Format report](#2-format-report)
|
||||
- [Schedule](#3-schedule)
|
||||
@@ -162,16 +136,17 @@ To create a report, follow these steps:
|
||||
|
||||
### 1. Select dashboard
|
||||
|
||||
At this step, select the dashboard or dashboards on which the report is based, as well as the variables and time range for those dashboards. The options are:
|
||||
At this step, select the dashboard or dashboards on which the report is based, as well as the variables and time ranges for those dashboards.
|
||||
The options are:
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
|
||||
| Option | Description |
|
||||
| ------ | ----------- |
|
||||
| Source dashboard | Select the dashboard from which you want to generate the report. |
|
||||
| [Template variables (optional)](#template-variables) | Select the variable values for the selected dashboard. This option is only displayed if the dashboard has variables. |
|
||||
| [Time range (optional)](#time-range) | By default, reports use the saved time range of the dashboard. Optionally, you can change the time range of the report. |
|
||||
| Add another dashboard | Add more dashboards to the report. Additional dashboards will be rendered as new pages in the same PDF file, or additional images if you chose to embed images in your report email. You can't add the same dashboard to a report multiple times. |
|
||||
| Source dashboard (required) | Select the dashboard from which you want to generate the report. |
|
||||
| [Template variables](#template-variables) | Select the variable values for the selected dashboard. This option is only displayed if the dashboard has variables. |
|
||||
| [Time range](#time-range) | If you leave the field empty, reports use the saved time range of the dashboard. Optionally, you can change the time range of the report. |
|
||||
| Add another dashboard | Add more dashboards to the report. |
|
||||
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
@@ -179,30 +154,39 @@ At this step, select the dashboard or dashboards on which the report is based, a
|
||||
|
||||
This option is only displayed if the dashboard has variables.
|
||||
|
||||
You can configure report-specific template variables for the dashboard on the report page. The variables that you select will override the variables from the dashboard, and they are used when rendering a PDF file of the report. For detailed information about using template variables, refer to the [Templates and variables](ref:templates-and-variables) section.
|
||||
You can configure report-specific template variables for the dashboard on the report page.
|
||||
The variables that you select override the variables from the dashboard.
|
||||
For detailed information about using template variables, refer to [Variables](ref:templates-and-variables).
|
||||
|
||||
The query variables saved with a report might become out of date if the results of that query change. For example, if your template variable queries for a list of hostnames and a new hostname is added, then it will not be included in the report. If that occurs, the selected variables must be manually updated in the report. If you select the **All** value for the template variable or if you keep the dashboard's original variable selection, then the report stays up-to-date as new values are added.
|
||||
The query variables saved with a report might become out-of-date if the results of that query change.
|
||||
For example, if your template variable queries for a list of hostnames and a new hostname is added, then it won't be included in the report.
|
||||
If that occurs, the selected variables must be manually updated in the report.
|
||||
If you select the **All** value for the template variable or if you keep the dashboard's original variable selection, then the report stays up-to-date as new values are added.
|
||||
|
||||
#### Time range
|
||||
|
||||
By default, reports use the saved time range of the dashboard. Optionally, you can change the time range of the report by:
|
||||
|
||||
- Saving a modified time range to the dashboard. Changing the dashboard time range without saving it doesn't change the time zone of the report.
|
||||
- Setting a time range via the **Time range** field in the report form. If specified, the custom time range overrides the time range from the report's dashboard.
|
||||
If you leave the **Time range** field empty, reports use the saved time range of the dashboard.
|
||||
Optionally, you can change the time range of the report by setting it in the **Time range** field.
|
||||
If specified, the custom time range overrides the time range from the report's dashboard.
|
||||
|
||||
The page header of the report displays the time range for the dashboard's data queries.
|
||||
|
||||
##### Report time zones
|
||||
|
||||
Reports use the time zone of the dashboard from which they’re generated. You can control the time zone for your reports by setting the dashboard to a specific time zone. Note that this affects the display of the dashboard for all users.
|
||||
Reports use the time zone of the dashboard from which they're generated.
|
||||
You can control the time zone for your reports by setting the dashboard to a specific time zone.
|
||||
Note that this affects the display of the dashboard for all users.
|
||||
|
||||
If a dashboard has the **Browser Time** setting, the reports generated from that dashboard use the time zone of the Grafana server. As a result, this time zone might not match the time zone of users creating or receiving the report.
|
||||
If a dashboard has the **Browser Time** setting, the reports generated from that dashboard use the time zone of the Grafana server.
|
||||
As a result, this time zone might not match the time zone of users creating or receiving the report.
|
||||
If you want to use a specific time zone, save the dashboard with a fixed time zone instead of **Browser Time**
|
||||
|
||||
If the time zone is set differently between your Grafana server and its remote image renderer, then the time ranges in the report might be different between the page header and the time axes in the panels. To avoid this, set the time zone to UTC for dashboards when using a remote renderer. Each dashboard's time zone setting is visible in the [time range controls](ref:time-range-controls).
|
||||
Each dashboard's time zone setting is visible in the [time range controls](ref:time-range-controls).
|
||||
|
||||
### 2. Format report
|
||||
|
||||
At this step, set the report formatting options. You can select multiple options:
|
||||
At this step, select one or more report formatting options.
|
||||
You can select multiple options, but you must select _at least one_:
|
||||
|
||||
- [Attach the report as a PDF](#attach-the-report-as-a-pdf)
|
||||
- [Include table data as PDF appendix](#table-data-in-pdf) (Public preview only)
|
||||
@@ -212,13 +196,18 @@ At this step, set the report formatting options. You can select multiple options
|
||||
|
||||
#### Attach the report as a PDF
|
||||
|
||||
If you selected the PDF format option, under the **Style the PDF** section, set the following options:
|
||||
If you selected the PDF format option under the **Style the PDF** section, you can configure the following options:
|
||||
|
||||
- **Show template variables** - Click the checkbox to select this option.
|
||||
- **Configure multiple PDFs** - Click the **Combine all dashboard PDFs in one file** checkbox if you want to generate one PDF file for all the dashboards included in the report. This option is only displayed if your report includes multiple dashboards.
|
||||
- **Configure report header** - Click the **Show template variables** checkbox to show dashboard variables.
|
||||
- **Orientation** - Set the report orientation in **Portrait** or **Landscape**. Refer to the [Layout and orientation table](#layout-and-orientation) to see examples.
|
||||
- **Layout** - Select one of the following:
|
||||
- **Simple** - Renders each panel as full-width across the PDF. Refer to the [Layout and orientation table](#layout-and-orientation) to see examples.
|
||||
- **Grid** - Renders the PDF with the same panel arrangement and width as the source dashboard. Refer to the [Layout and orientation table](#layout-and-orientation) to see examples.
|
||||
|
||||
- **Simple** - Renders each panel as full-width across the PDF.
|
||||
- **Grid** - Renders the PDF with the same panel arrangement and width as the source dashboard.
|
||||
|
||||
Refer to the [Layout and orientation table](#layout-and-orientation) to see examples.
|
||||
|
||||
- **Zoom** - Zoom in to enlarge text in your PDF, or zoom out to see more data (like table columns) per panel.
|
||||
|
||||
Click **Preview PDF** in the top-right corner of the screen to view a rendered PDF with the options you selected.
|
||||
@@ -238,50 +227,40 @@ Click **Preview PDF** in the top-right corner of the screen to view a rendered P
|
||||
|
||||
#### Embed a dashboard as an image in the email
|
||||
|
||||
You can send a report email with an image of the dashboard embedded in the email instead of attached as a PDF. In this case, the email recipients can see the dashboard at a glance instead of having to open the PDF.
|
||||
You can send a report email with an image of the dashboard embedded in the email.
|
||||
This lets the email recipients see the dashboard at a glance.
|
||||
|
||||
#### Attach a CSV file of the table panel data
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
To use this feature in Grafana Enterprise, you must have [Grafana image renderer plugin](/grafana/plugins/grafana-image-renderer) v3.0.
|
||||
{{< /admonition >}}
|
||||
You can attach a CSV file to the report email for each table panel on the selected dashboard.
|
||||
|
||||
You can attach a CSV file to the report email for each table panel on the selected dashboard, along with the PDF report. By default, CSV files larger than 10Mb are not sent, which keeps email servers from rejecting the email. You can increase or decrease this limit in the [reporting configuration](ref:rendering-configuration).
|
||||
|
||||
This feature relies on the same plugin that supports the [image rendering](ref:image-rendering) features.
|
||||
|
||||
When the CSV file is generated, it is temporarily written to the `csv` folder in the Grafana `data` folder.
|
||||
|
||||
A background job runs every 10 minutes and removes temporary CSV files. You can configure how long a CSV file should be stored before being removed by configuring the [temp-data-lifetime](ref:temp-data-lifetime) setting. This setting also affects how long a renderer PNG file should be stored.
|
||||
|
||||
Click **Download CSV** in the top-right corner of the screen to see the file.
|
||||
Click **Download CSV** in the top-right corner of the screen to download a zipped file of the CSV files for your selected dashboard.
|
||||
|
||||
#### Table data in PDF
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Available in public preview (`pdfTables` feature toggle) in [Grafana Enterprise](ref:grafana-enterprise) v10.3+ with the [Grafana image renderer plugin](/grafana/plugins/grafana-image-renderer) v3.0+, as well as [Grafana Cloud](/docs/grafana-cloud/).
|
||||
{{% /admonition %}}
|
||||
{{< admonition type="note" >}}
|
||||
Available in public preview (`pdfTables` feature toggle) in [Grafana Enterprise](ref:grafana-enterprise) v10.3+ with the [Grafana image renderer plugin](/grafana/plugins/grafana-image-renderer) v3.0+, as well as in [Grafana Cloud](/docs/grafana-cloud/).
|
||||
{{< /admonition >}}
|
||||
|
||||
When there's more data in your table visualizations than can be shown in the dashboard PDF, you can select one of these two options to access all table visualization data as PDF in your reports:
|
||||
|
||||
- **Include table data as PDF appendix** - Adds an appendix to the main dashboard PDF.
|
||||
- **Include table data as PDF appendix** - Adds an appendix to the dashboard PDF.
|
||||
- **Attach a separate PDF of table data** - Generates a separate PDF file.
|
||||
|
||||
This feature relies on the same plugin that supports the [image rendering](ref:image-rendering) features.
|
||||
|
||||
### 3. Schedule
|
||||
|
||||
At this step, set scheduling information. Options vary depending on the frequency you select.
|
||||
At this step, set scheduling information.
|
||||
Options vary depending on the frequency you select.
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
|
||||
| Option | Description |
|
||||
| ------ | ----------- |
|
||||
| Frequency | Scheduled reports can be sent once, or repeated on an hourly, daily, weekly, or monthly basis, or sent at custom intervals. You can also disable scheduling by selecting **Never**, for example to send the report using the API. |
|
||||
| Frequency | You can schedule reports to be sent once, or repeated on an hourly, daily, weekly, or monthly basis, or sent at custom intervals. You can also disable scheduling by selecting **Never**. For example, you might want to [send the report using the API](#send-a-report-using-the-api). |
|
||||
| Time | Choose one of the following:<ul><li>**Send now** sends the report immediately after you save it. To stop sending the report at some point in the future, add an end date.</li><li>**Send later** schedules a report for a later date. When you select this option, the required **Start date**, **Start time**, and **Time zone** options are displayed.</li></ul> |
|
||||
| End date | If you leave the end date empty, the report is sent out indefinitely. |
|
||||
| End date | If you leave this field empty, the report is sent out indefinitely. |
|
||||
| Send only from Monday to Friday | For reports that have an hourly or daily frequency, you can choose to send them only from Monday to Friday. |
|
||||
| Send on the last day of the month | When you schedule a report with a monthly frequency, and set the start date between the 29th and the 31st of the month, the report is only sent during the months that have those dates. If you want the report to be sent every month, select this option instead. This way, the report is sent on the last day of every month regardless of how many days there are in any given month. |
|
||||
| Send on the last day of the month | When you schedule a report with a monthly frequency, and set the start date between the 29th and the 31st of the month, the report is only sent during the months that have those dates. If you want the report to be sent every month, select the **Send on the last day of the month** option. This way, the report is sent on the last day of every month regardless of how many days there are in the month. |
|
||||
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
@@ -289,23 +268,29 @@ At this step, set scheduling information. Options vary depending on the frequenc
|
||||
|
||||
At this step, enter information related to sharing the report:
|
||||
|
||||
<!-- vale Grafana.GoogleLyHyphens = NO -->
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
|
||||
| Option | Description |
|
||||
| ------ | ----------- |
|
||||
| Report name | Name of the report as you want it to appear in the **Reports** list. The report name also populates the email subject line. |
|
||||
| Recipients | Enter the email addresses of the people or teams that you want to receive the report, separated by commas or semicolons. |
|
||||
| Report name (required) | The name of the report as you want it to appear in the **Reports** list. The report name also populates the email subject line. |
|
||||
| Recipients (required) | Enter the email addresses of the people or teams that you want to receive the report, separated by commas or semicolons. |
|
||||
| Reply-to email address | The address that appears in the **Reply to** field of the email. |
|
||||
| Message | Message body in the email with the report. |
|
||||
| Include a dashboard link | Include a link to the dashboard from within the report email. |
|
||||
| Message | The body of the message in the email with the report. |
|
||||
| Include a dashboard link | Include a links to the dashboards in the report email. |
|
||||
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
Click **Send test email** in the top-right corner of the screen to verify that the configuration works as expected and to verify that emails are working. You can choose to send this email to the recipients configured for the report, or to a different set of email addresses only used for testing. The last saved version of the report will be sent to selected emails.
|
||||
<!-- vale Grafana.GoogleLyHyphens = YES -->
|
||||
|
||||
Click **Send test email** in the top-right corner of the screen to verify that the configuration works as expected and to verify that emails are working.
|
||||
You can choose to send this email to the recipients configured for the report, or to a different set of email addresses only used for testing.
|
||||
|
||||
### 5. Confirm
|
||||
|
||||
At this step, the confirmation page displays all your the settings. Review them and confirm that they're correct or click the provided **Edit** links for each section to make updates.
|
||||
At this step, the confirmation page displays all the report settings.
|
||||
Review them and confirm that they're correct or click the provided **Edit** links for each section to make updates.
|
||||
|
||||
Then, click **Send now** or **Schedule send**.
|
||||
|
||||
@@ -313,7 +298,7 @@ You can also save the report as a draft or discard it. Discarding the report is
|
||||
|
||||
## Send a report using the API
|
||||
|
||||
You can send reports programmatically with the [send report](ref:send-report) endpoint in the [HTTP APIs](ref:http-apis).
|
||||
You can send reports programmatically with the [send report](ref:send-report) endpoint using the HTTP API.
|
||||
|
||||
## Manage reports
|
||||
|
||||
@@ -321,7 +306,7 @@ On the **Reports** page, you can view and manage your existing reports or create
|
||||
|
||||

|
||||
|
||||
### Edit
|
||||
### Edit reports
|
||||
|
||||
To edit a report, follow these steps:
|
||||
|
||||
@@ -331,9 +316,10 @@ To edit a report, follow these steps:
|
||||
1. When you've finished making changes, click **Confirm** at the top of the screen to go to the last step.
|
||||
1. Click **Update report**.
|
||||
|
||||
### Pause or resume a report
|
||||
### Pause or resume reports {#pause-a-report}
|
||||
|
||||
You can pause and resume sending reports from the report list view. To do this, follow these steps:
|
||||
You can pause and resume sending reports from the report list view.
|
||||
To do this, follow these steps:
|
||||
|
||||
1. In the main menu, click **Dashboards > Reporting**.
|
||||
1. On the row of the report you want to update, do one of the following:
|
||||
@@ -341,11 +327,22 @@ You can pause and resume sending reports from the report list view. To do this,
|
||||
- Click the pause icon - The report won't be sent according to its schedule until it's resumed.
|
||||
- Click the resume icon - The report resumes on its previous schedule.
|
||||
|
||||
### Delete reports
|
||||
|
||||
To delete a report, follow these steps:
|
||||
|
||||
1. In the main menu, click **Dashboards > Reporting**.
|
||||
1. On the row of the report you want to update, click the trash can icon.
|
||||
1. Click **Delete** to confirm.
|
||||
|
||||
Deleting a report is irreversible.
|
||||
|
||||
## Troubleshoot Reporting
|
||||
|
||||
To troubleshoot and get more log information, enable debug logging in the configuration file. Refer to [Configuration](ref:configuration) for more information.
|
||||
To troubleshoot and get more log information, enable debug logging in the configuration file.
|
||||
Refer to the [log filters configuration documentation](ref:log-filters) for more information.
|
||||
|
||||
```bash
|
||||
[log]
|
||||
filters = report:debug
|
||||
filters = rendering:debug,report.api:debug,report.render:debug,report.scheduler:debug,report.sender:debug,report.service:debug
|
||||
```
|
||||
@@ -11,22 +11,12 @@ menuTitle: Settings
|
||||
title: Reporting settings
|
||||
description: Manage organizational Reporting settings
|
||||
weight: 700
|
||||
refs:
|
||||
grafana-enterprise:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/introduction/grafana-enterprise/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/introduction/grafana-enterprise/
|
||||
configuration:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/setup-grafana/configure-grafana/#filters
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/setup-grafana/configure-grafana/#filters
|
||||
---
|
||||
|
||||
# Reporting settings
|
||||
|
||||
You can configure organization-wide report settings and branding options in **Dashboards > Reporting > Settings**. Settings are applied to all the reports for the current organization.
|
||||
You can configure organization-wide report settings and branding options in **Dashboards > Reporting > Settings**.
|
||||
Settings are applied to all the reports for the current organization.
|
||||
|
||||
## Attachment settings
|
||||
|
||||
@@ -34,13 +24,22 @@ The options in this section control the branding and theming of the report attac
|
||||
|
||||
### PDF
|
||||
|
||||
- **Company logo** - Company logo displayed in the report PDF. It can be configured by specifying a URL, or by uploading a file. The maximum file size is 16 MB. Defaults to the Grafana logo.
|
||||
- **Company logo** - Company logo displayed in the report PDF.
|
||||
Configure it by specifying a URL or uploading a file.
|
||||
The maximum file size is 16 MB.
|
||||
Defaults to the Grafana logo.
|
||||
|
||||
- **Theme** - Theme of the PDF attached to the report. Defaults to **Light**. The selected theme is also applied to the PDFs generated when you click **Preview PDF** during report creation or select the **Export as PDF** option on a dashboard. If **Current** is selected, the PDF in the report will be in the instance theme of the Admin, but the preview and exported PDFs will be in the user's instance theme.
|
||||
- **Theme** - Theme of the PDF attached to the report.
|
||||
The selected theme is also applied to the PDFs generated when you click **Preview PDF** during report creation or select the **Export as PDF** option on a dashboard.
|
||||
|
||||
If **Current** is selected, the PDF in the report is in the instance theme of the report creator, but the preview and exported PDFs are in the user's instance theme.
|
||||
Defaults to **Light**.
|
||||
|
||||
### Embedded Image
|
||||
|
||||
- **Theme** - Theme of the dashboard image embedded in the email. Defaults to **Dark**.
|
||||
- **Theme** - Theme of the dashboard image embedded in the email.
|
||||
If **Current** is selected, the image in the report is in the instance theme of the report creator. If the report creator doesn't have a theme set, then the team, organization, or server theme is used. For more information refer to [Change Grafana UI theme](ref:change-ui-theme).
|
||||
Defaults to **Dark**.
|
||||
|
||||
<!-- vale Grafana.WordList = NO -->
|
||||
|
||||
@@ -48,9 +47,10 @@ The options in this section control the branding and theming of the report attac
|
||||
|
||||
<!-- vale Grafana.WordList = YES -->
|
||||
|
||||
- **Company logo** - Company logo displayed in the report email. It can be configured by specifying a URL, or by uploading a file. The maximum file size is 16 MB. Defaults to the Grafana logo.
|
||||
- **Company logo** - Company logo displayed in the report email. Configure it by specifying a URL or uploading a file. The maximum file size is 16 MB. Defaults to the Grafana logo.
|
||||
- **Email footer** - Toggle to enable the report email footer. Select **Sent by** or **None**.
|
||||
- **Footer link text** - Text of the link in the report email footer. Defaults to `Grafana`.
|
||||
- **Footer link URL** - Link of the report email footer.
|
||||
|
||||
Currently, the API does not allow for the simultaneous upload of files with identical names for both the email logo and report logo. You can still upload the same file for each logo separately in two distinct steps.
|
||||
Currently, the API does not allow for the simultaneous upload of files with identical names for both the email logo and report logo.
|
||||
You can still upload the same file for each logo separately in two distinct steps.
|
||||
@@ -44,9 +44,9 @@ refs:
|
||||
destination: /docs/grafana/grafana-cloud/visualizations/dashboards/share-dashboards-panels/shared-dashboards/
|
||||
configure-report:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/create-reports/#create-or-update-a-report
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/create-reports/#create-a-report
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/visualizations/dashboards/create-reports/#create-or-update-a-report
|
||||
destination: /docs/grafana-cloud/visualizations/dashboards/create-reports/#create-a-report
|
||||
image-rendering-config:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/setup-grafana/image-rendering/#configuration
|
||||
|
||||
@@ -144,7 +144,7 @@ Enable or disable the reporting feature. When disabled, no reports are generated
|
||||
|
||||
### rendering_timeout
|
||||
|
||||
Timeout for the following reporting rendering requests: generating PDFs, generating embedded dashboard images for report emails, and generating attached CSV files. Default is 10 seconds.
|
||||
Timeout for the following reporting rendering requests: generating PDFs, generating embedded dashboard images for report emails, and generating attached CSV files. Default is 10 seconds (`10s`).
|
||||
|
||||
### concurrent_render_limit
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ require (
|
||||
github.com/googleapis/gax-go/v2 v2.14.1 // @grafana/grafana-backend-group
|
||||
github.com/gorilla/mux v1.8.1 // @grafana/grafana-backend-group
|
||||
github.com/gorilla/websocket v1.5.3 // @grafana/grafana-app-platform-squad
|
||||
github.com/grafana/alerting v0.0.0-20250129195454-3e5b80036b7a // @grafana/alerting-backend
|
||||
github.com/grafana/alerting v0.0.0-20250130152446-d49e2e0b7d65 // @grafana/alerting-backend
|
||||
github.com/grafana/authlib v0.0.0-20250123104008-e99947858901 // @grafana/identity-access-team
|
||||
github.com/grafana/authlib/types v0.0.0-20250120145936-5f0e28e7a87c // @grafana/identity-access-team
|
||||
github.com/grafana/dashboard-linter v0.0.0-20241106223805-1e7999311752 // @grafana/grafana-app-platform-squad
|
||||
|
||||
@@ -1500,8 +1500,8 @@ github.com/gorilla/sessions v1.2.1 h1:DHd3rPN5lE3Ts3D8rKkQ8x/0kqfeNmBAaiSi+o7Fsg
|
||||
github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM=
|
||||
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
|
||||
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/grafana/alerting v0.0.0-20250129195454-3e5b80036b7a h1:44E+I3EPdh/W02Uyfyig86EJKPjvzcF3y0A+FEi1fBk=
|
||||
github.com/grafana/alerting v0.0.0-20250129195454-3e5b80036b7a/go.mod h1:QsnoKX/iYZxA4Cv+H+wC7uxutBD8qi8ZW5UJvD2TYmU=
|
||||
github.com/grafana/alerting v0.0.0-20250130152446-d49e2e0b7d65 h1:dmsycYQzl5JexuV8UxQpT3B79maSvhiIahid4/tezAM=
|
||||
github.com/grafana/alerting v0.0.0-20250130152446-d49e2e0b7d65/go.mod h1:QsnoKX/iYZxA4Cv+H+wC7uxutBD8qi8ZW5UJvD2TYmU=
|
||||
github.com/grafana/authlib v0.0.0-20250123104008-e99947858901 h1:nqV1YrtX+ZG+EYB5dcmFMWhg2Y038OMaAHAADbOC9RA=
|
||||
github.com/grafana/authlib v0.0.0-20250123104008-e99947858901/go.mod h1:/gYfphsNu9v1qYWXxpv1NSvMEMSwvdf8qb8YlgwIRl8=
|
||||
github.com/grafana/authlib/types v0.0.0-20250120145936-5f0e28e7a87c h1:b0sPDtt33uFdmvUJjSCld3kwE2E49dUvevuUDSJsEuo=
|
||||
|
||||
+3
-3
@@ -82,7 +82,7 @@
|
||||
"@grafana/plugin-e2e": "1.17.1",
|
||||
"@grafana/tsconfig": "^2.0.0",
|
||||
"@manypkg/get-packages": "^2.2.0",
|
||||
"@playwright/test": "1.50.0",
|
||||
"@playwright/test": "1.50.1",
|
||||
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
|
||||
"@react-types/button": "3.10.2",
|
||||
"@react-types/menu": "3.9.14",
|
||||
@@ -91,7 +91,7 @@
|
||||
"@rsdoctor/webpack-plugin": "^0.4.6",
|
||||
"@rtk-query/codegen-openapi": "^2.0.0",
|
||||
"@rtsao/plugin-proposal-class-properties": "7.0.1-patch.1",
|
||||
"@stylistic/eslint-plugin-ts": "^2.9.0",
|
||||
"@stylistic/eslint-plugin-ts": "^3.0.0",
|
||||
"@swc/core": "1.10.12",
|
||||
"@swc/helpers": "0.5.15",
|
||||
"@testing-library/dom": "10.4.0",
|
||||
@@ -146,7 +146,7 @@
|
||||
"@types/slate": "0.47.11",
|
||||
"@types/slate-plain-serializer": "0.7.5",
|
||||
"@types/slate-react": "0.22.9",
|
||||
"@types/swagger-ui-react": "4.19.0",
|
||||
"@types/swagger-ui-react": "5.18.0",
|
||||
"@types/systemjs": "6.15.1",
|
||||
"@types/tinycolor2": "1.4.6",
|
||||
"@types/uuid": "10.0.0",
|
||||
|
||||
@@ -255,4 +255,6 @@ export interface FeatureToggles {
|
||||
elasticsearchImprovedParsing?: boolean;
|
||||
datasourceConnectionsTab?: boolean;
|
||||
fetchRulesUsingPost?: boolean;
|
||||
alertingAlertmanagerExtraDedupStage?: boolean;
|
||||
alertingAlertmanagerExtraDedupStageStopPipeline?: boolean;
|
||||
}
|
||||
@@ -1772,6 +1772,24 @@ var (
|
||||
HideFromAdminPage: true,
|
||||
HideFromDocs: true,
|
||||
},
|
||||
{
|
||||
Name: "alertingAlertmanagerExtraDedupStage",
|
||||
Description: "enables extra deduplication stage in alertmanager that checks that timestamps of the pipeline and the current state are matching",
|
||||
Stage: FeatureStageExperimental,
|
||||
Owner: grafanaAlertingSquad,
|
||||
HideFromAdminPage: true,
|
||||
HideFromDocs: true,
|
||||
RequiresRestart: true,
|
||||
},
|
||||
{
|
||||
Name: "alertingAlertmanagerExtraDedupStageStopPipeline",
|
||||
Description: "works together with alertingAlertmanagerExtraDedupStage, if enabled, it will stop the pipeline if the timestamps are not matching. Otherwise, it will emit a warning",
|
||||
Stage: FeatureStageExperimental,
|
||||
Owner: grafanaAlertingSquad,
|
||||
HideFromAdminPage: true,
|
||||
HideFromDocs: true,
|
||||
RequiresRestart: true,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -236,3 +236,5 @@ grafanaAdvisor,experimental,@grafana/plugins-platform-backend,false,false,false
|
||||
elasticsearchImprovedParsing,experimental,@grafana/aws-datasources,false,false,false
|
||||
datasourceConnectionsTab,experimental,@grafana/plugins-platform-backend,false,false,true
|
||||
fetchRulesUsingPost,experimental,@grafana/alerting-squad,false,false,false
|
||||
alertingAlertmanagerExtraDedupStage,experimental,@grafana/alerting-squad,false,true,false
|
||||
alertingAlertmanagerExtraDedupStageStopPipeline,experimental,@grafana/alerting-squad,false,true,false
|
||||
|
@@ -954,4 +954,12 @@ const (
|
||||
// FlagFetchRulesUsingPost
|
||||
// Use a POST request to list rules by passing down the namespaces user has access to
|
||||
FlagFetchRulesUsingPost = "fetchRulesUsingPost"
|
||||
|
||||
// FlagAlertingAlertmanagerExtraDedupStage
|
||||
// enables extra deduplication stage in alertmanager that checks that timestamps of the pipeline and the current state are matching
|
||||
FlagAlertingAlertmanagerExtraDedupStage = "alertingAlertmanagerExtraDedupStage"
|
||||
|
||||
// FlagAlertingAlertmanagerExtraDedupStageStopPipeline
|
||||
// works together with alertingAlertmanagerExtraDedupStage, if enabled, it will stop the pipeline if the timestamps are not matching. Otherwise, it will emit a warning
|
||||
FlagAlertingAlertmanagerExtraDedupStageStopPipeline = "alertingAlertmanagerExtraDedupStageStopPipeline"
|
||||
)
|
||||
@@ -143,6 +143,36 @@
|
||||
"codeowner": "@grafana/alerting-squad"
|
||||
}
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"name": "alertingAlertmanagerExtraDedupStage",
|
||||
"resourceVersion": "1738251165994",
|
||||
"creationTimestamp": "2025-01-30T15:32:45Z"
|
||||
},
|
||||
"spec": {
|
||||
"description": "enables extra deduplication stage in alertmanager that checks that timestamps of the pipeline and the current state are matching",
|
||||
"stage": "experimental",
|
||||
"codeowner": "@grafana/alerting-squad",
|
||||
"requiresRestart": true,
|
||||
"hideFromAdminPage": true,
|
||||
"hideFromDocs": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"name": "alertingAlertmanagerExtraDedupStageStopPipeline",
|
||||
"resourceVersion": "1738251165994",
|
||||
"creationTimestamp": "2025-01-30T15:32:45Z"
|
||||
},
|
||||
"spec": {
|
||||
"description": "works together with alertingAlertmanagerExtraDedupStage, if enabled, it will stop the pipeline if the timestamps are not matching. Otherwise, it will emit a warning",
|
||||
"stage": "experimental",
|
||||
"codeowner": "@grafana/alerting-squad",
|
||||
"requiresRestart": true,
|
||||
"hideFromAdminPage": true,
|
||||
"hideFromDocs": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"name": "alertingApiServer",
|
||||
|
||||
@@ -148,6 +148,8 @@ type AlertNG struct {
|
||||
Api *api.API
|
||||
httpClientProvider httpclient.Provider
|
||||
InstanceStore state.InstanceStore
|
||||
// StartupInstanceReader is used to fetch the state of alerts on startup.
|
||||
StartupInstanceReader state.InstanceReader
|
||||
|
||||
// Alerting notification services
|
||||
MultiOrgAlertmanager *notifier.MultiOrgAlertmanager
|
||||
@@ -404,7 +406,7 @@ func (ng *AlertNG) init() error {
|
||||
return err
|
||||
}
|
||||
|
||||
ng.InstanceStore = initInstanceStore(ng.store.SQLStore, ng.Log.New("ngalert.state.instancestore"), ng.FeatureToggles)
|
||||
ng.InstanceStore, ng.StartupInstanceReader = initInstanceStore(ng.store.SQLStore, ng.Log, ng.FeatureToggles)
|
||||
|
||||
stateManagerCfg := state.ManagerCfg{
|
||||
Metrics: ng.Metrics.GetStateMetrics(),
|
||||
@@ -519,17 +521,30 @@ func (ng *AlertNG) init() error {
|
||||
return DeclareFixedRoles(ng.AccesscontrolService, ng.FeatureToggles)
|
||||
}
|
||||
|
||||
func initInstanceStore(sqlStore db.DB, logger log.Logger, featureToggles featuremgmt.FeatureToggles) state.InstanceStore {
|
||||
// initInstanceStore initializes the instance store based on the feature toggles.
|
||||
// It returns two vales: the instance store that should be used for writing alert instances,
|
||||
// and an alert instance reader that can be used to read alert instances on startup.
|
||||
func initInstanceStore(sqlStore db.DB, logger log.Logger, featureToggles featuremgmt.FeatureToggles) (state.InstanceStore, state.InstanceReader) {
|
||||
var instanceStore state.InstanceStore
|
||||
|
||||
// We init both stores here, but only one will be used based on the feature toggles.
|
||||
// Two stores are needed for the multi-instance reader to work correctly.
|
||||
// It's used to read the state of alerts on startup, and allows switching the feature
|
||||
// flags seamlessly without losing the state of alerts.
|
||||
protoInstanceStore := store.ProtoInstanceDBStore{
|
||||
SQLStore: sqlStore,
|
||||
Logger: logger,
|
||||
FeatureToggles: featureToggles,
|
||||
}
|
||||
simpleInstanceStore := store.InstanceDBStore{
|
||||
SQLStore: sqlStore,
|
||||
Logger: logger,
|
||||
FeatureToggles: featureToggles,
|
||||
}
|
||||
|
||||
if featureToggles.IsEnabledGlobally(featuremgmt.FlagAlertingSaveStateCompressed) {
|
||||
logger.Info("Using protobuf-based alert instance store")
|
||||
instanceStore = store.ProtoInstanceDBStore{
|
||||
SQLStore: sqlStore,
|
||||
Logger: logger,
|
||||
FeatureToggles: featureToggles,
|
||||
}
|
||||
|
||||
instanceStore = protoInstanceStore
|
||||
// If FlagAlertingSaveStateCompressed is enabled, ProtoInstanceDBStore is used,
|
||||
// which functions differently from InstanceDBStore. FlagAlertingSaveStatePeriodic is
|
||||
// not applicable to ProtoInstanceDBStore, so a warning is logged if it is set.
|
||||
@@ -538,14 +553,10 @@ func initInstanceStore(sqlStore db.DB, logger log.Logger, featureToggles feature
|
||||
}
|
||||
} else {
|
||||
logger.Info("Using simple database alert instance store")
|
||||
instanceStore = store.InstanceDBStore{
|
||||
SQLStore: sqlStore,
|
||||
Logger: logger,
|
||||
FeatureToggles: featureToggles,
|
||||
}
|
||||
instanceStore = simpleInstanceStore
|
||||
}
|
||||
|
||||
return instanceStore
|
||||
return instanceStore, state.NewMultiInstanceReader(logger, protoInstanceStore, simpleInstanceStore)
|
||||
}
|
||||
|
||||
func initStatePersister(uaCfg setting.UnifiedAlertingSettings, cfg state.ManagerCfg, featureToggles featuremgmt.FeatureToggles) state.StatePersister {
|
||||
@@ -605,7 +616,7 @@ func (ng *AlertNG) Run(ctx context.Context) error {
|
||||
// Also note that this runs synchronously to ensure state is loaded
|
||||
// before rule evaluation begins, hence we use ctx and not subCtx.
|
||||
//
|
||||
ng.stateManager.Warm(ctx, ng.store, ng.InstanceStore)
|
||||
ng.stateManager.Warm(ctx, ng.store, ng.StartupInstanceReader)
|
||||
|
||||
children.Go(func() error {
|
||||
return ng.schedule.Run(subCtx)
|
||||
|
||||
@@ -234,8 +234,11 @@ func TestInitInstanceStore(t *testing.T) {
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
instanceStore := initInstanceStore(sqlStore, logger, tt.ft)
|
||||
instanceStore, instanceReader := initInstanceStore(sqlStore, logger, tt.ft)
|
||||
assert.IsType(t, tt.expectedInstanceStoreType, instanceStore)
|
||||
assert.IsType(t, &state.MultiInstanceReader{}, instanceReader)
|
||||
assert.IsType(t, store.ProtoInstanceDBStore{}, instanceReader.(*state.MultiInstanceReader).ProtoDBReader)
|
||||
assert.IsType(t, store.InstanceDBStore{}, instanceReader.(*state.MultiInstanceReader).DBReader)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
"time"
|
||||
|
||||
alertingNotify "github.com/grafana/alerting/notify"
|
||||
"github.com/grafana/alerting/notify/stages"
|
||||
"github.com/grafana/alerting/receivers"
|
||||
alertingTemplates "github.com/grafana/alerting/templates"
|
||||
"github.com/prometheus/alertmanager/config"
|
||||
@@ -17,6 +18,7 @@ import (
|
||||
amv2 "github.com/prometheus/alertmanager/api/v2/models"
|
||||
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
apimodels "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
|
||||
"github.com/grafana/grafana/pkg/services/ngalert/metrics"
|
||||
ngmodels "github.com/grafana/grafana/pkg/services/ngalert/models"
|
||||
@@ -91,7 +93,7 @@ func (m maintenanceOptions) MaintenanceFunc(state alertingNotify.State) (int64,
|
||||
|
||||
func NewAlertmanager(ctx context.Context, orgID int64, cfg *setting.Cfg, store AlertingStore, stateStore stateStore,
|
||||
peer alertingNotify.ClusterPeer, decryptFn alertingNotify.GetDecryptedValueFn, ns notifications.Service,
|
||||
m *metrics.Alertmanager, withAutogen bool,
|
||||
m *metrics.Alertmanager, featureToggles featuremgmt.FeatureToggles,
|
||||
) (*alertmanager, error) {
|
||||
nflog, err := stateStore.GetNotificationLog(ctx)
|
||||
if err != nil {
|
||||
@@ -121,6 +123,16 @@ func NewAlertmanager(ctx context.Context, orgID int64, cfg *setting.Cfg, store A
|
||||
return stateStore.SaveNotificationLog(context.Background(), state)
|
||||
},
|
||||
}
|
||||
l := log.New("ngalert.notifier.alertmanager", "org", orgID)
|
||||
action := stages.Disabled
|
||||
if featureToggles.IsEnabledGlobally(featuremgmt.FlagAlertingAlertmanagerExtraDedupStage) {
|
||||
if featureToggles.IsEnabledGlobally(featuremgmt.FlagAlertingAlertmanagerExtraDedupStageStopPipeline) {
|
||||
action = stages.StopPipeline
|
||||
} else {
|
||||
action = stages.LogOnly
|
||||
}
|
||||
l.Info("Initializing Alertmanager", "extra_dedup_stage", action)
|
||||
}
|
||||
|
||||
amcfg := &alertingNotify.GrafanaAlertmanagerConfig{
|
||||
ExternalURL: cfg.AppURL,
|
||||
@@ -132,9 +144,9 @@ func NewAlertmanager(ctx context.Context, orgID int64, cfg *setting.Cfg, store A
|
||||
MaxSilences: cfg.UnifiedAlerting.AlertmanagerMaxSilencesCount,
|
||||
MaxSilenceSizeBytes: cfg.UnifiedAlerting.AlertmanagerMaxSilenceSizeBytes,
|
||||
},
|
||||
PipelineAndStateTimestampsMismatchAction: action,
|
||||
}
|
||||
|
||||
l := log.New("ngalert.notifier.alertmanager", "org", orgID)
|
||||
gam, err := alertingNotify.NewGrafanaAlertmanager("orgID", orgID, amcfg, peer, l, alertingNotify.NewGrafanaAlertmanagerMetrics(m.Registerer, l))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -152,7 +164,7 @@ func NewAlertmanager(ctx context.Context, orgID int64, cfg *setting.Cfg, store A
|
||||
logger: l,
|
||||
|
||||
// TODO: Preferably, logic around autogen would be outside of the specific alertmanager implementation so that remote alertmanager will get it for free.
|
||||
withAutogen: withAutogen,
|
||||
withAutogen: featureToggles.IsEnabled(ctx, featuremgmt.FlagAlertingSimplifiedRouting),
|
||||
}
|
||||
|
||||
return am, nil
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
"github.com/grafana/grafana/pkg/infra/db"
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
"github.com/grafana/grafana/pkg/services/dashboards"
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
"github.com/grafana/grafana/pkg/services/ngalert/metrics"
|
||||
"github.com/grafana/grafana/pkg/services/ngalert/store"
|
||||
"github.com/grafana/grafana/pkg/services/ngalert/tests/fakes"
|
||||
@@ -52,7 +53,7 @@ func setupAMTest(t *testing.T) *alertmanager {
|
||||
orgID := 1
|
||||
stateStore := NewFileStore(int64(orgID), kvStore)
|
||||
|
||||
am, err := NewAlertmanager(context.Background(), 1, cfg, s, stateStore, &NilPeer{}, decryptFn, nil, m, false)
|
||||
am, err := NewAlertmanager(context.Background(), 1, cfg, s, stateStore, &NilPeer{}, decryptFn, nil, m, featuremgmt.WithFeatures())
|
||||
require.NoError(t, err)
|
||||
return am
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ func NewMultiOrgAlertmanager(
|
||||
moa.factory = func(ctx context.Context, orgID int64) (Alertmanager, error) {
|
||||
m := metrics.NewAlertmanagerMetrics(moa.metrics.GetOrCreateOrgRegistry(orgID), l)
|
||||
stateStore := NewFileStore(orgID, kvStore)
|
||||
return NewAlertmanager(ctx, orgID, moa.settings, moa.configStore, stateStore, moa.peer, moa.decryptFn, moa.ns, m, featureManager.IsEnabled(ctx, featuremgmt.FlagAlertingSimplifiedRouting))
|
||||
return NewAlertmanager(ctx, orgID, moa.settings, moa.configStore, stateStore, moa.peer, moa.decryptFn, moa.ns, m, featureManager)
|
||||
}
|
||||
|
||||
for _, opt := range opts {
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
package state
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"maps"
|
||||
"slices"
|
||||
"time"
|
||||
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
"github.com/grafana/grafana/pkg/services/ngalert/models"
|
||||
)
|
||||
|
||||
// MultiInstanceReader merges results from two InstanceReaders.
|
||||
//
|
||||
// For each rule, it picks the state that has the newer LastEvalTime.
|
||||
type MultiInstanceReader struct {
|
||||
ProtoDBReader InstanceReader
|
||||
DBReader InstanceReader
|
||||
logger log.Logger
|
||||
}
|
||||
|
||||
func NewMultiInstanceReader(logger log.Logger, r1, r2 InstanceReader) *MultiInstanceReader {
|
||||
return &MultiInstanceReader{
|
||||
ProtoDBReader: r1,
|
||||
DBReader: r2,
|
||||
logger: logger,
|
||||
}
|
||||
}
|
||||
|
||||
// FetchOrgIds merges org IDs from both readers.
|
||||
func (m *MultiInstanceReader) FetchOrgIds(ctx context.Context) ([]int64, error) {
|
||||
orgsOne, err := m.ProtoDBReader.FetchOrgIds(ctx)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to fetch org IDs from ProtoDBReader: %w", err)
|
||||
}
|
||||
|
||||
orgsTwo, err := m.DBReader.FetchOrgIds(ctx)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to fetch org IDs from DBReader: %w", err)
|
||||
}
|
||||
|
||||
orgsSet := make(map[int64]struct{})
|
||||
|
||||
for _, orgID := range orgsOne {
|
||||
orgsSet[orgID] = struct{}{}
|
||||
}
|
||||
for _, orgID := range orgsTwo {
|
||||
orgsSet[orgID] = struct{}{}
|
||||
}
|
||||
|
||||
return slices.Collect(maps.Keys(orgsSet)), nil
|
||||
}
|
||||
|
||||
// ListAlertInstances fetches alert instances for a query from both readers,
|
||||
// groups them by rule UID, and returns the newest instances for each rule as a
|
||||
// single slice.
|
||||
func (m *MultiInstanceReader) ListAlertInstances(ctx context.Context, cmd *models.ListAlertInstancesQuery) ([]*models.AlertInstance, error) {
|
||||
instancesOne, err := m.ProtoDBReader.ListAlertInstances(ctx, cmd)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to list alert instances from ProtoDBReader: %w", err)
|
||||
}
|
||||
|
||||
instancesTwo, err := m.DBReader.ListAlertInstances(ctx, cmd)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to list alert instances from DBReader: %w", err)
|
||||
}
|
||||
|
||||
byRuleOne := groupByRuleUID(instancesOne)
|
||||
byRuleTwo := groupByRuleUID(instancesTwo)
|
||||
|
||||
ruleSet := make(map[string]struct{})
|
||||
for uid := range byRuleOne {
|
||||
ruleSet[uid] = struct{}{}
|
||||
}
|
||||
for uid := range byRuleTwo {
|
||||
ruleSet[uid] = struct{}{}
|
||||
}
|
||||
|
||||
merged := make([]*models.AlertInstance, 0)
|
||||
for ruleUID := range ruleSet {
|
||||
sliceA := byRuleOne[ruleUID]
|
||||
sliceB := byRuleTwo[ruleUID]
|
||||
newer := getNewestAlertInstances(m.logger, sliceA, sliceB)
|
||||
merged = append(merged, newer...)
|
||||
}
|
||||
|
||||
return merged, nil
|
||||
}
|
||||
|
||||
func groupByRuleUID(instances []*models.AlertInstance) map[string][]*models.AlertInstance {
|
||||
result := make(map[string][]*models.AlertInstance)
|
||||
for _, inst := range instances {
|
||||
if inst == nil {
|
||||
continue
|
||||
}
|
||||
result[inst.RuleUID] = append(result[inst.RuleUID], inst)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
// getNewestAlertInstances returns the newest alert instances slice
|
||||
// by comparing the maximum LastEvalTime in each of them. If one is empty, returns the other.
|
||||
func getNewestAlertInstances(logger log.Logger, firstInstances, secondInstances []*models.AlertInstance) []*models.AlertInstance {
|
||||
if len(firstInstances) == 0 {
|
||||
return secondInstances
|
||||
}
|
||||
if len(secondInstances) == 0 {
|
||||
return firstInstances
|
||||
}
|
||||
|
||||
maxFirst := maxLastEvalTime(firstInstances)
|
||||
maxSecond := maxLastEvalTime(secondInstances)
|
||||
|
||||
if maxSecond.After(maxFirst) {
|
||||
logger.Debug("Newer alert instances found", "first_last_eval_time", maxFirst, "second_last_eval_time", maxSecond, "rule_uid", firstInstances[0].RuleUID)
|
||||
return secondInstances
|
||||
}
|
||||
return firstInstances
|
||||
}
|
||||
|
||||
// maxLastEvalTime finds the maximum LastEvalTime among a slice of alert instances.
|
||||
func maxLastEvalTime(instances []*models.AlertInstance) time.Time {
|
||||
var max time.Time
|
||||
|
||||
for _, i := range instances {
|
||||
if i != nil && i.LastEvalTime.After(max) {
|
||||
max = i.LastEvalTime
|
||||
}
|
||||
}
|
||||
|
||||
return max
|
||||
}
|
||||
@@ -0,0 +1,208 @@
|
||||
package state
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/mock"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/grafana/grafana/pkg/infra/log/logtest"
|
||||
"github.com/grafana/grafana/pkg/services/ngalert/models"
|
||||
)
|
||||
|
||||
type mockInstanceReader struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
func (m *mockInstanceReader) FetchOrgIds(ctx context.Context) ([]int64, error) {
|
||||
args := m.Called(ctx)
|
||||
return args.Get(0).([]int64), args.Error(1)
|
||||
}
|
||||
|
||||
func (m *mockInstanceReader) ListAlertInstances(ctx context.Context, cmd *models.ListAlertInstancesQuery) ([]*models.AlertInstance, error) {
|
||||
args := m.Called(ctx, cmd)
|
||||
return args.Get(0).([]*models.AlertInstance), args.Error(1)
|
||||
}
|
||||
|
||||
func TestMultiInstanceReader_FetchOrgIds(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
mockAOrgIDs []int64
|
||||
mockBOrgIDs []int64
|
||||
mockAError error
|
||||
mockBError error
|
||||
expectedOrgIDs []int64
|
||||
expectError bool
|
||||
}{
|
||||
{
|
||||
name: "both readers empty, no errors",
|
||||
mockAOrgIDs: []int64{},
|
||||
mockBOrgIDs: []int64{},
|
||||
expectedOrgIDs: []int64{},
|
||||
},
|
||||
{
|
||||
name: "simple union, no errors",
|
||||
mockAOrgIDs: []int64{1, 2},
|
||||
mockBOrgIDs: []int64{2, 3},
|
||||
expectedOrgIDs: []int64{1, 2, 3},
|
||||
},
|
||||
{
|
||||
name: "error in readerA",
|
||||
mockAError: errors.New("some error"),
|
||||
expectError: true,
|
||||
},
|
||||
{
|
||||
name: "error in readerB",
|
||||
mockBError: errors.New("another error"),
|
||||
expectError: true,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range tests {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
|
||||
readerA := &mockInstanceReader{}
|
||||
if tc.mockAError != nil {
|
||||
readerA.On("FetchOrgIds", mock.Anything).Return([]int64(nil), tc.mockAError).Once()
|
||||
} else {
|
||||
readerA.On("FetchOrgIds", mock.Anything).Return(tc.mockAOrgIDs, nil).Once()
|
||||
}
|
||||
|
||||
readerB := &mockInstanceReader{}
|
||||
if tc.mockBError != nil {
|
||||
readerB.On("FetchOrgIds", mock.Anything).Return([]int64(nil), tc.mockBError).Once()
|
||||
} else {
|
||||
readerB.On("FetchOrgIds", mock.Anything).Return(tc.mockBOrgIDs, nil).Once()
|
||||
}
|
||||
|
||||
multi := NewMultiInstanceReader(&logtest.Fake{}, readerA, readerB)
|
||||
orgIDs, err := multi.FetchOrgIds(ctx)
|
||||
|
||||
if tc.expectError {
|
||||
require.Error(t, err)
|
||||
return
|
||||
}
|
||||
require.NoError(t, err)
|
||||
require.ElementsMatch(t, tc.expectedOrgIDs, orgIDs)
|
||||
|
||||
readerA.AssertExpectations(t)
|
||||
readerB.AssertExpectations(t)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestMultiInstanceReader_ListAlertInstances(t *testing.T) {
|
||||
t1 := time.Unix(100, 0)
|
||||
t2 := time.Unix(200, 0)
|
||||
t3 := time.Unix(300, 0)
|
||||
|
||||
ruleA := "rule-1"
|
||||
ruleB := "rule-2"
|
||||
|
||||
instAOld := &models.AlertInstance{AlertInstanceKey: models.AlertInstanceKey{RuleUID: ruleA}, LastEvalTime: t1}
|
||||
instANew := &models.AlertInstance{AlertInstanceKey: models.AlertInstanceKey{RuleUID: ruleA}, LastEvalTime: t3}
|
||||
instBMid := &models.AlertInstance{AlertInstanceKey: models.AlertInstanceKey{RuleUID: ruleB}, LastEvalTime: t2}
|
||||
instASameTime := &models.AlertInstance{AlertInstanceKey: models.AlertInstanceKey{RuleUID: ruleA}, LastEvalTime: t1}
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
readerAInstances []*models.AlertInstance
|
||||
readerBInstances []*models.AlertInstance
|
||||
readerAError error
|
||||
readerBError error
|
||||
expectedInstances []*models.AlertInstance
|
||||
expectError bool
|
||||
}{
|
||||
{
|
||||
name: "both readers return empty lists",
|
||||
readerAInstances: []*models.AlertInstance{},
|
||||
readerBInstances: []*models.AlertInstance{},
|
||||
expectedInstances: []*models.AlertInstance{},
|
||||
},
|
||||
{
|
||||
name: "when readerB is empty, use instances from readerA",
|
||||
readerAInstances: []*models.AlertInstance{instAOld},
|
||||
readerBInstances: []*models.AlertInstance{},
|
||||
expectedInstances: []*models.AlertInstance{instAOld},
|
||||
},
|
||||
{
|
||||
name: "when readerA is empty, use instances from readerB",
|
||||
readerAInstances: []*models.AlertInstance{},
|
||||
readerBInstances: []*models.AlertInstance{instANew},
|
||||
expectedInstances: []*models.AlertInstance{instANew},
|
||||
},
|
||||
{
|
||||
name: "when same rule exists in both readers, picks instances from reader with newer evaluation time",
|
||||
readerAInstances: []*models.AlertInstance{instAOld},
|
||||
readerBInstances: []*models.AlertInstance{instANew},
|
||||
expectedInstances: []*models.AlertInstance{instANew},
|
||||
},
|
||||
{
|
||||
name: "combines instances across rules using newest evaluation time per rule",
|
||||
readerAInstances: []*models.AlertInstance{instAOld, instBMid},
|
||||
readerBInstances: []*models.AlertInstance{instANew},
|
||||
expectedInstances: []*models.AlertInstance{instANew, instBMid},
|
||||
},
|
||||
{
|
||||
name: "error from readerA",
|
||||
readerAError: errors.New("some error"),
|
||||
expectError: true,
|
||||
},
|
||||
{
|
||||
name: "error from readerB",
|
||||
readerBError: errors.New("another error"),
|
||||
expectError: true,
|
||||
},
|
||||
{
|
||||
name: "nil instances are filtered out from results",
|
||||
readerAInstances: []*models.AlertInstance{nil, instAOld},
|
||||
readerBInstances: []*models.AlertInstance{nil},
|
||||
expectedInstances: []*models.AlertInstance{instAOld},
|
||||
},
|
||||
{
|
||||
name: "when instances have equal evaluation times, picks instances from readerA",
|
||||
readerAInstances: []*models.AlertInstance{instAOld},
|
||||
readerBInstances: []*models.AlertInstance{instASameTime},
|
||||
expectedInstances: []*models.AlertInstance{instAOld},
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range tests {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
|
||||
mockA := &mockInstanceReader{}
|
||||
if tc.readerAError != nil {
|
||||
mockA.On("ListAlertInstances", mock.Anything, mock.Anything).Return([]*models.AlertInstance(nil), tc.readerAError).Once()
|
||||
} else {
|
||||
mockA.On("ListAlertInstances", mock.Anything, mock.Anything).Return(tc.readerAInstances, nil).Once()
|
||||
}
|
||||
|
||||
mockB := &mockInstanceReader{}
|
||||
if tc.readerBError != nil {
|
||||
mockB.On("ListAlertInstances", mock.Anything, mock.Anything).Return([]*models.AlertInstance(nil), tc.readerBError).Once()
|
||||
} else {
|
||||
mockB.On("ListAlertInstances", mock.Anything, mock.Anything).Return(tc.readerBInstances, nil).Once()
|
||||
}
|
||||
|
||||
multi := NewMultiInstanceReader(&logtest.Fake{}, mockA, mockB)
|
||||
cmd := &models.ListAlertInstancesQuery{RuleOrgID: 1234}
|
||||
got, err := multi.ListAlertInstances(ctx, cmd)
|
||||
|
||||
if tc.expectError {
|
||||
require.Error(t, err)
|
||||
return
|
||||
}
|
||||
require.NoError(t, err)
|
||||
|
||||
require.ElementsMatch(t, tc.expectedInstances, got)
|
||||
|
||||
mockA.AssertExpectations(t)
|
||||
mockB.AssertExpectations(t)
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -10,13 +10,7 @@ import (
|
||||
// InstanceStore represents the ability to fetch and write alert instances.
|
||||
type InstanceStore interface {
|
||||
InstanceReader
|
||||
|
||||
SaveAlertInstance(ctx context.Context, instance models.AlertInstance) error
|
||||
DeleteAlertInstances(ctx context.Context, keys ...models.AlertInstanceKey) error
|
||||
// SaveAlertInstancesForRule overwrites the state for the given rule.
|
||||
SaveAlertInstancesForRule(ctx context.Context, key models.AlertRuleKeyWithGroup, instances []models.AlertInstance) error
|
||||
DeleteAlertInstancesByRule(ctx context.Context, key models.AlertRuleKeyWithGroup) error
|
||||
FullSync(ctx context.Context, instances []models.AlertInstance, batchSize int) error
|
||||
InstanceWriter
|
||||
}
|
||||
|
||||
// InstanceReader provides methods to fetch alert instances.
|
||||
@@ -25,6 +19,16 @@ type InstanceReader interface {
|
||||
ListAlertInstances(ctx context.Context, cmd *models.ListAlertInstancesQuery) ([]*models.AlertInstance, error)
|
||||
}
|
||||
|
||||
// InstanceWriter provides methods to write alert instances.
|
||||
type InstanceWriter interface {
|
||||
SaveAlertInstance(ctx context.Context, instance models.AlertInstance) error
|
||||
DeleteAlertInstances(ctx context.Context, keys ...models.AlertInstanceKey) error
|
||||
// SaveAlertInstancesForRule overwrites the state for the given rule.
|
||||
SaveAlertInstancesForRule(ctx context.Context, key models.AlertRuleKeyWithGroup, instances []models.AlertInstance) error
|
||||
DeleteAlertInstancesByRule(ctx context.Context, key models.AlertRuleKeyWithGroup) error
|
||||
FullSync(ctx context.Context, instances []models.AlertInstance, batchSize int) error
|
||||
}
|
||||
|
||||
// RuleReader represents the ability to fetch alert rules.
|
||||
type RuleReader interface {
|
||||
ListAlertRules(ctx context.Context, query *models.ListAlertRulesQuery) (models.RulesGroup, error)
|
||||
|
||||
@@ -170,7 +170,7 @@ require (
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
|
||||
github.com/googleapis/gax-go/v2 v2.14.1 // indirect
|
||||
github.com/gorilla/mux v1.8.1 // indirect
|
||||
github.com/grafana/alerting v0.0.0-20250129195454-3e5b80036b7a // indirect
|
||||
github.com/grafana/alerting v0.0.0-20250130152446-d49e2e0b7d65 // indirect
|
||||
github.com/grafana/authlib v0.0.0-20250123104008-e99947858901 // indirect
|
||||
github.com/grafana/dataplane/sdata v0.0.9 // indirect
|
||||
github.com/grafana/dskit v0.0.0-20241105154643-a6b453a88040 // indirect
|
||||
|
||||
@@ -547,8 +547,8 @@ github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
|
||||
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
|
||||
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
|
||||
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/grafana/alerting v0.0.0-20250129195454-3e5b80036b7a h1:44E+I3EPdh/W02Uyfyig86EJKPjvzcF3y0A+FEi1fBk=
|
||||
github.com/grafana/alerting v0.0.0-20250129195454-3e5b80036b7a/go.mod h1:QsnoKX/iYZxA4Cv+H+wC7uxutBD8qi8ZW5UJvD2TYmU=
|
||||
github.com/grafana/alerting v0.0.0-20250130152446-d49e2e0b7d65 h1:dmsycYQzl5JexuV8UxQpT3B79maSvhiIahid4/tezAM=
|
||||
github.com/grafana/alerting v0.0.0-20250130152446-d49e2e0b7d65/go.mod h1:QsnoKX/iYZxA4Cv+H+wC7uxutBD8qi8ZW5UJvD2TYmU=
|
||||
github.com/grafana/authlib v0.0.0-20250123104008-e99947858901 h1:nqV1YrtX+ZG+EYB5dcmFMWhg2Y038OMaAHAADbOC9RA=
|
||||
github.com/grafana/authlib v0.0.0-20250123104008-e99947858901/go.mod h1:/gYfphsNu9v1qYWXxpv1NSvMEMSwvdf8qb8YlgwIRl8=
|
||||
github.com/grafana/authlib/types v0.0.0-20250120145936-5f0e28e7a87c h1:b0sPDtt33uFdmvUJjSCld3kwE2E49dUvevuUDSJsEuo=
|
||||
|
||||
@@ -116,7 +116,7 @@ require (
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
|
||||
github.com/googleapis/gax-go/v2 v2.14.1 // indirect
|
||||
github.com/gorilla/mux v1.8.1 // indirect
|
||||
github.com/grafana/alerting v0.0.0-20250129195454-3e5b80036b7a // indirect
|
||||
github.com/grafana/alerting v0.0.0-20250130152446-d49e2e0b7d65 // indirect
|
||||
github.com/grafana/dataplane/sdata v0.0.9 // indirect
|
||||
github.com/grafana/grafana-app-sdk/logging v0.30.0 // indirect
|
||||
github.com/grafana/grafana-aws-sdk v0.31.5 // indirect
|
||||
|
||||
@@ -411,8 +411,8 @@ github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2z
|
||||
github.com/gorilla/mux v1.7.1/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
|
||||
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
|
||||
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
|
||||
github.com/grafana/alerting v0.0.0-20250129195454-3e5b80036b7a h1:44E+I3EPdh/W02Uyfyig86EJKPjvzcF3y0A+FEi1fBk=
|
||||
github.com/grafana/alerting v0.0.0-20250129195454-3e5b80036b7a/go.mod h1:QsnoKX/iYZxA4Cv+H+wC7uxutBD8qi8ZW5UJvD2TYmU=
|
||||
github.com/grafana/alerting v0.0.0-20250130152446-d49e2e0b7d65 h1:dmsycYQzl5JexuV8UxQpT3B79maSvhiIahid4/tezAM=
|
||||
github.com/grafana/alerting v0.0.0-20250130152446-d49e2e0b7d65/go.mod h1:QsnoKX/iYZxA4Cv+H+wC7uxutBD8qi8ZW5UJvD2TYmU=
|
||||
github.com/grafana/authlib v0.0.0-20250123104008-e99947858901 h1:nqV1YrtX+ZG+EYB5dcmFMWhg2Y038OMaAHAADbOC9RA=
|
||||
github.com/grafana/authlib v0.0.0-20250123104008-e99947858901/go.mod h1:/gYfphsNu9v1qYWXxpv1NSvMEMSwvdf8qb8YlgwIRl8=
|
||||
github.com/grafana/authlib/types v0.0.0-20250120145936-5f0e28e7a87c h1:b0sPDtt33uFdmvUJjSCld3kwE2E49dUvevuUDSJsEuo=
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -70,6 +70,9 @@ func TestIntegrationOpenAPIs(t *testing.T) {
|
||||
}, {
|
||||
Group: "provisioning.grafana.app",
|
||||
Version: "v0alpha1",
|
||||
}, {
|
||||
Group: "iam.grafana.app",
|
||||
Version: "v0alpha1",
|
||||
}}
|
||||
for _, gv := range groups {
|
||||
VerifyOpenAPISnapshots(t, dir, gv, h)
|
||||
|
||||
@@ -28,6 +28,7 @@ import usersReducers from 'app/features/users/state/reducers';
|
||||
import templatingReducers from 'app/features/variables/state/keyedVariablesReducer';
|
||||
|
||||
import { alertingApi } from '../../features/alerting/unified/api/alertingApi';
|
||||
import { iamApi } from '../../features/iam/api/api';
|
||||
import { userPreferencesAPI } from '../../features/preferences/api';
|
||||
import { provisioningAPI } from '../../features/provisioning/api';
|
||||
import { queryLibraryApi } from '../../features/query-library/api/factory';
|
||||
@@ -61,6 +62,7 @@ const rootReducers = {
|
||||
[browseDashboardsAPI.reducerPath]: browseDashboardsAPI.reducer,
|
||||
[cloudMigrationAPI.reducerPath]: cloudMigrationAPI.reducer,
|
||||
[queryLibraryApi.reducerPath]: queryLibraryApi.reducer,
|
||||
[iamApi.reducerPath]: iamApi.reducer,
|
||||
[userPreferencesAPI.reducerPath]: userPreferencesAPI.reducer,
|
||||
[provisioningAPI.reducerPath]: provisioningAPI.reducer,
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { render, waitFor, screen } from '@testing-library/react';
|
||||
|
||||
import { AnnoKeyCreatedBy } from '../../apiserver/types';
|
||||
import { ListQueryTemplateApiResponse } from '../../query-library/api/endpoints.gen';
|
||||
import { CREATED_BY_KEY } from '../../query-library/api/types';
|
||||
|
||||
import { QueryTemplatesList } from './QueryTemplatesList';
|
||||
import { QueryActionButtonProps } from './types';
|
||||
@@ -117,7 +117,7 @@ const testItems = [
|
||||
name: 'TEST_QUERY',
|
||||
creationTimestamp: '2025-01-01T11:11:11.00Z',
|
||||
annotations: {
|
||||
[CREATED_BY_KEY]: 'viewer:JohnDoe',
|
||||
[AnnoKeyCreatedBy]: 'viewer:JohnDoe',
|
||||
},
|
||||
},
|
||||
spec: {
|
||||
|
||||
@@ -10,7 +10,6 @@ import { useListQueryTemplateQuery } from 'app/features/query-library';
|
||||
import { QueryTemplate } from 'app/features/query-library/types';
|
||||
|
||||
import { convertDataQueryResponseToQueryTemplates } from '../../query-library/api/mappers';
|
||||
import { UserDataQueryResponse } from '../../query-library/api/types';
|
||||
|
||||
import { QueryLibraryProps } from './QueryLibrary';
|
||||
import { queryLibraryTrackFilterDatasource } from './QueryLibraryAnalyticsEvents';
|
||||
@@ -33,9 +32,9 @@ export function QueryTemplatesList(props: QueryTemplatesListProps) {
|
||||
const styles = useStyles2(getStyles);
|
||||
|
||||
const loadUsersResult = useLoadUsersWithError(data);
|
||||
const userNames = loadUsersResult.value ? loadUsersResult.value.display.map((user) => user.displayName) : [];
|
||||
const userNames = loadUsersResult.data ? loadUsersResult.data.display.map((user) => user.displayName) : [];
|
||||
|
||||
const loadQueryMetadataResult = useLoadQueryMetadataWithError(data, loadUsersResult.value);
|
||||
const loadQueryMetadataResult = useLoadQueryMetadataWithError(data, loadUsersResult.data);
|
||||
|
||||
// Filtering right now is done just on the frontend until there is better backend support for this.
|
||||
const filteredRows = useMemo(
|
||||
@@ -61,7 +60,7 @@ export function QueryTemplatesList(props: QueryTemplatesListProps) {
|
||||
);
|
||||
}
|
||||
|
||||
if (isLoading || loadUsersResult.loading || loadQueryMetadataResult.loading) {
|
||||
if (isLoading || loadUsersResult.isLoading || loadQueryMetadataResult.loading) {
|
||||
return <Spinner />;
|
||||
}
|
||||
|
||||
@@ -109,7 +108,7 @@ export function QueryTemplatesList(props: QueryTemplatesListProps) {
|
||||
<Trans i18nKey="query-library.user-names">User name(s):</Trans>
|
||||
</InlineLabel>
|
||||
<MultiSelect
|
||||
isLoading={loadUsersResult.loading}
|
||||
isLoading={loadUsersResult.isLoading}
|
||||
className={styles.multiSelect}
|
||||
onChange={(items, actionMeta) => {
|
||||
setUserFilters(items);
|
||||
@@ -166,7 +165,7 @@ function useLoadUsersWithError(data: QueryTemplate[] | undefined) {
|
||||
*/
|
||||
function useLoadQueryMetadataWithError(
|
||||
queryTemplates: QueryTemplate[] | undefined,
|
||||
userDataList: UserDataQueryResponse | undefined
|
||||
userDataList: ReturnType<typeof useLoadUsers>['data']
|
||||
) {
|
||||
const result = useLoadQueryMetadata(queryTemplates, userDataList);
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { skipToken } from '@reduxjs/toolkit/query';
|
||||
import { compact, uniq } from 'lodash';
|
||||
import { useAsync } from 'react-use';
|
||||
import { AsyncState } from 'react-use/lib/useAsync';
|
||||
@@ -6,20 +7,20 @@ import { getDataSourceSrv } from '@grafana/runtime';
|
||||
import { DataQuery, DataSourceRef } from '@grafana/schema';
|
||||
|
||||
import { createQueryText } from '../../../../core/utils/richHistory';
|
||||
import { useGetDisplayListQuery } from '../../../iam';
|
||||
import { getDatasourceSrv } from '../../../plugins/datasource_srv';
|
||||
import { UserDataQueryResponse } from '../../../query-library/api/types';
|
||||
import { getUserInfo } from '../../../query-library/api/user';
|
||||
import { QueryTemplate } from '../../../query-library/types';
|
||||
|
||||
export function useLoadUsers(userUIDs: string[] | undefined) {
|
||||
return useAsync(async () => {
|
||||
if (!userUIDs) {
|
||||
return undefined;
|
||||
}
|
||||
const userQtList = uniq(compact(userUIDs));
|
||||
const usersParam = userQtList.map((userUid) => `key=${encodeURIComponent(userUid)}`).join('&');
|
||||
return await getUserInfo(`?${usersParam}`);
|
||||
}, [userUIDs]);
|
||||
const userQtList = uniq(compact(userUIDs));
|
||||
const usersParam = userQtList.map((userUid) => `key=${encodeURIComponent(userUid)}`).join('&');
|
||||
return useGetDisplayListQuery(
|
||||
userUIDs
|
||||
? {
|
||||
name: `name?${usersParam}`,
|
||||
}
|
||||
: skipToken
|
||||
);
|
||||
}
|
||||
|
||||
// Explicitly type the result so TS knows to discriminate between the error result and good result by the error prop
|
||||
@@ -54,7 +55,7 @@ type MetadataValue =
|
||||
*/
|
||||
export function useLoadQueryMetadata(
|
||||
queryTemplates: QueryTemplate[] | undefined,
|
||||
userDataList: UserDataQueryResponse | undefined
|
||||
userDataList: ReturnType<typeof useLoadUsers>['data']
|
||||
): AsyncState<MetadataValue[]> {
|
||||
return useAsync(async () => {
|
||||
if (!(queryTemplates && userDataList)) {
|
||||
@@ -87,7 +88,7 @@ export function useLoadQueryMetadata(
|
||||
user: {
|
||||
uid: queryTemplate.user?.uid || '',
|
||||
displayName: extendedUserData?.displayName || '',
|
||||
avatarUrl: extendedUserData?.avatarUrl || '',
|
||||
avatarUrl: extendedUserData?.avatarURL || '',
|
||||
},
|
||||
error: undefined,
|
||||
};
|
||||
|
||||
@@ -27,6 +27,31 @@ interface MockQuery extends DataQuery {
|
||||
expr: string;
|
||||
}
|
||||
|
||||
jest.mock('../QueryLibrary/utils/dataFetching', () => {
|
||||
return {
|
||||
__esModule: true,
|
||||
...jest.requireActual('../QueryLibrary/utils/dataFetching'),
|
||||
useLoadUsers: () => {
|
||||
return {
|
||||
data: {
|
||||
display: [
|
||||
{
|
||||
avatarUrl: '',
|
||||
displayName: 'john doe',
|
||||
identity: {
|
||||
name: 'JohnDoe',
|
||||
type: 'viewer',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
isLoading: false,
|
||||
error: null,
|
||||
};
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
jest.mock('@grafana/runtime', () => ({
|
||||
...jest.requireActual('@grafana/runtime'),
|
||||
reportInteraction: (...args: object[]) => {
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import { createApi } from '@reduxjs/toolkit/query/react';
|
||||
|
||||
import { createBaseQuery } from '../../../api/createBaseQuery';
|
||||
import { getAPINamespace } from '../../../api/utils';
|
||||
|
||||
export const API_VERSION = 'iam.grafana.app/v0alpha1';
|
||||
|
||||
export const BASE_URL = `/apis/${API_VERSION}/namespaces/${getAPINamespace()}`;
|
||||
|
||||
export const iamApi = createApi({
|
||||
baseQuery: createBaseQuery({ baseURL: BASE_URL }),
|
||||
reducerPath: 'iamAPI',
|
||||
endpoints: () => ({}),
|
||||
});
|
||||
@@ -0,0 +1,59 @@
|
||||
import { iamApi as api } from './api';
|
||||
export const addTagTypes = ['DisplayList'] as const;
|
||||
const injectedRtkApi = api
|
||||
.enhanceEndpoints({
|
||||
addTagTypes,
|
||||
})
|
||||
.injectEndpoints({
|
||||
endpoints: (build) => ({
|
||||
getDisplayList: build.query<GetDisplayListApiResponse, GetDisplayListApiArg>({
|
||||
query: (queryArg) => ({ url: `/display/${queryArg.name}` }),
|
||||
providesTags: ['DisplayList'],
|
||||
}),
|
||||
}),
|
||||
overrideExisting: false,
|
||||
});
|
||||
export { injectedRtkApi as generatedIamApi };
|
||||
export type GetDisplayListApiResponse = /** status 200 OK */ DisplayList;
|
||||
export type GetDisplayListApiArg = {
|
||||
/** name of the DisplayList */
|
||||
name: string;
|
||||
};
|
||||
export type IdentityRef = {
|
||||
/** Name is the unique identifier for identity, guaranteed jo be a unique value for the type within a namespace. */
|
||||
name: string;
|
||||
/** Type of identity e.g. "user". For a full list see https://github.com/grafana/authlib/blob/2f8d13a83ca3e82da08b53726de1697ee5b5b4cc/claims/type.go#L15-L24 */
|
||||
type: string;
|
||||
};
|
||||
export type Display = {
|
||||
/** AvatarURL is the url where we can get the avatar for identity */
|
||||
avatarURL?: string;
|
||||
/** Display name for identity. */
|
||||
displayName: string;
|
||||
identity: IdentityRef;
|
||||
/** InternalID is the legacy numreric id for identity, this is deprecated and should be phased out */
|
||||
internalId?: number;
|
||||
};
|
||||
export type ListMeta = {
|
||||
/** continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message. */
|
||||
continue?: string;
|
||||
/** remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is *estimating* the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact. */
|
||||
remainingItemCount?: number;
|
||||
/** String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency */
|
||||
resourceVersion?: string;
|
||||
/** Deprecated: selfLink is a legacy read-only field that is no longer populated by the system. */
|
||||
selfLink?: string;
|
||||
};
|
||||
export type DisplayList = {
|
||||
/** APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources */
|
||||
apiVersion?: string;
|
||||
/** Matching items (the caller may need to remap from keys to results) */
|
||||
display: Display[];
|
||||
/** Input keys that were not useable */
|
||||
invalidKeys?: string[];
|
||||
/** Request keys used to lookup the display value */
|
||||
keys: string[];
|
||||
/** Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds */
|
||||
kind?: string;
|
||||
metadata?: ListMeta;
|
||||
};
|
||||
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* To generate iam k8s APIs, run:
|
||||
* `yarn process-specs && npx rtk-query-codegen-openapi ./public/app/features/iam/api/scripts/generate-rtk-apis.ts` from the root of the repo
|
||||
*/
|
||||
|
||||
import { ConfigFile } from '@rtk-query/codegen-openapi';
|
||||
import { accessSync } from 'fs';
|
||||
|
||||
const schemaFile = '../../../../../../data/openapi/iam.grafana.app-v0alpha1.json';
|
||||
|
||||
try {
|
||||
// Check we have the OpenAPI before generating query library RTK APIs,
|
||||
// as this is currently a manual process
|
||||
accessSync(schemaFile);
|
||||
} catch (e) {
|
||||
console.error('\nCould not find OpenAPI definition.\n');
|
||||
console.error(
|
||||
'Please run go test pkg/tests/apis/openapi_test.go to generate the OpenAPI definition, then try running this script again.\n'
|
||||
);
|
||||
throw e;
|
||||
}
|
||||
|
||||
const config: ConfigFile = {
|
||||
schemaFile,
|
||||
apiFile: '',
|
||||
tag: true,
|
||||
outputFiles: {
|
||||
'../endpoints.gen.ts': {
|
||||
apiFile: '../api.ts',
|
||||
apiImport: 'iamApi',
|
||||
filterEndpoints: ['getDisplayList'],
|
||||
exportName: 'generatedIamApi',
|
||||
flattenArg: false,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
@@ -0,0 +1,3 @@
|
||||
import { generatedIamApi } from './api/endpoints.gen';
|
||||
|
||||
export const { useGetDisplayListQuery } = generatedIamApi;
|
||||
@@ -204,7 +204,14 @@ export function ConfigForm({ data }: ConfigFormProps) {
|
||||
control={control}
|
||||
rules={{ required: 'This field is required.' }}
|
||||
render={({ field: { ref, onChange, ...field } }) => {
|
||||
return <RadioButtonGroup options={targetOptions} onChange={onChange} disabled={!!data?.spec} {...field} />;
|
||||
return (
|
||||
<RadioButtonGroup
|
||||
options={targetOptions}
|
||||
onChange={onChange}
|
||||
disabled={Boolean(data?.status?.sync.state)}
|
||||
{...field}
|
||||
/>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</Field>
|
||||
|
||||
@@ -26,7 +26,7 @@ export default function FileStatusPage() {
|
||||
const params = useParams();
|
||||
const [queryParams] = useQueryParams();
|
||||
const ref = (queryParams['ref'] as string) ?? undefined;
|
||||
const tab = (queryParams['tab'] as TabSelection) ?? TabSelection.Lint;
|
||||
const tab = (queryParams['tab'] as TabSelection) ?? TabSelection.File;
|
||||
const name = params['name'] ?? '';
|
||||
const path = params['*'] ?? '';
|
||||
const query = useGetRepositoryStatusQuery({ name });
|
||||
@@ -90,7 +90,6 @@ function ResourceView({ wrap, repo, repoRef, tab }: Props) {
|
||||
}
|
||||
|
||||
const tabInfo = [
|
||||
{ value: TabSelection.Lint, label: 'Lint', counter: wrap.lint?.length },
|
||||
{ value: TabSelection.File, label: 'File (from repository)' },
|
||||
{ value: TabSelection.Existing, label: 'Existing (from grafana)' },
|
||||
{ value: TabSelection.DryRun, label: 'Dry Run (result after apply)' },
|
||||
@@ -132,7 +131,6 @@ function ResourceView({ wrap, repo, repoRef, tab }: Props) {
|
||||
key={t.value}
|
||||
label={t.label}
|
||||
active={tab === t.value}
|
||||
counter={t.counter}
|
||||
/>
|
||||
))}
|
||||
</TabsBar>
|
||||
|
||||
@@ -10,5 +10,6 @@ export const QUERY_LIBRARY_GET_LIMIT = 1000;
|
||||
|
||||
export const queryLibraryApi = createApi({
|
||||
baseQuery: createBaseQuery({ baseURL: BASE_URL }),
|
||||
reducerPath: 'queryLibraryAPI',
|
||||
endpoints: () => ({}),
|
||||
});
|
||||
@@ -1,10 +1,10 @@
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
import { AnnoKeyCreatedBy } from '../../apiserver/types';
|
||||
import { AddQueryTemplateCommand, QueryTemplate } from '../types';
|
||||
|
||||
import { ListQueryTemplateApiResponse, QueryTemplate as QT } from './endpoints.gen';
|
||||
import { API_VERSION, QueryTemplateKinds } from './query';
|
||||
import { CREATED_BY_KEY } from './types';
|
||||
|
||||
export const convertDataQueryResponseToQueryTemplates = (result: ListQueryTemplateApiResponse): QueryTemplate[] => {
|
||||
if (!result.items) {
|
||||
@@ -21,7 +21,7 @@ export const convertDataQueryResponseToQueryTemplates = (result: ListQueryTempla
|
||||
})) ?? [],
|
||||
createdAtTimestamp: new Date(spec.metadata?.creationTimestamp ?? '').getTime(),
|
||||
user: {
|
||||
uid: spec.metadata?.annotations?.[CREATED_BY_KEY] ?? '',
|
||||
uid: spec.metadata?.annotations?.[AnnoKeyCreatedBy] ?? '',
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
// pkg/apis/iam/v0alpha1/types_display.go
|
||||
export type UserDataQueryResponse = {
|
||||
apiVersion: string;
|
||||
kind: string;
|
||||
metadata: {
|
||||
selfLink: string;
|
||||
resourceVersion: string;
|
||||
continue: string;
|
||||
remainingItemCount: number;
|
||||
};
|
||||
display: UserSpecResponse[];
|
||||
keys: string[];
|
||||
};
|
||||
|
||||
// pkg/apis/iam/v0alpha1/types_display.go
|
||||
export type UserSpecResponse = {
|
||||
avatarUrl: string;
|
||||
displayName: string;
|
||||
identity: {
|
||||
name: string;
|
||||
type: string;
|
||||
};
|
||||
internalId: number;
|
||||
};
|
||||
|
||||
export const CREATED_BY_KEY = 'grafana.app/createdBy';
|
||||
@@ -1,20 +0,0 @@
|
||||
import { getBackendSrv } from '@grafana/runtime';
|
||||
|
||||
import { getAPINamespace } from '../../../api/utils';
|
||||
|
||||
import { UserDataQueryResponse } from './types';
|
||||
|
||||
/**
|
||||
* @alpha
|
||||
*/
|
||||
export const API_VERSION = 'iam.grafana.app/v0alpha1';
|
||||
|
||||
/**
|
||||
* @alpha
|
||||
*/
|
||||
const BASE_URL = `apis/${API_VERSION}/namespaces/${getAPINamespace()}/display`;
|
||||
|
||||
export async function getUserInfo(url?: string): Promise<UserDataQueryResponse> {
|
||||
const userInfo = await getBackendSrv().get(`${BASE_URL}${url}`);
|
||||
return userInfo;
|
||||
}
|
||||
+38
-1
@@ -1,12 +1,15 @@
|
||||
import { screen } from '@testing-library/react';
|
||||
import { fireEvent, screen } from '@testing-library/react';
|
||||
import selectEvent from 'react-select-event';
|
||||
|
||||
import { useDispatch } from '../../../../hooks/useStatelessReducer';
|
||||
import { renderWithESProvider } from '../../../../test-helpers/render';
|
||||
import { ElasticsearchQuery, Terms, Average, Derivative, TopMetrics } from '../../../../types';
|
||||
import { describeMetric } from '../../../../utils';
|
||||
|
||||
import { TermsSettingsEditor } from './TermsSettingsEditor';
|
||||
|
||||
jest.mock('../../../../hooks/useStatelessReducer');
|
||||
|
||||
describe('Terms Settings Editor', () => {
|
||||
it('Pipeline aggregations should not be in "order by" options', () => {
|
||||
const termsAgg: Terms = {
|
||||
@@ -37,4 +40,38 @@ describe('Terms Settings Editor', () => {
|
||||
// All other metric aggregations can be used in order by
|
||||
expect(screen.getByText(describeMetric(avg))).toBeInTheDocument();
|
||||
});
|
||||
|
||||
describe('Handling change', () => {
|
||||
let dispatch = jest.fn();
|
||||
beforeEach(() => {
|
||||
dispatch.mockClear();
|
||||
jest.mocked(useDispatch).mockReturnValue(dispatch);
|
||||
});
|
||||
|
||||
test('updating size', async () => {
|
||||
const termsAgg: Terms = {
|
||||
id: '1',
|
||||
type: 'terms',
|
||||
};
|
||||
const avg: Average = { id: '2', type: 'avg', field: '@value' };
|
||||
const derivative: Derivative = { id: '3', field: avg.id, type: 'derivative' };
|
||||
const topMetrics: TopMetrics = { id: '4', type: 'top_metrics' };
|
||||
const query: ElasticsearchQuery = {
|
||||
refId: 'A',
|
||||
query: '',
|
||||
bucketAggs: [termsAgg],
|
||||
metrics: [avg, derivative, topMetrics],
|
||||
};
|
||||
|
||||
renderWithESProvider(<TermsSettingsEditor bucketAgg={termsAgg} />, { providerProps: { query } });
|
||||
|
||||
const sizeInput = screen.getByLabelText('Size');
|
||||
fireEvent.change(sizeInput, { target: { value: '30' } });
|
||||
fireEvent.blur(sizeInput);
|
||||
|
||||
expect(dispatch).toHaveBeenCalledTimes(1);
|
||||
expect(dispatch.mock.calls[0][0].payload.settingName).toBe('size');
|
||||
expect(dispatch.mock.calls[0][0].payload.newValue).toBe('30');
|
||||
});
|
||||
});
|
||||
});
|
||||
+13
-12
@@ -7,11 +7,10 @@ import { InlineField, Select, Input } from '@grafana/ui';
|
||||
import { useDispatch } from '../../../../hooks/useStatelessReducer';
|
||||
import { MetricAggregation, Percentiles, ExtendedStatMetaType, ExtendedStats, Terms } from '../../../../types';
|
||||
import { describeMetric } from '../../../../utils';
|
||||
import { useCreatableSelectPersistedBehaviour } from '../../../hooks/useCreatableSelectPersistedBehaviour';
|
||||
import { useQuery } from '../../ElasticsearchQueryContext';
|
||||
import { isPipelineAggregation } from '../../MetricAggregationsEditor/aggregations';
|
||||
import { changeBucketAggregationSetting } from '../state/actions';
|
||||
import { bucketAggregationConfig, orderByOptions, orderOptions, sizeOptions } from '../utils';
|
||||
import { bucketAggregationConfig, orderByOptions, orderOptions } from '../utils';
|
||||
|
||||
import { inlineFieldProps } from '.';
|
||||
|
||||
@@ -23,6 +22,12 @@ export const TermsSettingsEditor = ({ bucketAgg }: Props) => {
|
||||
const { metrics } = useQuery();
|
||||
const orderBy = createOrderByOptions(metrics);
|
||||
const { current: baseId } = useRef(uniqueId('es-terms-'));
|
||||
let size = bucketAgg.settings?.size || bucketAggregationConfig.terms.defaultSettings?.size;
|
||||
if (!size || size === '') {
|
||||
size = '10';
|
||||
} else if (size === '0') {
|
||||
size = '500';
|
||||
}
|
||||
|
||||
const dispatch = useDispatch();
|
||||
|
||||
@@ -40,16 +45,12 @@ export const TermsSettingsEditor = ({ bucketAgg }: Props) => {
|
||||
</InlineField>
|
||||
|
||||
<InlineField label="Size" {...inlineFieldProps}>
|
||||
<Select
|
||||
inputId={`${baseId}-size`}
|
||||
// TODO: isValidNewOption should only allow numbers & template variables
|
||||
{...useCreatableSelectPersistedBehaviour({
|
||||
options: sizeOptions,
|
||||
value: bucketAgg.settings?.size || bucketAggregationConfig.terms.defaultSettings?.size,
|
||||
onChange({ value }) {
|
||||
dispatch(changeBucketAggregationSetting({ bucketAgg, settingName: 'size', newValue: value }));
|
||||
},
|
||||
})}
|
||||
<Input
|
||||
id={`${baseId}-size`}
|
||||
onBlur={(e) =>
|
||||
dispatch(changeBucketAggregationSetting({ bucketAgg, settingName: 'size', newValue: e.target.value }))
|
||||
}
|
||||
defaultValue={size}
|
||||
/>
|
||||
</InlineField>
|
||||
|
||||
|
||||
-11
@@ -64,14 +64,3 @@ export const orderOptions: Array<SelectableValue<string>> = [
|
||||
{ label: 'Top', value: 'desc' },
|
||||
{ label: 'Bottom', value: 'asc' },
|
||||
];
|
||||
|
||||
export const sizeOptions = [
|
||||
{ label: 'No limit', value: '0' },
|
||||
{ label: '1', value: '1' },
|
||||
{ label: '2', value: '2' },
|
||||
{ label: '3', value: '3' },
|
||||
{ label: '5', value: '5' },
|
||||
{ label: '10', value: '10' },
|
||||
{ label: '15', value: '15' },
|
||||
{ label: '20', value: '20' },
|
||||
];
|
||||
@@ -12,6 +12,7 @@ import { StoreState } from 'app/types/store';
|
||||
import { buildInitialState } from '../core/reducers/navModel';
|
||||
import { addReducer, createRootReducer } from '../core/reducers/root';
|
||||
import { alertingApi } from '../features/alerting/unified/api/alertingApi';
|
||||
import { iamApi } from '../features/iam/api/api';
|
||||
import { queryLibraryApi } from '../features/query-library/api/factory';
|
||||
|
||||
import { setStore } from './store';
|
||||
@@ -43,6 +44,7 @@ export function configureStore(initialState?: Partial<StoreState>) {
|
||||
queryLibraryApi.middleware,
|
||||
userPreferencesAPI.middleware,
|
||||
provisioningAPI.middleware,
|
||||
iamApi.middleware,
|
||||
...extraMiddleware
|
||||
),
|
||||
devTools: process.env.NODE_ENV !== 'production',
|
||||
|
||||
@@ -6153,14 +6153,14 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@playwright/test@npm:1.50.0":
|
||||
version: 1.50.0
|
||||
resolution: "@playwright/test@npm:1.50.0"
|
||||
"@playwright/test@npm:1.50.1":
|
||||
version: 1.50.1
|
||||
resolution: "@playwright/test@npm:1.50.1"
|
||||
dependencies:
|
||||
playwright: "npm:1.50.0"
|
||||
playwright: "npm:1.50.1"
|
||||
bin:
|
||||
playwright: cli.js
|
||||
checksum: 10/1fec2ed986205b57b03f24392bb01c6454c1f0a5c14204ce921afd51c3f5d61f20eddb3a18d36a02b19b3e3d731c7ff6bb7ba3c622aabc8fa3802021aef7d21b
|
||||
checksum: 10/0d8d2291d6554c492cb163b4d463e1e9cc6d3ae50680d790473f693f36a243c16c3620406849dd40115046c47a6ad5cc36a24511caec6d054dc1a1d9fffb4138
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -7775,16 +7775,16 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@stylistic/eslint-plugin-ts@npm:^2.9.0":
|
||||
version: 2.13.0
|
||||
resolution: "@stylistic/eslint-plugin-ts@npm:2.13.0"
|
||||
"@stylistic/eslint-plugin-ts@npm:^3.0.0":
|
||||
version: 3.0.1
|
||||
resolution: "@stylistic/eslint-plugin-ts@npm:3.0.1"
|
||||
dependencies:
|
||||
"@typescript-eslint/utils": "npm:^8.13.0"
|
||||
eslint-visitor-keys: "npm:^4.2.0"
|
||||
espree: "npm:^10.3.0"
|
||||
peerDependencies:
|
||||
eslint: ">=8.40.0"
|
||||
checksum: 10/222d6ec0094177f40ea43f28af257192655539fe4bb1495341bc9ff521bca975da2066e229798fcc8e28ea24e91d0ef4db05b4f212f615cad752ade5c1c68561
|
||||
checksum: 10/24dc9f67ff56bc200340807a1fd055e8f49332c244b0ba214ea68ed91773d922790645db34f014e0f703644cc605171e5190df385597dad12d127d92fd72d29b
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -10205,12 +10205,12 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@types/swagger-ui-react@npm:4.19.0":
|
||||
version: 4.19.0
|
||||
resolution: "@types/swagger-ui-react@npm:4.19.0"
|
||||
"@types/swagger-ui-react@npm:5.18.0":
|
||||
version: 5.18.0
|
||||
resolution: "@types/swagger-ui-react@npm:5.18.0"
|
||||
dependencies:
|
||||
"@types/react": "npm:*"
|
||||
checksum: 10/c4a7ae85ca081bf079164b3e11ecc0c91dec1ed10da0f44fc67f8cf93a7d92d5bfa681035eb8b9d3327a0361d201861c02571b4b18f361253510f3ce19ce073f
|
||||
checksum: 10/002bb3e38eb5917f5da942affa357811ccb078816bf53ba9007e43603f9b9a839eb930380b08051b9cc9a95ca2ebec06599a825e4d0542e436ea2c2027fc3a0a
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -16876,11 +16876,11 @@ __metadata:
|
||||
linkType: hard
|
||||
|
||||
"fishery@npm:^2.2.2":
|
||||
version: 2.2.2
|
||||
resolution: "fishery@npm:2.2.2"
|
||||
version: 2.2.3
|
||||
resolution: "fishery@npm:2.2.3"
|
||||
dependencies:
|
||||
lodash.mergewith: "npm:^4.6.2"
|
||||
checksum: 10/68120995b0cd7827f0d50ef3b552a74289c99fa6195cafb6e5d376aa14421f12873274e1fc5aa101073fdae35ad6543cb5b04687bb295d8c37ff3b99dbdeb9ae
|
||||
checksum: 10/a8855c1949524996d2ba3b84cf6fe13f2a8ade8296e090bedbc58d2879dc481d85a0aced1e33f80b1a1ec9cb1a2eb7562494c2ae514915730d14285694f595bf
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -17810,7 +17810,7 @@ __metadata:
|
||||
"@opentelemetry/api": "npm:1.9.0"
|
||||
"@opentelemetry/exporter-collector": "npm:0.25.0"
|
||||
"@opentelemetry/semantic-conventions": "npm:1.28.0"
|
||||
"@playwright/test": "npm:1.50.0"
|
||||
"@playwright/test": "npm:1.50.1"
|
||||
"@pmmmwh/react-refresh-webpack-plugin": "npm:0.5.15"
|
||||
"@popperjs/core": "npm:2.11.8"
|
||||
"@react-aria/dialog": "npm:3.5.21"
|
||||
@@ -17826,7 +17826,7 @@ __metadata:
|
||||
"@rsdoctor/webpack-plugin": "npm:^0.4.6"
|
||||
"@rtk-query/codegen-openapi": "npm:^2.0.0"
|
||||
"@rtsao/plugin-proposal-class-properties": "npm:7.0.1-patch.1"
|
||||
"@stylistic/eslint-plugin-ts": "npm:^2.9.0"
|
||||
"@stylistic/eslint-plugin-ts": "npm:^3.0.0"
|
||||
"@swc/core": "npm:1.10.12"
|
||||
"@swc/helpers": "npm:0.5.15"
|
||||
"@testing-library/dom": "npm:10.4.0"
|
||||
@@ -17881,7 +17881,7 @@ __metadata:
|
||||
"@types/slate": "npm:0.47.11"
|
||||
"@types/slate-plain-serializer": "npm:0.7.5"
|
||||
"@types/slate-react": "npm:0.22.9"
|
||||
"@types/swagger-ui-react": "npm:4.19.0"
|
||||
"@types/swagger-ui-react": "npm:5.18.0"
|
||||
"@types/systemjs": "npm:6.15.1"
|
||||
"@types/tinycolor2": "npm:1.4.6"
|
||||
"@types/uuid": "npm:10.0.0"
|
||||
@@ -24221,27 +24221,27 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"playwright-core@npm:1.50.0":
|
||||
version: 1.50.0
|
||||
resolution: "playwright-core@npm:1.50.0"
|
||||
"playwright-core@npm:1.50.1":
|
||||
version: 1.50.1
|
||||
resolution: "playwright-core@npm:1.50.1"
|
||||
bin:
|
||||
playwright-core: cli.js
|
||||
checksum: 10/0d27e52164bcc37ed5aeaa0c7efa6a0b3616cfbb01e206c26572bff8b8e5f0923a993369c826056cd7bee4b975508a1ec257b533098ee9db7bc5b75832110e4d
|
||||
checksum: 10/9a310b8a66bf7fd926e620c1c8e27be29bdbdce91640e5f975b2fd4dc706d0307faec2bb0456cc8e7dedb1e71c0b5eb35c6a58acd5cedc7d8fd849a9067e637b
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"playwright@npm:1.50.0":
|
||||
version: 1.50.0
|
||||
resolution: "playwright@npm:1.50.0"
|
||||
"playwright@npm:1.50.1":
|
||||
version: 1.50.1
|
||||
resolution: "playwright@npm:1.50.1"
|
||||
dependencies:
|
||||
fsevents: "npm:2.3.2"
|
||||
playwright-core: "npm:1.50.0"
|
||||
playwright-core: "npm:1.50.1"
|
||||
dependenciesMeta:
|
||||
fsevents:
|
||||
optional: true
|
||||
bin:
|
||||
playwright: cli.js
|
||||
checksum: 10/53521f05c48ab51a37d6fa280a7c1e6486e2879f9997e877227517945faf195ce16829cf144709bba292c3023bcd07cf44a4dd965458c9adc30ea6fbe1f0f74a
|
||||
checksum: 10/a3687614ac3238a81cbe3018e4f4a2ae92c71f3f65110cc6087068c020f6134f0628308da33177b9b08102644706e835d4053f6890beeb4a935f433bc4ac107a
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
||||
Reference in new issue
Block a user