@@ -3981,9 +3981,9 @@ static int wg_transmit_unique_segment(
3981
3981
& response , ctx -> agent_translation_service_url , json , headers ,
3982
3982
STATIC_ARRAY_SIZE (headers ), 0 );
3983
3983
if (wg_result != 0 ) {
3984
- wg_log_json_message (ctx , "Error %d from wg_curl_get_or_post\n" ,
3985
- wg_result );
3986
- ERROR ("%s: Error %d from wg_curl_get_or_post" ,
3984
+ wg_log_json_message (ctx , "Error %d from wg_curl_get_or_post "
3985
+ "(CollectdTimeseries)\n" , wg_result );
3986
+ ERROR ("%s: Error %d from wg_curl_get_or_post (CollectdTimeseries) " ,
3987
3987
this_plugin_name , wg_result );
3988
3988
if (wg_result == -1 ) {
3989
3989
++ ctx -> ats_stats -> api_connectivity_failures ;
@@ -4028,12 +4028,19 @@ static int wg_transmit_unique_segment(
4028
4028
ctx , "Sending JSON (TimeseriesRequest) to %s:\n%s\n" ,
4029
4029
ctx -> custom_metrics_url , json );
4030
4030
4031
- if (wg_curl_get_or_post (
4032
- & response , ctx -> custom_metrics_url , json , headers ,
4033
- STATIC_ARRAY_SIZE (headers ), 0 ) != 0 ) {
4034
- wg_log_json_message (ctx , "Error contacting server.\n" );
4035
- ERROR ("write_gcm: Error talking to the endpoint." );
4036
- ++ ctx -> gsd_stats -> api_connectivity_failures ;
4031
+ int wg_result = wg_curl_get_or_post (
4032
+ & response , ctx -> custom_metrics_url , json , headers ,
4033
+ STATIC_ARRAY_SIZE (headers ), 0 );
4034
+ if (wg_result != 0 ) {
4035
+ wg_log_json_message (ctx , "Error %d from wg_curl_get_or_post "
4036
+ "(Timeseries)\n" , wg_result );
4037
+ ERROR ("%s: Error %d from wg_curl_get_or_post (Timeseries)" ,
4038
+ this_plugin_name , wg_result );
4039
+ if (wg_result == -1 ) {
4040
+ ++ ctx -> gsd_stats -> api_connectivity_failures ;
4041
+ } else {
4042
+ ++ ctx -> gsd_stats -> api_errors ;
4043
+ }
4037
4044
goto leave ;
4038
4045
}
4039
4046
0 commit comments