Go and InfluxDB
Powerful performance with an easy integration, powered by Telegraf, the open source data connector built by InfluxData.
5B+
Telegraf downloads
#1
Time series database
Source: DB Engines
1B+
Downloads of InfluxDB
2,800+
Contributors
Table of Contents
Powerful Performance, Limitless Scale
Collect, organize, and act on massive volumes of high-velocity data. Any data is more valuable when you think of it as time series data. with InfluxDB, the #1 time series platform built to scale with Telegraf.
See Ways to Get Started
Build IoT, analytics, and cloud applications using the Go client library with InfluxDB.
Why use the InfluxDB Go Client Library?
InfluxDB is an API-first time series database for your Go lang applications. Use the InfluxDB open-source Go API client to write and query data and even manage your InfluxDB instance from within your application.
Key features
- Provides API access to all InfluxDB Write and Read functionality, settings, and advanced features like managing your instance,
- Write data in InfluxDB line protocol or point data structure
- Write data both asynchronously or synchronously
- Automatically retry requests on failure
- Parameterized queries (InfluxDB Cloud only)
- Checking the state of your server
- Health - Detailed info about the server status, along with version string (OSS)
- Ready - Server uptime info (OSS)
- Ping - Whether a server is up
Get started
Getting Started with Go and InfluxDB
This tutorial shows you how to use the InfluxDB Go client library, create a connection to the database and store and query data from it.
Learn moreGetting Started with the InfluxDB Go Client
Looking to build an application with a fast way to fetch data concurrently with an easy binary deploy? Then use the InfluxDB Go Client.
Learn moreRead
Write
package main
import (
"context"
"fmt"
influxdb2 "github.com/influxdata/influxdb-client-go/v2"
)
func main() {
url := "https://us-west-2-1.aws.cloud2.influxdata.com"
token := "my-token"
org := "my-org"
bucket := "my-bucket"
client := influxdb2.NewClient(url, token)
queryAPI := client.QueryAPI(org)
query := fmt.Sprintf(`from(bucket: "%v") |> range(start: -1d)`, bucket)
result, err := queryAPI.Query(context.Background(), query)
if err != nil {
panic(err)
}
for result.Next() {
record := result.Record()
fmt.Printf("%v %v: %v=%v\n", record.Time(), record.Measurement(), record.Field(), record.Value())
}
client.Close()
}
Powerful Performance, Limitless Scale
Collect, organize, and act on massive volumes of high-velocity data. Any data is more valuable when you think of it as time series data. with InfluxDB, the #1 time series platform built to scale with Telegraf.
See Ways to Get Started