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

Emit the error code and type to the tracing span for inbound calls #903

Merged
merged 3 commits into from
Aug 29, 2023

Conversation

deepanshumehndiratta
Copy link
Contributor

@deepanshumehndiratta deepanshumehndiratta commented Aug 22, 2023

Changelog

  1. Emit the error code and type to the tracing span for inbound calls

Description

This change adds the error type and code (for system errors) to the tracing spans for inbound requests.

@CLAassistant
Copy link

CLAassistant commented Aug 22, 2023

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Aug 22, 2023

Codecov Report

Patch coverage: 71.79% and project coverage change: +0.10% 🎉

Comparison is base (0c11cc2) 88.78% compared to head (f3409ca) 88.89%.
Report is 5 commits behind head on dev.

❗ Current head f3409ca differs from pull request most recent head 51344aa. Consider uploading reports for the commit 51344aa to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #903      +/-   ##
==========================================
+ Coverage   88.78%   88.89%   +0.10%     
==========================================
  Files          43       43              
  Lines        4440     4510      +70     
==========================================
+ Hits         3942     4009      +67     
  Misses        379      379              
- Partials      119      122       +3     
Files Changed Coverage Δ
outbound.go 87.86% <33.33%> (+0.72%) ⬆️
messages.go 91.58% <50.00%> (-6.27%) ⬇️
inbound.go 79.51% <61.53%> (-2.88%) ⬇️
mex.go 75.42% <76.00%> (+2.91%) ⬆️
connection.go 88.39% <88.88%> (+3.40%) ⬆️
relay.go 85.77% <100.00%> (+0.06%) ⬆️
relay_messages.go 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +423 to +429
errorType := appErrorType
if response.systemError {
errorType = systemErrorType
// if the error is a system error, set the error code in span log
span.SetTag("rpc.tchannel.system_error_code", GetSystemErrorCode(response.err))
}
span.SetTag("rpc.tchannel.error_type", errorType)

Choose a reason for hiding this comment

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

I feel something like this could be easier to read:
(Also - we can add the error message to the span log)

	if span := response.span; span != nil {
		if response.systemError {
			ext.Error.Set(span, true)
			span.SetTag("rpc.tchannel.error_type", "system")
			span.SetTag("rpc.tchannel.system.error_code", GetSystemErrorCode(response.err))
			span.LogKV("rpc.tchannel.system.error_message", GetSystemErrorMessage(response.err))
		} else if response.applicationError {
			ext.Error.Set(span, true)
			span.SetTag("rpc.tchannel.error_type", "application")
		}

Copy link
Collaborator

Choose a reason for hiding this comment

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

sorry for coming late to this. why weren't these changes tested?

@AllenLuUber AllenLuUber requested review from dastbe and jronak and removed request for ChenX1993 August 25, 2023 15:55
@deepanshumehndiratta deepanshumehndiratta merged commit 628e1b3 into dev Aug 29, 2023
@deepanshumehndiratta deepanshumehndiratta deleted the codespace-solid-journey-jr9494xg4f5477 branch August 29, 2023 06:13
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.

5 participants