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

How to get data into Graphite using plaintext protocol?[Q] #2642

Closed
dinBo opened this issue Oct 19, 2020 · 4 comments
Closed

How to get data into Graphite using plaintext protocol?[Q] #2642

dinBo opened this issue Oct 19, 2020 · 4 comments

Comments

@dinBo
Copy link

dinBo commented Oct 19, 2020

First of all, I’m new to Graphite, so sorry if this question has an obvious answer that I’m somehow missing.

So, I’ve set up Graphite and Grafana via Docker using the following instructions (The “Up and running in (almost) 5 minutes“ section): https://www.sitespeed.io/documentation/sitespeed.io/performance-dashboard/. I’m using these instructions because I’ll be using both metrics gained from sitespeed.io and from a custom Node.js script.

I’m trying to send the data from Node.js script to Graphite using plaintext protocol (https://graphite.readthedocs.io/en/latest/feeding-carbon.html#the-plaintext-protocol). I’ve used the ’net’ library (https://nodejs.org/api/net.html) to send the data via TCP:
Pasted Graphic 8

When I run the script, this is what is logged:
Pasted Graphic 9

And also, I’m able to access it in grafana:
Pasted Graphic 10

The problem is that I’m not able to see the data value in Grafana, even when I explicitly give it the timestamp, it’s like it doesn’t reach it. Here’s the example for timestamp 1603104600000 (Date and time for GMT+2 zone: 2020-10-19 12:50:00 AM):
Pasted Graphic 11

It’s not shown in the graph or table in Explore tab (look at the last entry in table):
Pasted Graphic 12

And in Query inspector it says it’s null for the given timestamp:
Pasted Graphic 13

How can I get the data into graphite using plaintext protocol? Am I missing to add something when sending data to Graphite?

Thanks,
Bodin

@dinBo dinBo added the question label Oct 19, 2020
@piotr1212
Copy link
Member

I think you got a few zeros too much in your date.

@deniszh
Copy link
Member

deniszh commented Oct 19, 2020

@dinBo : in Graphite timestamp is in seconds, not milliseconds or nanoseconds.

@JohanElmis
Copy link

@dinBo Have you been able to test with "lower" resolution on your time?
I used to tests data with some simple bash-command.
Not really a dice - as it gives 0-6 but something to relate to anyway. This send data every 10s, easy to tune for what your server/storage expects.

export PORT=2003
export SERVER="DNS or IP of your server"
while true; do echo "local.random.diceroll $(rand -M 6) date +%s" | nc -4 -q0 ${SERVER} ${PORT}; sleep 10; done

@stale
Copy link

stale bot commented Dec 27, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 27, 2020
@stale stale bot closed this as completed Jan 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants