Module: Tinymon
- Defined in:
- lib/tinymon.rb,
lib/tinymonrb.rb,
lib/tinymon/scope.rb,
lib/tinymon/client.rb,
lib/tinymon/version.rb,
lib/tinymon/transport.rb,
lib/tinymon/stacktrace.rb,
lib/tinymon/integrations.rb,
lib/tinymon/event_builder.rb
Overview
Public API:
require "tinymon"
Tinymon.init(dsn: "tm_pub_xxx", environment: "production", release: "1.0.0")
begin
risky_thing
rescue => e
Tinymon.capture_exception(e)
end
Defined Under Namespace
Modules: EventBuilder, Integrations, Stacktrace
Classes: Client, Scope, Transport
Constant Summary
collapse
- SCOPE =
Singleton instance — mirrors the JS/Python SDKs’ module-level scope.
Scope.new
- VERSION =
"0.1.0"
- SDK_NAME =
"tinymon.ruby"
Class Method Summary
collapse
Class Method Details
._build_event(exception, **kwargs) ⇒ Object
Exposed for the cross-language contract test in test/test_contract.rb.
60
61
62
|
# File 'lib/tinymon.rb', line 60
def _build_event(exception, **kwargs)
EventBuilder.build(exception, **kwargs)
end
|
.add_breadcrumb(crumb) ⇒ Object
55
56
57
|
# File 'lib/tinymon.rb', line 55
def add_breadcrumb(crumb)
SCOPE.add_breadcrumb(crumb)
end
|
.capture_exception(exception) ⇒ Object
39
40
41
|
# File 'lib/tinymon.rb', line 39
def capture_exception(exception)
@client&.capture_exception(exception)
end
|
.capture_message(message, level: "info") ⇒ Object
43
44
45
|
# File 'lib/tinymon.rb', line 43
def capture_message(message, level: "info")
@client&.capture_message(message, level: level)
end
|
.init(dsn:, endpoint: nil, environment: nil, release: nil, sample_rate: 1.0, before_send: nil) ⇒ Object
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/tinymon.rb', line 26
def init(dsn:, endpoint: nil, environment: nil, release: nil, sample_rate: 1.0, before_send: nil)
@client = Client.new(
dsn: dsn,
endpoint: endpoint,
environment: environment,
release: release,
sample_rate: sample_rate,
before_send: before_send,
)
Integrations.install(@client)
@client
end
|
.set_tag(key, value) ⇒ Object
51
52
53
|
# File 'lib/tinymon.rb', line 51
def set_tag(key, value)
SCOPE.set_tag(key, value)
end
|
.set_user(user) ⇒ Object
47
48
49
|
# File 'lib/tinymon.rb', line 47
def set_user(user)
SCOPE.set_user(user)
end
|