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
Properties
Instance
The activity source instance for CDC operations. Process-lifetime singleton -- do not dispose.
public static ActivitySource Instance { get; }
Property Value
Methods
StartApplyChangeActivity(string, string)
Starts an activity for applying a single CDC change.
public static Activity? StartApplyChangeActivity(string provider, string changeType)
Parameters
providerstringThe CDC provider name.
changeTypestringThe type of change (insert, update, delete).
Returns
StartCheckpointActivity(string)
Starts an activity for saving a CDC checkpoint.
public static Activity? StartCheckpointActivity(string provider)
Parameters
providerstringThe CDC provider name.
Returns
StartPollActivity(string)
Starts an activity for a CDC polling cycle.
public static Activity? StartPollActivity(string provider)
Parameters
providerstringThe CDC provider name (e.g., "Postgres", "MongoDB").
Returns
StartProcessBatchActivity(string, int)
Starts an activity for processing a batch of CDC changes.
public static Activity? StartProcessBatchActivity(string provider, int batchSize)