PowerTraces.MySQL 3.0.0

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

PowerTraces.MySQL

MySQL / MariaDB provider for PowerTraces — exports OpenTelemetry traces and logs straight to MySQL via a connection string (using MySqlConnector). No collector, no EF Core, no migrations project: tables are created automatically the first time you write.

Install

dotnet add package PowerTraces.MySQL

Export traces and logs

using OpenTelemetry.Logs;
using OpenTelemetry.Trace;
using PowerTraces.MySQL;

builder.Services.AddOpenTelemetry()
    .WithTracing(t => t
        .AddAspNetCoreInstrumentation()
        .AddPowerTracesMySqlExporter(connectionString))
    .WithLogging(l => l
        .AddPowerTracesMySqlExporter(connectionString));

Optional settings (schema/database name, command timeout, path exclusions, export-error callback):

tracing.AddPowerTracesMySqlExporter(connectionString, o =>
{
    o.Schema = "powertraces";              // default; tables live in this MySQL database/schema
    o.CommandTimeoutSeconds = 30;
    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.AddPowerTracesMySqlDashboard(connectionString);
// ...
app.MapPowerTracesDashboard("/otel", PowerTracesDatabaseProvider.MySql);

What gets created

Tables in the powertraces database (configurable): Resources, Spans, Logs, Traces, AttributeKeys, IgnoreRules, Settings and PinnedTraces — plus the indexes the dashboard's queries need. Creation is idempotent and guarded by GET_LOCK, so it's safe for multiple instances to start at once.

The trace list reads Traces (one summary row per trace, upserted as spans arrive) rather than grouping Spans on every request, so it stays in the milliseconds as the tables grow; list totals stop counting at 10,000 (shown as "10,000+"). Attribute values live only in each row's attribute JSON, which attribute filters read — there's no per-attribute index, so a filter scans the rows the other filters (time range, service, errors) leave. AttributeKeys lists every attribute key seen, for the dashboard's attribute picker.

Upgrading a database written by an earlier version: missing tables are created (and the trace summaries backfilled from existing spans) once, the first time the new version starts. The SpanAttributes/LogAttributes index tables earlier versions wrote are dropped after their keys are copied into AttributeKeys.

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 62 11/12/2026