Documentation
¶
Index ¶
- func ErrorReportingMiddleware(router http.Handler, config ErrorReportingConfig) http.Handler
- func MetricCollectorNoticeError(txnID string, txnName string, err error, w http.ResponseWriter, ...)
- func ReportErrorToBugsnag(errorClass string, err error, a ...interface{}) error
- func Wrapper(handler httprouter.Handle, path string, mc Config) httprouter.Handle
- type Config
- type DataStore
- type ErrorReportingConfig
- type MetricCollectorConfig
- type MetricCollectorDatastoreSegment
- type MetricCollectorSegment
- type MetricCollectorTxn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorReportingMiddleware ¶ added in v0.1.9
func ErrorReportingMiddleware(router http.Handler, config ErrorReportingConfig) http.Handler
ErrorReportingMiddleware configures and wraps error reporting handler around the router
func MetricCollectorNoticeError ¶ added in v0.1.9
func MetricCollectorNoticeError(txnID string, txnName string, err error, w http.ResponseWriter, r *http.Request)
MetricCollectorNoticeError Send error to newrelic
func ReportErrorToBugsnag ¶ added in v0.1.12
ReportErrorToBugsnag send error to bugsnag
func Wrapper ¶ added in v0.1.9
func Wrapper(handler httprouter.Handle, path string, mc Config) httprouter.Handle
Wrapper Wraps middlewares around http requests
Types ¶
type Config ¶ added in v0.1.9
type Config struct {
ErrorReportingConfig ErrorReportingConfig
MetricCollectorConfig MetricCollectorConfig
}
Config middleware config
type DataStore ¶ added in v0.1.9
type DataStore struct {
Product string
Collection string
Operation string
ParameterizedQuery string
QueryParameters map[string]interface{}
Host string
PortPathOrID string
DatabaseName string
}
DataStore Metric Collector datastore
type ErrorReportingConfig ¶ added in v0.1.9
type ErrorReportingConfig struct {
Enabled bool
Bugsnag bool
APIKey string
ReleaseStage string
AppType string
AppVersion string
ProjectPackages []string
NotifyReleaseStages []string
ParamsFilters []string
PanicHandler func()
Hostname string
}
ErrorReportingConfig Error reporting config
type MetricCollectorConfig ¶ added in v0.1.9
type MetricCollectorConfig struct {
Enabled bool
Newrelic bool
Debug bool
AppName string
License string
Labels map[string]string
HostDisplayName string
}
MetricCollectorConfig Metric Collector config
type MetricCollectorDatastoreSegment ¶ added in v0.1.9
type MetricCollectorDatastoreSegment struct {
DatastoreSegment newrelic.DatastoreSegment
}
MetricCollectorDatastoreSegment Metric Collector datastore segment
func StartMetricCollectorDataStoreSegment ¶ added in v0.1.9
func StartMetricCollectorDataStoreSegment(txnID string, txnName string, datastore DataStore, w http.ResponseWriter, r *http.Request) MetricCollectorDatastoreSegment
StartMetricCollectorDataStoreSegment Starts and retuns a metric collector datastore segment for a transaction
type MetricCollectorSegment ¶ added in v0.1.9
MetricCollectorSegment Metric Collector segment
func StartMetricCollectorSegment ¶ added in v0.1.9
func StartMetricCollectorSegment(txnID string, txnName string, segmentName string, w http.ResponseWriter, r *http.Request) MetricCollectorSegment
StartMetricCollectorSegment Starts and retuns a metric collector segment for a transaction
type MetricCollectorTxn ¶ added in v0.1.9
type MetricCollectorTxn struct {
Txn newrelic.Transaction
}
MetricCollectorTxn Metric Collector transaction
func GetMetricCollectorTransaction ¶ added in v0.1.9
func GetMetricCollectorTransaction(txnID string, txnName string, w http.ResponseWriter, r *http.Request) MetricCollectorTxn
GetMetricCollectorTransaction returns new or existing metric collector transanction