The plugins of opentracing-go.

OpenTracing-Go-Plugins

The plugins of opentracing-go.

Installation

go get -u github.com/yuewokeji/opentracing-go-plugins

Configuration

Initialize a tracer

Create a tracer such as jaeger.

package main

import (
	"github.com/opentracing/opentracing-go"
	"github.com/uber/jaeger-client-go"
	"github.com/uber/jaeger-client-go/transport"
	"io"
)

func initJaeger(service, url string) (opentracing.Tracer, io.Closer) {
	sender := transport.NewHTTPTransport(url)
	reporter := jaeger.NewRemoteReporter(sender, jaeger.ReporterOptions.Logger(jaeger.StdLogger))

	// samples 100% of traces
	tracer, closer := jaeger.NewTracer(service, jaeger.NewConstSampler(true), reporter)
	return tracer, closer
}

Initialize the global tracer

Let's initialize the global tracer, that's because the function opentracing.GlobalTracer() returns a no-op tracer by default.

func initGlobalTracer() io.Closer {
	// the closer can be used in shutdown hooks
	tracer, closer := initJaeger("hello-world", "https://your-reporter-url")

	opentracing.SetGlobalTracer(tracer)
	return closer
}

Plugin Summary

  1. goroutine
  2. gin
  3. goredis
  4. gorm
  5. grpc
  6. http client
  7. omnipotent
Similar Resources

🎉 An awesome version control tool for protoc and its related plugins.

🎉 An awesome version control tool for protoc and its related plugins.

❤️ PowerProto is actively maintained! Any questions in use can be directly raised issue, I will respond to you as fast as possible. If you think the p

Dec 29, 2022

Go Support Code For Writing Falcosecurity Plugins

plugin-sdk-go Go package to facilitate writing Falco/Falco libs plugins. Before using this package, review the developer's guide which fully documents

Sep 20, 2021

go program that installs and customizes ohmyzsh tmux vim via various plugins and other nice to haves

go program that installs and customizes ohmyzsh tmux vim via various plugins and other nice to haves

Pimp-My-Shell Table of Contents Pimp-My-Shell Install Usage About Resources Tmux Hotkeys VIM Hotkeys Adjusting Custom Aliases Mac Fix Terminal bind ke

Dec 22, 2022

Command line tools for creating and compiling JavaScript Minecraft plugins.

@customrealms/cli CustomRealms command-line tools for setting up and compiling JavaScript Minecraft plugins. Installation Install the CLI on your comp

Aug 2, 2022

Kong Api Gateway Plugins for golang

Prerequisites: Windows Docker. Build Command: docker build -t kong-plugins . Run Command: docker run -ti --rm --name kong-plugins -e "KONG_DATABASE=of

Aug 3, 2022

Installs containerd on Windows, optionally with default CNI plugins

containerd-installer Installs containerd on Windows, optionally with default CNI plugins Usage NAME: containerd-installer.exe - Install containerd

Nov 27, 2022

This is kubectl-plugins repository

This is kubectl-plugins repository

golang CLI Template golang project template for building CLI Setup Setup by Command git clone https://github.com/mpppk/cli-template your_awesome_tool

Dec 20, 2021

This plugins watches and builds the source files continiusly in-memory

Caddy Esbuild plugin This plugins watches and builds the source files continiusly in-memory. It includes a etag to cache in the browser to save bandwi

Jun 17, 2022

Go C-based plugins loader

dlplugin This package is based on the official Go plugin package, but modified to use any dynamic C libraries (Only Linux, FreeBSD, and macOS). It pro

Sep 6, 2022

Script to generate a web page for your Aliucord plugins repo.

Aliucord-Store Script used to generate a website front-end for your plugins. Usage: go run cmds/store/main.go -dir string Your repository's

Jan 31, 2022

🔌 RR plugins interfaces and proto API

🔌  RR plugins interfaces and proto API

RoadRunner API RR API consists of 2 parts: Plugin interfaces. Proto API for the PHP clients, at the moment released as V1Beta. Plugins should depend o

Jan 5, 2023

Jaken - A general purpose IRC bot featuring user acls and arbitrary plugins

Design principles This bot is based on the premise of a loosely coupling between

Jul 21, 2022

Provides agent and server plugins for SPIRE to allow Tailscale node attestation.

SPIRE Tailscale Plugin ⚠️ this node attestation plugin relies on a Tailscale OIDC id-token feature, which is marked as Work-in-Progress and may not be

