Skip to content

Commit

Permalink
README.md out of date (#263)
Browse files Browse the repository at this point in the history
Replaced DI occurrences of ITracer/Tracer with ITracerFactory/TracerFactory
  • Loading branch information
z1c0 authored and Liudmila Molkova committed Oct 8, 2019
1 parent 6bf0e18 commit 14e0d60
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,15 +269,15 @@ Configuration is done by user application: it should configure exporter and may
[OpenTelemetry.Collector.AspNetCore][OpenTelemetry-collect-aspnetcore-nuget-url] to collect incoming HTTP requests
[OpenTelemetry.Collector.Dependencies](OpenTelemetry-collect-deps-nuget-url) to collect outgoing HTTP requests and Azure SDK calls

2. Make sure `ITracer`, `ISampler`, and `SpanExporter` and `SpanProcessor` are registered in DI.
2. Make sure `ITracerFactory`, `ISampler`, and `SpanExporter` and `SpanProcessor` are registered in DI.

```csharp
services.AddSingleton<ISampler>(Samplers.AlwaysSample);
services.AddSingleton<ZipkinTraceExporterOptions>(_ => new ZipkinTraceExporterOptions { ServiceName = "my-service" });
services.AddSingleton<SpanExporter, ZipkinTraceExporter>();
services.AddSingleton<SpanProcessor, BatchingSpanProcessor>();
services.AddSingleton<TraceConfig>();
services.AddSingleton<ITracer, Tracer>();
services.AddSingleton<ITracerFactory, TracerFactory>();

// you may also configure request and dependencies collectors
services.AddSingleton<RequestsCollectorOptions>(new RequestsCollectorOptions());
Expand Down Expand Up @@ -305,15 +305,15 @@ Outgoing http calls to Redis made using StackExchange.Redis library can be autom
1. Install package to your project:
[OpenTelemetry.Collector.StackExchangeRedis][OpenTelemetry-collect-stackexchange-redis-nuget-url]

2. Make sure `ITracer`, `ISampler`, and `SpanExporter` and `SpanProcessor` are registered in DI.
2. Make sure `ITracerFactory`, `ISampler`, and `SpanExporter` and `SpanProcessor` are registered in DI.

```csharp
services.AddSingleton<ISampler>(Samplers.AlwaysSample);
services.AddSingleton<ZipkinTraceExporterOptions>(_ => new ZipkinTraceExporterOptions { ServiceName = "my-service" });
services.AddSingleton<SpanExporter, ZipkinTraceExporter>();
services.AddSingleton<SpanProcessor, BatchingSpanProcessor>();
services.AddSingleton<TraceConfig>();
services.AddSingleton<ITracer, Tracer>();
services.AddSingleton<ITracerFactory, TracerFactory>();

// configure redis collection
services.AddSingleton<StackExchangeRedisCallsCollectorOptions>(new StackExchangeRedisCallsCollectorOptions());
Expand Down

0 comments on commit 14e0d60

Please sign in to comment.