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

prometheus: make backend configurable for now admin users #24

Open
farodin91 opened this issue Dec 15, 2023 · 12 comments
Open

prometheus: make backend configurable for now admin users #24

farodin91 opened this issue Dec 15, 2023 · 12 comments

Comments

@farodin91
Copy link

farodin91 commented Dec 15, 2023

First step, make Prometheus service address configurable.

In my case, i would like to provide the endpoint by an different plugin which serves dynamic clusters.


I used Lens before, here i was able to provide such settings by an different lens extension.
image

@yolossn
Copy link
Contributor

yolossn commented Dec 18, 2023

Hey @farodin91 Can you explain a bit more on this? Do you want a way to specify the proxy URL for accessing prometheus?

@farodin91
Copy link
Author

@yolossn I updated the issue.

@remram44
Copy link

I am running into this too. My cluster already has a Prometheus server installed, I don't want to deploy another one.

In addition, the message is not very clear: "Install Prometheus for accessing metrics charts" Does this mean installing a Prometheus server or the Prometheus plugin for Headlamp?

@remram44
Copy link

In addition, note that Prometheus might be using HTTPS.

@yolossn
Copy link
Contributor

yolossn commented Feb 20, 2024

Hey @remram44 We are working on plugin settings feature which will allow plugins to make certain values configurable by the end user. The PR is under review now, once that is done, we will update the prometheus plugin to allow the user configure the endpoint to access prometheus.

@remram44
Copy link

I am running headlamp as a web app for my cluster's users, in my case they don't need to configure this value, I would do it when installing. For example an environment variable would be perfect.

@air3ijai
Copy link

air3ijai commented Mar 27, 2024

We are running VictoriaMetrics as an drop-in replacement for Prometheus.

It would be very helpful if we would be able to set a custom endpoint in Prometheus plugin.

example Screenshot 2024-03-27 at 16 42 34

@yolossn
Copy link
Contributor

yolossn commented Jul 16, 2024

This can be solved in two different ways, the user can either provide the label to identify the prometheus pod and the plugin figures out how to reach the pod etc or the user can provide the namespace and pod/service url to reach the prometheus pod.

If we choose to solve it by getting the namespace and pod/service url from the user, the following steps can be used to fix this.

  1. Create a Settings component and register it using the registerPluginSettings function.
    The Settings component should take care of getting the namespace and service to access prometheus as inputs and store it in plugin conf.

  2. In the components that use fetchMetrics get the config using the ConfigStore and generate the prefix and pass it to the fetchMetrics function.

References:

  1. Introduction to Plugin Settings
  2. OpenCost plugin for headlamp has a similar configuration mechanism.

cc: @joaquimrocha

@joaquimrocha
Copy link
Contributor

@skoeva Can you look into this one?

@air3ijai
Copy link

This can be solved in two different ways

Maybe we can leave a space for multiple solutions, if they will be implemented later
Screenshot 2024-07-16 at 13 08 34

@Smana
Copy link

Smana commented Sep 14, 2024

Hey, I'm currently using VictoriaMetrics which is 100% prometheus compatible here. What I need is just to be able to point to a given address.
That'd be great! thank you :)

@mgalesloot
Copy link
Contributor

The solution with client side plugin settings would be great, but I think for this setting a server side configuration would be nicer. It would allow the platform team to configure plugin settings, and end users would not be bothered in configuring the plugin and maintaining browser cookies. I believe this is a missing feature in the plugin system.

Suggestion:

  • Create a configmap in headlamp namespace with settings for plugins
  • Provide support in the Headlamp helm chart for plugin stettings and generate this configmap
  • Add support in the Headlamp api so React client can pull the data from the configmap

An even simpler solution would be to create a configmap and let the plugin fetch this configmap via the Headlamp proxy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants