Documentation ¶
Overview ¶
Package metrics implements a metrics dashboard with either datadog or prometheus (coming soon)
Index ¶
Constants ¶
const DDProfileEnv = "DD_PROFILES"
DDProfileEnv is the data daog profile neviornment variable.
const HandlerEnv = "METRICS_HANDLER"
HandlerEnv is the driver to use for metrics.
Variables ¶
var AllHandlerTypes []HandlerType
AllHandlerTypes is a list of all contract types. Since we use stringer and this is a testing library, instead of manually copying all these out we pull the names out of stringer. In order to make sure stringer is updated, we panic on any method called where the index is higher than the stringer array length.
Functions ¶
Types ¶
type Handler ¶ added in v0.0.19
type Handler interface { Start(ctx context.Context) error // Gin gets a gin middleware for tracing. Gin() gin.HandlerFunc // ConfigureHTTPClient configures tracing on an http client ConfigureHTTPClient(client *http.Client) // AddGormCallbacks adds gorm callbacks for tracing. AddGormCallbacks(db *gorm.DB) }
Handler collects metrics.
func NewDatadogMetricsHandler ¶ added in v0.0.19
NewDatadogMetricsHandler creates a new datadog metrics handler.
func NewFromEnv ¶ added in v0.0.19
NewFromEnv sets up a metrics handler from environment variable. this will not set the global and generally, SetupFromEnv should be used instead.
func NewNullHandler ¶ added in v0.0.19
func NewNullHandler() Handler
NewNullHandler creates a new null transaction handler.
func NewRelicMetricsHandler ¶ added in v0.0.19
NewRelicMetricsHandler creates a new newrelic metrics handler.
type HandlerType ¶ added in v0.0.19
type HandlerType uint8
HandlerType is the handler type to use
const ( // DataDog is the datadog driver. DataDog HandlerType = 0 // Datadog // NewRelic is the new relic driver. NewRelic HandlerType = iota // NewRelic // Null is a null data type handler. Null HandlerType = iota // Null )
func (HandlerType) Lower ¶ added in v0.0.19
func (i HandlerType) Lower() string
Lower gets the lowercase version of the handler type. Useful for comparison in switch.
func (HandlerType) String ¶ added in v0.0.19
func (i HandlerType) String() string