contrib/

directory
v1.62.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2024 License: Apache-2.0, BSD-3-Clause, Apache-2.0

README

Godoc

The purpose of these packages is to provide tracing on top of commonly used packages from the standard library as well as the community in a "plug-and-play" manner. This means that by simply importing the appropriate path, functions are exposed having the same signature as the original package. These functions return structures which embed the original return value, allowing them to be used as they normally would with tracing activated out of the box.

All of these libraries are supported by our APM product.

⚠ These libraries are not built to be used with Opentracing. Opentracing integrations can be found in their own organisation.

Usage

First, find the library which you'd like to integrate with. The naming convention for the integration packages is:

  • If the package is from the standard library (eg. database/sql), it will be located at the same path.
  • If the package is hosted on Github (eg. github.com/user/repo) and has version v2.1.0, it will be located at the shorthand path user/repo.v2.
  • If the package is from anywhere else (eg. google.golang.org/grpc) and has no stable version, it can be found under the full import path, followed by the version suffix (in this example .v0).
  • All new integrations should be suffixed with .vN where N is the major version that is being covered. If the integration covers more than one major version, the minimum version supported should be chosen for the suffix. (ex. If the integration covers versions 2.x.x - 4.x.x, the suffix will be .v2)
  • The package itself should retain its un-versioned name. For example, the integration under user/repo.v2 stays as package repo, and does not become package repo.v2

Second, there are a few tags that should be found in all integration spans:

  • The span.kind tag should be set in root spans with either a client, server, producer, or consumer value according to the definitions found in the repository. If the value is determined to be internal, then omit the tag as that is the assumed default value. Otherwise, explicitly set it with a value from above.
  • The component tag should be set in all spans with the value equivalent to full naming convention of the integration package explained in the previous step.

Each integration comes with thorough documentation and usage examples. A good overview can be seen on our godoc page.

Instrumentation telemetry

Every integration is expected to import instrumentation telemetry to gather integration usage (more info here). Instrumentation telemetry can be enabled by adding the following init function to the new contrib package:

func init() {
    telemetry.LoadIntegration("package/import/path")
}

Directories

Path Synopsis
99designs
IBM
Shopify
aws
bradfitz
cloud.google.com
confluentinc
database
dimfeld
elastic
emicklei
garyburd
gin-gonic
globalsign
go-chi
go-pg
go-redis
go.mongodb.org
Package gocql provides functions to trace the gocql/gocql package (https://github.com/gocql/gocql).
Package gocql provides functions to trace the gocql/gocql package (https://github.com/gocql/gocql).
gofiber
gomodule
google.golang.org
gopkg.in
gorilla
gorm.io
graph-gophers
graphql-go
hashicorp
internal
jackc
jinzhu
jmoiron
julienschmidt
k8s.io
labstack
miekg
net
olivere
redis
segmentio
sirupsen
syndtr
tidwall
twitchtv
urfave
valyala
zenazn

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL