0

I need to push cpu info to OpenTSDB server using golang.

What is the procedure to send data in golang?

In which package should use the sent Data? (websocket or http)

In which format should I send the data?

What method should I use for pushing the data? (POST OR GET)

vanarajcs
  • 968
  • 2
  • 7
  • 18

1 Answers1

1

You can use https://github.com/shirou/gopsutil package to gather metrics then use http package to push data to your backend using a POST request with a json body. Have a look to this thread for posting data with golang : How do I send a JSON string in a POST request in Go.

Community
  • 1
  • 1
molivier
  • 2,146
  • 1
  • 18
  • 20