Add additional performance spans

This commit is contained in:
Maximilian Paß
2023-02-02 17:51:05 +00:00
parent 689344bd79
commit f2c205a8ed
19 changed files with 92 additions and 51 deletions

View File

@ -4,6 +4,7 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/getsentry/sentry-go"
"github.com/gorilla/mux"
"github.com/openHPI/poseidon/internal/environment"
"github.com/openHPI/poseidon/internal/runner"
@ -118,7 +119,9 @@ func (e *EnvironmentController) createOrUpdate(writer http.ResponseWriter, reque
return
}
created, err := e.manager.CreateOrUpdate(environmentID, *req)
span := sentry.StartSpan(request.Context(), "Create Environment")
created, err := e.manager.CreateOrUpdate(environmentID, *req, request.Context())
span.Finish()
if err != nil {
writeInternalServerError(writer, err, dto.ErrorUnknown)
}