open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
3.11k stars 2.39k forks source link

syslogreceiver doesn't add resources #31849

Closed ubcharron closed 8 months ago

ubcharron commented 8 months ago

Component(s)

receiver/syslog

What happened?

Description

According to the doc, the syslog receiver can add resources to every incoming syslog via the "resource" key:

Field: resource
Default value: []
Description: A map of key: value labels to add to the entry's resource

However, it doesn't seem to actually add them.

Steps to Reproduce

Setup syslog receiver:

receivers:
  syslog:
    resource:
      mytag: myvalue
    udp:
      listen_address: "127.0.0.1:514"
    protocol: rfc3164

Send a syslog message:

logger -d fdkskjsdf --server=localhost --rfc3164

Expected Result

The ResourceLog should have a resource attribute "mytag" with the value "myvalue".

Actual Result

The ResourceLog does not have any resource attributes.

Collector version

0.96.0

Environment information

Environment

OS: Ubuntu LTS

OpenTelemetry Collector configuration

receivers:
  syslog:
    resource:
      mytag: myvalue
    udp:
      listen_address: "127.0.0.1:514"
    protocol: rfc3164

exporters:
  debug:
    verbosity: detailed

service:
  pipelines:
    logs:
      receivers: [syslog]
      exporters: [debug]

Log output

2024-03-20T15:19:22.572Z        info    LogsExporter    {"kind": "exporter", "data_type": "logs", "name": "debug", "resource logs": 1, "log records": 1}
2024-03-20T15:19:22.572Z        info    ResourceLog #0
Resource SchemaURL:
ScopeLogs #0
ScopeLogs SchemaURL:
InstrumentationScope
LogRecord #0
ObservedTimestamp: 2024-03-20 15:19:22.568639715 +0000 UTC
Timestamp: 2024-03-20 15:19:22 +0000 UTC
SeverityText: notice
SeverityNumber: Info2(10)
Body: Str(<13>Mar 20 15:19:22 bcharron-wks-2 bcharron: fdkskjsdf)
Attributes:
     -> hostname: Str(bcharron-wks-2)
     -> facility: Int(1)
     -> appname: Str(bcharron)
     -> message: Str(fdkskjsdf)
     -> priority: Int(13)
Trace ID:
Span ID:
Flags: 0
        {"kind": "exporter", "data_type": "logs", "name": "debug"}

Additional context

No response

github-actions[bot] commented 8 months ago

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.