interceptors: migrate to otel and add logging interceptor

Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
2024-10-17 17:15:05 +02:00
parent 9591a64e09
commit 3a3d77169c
41 changed files with 2817 additions and 852 deletions

24
example/main.go Normal file
View File

@ -0,0 +1,24 @@
package main
import (
"context"
"github.com/spf13/cobra"
"go.linka.cloud/grpc-toolkit/service"
)
func main() {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
f, opts := service.NewFlagSet()
cmd := &cobra.Command{
Use: "example",
Run: func(cmd *cobra.Command, args []string) {
run(cmd.Context(), opts)
},
}
cmd.Flags().AddFlagSet(f)
cmd.ExecuteContext(ctx)
}