Documentation ¶
Overview ¶
Package gorelic is an New Relic agent implementation for Go runtime. It collect a lot of metrics about Go scheduler, garbage collector and memory allocator and send them to NewRelic.
Index ¶
Constants ¶
View Source
const ( // DefaultNewRelicPollInterval - how often we will report metrics to NewRelic. // Recommended values is 60 seconds DefaultNewRelicPollInterval = 60 // DefaultGcPollIntervalInSeconds - how often we will get garbage collector run statistic // Default value is - every 10 seconds // During GC stat pooling - mheap will be locked, so be carefull changing this value DefaultGcPollIntervalInSeconds = 10 // DefaultMemoryAllocatorPollIntervalInSeconds - how often we will get memory allocator statistic. // Default value is - every 60 seconds // During this process stoptheword() is called, so be carefull changing this value DefaultMemoryAllocatorPollIntervalInSeconds = 60 //DefaultAgentGuid is plugin ID in NewRelic. //You should not change it unless you want to create your own plugin. DefaultAgentGuid = "com.github.yvasiyarov.GoRelic" //CurrentAgentVersion is plugin version CurrentAgentVersion = "0.0.6" //DefaultAgentName in NewRelic GUI. You can change it. DefaultAgentName = "Go daemon" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct { NewrelicName string NewrelicLicense string NewrelicPollInterval int Verbose bool CollectGcStat bool CollectMemoryStat bool CollectHTTPStat bool CollectHTTPStatuses bool GCPollInterval int MemoryAllocatorPollInterval int AgentGUID string AgentVersion string HTTPTimer metrics.Timer HTTPStatusCounters map[int]metrics.Counter Tracer *Tracer CustomMetrics []newrelic_platform_go.IMetrica // All HTTP requests will be done using this client. Change it if you need // to use a proxy. Client http.Client // contains filtered or unexported fields }
Agent - is NewRelic agent implementation. Agent start separate go routine which will report data to NewRelic
func (*Agent) AddCustomMetric ¶ added in v0.0.7
func (agent *Agent) AddCustomMetric(metric newrelic_platform_go.IMetrica)
AddCustomMetric adds metric to be collected periodically with NewrelicPollInterval interval
func (*Agent) WrapHTTPHandler ¶ added in v0.0.5
WrapHTTPHandler instrument HTTP handler object to collect HTTP metrics
func (*Agent) WrapHTTPHandlerFunc ¶ added in v0.0.5
func (agent *Agent) WrapHTTPHandlerFunc(h tHTTPHandlerFunc) tHTTPHandlerFunc
WrapHTTPHandlerFunc instrument HTTP handler functions to collect HTTP metrics
type TraceTransaction ¶ added in v0.0.7
type TraceTransaction struct {
// contains filtered or unexported fields
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.