Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/usausa/mini-data-profiler
Minimum data profiler for ADO.NET.
https://github.com/usausa/mini-data-profiler
csharp data-access dataaccess dotnet opentelemetry profiler telemetry
Last synced: about 2 months ago
JSON representation
Minimum data profiler for ADO.NET.
- Host: GitHub
- URL: https://github.com/usausa/mini-data-profiler
- Owner: usausa
- License: mit
- Created: 2024-03-05T04:41:58.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-04-25T10:54:27.000Z (9 months ago)
- Last Synced: 2024-04-26T12:01:11.947Z (9 months ago)
- Topics: csharp, data-access, dataaccess, dotnet, opentelemetry, profiler, telemetry
- Language: C#
- Homepage:
- Size: 121 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mini-data-profiler
| Package | Info | Description |
|-|-|-|
| MiniDataProfiler | [![NuGet Badge](https://buildstats.info/nuget/MiniDataProfiler)](https://www.nuget.org/packages/MiniDataProfiler/) | Core |
| MiniDataProfiler.Listener.Logging | [![NuGet Badge](https://buildstats.info/nuget/MiniDataProfiler.Listener.Logging)](https://www.nuget.org/packages/MiniDataProfiler.Listener.Logging/) | Microsoft.Extensions.Logging Listener |
| MiniDataProfiler.Listener.OpenTelemetry | [![NuGet Badge](https://buildstats.info/nuget/MiniDataProfiler.Listener.OpenTelemetry)](https://www.nuget.org/packages/MiniDataProfiler.Listener.OpenTelemetry/) | OpenTelemetry Listener |## What is this?
* Simple profiler for ADO.NET
## Usage
```csharp
// Setup Logger
using var loggerFactory = LoggerFactory.Create(builder =>
{
builder
.AddFilter("MiniDataProfiler.Listener.Logging", LogLevel.Information)
.AddConsole();
});
var logListener = new LoggingListener(loggerFactory.CreateLogger(), new LoggingListenerOption());// Setup OpenTelemetry
using var tracerProvider = Sdk.CreateTracerProviderBuilder()
.ConfigureResource(config =>
{
config.AddService("Example", serviceInstanceId: Environment.MachineName);
})
.AddMiniDataProfilerInstrumentation()
.AddOtlpExporter(config =>
{
config.Endpoint = new Uri("http://otlp-exporter:4317");
})
.Build();// Listeners
var listener = new ChainListener(logListener, new OpenTelemetryListener(new OpenTelemetryListenerOption()));// Use ProfileDbConnection
using var con = new ProfileDbConnection(listener, new SqliteConnection(connectionString));
...
```