Class: Sentry::Metrics::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sdk_logger) ⇒ Configuration

Returns a new instance of Configuration.



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

def initialize(sdk_logger)
  @sdk_logger = sdk_logger
  @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)


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

def before_emit
  @before_emit
end

#enable_code_locationsBoolean

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

Returns:

  • (Boolean)


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

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)


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

def enabled
  @enabled
end