Skip to content

qonto/oteltwirp

 
 

Repository files navigation

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))

About

Simple OpenTelemetry hooks for Twirp

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%