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

Adding more tags for panic metrics #928

Merged
merged 1 commit into from
Feb 28, 2024
Merged

Conversation

anirudhraja
Copy link

EndpointID and HandlerID tags if present will help debug panic metrics with ease. Adding these tags in this diff.

@@ -301,8 +301,14 @@ func (router *httpRouter) handlePanic(
}
logger := router.gateway.ContextLogger
logger.Error(r.Context(), "A http request handler paniced", zap.Error(err), zap.Int(logFieldResponseStatusCode, http.StatusInternalServerError))
router.panicCount.Inc(1)

m := router.gateway.ContextExtractor.ExtractScopeTags(r.Context())
Copy link
Contributor

Choose a reason for hiding this comment

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

Can a gateway be nil resulting in nil pointer?

@anirudhraja anirudhraja force-pushed the anirudh/panicMetricsFix branch from 41836d7 to ff181e8 Compare February 28, 2024 07:12
Copy link
Contributor

@shivam-srivastava28 shivam-srivastava28 left a comment

Choose a reason for hiding this comment

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

LGTM

@anirudhraja anirudhraja merged commit e16bccc into version-2 Feb 28, 2024
4 checks passed
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