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

Refine 404 handling in Restlet instrumentation #4206

Merged
merged 2 commits into from
Sep 27, 2021

Conversation

anosek-an
Copy link
Contributor

A small fix to the Restlet server instrumentation - if response code is 404, span name will be /*

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -71,6 +75,12 @@ public static void finishRequest(

scope.close();

if (response.getStatus() != null
&& response.getStatus().equals(Status.CLIENT_ERROR_NOT_FOUND)) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: this can be easily compacted to Status.CLIENT_ERROR_NOT_FOUND.equals(response.getStatus())
In general comparing constant - to - value allows to skip a nullcheck :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Certainly more elegant, thanks!

Copy link
Member

@trask trask left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@trask trask merged commit 8c522a1 into open-telemetry:main Sep 27, 2021
@anosek-an anosek-an deleted the fix-restlet-404 branch October 14, 2021 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants