I’m currently unable to tell what the problem might be. At the moment I’m able to go to the panel > share and use “Direct link rendered image” and I can sometimes see log entries for panel rendering but not always when an alert is triggered or when I fire a test alert to my slack contact point (with dashboard and panel IDs), nothing seems to happen with rendering.
I’m unable to find any error logs at the moment and I’ve put Grafana into debug mode.
If anyone has any advice, would be greatly appreciated. The slack contact point is also using a bot account with below permissions.
incoming-webhook - Post messages to specific channels in Slack
files:write - Upload, edit and delete files as Grafana alert
I’m confused as I can render an image using the share option (log to prove):
tlogger=ngalert.image rule_uid=kvbbldC4k org_id=1 t=2023-09-11T09:21:03.395599115Z level=debug msg="Cannot take screenshot for alert rule as it is not associated with a dashboard"
logger=ngalert.image rule_uid=kvbbldC4k org_id=1 t=2023-09-11T09:20:08.396127525Z level=debug msg="Cannot take screenshot for alert rule as it is not associated with a dashboard"
logger=ngalert.image rule_uid=kvbbldC4k org_id=1 t=2023-09-11T09:20:05.374930034Z level=debug msg="Cannot take screenshot for alert rule as it is not associated with a dashboard"
logger=ngalert.image rule_uid=flwElkiVk org_id=1 dashboard=yLU8ue6Mz panel=20 t=2023-09-11T08:47:07.552492709Z level=debug msg="Saved image" token=4d0739aa-a1cd-430d-9aca-5b1683f46685
logger=ngalert.image rule_uid=flwElkiVk org_id=1 dashboard=yLU8ue6Mz panel=20 t=2023-09-11T08:47:07.546822759Z level=debug msg="Took screenshot" path=/var/lib/grafana/png/jtFI1jBthq63OJF0RjUE.png
logger=ngalert.image rule_uid=flwElkiVk org_id=1 dashboard=yLU8ue6Mz panel=20 t=2023-09-11T08:47:06.711916892Z level=debug msg="Saved image" token=faa5cf6a-d6af-4858-8f21-f8f7725d9bd1
logger=ngalert.image rule_uid=flwElkiVk org_id=1 dashboard=yLU8ue6Mz panel=20 t=2023-09-11T08:47:06.70232212Z level=debug msg="Took screenshot" path=/var/lib/grafana/png/Jay5Vv5DR7IDAfIQQO40.png
logger=ngalert.image rule_uid=flwElkiVk org_id=1 dashboard=yLU8ue6Mz panel=20 t=2023-09-11T08:47:02.728371299Z level=debug msg="Requesting screenshot"
logger=ngalert.image rule_uid=flwElkiVk org_id=1 dashboard=yLU8ue6Mz panel=20 t=2023-09-11T08:47:00.504233751Z level=debug msg="Requesting screenshot"
The “cannot take screenshot for alert rule…” is fine as that’s for a dashboard with nothing set, otherwise everything looks fine.
I’ve just done a request which didn’t appear in ngalert.image, I had to search for “render” which then showed up
DevTools listening on ws://127.0.0.1:38555/devtools/browser/a87775a3-e108-4561-b1af-f8dd986552e7[0911/084701.157394:ERROR:zygote_host_impl_linux.cc(273)] Failed to adjust OOM score of renderer with pid 1245: Permission denied (13)[0911/084701.162380:WARNING:bluez_dbus_manager.cc(247)] Floss manager not present, cannot set Floss enable/disable.[0911/084701.171288:ERROR:angle_platform_impl.cc(44)] RendererVk.cpp:168 (VerifyExtensionsPresent): Extension not supported: VK_KHR_surfaceERR: RendererVk.cpp:168 (VerifyExtensionsPresent): Extension not supported: VK_KHR_surface[0911/084701.192333:ERROR:angle_platform_impl.cc(44)] RendererVk.cpp:168 (VerifyExtensionsPresent): Extension not supported: VK_KHR_xcb_surfaceERR: RendererVk.cpp:168 (VerifyExtensionsPresent): Extension not supported: VK_KHR_xcb_surface[0911/084701.192447:ERROR:angle_platform_impl.cc(44)] Display.cpp:1063 (initialize): ANGLE Display::initialize error 0: Internal Vulkan error (-7): A requested extension is not supported, in ../../third_party/angle/src/libANGLE/renderer/vulkan/RendererVk.cpp, enableInstanceExtensions:1619.ERR: Display.cpp:1063 (initialize): ANGLE Display::initialize error 0: Internal Vulkan error (-7): A requested extension is not supported, in ../../third_party/angle/src/libANGLE/renderer/vulkan/RendererVk.cpp, enableInstanceExtensions:1619.[0911/084701.192518:ERROR:gl_display.cc(520)] EGL Driver message (Critical) eglInitialize: Internal Vulkan error (-7): A requested extension is not supported, in ../../third_party/angle/src/libANGLE/renderer/vulkan/RendererVk.cpp, enableInstanceExtensions:1619.[0911/084701.192603:ERROR:gl_display.cc(790)] eglInitialize SwANGLE failed with error EGL_NOT_INITIALIZED[0911/084701.192677:ERROR:gl_display.cc(824)] Initialization of all EGL display types failed.[0911/084701.192756:ERROR:gl_ozone_egl.cc(26)] GLDisplayEGL::Initialize failed.[0911/084701.194093:ERROR:zygote_host_impl_linux.cc(273)] Failed to adjust OOM score of renderer with pid 1251: Permission denied (13)[0911/084701.194170:ERROR:angle_platform_impl.cc(44)] RendererVk.cpp:168 (VerifyExtensionsPresent): Extension not supported: VK_KHR_surfaceERR: RendererVk.cpp:168 (VerifyExtensionsPresent): Extension not supported: VK_KHR_surface[0911/084701.194300:ERROR:angle_platform_impl.cc(44)] RendererVk.cpp:168 (VerifyExtensionsPresent): Extension not supported: VK_KHR_xcb_surfaceERR: RendererVk.cpp:168 (VerifyExtensionsPresent): Extension not supported: VK_KHR_xcb_surface[0911/084701.194409:ERROR:angle_platform_impl.cc(44)] Display.cpp:1063 (initialize): ANGLE Display::initialize error 0: Internal Vulkan error (-7): A requested extension is not supported, in ../../third_party/angle/src/libANGLE/renderer/vulkan/RendererVk.cpp, enableInstanceExtensions:1619.ERR: Display.cpp:1063 (initialize): ANGLE Display::initialize error 0: Internal Vulkan error (-7): A requested extension is not supported, in ../../third_party/angle/src/libANGLE/renderer/vulkan/RendererVk.cpp, enableInstanceExtensions:1619.[0911/084701.194675:ERROR:gl_display.cc(520)] EGL Driver message (Critical) eglInitialize: Internal Vulkan error (-7): A requested extension is not supported, in ../../third_party/angle/src/libANGLE/renderer/vulkan/RendererVk.cpp, enableInstanceExtensions:1619.[0911/084701.194770:ERROR:gl_display.cc(790)] eglInitialize SwANGLE failed with error EGL_NOT_INITIALIZED[0911/084701.194831:ERROR:gl_display.cc(824)] Initialization of all EGL display types failed.[0911/084701.194914:ERROR:gl_ozone_egl.cc(26)] GLDisplayEGL::Initialize failed.[0911/084701.197338:ERROR:zygote_host_impl_linux.cc(273)] Failed to adjust OOM score of renderer with pid 1256: Permission denied (13)[0911/084701.198668:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization[0911/084701.209657:ERROR:zygote_host_impl_linux.cc(273)] Failed to adjust OOM score of renderer with pid 1272: Permission denied (13)
From my research this is fine to ignore, rendering if also working because you can request via the share options of the panel.
You should also see debug logs from Slack too. For example:
DEBUG[09-11|11:50:23] Creating slack message logger=ngalert.notifier.slack
DEBUG[09-11|11:50:23] Synchronizing Alertmanagers for orgs logger=ngalert.multiorg.alertmanager
DEBUG[09-11|11:50:23] sending Slack API request logger=ngalert.notifier.slack
DEBUG[09-11|11:50:23] Looks like we are using the Slack API, have set the Bearer token for this request logger=ngalert.notifier.slack
DEBUG[09-11|11:50:23] The request was successful logger=ngalert.notifier.slack
DEBUG[09-11|11:50:23] Received an image token in annotations logger=ngalert.notifier.image-provider
DEBUG[09-11|11:50:23] Uploadimg image logger=ngalert.notifier.slack
DEBUG[09-11|11:50:23] Sending multipart request to files.upload logger=ngalert.notifier.slack
DEBUG[09-11|11:50:24] The request was successful logger=ngalert.notifier.slack
DEBUG[09-11|11:50:24] Notify success logger=ngalert.notifier.alertmanager LOG15_ERROR= component=alertmanager orgID=1 component=dispatcher receiver=Slack integration=slack[0] aggrGroup={}:{} alerts="[Panel Title[dd21459][active]]" attempts=1
Hey apologies for the delay in reply - I work with Luke and took over the ticket to setup the images.
We’re not seeing any logs that would suggest that slack is trying to send an image - I can see the output of the slack request and it doesn’t include any information on it attempting sending the image token or url.
the image however is generated by grafana-image-renderer.
If I can give some more info on our setup:
we are using the bot token
bot has access to file:write
we set the image to be saved in local storage (we don’t want to maintain public S3 buckets)
generating images in grafana works fine
One thing I was wondering in this is whether the fact our grafana is on EKS could be affecting the slack notifier being able to read the image? how does the slack notifier get the image?
but I’m not sure where they’re coming from or whether my assumption is correct? I can’t see the errors in the source to try and work out what could cause them my message for slack send is also different from the one you posted
the two errors and no image were showing when I was just running contact point test, despite adding dashboard and panel - that’s ok however confused some results.
in the end I got it working with “real” alerts by adding “uploadImage”: true to the contact point configuration using the admin panel
do you know if there’s a plan for this to be an option on contact point configuration? I only managed to work it out by going through the source code of slack notifier
Yes, images don’t show in contact point testing. We are aware of this limitation. I didn’t realize you were using the Test button. Apologies, otherwise I could have provided the answer earlier!
Btw there is no "uploadImage" option in Alertmanager configuration, that’s just a no-op (is ignored).
it’s definitely that option that fixed it for us so I think it’s defo used there. Might be something specific about our setup but it doesn’t seem like that option is by default set to true and without that this code in notifier won’t trigger
Hi! No, I can promise you that option does nothing in Grafana Alerting. We never read the uploadImage option in Grafana Alerting. That option, along with the code you linked is from Legacy Alerting which you are not using and will be removed in Grafana 11.