Skip to content

Commit ca5a5f5

Browse files
Merge pull request #4898 from grafana/dev
1.9.10
2 parents 9a81c8b + b5c5225 commit ca5a5f5

File tree

14 files changed

+438
-121
lines changed

14 files changed

+438
-121
lines changed

docs/sources/configure/integrations/references/slack/index.md

Lines changed: 339 additions & 0 deletions
Large diffs are not rendered by default.

docs/sources/manage/notify/slack/index.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,22 @@ refs:
2626
destination: /docs/oncall/<ONCALL_VERSION>/set-up/open-source/#slack-setup
2727
- pattern: /docs/grafana-cloud/
2828
destination: /docs/grafana-cloud/alerting-and-irm/oncall/set-up/open-source/#slack-setup
29+
irm-slack:
30+
- pattern: /docs/oncall/
31+
destination: /docs/oncall/<ONCALL_VERSION>/configure/integrations/references/slack/
32+
- pattern: /docs/grafana-cloud/
33+
destination: /docs/grafana-cloud/alerting-and-irm/oncall/configure/integrations/references/slack/
2934
---
3035

3136
# Slack integration for Grafana OnCall
3237

38+
{{< admonition type="warning" >}}
39+
The OnCall Slack app is now a Grafana IRM app with new incident management features. Migrate now to access the enhanced capabilities.
40+
41+
Refer to the [Grafana IRM Slack integration](ref:irm-slack) documentation to learn more.
42+
{{< /admonition >}}
43+
44+
{{< collapse title="Legacy Slack integration for Grafana OnCall" >}}
3345
The Slack integration for Grafana OnCall incorporates your Slack workspace directly into your incident response workflow
3446
to help your team focus on alert resolution with less friction.
3547

@@ -210,3 +222,4 @@ Use message shortcuts to add resolution notes directly from Slack. Message short
210222
1. Hover over the message and select **More actions** from the menu options.
211223
1. Select **Add as resolution note**.
212224
1. The Grafana OnCall app will react to the message in Slack with the memo emoji and add the message to the alert group timeline.
225+
{{< /collapse >}}

docs/sources/set-up/get-started/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ refs:
3434
destination: /docs/grafana-cloud/alerting-and-irm/oncall/configure/escalation-chains-and-routes/#escalation-chains
3535
slack-integration-for-grafana-oncall:
3636
- pattern: /docs/oncall/
37-
destination: /docs/oncall/<ONCALL_VERSION>/manage/notify/slack/
37+
destination: /docs/oncall/<ONCALL_VERSION>/configure/integrations/references/slack/
3838
- pattern: /docs/grafana-cloud/
39-
destination: /docs/grafana-cloud/alerting-and-irm/oncall/manage/notify/slack/
39+
destination: /docs/grafana-cloud/alerting-and-irm/oncall/configure/integrations/references/slack/
4040
user-and-team-management:
4141
- pattern: /docs/oncall/
4242
destination: /docs/oncall/<ONCALL_VERSION>/manage/user-and-team-management/
@@ -233,7 +233,7 @@ To configure Slack for Grafana OnCall:
233233
6. Ensure users verify their Slack accounts in their user profile in Grafana OnCall.
234234

235235
For further instruction on connecting to your Slack workspace, refer to
236-
[Slack integration for Grafana OnCall](ref:slack-integration-for-grafana-oncall)
236+
[Slack integration for Grafana IRM](ref:slack-integration-for-grafana-oncall).
237237

238238
Grafana OnCall also supports other ChatOps integration like Microsoft Teams and Telegram.
239239
For a full list of supported integrations, refer to [Notify people](ref:notify-people).

