Skip to content

System.Diagnostics.Activity out of proc monitoring can't access Activity Events or Links #102924

@CodeBlanch

Description

@CodeBlanch

We have DiagnosticSourceEventSource which enables listening to Activity \ traces out of process.

DiagnosticSourceEventSource supports an argument FilterAndPayloadSpecs which can be used to configure the events and payload which will be written to the source. Example:

[AS]MyActivitySource/Stop:-TraceId;SpanId;ParentSpanId;ActivityTraceFlags;Kind;DisplayName;StartTimeTicks=StartTimeUtc.Ticks;DurationTicks=Duration.Ticks;Status;StatusDescription;Tags=TagObjects.*Enumerate;ActivitySourceVersion=Source.Version

Tags=TagObjects.*Enumerate; works for retrieving tags.

But this...

Events=Events.*Enumerate;Links=Links.*Enumerate;

...won't work for retrieving Events and/or Links.

The reason it doesn't work is ActivityEvent and ActivityLink structs don't provide a suitable ToString implementation which is how the data gets serialized:

The solution could be to implement more useful ToString operations or provide some other way to include that data via the FilterAndPayloadSpecs. ToString could be tricky for ActivityEvent because it contains its own tag collection.

/cc @noahfalk @tarekgh @samsp-msft

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions