github.com/yankunsam/loki/v2@v2.6.3-0.20220817130409-389df5235c27/clients/cmd/fluent-bit/client.go (about) 1 package main 2 3 import ( 4 "github.com/go-kit/log" 5 6 "github.com/grafana/loki/clients/pkg/promtail/client" 7 ) 8 9 // NewClient creates a new client based on the fluentbit configuration. 10 func NewClient(cfg *config, logger log.Logger, metrics *client.Metrics, streamLagLabels []string) (client.Client, error) { 11 if cfg.bufferConfig.buffer { 12 return NewBuffer(cfg, logger, metrics, streamLagLabels) 13 } 14 return client.New(metrics, cfg.clientConfig, streamLagLabels, logger) 15 }