Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@ jobs:

- name: Pack
run: |
dotnet pack src/TrackSeries.FanArtTV.Client.Diagnostics/TrackSeries.FanArtTV.Client.Diagnostics.csproj --no-build -c Release /p:Packing=true /p:CI=true
dotnet pack src/TrackSeries.FanArtTV.Client/TrackSeries.FanArtTV.Client.csproj --no-build -c Release /p:Packing=true /p:CI=true
dotnet pack src/TrackSeries.FanArtTV.Client.OpenTelemetry/TrackSeries.FanArtTV.Client.OpenTelemetry.csproj --no-build -c Release /p:Packing=true /p:CI=true
1 change: 1 addition & 0 deletions .github/workflows/publish-on-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:

- name: Pack
run: |
dotnet pack src/TrackSeries.FanArtTV.Client.Diagnostics/TrackSeries.FanArtTV.Client.Diagnostics.csproj --no-build -c Release /p:Packing=true /p:CI=true -o ./artifacts
dotnet pack src/TrackSeries.FanArtTV.Client/TrackSeries.FanArtTV.Client.csproj --no-build -c Release /p:Packing=true /p:CI=true -o ./artifacts
dotnet pack src/TrackSeries.FanArtTV.Client.OpenTelemetry/TrackSeries.FanArtTV.Client.OpenTelemetry.csproj --no-build -c Release /p:Packing=true /p:CI=true -o ./artifacts

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish-on-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:

- name: Pack
run: |
dotnet pack src/TrackSeries.FanArtTV.Client.Diagnostics/TrackSeries.FanArtTV.Client.Diagnostics.csproj --no-build -c Release /p:Packing=true /p:CI=true -o ./artifacts
dotnet pack src/TrackSeries.FanArtTV.Client/TrackSeries.FanArtTV.Client.csproj --no-build -c Release /p:Packing=true /p:CI=true -o ./artifacts
dotnet pack src/TrackSeries.FanArtTV.Client.OpenTelemetry/TrackSeries.FanArtTV.Client.OpenTelemetry.csproj --no-build -c Release /p:Packing=true /p:CI=true -o ./artifacts

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ services

Configure exporters, resources and sampling in the application as usual. The standard `HttpClient` instrumentation can be enabled alongside this integration to observe individual HTTP attempts, while the FanArtTV activity represents the logical request across retries.

Services that only need the stable source and meter names can reference the lightweight `TrackSeries.FanArtTV.Client.Diagnostics` package without pulling in the client or OpenTelemetry dependencies.

[Integration example](https://github.com/TrackSeries/TrackSeries.FanArtTV.Client/blob/main/tests/TrackSeries.FanArtTV.Client.IntegrationTests/FanArtTVSmokeTests.cs)

## Migrating to version 2
Expand Down
2 changes: 1 addition & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ git tag -a "v$version" -m "Release $version"
git push origin "v$version"
```

The tag triggers `.github/workflows/publish-on-tag.yml`, which builds both packages, publishes them to NuGet.org, and creates a GitHub Release with automatically generated release notes. Pushing the next prerelease version to `main` publishes prerelease packages to GitHub Packages.
The tag triggers `.github/workflows/publish-on-tag.yml`, which builds all three packages, publishes them to NuGet.org, and creates a GitHub Release with automatically generated release notes. Pushing the next prerelease version to `main` publishes prerelease packages to GitHub Packages.

If pushing the tag does not start a workflow run, trigger the safe manual fallback from `main` with the same `v`-prefixed tag:

Expand Down
1 change: 1 addition & 0 deletions TrackSeries.FanArtTV.Client.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<Platform Name="x86" />
</Configurations>
<Folder Name="/src/">
<Project Path="src/TrackSeries.FanArtTV.Client.Diagnostics/TrackSeries.FanArtTV.Client.Diagnostics.csproj" />
<Project Path="src/TrackSeries.FanArtTV.Client.OpenTelemetry/TrackSeries.FanArtTV.Client.OpenTelemetry.csproj" />
<Project Path="src/TrackSeries.FanArtTV.Client/TrackSeries.FanArtTV.Client.csproj" />
</Folder>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net10.0;net8.0</TargetFrameworks>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>latest</LangVersion>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>
<Description>Stable telemetry names for TrackSeries.FanArtTV.Client instrumentation.</Description>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\TrackSeries.FanArtTV.Client\TrackSeries.FanArtTV.Client.csproj" />
<ProjectReference Include="..\TrackSeries.FanArtTV.Client.Diagnostics\TrackSeries.FanArtTV.Client.Diagnostics.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions src/TrackSeries.FanArtTV.Client/Diagnostics/TypeForwarders.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
using System.Runtime.CompilerServices;
using TrackSeries.FanArtTV.Client.Diagnostics;

[assembly: TypeForwardedTo(typeof(FanArtTVClientTelemetry))]
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
<InternalsVisibleTo Include="TrackSeries.FanArtTV.Client.UnitTests" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\TrackSeries.FanArtTV.Client.Diagnostics\TrackSeries.FanArtTV.Client.Diagnostics.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
<PackageReference Include="Microsoft.Extensions.Http" Version="10.0.10" />
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="10.8.0" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using OpenTelemetry;
using TrackSeries.FanArtTV.Client.Diagnostics;

namespace TrackSeries.FanArtTV.Client.UnitTests;

public sealed class FanArtTVClientDiagnosticsContractTests
{
[Fact]
public void Client_Uses_Stable_Telemetry_Contract()
{
Assert.Equal("TrackSeries.FanArtTV.Client", FanArtTVClientTelemetry.ActivitySourceName);
Assert.Equal("TrackSeries.FanArtTV.Client", FanArtTVClientTelemetry.MeterName);
Assert.Equal(FanArtTVClientTelemetry.ActivitySourceName, FanArtTVClientDiagnostics.ActivitySource.Name);
Assert.Equal(FanArtTVClientTelemetry.MeterName, FanArtTVClientDiagnostics.Meter.Name);
}

[Fact]
public void Main_Client_Forwards_Existing_Telemetry_Contract_Type()
{
Assert.Contains(
typeof(FanArtTVClientTelemetry),
typeof(IFanArtTVClient).Assembly.GetForwardedTypes());
}

[Fact]
public void OpenTelemetry_Assembly_Does_Not_Reference_Main_Client()
{
var referencedAssemblyNames = typeof(FanArtTVClientOpenTelemetryBuilderExtensions)
.Assembly
.GetReferencedAssemblies()
.Select(static assembly => assembly.Name);

Assert.DoesNotContain("TrackSeries.FanArtTV.Client", referencedAssemblyNames);
}
}
Loading