public static TracerBuilder AddNServiceBusAdapter(this TracerBuilder builder, Action <NServiceBusInstrumentationOptions> configureInstrumentationOptions) { var options = new NServiceBusInstrumentationOptions(); configureInstrumentationOptions ??= opt => { }; configureInstrumentationOptions(options); return(builder .AddAdapter(t => new NServiceBusReceiveAdapter(t, options)) .AddAdapter(t => new NServiceBusSendAdapter(t, options))); }
public static TracerBuilder UseEventSource(this TracerBuilder builder, IEnumerable <KeyValuePair <EventSource, EventLevel> > events, Func <EventWrittenEventArgs, Event> convertFunc = null) { builder.AddAdapter(tracer => { var collector = new EventSourceAdapter(tracer, convertFunc); foreach (var pair in events) { collector.Add(pair.Key, new EventEnableOption() { Level = pair.Value }); } return(collector); }); return(builder); }
public static TracerBuilder AddNServiceBusAdapter(this TracerBuilder builder) => builder .AddAdapter(t => new NServiceBusReceiveAdapter(t)) .AddAdapter(t => new NServiceBusSendAdapter(t));