Skip to content

Commit

Permalink
[exporter/syslog] Enable component (#28902)
Browse files Browse the repository at this point in the history
**Description:** Promote syslogexporter to alpha and add it to
otelcontribcol

**Link to tracking Issue:**  related to: #21242, #21244, #21245

**Testing:** <Describe what testing was performed and which tests were
added.>
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"}
```
  • Loading branch information
kasia-kujawa authored Nov 9, 2023
1 parent 320eff4 commit b716a4d
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 4 deletions.
27 changes: 27 additions & 0 deletions .chloggen/enable_syslog_exporter.yaml
Original file line number Diff line number Diff line change
@@ -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: []
2 changes: 2 additions & 0 deletions cmd/otelcontribcol/builder-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions cmd/otelcontribcol/components.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions cmd/otelcontribcol/exporters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions cmd/otelcontribcol/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions cmd/oteltestbedcol/builder-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions cmd/oteltestbedcol/components.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions cmd/oteltestbedcol/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions exporter/syslogexporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<!-- status autogenerated section -->
| 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
<!-- end autogenerated section -->

The Syslog exporter sends logs in [syslog][syslog_wikipedia] format to a remote syslog server.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion exporter/syslogexporter/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ type: syslog
status:
class: exporter
stability:
development: [logs]
alpha: [logs]
codeowners:
active: [kkujawa-sumo, rnishtala-sumo, astencel-sumo]

0 comments on commit b716a4d

Please sign in to comment.