@@ -1049,6 +1049,19 @@ describe("normalizeAndValidateConfig()", () => {
10491049 observability : {
10501050 enabled : true ,
10511051 head_sampling_rate : 1 ,
1052+ logs : {
1053+ enabled : true ,
1054+ head_sampling_rate : 1 ,
1055+ invocation_logs : true ,
1056+ destinations : [ "test" ] ,
1057+ persist : true ,
1058+ } ,
1059+ traces : {
1060+ enabled : true ,
1061+ head_sampling_rate : 1 ,
1062+ destinations : [ "test" ] ,
1063+ persist : true ,
1064+ } ,
10521065 } ,
10531066 } ;
10541067
@@ -1136,6 +1149,19 @@ describe("normalizeAndValidateConfig()", () => {
11361149 observability : {
11371150 enabled : "INVALID" ,
11381151 head_sampling_rate : "INVALID" ,
1152+ logs : {
1153+ enabled : "INVALID" ,
1154+ head_sampling_rate : "INVALID" ,
1155+ destinations : "INVALID" ,
1156+ persist : "INVALID" ,
1157+ invocation_logs : "INVALID" ,
1158+ } ,
1159+ traces : {
1160+ enabled : "INVALID" ,
1161+ head_sampling_rate : "INVALID" ,
1162+ destinations : "INVALID" ,
1163+ persist : "INVALID" ,
1164+ } ,
11391165 } ,
11401166 } as unknown as RawEnvironment ;
11411167
@@ -1208,9 +1234,18 @@ describe("normalizeAndValidateConfig()", () => {
12081234 - Expected \\"logpush\\" to be of type boolean but got \\"INVALID\\".
12091235 - Expected \\"upload_source_maps\\" to be of type boolean but got \\"INVALID\\".
12101236 - Expected \\"observability.enabled\\" to be of type boolean but got \\"INVALID\\".
1211- - Expected \\"observability.logs.enabled\\" to be of type boolean but got undefined.
1212- - Expected \\"observability.traces.enabled\\" to be of type boolean but got undefined.
1213- - Expected \\"observability.head_sampling_rate\\" to be of type number but got \\"INVALID\\"."
1237+ - Expected \\"observability.logs.enabled\\" to be of type boolean but got \\"INVALID\\".
1238+ - Expected \\"observability.traces.enabled\\" to be of type boolean but got \\"INVALID\\".
1239+ - Expected \\"observability.head_sampling_rate\\" to be of type number but got \\"INVALID\\".
1240+ - Expected \\"observability.logs.enabled\\" to be of type boolean but got \\"INVALID\\".
1241+ - Expected \\"observability.logs.head_sampling_rate\\" to be of type number but got \\"INVALID\\".
1242+ - Expected \\"observability.logs.invocation_logs\\" to be of type boolean but got \\"INVALID\\".
1243+ - Expected \\"logs.destinations\\" to be an array of strings but got \\"INVALID\\"
1244+ - Expected \\"observability.logs.persist\\" to be of type boolean but got \\"INVALID\\".
1245+ - Expected \\"observability.traces.enabled\\" to be of type boolean but got \\"INVALID\\".
1246+ - Expected \\"observability.traces.head_sampling_rate\\" to be of type number but got \\"INVALID\\".
1247+ - Expected \\"traces.destinations\\" to be an array of strings but got \\"INVALID\\"
1248+ - Expected \\"observability.traces.persist\\" to be of type boolean but got \\"INVALID\\"."
12141249 ` ) ;
12151250 } ) ;
12161251
@@ -6682,6 +6717,36 @@ describe("normalizeAndValidateConfig()", () => {
66826717 ` ) ;
66836718 } ) ;
66846719
6720+ it ( "should not warn on full observability config" , ( ) => {
6721+ const { diagnostics } = normalizeAndValidateConfig (
6722+ {
6723+ observability : {
6724+ enabled : true ,
6725+ head_sampling_rate : 1 ,
6726+ logs : {
6727+ enabled : true ,
6728+ head_sampling_rate : 1 ,
6729+ invocation_logs : true ,
6730+ destinations : [ "test" ] ,
6731+ persist : true ,
6732+ } ,
6733+ traces : {
6734+ enabled : true ,
6735+ head_sampling_rate : 1 ,
6736+ destinations : [ "test" ] ,
6737+ persist : true ,
6738+ } ,
6739+ } ,
6740+ } as unknown as RawConfig ,
6741+ undefined ,
6742+ undefined ,
6743+ { env : undefined }
6744+ ) ;
6745+
6746+ expect ( diagnostics . hasWarnings ( ) ) . toBe ( false ) ;
6747+ expect ( diagnostics . hasErrors ( ) ) . toBe ( false ) ;
6748+ } ) ;
6749+
66856750 it ( "should error on invalid observability.logs" , ( ) => {
66866751 const { diagnostics } = normalizeAndValidateConfig (
66876752 {
0 commit comments