File tree Expand file tree Collapse file tree 2 files changed +16
-13
lines changed
Sources/Exporters/OpenTelemetryProtocolCommon/common Expand file tree Collapse file tree 2 files changed +16
-13
lines changed Original file line number Diff line number Diff line change 66import Foundation
77
88public enum Constants {
9- public enum HTTP {
10- public static let userAgent = " User-Agent "
11- }
9+ public enum OTLP {
10+ public static let version = " 0.20.0 "
11+ }
12+ public enum HTTP {
13+ public static let userAgent = " User-Agent "
14+ }
1215}
Original file line number Diff line number Diff line change @@ -7,15 +7,15 @@ import Foundation
77import OpenTelemetryApi
88
99public struct Headers {
10- // GetUserAgentHeader returns an OTLP header value of the form "OTel OTLP Exporter Swift/{{ .Version }}"
11- // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#user-agent
12- public static func getUserAgentHeader( ) -> String {
13- var version = OpenTelemetry . version
14- if !version. isEmpty && version. hasPrefix ( " v " ) {
15- version = String ( version. dropFirst ( 1 ) )
16- }
17- let userAgent = " OTel-OTLP-Exporter-Swift/ \( version) "
18-
19- return userAgent
10+ // GetUserAgentHeader returns an OTLP header value of the form "OTel OTLP Exporter Swift/{{ .Version }}"
11+ // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#user-agent
12+ public static func getUserAgentHeader( ) -> String {
13+ var version = Constants . OTLP. version
14+ if !version. isEmpty && version. hasPrefix ( " v " ) {
15+ version = String ( version. dropFirst ( 1 ) )
2016 }
17+ let userAgent = " OTel-OTLP-Exporter-Swift/ \( version) "
18+
19+ return userAgent
20+ }
2121}
You can’t perform that action at this time.
0 commit comments