Purview.Telemetry.SourceGenerator 1.1.0

dotnet add package Purview.Telemetry.SourceGenerator --version 1.1.0                
NuGet\Install-Package Purview.Telemetry.SourceGenerator -Version 1.1.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="Purview.Telemetry.SourceGenerator" Version="1.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Purview.Telemetry.SourceGenerator --version 1.1.0                
#r "nuget: Purview.Telemetry.SourceGenerator, 1.1.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.
// Install Purview.Telemetry.SourceGenerator as a Cake Addin
#addin nuget:?package=Purview.Telemetry.SourceGenerator&version=1.1.0

// Install Purview.Telemetry.SourceGenerator as a Cake Tool
#tool nuget:?package=Purview.Telemetry.SourceGenerator&version=1.1.0                

Purview Telemetry Source Generator

Generates ActivitySource, High-performance logging and Metrics based on methods on an interface, enabling fast iteration cycles, dependency injection and substitutes for testing.

The latest version is available on NuGet, and supports generating for the following frameworks:

  • .NET Framework 4.7.2
  • .NET Framework 4.8
  • .NET 7
  • .NET 8
  • .NET 9
[ActivitySource]
[Logger]
[Meter]
interface IEntityStoreTelemetry
{
    /// <summary>
    /// Creates and starts an Activity and adds the parameters as Tags and Baggage.
    /// </summary>
    [Activity]
    Activity? GettingEntityFromStore(int entityId, [Baggage]string serviceUrl);

    /// <summary>
    /// Adds an ActivityEvent to the Activity with the parameters as Tags.
    /// </summary>
    [Event]
    void GetDuration(Activity? activity, int durationInMS);

    /// <summary>
    /// Adds the parameters as Baggage to the Activity.
    /// </summary>
    [Context]
    void RetrievedEntity(Activity? activity, float totalValue, int lastUpdatedByUserId);

    /// <summary>
    /// Generates a structured log message using an ILogger.
    /// </summary>
    [Log]
    void ProcessingEntity(int entityId, string updateState);

    /// <summary>
    /// Adds 1 to a Counter<T> with the entityId as a Tag.
    /// </summary>
    [AutoCounter]
    void RetrievingEntity(int entityId);
}

For more information see the wiki.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.0

    • No dependencies.

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
1.1.0 89 12/8/2024
1.0.12 135 6/9/2024
1.0.11 143 6/3/2024
1.0.10 107 6/3/2024
1.0.9 123 5/30/2024
1.0.8 113 5/27/2024
1.0.7 117 5/20/2024
1.0.6 124 5/20/2024
1.0.5 133 5/6/2024
1.0.4 105 5/1/2024
1.0.3 337 4/30/2024
1.0.2 118 4/25/2024
1.0.1 112 4/25/2024
1.0.0 120 4/22/2024
0.0.14-prerelease 109 4/8/2024
0.0.13-prerelease 110 4/7/2024
0.0.12-prerelease 99 4/6/2024
0.0.11-prerelease 103 4/6/2024
0.0.10-prerelease 100 4/6/2024