#pragma warning restore CA2000 // Dispose objects before losing scope /// <summary> /// Adds a <see cref="Sampler"/> which will automatically sample any span under a traceId registered through <see cref="ActivityTraceListenerManager"/>. /// </summary> /// <param name="tracerProviderBuilder"><see cref="TracerProviderBuilder"/>.</param> /// <param name="innerSampler"><see cref="Sampler"/>.</param> /// <returns>Returns the supplied <see cref="TracerProviderBuilder"/> for chaining.</returns> public static TracerProviderBuilder SetActivityTraceListenerSampler(this TracerProviderBuilder tracerProviderBuilder, Sampler innerSampler) => tracerProviderBuilder.SetSampler(new ActivityTraceListenerSampler(innerSampler));