Skip to content

Feature/turn off internal fingerprinting #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ rollbar.test
.env
cover.out
cover.html
.idea
.vscode
24 changes: 24 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,30 @@ func (c *Client) SetFingerprint(fingerprint bool) {
c.configuration.fingerprint = fingerprint
}

// Enables custom client-side fingerprint. The default value is false.
func (c *Client) EnableClientsideFingerprintGeneration() {
c.diagnostic.configuredOptions["fingerprint"] = true
c.configuration.fingerprint = true
}

// Disables custom client-side fingerprint. The default value is false.
func (c *Client) DisableClientsideFingerprintGeneration() {
c.diagnostic.configuredOptions["fingerprint"] = false
c.configuration.fingerprint = false
}

// Enables custom client-side fingerprint. The default value is false. (Alias of above method).
func (c *Client) EnableClientsideFingerprint() {
c.diagnostic.configuredOptions["fingerprint"] = true
c.configuration.fingerprint = true
}

// Disables custom client-side fingerprint. The default value is false. (Alias of above method).
func (c *Client) DisableClientsideFingerprint() {
c.diagnostic.configuredOptions["fingerprint"] = false
c.configuration.fingerprint = false
}

// SetLogger sets the logger on the underlying transport. By default log.Printf is used.
func (c *Client) SetLogger(logger ClientLogger) {
c.Transport.SetLogger(logger)
Expand Down
21 changes: 21 additions & 0 deletions rollbar.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,27 @@ var DefaultStackTracer StackTracerFunc = func(err error) ([]runtime.Frame, bool)
return nil, false
}

// Enables a custom client-side fingerprint. The default value is false.
func EnableClientsideFingerprintGeneration() {
std.SetFingerprint(true)
}

// Disables a custom client-side fingerprint. The default value is false.
func DisableClientsideFingerprintGeneration() {
std.SetFingerprint(false)
}

// Enables a custom client-side fingerprint. The default value is false. (Alias of above method).
func EnableClientsideFingerprint() {
std.SetFingerprint(true)
}

// Disables a custom client-side fingerprint. The default value is false. (Alias of above method).
func DisableClientsideFingerprint() {
std.SetFingerprint(false)
}


// SetEnabled sets whether or not the managed Client instance is enabled.
// If this is true then this library works as normal.
// If this is false then no calls will be made to the network.
Expand Down