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

Connecting TicktockDB to Grafana not working #65

Open
juggledad opened this issue Jan 11, 2024 · 8 comments
Open

Connecting TicktockDB to Grafana not working #65

juggledad opened this issue Jan 11, 2024 · 8 comments

Comments

@juggledad
Copy link

I have ticktock running on a Raspberry Pi 2 model B v1.1 and it has been running great for several weeks. NOTE: this is not a docker image.
I'm using Node-RED to collect data from some sensors (bme280's) in three different locations. In NR I can create graphs of the data with no problem.

Now I want to use Grafana to connect to the DB.
I installed Grafana and logged into Grafana
I then selected the Connections option from the hamburger menu and selected OpenTSDB as the Data source
Next I open the OpenTSDB Data source and set the HTTP URL to http://192.168.1.192:6182 (192.168.1.192 is the IP of the RPI)
I click 'Save and Test' and it shows 'Data source is working'
I click the 'Explore view' option (at bottom of the screen)

When I click on the 'Metric name' option it shows 'No options found'

Any suggestions?

@ylin30
Copy link
Collaborator

ylin30 commented Jan 11, 2024

image

Do you mean this? It works here. TT supports OpenTSDB API (/api/suggest) which enables this feature in Grafana. Have you added any metrics to TT already? You can try this curl cmd to see if any response:

curl -s -v 'http://192.168.1.192:6182/api/suggest?type=metrics&q=&max=100'

@juggledad
Copy link
Author

Yes I have metrics

pmw@ticktockpi:~ $ curl -s -v 'http://192.168.1.192:6182/api/suggest?type=metrics&q=&max=100'

  • Trying 192.168.1.192:6182...
  • Connected to 192.168.1.192 (192.168.1.192) port 6182 (#0)

GET /api/suggest?type=metrics&q=&max=100 HTTP/1.1
Host: 192.168.1.192:6182
User-Agent: curl/7.74.0
Accept: /

  • Mark bundle as not supporting multiuse
    < HTTP/1.1 200 OK
    < Content-Length: 37
    < Content-Type: application/json
    <
  • Connection #0 to host 192.168.1.192 left intact
    ["weather.h","weather.p","weather.t"]pmw@ticktockpi:~ $

And in node-red I can create graphs using the node-red nodes so I decided to try Grafana.
Screenshot 2024-01-11 at 2 43 28 PM

so I made the connection but when I try to use it I get this:
Screenshot 2024-01-11 at 2 43 08 PM

@ylin30
Copy link
Collaborator

ylin30 commented Jan 11, 2024

hm...What version of Grafana are you using? Mine is v9.3.2 (21c1d14e91).

Can u also inspect the network traffic from Grafana to TT? If you use Chrome as your browser, do this:

  1. Right click on the grafana webpage, select "Inspect" from the pop-up manu;
    image

  2. Select the 'network' tab in the left panel

  3. Click the dropdown button in Metric name text box

  4. You should see if Grafana sends /api/suggest to TT and responses.
    image

Other browsers should be similar. You can google it.

@juggledad
Copy link
Author

pmw@ticktockpi:~ $ /usr/share/grafana/bin/grafana -v
grafana version 10.2.3

This is the most interesting thing I found
Screenshot 2024-01-12 at 5 36 41 AM
Screenshot 2024-01-12 at 5 36 50 AM

@juggledad
Copy link
Author

Update: I downgraded to Grafana v9.3.2 and I am now seeing the metrics

@ylin30
Copy link
Collaborator

ylin30 commented Jan 12, 2024

pmw@ticktockpi:~ $ /usr/share/grafana/bin/grafana -v

grafana version 10.2.3

This is the most interesting thing I found

Screenshot 2024-01-12 at 5 36 41 AM

Screenshot 2024-01-12 at 5 36 50 AM

Note the q=cpu parameter. This causes the empty response since you didn't have metrics with cpu* prefix. I tend to think it's a bug In grafana v10.

@juggledad
Copy link
Author

Well at least you know about this if someone else upgrades to v10 of Grafana.

@ylin30
Copy link
Collaborator

ylin30 commented Jan 12, 2024

yah! Thanks for the reporting. I add this info in FAQ.

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

No branches or pull requests

2 participants