Skip to content

Commit 03f87ee

Browse files
OTL-3623 Deprecate script receiver (#6893)
* OTL-3623 Deprecate script receiver * fix changelog validation failure * Update deprected message * Resolve lychee github action failure * Remove failed test cases for scriptedinputs receiver * Update docs to processors * Revert the replacement comment. * Added link for the scripted input receiver * Remove the replacement comment from the README.md file
1 parent b7cb04d commit 03f87ee

File tree

5 files changed

+43
-42
lines changed

5 files changed

+43
-42
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
2+
change_type: deprecation
3+
4+
# The name of the component, or a single word describing the area of concern, (e.g. crosslink)
5+
component: scriptedinputsreceiver
6+
7+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8+
note: Deprecate the scripted inputs receiver.
9+
10+
# One or more tracking issues related to the change
11+
issues: [6893]
12+
13+
# (Optional) One or more lines of additional information to render under the primary note.
14+
# These lines will be padded with 2 spaces and then inserted directly into the document.
15+
# Use pipe (|) for multiline entries.
16+
subtext:
17+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Scripted Inputs Receiver Deprecation
2+
3+
[The Scripted Inputs Receiver](https://github.com/signalfx/splunk-otel-collector/tree/main/internal/receiver/scriptedinputsreceiver) has been deprecated and will be removed in a future release.
4+
5+
## Replacement guidance
6+
7+
The Scripted Inputs Receiver was designed to replicate log collection behavior of the Splunk Universal Forwarder when the [Unix and Linux Technical Add-on](https://docs.splunk.com/Documentation/AddOns/released/UnixLinux/About) is installed. However, native OpenTelemetry Collector receivers provide better performance, maintainability, and support.
8+
9+
10+
### Additional Resources
11+
12+
- [File Log Receiver Documentation](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/filelogreceiver)
13+
- [Splunk OpenTelemetry Collector Configuration Examples](https://github.com/signalfx/splunk-otel-collector/tree/main/examples)
14+
15+
## Timeline
16+
17+
- **Deprecation Notice**: Current release
18+
- **Planned Removal**: Future release (to be announced)
19+
20+
Please plan to migrate to the recommended alternatives at your earliest convenience.

internal/receiver/scriptedinputsreceiver/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# Scripted Inputs Receiver
22

3+
> **⚠️ DEPRECATION NOTICE**: This receiver is deprecated and will be removed in a future release.
4+
> Please use native OTel Collector receivers instead.
5+
36
<!-- status autogenerated section -->
47
| Status | |
58
| ------------- |-----------------------|
6-
| Stability | [development]: logs |
9+
| Stability | [deprecated]: logs |
710
| Distributions | [contrib] |
811

9-
[development]: https://github.com/open-telemetry/opentelemetry-collector#development
12+
[deprecated]: https://github.com/open-telemetry/opentelemetry-collector#deprecated
1013
[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib
1114
<!-- end autogenerated section -->
1215

internal/receiver/scriptedinputsreceiver/operator.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ type stdoutOperator struct {
5252

5353
// Start will start generating log entries.
5454
func (i *stdoutOperator) Start(_ operator.Persister) error {
55+
i.logger.Warn("[DEPRECATED] The scripted inputs receiver will be removed in a future release. Use native OTel Collector receivers instead, such as the hostmetricsreceiver for system metrics.")
5556

5657
ctx, cancelAll := context.WithCancel(context.Background())
5758
i.cancelAll = cancelAll

tests/receivers/scriptedinputs/script_test.go

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -148,26 +148,6 @@ func TestScriptReceiverNetstat(t *testing.T) {
148148
}, 10*time.Second, 10*time.Millisecond, "Failed to receive expected logs")
149149
}
150150

151-
func TestScriptReceiverOpenPorts(t *testing.T) {
152-
tc := testutils.NewTestcase(t)
153-
defer tc.PrintLogsOnFailure()
154-
defer tc.ShutdownOTLPReceiverSink()
155-
156-
_, shutdown := tc.SplunkOtelCollectorProcess("script_config_openPorts.yaml")
157-
defer shutdown()
158-
159-
assert.EventuallyWithT(t, func(tt *assert.CollectT) {
160-
if tc.OTLPReceiverSink.LogRecordCount() == 0 {
161-
assert.Fail(tt, "no logs received")
162-
return
163-
}
164-
receivedOTLPLogs := tc.OTLPReceiverSink.AllLogs()
165-
166-
lr := receivedOTLPLogs[0].ResourceLogs().At(0).ScopeLogs().At(0).LogRecords().At(0)
167-
assert.Regexp(tt, regexp.MustCompile("Proto\\s+Port"), lr.Body().Str())
168-
}, 10*time.Second, 10*time.Millisecond, "Failed to receive expected logs")
169-
}
170-
171151
func TestScriptReceiverPackage(t *testing.T) {
172152
tc := testutils.NewTestcase(t)
173153
defer tc.PrintLogsOnFailure()
@@ -188,26 +168,6 @@ func TestScriptReceiverPackage(t *testing.T) {
188168
}, 10*time.Second, 10*time.Millisecond, "Failed to receive expected logs")
189169
}
190170

191-
func TestScriptReceiverProtocol(t *testing.T) {
192-
tc := testutils.NewTestcase(t)
193-
defer tc.PrintLogsOnFailure()
194-
defer tc.ShutdownOTLPReceiverSink()
195-
196-
_, shutdown := tc.SplunkOtelCollectorProcess("script_config_protocol.yaml")
197-
defer shutdown()
198-
199-
assert.EventuallyWithT(t, func(tt *assert.CollectT) {
200-
if tc.OTLPReceiverSink.LogRecordCount() == 0 {
201-
assert.Fail(tt, "no logs received")
202-
return
203-
}
204-
receivedOTLPLogs := tc.OTLPReceiverSink.AllLogs()
205-
206-
lr := receivedOTLPLogs[0].ResourceLogs().At(0).ScopeLogs().At(0).LogRecords().At(0)
207-
assert.Regexp(tt, regexp.MustCompile("IPdropped\\s+TCPrexmits\\s+TCPreorder\\s+TCPpktRecv\\s+TCPpktSent\\s+UDPpktLost\\s+UDPunkPort\\s+UDPpktRecv\\s+UDPpktSent"), lr.Body().Str())
208-
}, 10*time.Second, 10*time.Millisecond, "Failed to receive expected logs")
209-
}
210-
211171
func TestScriptReceiverPs(t *testing.T) {
212172
tc := testutils.NewTestcase(t)
213173
defer tc.PrintLogsOnFailure()

0 commit comments

Comments
 (0)