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

How is the /panels endpoint supposed to work? #12

Open
amotl opened this issue Feb 6, 2022 · 1 comment
Open

How is the /panels endpoint supposed to work? #12

amotl opened this issue Feb 6, 2022 · 1 comment

Comments

@amotl
Copy link
Contributor

amotl commented Feb 6, 2022

Hi there,

at 1, I discovered that @fbeneventi used the add_panel_reader() routine on this recipe the other day. However, I haven't been able to figure out how this is supposed to work as I also wasn't able to find any reference in simple-json-datasource 2.

What subsystem of Grafana would request this endpoint? I am feeling a bit silly on this and dearly hope that @linar-jether or @fbeneventi could shed some light on this.

With kind regards,
Andreas.

Footnotes

  1. https://gist.github.com/fbeneventi/9264d8760f847ad5acf0a4bcdab8d87f#file-simple_python_datasource-py-L281

  2. https://github.com/grafana/simple-json-datasource

@amotl
Copy link
Contributor Author

amotl commented Feb 6, 2022

To answer myself, I was able to discover @linar-jether's introduction to that feature at 1:

To serve HTML panels, use add_panel_reader(name, lambda query_str, ts_range: <html_content>) to register a function that returns a HTML string for a given query string and time range. To query it, use the AJAX Panel for Grafana.

image

It would be sweet to have an example in the repository demoing that feature.

Footnotes

  1. https://gist.github.com/linar-jether/95ff412f9d19fdf5e51293eb0c09b850#gistcomment-2316794

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

No branches or pull requests

1 participant