YMJake.Aspire.VictoriaLogs
0.1.0-alpha.1
dotnet add package YMJake.Aspire.VictoriaLogs --version 0.1.0-alpha.1
NuGet\Install-Package YMJake.Aspire.VictoriaLogs -Version 0.1.0-alpha.1
<PackageReference Include="YMJake.Aspire.VictoriaLogs" Version="0.1.0-alpha.1" />
<PackageVersion Include="YMJake.Aspire.VictoriaLogs" Version="0.1.0-alpha.1" />
<PackageReference Include="YMJake.Aspire.VictoriaLogs" />
paket add YMJake.Aspire.VictoriaLogs --version 0.1.0-alpha.1
#r "nuget: YMJake.Aspire.VictoriaLogs, 0.1.0-alpha.1"
#:package YMJake.Aspire.VictoriaLogs@0.1.0-alpha.1
#addin nuget:?package=YMJake.Aspire.VictoriaLogs&version=0.1.0-alpha.1&prerelease
#tool nuget:?package=YMJake.Aspire.VictoriaLogs&version=0.1.0-alpha.1&prerelease
Aspire.VictoriaLogs
Client library that sends an Aspire project's OpenTelemetry logs to VictoriaLogs.
dotnet add package YMJake.Aspire.VictoriaLogs
Pair it with YMJake.Aspire.Hosting.VictoriaLogs in the AppHost:
// AppHost
IResourceBuilder<VictoriaLogsResource> vlogs = builder.AddVictoriaLogs("vlogs");
builder.AddProject<Projects.Api>("api")
.WithReference(vlogs);
// Api
builder.AddVictoriaLogsEndpoint("vlogs");
WithReference injects ConnectionStrings__vlogs, and AddVictoriaLogsEndpoint reads it, so no URL is
hard-coded in the service.
Requirements
The project must have an OpenTelemetry logger provider registered. ServiceDefaults already does this:
builder.Logging.AddOpenTelemetry(logging =>
{
logging.IncludeFormattedMessage = true;
logging.IncludeScopes = true;
});
The package adds an OTLP log processor to that pipeline. It does not touch traces or metrics, so the Aspire dashboard keeps receiving them; logs go to both the dashboard and VictoriaLogs.
Configuration
Settings are read from the Aspire:VictoriaLogs section, then from a section named after the
connection name, then from ConnectionStrings:<connectionName>.
{
"Aspire": {
"VictoriaLogs": {
"DisableHealthChecks": false,
"ServerUrl": "http://localhost:9428"
}
}
}
| Setting | Default | Description |
|---|---|---|
ServerUrl |
from the connection string | Base URL of the VictoriaLogs server. Overrides Logs.Endpoint. |
DisableHealthChecks |
false |
Skips the /health health check registration. |
Logs |
OTLP/HTTP protobuf, batch | OtlpExporterOptions for the log exporter, including Headers and TimeoutMilliseconds. |
Code-based overrides run after configuration binding:
builder.AddVictoriaLogsEndpoint("vlogs", settings =>
{
settings.Logs.Headers = "VL-Stream-Fields=service.name";
settings.Logs.TimeoutMilliseconds = 5_000;
});
Behaviour
- Logs are exported to
{ServerUrl}/insert/opentelemetry/v1/logsover OTLP/HTTP with protobuf. - The full signal path is set explicitly: the .NET OTLP exporter does not append
v1/logsto a signal-specific endpoint. - A health check named
VictoriaLogscalls{ServerUrl}/health.
VictoriaLogs specifics
- VictoriaLogs treats OpenTelemetry resource attributes as stream fields. Narrow them with the
VL-Stream-Fieldsheader if the default stream cardinality is too high. - The log body becomes
_msg. UseVL-Msg-Fieldto read the message from another attribute. - Only logs are supported. VictoriaLogs does not accept OTLP traces or metrics.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.Extensions.Configuration.Binder (>= 10.0.14)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.14)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.14)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.20.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-alpha.1 | 62 | 10/31/2026 |