ソースを参照

Add opentelemetry project

master
Savorboard 3年前
コミット
f5f67f7fc3
3個のファイルの変更67行の追加1行の削除
  1. +8
    -1
      CAP.sln
  2. +35
    -0
      src/DotNetCore.CAP.OpenTelemetry/CapDiagnosticListener.cs
  3. +24
    -0
      src/DotNetCore.CAP.OpenTelemetry/DotNetCore.CAP.OpenTelemetry.csproj

+ 8
- 1
CAP.sln ファイルの表示

@@ -76,7 +76,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetCore.CAP.RedisStreams
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.Dashboard.Auth", "samples\Sample.Dashboard.Auth\Sample.Dashboard.Auth.csproj", "{6E059983-DE89-4D53-88F5-D9083BCE257F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetCore.CAP.MultiModuleSubscriberTests", "test\DotNetCore.CAP.MultiModuleSubscriberTests\DotNetCore.CAP.MultiModuleSubscriberTests.csproj", "{23684403-7DA8-489A-8A1E-8056D7683E18}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetCore.CAP.MultiModuleSubscriberTests", "test\DotNetCore.CAP.MultiModuleSubscriberTests\DotNetCore.CAP.MultiModuleSubscriberTests.csproj", "{23684403-7DA8-489A-8A1E-8056D7683E18}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetCore.CAP.OpenTelemetry", "src\DotNetCore.CAP.OpenTelemetry\DotNetCore.CAP.OpenTelemetry.csproj", "{D32FBDA5-41AC-4563-8CBA-F40C2C10E864}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -184,6 +186,10 @@ Global
{23684403-7DA8-489A-8A1E-8056D7683E18}.Debug|Any CPU.Build.0 = Debug|Any CPU
{23684403-7DA8-489A-8A1E-8056D7683E18}.Release|Any CPU.ActiveCfg = Release|Any CPU
{23684403-7DA8-489A-8A1E-8056D7683E18}.Release|Any CPU.Build.0 = Release|Any CPU
{D32FBDA5-41AC-4563-8CBA-F40C2C10E864}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D32FBDA5-41AC-4563-8CBA-F40C2C10E864}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D32FBDA5-41AC-4563-8CBA-F40C2C10E864}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D32FBDA5-41AC-4563-8CBA-F40C2C10E864}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -214,6 +220,7 @@ Global
{54458B54-49CC-454C-82B2-4AED681D9D07} = {9B2AE124-6636-4DE9-83A3-70360DABD0C4}
{6E059983-DE89-4D53-88F5-D9083BCE257F} = {3A6B6931-A123-477A-9469-8B468B5385AF}
{23684403-7DA8-489A-8A1E-8056D7683E18} = {C09CDAB0-6DD4-46E9-B7F3-3EF2A4741EA0}
{D32FBDA5-41AC-4563-8CBA-F40C2C10E864} = {9B2AE124-6636-4DE9-83A3-70360DABD0C4}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2E70565D-94CF-40B4-BFE1-AC18D5F736AB}


+ 35
- 0
src/DotNetCore.CAP.OpenTelemetry/CapDiagnosticListener.cs ファイルの表示

@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics.Tracing;
using OpenTelemetry.Instrumentation;
using System.Diagnostics;
using System.Reflection;

namespace DotNetCore.CAP.OpenTelemetry
{
public class CapDiagnosticListener : EventSource
{
internal static readonly ActivitySource ActivitySource = new ActivitySource("", "");

public CapDiagnosticListener()
{
// var count = new System.Diagnostics.Tracing.DiagnosticCounter();

}

}

internal sealed partial class HttpTelemetry : EventSource
{
public static readonly HttpTelemetry Log = new HttpTelemetry();


[Event(1, Level = EventLevel.Informational)]
private void RequestStart(string scheme, string host, int port, string pathAndQuery, byte versionMajor, byte versionMinor, HttpVersionPolicy versionPolicy)
{
Interlocked.Increment(ref _startedRequests);
WriteEvent(eventId: 1, scheme, host, port, pathAndQuery, versionMajor, versionMinor, versionPolicy);
}
}
}

+ 24
- 0
src/DotNetCore.CAP.OpenTelemetry/DotNetCore.CAP.OpenTelemetry.csproj ファイルの表示

@@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<AssemblyName>DotNetCore.CAP.OpenTelemetry</AssemblyName>
<Description>CAP instrumentation for OpenTelemetry .NET</Description>
<PackageTags>$(PackageTags);distributed-tracing</PackageTags>
</PropertyGroup>
<PropertyGroup>
<DocumentationFile>bin\$(Configuration)\netstandard2.1\DotNetCore.CAP.OpenTelemetry.xml</DocumentationFile>
<NoWarn>1701;1702;1705;CS1591</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="5.0.1" />
<PackageReference Include="OpenTelemetry" Version="1.1.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\DotNetCore.CAP\DotNetCore.CAP.csproj" />
</ItemGroup>
</Project>

読み込み中…
キャンセル
保存