Skip to content

Commit 21d8dd0

Browse files
[exporter/datasetexporter]: Call the currect function on shutdown (#24255)
**Description:** Call the correct function on shutdown After we have changed the underlying library we haven't updated the exporter code to call the correct function. This PR is fixing this. **Link to tracking Issue:** #24253 **Testing:** 1. Run open telemetry collector 2. Terminate it - `docker kill --signal SIGTERM ...` 3. Observe logs: ``` 2023-07-13T11:30:54.191Z info otelcol/collector.go:236 Received signal from OS {"signal": "terminated"} 2023-07-13T11:30:54.191Z info service/service.go:157 Starting shutdown... 2023-07-13T11:30:54.191Z info adapter/receiver.go:139 Stopping stanza receiver {"kind": "receiver", "name": "filelog/log", "data_type": "logs"} ... ... 2023-07-13T11:31:00.917Z info client/client.go:387 Buffers' Queue Stats: {"kind": "exporter", "data_type": "logs", "name": "dataset/logs", "processed": 32, "enqueued": 32, "dropped": 0, "waiting": 0, "processingS": 24.727153498} 2023-07-13T11:31:00.919Z info client/client.go:399 Events' Queue Stats: {"kind": "exporter", "data_type": "logs", "name": "dataset/logs", "processed": 200005, "enqueued": 200005, "waiting": 0, "processingS": 24.727153498} 2023-07-13T11:31:00.919Z info client/client.go:413 Transfer Stats: {"kind": "exporter", "data_type": "logs", "name": "dataset/logs", "bytesSentMB": 150.06610584259033, "bytesAcceptedMB": 150.06610584259033, "throughputMBpS": 6.068879131385992, "perBufferMB": 4.689565807580948, "successRate": 1, "processingS": 24.727153498, "processing": 24.727153498} 2023-07-13T11:31:00.919Z info client/add_events.go:294 Finishing with success {"kind": "exporter", "data_type": "logs", "name": "dataset/logs"} 2023-07-13T11:31:00.919Z info extensions/extensions.go:44 Stopping extensions... 2023-07-13T11:31:00.919Z info service/service.go:171 Shutdown complete. ``` **Documentation:** There is no change in the documentation needed.
1 parent be286ca commit 21d8dd0

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Use this changelog template to create an entry for release notes.
2+
# If your change doesn't affect end users, such as a test fix or a tooling change,
3+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
4+
5+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
6+
change_type: bug_fix
7+
8+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
9+
component: datasetexporter
10+
11+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
12+
note: Call the correct library function then exporter is shutting down.
13+
14+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
15+
issues: [24253]
16+
17+
# (Optional) One or more lines of additional information to render under the primary note.
18+
# These lines will be padded with 2 spaces and then inserted directly into the document.
19+
# Use pipe (|) for multiline entries.
20+
subtext:

exporter/datasetexporter/datasetexporter.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ func newDatasetExporter(entity string, config *Config, set exporter.CreateSettin
6767
}
6868

6969
func (e *DatasetExporter) shutdown(context.Context) error {
70-
e.client.SendAllAddEventsBuffers()
71-
return nil
70+
return e.client.Shutdown()
7271
}
7372

7473
func sendBatch(events []*add_events.EventBundle, client *client.DataSetClient) error {

0 commit comments

Comments
 (0)