diff --git a/cmd/checkapi/allowlist.txt b/cmd/checkapi/allowlist.txt index 5bdd40d99f0a..ad42bea9c067 100644 --- a/cmd/checkapi/allowlist.txt +++ b/cmd/checkapi/allowlist.txt @@ -1,5 +1,4 @@ connector/servicegraphconnector -exporter/alibabacloudlogserviceexporter exporter/awscloudwatchlogsexporter exporter/awskinesisexporter exporter/azuremonitorexporter diff --git a/exporter/alibabacloudlogserviceexporter/logs_exporter.go b/exporter/alibabacloudlogserviceexporter/logs_exporter.go index f096700e2a6e..ce426d14bd36 100644 --- a/exporter/alibabacloudlogserviceexporter/logs_exporter.go +++ b/exporter/alibabacloudlogserviceexporter/logs_exporter.go @@ -21,7 +21,7 @@ func newLogsExporter(set exporter.CreateSettings, cfg component.Config) (exporte } var err error - if l.client, err = NewLogServiceClient(cfg.(*Config), set.Logger); err != nil { + if l.client, err = newLogServiceClient(cfg.(*Config), set.Logger); err != nil { return nil, err } @@ -34,7 +34,7 @@ func newLogsExporter(set exporter.CreateSettings, cfg component.Config) (exporte type logServiceLogsSender struct { logger *zap.Logger - client LogServiceClient + client logServiceClient } func (s *logServiceLogsSender) pushLogsData( @@ -43,7 +43,7 @@ func (s *logServiceLogsSender) pushLogsData( var err error slsLogs := logDataToLogService(md) if len(slsLogs) > 0 { - err = s.client.SendLogs(slsLogs) + err = s.client.sendLogs(slsLogs) } return err } diff --git a/exporter/alibabacloudlogserviceexporter/metrics_exporter.go b/exporter/alibabacloudlogserviceexporter/metrics_exporter.go index 7df0e5a6972b..4381aeabf1ec 100644 --- a/exporter/alibabacloudlogserviceexporter/metrics_exporter.go +++ b/exporter/alibabacloudlogserviceexporter/metrics_exporter.go @@ -21,7 +21,7 @@ func newMetricsExporter(set exporter.CreateSettings, cfg component.Config) (expo } var err error - if l.client, err = NewLogServiceClient(cfg.(*Config), set.Logger); err != nil { + if l.client, err = newLogServiceClient(cfg.(*Config), set.Logger); err != nil { return nil, err } @@ -34,7 +34,7 @@ func newMetricsExporter(set exporter.CreateSettings, cfg component.Config) (expo type logServiceMetricsSender struct { logger *zap.Logger - client LogServiceClient + client logServiceClient } func (s *logServiceMetricsSender) pushMetricsData( @@ -44,7 +44,7 @@ func (s *logServiceMetricsSender) pushMetricsData( var err error logs := metricsDataToLogServiceData(s.logger, md) if len(logs) > 0 { - err = s.client.SendLogs(logs) + err = s.client.sendLogs(logs) } return err } diff --git a/exporter/alibabacloudlogserviceexporter/trace_exporter.go b/exporter/alibabacloudlogserviceexporter/trace_exporter.go index 498385ff85cf..972e83bc1cd6 100644 --- a/exporter/alibabacloudlogserviceexporter/trace_exporter.go +++ b/exporter/alibabacloudlogserviceexporter/trace_exporter.go @@ -21,7 +21,7 @@ func newTracesExporter(set exporter.CreateSettings, cfg component.Config) (expor } var err error - if l.client, err = NewLogServiceClient(cfg.(*Config), set.Logger); err != nil { + if l.client, err = newLogServiceClient(cfg.(*Config), set.Logger); err != nil { return nil, err } @@ -34,7 +34,7 @@ func newTracesExporter(set exporter.CreateSettings, cfg component.Config) (expor type logServiceTraceSender struct { logger *zap.Logger - client LogServiceClient + client logServiceClient } func (s *logServiceTraceSender) pushTraceData( @@ -44,7 +44,7 @@ func (s *logServiceTraceSender) pushTraceData( var err error slsLogs := traceDataToLogServiceData(td) if len(slsLogs) > 0 { - err = s.client.SendLogs(slsLogs) + err = s.client.sendLogs(slsLogs) } return err } diff --git a/exporter/alibabacloudlogserviceexporter/uploader.go b/exporter/alibabacloudlogserviceexporter/uploader.go index 49b3c7a3fd1c..f84d37ce406e 100644 --- a/exporter/alibabacloudlogserviceexporter/uploader.go +++ b/exporter/alibabacloudlogserviceexporter/uploader.go @@ -14,10 +14,10 @@ import ( "go.uber.org/zap" ) -// LogServiceClient log Service's client wrapper -type LogServiceClient interface { - // SendLogs send message to LogService - SendLogs(logs []*sls.Log) error +// logServiceClient log Service's client wrapper +type logServiceClient interface { + // sendLogs send message to LogService + sendLogs(logs []*sls.Log) error } type logServiceClientImpl struct { @@ -41,8 +41,8 @@ func getIPAddress() (ipAddress string, err error) { return ipAddress, err } -// NewLogServiceClient Create Log Service client -func NewLogServiceClient(config *Config, logger *zap.Logger) (LogServiceClient, error) { +// newLogServiceClient Create Log Service client +func newLogServiceClient(config *Config, logger *zap.Logger) (logServiceClient, error) { if config == nil || config.Endpoint == "" || config.Project == "" || config.Logstore == "" { return nil, errors.New("missing logservice params: Endpoint, Project, Logstore") } @@ -71,8 +71,8 @@ func NewLogServiceClient(config *Config, logger *zap.Logger) (LogServiceClient, return c, nil } -// SendLogs send message to LogService -func (c *logServiceClientImpl) SendLogs(logs []*sls.Log) error { +// sendLogs send message to LogService +func (c *logServiceClientImpl) sendLogs(logs []*sls.Log) error { return c.clientInstance.SendLogListWithCallBack(c.project, c.logstore, c.topic, c.source, logs, c) }