PowerTraces.Sqlite 3.0.0

dotnet add package PowerTraces.Sqlite --version 3.0.0
                    
NuGet\Install-Package PowerTraces.Sqlite -Version 3.0.0
                    
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="PowerTraces.Sqlite" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PowerTraces.Sqlite" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="PowerTraces.Sqlite" />
                    
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 PowerTraces.Sqlite --version 3.0.0
                    
#r "nuget: PowerTraces.Sqlite, 3.0.0"
                    
#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 PowerTraces.Sqlite@3.0.0
                    
#: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=PowerTraces.Sqlite&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=PowerTraces.Sqlite&version=3.0.0
                    
Install as a Cake Tool

PowerTraces.Sqlite

SQLite provider for PowerTraces — exports OpenTelemetry traces and logs to a local SQLite file. No database server, no collector, no migrations: the file and its tables are created the first time you write. Good for local development, single-server apps and small deployments.

Install

dotnet add package PowerTraces.Sqlite

Export traces and logs

using OpenTelemetry.Logs;
using OpenTelemetry.Trace;
using PowerTraces.Sqlite;

builder.Services.AddOpenTelemetry()
    .WithTracing(t => t
        .AddAspNetCoreInstrumentation()
        .AddPowerTracesSqliteExporter("telemetry/traces.db"))
    .WithLogging(l => l
        .AddPowerTracesSqliteExporter("telemetry/traces.db"));

Pass a file path (default powertraces.db) or a full connection string ("Data Source=telemetry/traces.db;Default Timeout=30"). Optional settings:

tracing.AddPowerTracesSqliteExporter("telemetry/traces.db", o =>
{
    o.Schema = "powertraces";             // default; prefixes table names (SQLite has no schemas)
    o.CommandTimeoutSeconds = 30;         // also how long a write waits for a busy file
    o.ExcludePathPrefixes.Add("/otel");   // don't trace the dashboard's own requests
    o.OnExportError = ex => logger.LogWarning(ex, "PowerTraces export failed");
});

View what you collected

Add PowerTraces.Dashboard and register this provider's dashboard store alongside it:

builder.Services.AddPowerTracesSqliteDashboard("telemetry/traces.db");
// ...
app.MapPowerTracesDashboard("/otel", PowerTracesDatabaseProvider.Sqlite);

Old telemetry is deleted by the dashboard's Retention policy (off until you enable it), the same as every other provider.

What gets created

Tables prefixed with powertraces_ (configurable): Resources, Spans, Logs, Traces, AttributeKeys, IgnoreRules, Settings and PinnedTraces, plus the indexes the dashboard's queries need. The file is switched to WAL journaling, so the dashboard reads while the exporter writes. Timestamps are stored as ISO-8601 text.

The trace list reads Traces (one summary row per trace, upserted as spans arrive). Attribute filters read each row's attribute JSON with json_extract, scanning the rows the other filters leave; AttributeKeys lists every key seen, for the dashboard's attribute picker.

Trade-offs

  • SQLite allows one writer at a time. Batches from several app instances sharing one file take turns (each waits up to CommandTimeoutSeconds). Keep the file on a local disk, not a network share.
  • Case-insensitive matching (search, contains filters) folds ASCII letters only.

If you outgrow it, switch to PowerTraces.PostgreSQL, PowerTraces.MSSQL, PowerTraces.MySQL or PowerTraces.MongoDb — same contract, a real database server.

License

Free for any use, including commercial use, under the PowerTraces Free License (LICENSE.txt in this package): you may use it and ship it unmodified inside your applications, but not modify the code or publish changed copies.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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
3.0.0 50 11/12/2026