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

Fixes Opsgenie Create Alert failure when external image URL attached #78

Merged
merged 1 commit into from
Apr 26, 2023

Conversation

oneoneonepig
Copy link
Contributor

@oneoneonepig oneoneonepig commented Apr 26, 2023

Fixes issue: grafana/grafana#67177

When invoking the Opsgenie Create Alert API, the field detail seems to only accept string value, does not accept array in the value. If the value is an array, Opsgenie will respond with 422 Unprocessable Entity.

This fix converts the array to a comma joined string, and the following screenshot is a successfully sent alert with two images attached:

opsgenie alert with multiple images attached
SNAG-20230426-152522-0000

The following section is copied from the original issue:

What happened:

Cannot create Opsgenie Alerts with S3 image url attached

What you expected to happen:

Opsgenie Alerts are created and image URL are attached in details section

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

  1. Create a Grafana container
  2. Create a Grafana Image Renderer container
  3. Configure Grafana to use the Grafana Image Renderer by following the tutorial
  4. Configure panels, alert rules, contact points, notification policies, etc.
  5. Trigger an Grafana Alert
  6. An image is created in the S3 bucket
  7. Grafana log shows 422 Unprocessable Entity
  8. No Opsgenie Alert is created

@CLAassistant
Copy link

CLAassistant commented Apr 26, 2023

CLA assistant check
All committers have signed the CLA.

@yuri-tceretian yuri-tceretian self-requested a review April 26, 2023 15:34
@yuri-tceretian yuri-tceretian added the bug Something isn't working label Apr 26, 2023
Copy link
Contributor

@yuri-tceretian yuri-tceretian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I would really appreciate a test + some description (you can copy some from the issue).

@grobinson-grafana
Copy link
Contributor

grobinson-grafana commented Apr 26, 2023

Could you also include your redacted screenshot from the GitHub issue in the description to show that you manually tested it too?

@oneoneonepig
Copy link
Contributor Author

Hi @grobinson-grafana and @yuri-tceretian, I've added a brief description of the fix, the result screenshot, and copied a few sections from the original issue.

Let me know if anything else should be added or tested

@yuri-tceretian yuri-tceretian merged commit 011a41e into grafana:main Apr 26, 2023
@grobinson-grafana
Copy link
Contributor

Thank you very much for your contribution! This will be released in Grafana 10. I will also look at how to backport it to 9.5 and 9.4.

@oneoneonepig oneoneonepig deleted the oneoneonepig-patch-1 branch April 27, 2023 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants