Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update url to the metrics reporter sdk #535

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let package = Package(
)
],
dependencies: [
.package(name: "MetricsReporter", url: "https://github.com/rudderlabs/metrics-reporter-ios", .exact("1.2.1")),
.package(name: "MetricsReporter", url: "https://github.com/rudderlabs/metrics-reporter-ios", .exact("2.0.0")),
],
targets: [
.target(
Expand Down
10 changes: 5 additions & 5 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
PODS:
- MetricsReporter (1.2.1):
- MetricsReporter (2.0.0):
- RSCrashReporter (= 1.0.1)
- RudderKit (= 1.4.0)
- RSCrashReporter (1.0.1)
- Rudder (1.27.0):
- MetricsReporter (= 1.2.1)
- Rudder (1.28.1):
- MetricsReporter (= 2.0.0)
- RudderKit (1.4.0)
- SQLCipher (4.5.4):
- SQLCipher/standard (= 4.5.4)
Expand All @@ -31,9 +31,9 @@ EXTERNAL SOURCES:
:path: "."

SPEC CHECKSUMS:
MetricsReporter: 99596ee5003c69949ed2f50acc34aee83c42f843
MetricsReporter: 364b98791e868b10e9d512eb50af28d8c11e5cdb
RSCrashReporter: 6b8376ac729b0289ebe0908553e5f56d8171f313
Rudder: 3cfcd9e6c5359cd6d49f411101ed9b894e3b64bd
Rudder: 07c2c7f8f02a91a3c8343d7284d3b3b49f8da969
RudderKit: d9d6997696e1642b753d8bdf94e57af643a68f03
SQLCipher: 905b145f65f349f26da9e60a19901ad24adcd381

Expand Down
2 changes: 1 addition & 1 deletion Rudder.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ Pod::Spec.new do |s|

s.source_files = 'Sources/**/*.{h,m}'

s.dependency 'MetricsReporter', '1.2.1'
s.dependency 'MetricsReporter', '2.0.0'
end
17 changes: 11 additions & 6 deletions Sources/Classes/RSMetricsReporter.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,18 @@ - (instancetype)initWithWriteKey:(NSString *)writeKey preferenceManager:(RSPrefe
self = [super init];
if (self) {
if (preferenceManager.isMetricsCollectionEnabled || preferenceManager.isErrorsCollectionEnabled) {
RSMetricConfiguration *configuration = [[RSMetricConfiguration alloc] initWithLogLevel:config.logLevel writeKey:writeKey sdkVersion:RS_VERSION];
[configuration dbCountThreshold:config.dbCountThreshold];
_metricsClient = [[RSMetricsClient alloc] initWithConfiguration:configuration];
_metricsClient.isMetricsCollectionEnabled = preferenceManager.isMetricsCollectionEnabled;
_metricsClient.isErrorsCollectionEnabled = preferenceManager.isErrorsCollectionEnabled;
NSString *dataPlaneUrl = config.dataPlaneUrl ?: @"";
if (dataPlaneUrl.length > 0) {
RSMetricConfiguration *configuration = [[RSMetricConfiguration alloc] initWithLogLevel:config.logLevel writeKey:writeKey sdkVersion:RS_VERSION sdkMetricsUrl:dataPlaneUrl];
[configuration dbCountThreshold:config.dbCountThreshold];
_metricsClient = [[RSMetricsClient alloc] initWithConfiguration:configuration];
_metricsClient.isMetricsCollectionEnabled = preferenceManager.isMetricsCollectionEnabled;
_metricsClient.isErrorsCollectionEnabled = preferenceManager.isErrorsCollectionEnabled;
} else {
[RSLogger logWarn:@"RSMetricsReporter: Data plane url cannot be nil or empty."];
}
} else {
[RSLogger logWarn:@"RSMetricsReporter: Metrics and Errors collection is disabled."];
[RSLogger logWarn:@"RSMetricsReporter: Metrics and Errors collection is disabled."];
}
}
return self;
Expand Down
Loading