Private
Public Access
1
0

trace tweaks
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-12-14 23:15:09 -08:00
parent 404c64b910
commit 36f695c146

View File

@@ -34,6 +34,8 @@ func (srv *Server) graphImage(c echo.Context) error {
log = log.With("serverID", serverID).With("type", imageType) log = log.With("serverID", serverID).With("type", imageType)
log.Info("graph parameters") log.Info("graph parameters")
span.SetAttributes(attribute.String("url.server_parameter", serverID))
if imageType != "offset.png" { if imageType != "offset.png" {
return c.String(http.StatusNotFound, "invalid image name") return c.String(http.StatusNotFound, "invalid image name")
} }
@@ -47,6 +49,10 @@ func (srv *Server) graphImage(c echo.Context) error {
} }
serverData, err := srv.FindServer(ctx, serverID) serverData, err := srv.FindServer(ctx, serverID)
if err != nil {
span.RecordError(err)
return c.String(http.StatusInternalServerError, "server error")
}
if serverData.ID == 0 { if serverData.ID == 0 {
return c.String(http.StatusNotFound, "not found") return c.String(http.StatusNotFound, "not found")
} }