-
Notifications
You must be signed in to change notification settings - Fork 133
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(logs): Add error fingerprint attribute #1722
Conversation
Allow users to provide custom fingerprint in log calls that is transferred to the LogEvent refs: RUM-2906
69127be
to
58ed3aa
Compare
Datadog ReportBranch report: ❌ 1 Failed (0 Known Flaky), 1238 Passed, 0 Skipped, 1m 26.81s Wall Time ❌ Failed Tests (1)
🔻 Code Coverage Decreases vs Default Branch (1)
|
6ab2625
to
90e91a3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Well done 👍. There are some blocking points in public API comments.
Except in-line comments, what's our take on allowing fingerprint in RUM resource errors?
@@ -68,6 +68,7 @@ internal struct LogMessageReceiver: FeatureMessageReceiver { | |||
level: log.level, | |||
message: log.message, | |||
error: log.error, | |||
errorFingerprint: nil, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion/ (separate effort to consider rather than a change in this PR) This flow corresponds to sending logs from spans (span.log(fields:)
API), so in theory it could support Trace.Attributes.errorFingerprint
as well for consistency 💡.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed at standup, it sounds like we won't support fingerprinting through traces at the moment.
@@ -110,6 +110,7 @@ internal final class RemoteLogger: LoggerProtocol { | |||
let tags = self.tags | |||
var logAttributes = attributes | |||
let isCrash = logAttributes?.removeValue(forKey: CrossPlatformAttributes.errorLogIsCrash) as? Bool ?? false | |||
let errorFingerprint = logAttributes?.removeValue(forKey: Logs.Attributes.errorFingerprint) as? String |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question/ Shouldn't we check if level
is >= error
🤔, so this is not applied to lower severities?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No I don't think so, as you can pass errors to any level. I could check that an error was passed in though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, indeed 👍. All good 👌
IntegrationTests/Runner/Scenarios/RUM/ManualInstrumentation/SendRUMFixture3ViewController.swift
Outdated
Show resolved
Hide resolved
Co-authored-by: Maciek Grzybowski <maciek.grzybowski@datadoghq.com>
f1cdfbf
to
8c6eb1b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
PS. I removed IPHONEOS_DEPLOYMENT_TARGET
overrides in 45229f7 as they went again into the change 😉
What and why?
Allow users to provide custom error fingerprint attribute.
In Logs the attribute
Logs.Attributes.errorFingerprint
is added to any log call and added to theLogEvent.Error.fingerprint
member.In RUM, the attribute
RUM.Attributes.errorFingterprint
is added toaddError
calls and it is transferred to theRUMError.finterprint
memberrefs: RUM-2906
How?
A special attribute (defined at
Logs.Attributes.errorFingerprint
) is read and moved during LogEvent creationReview checklist
Custom CI job configuration (optional)
tools/