{"modulePath":"github.com/Stackimpact/stackimpact-go","version":"v2.3.10+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package stackimpact\n\n## Constants\n\n```go\nconst ErrorGroupHandledExceptions string = \"Handled exceptions\"\n```\n\n```go\nconst ErrorGroupRecoveredPanics string = \"Recovered panics\"\n```\n\n```go\nconst ErrorGroupUnrecoveredPanics string = \"Unrecovered panics\"\n```\n\n## Functions\n\n```go\nfunc WithPprofLabel(key string, val string, req *http.Request, fn func())\n```\n\n## Types\n\n```go\ntype Agent struct {\n\n\t// compatibility \u003c 1.2.0\n\tDashboardAddress string\n\tAgentKey         string\n\tAppName          string\n\tHostName         string\n\tDebug            bool\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewAgent() *Agent\n```\nDEPRECATED. Kept for compatibility with \\\u003c1.4.3.\n\n```go\nfunc Start(options Options) *Agent\n```\nStarts the agent with configuration options. Required options are AgentKey and AppName.\n\n```go\nfunc (a *Agent) Configure(agentKey string, appName string)\n```\nDEPRECATED. Kept for compatibility with \\\u003c1.2.0.\n\n```go\nfunc (a *Agent) MeasureHandler(pattern string, handler http.Handler) (string, http.Handler)\n```\nDEPRECATED. A helper function to measure HTTP handler execution by wrapping http.Handle method parameters.\n\n```go\nfunc (a *Agent) MeasureHandlerFunc(pattern string, handlerFunc func(http.ResponseWriter, *http.Request)) (string, func(http.ResponseWriter, *http.Request))\n```\nDEPRECATED. A helper function to measure HTTP handler function execution by wrapping http.HandleFunc method parameters.\n\n```go\nfunc (a *Agent) MeasureSegment(segmentName string) *Segment\n```\nDEPRECATED. Starts measurement of execution time of a code segment. To stop measurement call Stop on returned Segment object. After calling Stop the segment is recorded, aggregated and reported with regular intervals.\n\n```go\nfunc (a *Agent) Profile() *Span\n```\nUse this method to instruct the agent to start and stop profiling. It does not guarantee that any profiler will be started. The decision is made by the agent based on the overhead constraints. The method returns Span object, on which the Stop() method should be called.\n\n```go\nfunc (a *Agent) ProfileHandler(pattern string, handler http.Handler) (string, http.Handler)\n```\nA helper function to profile HTTP handler execution by wrapping http.Handle method parameters.\n\n```go\nfunc (a *Agent) ProfileHandlerFunc(pattern string, handlerFunc func(http.ResponseWriter, *http.Request)) (string, func(http.ResponseWriter, *http.Request))\n```\nA helper function to profile HTTP handler function execution by wrapping http.HandleFunc method parameters.\n\n```go\nfunc (a *Agent) ProfileWithName(name string) *Span\n```\nThis method is similar to the Profile() method. It additionally allows to specify a span name to group span timing measurements.\n\n```go\nfunc (a *Agent) RecordAndRecoverPanic()\n```\nAggregates and reports panics with regular intervals. This function also recovers from panics\n\n```go\nfunc (a *Agent) RecordError(err interface{})\n```\nAggregates and reports errors with regular intervals.\n\n```go\nfunc (a *Agent) RecordPanic()\n```\nAggregates and reports panics with regular intervals.\n\n```go\nfunc (a *Agent) Report()\n```\nDEPRECATED. Kept for compatibility.\n\n```go\nfunc (a *Agent) ReportAllocationProfile()\n```\nReport current allocation profile to the Dashboard.\n\n```go\nfunc (a *Agent) ReportWithHTTPClient(client *http.Client)\n```\nDEPRECATED. Kept for compatibility.\n\n```go\nfunc (a *Agent) Start(options Options)\n```\nStarts the agent with configuration options. Required options are AgentKey and AppName.\n\n```go\nfunc (a *Agent) StartBlockProfiler()\n```\nStart blocking call profiler. Automatic profiling should be disabled.\n\n```go\nfunc (a *Agent) StartCPUProfiler()\n```\nStart CPU profiler. Automatic profiling should be disabled.\n\n```go\nfunc (a *Agent) StopBlockProfiler()\n```\nStop blocking call profiler and report the recorded profile to the Dashboard.\n\n```go\nfunc (a *Agent) StopCPUProfiler()\n```\nStop CPU profiler and report the recorded profile to the Dashboard.\n\n```go\nfunc (a *Agent) UpdateOptions(options Options)\n```\nUpdate some options after the agent has already been started. Only ProxyAddress, HTTPClient and Debug options are updatable.\n\n```go\ntype Options struct {\n\tDashboardAddress     string\n\tProxyAddress         string\n\tHTTPClient           *http.Client\n\tAgentKey             string\n\tAppName              string\n\tAppVersion           string\n\tAppEnvironment       string\n\tHostName             string\n\tDisableAutoProfiling bool\n\tDebug                bool\n\tLogger               *log.Logger\n\tProfileAgent         bool\n}\n```\n\n```go\ntype Segment struct {\n\tName string\n\n\tDuration float64\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (s *Segment) Stop()\n```\nStops the measurement of a code segment execution time.\n\n```go\ntype Span struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (s *Span) Stop()\n```\nStops profiling.\n\n","path":"github.com/Stackimpact/stackimpact-go","name":"stackimpact","synopsis":"","isRedistributable":true}
