All Projects → caozhiyuan → ClrProfiler.Trace

caozhiyuan / ClrProfiler.Trace

Licence: other
CoreCLR Profiler ILReWrite , Use To OpenTracing

Programming Languages

C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language
C#
18002 projects
Batchfile
5799 projects
powershell
5483 projects
CMake
9771 projects

Projects that are alternatives of or similar to ClrProfiler.Trace

Cat
CAT 作为服务端项目基础组件,提供了 Java, C/C++, Node.js, Python, Go 等多语言客户端,已经在美团点评的基础架构中间件框架(MVC框架,RPC框架,数据库框架,缓存框架等,消息队列,配置系统等)深度集成,为美团点评各业务线提供系统丰富的性能指标、健康状况、实时告警等。
Stars: ✭ 16,236 (+33034.69%)
Mutual labels:  apm
fast-laravel
基于Swoole的高性能HTTP服务器,加速您Laravel应用程序。
Stars: ✭ 33 (-32.65%)
Mutual labels:  apm
elastic-apm-mule3-agent
Elastic APM agent for Mule 3.x
Stars: ✭ 18 (-63.27%)
Mutual labels:  apm
elastic-stack-testing
Elastic Stack Testing Framework (ESTF) 🤖
Stars: ✭ 47 (-4.08%)
Mutual labels:  apm
AppDynamics.DEXTER
Turn your APM data store into a Data Warehouse with advanced reporting, including entities, configuration, metrics, flowmaps, events, snapshots and call graph flame graphs
Stars: ✭ 79 (+61.22%)
Mutual labels:  apm
trace-cocoa-sdk
Catch bugs before they reach production — get detailed crash reports and monitor how your app is performing across the entire install base.
Stars: ✭ 15 (-69.39%)
Mutual labels:  apm
Dd Trace Java
Datadog APM client for Java
Stars: ✭ 228 (+365.31%)
Mutual labels:  apm
ilogtail
Fast and Lightweight Observability Data Collector
Stars: ✭ 1,035 (+2012.24%)
Mutual labels:  apm
pinpoint-node-agent
Pinpoint Node.js agent
Stars: ✭ 45 (-8.16%)
Mutual labels:  apm
proxychanger
Go tool to change system and applications proxy
Stars: ✭ 15 (-69.39%)
Mutual labels:  apm
meteor-elastic-apm
Meteor Elastic APM integration
Stars: ✭ 56 (+14.29%)
Mutual labels:  apm
fierysdk
ragnar fiery php sdk
Stars: ✭ 42 (-14.29%)
Mutual labels:  apm
OneAgent-SDK-for-dotnet
Enables custom tracing of .NET applications in Dynatrace
Stars: ✭ 14 (-71.43%)
Mutual labels:  apm
tester-jest
Tester Jest is a tester provider for the Atom Tester.
Stars: ✭ 21 (-57.14%)
Mutual labels:  apm
Uatu
Android方法调用跟踪 ; 方法耗时统计 ; 方法调用参数以及返回值跟踪 ; 方法调用替换;方法hook
Stars: ✭ 93 (+89.8%)
Mutual labels:  apm
Dd Trace Go
A Go tracing package for Datadog APM
Stars: ✭ 244 (+397.96%)
Mutual labels:  apm
atom-gitkraken
Open the current @atom project in GitKraken.
Stars: ✭ 12 (-75.51%)
Mutual labels:  apm
pm2-io-apm
PM2.io APM for Node.JS
Stars: ✭ 131 (+167.35%)
Mutual labels:  apm
tester
Test runner for the Atom Editor.
Stars: ✭ 38 (-22.45%)
Mutual labels:  apm
skywalking-python
The Python agent for Apache SkyWalking
Stars: ✭ 152 (+210.2%)
Mutual labels:  apm

CoreCLR Profiler ILReWrite

This sample shows il rewrite (open dev.cmd to develop)

