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

Annotations: Fix blank panels for queries with unknown data sources #39017

Merged
merged 2 commits into from
Sep 9, 2021

Conversation

hugohaggmark
Copy link
Contributor

What this PR does / why we need it:
We're using the rxjs function reduce in DashboardQueryRunner and AnnotationsWorker to keep re-renders to one. One challenge with using reduce is that all observables involved need to be completed before any value is emitted. Having an unhandled exception in that chain will cause the reduce to never emit a value which explains #38985.

This PR adds error handling for the call to datasourceSrv.get so we always emit values even if one of the data sources is missing.

Which issue(s) this PR fixes:
Fixes #38985

Special notes for your reviewer:

@hugohaggmark hugohaggmark added this to the 8.1.4 milestone Sep 9, 2021
@hugohaggmark hugohaggmark self-assigned this Sep 9, 2021
@hugohaggmark hugohaggmark requested review from a team, kaydelaney, natellium, torkelo and ashharrison90 and removed request for a team and natellium September 9, 2021 05:54
Copy link
Contributor

@ashharrison90 ashharrison90 left a comment

Choose a reason for hiding this comment

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

looks good to me, nice catch! 🙌

@hugohaggmark
Copy link
Contributor Author

@ashharrison90 did you have a minute to test it out too?

@ashharrison90
Copy link
Contributor

yeah, worked perfectly for me and surfaced the error to the user. although i only tested the scenario you mentioned in the issue - i'm a little unsure what else to test in that area 😅

@hugohaggmark
Copy link
Contributor Author

yeah, worked perfectly for me and surfaced the error to the user. although i only tested the scenario you mentioned in the issue - i'm a little unsure what else to test in that area 😅

Thank you, that's more than enough!

@hugohaggmark hugohaggmark merged commit 419ead9 into main Sep 9, 2021
@hugohaggmark hugohaggmark deleted the hugoh/annotations-broken-observable branch September 9, 2021 11:43
grafanabot pushed a commit that referenced this pull request Sep 9, 2021
…#39017)

* Annotations: Fixes blank panels for queries with unknown data sources

* Chore: fixes strict typescript error

(cherry picked from commit 419ead9)
hugohaggmark added a commit that referenced this pull request Sep 9, 2021
…#39017) (#39034)

* Annotations: Fixes blank panels for queries with unknown data sources

* Chore: fixes strict typescript error

(cherry picked from commit 419ead9)

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
@sunker sunker added this to the 8.1.4 milestone Sep 16, 2021
@sunker sunker changed the title Annotations: Fixes blank panels for queries with unknown data sources Annotations: Fix blank panels for queries with unknown data sources Sep 16, 2021
stevepostill pushed a commit to Reveal-International/grafana that referenced this pull request Nov 3, 2021
…-github to revdev

* commit '56aebaac32bd7a82f84a571969b51c62ba54fd6d': (23 commits)
  "Release: Updated versions in package to 8.1.4" (grafana#39273)
  Docs: Update azuread docs to mention about env variables (grafana#39203) (grafana#39265)
  Docs: plugin migration guide 7.0.0 to 8.0.0 (grafana#38911) (grafana#39246)
  Docs: Added "manageAlerts" provisioning option. (grafana#38836) (grafana#39253)
  BarChart: Fix legend and tooltip colors off by 1 after data refresh (grafana#39234) (grafana#39252)
  Update silences.md (grafana#38834) (grafana#39243)
  Explore: Ensure logs volume bar colors match legend colors (grafana#39072) (grafana#39120)
  Graph: make old graph panel thresholds work even if ngalert is enabled  (grafana#38918) (grafana#39233)
  Fix regex to identify / as separator (grafana#39220)
  [v8.1.x] BarChart: fix stale bar values and x axis labels
  Add link to default template (grafana#39106) (grafana#39138)
  Doc: Created a separate topic for AWS authentication  (grafana#39012) (grafana#39160)
  LDAP: Search all DNs for users (grafana#38891) (grafana#39167)
  Docs: Fix broken link to signed GCS URLs docs (grafana#39144) (grafana#39149)
  [v8.1.x] Variables: Fix not updating inside a Panel when the preceding Row uses "Repeat For" (grafana#39141)
  Docs: Improve v8 upgrade notes for SQL data sources (grafana#38792) (grafana#39124)
  Explore: Trace view now shows trace start time in selected timezone (grafana#39054) (grafana#39093)
  Alerting: Fix notification channel migration (grafana#38983) (grafana#39053)
  Annotations: Fixes blank panels for queries with unknown data sources (grafana#39017) (grafana#39034)
  Copy cue.mod and packages/grafana-schema to container workdir (grafana#38998) (grafana#39018)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Annotations: errors in DashboardQueryRunner don't bubble up
4 participants