From ddc17001040f48a786b86ebcd64996a20ce00089 Mon Sep 17 00:00:00 2001 From: Katarzyna Kujawa <73836361+kkujawa-sumo@users.noreply.github.com> Date: Thu, 9 Nov 2023 11:13:57 +0100 Subject: [PATCH] [exporter/syslog] Enable component (#28902) **Description:** Promote syslogexporter to alpha and add it to otelcontribcol **Link to tracking Issue:** related to: #21242, #21244, #21245 **Testing:** Manual tests: Configuration: ```yaml exporters: syslog: network: tcp port: 514 endpoint: 127.0.0.1 protocol: rfc5424 receivers: filelog: start_at: beginning include: - /Users/kkujawa/git/opentelemetry-collector-contrib/test.txt operators: - type: syslog_parser protocol: rfc5424 service: pipelines: logs: receivers: - filelog exporters: - syslog ``` Logs: ``` ./bin/otelcontribcol_darwin_amd64 --config /Users/kkujawa/git/opentelemetry-collector-contrib/bin/config.yaml 2023-11-06T12:59:31.656+0100 info service@v0.88.1-0.20231026220224-6405e152a2d9/telemetry.go:84 Setting up own telemetry... 2023-11-06T12:59:31.656+0100 info service@v0.88.1-0.20231026220224-6405e152a2d9/telemetry.go:201 Serving Prometheus metrics {"address": ":8888", "level": "Basic"} 2023-11-06T12:59:31.656+0100 info exporter@v0.88.1-0.20231026220224-6405e152a2d9/exporter.go:275 Development component. May change in the future. {"kind": "exporter", "data_type": "logs", "name": "syslog"} 2023-11-06T12:59:31.656+0100 info syslogexporter@v0.88.0/exporter.go:42 Syslog Exporter configured {"kind": "exporter", "data_type": "logs", "name": "syslog", "endpoint": "127.0.0.1", "Protocol": "rfc5424", "port": 514} 2023-11-06T12:59:31.657+0100 info service@v0.88.1-0.20231026220224-6405e152a2d9/service.go:143 Starting otelcontribcol... {"Version": "0.88.0-dev", "NumCPU": 16} 2023-11-06T12:59:31.657+0100 info extensions/extensions.go:33 Starting extensions... 2023-11-06T12:59:31.657+0100 info adapter/receiver.go:45 Starting stanza receiver {"kind": "receiver", "name": "filelog", "data_type": "logs"} 2023-11-06T12:59:31.657+0100 info service@v0.88.1-0.20231026220224-6405e152a2d9/service.go:169 Everything is ready. Begin running and processing data. 2023-11-06T12:59:31.858+0100 info fileconsumer/file.go:263 Started watching file {"kind": "receiver", "name": "filelog", "data_type": "logs", "component": "fileconsumer", "path": "/Users/kkujawa/git/opentelemetry-collector-contrib/test.txt"} ``` --- .chloggen/enable_syslog_exporter.yaml | 27 +++++++++++++++++++ cmd/otelcontribcol/builder-config.yaml | 2 ++ cmd/otelcontribcol/components.go | 2 ++ cmd/otelcontribcol/exporters_test.go | 13 +++++++++ cmd/otelcontribcol/go.mod | 3 +++ cmd/oteltestbedcol/builder-config.yaml | 2 ++ cmd/oteltestbedcol/components.go | 2 ++ cmd/oteltestbedcol/go.mod | 3 +++ exporter/syslogexporter/README.md | 4 +-- .../internal/metadata/generated_status.go | 2 +- exporter/syslogexporter/metadata.yaml | 2 +- 11 files changed, 58 insertions(+), 4 deletions(-) create mode 100755 .chloggen/enable_syslog_exporter.yaml diff --git a/.chloggen/enable_syslog_exporter.yaml b/.chloggen/enable_syslog_exporter.yaml new file mode 100755 index 000000000000..321f20787fba --- /dev/null +++ b/.chloggen/enable_syslog_exporter.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: syslogexporter + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Promote syslogexporter to alpha and add it to otelcontribcol + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [21242, 21244, 21245] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [] diff --git a/cmd/otelcontribcol/builder-config.yaml b/cmd/otelcontribcol/builder-config.yaml index e448db666cd4..8d2bdb02f3b6 100644 --- a/cmd/otelcontribcol/builder-config.yaml +++ b/cmd/otelcontribcol/builder-config.yaml @@ -74,6 +74,7 @@ exporters: - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/skywalkingexporter v0.88.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/splunkhecexporter v0.88.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sumologicexporter v0.88.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/syslogexporter v0.88.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/tanzuobservabilityexporter v0.88.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/tencentcloudlogserviceexporter v0.88.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/zipkinexporter v0.88.0 @@ -407,6 +408,7 @@ replaces: - github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecsobserver => ../../extension/observer/ecsobserver - github.com/open-telemetry/opentelemetry-collector-contrib/processor/remotetapprocessor => ../../processor/remotetapprocessor - github.com/open-telemetry/opentelemetry-collector-contrib/processor/sumologicprocessor => ../../processor/sumologicprocessor + - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/syslogexporter => ../../exporter/syslogexporter # see https://github.com/mattn/go-ieproxy/issues/45 - github.com/mattn/go-ieproxy => github.com/mattn/go-ieproxy v0.0.1 - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest diff --git a/cmd/otelcontribcol/components.go b/cmd/otelcontribcol/components.go index ff3858e0180e..449cd50ad7e3 100644 --- a/cmd/otelcontribcol/components.go +++ b/cmd/otelcontribcol/components.go @@ -65,6 +65,7 @@ import ( skywalkingexporter "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/skywalkingexporter" splunkhecexporter "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/splunkhecexporter" sumologicexporter "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sumologicexporter" + syslogexporter "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/syslogexporter" tanzuobservabilityexporter "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/tanzuobservabilityexporter" tencentcloudlogserviceexporter "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/tencentcloudlogserviceexporter" zipkinexporter "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/zipkinexporter" @@ -365,6 +366,7 @@ func components() (otelcol.Factories, error) { skywalkingexporter.NewFactory(), splunkhecexporter.NewFactory(), sumologicexporter.NewFactory(), + syslogexporter.NewFactory(), tanzuobservabilityexporter.NewFactory(), tencentcloudlogserviceexporter.NewFactory(), zipkinexporter.NewFactory(), diff --git a/cmd/otelcontribcol/exporters_test.go b/cmd/otelcontribcol/exporters_test.go index 0781b5d1dd8e..ea2443a4456f 100644 --- a/cmd/otelcontribcol/exporters_test.go +++ b/cmd/otelcontribcol/exporters_test.go @@ -58,6 +58,7 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/skywalkingexporter" "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/splunkhecexporter" "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sumologicexporter" + "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/syslogexporter" "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/tanzuobservabilityexporter" "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/tencentcloudlogserviceexporter" "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/zipkinexporter" @@ -528,6 +529,18 @@ func TestDefaultExporters(t *testing.T) { }, expectConsumeErr: true, }, + { + exporter: "syslog", + getConfigFn: func() component.Config { + cfg := expFactories["syslog"].CreateDefaultConfig().(*syslogexporter.Config) + cfg.Endpoint = "http://" + endpoint + // disable queue to validate passing the test data synchronously + cfg.QueueSettings.Enabled = false + cfg.RetrySettings.Enabled = false + return cfg + }, + expectConsumeErr: true, + }, { exporter: "tanzuobservability", getConfigFn: func() component.Config { diff --git a/cmd/otelcontribcol/go.mod b/cmd/otelcontribcol/go.mod index 5e5e10b71335..93ceeaa78fb2 100644 --- a/cmd/otelcontribcol/go.mod +++ b/cmd/otelcontribcol/go.mod @@ -50,6 +50,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/exporter/skywalkingexporter v0.88.0 github.com/open-telemetry/opentelemetry-collector-contrib/exporter/splunkhecexporter v0.88.0 github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sumologicexporter v0.88.0 + github.com/open-telemetry/opentelemetry-collector-contrib/exporter/syslogexporter v0.88.0 github.com/open-telemetry/opentelemetry-collector-contrib/exporter/tanzuobservabilityexporter v0.88.0 github.com/open-telemetry/opentelemetry-collector-contrib/exporter/tencentcloudlogserviceexporter v0.88.0 github.com/open-telemetry/opentelemetry-collector-contrib/exporter/zipkinexporter v0.88.0 @@ -1119,6 +1120,8 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/processor/remo replace github.com/open-telemetry/opentelemetry-collector-contrib/processor/sumologicprocessor => ../../processor/sumologicprocessor +replace github.com/open-telemetry/opentelemetry-collector-contrib/exporter/syslogexporter => ../../exporter/syslogexporter + replace github.com/mattn/go-ieproxy => github.com/mattn/go-ieproxy v0.0.1 replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest diff --git a/cmd/oteltestbedcol/builder-config.yaml b/cmd/oteltestbedcol/builder-config.yaml index 351b43f8160a..a20e42e91855 100644 --- a/cmd/oteltestbedcol/builder-config.yaml +++ b/cmd/oteltestbedcol/builder-config.yaml @@ -23,6 +23,7 @@ exporters: - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sapmexporter v0.88.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/signalfxexporter v0.88.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/splunkhecexporter v0.88.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/syslogexporter v0.88.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/zipkinexporter v0.88.0 processors: @@ -71,6 +72,7 @@ replaces: - github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor => ../../processor/attributesprocessor - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver => ../../receiver/carbonreceiver - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/splunkhecexporter => ../../exporter/splunkhecexporter + - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/syslogexporter => ../../exporter/syslogexporter - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter => ../../exporter/prometheusexporter - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/opencensus => ../../pkg/translator/opencensus - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/zipkinexporter => ../../exporter/zipkinexporter diff --git a/cmd/oteltestbedcol/components.go b/cmd/oteltestbedcol/components.go index fe3453ea9c6f..8d4bd79063ef 100644 --- a/cmd/oteltestbedcol/components.go +++ b/cmd/oteltestbedcol/components.go @@ -25,6 +25,7 @@ import ( sapmexporter "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sapmexporter" signalfxexporter "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/signalfxexporter" splunkhecexporter "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/splunkhecexporter" + syslogexporter "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/syslogexporter" zipkinexporter "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/zipkinexporter" pprofextension "github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension" filestorage "github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/filestorage" @@ -90,6 +91,7 @@ func components() (otelcol.Factories, error) { sapmexporter.NewFactory(), signalfxexporter.NewFactory(), splunkhecexporter.NewFactory(), + syslogexporter.NewFactory(), zipkinexporter.NewFactory(), ) if err != nil { diff --git a/cmd/oteltestbedcol/go.mod b/cmd/oteltestbedcol/go.mod index 6c5591e54881..9df8f7be433f 100644 --- a/cmd/oteltestbedcol/go.mod +++ b/cmd/oteltestbedcol/go.mod @@ -11,6 +11,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sapmexporter v0.88.0 github.com/open-telemetry/opentelemetry-collector-contrib/exporter/signalfxexporter v0.88.0 github.com/open-telemetry/opentelemetry-collector-contrib/exporter/splunkhecexporter v0.88.0 + github.com/open-telemetry/opentelemetry-collector-contrib/exporter/syslogexporter v0.88.0 github.com/open-telemetry/opentelemetry-collector-contrib/exporter/zipkinexporter v0.88.0 github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.88.0 github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.88.0 @@ -338,6 +339,8 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbo replace github.com/open-telemetry/opentelemetry-collector-contrib/exporter/splunkhecexporter => ../../exporter/splunkhecexporter +replace github.com/open-telemetry/opentelemetry-collector-contrib/exporter/syslogexporter => ../../exporter/syslogexporter + replace github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter => ../../exporter/prometheusexporter replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/opencensus => ../../pkg/translator/opencensus diff --git a/exporter/syslogexporter/README.md b/exporter/syslogexporter/README.md index 02de6fbf9d3b..fb530780777c 100644 --- a/exporter/syslogexporter/README.md +++ b/exporter/syslogexporter/README.md @@ -3,12 +3,12 @@ | Status | | | ------------- |-----------| -| Stability | [development]: logs | +| Stability | [alpha]: logs | | Distributions | [] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aexporter%2Fsyslog%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aexporter%2Fsyslog) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aexporter%2Fsyslog%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aexporter%2Fsyslog) | | [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@kkujawa-sumo](https://www.github.com/kkujawa-sumo), [@rnishtala-sumo](https://www.github.com/rnishtala-sumo), [@astencel-sumo](https://www.github.com/astencel-sumo) | -[development]: https://github.com/open-telemetry/opentelemetry-collector#development +[alpha]: https://github.com/open-telemetry/opentelemetry-collector#alpha The Syslog exporter sends logs in [syslog][syslog_wikipedia] format to a remote syslog server. diff --git a/exporter/syslogexporter/internal/metadata/generated_status.go b/exporter/syslogexporter/internal/metadata/generated_status.go index 656746c269d2..7b226c8c8706 100644 --- a/exporter/syslogexporter/internal/metadata/generated_status.go +++ b/exporter/syslogexporter/internal/metadata/generated_status.go @@ -8,5 +8,5 @@ import ( const ( Type = "syslog" - LogsStability = component.StabilityLevelDevelopment + LogsStability = component.StabilityLevelAlpha ) diff --git a/exporter/syslogexporter/metadata.yaml b/exporter/syslogexporter/metadata.yaml index 32a6ec860902..35ac5f4da970 100644 --- a/exporter/syslogexporter/metadata.yaml +++ b/exporter/syslogexporter/metadata.yaml @@ -3,6 +3,6 @@ type: syslog status: class: exporter stability: - development: [logs] + alpha: [logs] codeowners: active: [kkujawa-sumo, rnishtala-sumo, astencel-sumo]