Skip to content

Commit

Permalink
dumping more ideas
Browse files Browse the repository at this point in the history
  • Loading branch information
reyang committed Aug 6, 2020
1 parent 4f1f998 commit 127bc8b
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion docs/trace/building-your-own-processor/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,20 @@ public class Program

public static void Main()
{
/* a simple case, where default ALWAYS_ON sampler is used:
using var tracerProvider = Sdk.CreateTracerProvider()
.AddProcessor(new BatchingActivityProcessor(new ZipkinExporter()));
*/

/* making it easier for the user:
using var tracerProvider = Sdk.CreateTracerProvider()
.AddZipkinExporter(options);
1) AddExporter should be an extension function provided by individual exporter
2) individual exporter should pick the right (batching vs. simple) processor by default
3) individual exporter can expose an option letting people to use a non-default processor
*/

using var tracerProvider = Sdk.CreateTracerProvider(new ProbabilitySampler(0.5))
.AddListener("MyCompany.MyProduct.MyLibrary")
.AddListener("MyCompany.AnotherProduct.*")
Expand All @@ -42,11 +56,13 @@ public static void Main()
{
}

/*
/* according to the spec, processors can be added at runtime
tracerProvider.AddProcessor(new MultiActivityProcessor(
[processor1, processor2, processor3]
));
*/

/* existing samplers can be reused as a tail sampling filter
tracerProvider.AddProcessor(new MultiActivityProcessor(
[new TailSamplingProcessor(new Sampler()), new SimpleExportProcessor(new ConsoleExporter())]
));
Expand Down

0 comments on commit 127bc8b

Please sign in to comment.