Skip to content

Instantly share code, notes, and snippets.

@xNok
Created September 13, 2021 00:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xNok/1d33a574da02439e441530fd32039b42 to your computer and use it in GitHub Desktop.
Save xNok/1d33a574da02439e441530fd32039b42 to your computer and use it in GitHub Desktop.
func write_event_with_blocking_write(client influxdb2.Client) {
// Get blocking write client
writeAPI := client.WriteAPIBlocking(org, bucket)
// write line protocol
writeAPI.WriteRecord(context.Background(), fmt.Sprintf("stat,unit=temperature1 avg=%f,max=%f", 23.5, 45.0))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment