Categorygithub.com/rollbar/rollbar-go
modulepackage
1.4.5
Repository: https://github.com/rollbar/rollbar-go.git
Documentation: pkg.go.dev

# README

rollbar-go

Build Status

Rollbar is a real-time exception reporting service for Go and other languages. The Rollbar service will alert you of problems with your code and help you understand them in a ways never possible before. We love it and we hope you will too.

rollbar-go is a Golang Rollbar client that makes it easy to report errors to Rollbar with full stacktraces. Errors are sent to Rollbar asynchronously in a background goroutine.

Because Go's error type doesn't include stack information from when it was set or allocated, we use the stack information from where the error was reported.

Setup Instructions and Usage

  1. Sign up for a Rollbar account
  2. Follow the Usage example in our Go SDK docs to get started for your platform.

Documentation

API docs on godoc.org

Running Tests

Running tests docs on docs.rollar.com

Release History & Changelog

See our Releases page for a list of all releases, including changes.

Help / Support

If you run into any issues, please email us at [email protected]

For bug reports, please open an issue on GitHub.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature).
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

History

This library originated with this project github.com/stvp/rollbar. This was subsequently forked by Heroku, github.com/heroku/rollbar, and extended. Those two libraries diverged as features were added independently to both. This official library is actually a fork of the Heroku fork with some git magic to make it appear as a standalone repository along with all of that history. We then also went back to the original stvp library and brought over most of the divergent changes. Since then we have moved forward to add more functionality to this library and it is the recommended notifier for Go going forward.

# Packages

No description provided by the author

# Functions

CaptureIp is the currently set level of IP address information to capture from requests.
CaptureTelemetryEvent sets the user-specified telemetry event.
ClearPerson clears any previously set person information.
Close will block until the queue of errors / messages is empty and terminate the goroutine used for sending items.
CodeVersion is the string describing the running code version on the server that is currently set on the managed Client instance.
Critical reports an item with level `critical`.
Custom is the currently set extra metadata on the managed Client instance.
Debug reports an item with level `debug`.
No description provided by the author
EnableLoggerTelemetry enables logger telemetry.
EnableNetworkTelemetry enables the network telemetry it wraps up the client for telemetry http.DefaultClient can also be passed by the reference.
EnableNetworkTelemetryRequestHeaders enables telemetry request headers.
EnableNetworkTelemetryResponseHeaders enables telemetry response headers.
Endpoint is the currently configured endpoint to send items on the managed Client instance.
Environment is the environment currently set on the managed Client instance.
Error reports an item with level `error`.
Errorf sends an error to Rollbar with the given level using the format string and arguments.
ErrorWithExtras asynchronously sends an error to Rollbar with the given severity level with extra custom data.
ErrorWithExtrasAndContext asynchronously sends an error to Rollbar with the given severity level with extra custom data, within the given context.
ErrorWithLevel asynchronously sends an error to Rollbar with the given severity level.
ErrorWithStackSkip asynchronously sends an error to Rollbar with the given severity level and a given number of stack trace frames skipped.
ErrorWithStackSkipWithExtras asynchronously sends an error to Rollbar with the given severity level and a given number of stack trace frames skipped with extra custom data.
ErrorWithStackSkipWithExtrasAndContext asynchronously sends an error to Rollbar with the given severity level and a given number of stack trace frames skipped with extra custom data, within the given context.
Fingerprint is whether or not the current managed Client instance uses a custom client-side fingerprint.
Info reports an item with level `info`.
LambdaWrapper calls handlerFunc with arguments, and recovers and reports a panic to Rollbar if it occurs.
Log reports an item with the given level.
LogPanic accepts an error value returned by recover() and handles logging to Rollbar with stack info.
Message asynchronously sends a message to Rollbar with the given severity level.
MessageWithExtras asynchronously sends a message to Rollbar with the given severity level with extra custom data.
MessageWithExtrasAndContext asynchronously sends a message to Rollbar with the given severity level with extra custom data, within the given context.
New returns the default implementation of a Client.
NewAsync builds a Client with the asynchronous implementation of the transport interface.
NewAsyncTransport builds an asynchronous transport which sends data to the Rollbar API at the specified endpoint using the given access token.
NewPersonContext returns a new Context that carries the person as a value.
NewQueue returns a new queue with the given initial size.
NewSync builds a Client with the synchronous implementation of the transport interface.
NewSyncTransport builds a synchronous transport which sends data to the Rollbar API at the specified endpoint using the given access token.
NewTelemetry initializes telemetry object with scrubheader.
NewTransport creates a transport that sends items to the Rollbar API asynchronously.
PersonFromContext returns the Person value stored in ctx, if any.
Platform is the platform reported for all Rollbar items.
RequestError asynchronously sends an error to Rollbar with the given severity level and request-specific information.
RequestErrorWithExtras asynchronously sends an error to Rollbar with the given severity level and request-specific information with extra custom data.
RequestErrorWithExtrasAndContext asynchronously sends an error to Rollbar with the given severity level and request-specific information with extra custom data.
RequestErrorWithStackSkip asynchronously sends an error to Rollbar with the given severity level and a given number of stack trace frames skipped, in addition to extra request-specific information.
RequestErrorWithStackSkipWithExtras asynchronously sends an error to Rollbar with the given severity level and a given number of stack trace frames skipped, in addition to extra request-specific information and extra custom data.
RequestErrorWithStackSkipWithExtrasAndContext asynchronously sends an error to Rollbar with the given severity level and a given number of stack trace frames skipped, in addition to extra request-specific information and extra custom data, within the given context.
RequestMessage asynchronously sends a message to Rollbar with the given severity level and request-specific information.
RequestMessageWithExtras asynchronously sends a message to Rollbar with the given severity level with extra custom data in addition to extra request-specific information.
RequestMessageWithExtrasAndContext asynchronously sends a message to Rollbar with the given severity level with extra custom data in addition to extra request-specific information, within the given context.
ServerHost is the currently set hostname on the managed Client instance.
ServerRoot is the currently set path to the code root set on the managed Client instance.
SetCaptureIp sets what level of IP address information to capture from requests.
SetCheckIgnore sets the checkIgnore function on the managed Client instance.
SetCodeVersion sets the code version on the managed Client instance.
No description provided by the author
SetCustom sets custom data on the managed Client instance.
SetCustomQueueSize initializes the queue with a custom size.
SetEnabled sets whether or not the managed Client instance is enabled.
SetEndpoint sets the endpoint on the managed Client instance.
SetEnvironment sets the environment on the managed Client instance.
SetFingerprint sets whether or not to use custom client-side fingerprinting on the managed Client instance.
SetHTTPClient sets custom http Client.
SetItemsPerMinute sets the max number of items to send in a given minute.
SetLogger sets an alternative logger to be used by the underlying transport layer on the managed Client instance.
SetPerson information for identifying a user associated with any subsequent errors or messages.
SetPlatform sets the platform on the managed Client instance.
SetPrintPayloadOnError sets whether or not to output the payload to stderr if an error occurs during transport to the Rollbar API.
SetRetryAttempts sets how many times to attempt to retry sending an item if the http transport experiences temporary error conditions.
SetScrubFields sets the fields to scrub on the managed Client instance.
SetScrubHeaders sets the headers to scrub on the managed Client instance.
SetServerHost sets the host value on the managed Client instance.
SetServerRoot sets the code root value on the managed Client instance.
SetStackTracer sets the StackTracerFunc used by the managed Client instance.
SetTelemetry sets the telemetry.
SetToken sets the token on the managed Client instance.
SetTransform sets the transform function called after the entire payload has been built before it is sent to the API.
SetUnwrapper sets the UnwrapperFunc used by the managed Client instance.
Token returns the currently set Rollbar access token on the managed Client instance.
Wait will block until the queue of errors / messages is empty.
Warning reports an item with level `warning`.
No description provided by the author
No description provided by the author
No description provided by the author
Wrap calls f and then recovers and reports a panic to Rollbar if it occurs.
WrapAndWait calls f, and recovers and reports a panic to Rollbar if it occurs.
WrapWithArgs calls f with the supplied args and reports a panic to Rollbar if it occurs.

