All attributes that the stdout traces logs should be in the OpenTelemetry tracer as well.
Actual Behavior
remoteIp and remotePort are missing in the OpenTelemetry trace.
Stalwart Version
v0.16.x
Installation Method
NixOS
Database Backend
PostgreSQL
Blob Storage
PostgreSQL
Search Engine
PostgreSQL
Directory Backend
Internal
I have reviewed the documentation and FAQ and confirm that my issue is NOT addressed there.
on
I have searched this support forum (open and closed topics) and confirm this is not a duplicate.
on
I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.
Confirmed by looking at the tracing implementation: this is expected given how the OpenTelemetry log exporter is built, and it looks like a gap in that exporter compared to the stdout/text writer.
In the stdout (text) tracer, each log line is built by merging the parent span’s attributes with the event’s own attributes (crates/trc/src/serializers/text.rs, write_keys, which chains span_keys.iter().chain(keys.iter())). The remoteIp/remotePort/listenerId/localPort attributes are set once on the span-start event (e.g. the SMTP connection span), not repeated on every child event like “SMTP EHLO command.” The text writer pulls them in from the parent span, which is why you see them in stdout.
The OpenTelemetry log record builder (crates/common/src/telemetry/tracers/otel.rs, build_log_record) only iterates event.keys, i.e. the attributes attached directly to that specific event, and never looks at event.inner.span’s keys. So any attribute that only exists on the parent span (like remoteIp/remotePort) never makes it into the exported OTel log record’s attributes, only into the OTel span data (attached to the span itself, not each log line).
So functionally: remoteIp/remotePort should still show up as attributes on the enclosing span exported to your collector (the SMTP connection span), just not repeated on each log record/event within that span, unlike the stdout tracer which repeats them per line. If your OTel span exporter is enabled and you check the span for that connection rather than the individual log record, the attributes should be present there.
This isn’t something covered by current published docs as a known limitation, it’s something I found directly in the tracer source code, so I can’t point you to a docs page confirming intended behavior either way.
This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.