diff --git a/Dockerfile b/Dockerfile index 1fe18a7b61e57..bd5cca0976c12 100644 --- a/Dockerfile +++ b/Dockerfile @@ -189,5 +189,9 @@ ARG RUN_SH=grafana/packaging/docker/run.sh COPY ${RUN_SH} /run.sh +# LOGZ.IO GRAFANA CHANGE :: Add unique file to avoid ECR tag limit +ARG VERSION +RUN echo "$VERSION" > /var/version.txt + USER "$GF_UID" -ENTRYPOINT [ "/run.sh" ] \ No newline at end of file +ENTRYPOINT [ "/run.sh" ] diff --git a/Makefile b/Makefile index 4fd93cce4a3e8..42b3c1bafb118 100644 --- a/Makefile +++ b/Makefile @@ -173,7 +173,7 @@ test-go-unit: ## Run unit tests for backend with flags. .PHONY: test-go-integration test-go-integration: ## Run integration tests for backend with flags. @echo "test backend integration tests" - $(GO) test -count=1 -run "^TestIntegration" -covermode=atomic -timeout=5m $(GO_INTEGRATION_TESTS) + $(GO) test -count=1 -run "^TestIntegration" -covermode=atomic -timeout=10m $(GO_INTEGRATION_TESTS) .PHONY: test-go-integration-alertmanager test-go-integration-alertmanager: ## Run integration tests for the remote alertmanager (config taken from the mimir_backend block). diff --git a/custom.ini b/custom.ini index 3cd2f7efd5b38..b12c8b998e239 100644 --- a/custom.ini +++ b/custom.ini @@ -87,4 +87,5 @@ custom_endpoint = log [feature_toggles] prometheusPromQAIL = false -publicDashboards = false \ No newline at end of file +publicDashboards = false +autoMigratePiechartPanel = true diff --git a/packages/grafana-prometheus/src/datasource.ts b/packages/grafana-prometheus/src/datasource.ts index f26453908103e..7aa66d7d735d8 100644 --- a/packages/grafana-prometheus/src/datasource.ts +++ b/packages/grafana-prometheus/src/datasource.ts @@ -747,8 +747,10 @@ export class PrometheusDatasource async loadRules() { try { - const res = await this.metadataRequest('/api/v1/rules', {}, { showErrorAlert: false }); - const groups = res.data?.data?.groups; + // LOGZ.IO GRAFANA CHANGE :: DEV-46445-disable-recording-rules-fetch-in-grafana-10 + // const res = await this.metadataRequest('/api/v1/rules', {}, { showErrorAlert: false }); + // const groups = res.data?.data?.groups; + const groups = null; if (groups) { this.ruleMappings = extractRuleMappingFromGroups(groups); diff --git a/public/app/core/components/SharedPreferences/SharedPreferences.tsx b/public/app/core/components/SharedPreferences/SharedPreferences.tsx index 08be7cf9f2f00..dc5ee09eabe25 100644 --- a/public/app/core/components/SharedPreferences/SharedPreferences.tsx +++ b/public/app/core/components/SharedPreferences/SharedPreferences.tsx @@ -20,7 +20,6 @@ import { DashboardPicker } from 'app/core/components/Select/DashboardPicker'; import { t, Trans } from 'app/core/internationalization'; import { LANGUAGES } from 'app/core/internationalization/constants'; import { PreferencesService } from 'app/core/services/PreferencesService'; -import { backendSrv } from "app/core/services/backend_srv";// LOGZ.IO GRAFANA CHANGE :: DEV-20609 Home dashboard import { changeTheme } from 'app/core/services/theme'; export interface Props { @@ -75,7 +74,7 @@ export class SharedPreferences extends PureComponent { } async componentDidMount() { - const prefs = await backendSrv.get(`/api/${this.props.resourceUri.toLowerCase()}/preferences`);// LOGZ.IO GRAFANA CHANGE :: DEV-20609 Home dashboard + const prefs = await this.service.load(); this.setState({ homeDashboardUID: prefs.homeDashboardUID, @@ -92,14 +91,8 @@ export class SharedPreferences extends PureComponent { const confirmationResult = this.props.onConfirm ? await this.props.onConfirm() : true; if (confirmationResult) { - // LOGZ.IO GRAFANA CHANGE :: DEV-20609 Home dashboard - const { homeDashboardUID, theme, timezone } = this.state; - await backendSrv.put(`/api/${this.props.resourceUri.toLowerCase()}/preferences`, { - homeDashboardId: homeDashboardUID, - theme, - timezone, - }); - // LOGZ.IO GRAFANA CHANGE :: end + const { homeDashboardUID, theme, timezone, weekStart, language, queryHistory } = this.state; + await this.service.update({ homeDashboardUID, theme, timezone, weekStart, language, queryHistory }); window.location.reload(); } }; diff --git a/public/app/core/services/backend_srv.ts b/public/app/core/services/backend_srv.ts index 559fbff18ff30..719a303615244 100644 --- a/public/app/core/services/backend_srv.ts +++ b/public/app/core/services/backend_srv.ts @@ -508,7 +508,7 @@ export class BackendSrv implements BackendService { } /** @deprecated */ - search(query: any): Promise { + search(query: any): Promise> { // LOGZ.IO GRAFANA CHANGE :: DEV-20609 Home dashboard return this.get('/api/search', query); } diff --git a/public/app/core/services/impression_srv.ts b/public/app/core/services/impression_srv.ts index 3dcd3bdd39cb8..0ce7fee8647f3 100644 --- a/public/app/core/services/impression_srv.ts +++ b/public/app/core/services/impression_srv.ts @@ -30,6 +30,7 @@ export class ImpressionSrv { } private async convertToUIDs() { + return; // LOGZIO GRAFANA CHANGE :: DEV-46987 - disable convert recent visited dashboards to UID let impressions = this.getImpressions(); const ids = filter(impressions, (el) => isNumber(el)); if (!ids.length) { diff --git a/public/app/features/alerting/unified/components/alert-groups/AlertDetails.tsx b/public/app/features/alerting/unified/components/alert-groups/AlertDetails.tsx index 22b8f9192e9c6..1031cc72fca86 100644 --- a/public/app/features/alerting/unified/components/alert-groups/AlertDetails.tsx +++ b/public/app/features/alerting/unified/components/alert-groups/AlertDetails.tsx @@ -1,5 +1,5 @@ import { css } from '@emotion/css'; -import React from 'react'; +import React, {useMemo} from 'react'; import { GrafanaTheme2 } from '@grafana/data'; import { LinkButton, useStyles2 } from '@grafana/ui'; @@ -27,6 +27,15 @@ export const AlertDetails = ({ alert, alertManagerSourceName }: AmNotificationsA const isSeeSourceButtonEnabled = isGrafanaSource ? contextSrv.hasPermission(AccessControlAction.AlertingRuleRead) : true; + // LOGZ.IO CHANGE :: DEV-46517 - fix "see source button" + const generatorURL = useMemo(() => { + if (alert.generatorURL) { + const url = new URL(alert.generatorURL); + return url.hash.replace(/^#.dashboard.metrics/, '/grafana-app'); + } + return ''; + }, [alert.generatorURL]); + // LOGZ.IO CHANGE :: DEV-46517 - fix "see source button" end return ( <> @@ -58,8 +67,8 @@ export const AlertDetails = ({ alert, alertManagerSourceName }: AmNotificationsA )} - {isSeeSourceButtonEnabled && alert.generatorURL && ( - + {isSeeSourceButtonEnabled && generatorURL && ( /* LOGZ.IO CHANGE :: DEV-46517 - fix "see source button" */ + See source )} diff --git a/public/app/features/alerting/unified/components/rule-editor/GrafanaEvaluationBehavior.tsx b/public/app/features/alerting/unified/components/rule-editor/GrafanaEvaluationBehavior.tsx index 34821a527f939..6b357d66208b6 100644 --- a/public/app/features/alerting/unified/components/rule-editor/GrafanaEvaluationBehavior.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/GrafanaEvaluationBehavior.tsx @@ -300,6 +300,7 @@ export function GrafanaEvaluationBehavior({ - {/* - // LOGZ.IO CHANGE :: DEV-46521 remove rule type switch */} + /> )} @@ -471,14 +468,18 @@ export const QueryAndExpressionsStep = ({ editingExistingRule, onDataChange }: P Add query - {/* - // LOGZ.IO CHANGE :: DEV-46521 remove rule type switch */} + /> + {/* Expression Queries */} Expressions diff --git a/public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/SmartAlertTypeDetector.tsx b/public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/SmartAlertTypeDetector.tsx index 5a526fc8443da..a32a604193325 100644 --- a/public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/SmartAlertTypeDetector.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/SmartAlertTypeDetector.tsx @@ -93,6 +93,8 @@ export function SmartAlertTypeDetector({ // if we can't switch to data-source managed, disable it // TODO figure out how to show a popover to the user to indicate _why_ it's disabled const disabledOptions = canSwitch ? [] : [RuleFormType.cloudAlerting]; + + return null; return ( diff --git a/public/app/features/alerting/unified/components/rules/RulesFilter.tsx b/public/app/features/alerting/unified/components/rules/RulesFilter.tsx index d462cb653f71d..bbde327c57837 100644 --- a/public/app/features/alerting/unified/components/rules/RulesFilter.tsx +++ b/public/app/features/alerting/unified/components/rules/RulesFilter.tsx @@ -191,7 +191,7 @@ const RulesFilter = ({ onFilterCleared = () => undefined }: RulesFilerProps) => onChange={handleAlertStateChange} /> -
+ diff --git a/public/app/features/alerting/unified/hooks/usePluginBridge.ts b/public/app/features/alerting/unified/hooks/usePluginBridge.ts index 2468fedd9eae8..10ede77a9a802 100644 --- a/public/app/features/alerting/unified/hooks/usePluginBridge.ts +++ b/public/app/features/alerting/unified/hooks/usePluginBridge.ts @@ -14,13 +14,12 @@ interface PluginBridgeHookResponse { } export function usePluginBridge(plugin: PluginID): PluginBridgeHookResponse { + const { loading, error, value } = useAsync(() => getPluginSettings(plugin, { showErrorAlert: false })); // LOGZ.IO CHANGE :: DEV-46522 disable the oncall grafana plugin if (plugin === SupportedPlugin.OnCall) { return { loading: false, installed: false}; } // LOGZ.IO CHANGE :: DEV-46522 disable the oncall grafana plugin. END - const { loading, error, value } = useAsync(() => getPluginSettings(plugin, { showErrorAlert: false })); - const installed = value && !error && !loading; const enabled = value?.enabled; const isLoading = loading && !value; diff --git a/public/app/features/dashboard/components/GenAI/utils.ts b/public/app/features/dashboard/components/GenAI/utils.ts index 4692236177797..db3f106107597 100644 --- a/public/app/features/dashboard/components/GenAI/utils.ts +++ b/public/app/features/dashboard/components/GenAI/utils.ts @@ -60,6 +60,7 @@ export function getDashboardChanges(dashboard: DashboardModel): { * @returns true if the LLM plugin is enabled. */ export async function isLLMPluginEnabled() { + return Promise.resolve(false); // LOGZ.IO GRAFANA CHANGE :: DEV-44665-grafana-upgrade-remove-llm // Check if the LLM plugin is enabled. // If not, we won't be able to make requests, so return early. return llms.openai.health().then((response) => response.ok); diff --git a/public/app/features/playlist/ShareModal.tsx b/public/app/features/playlist/ShareModal.tsx index 4e05143b4d1f2..814f547115352 100644 --- a/public/app/features/playlist/ShareModal.tsx +++ b/public/app/features/playlist/ShareModal.tsx @@ -24,8 +24,8 @@ export const ShareModal = ({ playlistUid, onDismiss }: Props) => { const params: UrlQueryMap = {}; if (mode) { - params.kiosk = mode; - } + params.kiosk = mode.toString(); // LOGZ.IO GRAFANA CHANGE :: DEV-42761 fix playlist sharing url + } if (autoFit) { params.autofitpanels = true; } diff --git a/public/app/plugins/datasource/elasticsearch/datasource.ts b/public/app/plugins/datasource/elasticsearch/datasource.ts index 7fab51613c9c9..a26abd89fbcb8 100644 --- a/public/app/plugins/datasource/elasticsearch/datasource.ts +++ b/public/app/plugins/datasource/elasticsearch/datasource.ts @@ -774,7 +774,9 @@ export class ElasticDatasource if (index && index.mappings) { const mappings = index.mappings; - const properties = mappings.properties; + // LOGZ.IO GRAFANA CHANGE :: DEV-46404 - mappings not showing on query building + // the format of the response depends on the esversion. we have v7 , seems to, which requires the _doc. + const properties = mappings.properties || mappings._doc.properties; getFieldsRecursively(properties); } } @@ -1029,6 +1031,7 @@ export class ElasticDatasource } private getDatabaseVersionUncached(): Promise { + return Promise.resolve(null); // LOGZ.IO GRAFANA CHANGE :: DEV-46435-grafana-10-error-500-on-get-api-datasources-uid-uid-resources // we want this function to never fail const getDbVersionObservable = config.featureToggles.enableElasticsearchBackendQuerying ? from(this.getResourceRequest('')) diff --git a/public/app/plugins/datasource/prometheus/datasource.ts b/public/app/plugins/datasource/prometheus/datasource.ts index 2b296ae682210..983afd9409ef3 100644 --- a/public/app/plugins/datasource/prometheus/datasource.ts +++ b/public/app/plugins/datasource/prometheus/datasource.ts @@ -747,8 +747,10 @@ export class PrometheusDatasource async loadRules() { try { - const res = await this.metadataRequest('/api/v1/rules', {}, { showErrorAlert: false }); - const groups = res.data?.data?.groups; + // LOGZ.IO GRAFANA CHANGE :: DEV-46445-disable-recording-rules-fetch-in-grafana-10 + // const res = await this.metadataRequest('/api/v1/rules', {}, { showErrorAlert: false }); + // const groups = res.data?.data?.groups; + const groups = null; if (groups) { this.ruleMappings = extractRuleMappingFromGroups(groups); diff --git a/public/app/plugins/datasource/prometheus/querybuilder/components/promQail/state/helpers.ts b/public/app/plugins/datasource/prometheus/querybuilder/components/promQail/state/helpers.ts index 465fb7bfed803..c06cab7340c9b 100644 --- a/public/app/plugins/datasource/prometheus/querybuilder/components/promQail/state/helpers.ts +++ b/public/app/plugins/datasource/prometheus/querybuilder/components/promQail/state/helpers.ts @@ -272,6 +272,7 @@ function guessMetricFamily(metric: string): string { * @returns true if the LLM plugin is enabled. */ export async function isLLMPluginEnabled(): Promise { + return Promise.resolve(false); // LOGZ.IO GRAFANA CHANGE :: DEV-44665-grafana-upgrade-remove-llm // Check if the LLM plugin is enabled. // If not, we won't be able to make requests, so return early. const openaiEnabled = llms.openai.health().then((response) => response.ok); diff --git a/public/app/plugins/panel/alertGroups/AlertGroup.tsx b/public/app/plugins/panel/alertGroups/AlertGroup.tsx index 2ffb2de9aa361..36951cd13534f 100644 --- a/public/app/plugins/panel/alertGroups/AlertGroup.tsx +++ b/public/app/plugins/panel/alertGroups/AlertGroup.tsx @@ -43,6 +43,13 @@ export const AlertGroup = ({ alertManagerSourceName, group, expandAll }: Props) end: Date.now(), }); + // LOGZ.IO CHANGE :: DEV-46517 - fix "see source button" + const generatorURL = alert.generatorURL ? (() => { + const url = new URL(alert.generatorURL); + return url.hash.replace(/^#.dashboard.metrics/, '/grafana-app'); + })() : null; + // LOGZ.IO CHANGE :: DEV-46517 - fix "see source button" end + return (
@@ -75,8 +82,9 @@ export const AlertGroup = ({ alertManagerSourceName, group, expandAll }: Props) Silence )} - {alert.generatorURL && ( - + { /* LOGZ.IO CHANGE :: DEV-46517 - patch the link url to work inside iframe */ } + {generatorURL && ( + See source )}