hastic-zzz / hastic-grafana-app

Hastic data management server for labeling patterns and anomalies in Grafana
https://hastic.io
GNU General Public License v3.0
179 stars 18 forks source link

Unexpected error while adding analytic unit #85

Closed sahilkajani closed 6 years ago

sahilkajani commented 6 years ago

I'm getting this unexpected error while adding an analytic unit. I'm using Grafana 5.3.1

image

rozetko commented 6 years ago

Hey, @sahilkajani! Would you show "Plugin info" tab contents please? Is there anything in hastic-server logs? Are you running panel and server from the latest release or directly from master?

sahilkajani commented 6 years ago

Thanks for the prompt reply. Please find the below screenshot

I tried running the hastic-server and panel using Docker but I'm getting exactly the same error, so currently I'm following the installation from source method as mentioned here https://github.com/hastic/hastic-server/wiki/Installation-from-source

Also, where can I get the logs from?

image

rozetko commented 6 years ago

We should check if it is possible to run hastic-server in Windows first, because we support only Linux

P.S. When you're running Docker - you can see logs in docker logs hastic-server_server_1 or docker logs hastic-server_server_1 When you're running it from source - you should see them in terminal where you run it

P.P.S you can try to change your HASTIC_SERVER_URL variable from http://localhost:8000/ to http://localhost:8000. Please let me know if it works, I would create a bug regarding it then

sahilkajani commented 6 years ago

I tried using http://localhost:8000 but that didn't work. Also, there is nothing interesting in the log image

I've used the below configurations for the hastic-server and hastic-analytics to create Docker conatiners. Does this look correct?

docker run -d \
  --name hastic-analytics \
  -p 8002:8002 \
  hastic/analytics

docker run -d \
  --name hastic-server \
  -p 8000:8000 \
  -e HASTIC_API_KEY=eyJrIjoiVnZZSG9kVFNmWk5YSjc2UFhkM0VPN09DcDBwbXpGUTUiLCJuIjoiSEFTVElDX0FQSV9LRVkiLCJpZCI6MX0= \
  -e ZMQ_CONNECTION_STRING=tcp://8002:8002\
  -v :/var/www/data \
  hastic/server

Also, would analyticsReady always display false?

image

rozetko commented 6 years ago

Will test it in Windows today and let you know if it works But there is a couple of problems in your configuration anyway:

sahilkajani commented 6 years ago

I didn't use docker-compose because I was running containers manually, but I tried using docker-compose and it worked!

But unfortunately I'm getting another error while labeling. I'm not sure if that's a bug or if I'm doing something wrong. Could you please help?

image

rozetko commented 6 years ago

It's a known issue when running hastic-server from Docker and Grafana on localhost. There is a workaround for it in hastic-server wiki:

NOTE: if you use Grafana and Hastic on one host, use your host IP (e.g. http://192.168.0.1:3000 instead of http://localhost:3000 / http://127.0.0.1:3000) when opening Grafana in browser. Otherwise Hastic will try to find Grafana inside Docker container and fail.

Just run Grafana on http://<your_host_ip>:3000 (e.g. http://192.168.0.1:3000) instead of http://localhost:3000

sahilkajani commented 6 years ago

Any recommended tool that would allow me to create a host ip and run grafana?

rozetko commented 6 years ago

Here is ways to find your IP in Windows: https://www.digitalcitizen.life/find-ip-address-windows

sahilkajani commented 6 years ago

Thanks a lot for the link. Getting a different error message now!

image

jonyrock commented 6 years ago

@sahilkajani hastic server is up, right? do you see anything interesting in server log?

Can I also ask you for steps you made to get this, please?

sahilkajani commented 6 years ago

Yes the server is up and I can see it running on http://localhost:8000. There are no errors in the log.

Below are the steps 1) Following the steps mentioned here https://github.com/hastic/hastic-grafana-graph-panel/wiki/Installation-from-source graph panel is installed 1) Started Grafana server and using host ip address I then navigate to the Grafana login page 2) After logging in, I created an API key 3) I then created a directory in my local drive which holds the docker-compose.yml and .env file 4) Using Gitbash, I run the below the commands

export HASTIC_API_KEY=<your_grafana_api_key>
docker-compose up -d

5) This runs the server and analytics and I can see the server running on http://localhost:8000 and analyticsReady is true. 6) I then add the variable inside grafana 7) Selecting a graph using Hastic Graph icon, I'm setting my data source as Influxdb database and selecting some metrics 8) While setting the analytics I'm getting the above error

jonyrock commented 6 years ago

@sahilkajani lets make a google hangouts with screen sharing? Just for fun. I feel how you struggling. Please sent us a time working for you to ping@hastic.io

rozetko commented 6 years ago

When creating datasource for using with Hastic - make sure it is Server access type, not Browser Otherwise, hastic-server won't be able to get data from there

image

sahilkajani commented 6 years ago

I updated the graph panel and got the latest hastic server version in Docker. Facing a weird issue now So when I create the Graph by selecting the data source and field in Metrics tab (see Image 1) and further using the Analytics tab I select two labels (see Image 2) to which it correctly detects similar patterns (see Image 3)

But for the same graph when I try to add some queries like WHERE, GROUP BY (Image 4) and select patterns, it throws up en error (Image 5)

Image 1 image

Image 2 image

Image 3 image

Image 4 image

Image 5 image

jonyrock commented 6 years ago

@sankerust @sahilkajani @rozetko lets make a new issue based on this input, please?