Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alerting: Source URL in alert created outside of dashboard/panel in multi-org environment does not contain orgId #66427

Closed
aos opened this issue Apr 13, 2023 · 6 comments
Assignees
Milestone

Comments

@aos
Copy link

aos commented Apr 13, 2023

What happened:

This is similar to #47424. When an alert is created in a multi-org environment, outside of a dashboard or panel, by going through Alerting -> New Alert rule, the generated alert URL will not have the orgId parameter attached to it. This causes an "alert not found" within multi-org environments.

This was fixed for dashboard and panel URLs but not alerts created outside of those context in #57123. The logic should extend to creating alerts manually.

What you expected to happen:

Alerts created via Alerts -> New alert rule should include the appropriate source URL with the orgId parameter in a multi-org environment.

How to reproduce it (as minimally and precisely as possible):

  1. Be in a multi-org environment
  2. Create an alert via Alerts -> New alert rule
  3. Fire the alert
  4. Notice that the Source URL in the alert notification does not contain the correct orgId and will not go to the appropriate organization/alert.

Anything else we need to know?:

It looks like all the alerting logic was moved to the repo: https://github.com/grafana/alerting in main and v9.4.x, but it's still here in v9.3.x.

I think the change should be simple enough and I'm fine with cutting a PR for this, but I wasn't sure where the change should go. If it's in v9.4.x, and I make a PR to https://github.com/grafana/alerting, we'd have to also bump the go.mod here, correct?

Environment:

  • Grafana version: 9.3.8
  • Data source type & version: Prometheus
  • OS Grafana is installed on: Linux
  • User OS & Browser: Firefox
  • Grafana plugins: N/A

Thanks!

@tonypowa
Copy link
Contributor

hi @aos

thank you for creating this issue

I am forwarding it to the Alert squad. They will get back to you with the next steps

@tonypowa tonypowa added type/bug area/alerting Grafana Alerting labels Apr 14, 2023
@alexweav
Copy link
Contributor

Yes, the grafana/alerting repo is the right place for this fix. We bump its version periodically, but we'd also happily accept an external PR to bump its version once your original PR goes in.

Thank you for reporting this!

@meyerder
Copy link

Will or can this make it into 9.5 as well? Hopefully soon?

@yuri-tceretian
Copy link
Contributor

Pr has been merged. I opened backport to v10.0 branch grafana/alerting#97

@yuri-tceretian
Copy link
Contributor

I have found a similar bug with silence URL. grafana/alerting#98 fixes it. Once it is merged I will backport both to v10 branch and update imports.

@yuri-tceretian
Copy link
Contributor

Unfortunately, both fixes will not be in 10.0.0 as the PR that updated alerting module was merged too late. The fixes will be in the next patch release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

6 participants