From 786f91321e774f1e8b54c14c88f4797e92c418b5 Mon Sep 17 00:00:00 2001 From: Iceman Date: Sat, 14 Sep 2024 23:45:22 +0900 Subject: [PATCH] Make `OTelSamplingResult.init` Public (#132) Co-authored-by: Moritz Lang --- Sources/OTel/Tracing/Sampling/OTelSamplingResult.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Sources/OTel/Tracing/Sampling/OTelSamplingResult.swift b/Sources/OTel/Tracing/Sampling/OTelSamplingResult.swift index 4834ed14..fadc1321 100644 --- a/Sources/OTel/Tracing/Sampling/OTelSamplingResult.swift +++ b/Sources/OTel/Tracing/Sampling/OTelSamplingResult.swift @@ -21,7 +21,12 @@ public struct OTelSamplingResult: Equatable, Sendable { /// Additional attributes describing the sampling decision to be included in the span's attributes. public let attributes: SpanAttributes - init(decision: OTelSamplingResult.Decision, attributes: SpanAttributes = [:]) { + /// Create a sampling result with the given decision and attributes. + /// + /// Parameters: + /// - decision: Whether the span should be recorded/sampled. + /// - attributes: Additional attributes describing the sampling decision. + public init(decision: OTelSamplingResult.Decision, attributes: SpanAttributes = [:]) { self.decision = decision self.attributes = attributes }