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

Panel as an iframe #11702

Closed
stokito opened this issue Dec 12, 2022 · 5 comments
Closed

Panel as an iframe #11702

stokito opened this issue Dec 12, 2022 · 5 comments

Comments

@stokito
Copy link

stokito commented Dec 12, 2022

Proposal

I don't want to use Grafana and the basic Prometheus graphs are fine to me. But I need to include the graph into a dashboard. The Grafana has such a feature and it looks for me like a simple thing to implement for the Prometheus.
Even now I can include the /graph page but I just want to hide a header. Is it something that can be done in Prometheus or it's UI is not a subject for a serious use and we should use the Grafana instead?

@LeviHarrison
Copy link
Member

Technically, I don't think this would be too difficult. All the configuration information for a graph is already serialized in the URL anyway so all we would need to do is make a page that only has the graph component. The question of is it in scope is a little more tricky. I personally think the iframe functionality is on the border of what our simple UI should be doing. I wouldn't necessarily be opposed to it, but I'm not familiar enough the decisions made in the UI to make a determination.

cc @juliusv

@juliusv
Copy link
Member

juliusv commented Dec 24, 2022

I'm also on the fence about that in Prometheus itself... btw., one way you can already do it is by using the console templates in Prometheus (https://prometheus.io/docs/visualization/consoles/#console-templates) that already come with an example graphing library as well. You could use that to serve an HTML page straight from Prometheus that only shows a graph.

On a totally different front (but at the moment still only in a separate project), the Perses project (https://github.com/perses/perses) had embeddability of Prometheus graphs as one of its main goals. @Nexucis is this already usable by others?

@stokito
Copy link
Author

stokito commented Dec 25, 2022

I feel stupid because didn't figured out what is consoles and how to use them when first read the docs. Nice feature. It would be great to add a menu item for them.
The consoles themselves needs for some attention.
Their index page http://localhost:9090/consoles/index.html.example has a list of console files but it's not clickable and not generated automatically. Some consoles seems not working our of the box.

The consoles aren't not the same as the React UI built-in to Prometheus binary. So I'm not sure if I can get the same functionality like query autocompletion. Ideally the main UI must be also implemented as a default console. Then users may play and hack it.

Anyway, this is basically not related directly to the feature request. The iframe would be very useful at least for my case but I don't know how many of others would need it. Given that I was a first who asked about it I assume that this is not needed.

Right now for my app I took chart.js library and making a CORS request to the Prometheus with Base Authorization and credentials are just written in the client JS. This is a bad solution from security perspective but I don't have other options for now. And even with the CORS I have a trouble and had to put nginx behind.
I still wish to have the iframe just because I can use autocompletion.
Also I need to figure out how to get rid off the basic auth creds and the only reasonable way would be to use JWT based auth. This again needs for a proxy behind the Prometheus.

P.S. You see, this is all basically talk more about direction of the Prometheus itself. When I created the issue I was pissed off. And next hour I just started looking how to get rid off the Prometheus and use plain PostgreSQL instead. I spent too much time on the Prom and not a single of my needs wasn't solved without a headache:

  1. Installation: the Ubuntu's prom package is very outdated. And there is no any PPA or just a DEB package. So I had to download manually and configure the systemd unit.
  2. By default there is no any password and I had to spend time to find how to add a basic auth.
  3. TLS was a separate pain because the Prometheus has it's own user that doesn't have an access to /etc/letsencrypt. As a workaround I added the prometheus user to ssl-cert group and copied certs to /etc/ssl/private.
  4. Alerts should be installed separately and this also was a big challenge. The Ubuntu's package is old and doesn't support Telegram. I don't know why TG wasn't supported from beginning given that it has a simple API and widely used. I still didn't configured alerts rules because this seems complicated and no any UI for this. Instead I just wrote a shell scrip that does everything I need in a plain manner.
  5. The service discovery turned out to be just an integration with a SD of a k18s. So basically Prom doesn't have an SD and I have to write my own.

And many of other small problems like removing a metric series that consumed too mush of a disk space. I spending about 30% of time to fight with it and this is just insane.
So many optimizations of TSDB while basic needs aren't covered and the overall system is not usable.

@stokito stokito closed this as completed Dec 25, 2022
@juliusv
Copy link
Member

juliusv commented Dec 27, 2022

@stokito It seems to me that you came with the expectations of a commercial product to an open-source project built and maintained in large parts by volunteers, often in their free time (although some companies also pay some people for specific things). Still, it is good feedback, and definitely we could do a better job in many of these things. When it comes to Debian / Ubuntu packages, they are indeed often out of date or not feature-complete, as Debian's own packaging guidelines make it quite tough to ship Prometheus packages with all features and in a timely way. That's currently done by a volunteer outside of the official project. It would be nice if the project itself could ship its own .debs and other packages with less packaging restrictions, but currently nobody is doing that unfortunately (again, it would need a volunteer).

With point 5, I'm not sure what you mean... Prometheus supports integrating with a lot of common types of service discovery, where k8s is just one (see https://prometheus.io/docs/prometheus/latest/configuration/configuration/#configuration). It also allows custom integrations over HTTP or local files. What other way were you expecting Prometheus to discover services?

Anyway, it seems like Prometheus wasn't a match for what you were expecting, which is fine.

@Nexucis
Copy link
Member

Nexucis commented Dec 29, 2022

On a totally different front (but at the moment still only in a separate project), the Perses project (https://github.com/perses/perses) had embeddability of Prometheus graphs as one of its main goals. @Nexucis is this already usable by others?

Well on the paper, it should be usable by others, but for the moment there is no guideline or explanation on how to do it.
On my personal side, I will try it in Prometheus. Probably when I will start to do that, I will write or help to write such documentation.
Even if I can't wait to see it happen, well this moment will take time :(. Also because there is some steps before with more urgent matter, like integrating PromLens in Prometheus.

@prometheus prometheus locked as resolved and limited conversation to collaborators Jun 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants