Class: Sentry::Transport::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/sentry/transport/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



81
82
83
84
85
86
# File 'lib/sentry/transport/configuration.rb', line 81

def initialize
  @ssl_verification = true
  @open_timeout = 1
  @timeout = 2
  @encoding = HTTPTransport::GZIP_ENCODING
end

Instance Attribute Details

#encodingString

The encoding to use to compress the request body. Default value is ‘Sentry::HTTPTransport::GZIP_ENCODING`.

Returns:

  • (String)


72
73
74
# File 'lib/sentry/transport/configuration.rb', line 72

def encoding
  @encoding
end

#open_timeoutInteger

The timeout in seconds to read data from Sentry, in seconds. Default value is 1.

Returns:

  • (Integer)


16
17
18
# File 'lib/sentry/transport/configuration.rb', line 16

def open_timeout
  @open_timeout
end

#proxyString, ...

The proxy configuration to use to connect to Sentry. Accepts either a URI formatted string, URI, or a hash with the ‘uri`, `user`, and `password` keys.

If you’re using the default transport (‘Sentry::HTTPTransport`), proxy settings will also automatically be read from tne environment variables (`HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY`).

Examples:

# setup proxy using a string:
config.transport.proxy = "https://user:password@proxyhost:8080"

# setup proxy using a URI:
config.transport.proxy = URI("https://user:password@proxyhost:8080")

# setup proxy using a hash:
config.transport.proxy = {
  uri: URI("https://proxyhost:8080"),
  user: "user",
  password: "password"
}

Returns:

  • (String, URI, Hash, nil)


41
42
43
# File 'lib/sentry/transport/configuration.rb', line 41

def proxy
  @proxy
end

#sslHash?

The SSL configuration to use to connect to Sentry. You can either pass a ‘Hash` containing `ca_file` and `verification` keys, or you can set those options directly on the `Sentry::HTTPTransport::Configuration` object:

Examples:

config.transport.ssl =  {
  ca_file: "/path/to/ca_file",
  verification: true
end

Returns:

  • (Hash, nil)


54
55
56
# File 'lib/sentry/transport/configuration.rb', line 54

def ssl
  @ssl
end

#ssl_ca_fileString?

The path to the CA file to use to verify the SSL connection. Default value is ‘nil`.

Returns:

  • (String, nil)


60
61
62
# File 'lib/sentry/transport/configuration.rb', line 60

def ssl_ca_file
  @ssl_ca_file
end

#ssl_verificationBoolean

Whether to verify that the peer certificate is valid in SSL connections. Default value is ‘true`.

Returns:

  • (Boolean)


66
67
68
# File 'lib/sentry/transport/configuration.rb', line 66

def ssl_verification
  @ssl_verification
end

#timeoutInteger

The timeout in seconds to open a connection to Sentry, in seconds. Default value is 2.

Returns:

  • (Integer)


10
11
12
# File 'lib/sentry/transport/configuration.rb', line 10

def timeout
  @timeout
end

#transport_classClass?

The class to use as a transport to connect to Sentry. If this option not set, it will return ‘nil`, and Sentry will use `Sentry::HTTPTransport` by default.

Returns:

  • (Class, nil)


79
80
81
# File 'lib/sentry/transport/configuration.rb', line 79

def transport_class
  @transport_class
end