Step 2:
Create An Empty Web Application(.NET Framework),and then created a Generic Handler(index.ashx) to receive Tracing data, and the received data is written into the txt file:
public class Index : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
Stream stream = context.Request.InputStream;
if (stream.Length > 0)
{
byte[] spanByutes = new byte[stream.Length];
stream.Read(spanByutes, 0, spanByutes.Length);
var spanString = Encoding.UTF8.GetString(spanByutes);
StreamWriter sw = File.AppendText(@"D:\Code\Csharp\spanInfo.txt");
sw.WriteLine(spanString);
sw.Flush();
sw.Close();
}
context.Response.ContentType = "text/plain";
context.Response.Write("ok!");
}
public bool IsReusable
{
get
{
return false;
}
}
}
}
step 3:
Turn on the receiver and listen for ZipkinTracerExporter Export data;
https://localhost:44399/Index.ashx;
step4:
Turn on the Web Application(WebOpenCensus),Tracking call information;
problem:
The ZipkinTracerExporter will Fall into a cycle. Because the ZipkinTracerExporter HttpPost function is tracked.
step1: I created a Web Application(.Net Core)[WebOpenCensus] ,created a logged in Controller,and then configured in the startup class according to the configuration example(https://github.com/census-instrumentation/opencensus-csharp/blob/develop/PROJECT_DESCRIPTION.md) ;
Step 2: Create An Empty Web Application(.NET Framework),and then created a Generic Handler(index.ashx) to receive Tracing data, and the received data is written into the txt file: public class Index : IHttpHandler {
}
step 3: Turn on the receiver and listen for ZipkinTracerExporter Export data; https://localhost:44399/Index.ashx; step4: Turn on the Web Application(WebOpenCensus),Tracking call information;
problem:
The ZipkinTracerExporter will Fall into a cycle. Because the ZipkinTracerExporter HttpPost function is tracked.