Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gonicus/grpc-opentracing-opencensus-adapter
https://github.com/gonicus/grpc-opentracing-opencensus-adapter
Last synced: 9 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/gonicus/grpc-opentracing-opencensus-adapter
- Owner: gonicus
- License: mit
- Created: 2020-09-02T10:27:25.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-01T10:04:46.000Z (over 4 years ago)
- Last Synced: 2024-06-20T16:41:14.321Z (7 months ago)
- Language: Go
- Size: 9.77 KB
- Stars: 0
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gRPC OpenTracing to OpenCensus Adapter
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
This adapter injects an OpenCensus span in the metadata of a gRPC call, which is extracted from your OpenTracing span before.
If your project uses OpenTracing and you call a service via gRPC, which uses OpenCensus, this adapter makes the span available in the remote service.
```go
d, err := grpc.Dial("localhost:9080", grpc.WithInsecure(),
grpc.WithUnaryInterceptor(otocadapter.OpenCensusAdapterClientInterceptor(tracer)),
)
if err != nil {
logrus.Fatalln("Can't connect to DGraph:", err)
}
defer func() {
d.Close()
logrus.Info("Closed Dgraph connection...")
}()
dgraphClient := dgo.NewDgraphClient(api.NewDgraphClient(d))
```## Install
```
go get -u github.com/gonicus/grpc-opentracing-opencensus-adapter
```