@@ -85,14 +85,18 @@ DestinationWorker::init()
85
85
auto credentials = owner->credentials_builder .build ();
86
86
if (!credentials)
87
87
{
88
- msg_error (" Error querying Loki credentials" , log_pipe_location_tag ((LogPipe *) this ->super ->super .owner ));
88
+ msg_error (" Error querying Loki credentials" ,
89
+ evt_tag_str (" url" , owner->get_url ().c_str ()),
90
+ log_pipe_location_tag ((LogPipe *) this ->super ->super .owner ));
89
91
return false ;
90
92
}
91
93
92
94
this ->channel = ::grpc::CreateCustomChannel (owner->get_url (), credentials, args);
93
95
if (!this ->channel )
94
96
{
95
- msg_error (" Error creating Loki gRPC channel" , log_pipe_location_tag ((LogPipe *) this ->super ->super .owner ));
97
+ msg_error (" Error creating Loki gRPC channel" ,
98
+ evt_tag_str (" url" , owner->get_url ().c_str ()),
99
+ log_pipe_location_tag ((LogPipe *) this ->super ->super .owner ));
96
100
return false ;
97
101
}
98
102
@@ -110,6 +114,8 @@ DestinationWorker::deinit()
110
114
bool
111
115
DestinationWorker::connect ()
112
116
{
117
+ DestinationDriver *owner = this ->get_owner ();
118
+
113
119
this ->prepare_batch ();
114
120
115
121
msg_debug (" Connecting to Loki" , log_pipe_location_tag ((LogPipe *) this ->super ->super .owner ));
@@ -118,7 +124,12 @@ DestinationWorker::connect()
118
124
std::chrono::system_clock::now () + std::chrono::seconds (10 );
119
125
120
126
if (!this ->channel ->WaitForConnected (connect_timeout))
121
- return false ;
127
+ {
128
+ msg_error (" Time out connecting to Loki" ,
129
+ evt_tag_str (" url" , owner->get_url ().c_str ()),
130
+ log_pipe_location_tag ((LogPipe *) this ->super ->super .owner ));
131
+ return false ;
132
+ }
122
133
123
134
this ->connected = true ;
124
135
return true ;
@@ -240,6 +251,7 @@ DestinationWorker::flush(LogThreadedFlushMode mode)
240
251
if (!status.ok ())
241
252
{
242
253
msg_error (" Error sending Loki batch" , evt_tag_str (" error" , status.error_message ().c_str ()),
254
+ evt_tag_str (" url" , owner->get_url ().c_str ()),
243
255
evt_tag_str (" details" , status.error_details ().c_str ()),
244
256
log_pipe_location_tag ((LogPipe *) this ->super ->super .owner ));
245
257
result = LTR_ERROR;
0 commit comments