Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 925 Bytes

README.md

File metadata and controls

31 lines (21 loc) · 925 Bytes

OpenTelemetry Hooks for Twirp

The oteltwirp package creates an OpenTelemetry Twirp hook to use in your server. Derived from twirp-opentracing and otelgrpc.

Installation

go get -u github.com/qonto/oteltwirp

Server-side usage example

Where you are instantiating your Twirp server:

import (
    "github.com/qonto/oteltwirp"
    ...
)

hooks := oteltwirp.NewOpenTelemetryHooks()
service := haberdasherserver.New()
server := WithTraceContext(haberdasher.NewHaberdasherServer(service, hooks))
log.Fatal(http.ListenAndServe(":8080", server))

Client-side usage example

When instantiating your Twirp client:

client := haberdasher.NewHaberdasherProtobufClient(url, oteltwirp.NewTraceHTTPClient(http.DefaultClient))