refactor: moving telemetry wip

This commit is contained in:
Stevan Freeborn
2025-06-03 16:31:09 -05:00
parent 852f27c7b5
commit 8e0ec2d3d5
9 changed files with 69 additions and 17 deletions
@@ -0,0 +1,32 @@
namespace StevesBot.Webhook.Tests.Unit;
public sealed class StevesBotWebhookInstrumentationTests : IDisposable
{
private readonly StevesBotWebhookInstrumentation _instrumentation = new();
[Fact]
public void SourceName_WhenCalled_ItShouldReturnCorrectName()
{
_instrumentation.SourceName.Should().Be("StevesBot.Webhook");
}
[Fact]
public void SourceVersion_WhenCalled_ItShouldReturnCorrectVersion()
{
_instrumentation.SourceVersion.Should().Be("0.0.0");
}
[Fact]
public void Constructor_WhenCalled_ItShouldReturnInstance()
{
using var result = new StevesBotWebhookInstrumentation();
using var expectedSource = new ActivitySource(_instrumentation.SourceName, _instrumentation.SourceVersion);
result.Source.Should().BeEquivalentTo(expectedSource);
}
public void Dispose()
{
_instrumentation.Dispose();
}
}
@@ -1,4 +1,5 @@
global using System.Collections.Concurrent;
global using System.Diagnostics;
global using System.Net;
global using System.Text;
@@ -13,6 +14,7 @@ global using RichardSzalay.MockHttp;
global using StevesBot.Library.Discord.Rest;
global using StevesBot.Library.Discord.Rest.Requests;
global using StevesBot.Webhook.Telemetry;
global using StevesBot.Webhook.YouTube;
global using StevesBot.Webhook.YouTube.Data;
global using StevesBot.Webhook.YouTube.Handlers;