Skip to content

OpenTracing message field gets overridden by default "Span event" message in some cases #522

Description

@JessicaYeh

Describe what happened
In a log event that's attached to a span in a trace, when I set the OpenTracing message field Fields.MESSAGE and also set Fields.EVENT and Fields.ERROR_KIND, the Fields.MESSAGE value gets overridden with the default "Span event" message. When I only set Fields.MESSAGE and did not set Fields.EVENT and Fields.ERROR_KIND, the message was properly set.

Steps to reproduce the issue:

Message DOES NOT get set with the following:

HashMap propertiesWithOpenTracingInfo = properties.toHashMap();
propertiesWithOpenTracingInfo.put(Fields.EVENT, "error");
propertiesWithOpenTracingInfo.put(Fields.ERROR_KIND, errorKind);
propertiesWithOpenTracingInfo.put(Fields.MESSAGE, message);
span.log(propertiesWithOpenTracingInfo);

Message IS correctly set with the following:

HashMap propertiesWithOpenTracingInfo = properties.toHashMap();
propertiesWithOpenTracingInfo.put(Fields.MESSAGE, message);
span.log(propertiesWithOpenTracingInfo);

Describe what you expected:

On DataDog's website in Log Explorer, the message should be the message that I passed, i.e. network request error. But it is replaced with Span event, but only when I set other fields, i.e. in order to mark it as an error log.

Additional context

  • Android OS version: 11
  • Device Model: Samsung Galaxy S20
  • Datadog SDK version: 1.7.1
  • Versions of any other relevant dependencies (OkHttp, …):
  • Proguard configuration:
  • Gradle Plugins:

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingfixed

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions