Skip to content
New issue

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

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

Already on GitHub? # to your account

Http errors #183

Merged
merged 3 commits into from
Oct 30, 2023
Merged

Http errors #183

merged 3 commits into from
Oct 30, 2023

Conversation

bryce-b
Copy link
Contributor

@bryce-b bryce-b commented Oct 27, 2023

This PR creates an "error" for http errors, which will then show up in the errors tab of the UI.

@bryce-b
Copy link
Contributor Author

bryce-b commented Oct 27, 2023

@LikeTheSalad you make want to add something similar for the android agent.

span.addEvent(name : SemanticAttributes.exception.rawValue,
attributes: [SemanticAttributes.exceptionType.rawValue: AttributeValue.string("\(httpResponse.statusCode)"),
SemanticAttributes.exceptionEscaped.rawValue: AttributeValue.bool(false),
SemanticAttributes.exceptionMessage.rawValue: AttributeValue.string(HTTPURLResponse.localizedString(forStatusCode: httpResponse.statusCode)),
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to try to keep things consistent in Android, what's the message format provided by HTTPURLResponse.localizedString(forStatusCode: httpResponse.statusCode)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for a 404 this produces "Not Found"
It's using the string values described in RFC 2616

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants