YMJake.Aspire.VictoriaLogs 0.1.0-alpha.1

This is a prerelease version of YMJake.Aspire.VictoriaLogs.
dotnet add package YMJake.Aspire.VictoriaLogs --version 0.1.0-alpha.1
                    
NuGet\Install-Package YMJake.Aspire.VictoriaLogs -Version 0.1.0-alpha.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="YMJake.Aspire.VictoriaLogs" Version="0.1.0-alpha.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="YMJake.Aspire.VictoriaLogs" Version="0.1.0-alpha.1" />
                    
Directory.Packages.props
<PackageReference Include="YMJake.Aspire.VictoriaLogs" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add YMJake.Aspire.VictoriaLogs --version 0.1.0-alpha.1
                    
#r "nuget: YMJake.Aspire.VictoriaLogs, 0.1.0-alpha.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package YMJake.Aspire.VictoriaLogs@0.1.0-alpha.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=YMJake.Aspire.VictoriaLogs&version=0.1.0-alpha.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=YMJake.Aspire.VictoriaLogs&version=0.1.0-alpha.1&prerelease
                    
Install as a Cake Tool

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/logs over OTLP/HTTP with protobuf.
  • The full signal path is set explicitly: the .NET OTLP exporter does not append v1/logs to a signal-specific endpoint.
  • A health check named VictoriaLogs calls {ServerUrl}/health.

VictoriaLogs specifics

  • VictoriaLogs treats OpenTelemetry resource attributes as stream fields. Narrow them with the VL-Stream-Fields header if the default stream cardinality is too high.
  • The log body becomes _msg. Use VL-Msg-Field to read the message from another attribute.
  • Only logs are supported. VictoriaLogs does not accept OTLP traces or metrics.
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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