func NewClient(logger log.Logger, conf influx.HTTPConfig, db string, rp string) *Client {
	c, err := influx.NewHTTPClient(conf)
	// Currently influx.NewClient() *should* never return an error.
	if err != nil {
		level.Error(logger).Log("err", err)
		os.Exit(1)
	}

	if logger == nil {
		logger = log.NewNopLogger()
	}

	return &Client{
		logger:          logger,
		client:          c,
		database:        db,
		retentionPolicy: rp,
		ignoredSamples: prometheus.NewCounter(
			prometheus.CounterOpts{
				Name: "prometheus_influxdb_ignored_samples_total",
				Help: "The total number of samples not sent to InfluxDB due to unsupported float values (Inf, -Inf, NaN).",
			},
		),
	}
}
func NewClient(logger log.Logger, conf influx.HTTPConfig, db string, rp string) *Client {
	c, err := influx.NewHTTPClient(conf)
	
	if err != nil {
		level.Error(logger).Log("err", err)
		os.Exit(1)
	}

	if logger == nil {
		logger = log.NewNopLogger()
	}

	return &Client{
		logger:          logger,
		client:          c,
		database:        db,
		retentionPolicy: rp,
		ignoredSamples: prometheus.NewCounter(
			prometheus.CounterOpts{
				Name: "prometheus_influxdb_ignored_samples_total",
				Help: "The total number of samples not sent to InfluxDB due to unsupported float values (Inf, -Inf, NaN).",
			},
		),
	}
}
func NewClient ( logger log . Logger , conf influx . HTTPConfig , db string , rp string ) * Client { c , err := influx . NewHTTPClient ( conf ) // Currently influx.NewClient() *should* never return an error. if err != nil { level . Error ( logger ) . Log ( " " , err ) os . Exit ( 1 ) } if logger == nil { logger = log . NewNopLogger ( ) } return & Client { logger : logger , client : c , database : db , retentionPolicy : rp , ignoredSamples : prometheus . NewCounter ( prometheus . CounterOpts { Name : " " , Help : " " , } , ) , } }
// NewClient creates a new Client.
NewClient creates a new Client .