Skip to content

[API Proposal]: ActivityTraceFlags.RandomTraceId flag #124509

@Kielek

Description

@Kielek

Background and motivation

Needed to comply with new OpenTelemetry specification requirements released as v1.52.0. It was marked as mandatory under open-telemetry/opentelemetry-specification#4761.

RandomTraceId definition is availab;e on W3C page.

It is also needed for open-telemetry/opentelemetry-dotnet#6768

API Proposal

namespace System.Diagnostics;

    [Flags]
    public enum ActivityTraceFlags
    {
        None = 0b_0_0000000,
        Recorded = 0b_0_0000001, 
+       RandomTraceId = 0b_0_0000010, // 2
    }

    public partial class Activity : IDisposable
    {
+       public bool RandomizedTraceId { get { throw null; } }
    }

API Usage

N/A

Alternative Designs

No response

Risks

Needed to modify also the way how traceId/flags are created by the Activity class.
Worth to double check if System.Diagnostics.W3CPropagator will be able to handle correctly new flag.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions