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

VictoriaMetrics as prometheus.server.endpoint #1917

Open
jack-walters opened this issue Oct 4, 2022 · 5 comments · May be fixed by #2120
Open

VictoriaMetrics as prometheus.server.endpoint #1917

jack-walters opened this issue Oct 4, 2022 · 5 comments · May be fixed by #2120

Comments

@jack-walters
Copy link

jack-walters commented Oct 4, 2022

Hello.

I use victoriametrics instead of prometheus.
The endpoint URL of victoriametrics is vmselect-vmcluster-persistent.monitoring:8481/select/0/prometheus.

But if I set this endpoint in prometheus.server.endpoint option - I get error:

Invalid HTTP host: vmselect-vmcluster-persistent.monitoring:8481/select/0/prometheus for configuration Prometheus endpoint URI is malformed, expected schema://host:port, provided vmselect-vmcluster-persistent.monitoring:8481/select/0/prometheus

The only solution I found is to use nginx as a proxy server:

server {
...
        location / {
          proxy_pass http://vmselect-vmcluster-persistent.monitoring:8481/select/0/prometheus;
        }
}

Thanks!

@GideonStowell
Copy link

GideonStowell commented Feb 8, 2023

I am having a similar issue but using nginx is a less than ideal workaround.

In my cruisecontrol.properties I have this configuration set:

# Prometheus Metric Sampler specific configuration
prometheus.server.endpoint=${env:PROMETHEUS_SERVER}

I am attempting to run cruise control in a docker container, so at docker run time I provide the PROMETHEUS_SERVER env variable. I have tried the following values:

PROMETHEUS_SERVER
http://127.17.0.2
http://127.17.0.2:9090
127.17.0.2:9090
myserver1:1234
http://myserver1:1234

All of these fail with this same error:

ERROR Uncaught exception on thread Thread[main,5,main] (com.linkedin.kafka.cruisecontrol.KafkaCruiseControlMain)
com.linkedin.cruisecontrol.common.config.ConfigException: Prometheus endpoint URI is malformed, expected schema://host:port, provided http://myserver1:9090

The cruise control version I am using is 2.5.70.

Is this a known bug or do I have something misconfigured elsewhere?

@clkelly-r7
Copy link

clkelly-r7 commented Feb 17, 2023

I am also getting the same error as @GideonStowell when setting prometheus.server.endpoint=${env:PROMETHEUS_SERVER} as http://localhost:9090 in a local setup
I am using cruise-control-2.5.111

@GideonStowell
Copy link

GideonStowell commented Feb 17, 2023

@clkelly-r7
I'm not sure if this will help you but it turned out that I have a trailing space in my cruisecontrol.properties file, on the line where I was setting the Prometheus server endpoint. And for some reason that causes the endpoint validation to fail. Seems like this validation step should strip leading and trailing spaces, but it is what it is.
Hope this helps!

@clkelly-r7
Copy link

@GideonStowell that solved my issue as well, thank you!

@SLoeuillet
Copy link

Did create a PR that fixes that specific issue for me
Please test it

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