implement grpc gateway and addl handler support
This commit is contained in:
19
pkg/app/run_http.go
Normal file
19
pkg/app/run_http.go
Normal file
@ -0,0 +1,19 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/codes"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
)
|
||||
|
||||
func (a *App) runHTTP(ctx context.Context) {
|
||||
span := trace.SpanFromContext(ctx)
|
||||
if err := a.initHTTP(ctx); err != nil {
|
||||
span.RecordError(err)
|
||||
span.SetStatus(codes.Error, err.Error())
|
||||
}
|
||||
span.AddEvent("http server started")
|
||||
span.SetAttributes(attribute.Int("http.handlers", len(a.HTTP.Funcs)))
|
||||
}
|
Reference in New Issue
Block a user