Class: Sentry::Metrics::Configuration

Inherits:
Object
  • Object
show all
Includes:
ArgumentCheckingHelper
Defined in:
lib/sentry/metrics/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



35
36
37
38
# File 'lib/sentry/metrics/configuration.rb', line 35

def initialize
  @enabled = false
  @enable_code_locations = true
end

Instance Attribute Details

#before_emitProc?

Optional Proc, called before emitting a metric to the aggregator. Use it to filter keys (return false/nil) or update tags. Make sure to return true at the end.

Examples:

config.metrics.before_emit = lambda do |key, tags|
  return nil if key == 'foo'
  tags[:bar] = 42
  tags.delete(:baz)
  true
end

Returns:

  • (Proc, nil)


33
34
35
# File 'lib/sentry/metrics/configuration.rb', line 33

def before_emit
  @before_emit
end

#enable_code_locationsBoolean

Enable code location reporting. Will be sent once per day. True by default.

Returns:

  • (Boolean)


18
19
20
# File 'lib/sentry/metrics/configuration.rb', line 18

def enable_code_locations
  @enable_code_locations
end

#enabledBoolean

Enable metrics usage. Starts a new Aggregator instance to aggregate metrics and a thread to aggregate flush every 5 seconds.

Returns:

  • (Boolean)


12
13
14
# File 'lib/sentry/metrics/configuration.rb', line 12

def enabled
  @enabled
end