Skip to content

Commit c0dedcf

Browse files
committed
Support JSON log record types
1 parent f69280e commit c0dedcf

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lambda-extension/src/telemetry.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ pub struct LambdaTelemetry {
2424
#[serde(tag = "type", content = "record", rename_all = "lowercase")]
2525
pub enum LambdaTelemetryRecord {
2626
/// Function log records
27-
Function(String),
27+
Function(serde_json::Value),
2828

2929
/// Extension log records
30-
Extension(String),
30+
Extension(serde_json::Value),
3131

3232
/// Platform init start record
3333
#[serde(rename = "platform.initStart", rename_all = "camelCase")]
@@ -336,13 +336,13 @@ mod deserialization_tests {
336336
// function
337337
function: (
338338
r#"{"time": "2020-08-20T12:31:32.123Z","type": "function", "record": "hello world"}"#,
339-
LambdaTelemetryRecord::Function("hello world".to_string()),
339+
LambdaTelemetryRecord::Function(serde_json::Value::String("hello world".to_string())),
340340
),
341341

342342
// extension
343343
extension: (
344344
r#"{"time": "2020-08-20T12:31:32.123Z","type": "extension", "record": "hello world"}"#,
345-
LambdaTelemetryRecord::Extension("hello world".to_string()),
345+
LambdaTelemetryRecord::Extension(serde_json::Value::String("hello world".to_string())),
346346
),
347347

348348
// platform.start
@@ -498,15 +498,15 @@ mod serialization_tests {
498498
function: (
499499
LambdaTelemetry {
500500
time: Utc.with_ymd_and_hms(2023, 11, 28, 12, 0, 9).unwrap(),
501-
record: LambdaTelemetryRecord::Function("hello world".to_string()),
501+
record: LambdaTelemetryRecord::Function(serde_json::Value::String("hello world".to_string())),
502502
},
503503
r#"{"time":"2023-11-28T12:00:09Z","type":"function","record":"hello world"}"#,
504504
),
505505
// extension
506506
extension: (
507507
LambdaTelemetry {
508508
time: Utc.with_ymd_and_hms(2023, 11, 28, 12, 0, 9).unwrap(),
509-
record: LambdaTelemetryRecord::Extension("hello world".to_string()),
509+
record: LambdaTelemetryRecord::Extension(serde_json::Value::String("hello world".to_string())),
510510
},
511511
r#"{"time":"2023-11-28T12:00:09Z","type":"extension","record":"hello world"}"#,
512512
),

0 commit comments

Comments
 (0)