# Constants

CaptureIpAnonymize means apply a pseudo-anonymization.
CaptureIpFull means capture the entire address without any modification.
CaptureIpNone means do not capture anything.
CRIT is the critial severity level.
DEBUG is the debug severity level.
DefaultBuffer is the default size of the buffered channel used for queueing items to send to Rollbar in the asynchronous implementation of Transport.
DefaultRetryAttempts is the number of times we attempt to retry sending an item when encountering temporary network errors.
ERR is the error severity level.
FILTERED is the string used to replace values that are scrubbed based on the configured headers and fields used for scrubbing.
INFO is the info severity level.
NAME is the name of this notifier sent with the payload to Rollbar.
No description provided by the author
VERSION is the version of this notifier sent with the payload to Rollbar.
WARN is the warning severity level.

# Variables

DefaultStackTracer is the default StackTracerFunc used by rollbar-go clients.
DefaultUnwrapper is the default UnwrapperFunc used by rollbar-go clients.

# Structs

AsyncTransport is a concrete implementation of the Transport type which communicates with the Rollbar API asynchronously using a buffered channel.
A Client can be used to interact with Rollbar via the configured Transport.
ErrBufferFull is an error which is returned when the asynchronous transport is used and the channel used for buffering items for sending to Rollbar is full.
ErrChannelClosed is an error which is returned when the asynchronous transport is used and the channel used for buffering items for sending to Rollbar is already closed.
No description provided by the author
Queue is a basic FIFO queue based on a circular list that resizes as needed.
SilentClientLogger is a type that implements the ClientLogger interface but produces no output.
SyncTransport is a concrete implementation of the Transport type which communicates with the Rollbar API synchronously.
Telemetry struct contains writer (for logs) and round tripper (for http client) and enables to queue the events.

# Interfaces

CauseStacker is an interface that errors can implement to create a trace_chain.
ClientLogger is the interface used by the rollbar Client/Transport to report problems.
Stacker is an interface that errors can implement to allow the extraction of stack traces.
Transport represents an object used for communicating with the Rollbar API.

# Type aliases

ErrHTTPError is an HTTP error status code as defined by http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html.
OptionFunc is the pointer to the optional parameter function.
A StackTracerFunc is used to extract stack traces when building an error chain.
An UnwrapperFunc is used to extract wrapped errors when building an error chain.