Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP lookup data adapter error reporting is inconsistent #19160

Open
kroepke opened this issue Apr 24, 2024 · 0 comments
Open

HTTP lookup data adapter error reporting is inconsistent #19160

kroepke opened this issue Apr 24, 2024 · 0 comments

Comments

@kroepke
Copy link
Member

kroepke commented Apr 24, 2024

When debugging a customer issue, we found that there are no usable error notifications in the UI, if the HTTP server returns unsuccessful status codes.

final Timer.Context time = httpRequestTimer.time();
try (final Response response = httpClient.newCall(request).execute()) {
if (!response.isSuccessful()) {
LOG.warn("HTTP request for key <{}> failed: {}", key, response);
httpRequestErrors.mark();
return getErrorResult();
}
final LookupResult result = parseBody(singleJsonPath, multiJsonPath, response.body().byteStream());
if (result == null) {
return getErrorResult();
}
return result;
} catch (IOException e) {
LOG.error("Data adapter <{}>: HTTP request error for key <{}> from URL <{}>", name(), key, urlString, e);
httpRequestErrors.mark();
Notification systemNotification = notificationService.buildNow()
.addType(Notification.Type.GENERIC)
.addSeverity(Notification.Severity.NORMAL)
.addDetail("title", "HTTP data adapter lookup failure")
.addDetail("description", f("Data adapter <%s>: HTTP request error from URL <%s>: %s", name(), urlString, e.getMessage()));
notificationService.publishIfFirst(systemNotification);
return getErrorResult();
} finally {
time.stop();
}

In this case an API returned 403 and the customer cannot see this happening in the UI.
Together with #19159 this lead to massive processing latency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants