ddlog

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2020 License: MIT Imports: 16 Imported by: 0

README

go-datadog

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIKey

func APIKey() string

APIKey is the Datadog API key.

func Address

func Address() string

Address is the current address where the log entries will be sent.

func Debug

func Debug(args ...interface{})

Debug writes a debug entry into the log.

func Error

func Error(args ...interface{})

Error writes an error entry to the log.

func Info

func Info(args ...interface{})

Info writes a info entry to the log.

func Initialize

func Initialize(c DDConfig) (err error)

Initialize bootstraps the logging and tracing to be sent to a Datadog Agent.

func Monitor

func Monitor() gin.HandlerFunc

Monitor is middleware that logs and traces the calls.

func NewAgentWriter

func NewAgentWriter(url string, portNo int, ddApikey string) io.Writer

NewAgentWriter returns a new DDAgentWriter

func Port

func Port() int

Port is the port upon which the address is listening.

func Stop

func Stop()

Stop invokes stops the started tracer.

Types

type DDConfig

type DDConfig struct {
	TraceIntakeHost string                 `yaml:"traceintakehost"`
	TraceIntakePort int                    `yaml:"traceintakeport"`
	LogIntakeURL    string                 `yaml:"logintakeurl"`
	LogIntakePort   int                    `yaml:"logintakeport"`
	APIKey          string                 `yaml:"apikey"`
	Environment     string                 `yaml:"environment"`
	ServiceName     string                 `yaml:"servicename"`
	ServiceVersion  string                 `yaml:"serviceversion"`
	GlobalTags      map[string]interface{} `yaml:"globaltags"`
	Commit          string                 `yaml:"commit"`
	LogBufferSize   int                    `yaml:"logbuffersize"`
	LogTimeout      int                    `yaml:"logtimeout"`
}

DDConfig are the values required to to initialize the use of sending logs and traces to a Datadog Agent.

Jump to

Keyboard shortcuts

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