Enable Sentry Performance Tracing
This commit is contained in:
@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"github.com/getsentry/sentry-go"
|
"github.com/getsentry/sentry-go"
|
||||||
|
sentryhttp "github.com/getsentry/sentry-go/http"
|
||||||
"github.com/openHPI/poseidon/internal/api"
|
"github.com/openHPI/poseidon/internal/api"
|
||||||
"github.com/openHPI/poseidon/internal/config"
|
"github.com/openHPI/poseidon/internal/config"
|
||||||
"github.com/openHPI/poseidon/internal/environment"
|
"github.com/openHPI/poseidon/internal/environment"
|
||||||
@ -102,6 +103,9 @@ func initServer() *http.Server {
|
|||||||
runnerManager, environmentManager = createManagerHandler(createAWSManager, config.Config.AWS.Enabled,
|
runnerManager, environmentManager = createManagerHandler(createAWSManager, config.Config.AWS.Enabled,
|
||||||
runnerManager, environmentManager)
|
runnerManager, environmentManager)
|
||||||
|
|
||||||
|
handler := api.NewRouter(runnerManager, environmentManager)
|
||||||
|
sentryHandler := sentryhttp.New(sentryhttp.Options{}).Handle(handler)
|
||||||
|
|
||||||
return &http.Server{
|
return &http.Server{
|
||||||
Addr: config.Config.Server.URL().Host,
|
Addr: config.Config.Server.URL().Host,
|
||||||
// A WriteTimeout would prohibit long-running requests such as creating an execution environment.
|
// A WriteTimeout would prohibit long-running requests such as creating an execution environment.
|
||||||
@ -110,7 +114,7 @@ func initServer() *http.Server {
|
|||||||
ReadHeaderTimeout: time.Second * 15,
|
ReadHeaderTimeout: time.Second * 15,
|
||||||
ReadTimeout: time.Second * 15,
|
ReadTimeout: time.Second * 15,
|
||||||
IdleTimeout: time.Second * 60,
|
IdleTimeout: time.Second * 60,
|
||||||
Handler: api.NewRouter(runnerManager, environmentManager),
|
Handler: sentryHandler,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,6 +71,12 @@ sentry:
|
|||||||
# This release information is used by Poseidon to provide the version route.
|
# This release information is used by Poseidon to provide the version route.
|
||||||
# Normally it is set by the deployment process.
|
# Normally it is set by the deployment process.
|
||||||
# release: this is replaced in the deployment process
|
# release: this is replaced in the deployment process
|
||||||
|
# In debug mode, the debug information is printed to stdout to help you understand what sentry is doing.
|
||||||
|
# debug: true
|
||||||
|
# Enable performance tracing.
|
||||||
|
# enabletracing: true
|
||||||
|
# The sample rate for sampling traces in the range [0.0, 1.0].
|
||||||
|
# tracessamplerate: 1.0
|
||||||
|
|
||||||
# Configuration of the influxdb monitoring
|
# Configuration of the influxdb monitoring
|
||||||
influxdb:
|
influxdb:
|
||||||
|
Reference in New Issue
Block a user