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

Fix: Error when enabling prometheus metrics #2528

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions server/controllers/events/events_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func (e *VCSEventsController) handleGithubPost(w http.ResponseWriter, r *http.Re

githubReqID := "X-Github-Delivery=" + r.Header.Get("X-Github-Delivery")
logger := e.Logger.With("gh-request-id", githubReqID)
scope := e.Scope.SubScope("github.event")
scope := e.Scope.SubScope("github_event")

logger.Debug("request valid")

Expand All @@ -169,10 +169,10 @@ func (e *VCSEventsController) handleGithubPost(w http.ResponseWriter, r *http.Re
switch event := event.(type) {
case *github.IssueCommentEvent:
resp = e.HandleGithubCommentEvent(event, githubReqID, logger)
scope = scope.SubScope(fmt.Sprintf("comment.%s", *event.Action))
scope = scope.SubScope(fmt.Sprintf("comment_%s", *event.Action))
case *github.PullRequestEvent:
resp = e.HandleGithubPullRequestEvent(logger, event, githubReqID)
scope = scope.SubScope(fmt.Sprintf("pr.%s", *event.Action))
scope = scope.SubScope(fmt.Sprintf("pr_%s", *event.Action))
default:
resp = HTTPResponse{
body: fmt.Sprintf("Ignoring unsupported event %s", githubReqID),
Expand Down
2 changes: 1 addition & 1 deletion server/events/instrumented_pull_closed_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func NewInstrumentedPullClosedExecutor(
) PullCleaner {

return &InstrumentedPullClosedExecutor{
scope: scope.SubScope("pullclosed.cleanup"),
scope: scope.SubScope("pullclosed_cleanup"),
log: log,
cleaner: cleaner,
}
Expand Down