Skip to content

Commit

Permalink
only serialise if set
Browse files Browse the repository at this point in the history
  • Loading branch information
richardelms committed Sep 25, 2024
1 parent bbbf3bc commit 54fe43b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ private string GetNanoSeconds(DateTimeOffset time)
var duration = time - _unixStart;
return (duration.Ticks * 100).ToString();
}

// This method tells Json.NET whether to serialize the droppedAttributesCount or not.
public bool ShouldSerializedroppedAttributesCount()
{
return droppedAttributesCount > 0;
}
}

}
2 changes: 1 addition & 1 deletion features/manual_spans.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Feature: Manual creation of spans
* the trace payload field "resourceSpans.0.scopeSpans.0.spans.0.endTimeUnixNano" matches the regex "^[0-9]+$"
* the trace payload field "resourceSpans.0.scopeSpans.0.spans.0" string attribute "net.host.connection.type" equals "wifi"
* the trace payload field "resourceSpans.0.scopeSpans.0.spans.0" string attribute "bugsnag.span.category" equals "custom"
* the trace payload field "resourceSpans.0.scopeSpans.0.spans.0.droppedAttributesCount" equals 0
* the trace payload field "resourceSpans.0.scopeSpans.0.spans.0.droppedAttributesCount" is null

#Resource attributes
* the trace payload field "resourceSpans.0.resource" string attribute "deployment.environment" is one of:
Expand Down

0 comments on commit 54fe43b

Please sign in to comment.