telemetry

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2021 License: MIT Imports: 6 Imported by: 2

README

Telemetry

Telemetry is a lib to simplify Telemetry Agents instalations.

Installation

go get github.com/facily-tech/go-core/telemetry

Implementation Examples

  1. Implement it instance; (Ex: https://github.com/facily-tech/go-scaffold/blob/main/internal/container/container.go)
  2. Implement it's close function into Main; (Ex: https://github.com/facily-tech/go-scaffold/blob/main/cmd/api/main.go)
  3. Implement the traces. (Ex: https://github.com/facily-tech/go-scaffold/blob/main/internal/api/handler.go)

Documentation

Index

Constants

View Source
const DataDogConfigPrefix = "DD_"

Variables

This section is empty.

Functions

This section is empty.

Types

type DataDog

type DataDog struct{}

func NewDataDog

func NewDataDog(config DataDogConfig) *DataDog

func (DataDog) Client

func (DataDog) Client(parent *http.Client) *http.Client

func (DataDog) Close

func (DataDog) Close()

func (*DataDog) Middleware

func (d *DataDog) Middleware(next http.Handler) http.Handler

type DataDogConfig

type DataDogConfig struct {
	Env     string `env:"ENV,required"`
	Service string `env:"SERVICE,default=core-commerce-erp-integration"`
	Version string
}

type HTTPClient

type HTTPClient struct {
	Client *http.Client
}

type NewRelic

type NewRelic struct {
	// contains filtered or unexported fields
}

func NewNewRelic

func NewNewRelic() (*NewRelic, error)

func (NewRelic) Client

func (NewRelic) Client(parent *http.Client) *http.Client

func (NewRelic) Close added in v0.2.0

func (NewRelic) Close()

func (*NewRelic) Middleware

func (relic *NewRelic) Middleware(next http.Handler) http.Handler

type Tracer

type Tracer interface {
	// Middleware must return a new handler with cross application tracing (CAT) or distributed tracing.
	Middleware(next http.Handler) http.Handler
	// Client wraps parent with tracing capabilities, parent is modified during this process.
	Client(parent *http.Client) *http.Client

	// Close should be called when the application end.
	Close()
}

A Tracer has methods to help tracer instrumentation of our services.

Jump to

Keyboard shortcuts

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