File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Sources/OpenTelemetrySdk/Resources Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -13,12 +13,15 @@ public struct EnvVarResource {
1313 private static let labelKeyValueSplitter = Character ( " = " )
1414
1515 /// This resource information is loaded from the OC_RESOURCE_LABELS
16- /// environment variable.
16+ /// environment variable or from the Info.plist file of the application loading the framework .
1717 public static let resource = Resource ( ) . merging ( other: Resource ( attributes: parseResourceAttributes ( rawEnvAttributes: ProcessInfo . processInfo. environment [ otelResourceAttributesEnv] ) ) )
1818 private init ( ) { }
1919
2020 public static func get( environment: [ String : String ] = ProcessInfo . processInfo. environment) -> Resource {
21- return Resource ( ) . merging ( other: Resource ( attributes: parseResourceAttributes ( rawEnvAttributes: environment [ otelResourceAttributesEnv] ) ) )
21+ let attributesToRead = environment [ otelResourceAttributesEnv] ??
22+ Bundle . main. infoDictionary ? [ otelResourceAttributesEnv] as? String
23+
24+ return Resource ( ) . merging ( other: Resource ( attributes: parseResourceAttributes ( rawEnvAttributes: attributesToRead) ) )
2225 }
2326
2427 /// Creates a label map from the OC_RESOURCE_LABELS environment variable.
You can’t perform that action at this time.
0 commit comments