May 22, 2022
Comments
  • 【请教】按照 Readme 添加了初始化和注入 gorm/gin Plugin 后 jaeger-ui 中没有新的服务

    【请教】按照 Readme 添加了初始化和注入 gorm/gin Plugin 后 jaeger-ui 中没有新的服务

    大致代码(Gin 部分)如下,不知道是不是我哪里理解或者使用方式不当?

    之前链路追踪实践的经验比较少,如果有什么小白的地方作者还望大大多多包涵(抱拳)。

    // main.go
    
    var (
    	tracerCloser io.Closer
    )
    
    func main() {
            // 调用 tracer 初始化
    	tracerCloser = initialize.InitGlobalTracer()
            // 调用 gin 初始化
    	core.RunServer()
    	err := tracerCloser.Close()
    	if err != nil {
    		fmt.Println("tracerCloser failed:", err.Error())
    	}
    }
    
    //  initialize.jaeger.go
    package initialize
    
    import (
    	"io"
    
    	"github.com/opentracing/opentracing-go"
    	"github.com/temptup/temptup.api/global"
    	"github.com/uber/jaeger-client-go"
    	"github.com/uber/jaeger-client-go/transport"
    )
    
    func initJaeger(service, url string) (opentracing.Tracer, io.Closer) {
    	sender := transport.NewHTTPTransport(url)
    	reporter := jaeger.NewRemoteReporter(sender, jaeger.ReporterOptions.Logger(jaeger.StdLogger))
    
    	// samples 100% of traces
    	tracer, closer := jaeger.NewTracer(service, jaeger.NewConstSampler(true), reporter)
    	return tracer, closer
    }
    
    func InitGlobalTracer() io.Closer {
    	// the closer can be used in shutdown hooks
    	tracer, closer := initJaeger("demo", "http://127.0.0.1")
    
    	opentracing.SetGlobalTracer(tracer)
    	return closer
    }
    
    
    // core.server.go
    func RunServer() {
        router := initialize.Routers()
    
        s := initServer("127.0.0.1:8888", router)
    
        go func() {
            fmt.Println(s.ListenAndServe().Error())
        }()
    
        graceful.ShutdownAndCleanup(func() {
            _, cancel := context.WithTimeout(context.Background(), 5*time.Second)
            cancel()
        })
    }
    
    // initialize.router.go
    var Router = gin.Default()
    
    // jaeger
    func Routers() *gin.Engine {
    
        var Router = gin.Default()
    
        // 注入 trace
        Router.Use(otgin.NewMiddleware(Router))
    
        // swagger
        Router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
        // ......
        fmt.Println("register swagger handler")
    
        return Router
    }
    
opentracing integration with GORM
opentracing integration with GORM

gorm-opentracing opentracing support for gorm2. Features Record SQL in span logs. Record Result in span logs. Record Table in span tags. Record Error

Nov 27, 2022
Opentracing factory to setup by multiples vendors

telemetry Opentracing factory to setup by multiples vendors. Usage telemetry.InitTracer( telemetry.WithJaeger(os.Getenv("APP_NAME")), telemetr

Jul 23, 2021
Progress OpenEdge Profiler data parsing to OpenTracing format

openedge-profiler-parser Progress OpenEdge Profiler data parsing to OpenTracing format. Prerequisites In order to RUN you will be enough with Docker:

Nov 9, 2021
Enable requests served by caddy for distributed tracing via The OpenTracing Project.

caddy-opentracing Enable requests served by caddy for distributed tracing via The OpenTracing Project. Dependencies The Go OpenTracing Library Jaeger,

Sep 30, 2022
Package for writing Nagios/Icinga/et cetera plugins in Go (golang)

nagiosplugin Package for writing Nagios/Icinga/et cetera plugins in Go (golang). Documentation See http://godoc.org/github.com/olorin/nagiosplugin. Us

Aug 30, 2022
Kubernetes plugins for EdgeGallery

Plugins 介绍 the edgegallery plugins repo 软件架构 软件架构说明 安装教程 xxxx xxxx xxxx 使用说明 xxxx xxxx xxxx 参与贡献 Fork 本仓库 新建 Feat_xxx 分支 提交代码 新建 Pull Request 码云特技 使用

Dec 28, 2021
CoreDNS is a DNS server that chains plugins
CoreDNS is a DNS server that chains plugins

CoreDNS is a DNS server/forwarder, written in Go, that chains plugins. Each plugin performs a (DNS) function. CoreDNS is a Cloud Native Computing Foun

Jan 3, 2023
create boilerplate structure for neovim plugins

boilit Boil yourself a sweet plugin Installation • Usage Ain't nobody got time to create plugin directories: boilit yourself! boilit creates boilerpla

Dec 28, 2022
Extend KIND networking capabilities with plugins using the KIND API

kind-networking-plugins Plugins to extend KIND networking capabilities with plugins using the KIND API These plugins were used for the Kubecon EU 2021

Nov 10, 2022
A command tool to help user install oh-my-zsh plugins fast in a comfortable way

zshx A command tool to help user install oh-my-zsh plugins fast in a comfortable way. in other way, it is a zsh plugin package manager. How to use the

Feb 11, 2022