engine/apps/slack/scenarios/paging.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,16 @@ def process_scenario(
145145
if settings.UNIFIED_SLACK_APP_ENABLED:
146146
if slack_team_identity.needs_reinstall:
147147
organizations = _get_available_organizations(slack_team_identity, slack_user_identity)
148-
# Provide a link to web if user has access only to one organization
149148
if len(organizations) == 1:
149+
# Provide a link to web if user has access only to one organization
150150
link = urljoin(organizations[0].web_link, "settings?tab=ChatOps&chatOpsTab=Slack")
151-
upgrade = f"<{link}|Upgrade>"
152151
else:
153-
upgrade = "Upgrade" # TODO: Add link to docs are available
152+
# Otherwise, provide a link to the documentation
153+
link = (
154+
"https://grafana.com/docs/grafana-cloud/alerting-and-irm/oncall/configure/integrations"
155+
"/references/slack/#migrate-to-the-grafana-irm-slack-integration"
156+
)
157+
upgrade = f"<{link}|Upgrade>"
154158
msg = (
155159
f"The new Slack IRM integration is now available. f{upgrade} for a more powerful and flexible "
156160
f"way to interact with Grafana IRM on Slack."

engine/settings/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
METRIC_USER_WAS_NOTIFIED_OF_ALERT_GROUPS_NAME,
118118
]
119119
# List of metrics to collect. Collect all available application metrics by default
120-
METRICS_TO_COLLECT = os.environ.get("METRICS_TO_COLLECT", METRICS_ALL)
120+
METRICS_TO_COLLECT = getenv_list("METRICS_TO_COLLECT", METRICS_ALL)
121121

122122

123123
# Database

grafana-plugin/src/containers/ApiTokenSettings/ApiTokenForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export const ApiTokenForm = observer((props: TokenCreationModalProps) => {
120120
<VerticalGroup>
121121
<Label>Curl command example</Label>
122122
<SourceCode noMinHeight showClipboardIconOnly>
123-
{getCurlExample(token, store.onCallApiUrl)}
123+
{getCurlExample(token, store.pluginStore.apiUrlFromStatus)}
124124
</SourceCode>
125125
</VerticalGroup>
126126
);

grafana-plugin/src/models/plugin/plugin.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { OnCallPluginMetaJSONData } from 'types';
55
import { ActionKey } from 'models/loader/action-keys';
66
import { GrafanaApiClient } from 'network/grafana-api/http-client';
77
import { makeRequest } from 'network/network';
8-
import { PluginConnection, PostStatusResponse } from 'network/oncall-api/api.types';
8+
import { PluginConnection, StatusResponse } from 'network/oncall-api/api.types';
99
import { RootBaseStore } from 'state/rootBaseStore/RootBaseStore';
1010
import { waitInMs } from 'utils/async';
1111
import { AutoLoadingState } from 'utils/decorators';
@@ -31,6 +31,7 @@ On Cloud:
3131
export class PluginStore {
3232
rootStore: RootBaseStore;
3333
connectionStatus?: PluginConnection;
34+
apiUrlFromStatus?: string;
3435
isPluginConnected = false;
3536
appliedOnCallApiUrl = '';
3637

@@ -53,9 +54,10 @@ export class PluginStore {
5354

5455
@AutoLoadingState(ActionKey.PLUGIN_VERIFY_CONNECTION)
5556
async verifyPluginConnection() {
56-
const { pluginConnection } = await makeRequest<PostStatusResponse>(`/plugin/status`, {});
57+
const { pluginConnection, api_url } = await makeRequest<StatusResponse>(`/plugin/status`, {});
5758
runInAction(() => {
5859
this.connectionStatus = pluginConnection;
60+
this.apiUrlFromStatus = api_url;
5961
this.isPluginConnected = Object.keys(pluginConnection).every(
6062
(key) => pluginConnection[key as keyof PluginConnection]?.ok
6163
);

grafana-plugin/src/network/oncall-api/api.types.d.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,10 @@ type PluginConnection = {
1616
grafana_url_from_engine: PluginConnectionCheck;
1717
};
1818

19-
export type PostStatusResponse = {
19+
export type StatusResponse = {
2020
pluginConnection: PluginConnection;
21-
allow_signup: boolean;
2221
api_url: string;
2322
currently_undergoing_maintenance_message: string | null;
24-
is_installed: boolean;
25-
is_user_anonymous: boolean;
2623
license: string;
27-
recaptcha_site_key: string;
28-
token_ok: boolean;
2924
version: string;
3025
};

grafana-plugin/src/pages/settings/tabs/ChatOps/tabs/SlackSettings/SlackSettings.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { WithStoreProps } from 'state/types';
3131
import { useStore } from 'state/useStore';
3232
import { withMobXProviderContext } from 'state/withStore';
3333
import { UserActions } from 'utils/authorization/authorization';
34-
import { DOCS_ROOT, DOCS_SLACK_SETUP, getPluginId } from 'utils/consts';
34+
import { DOCS_SLACK_SETUP, getPluginId } from 'utils/consts';
3535
import { useConfirmModal } from 'utils/hooks';
3636
import { showApiError } from 'utils/utils';
3737

@@ -353,15 +353,16 @@ const UpgradeToUnifiedSlackBanner = observer(() => {
353353
} = useStore();
354354
const { modalProps, openModal } = useConfirmModal();
355355

356+
const SLACK_MIGRATION_DOCS =
357+
'https://grafana.com/docs/grafana-cloud/alerting-and-irm/oncall/configure/integrations/references/slack/#migrate-to-the-grafana-irm-slack-integration';
356358
return (
357359
<>
358360
<ConfirmModal {...modalProps} />
359361
<Alert severity="warning" title="This integration is outdated" buttonContent="Migrate">
360362
<div className={styles.upgradeSlackAlertText}>
361363
The OnCall Slack app is now a Grafana IRM app with new incident management features. Migrate now to access the
362364
enhanced capabilities.{' '}
363-
<a href={`${DOCS_ROOT}`} target="_blank" rel="noreferrer">
364-
{/* TODO: update link to docs */}
365+
<a href={`${SLACK_MIGRATION_DOCS}`} target="_blank" rel="noreferrer">
365366
Learn more
366367
</a>
367368
</div>
@@ -390,12 +391,7 @@ const UpgradeToUnifiedSlackBanner = observer(() => {
390391
</li>
391392
</ul>
392393
</p>
393-
<a
394-
href={`${DOCS_ROOT}`} // TODO: update link to docs
395-
target="_blank"
396-
rel="noreferrer"
397-
className={styles.marginTop}
398-
>
394+
<a href={`${SLACK_MIGRATION_DOCS}`} target="_blank" rel="noreferrer" className={styles.marginTop}>
399395
<Text type="link">
400396
<span>Learn more in the docs</span>
401397
<Icon name="external-link-alt" className="u-margin-left-xs u-margin-bottom-xxs" />

grafana-plugin/src/pages/settings/tabs/MainSettings/MainSettings.module.css

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)