Skip to content

Commit

Permalink
feat: Remote Logging with manual set entityGuid and ingestKey feature…
Browse files Browse the repository at this point in the history
… complete.
  • Loading branch information
cdillard-NewRelic committed Jan 9, 2024
1 parent 1be17d1 commit 0aff012
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 42 deletions.
3 changes: 0 additions & 3 deletions Agent/General/NewRelicAgentInternal.m
Original file line number Diff line number Diff line change
Expand Up @@ -465,9 +465,6 @@ - (void) onSessionStart {
uuid);
self->_agentConfiguration.sessionIdentifier = uuid_String;

// TODO: Remove Logging Debugging Logging
NRLOG_VERBOSE(@"Set new sessionId = %@",uuid_String);

CFRelease(uuid);
if (self->_agentConfiguration.sessionIdentifier.length > 0) {
NRMA_setSessionId([self->_agentConfiguration.sessionIdentifier UTF8String]);
Expand Down
13 changes: 0 additions & 13 deletions Agent/Harvester/DataStore/NRMAHarvesterConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,6 @@ - (BOOL) isEqual:(id)object {
if (self.application_id != that.application_id) return NO;
if (![self.encoding_key isEqualToString:that.encoding_key]) return NO;

// Should trusted_account_key be considered in Equality

// Should entity_guid be considered in Equality?

// Should log_reporting be considered in Equality?


// [ <account id> , <app id> ];
return [self.data_token isEqual:that.data_token];
}
Expand All @@ -179,12 +172,6 @@ - (NSUInteger) hash
result = 31 * result + (unsigned int)self.application_id;
result = 31 * result + self.encoding_key.hash;

// Should trusted_account_key be considered in Hash?

// Should entity_guid be considered in Hash?

// Should log_reporting be considered in Hash?

return result;
}
@end
4 changes: 2 additions & 2 deletions Agent/Harvester/NRMAHarvester.mm
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,10 @@ - (void) connected
[self transition:NRMA_HARVEST_DISCONNECTED];
// Reconnect performed here.
[self execute];

// TODO: Is this the right place to send the configuration update Spt Metric?

// Send Supportability metric when received 409 to indicate that a config update should happen or send it when actual /connect call finishes which refreshes the data.
[NRMASupportMetricHelper enqueueConfigurationUpdateMetric];

break;
default:
break;
Expand Down
24 changes: 0 additions & 24 deletions Test Harness/NRTestApp/NRTestApp/ViewModels/UtilViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ class UtilViewModel {
options.append(UtilOption(title: "Notice Network Request", handler: { [self] in noticeNWRequest()}))
options.append(UtilOption(title: "Notice Network Failure", handler: { [self] in noticeFailedNWRequest()}))

options.append(UtilOption(title: "Notice Network Failure W Single Quotes", handler: { [self] in noticeFailedNWRequestWSingleQuotes()}))


options.append(UtilOption(title: "Toggle Remote Logging On/Off", handler: { [self] in toggleRemoteLogging()}))
options.append(UtilOption(title: "Test Log Dict", handler: { [self] in testLogDict()}))

options.append(UtilOption(title: "URLSession dataTask", handler: { [self] in doDataTask()}))
Expand Down Expand Up @@ -133,26 +129,6 @@ class UtilViewModel {
with: NRTimer(), andFailureCode: NSURLErrorTimedOut)
}

func noticeFailedNWRequestWSingleQuotes() {
NewRelic.noticeNetworkFailure(for: URL(string: "http://test.com/test('test')"), httpMethod: "GET",
with: NRTimer(), andFailureCode: NSURLErrorTimedOut)
}

var logEnabled = false

// testing only: this won't work once server supports settings this.
// Does not sync initial state.
func toggleRemoteLogging() {
if !logEnabled {
NewRelic.enableFeatures([NRMAFeatureFlags.NRFeatureFlag_LogReporting])
logEnabled = true
}
else {
NewRelic.disableFeatures([NRMAFeatureFlags.NRFeatureFlag_LogReporting])
logEnabled = false
}
}

func testLogDict() {
NewRelic.logAll([
"logLevel": "WARNING",
Expand Down

0 comments on commit 0aff012

Please sign in to comment.