Table of Contents

Class CdcActivitySource

Namespace
Excalibur.Cdc.Diagnostics
Assembly
Excalibur.Cdc.dll

Provides centralized activity source for CDC (Change Data Capture) tracing operations.

public static class CdcActivitySource
Inheritance
CdcActivitySource
Inherited Members

Remarks

This class provides static helper methods for creating OpenTelemetry activity spans for CDC operations. All CDC provider packages (SqlServer, Postgres, MongoDB, CosmosDb, DynamoDb, Firestore) should use these constants and helpers for consistent telemetry.

Activity creation depends on listeners and their sampling decisions. Start helpers return null when no activity is created and skip their activity-tag updates in that case. This does not guarantee zero allocation for callers or initialization.

Fields

Name

The activity source name for CDC tracing.

public const string Name = "Excalibur.Cdc"

Field Value

string

Properties

Instance

The activity source instance for CDC operations. Process-lifetime singleton -- do not dispose.

public static ActivitySource Instance { get; }

Property Value

ActivitySource

Methods

StartApplyChangeActivity(string, string)

Starts an activity for applying a single CDC change.

public static Activity? StartApplyChangeActivity(string provider, string changeType)

Parameters

provider string

The CDC provider name.

changeType string

The type of change (insert, update, delete).

Returns

Activity

StartCheckpointActivity(string)

Starts an activity for saving a CDC checkpoint.

public static Activity? StartCheckpointActivity(string provider)

Parameters

provider string

The CDC provider name.

Returns

Activity

StartPollActivity(string)

Starts an activity for a CDC polling cycle.

public static Activity? StartPollActivity(string provider)

Parameters

provider string

The CDC provider name (e.g., "Postgres", "MongoDB").

Returns

Activity

StartProcessBatchActivity(string, int)

Starts an activity for processing a batch of CDC changes.

public static Activity? StartProcessBatchActivity(string provider, int batchSize)

Parameters

provider string

The CDC provider name.

batchSize int

The number of changes in the batch.

Returns

Activity