Link Search Menu Expand Document

TelemetryOption


Defines the settings used by TelemetryTrace to capture and publish Telemetry data.

Properties

NameDescription
ApplicationThe name of the application that produces the telemetry. Set via the constructor.
GroupThe group the application is categorized under. Defaults to "Default".
HostThe collector endpoint to publish to. Defaults to http://localhost:5000.
ApiKeyThe API key sent via the X-API-Key header. Leave null if the collector does not require one.
FrequencyHow often the buffered telemetry is flushed. Defaults to 5 seconds.

Creating an Instance

var option = new TelemetryOption("MyApp")
{
    Host = "https://your-collector-host",
    ApiKey = "YOUR_API_KEY",
    Group = "Default",
    Frequency = TimeSpan.FromSeconds(5)
};

RepoDb.Telemetry.Default uses DefaultTelemetryOption, a subclass of this class.