stephenyeargin / hubot-grafana

📈🤖 Query Grafana dashboards
http://docs.grafana.org/tutorials/hubot_howto/
MIT License
154 stars 48 forks source link

Can only receive 1 image by each query which queries all panels in the dashboard #141

Closed yohey03518 closed 2 years ago

yohey03518 commented 2 years ago

Describe the bug Before 2.5.2, when there are more than one panel in dashboard and query by below message, I can get multiple images. hubot graf db <dashboard-name> But in version 3+, I can only get exactly 1 image. hubot graf db <dashboard-uid>

To Reproduce Steps to reproduce the behavior:

  1. Prepare a dashboard with multiple panels
  2. hubot graf db <dashboard-uid>
  3. Can only get 1 message in my channel

Expected behavior Should receive all the images from the dashboard.

Software:

  • Grafana: 8.3.4
  • Hubot-Grafana: 3.0.1
  • Hubot: 3.3.2
  • Adapter: Slack

Additional context I have noticed that in this version, there is a return for robot.respond . Also a corresponding unit test on the next commit. It seem you did want to return only first panel. I am not sure the reason for adding this (maybe due to performance?), but I am thinking about whether this can be controlled by a configuration? For example maybe can use HUBOT_GRAFANA_MAX_RETURNED_DASHBOARDS, to make the number of returned dashboard can be controlled. And user can query multiple panels with only 1 query.

Look forward to your response. And thanks for the powerful tool :)

stephenyeargin commented 2 years ago

Yep, that does appear to be a regression. Working on a fix.

yohey03518 commented 2 years ago

Hi @stephenyeargin it works now with version 3.1.0 . Thanks for your help. Have a nice day :)