208
func (p *processorImpl) bulkAfterAction(_ int64, requests []elastic.BulkableRequest, response *elastic.BulkResponse, err error) {
209
if err != nil {
211
>
var httpStatus int
212
>
var esErr *elastic.Error
213
>
if errors.As(err, &esErr) {
214
>
httpStatus = esErr.Status
215
>
}
216
218
>
for i, request := range requests {
219
>
if i < logFirstNRequests {
220
>
logRequests.WriteString(request.String())
221
>
logRequests.WriteRune('\n')
222
>
}
223
>
metrics.ElasticsearchBulkProcessorFailures.With(p.metricsHandler).Record(1, metrics.HttpStatusTag(httpStatus))
224
>
visibilityTaskKey := p.extractVisibilityTaskKey(request)
225
>
if visibilityTaskKey == "" {
226
continue
227
}
229
}
230
>
p.logger.Error("Unable to commit bulk ES request.", tag.Error(err), tag.RequestCount(len(requests)), tag.ESRequest(logRequests.String()))
processor.go
231
>
return
232
}
233