Skip to content
A home for InfluxDB’s 2.x's golang client.
Go
Branch: develop
Clone or download
docmerlin feat: Retry writer should split too-big payloads
This changes the retry writer to split excessively large payloads when
the influxdb returns an http.StatusRequestEntityTooLarge response.
Latest commit df22350 Jan 13, 2020
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci refactor(writers): move buffered writing and periodic batching into w… Sep 19, 2019
generated check go fmt on ci Sep 19, 2019
internal check go fmt on ci Sep 19, 2019
writer feat: Retry writer should split too-big payloads Feb 10, 2020
LICENSE chore: add MIT License Sep 19, 2019
README.md Fix syntax in the example Oct 21, 2019
client.go writer.RetryWriter implementation (#50) Sep 19, 2019
client_test.go chore(client): refactor New Client function (#19) Sep 19, 2019
clientoptions.go chore(client): refactor New Client function (#19) Sep 19, 2019
e2e_test.go feat: Retry writer should split too-big payloads Feb 10, 2020
errors.go feat: Retry writer should split too-big payloads Feb 10, 2020
examples_test.go refactor(writers): move buffered writing and periodic batching into w… Sep 19, 2019
go.mod
go.sum refactor(writers): move buffered writing and periodic batching into w… Sep 19, 2019
http.go Initial client work (#1) Apr 23, 2019
models.go Initial client work (#1) Apr 23, 2019
models_test.go Initial client work (#1) Apr 23, 2019
query.go fix: Treat empty string as missing data when marshalling into maps, a… Dec 11, 2019
query_test.go fix: Treat empty string as missing data when marshalling into maps, a… Dec 11, 2019
setup.go chore(client): refactor New Client function (#19) Sep 19, 2019
useragent.go Initial client work (#1) Apr 23, 2019
write.go feat: Retry writer should split too-big payloads Feb 10, 2020
write_test.go feat: Retry writer should split too-big payloads Feb 10, 2020

README.md

influxdb-client-go

A home for InfluxDB’s 2.x's golang client. This client is not compatible with InfluxDB 1.x--if you are looking for the 1.x golang client you can find it here.

Example:

influx, err := influxdb.New(myHTTPInfluxAddress, myToken, influxdb.WithHTTPClient(myHTTPClient))
if err != nil {
	panic(err) // error handling here; normally we wouldn't use fmt but it works for the example
}

// we use client.NewRowMetric for the example because it's easy, but if you need extra performance
// it is fine to manually build the []client.Metric{}.
myMetrics := []influxdb.Metric{
	influxdb.NewRowMetric(
		map[string]interface{}{"memory": 1000, "cpu": 0.93},
		"system-metrics",
		map[string]string{"hostname": "hal9000"},
		time.Date(2018, 3, 4, 5, 6, 7, 8, time.UTC)),
	influxdb.NewRowMetric(
		map[string]interface{}{"memory": 1000, "cpu": 0.93},
		"system-metrics",
		map[string]string{"hostname": "hal9000"},
		time.Date(2018, 3, 4, 5, 6, 7, 9, time.UTC)),
}

// The actual write..., this method can be called concurrently.
if _, err := influx.Write(context.Background(), "my-awesome-bucket", "my-very-awesome-org", myMetrics...); err != nil {
	log.Fatal(err) // as above use your own error handling here.
}
influx.Close() // closes the client.  After this the client is useless.

Releases

We will be using git-flow style releases, the current stable release will be listed in the master readme.

Requirements

influxdb-client-go requires go version 1.12 or newer to build.

You can’t perform that action at this time.