Skip to content

Commit f94a24d

Browse files
authored
[exporter/alibabacloudlogservice] do not expose method (#26383)
**Description:** Remove exposed function, only keep NewFactory to pass checkapi **Link to tracking Issue:** #26304
1 parent e6e5f54 commit f94a24d

File tree

6 files changed

+44
-18
lines changed

6 files changed

+44
-18
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: breaking
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: alibabacloudlogserviceexporter
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Do not export the function `NewLogServiceClient`
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [26304]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: [api]

cmd/checkapi/allowlist.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
connector/servicegraphconnector
2-
exporter/alibabacloudlogserviceexporter
32
exporter/awscloudwatchlogsexporter
43
exporter/awskinesisexporter
54
exporter/azuremonitorexporter

exporter/alibabacloudlogserviceexporter/logs_exporter.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func newLogsExporter(set exporter.CreateSettings, cfg component.Config) (exporte
2121
}
2222

2323
var err error
24-
if l.client, err = NewLogServiceClient(cfg.(*Config), set.Logger); err != nil {
24+
if l.client, err = newLogServiceClient(cfg.(*Config), set.Logger); err != nil {
2525
return nil, err
2626
}
2727

@@ -34,7 +34,7 @@ func newLogsExporter(set exporter.CreateSettings, cfg component.Config) (exporte
3434

3535
type logServiceLogsSender struct {
3636
logger *zap.Logger
37-
client LogServiceClient
37+
client logServiceClient
3838
}
3939

4040
func (s *logServiceLogsSender) pushLogsData(
@@ -43,7 +43,7 @@ func (s *logServiceLogsSender) pushLogsData(
4343
var err error
4444
slsLogs := logDataToLogService(md)
4545
if len(slsLogs) > 0 {
46-
err = s.client.SendLogs(slsLogs)
46+
err = s.client.sendLogs(slsLogs)
4747
}
4848
return err
4949
}

exporter/alibabacloudlogserviceexporter/metrics_exporter.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func newMetricsExporter(set exporter.CreateSettings, cfg component.Config) (expo
2121
}
2222

2323
var err error
24-
if l.client, err = NewLogServiceClient(cfg.(*Config), set.Logger); err != nil {
24+
if l.client, err = newLogServiceClient(cfg.(*Config), set.Logger); err != nil {
2525
return nil, err
2626
}
2727

@@ -34,7 +34,7 @@ func newMetricsExporter(set exporter.CreateSettings, cfg component.Config) (expo
3434

3535
type logServiceMetricsSender struct {
3636
logger *zap.Logger
37-
client LogServiceClient
37+
client logServiceClient
3838
}
3939

4040
func (s *logServiceMetricsSender) pushMetricsData(
@@ -44,7 +44,7 @@ func (s *logServiceMetricsSender) pushMetricsData(
4444
var err error
4545
logs := metricsDataToLogServiceData(s.logger, md)
4646
if len(logs) > 0 {
47-
err = s.client.SendLogs(logs)
47+
err = s.client.sendLogs(logs)
4848
}
4949
return err
5050
}

exporter/alibabacloudlogserviceexporter/trace_exporter.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func newTracesExporter(set exporter.CreateSettings, cfg component.Config) (expor
2121
}
2222

2323
var err error
24-
if l.client, err = NewLogServiceClient(cfg.(*Config), set.Logger); err != nil {
24+
if l.client, err = newLogServiceClient(cfg.(*Config), set.Logger); err != nil {
2525
return nil, err
2626
}
2727

@@ -34,7 +34,7 @@ func newTracesExporter(set exporter.CreateSettings, cfg component.Config) (expor
3434

3535
type logServiceTraceSender struct {
3636
logger *zap.Logger
37-
client LogServiceClient
37+
client logServiceClient
3838
}
3939

4040
func (s *logServiceTraceSender) pushTraceData(
@@ -44,7 +44,7 @@ func (s *logServiceTraceSender) pushTraceData(
4444
var err error
4545
slsLogs := traceDataToLogServiceData(td)
4646
if len(slsLogs) > 0 {
47-
err = s.client.SendLogs(slsLogs)
47+
err = s.client.sendLogs(slsLogs)
4848
}
4949
return err
5050
}

exporter/alibabacloudlogserviceexporter/uploader.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ import (
1414
"go.uber.org/zap"
1515
)
1616

17-
// LogServiceClient log Service's client wrapper
18-
type LogServiceClient interface {
19-
// SendLogs send message to LogService
20-
SendLogs(logs []*sls.Log) error
17+
// logServiceClient log Service's client wrapper
18+
type logServiceClient interface {
19+
// sendLogs send message to LogService
20+
sendLogs(logs []*sls.Log) error
2121
}
2222

2323
type logServiceClientImpl struct {
@@ -41,8 +41,8 @@ func getIPAddress() (ipAddress string, err error) {
4141
return ipAddress, err
4242
}
4343

44-
// NewLogServiceClient Create Log Service client
45-
func NewLogServiceClient(config *Config, logger *zap.Logger) (LogServiceClient, error) {
44+
// newLogServiceClient Create Log Service client
45+
func newLogServiceClient(config *Config, logger *zap.Logger) (logServiceClient, error) {
4646
if config == nil || config.Endpoint == "" || config.Project == "" || config.Logstore == "" {
4747
return nil, errors.New("missing logservice params: Endpoint, Project, Logstore")
4848
}
@@ -71,8 +71,8 @@ func NewLogServiceClient(config *Config, logger *zap.Logger) (LogServiceClient,
7171
return c, nil
7272
}
7373

74-
// SendLogs send message to LogService
75-
func (c *logServiceClientImpl) SendLogs(logs []*sls.Log) error {
74+
// sendLogs send message to LogService
75+
func (c *logServiceClientImpl) sendLogs(logs []*sls.Log) error {
7676
return c.clientInstance.SendLogListWithCallBack(c.project, c.logstore, c.topic, c.source, logs, c)
7777
}
7878

0 commit comments

Comments
 (0)