-
Notifications
You must be signed in to change notification settings - Fork 126
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
RUMM-3458 Enable adding custom attributes to RUM telemetry (debug) logs #1378
RUMM-3458 Enable adding custom attributes to RUM telemetry (debug) logs #1378
Conversation
required updating the generator to not print custom coding implementation for immutable properties with default value.
573a9d3
to
a2267db
Compare
Datadog ReportBranch report: ✅ |
/// This property will be ignored in coding because it uses default value and is immutable | ||
public let ignoredProperty: String = "default value" | ||
|
||
enum StaticCodingKeys: String, CodingKey { | ||
case ignoredProperty = "ignoredProperty" | ||
} |
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.
Without the fix, rum-models-generator
would include this ignoredProperty
key for custom coding in encode(to:)
and init(from:)
printed below, making the code snippet not compile.
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.
👌
What and why?
📦 This PR enables sending custom attributes with debug messages through
Telemetry
interface:It makes a preliminary step to enable metrics in this interface. Although we will introduce separate method for metrics, the foundation of telemetry attributes is done here to be leveraged in
debug()
logs as well.How?
rum-models-generator
attributes: [String: Encodable]
property to.debug
telemetry message and forwarded it from publicTelemetry
API down to telemetry receiver in RUM.Fix in
rum-models-generator
Because DataDog/rum-events-format#154 introduced
"additionalProperties": true
to telemetry schema, it surfaced a gap in our code generation whererum-models-generator
was printing invalid Swift code for customencode(to:)
anddecode(from:)
conformance when a type includes constant property (immutable with default value).Review checklist
Custom CI job configuration (optional)