Add basic runtime tracing (#2996)

This allows us in almost all places to use regions to further trace down
long running tasks.
Also removes an unused function.
This commit is contained in:
Till 2023-03-13 16:45:14 +01:00 committed by GitHub
parent 689b5ee72f
commit 232aef016c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 190 additions and 155 deletions

View file

@ -10,8 +10,6 @@ import (
"time"
"github.com/matrix-org/dendrite/internal"
"github.com/opentracing/opentracing-go"
)
type httpClient struct {
@ -34,8 +32,8 @@ func NewHTTPClient(disableTLSValidation bool) Client {
}
func (h *httpClient) Notify(ctx context.Context, url string, req *NotifyRequest, resp *NotifyResponse) error {
span, ctx := opentracing.StartSpanFromContext(ctx, "Notify")
defer span.Finish()
trace, ctx := internal.StartRegion(ctx, "Notify")
defer trace.EndRegion()
body, err := json.Marshal(req)
if err != nil {