generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathAwsOpenTelemetryConfig.swift
More file actions
136 lines (120 loc) · 4.14 KB
/
AwsOpenTelemetryConfig.swift
File metadata and controls
136 lines (120 loc) · 4.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/*
* Copyright Amazon.com, Inc. or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
import Foundation
/**
* Configuration model for AWS OpenTelemetry SDK.
*
* This class defines the structure for configuring the AWS OpenTelemetry SDK,
* including RUM (Real User Monitoring) settings and application information.
*/
@objc public class AwsOpenTelemetryConfig: NSObject, Codable {
/// Schema version of the configuration
public var version: String?
/// RUM (Real User Monitoring) configuration settings
public var rum: RumConfig
/// Application-specific configuration settings
public var application: ApplicationConfig
/**
* Initializes a new configuration instance.
*
* @param version The schema version of the configuration (defaults to "1.0.0")
* @param rum The RUM configuration settings
* @param application The application configuration settings
*/
@objc public init(version: String? = "1.0.0",
rum: RumConfig,
application: ApplicationConfig) {
self.version = version
self.rum = rum
self.application = application
super.init()
}
}
/**
* Configuration for AWS RUM (Real User Monitoring).
*
* Contains settings specific to the AWS RUM service, including region,
* app monitor identifier, and optional configuration overrides.
*/
@objc public class RumConfig: NSObject, Codable {
/// AWS region where the RUM service is deployed
public var region: String
/// Unique identifier for the RUM App Monitor
public var appMonitorId: String
/// Optional endpoint overrides for the RUM service
public var overrideEndpoint: EndpointOverrides?
/// Flag to enable debug logging for SDK integration
public var debug: Bool?
/// Optional alias to add to all requests to compare against the rum:alias
/// in appmonitors with resource based policies
public var alias: String?
/**
* Initializes a new RUM configuration instance.
*
* @param region AWS region where the RUM service is deployed
* @param appMonitorId Unique identifier for the RUM App Monitor
* @param overrideEndpoint Optional endpoint overrides for the RUM service
* @param debug Flag to enable debug logging (defaults to false)
*/
@objc public init(region: String, appMonitorId: String, overrideEndpoint: EndpointOverrides? = nil, debug: Bool = false, alias: String? = nil) {
self.region = region
self.appMonitorId = appMonitorId
self.overrideEndpoint = overrideEndpoint
self.debug = debug
self.alias = alias
super.init()
}
}
/**
* Configuration for endpoint overrides.
*
* Allows customization of the endpoints used for logs and traces,
* which is useful for testing or custom deployments.
*/
@objc public class EndpointOverrides: NSObject, Codable {
/// Custom endpoint URL for logs
public var logs: String?
/// Custom endpoint URL for traces
public var traces: String?
/**
* Initializes a new endpoint overrides instance.
*
* @param logs Custom endpoint URL for logs
* @param traces Custom endpoint URL for traces
*/
@objc public init(logs: String? = nil, traces: String? = nil) {
self.logs = logs
self.traces = traces
super.init()
}
}
/**
* Configuration for application-specific settings.
*
* Contains metadata about the application being monitored.
*/
@objc public class ApplicationConfig: NSObject, Codable {
/// Version of the application being monitored
public var applicationVersion: String
/**
* Initializes a new application configuration instance.
*
* @param applicationVersion Version of the application being monitored
*/
@objc public init(applicationVersion: String) {
self.applicationVersion = applicationVersion
super.init()
}
}