# Google.Cloud.Diagnostics.Common - Interface ITraceContext (5.3.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [5.3.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common.ITraceContext)
- [5.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/5.2.0/Google.Cloud.Diagnostics.Common.ITraceContext)
- [5.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/5.1.0/Google.Cloud.Diagnostics.Common.ITraceContext)
- [5.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/5.0.0/Google.Cloud.Diagnostics.Common.ITraceContext)
- [4.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/4.4.0/Google.Cloud.Diagnostics.Common.ITraceContext)
- [4.3.1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/4.3.1/Google.Cloud.Diagnostics.Common.ITraceContext)

    public interface ITraceContext

Reference documentation and code samples for the Google.Cloud.Diagnostics.Common interface ITraceContext.

A trace context.

## Namespace

[Google.Cloud.Diagnostics.Common](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common)

## Assembly

Google.Cloud.Diagnostics.Common.dll

## Properties

### ShouldTrace

    bool? ShouldTrace { get; }

Whether this request should be traced or not.
May be null, which means that there's not enough information to know
whether this request should be traced or not.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### SpanId

    ulong? SpanId { get; }

The span id or null if none is available.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.uint64` |   |

**Remarks** This corresponds to the span_id field of the TraceSpan message in the API.
See <https://cloud.google.com/trace/docs/reference/v2/rpc/google.devtools.cloudtrace.v1#tracespan>
for more information.

### TraceId

    string TraceId { get; }

The trace id or null if none is available.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

**Remarks** This corresponds to the trace_id field of the Trace message in the API.
See <https://cloud.google.com/trace/docs/reference/v2/rpc/google.devtools.cloudtrace.v1#trace>
for more information.