func()

in pkg/metrics/stats_reporter.go [55:69]


func (r *reporter) ReportRequest(ctx context.Context, operationType, status string, duration float64, errors ...string) {
	labels := []attribute.KeyValue{
		attribute.String(operationTypeKey, operationType),
		attribute.String(statusTypeKey, status),
	}

	// Add errors
	if (status == ErrorStatusTypeValue) && len(errors) > 0 {
		for _, err := range errors {
			labels = append(labels, attribute.String(errorMessageKey, err))
		}
	}

	r.histogram.Record(ctx, duration, metric.WithAttributes(labels...))
}