Rendering: Add metrics (#23827)
* Rendering: base metrics * Rendering: rendering_queue_size metric * Chore: fix linter error * Rendering metrics: refactoring * Apply suggestions from code review Co-Authored-By: Marcus Efraimsson <marcus.efraimsson@gmail.com> * Rendering metrics: handle DeadlineExceeded errors * Rendering metrics: don't measure canceled request time * Rendering metrics: revert deleting summary for canceled requests * Update pkg/services/rendering/rendering.go Co-Authored-By: Marcus Efraimsson <marcus.efraimsson@gmail.com> * Rendering: return ErrTimeout if context deadline exceeded Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
This commit is contained in:
co-authored by
Marcus Efraimsson
parent
830e8dc5fd
commit
fa710a3172
@@ -45,6 +45,10 @@ func (rs *RenderingService) renderViaPluginV1(ctx context.Context, renderKey str
|
||||
rs.log.Debug("calling renderer plugin", "req", req)
|
||||
|
||||
rsp, err := rs.pluginInfo.GrpcPluginV1.Render(ctx, req)
|
||||
if ctx.Err() == context.DeadlineExceeded {
|
||||
rs.log.Info("Rendering timed out")
|
||||
return nil, ErrTimeout
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -84,6 +88,10 @@ func (rs *RenderingService) renderViaPluginV2(ctx context.Context, renderKey str
|
||||
rs.log.Debug("Calling renderer plugin", "req", req)
|
||||
|
||||
rsp, err := rs.pluginInfo.GrpcPluginV2.Render(ctx, req)
|
||||
if ctx.Err() == context.DeadlineExceeded {
|
||||
rs.log.Info("Rendering timed out")
|
||||
return nil, ErrTimeout
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user