@ -775,19 +775,15 @@ class CustomPluginOption
} ;
TEST_F ( OpenTelemetryPluginOptionEnd2EndTest , Basic ) {
std : : vector <
std : : unique_ptr < grpc : : internal : : InternalOpenTelemetryPluginOption > >
plugin_option_list ;
plugin_option_list . emplace_back ( std : : make_unique < CustomPluginOption > (
/*enabled_on_client*/ true , /*enabled_on_server*/ true ,
std : : make_pair ( " key " , " value " ) ) ) ;
Init (
std : : move ( Options ( )
. set_metric_names ( { grpc : : OpenTelemetryPluginBuilder : :
kClientAttemptDurationInstrumentName ,
grpc : : OpenTelemetryPluginBuilder : :
kServerCallDurationInstrumentName } )
. set_plugin_options ( std : : move ( plugin_option_list ) ) ) ) ;
. add_plugin_option ( std : : make_unique < CustomPluginOption > (
/*enabled_on_client*/ true , /*enabled_on_server*/ true ,
std : : make_pair ( " key " , " value " ) ) ) ) ) ;
SendRPC ( ) ;
auto data = ReadCurrentMetricsData (
[ & ] ( const absl : : flat_hash_map <
@ -812,19 +808,15 @@ TEST_F(OpenTelemetryPluginOptionEnd2EndTest, Basic) {
}
TEST_F ( OpenTelemetryPluginOptionEnd2EndTest , ClientOnlyPluginOption ) {
std : : vector <
std : : unique_ptr < grpc : : internal : : InternalOpenTelemetryPluginOption > >
plugin_option_list ;
plugin_option_list . emplace_back ( std : : make_unique < CustomPluginOption > (
/*enabled_on_client*/ true , /*enabled_on_server*/ false ,
std : : make_pair ( " key " , " value " ) ) ) ;
Init (
std : : move ( Options ( )
. set_metric_names ( { grpc : : OpenTelemetryPluginBuilder : :
kClientAttemptDurationInstrumentName ,
grpc : : OpenTelemetryPluginBuilder : :
kServerCallDurationInstrumentName } )
. set_plugin_options ( std : : move ( plugin_option_list ) ) ) ) ;
. add_plugin_option ( std : : make_unique < CustomPluginOption > (
/*enabled_on_client*/ true , /*enabled_on_server*/ false ,
std : : make_pair ( " key " , " value " ) ) ) ) ) ;
SendRPC ( ) ;
auto data = ReadCurrentMetricsData (
[ & ] ( const absl : : flat_hash_map <
@ -850,19 +842,15 @@ TEST_F(OpenTelemetryPluginOptionEnd2EndTest, ClientOnlyPluginOption) {
}
TEST_F ( OpenTelemetryPluginOptionEnd2EndTest , ServerOnlyPluginOption ) {
std : : vector <
std : : unique_ptr < grpc : : internal : : InternalOpenTelemetryPluginOption > >
plugin_option_list ;
plugin_option_list . emplace_back ( std : : make_unique < CustomPluginOption > (
/*enabled_on_client*/ false , /*enabled_on_server*/ true ,
std : : make_pair ( " key " , " value " ) ) ) ;
Init (
std : : move ( Options ( )
. set_metric_names ( { grpc : : OpenTelemetryPluginBuilder : :
kClientAttemptDurationInstrumentName ,
grpc : : OpenTelemetryPluginBuilder : :
kServerCallDurationInstrumentName } )
. set_plugin_options ( std : : move ( plugin_option_list ) ) ) ) ;
. add_plugin_option ( std : : make_unique < CustomPluginOption > (
/*enabled_on_client*/ false , /*enabled_on_server*/ true ,
std : : make_pair ( " key " , " value " ) ) ) ) ) ;
SendRPC ( ) ;
auto data = ReadCurrentMetricsData (
[ & ] ( const absl : : flat_hash_map <
@ -889,32 +877,27 @@ TEST_F(OpenTelemetryPluginOptionEnd2EndTest, ServerOnlyPluginOption) {
TEST_F ( OpenTelemetryPluginOptionEnd2EndTest ,
MultipleEnabledAndDisabledPluginOptions ) {
std : : vector <
std : : unique_ptr < grpc : : internal : : InternalOpenTelemetryPluginOption > >
plugin_option_list ;
plugin_option_list . reserve ( 5 ) ;
plugin_option_list . emplace_back ( std : : make_unique < CustomPluginOption > (
/*enabled_on_client*/ true , /*enabled_on_server*/ true ,
std : : make_pair ( " key1 " , " value1 " ) ) ) ;
plugin_option_list . emplace_back ( std : : make_unique < CustomPluginOption > (
/*enabled_on_client*/ true , /*enabled_on_server*/ false ,
std : : make_pair ( " key2 " , " value2 " ) ) ) ;
plugin_option_list . emplace_back ( std : : make_unique < CustomPluginOption > (
/*enabled_on_client*/ true , /*enabled_on_server*/ false ,
std : : make_pair ( " key3 " , " value3 " ) ) ) ;
plugin_option_list . emplace_back ( std : : make_unique < CustomPluginOption > (
/*enabled_on_client*/ false , /*enabled_on_server*/ true ,
std : : make_pair ( " key4 " , " value4 " ) ) ) ;
plugin_option_list . emplace_back ( std : : make_unique < CustomPluginOption > (
/*enabled_on_client*/ false , /*enabled_on_server*/ true ,
std : : make_pair ( " key5 " , " value5 " ) ) ) ;
Init (
std : : move ( Options ( )
. set_metric_names ( { grpc : : OpenTelemetryPluginBuilder : :
kClientAttemptDurationInstrumentName ,
grpc : : OpenTelemetryPluginBuilder : :
kServerCallDurationInstrumentName } )
. set_plugin_options ( std : : move ( plugin_option_list ) ) ) ) ;
. add_plugin_option ( std : : make_unique < CustomPluginOption > (
/*enabled_on_client*/ true , /*enabled_on_server*/ true ,
std : : make_pair ( " key1 " , " value1 " ) ) )
. add_plugin_option ( std : : make_unique < CustomPluginOption > (
/*enabled_on_client*/ true , /*enabled_on_server*/ false ,
std : : make_pair ( " key2 " , " value2 " ) ) )
. add_plugin_option ( std : : make_unique < CustomPluginOption > (
/*enabled_on_client*/ true , /*enabled_on_server*/ false ,
std : : make_pair ( " key3 " , " value3 " ) ) )
. add_plugin_option ( std : : make_unique < CustomPluginOption > (
/*enabled_on_client*/ false , /*enabled_on_server*/ true ,
std : : make_pair ( " key4 " , " value4 " ) ) )
. add_plugin_option ( std : : make_unique < CustomPluginOption > (
/*enabled_on_client*/ false , /*enabled_on_server*/ true ,
std : : make_pair ( " key5 " , " value5 " ) ) ) ) ) ;
SendRPC ( ) ;
auto data = ReadCurrentMetricsData (
[ & ] ( const absl : : flat_hash_map <