Closed tarakshah94 closed 4 years ago
Invalid URL 'None/api/v1/query': No schema su
it looks like the prometheus url wasn't properly set
I've given it the URL of my Prometheus client which is working absolutely fine in my browser,
prometheus_url = os.getenv("http://xx.xxx.192.109:9090/graph")
and for now, since there's no authentication required I've commented this block:
#prom_connect_headers = None
# example oath token passed as a header
#if os.getenv("FLT_PROM_ACCESS_TOKEN"):
#prom_connect_headers = {
#"Authorization": "bearer " + os.getenv("FLT_PROM_ACCESS_TOKEN")
#}
And my device metrics are stored in a variable called device_metrics, so here's my list:
metrics_list = str( os.getenv( "device_metric" ) ).split(";")
prometheus_url = os.getenv("http://xx.xxx.192.109:9090/graph")
so this line looking for an env variable http://xx.xxx.192.109:9090/graph
.
I think what you need is prometheus_url = "http://xx.xxx.192.109:9090/graph"
other than that, I don't think you need to comment out any of the configuration stuff
This solved it. I spent a good amount of time on such a silly mistake! Thanks for pointing that @4n4nd
Hi, I'm trying this repository on Py-3.6 but I'm getting the following error:
I'm not able to understand this error. Am I supposed to pass some values to the app.py file?
py36) tarak@tarak-Aspire:~/Desktop/prometheus-anomaly-detector$ python app.py 2020-06-07 03:20:53,770:INFO:configuration: Metric data rolling training window size: 2 days, 23:59:59.899995 2020-06-07 03:20:53,771:INFO:configuration: Model retraining interval: 120 minutes 2020-06-07 03:20:53,922:ERROR:fbprophet.plot: Importing plotly failed. Interactive plots will not work. Traceback (most recent call last): File "app.py", line 33, in <module> metric_init = pc.get_current_metric_value(metric_name=metric) File "/home/tarak/anaconda3/envs/py36/lib/python3.6/site-packages/retrying.py", line 49, in wrapped_f return Retrying(*dargs, **dkw).call(f, *args, **kw) File "/home/tarak/anaconda3/envs/py36/lib/python3.6/site-packages/retrying.py", line 212, in call raise attempt.get() File "/home/tarak/anaconda3/envs/py36/lib/python3.6/site-packages/retrying.py", line 247, in get six.reraise(self.value[0], self.value[1], self.value[2]) File "/home/tarak/anaconda3/envs/py36/lib/python3.6/site-packages/six.py", line 703, in reraise raise value File "/home/tarak/anaconda3/envs/py36/lib/python3.6/site-packages/retrying.py", line 200, in call attempt = Attempt(fn(*args, **kwargs), attempt_number, False) File "/home/tarak/anaconda3/envs/py36/lib/python3.6/site-packages/prometheus_api_client/prometheus_connect.py", line 104, in get_current_metric_value headers=self.headers, File "/home/tarak/anaconda3/envs/py36/lib/python3.6/site-packages/requests/api.py", line 76, in get return request('get', url, params=params, **kwargs) File "/home/tarak/anaconda3/envs/py36/lib/python3.6/site-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File "/home/tarak/anaconda3/envs/py36/lib/python3.6/site-packages/requests/sessions.py", line 516, in request prep = self.prepare_request(req) File "/home/tarak/anaconda3/envs/py36/lib/python3.6/site-packages/requests/sessions.py", line 459, in prepare_request hooks=merge_hooks(request.hooks, self.hooks), File "/home/tarak/anaconda3/envs/py36/lib/python3.6/site-packages/requests/models.py", line 314, in prepare self.prepare_url(url, params) File "/home/tarak/anaconda3/envs/py36/lib/python3.6/site-packages/requests/models.py", line 388, in prepare_url raise MissingSchema(error) requests.exceptions.MissingSchema: Invalid URL 'None/api/v1/query': No schema su
Please help me understand.