TelemetryPublisherRepository
The default IPublisherRepository implementation. JSON-serializes and gzip-compresses telemetry items, then POSTs them to {host}/v1/telemetry/publish, adding an X-API-Key header when an API key is provided.
Creating an Instance
var repository = new TelemetryPublisherRepository(
host: "https://your-collector-host",
apiKey: "YOUR_API_KEY",
errorCallback: ex => logger.LogError(ex, "Publish failed"),
logger: serilogLogger);
Methods
| Name | Description |
|---|---|
| Publish | Publishes a single TelemetryItem. |
| PublishMany | Publishes multiple TelemetryItem objects in one batch. |
The methods above have corresponding
Asyncvariants. Publish failures never throw — they are routed to the optionalerrorCallbackandloggerinstead.
RepoDb.Telemetry.Default uses DefaultTelemetryPublisherRepository, a subclass of this class.