1.hook il in premain assembly.customloadfrom(you profiler C# dll)

2.add try catch finally in to need trace method

Prerequisites

Building

Build

windows

git clone https://github.com/dotnet/coreclr.git
git clone https://github.com/caozhiyuan/ClrProfiler.Trace.git

cd ClrProfiler.Trace
powershell ./scripts/install-vcpkgs.ps1

set _VSWHERE="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
if exist %_VSWHERE% ( for /f "usebackq tokens=*" %i in (`%_VSWHERE% -latest -prerelease -property installationPath`) do set _VSPATH=%i)
call "%_VSPATH%\VC\Auxiliary\Build\vcvars64.bat" 

cd src\ClrProfiler
SET BuildArch=x64
SET BuildType=Debug
build

linux

git clone https://github.com/dotnet/coreclr.git
git clone https://github.com/caozhiyuan/ClrProfiler.Trace.git

git clone https://github.com/Microsoft/vcpkg.git
cd ~/vcpkg
./bootstrap-vcpkg.sh
./vcpkg install spdlog

cd ~/ClrProfiler.Trace/src/ClrProfiler
mkdir build
cd build 
cmake ..
make

Setup

SET CORECLR_PROFILER={cf0d821e-299b-5307-a3d8-b283c03916dd}
SET CORECLR_ENABLE_PROFILING=1
SET CORECLR_PROFILER_PATH=%WorkDir%src\ClrProfiler\x64\Debug\ClrProfiler.dll
SET CORECLR_PROFILER_HOME=%WorkDir%src\ClrProfiler.Trace\bin\Debug\netstandard2.0

SET COR_PROFILER={af0d821e-299b-5307-a3d8-b283c03916dd}
SET COR_ENABLE_PROFILING=1
SET COR_PROFILER_PATH=%WorkDir%src\ClrProfiler\x64\Debug\ClrProfiler.dll
SET COR_PROFILER_HOME=%WorkDir%src\ClrProfiler.Trace\bin\Debug\net461

cd tools
Dll.Repack.cmd Debug 

: or Dll.Repack.cmd Release

download https://github.com/jaegertracing/jaeger/releases/download/v1.9.0/jaeger-1.9.0-windows-amd64.tar.gz
run jaeger-all-in-one.exe

run examples Samples.WebApi

open http://localhost:16686

Notice

About Async Method Trace

if use scope, you should startActive(false) and restore active scope at method end

it's important if you want get ActiveSpan, code like this :

 public EndMethodDelegate BeforeWrappedMethod(TraceMethodInfo traceMethodInfo)
 {
     var dbCommand = (DbCommand)traceMethodInfo.InvocationTarget;
     var scope = _tracer.BuildSpan("mssql.command")
         .WithTag(Tags.SpanKind, Tags.SpanKindClient)
         .WithTag(Tags.Component, "SqlServer")
         .WithTag(Tags.DbInstance, dbCommand.Connection.ConnectionString)
         .WithTag(Tags.DbStatement, dbCommand.CommandText)
         .WithTag(TagMethod, traceMethodInfo.MethodBase.Name)
         .WithTag(TagIsAsync, true)
         .StartActive(false);

     traceMethodInfo.TraceContext = scope;

     return delegate (object returnValue, Exception ex)
     {
         DelegateHelper.AsyncMethodEnd(Leave, traceMethodInfo, ex, returnValue);

         // for async method , at method end restore active scope, important
         var tempScope = (IScope)traceMethodInfo.TraceContext;
         tempScope.Dispose();
     };
 }

 private void Leave(TraceMethodInfo traceMethodInfo, object ret, Exception ex)
 {
     var scope = (IScope)traceMethodInfo.TraceContext;
     if (ex != null)
     {
         scope.Span.SetException(ex);
     }
     scope.Span.Finish();
 }

Help Links:


https://www.ecma-international.org/publications/files/ECMA-ST/ECMA-335.pdf

https://github.com/Microsoft/clr-samples

https://github.com/brian-reichle/MethodCheck

https://www.codeproject.com/articles/42655/%2fArticles%2f42655%2fNET-file-format-Signatures-under-the-hood-Part-2#LocalVarSig1.1

https://github.com/DataDog/dd-trace-dotnet

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].