Skip to content

Commit

Permalink
chore: add Deprecated comment for Influx v1
Browse files Browse the repository at this point in the history
InfluxDB v1 metric client is deprecated.
  • Loading branch information
shallowclouds committed Jan 3, 2021
1 parent f543446 commit 10209ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ type Target struct {
}

type configStruct struct {
Hostname string `yaml:"Hostname"`
Hostname string `yaml:"Hostname"`
// Deprecated: InfluxDB 1.* sever configs.
InfluxDBv1 struct {
Addr string `yaml:"Addr"`
Username string `yaml:"Username"`
Password string `yaml:"Password"`
Database string `yaml:"Database"`
} `yaml:"InfluxDBv1"`
// InfluxDB 2.* sever configs.
InfluxDBv2 struct {
Addr string `yaml:"Addr"`
Org string `yaml:"Org"`
Expand Down
3 changes: 2 additions & 1 deletion influxdb/influx.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/sirupsen/logrus"
)

// Client sends data points to InfluxDB v1.* server asynchronously.
// Deprecated: Client sends data points to InfluxDB v1.* server asynchronously.
type Client struct {
influxCli client.Client
wg sync.WaitGroup
Expand All @@ -23,6 +23,7 @@ const (
DefaultConsumerCount = 1
)

// Deprecated: NewAsyncClient creates an async client to send data points to InfluxDB server.
func NewAsyncClient(addr, db, username, password string) (*Client, error) {
cli, err := client.NewHTTPClient(client.HTTPConfig{
Addr: addr,
Expand Down

0 comments on commit 10209ed

Please sign in to comment.