cruise-control icon indicating copy to clipboard operation
cruise-control copied to clipboard

VictoriaMetrics as prometheus.server.endpoint

Open jack-walters opened this issue 2 years ago • 5 comments

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!

jack-walters avatar Oct 04 '22 08:10 jack-walters

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?

GideonStowell avatar Feb 08 '23 19:02 GideonStowell

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

clkelly-r7 avatar Feb 17 '23 14:02 clkelly-r7

@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!

GideonStowell avatar Feb 17 '23 14:02 GideonStowell

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

clkelly-r7 avatar Feb 20 '23 09:02 clkelly-r7

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

SLoeuillet avatar Feb 08 '24 12:02 SLoeuillet