From d78f073e88f470cdec5f71edaa97d7948d4f9803 Mon Sep 17 00:00:00 2001 From: Fabian Fett Date: Thu, 8 Oct 2020 11:10:09 +0200 Subject: [PATCH] Expose SpanAttributes Keys --- Sources/Tracing/Span.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Sources/Tracing/Span.swift b/Sources/Tracing/Span.swift index e657139..18786cb 100644 --- a/Sources/Tracing/Span.swift +++ b/Sources/Tracing/Span.swift @@ -329,6 +329,11 @@ extension SpanAttributes { public func forEach(_ callback: (String, SpanAttribute) -> Void) { self._attributes.forEach { callback($0.key, $0.1) } } + + /// Returns all attribute names. + public var keys: Dictionary.Keys { + return self._attributes.keys + } /// Returns true if the collection contains no attributes. public var isEmpty: Bool {