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

Update notification channel scanning #163

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

nikodemas
Copy link
Member

Hi @amotl,

I again felt the need of seeing in what dashboards different notification channels are used as previously described by me in #82, so I updated the code to satisfy my needs. However, there are some things worth mentioning:

  • this only searches through alerts that were created before Grafana 8, because after this alerting stopped being tied to the panel/dashboard, so this information is not available anymore. The command doesn't break on occasions like this, it just doesn't return any information about the related panels.
  • even then the structure of the alert information differs slightly between the dashboards, hence my update includes the sketchy if-elif
  • if you still think that this is something useful for the grafana-wtf, I might add support for the search by the channel name. Currently you need to use channel uid and that is completely fine for me, but having the ability to search by channel name would make it a little bit more user-friendly

Let me know what you think!

Copy link

codecov bot commented Jan 27, 2025

Codecov Report

Attention: Patch coverage is 13.04348% with 20 lines in your changes missing coverage. Please review.

Project coverage is 86.20%. Comparing base (e01dcad) to head (df10c24).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
grafana_wtf/core.py 14.28% 18 Missing ⚠️
grafana_wtf/commands.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #163      +/-   ##
==========================================
- Coverage   87.52%   86.20%   -1.32%     
==========================================
  Files           9        9              
  Lines        1090     1109      +19     
==========================================
+ Hits          954      956       +2     
- Misses        136      153      +17     
Flag Coverage Δ
unittests 86.20% <13.04%> (-1.32%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@amotl
Copy link
Contributor

amotl commented Jan 27, 2025

Dear @nikodemas,

thanks a stack for submitting those improvements. I just added you as a member to the grafana-toolbox org, so you can operate better, and will merge your patch right away now that it doesn't fail on CI/GHA.

Adding functionality to search by channel name will be well received.

With kind regards,
Andreas.

@amotl amotl merged commit 85727b4 into grafana-toolbox:main Jan 27, 2025
15 of 17 checks passed
@nikodemas
Copy link
Member Author

Thank you!

Sure, I will add the functionality probably some time later this week. Please also let me know if you have any comments on my code.

Best regards,
Nikodemas

@nikodemas nikodemas mentioned this pull request Feb 4, 2025
@amotl amotl changed the title Update channel scanning Update notification channel scanning Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants