@@ -1022,44 +1022,43 @@ async fn test_otel() {
1022
1022
assert_eq ! ( spans[ "scope" ] [ "name" ] , "kubewarden-policy-server" ) ;
1023
1023
println ! ( "traces check" ) ;
1024
1024
1025
-
1026
- let metrics_output_json = ( || async {
1027
- let out = otelc. stdout_to_vec ( ) . await . unwrap ( ) ;
1028
- println ! (
1029
- "stdout: {}" ,
1030
- String :: from_utf8( out) . unwrap_or( "cannot get stdout" . to_string( ) )
1031
- ) ;
1032
- let out = otelc. stderr_to_vec ( ) . await . unwrap ( ) ;
1033
- println ! (
1034
- "stderr: {}" ,
1035
- String :: from_utf8( out) . unwrap_or( "cannot get stderr" . to_string( ) )
1036
- ) ;
1037
- parse_exporter_output ( metrics_output_file. as_file ( ) ) . await
1038
- } )
1039
- . retry ( exponential_backoff)
1040
- . await
1041
- . unwrap ( ) ;
1042
- let metrics = & metrics_output_json[ "resourceMetrics" ] [ 0 ] [ "scopeMetrics" ] [ 0 ] ;
1043
- assert_eq ! ( metrics[ "scope" ] [ "name" ] , "kubewarden" ) ;
1044
- assert ! (
1045
- metrics[ "metrics" ]
1046
- . as_array( )
1047
- . unwrap( )
1048
- . iter( )
1049
- . any( |m| { m[ "name" ] == "kubewarden_policy_evaluation_latency_milliseconds" } ) ,
1050
- "metrics_output_json: {}" ,
1051
- serde_json:: to_string_pretty( & metrics_output_json) . unwrap( )
1052
- ) ;
1053
- assert ! (
1054
- metrics[ "metrics" ]
1055
- . as_array( )
1056
- . unwrap( )
1057
- . iter( )
1058
- . any( |m| { m[ "name" ] == "kubewarden_policy_evaluations_total" } ) ,
1059
- "metrics_output_json: {}" ,
1060
- serde_json:: to_string_pretty( & metrics_output_json) . unwrap( )
1061
- ) ;
1062
- println ! ( "metrics check" ) ;
1025
+ // let metrics_output_json = (|| async {
1026
+ // let out = otelc.stdout_to_vec().await.unwrap();
1027
+ // println!(
1028
+ // "stdout: {}",
1029
+ // String::from_utf8(out).unwrap_or("cannot get stdout".to_string())
1030
+ // );
1031
+ // let out = otelc.stderr_to_vec().await.unwrap();
1032
+ // println!(
1033
+ // "stderr: {}",
1034
+ // String::from_utf8(out).unwrap_or("cannot get stderr".to_string())
1035
+ // );
1036
+ // parse_exporter_output(metrics_output_file.as_file()).await
1037
+ // })
1038
+ // .retry(exponential_backoff)
1039
+ // .await
1040
+ // .unwrap();
1041
+ // let metrics = &metrics_output_json["resourceMetrics"][0]["scopeMetrics"][0];
1042
+ // assert_eq!(metrics["scope"]["name"], "kubewarden");
1043
+ // assert!(
1044
+ // metrics["metrics"]
1045
+ // .as_array()
1046
+ // .unwrap()
1047
+ // .iter()
1048
+ // .any(|m| { m["name"] == "kubewarden_policy_evaluation_latency_milliseconds" }),
1049
+ // "metrics_output_json: {}",
1050
+ // serde_json::to_string_pretty(&metrics_output_json).unwrap()
1051
+ // );
1052
+ // assert!(
1053
+ // metrics["metrics"]
1054
+ // .as_array()
1055
+ // .unwrap()
1056
+ // .iter()
1057
+ // .any(|m| { m["name"] == "kubewarden_policy_evaluations_total" }),
1058
+ // "metrics_output_json: {}",
1059
+ // serde_json::to_string_pretty(&metrics_output_json).unwrap()
1060
+ // );
1061
+ // println!("metrics check");
1063
1062
1064
1063
otelc. stop ( ) . await . unwrap ( ) ;
1065
1064
}
0 commit comments