Module: Logister

Defined in:
lib/logister.rb,
lib/logister/client.rb,
lib/logister/railtie.rb,
lib/logister/version.rb,
lib/logister/reporter.rb,
lib/logister/middleware.rb,
lib/logister/configuration.rb,
lib/logister/context_store.rb,
lib/logister/sql_subscriber.rb,
lib/logister/context_helpers.rb,
lib/logister/request_subscriber.rb,
lib/logister/active_job_reporter.rb,
lib/generators/logister/install_generator.rb

Defined Under Namespace

Modules: ActiveJobReporter, ContextHelpers, ContextStore, Generators Classes: Client, Configuration, Middleware, Railtie, Reporter, RequestSubscriber, SqlSubscriber

Constant Summary collapse

VERSION =
'0.2.4'

Class Method Summary collapse

Class Method Details

.add_breadcrumb(category:, message:, data: {}, level: "info") ⇒ Object



54
55
56
57
58
59
60
61
# File 'lib/logister.rb', line 54

def add_breadcrumb(category:, message:, data: {}, level: "info")
  ContextStore.add_manual_breadcrumb(
    category: category,
    message: message,
    data: data,
    level: level
  )
end

.add_dependency(name:, host: nil, method: nil, status: nil, duration_ms: nil, kind: nil, data: {}) ⇒ Object



63
64
65
66
67
68
69
70
71
72
73
# File 'lib/logister.rb', line 63

def add_dependency(name:, host: nil, method: nil, status: nil, duration_ms: nil, kind: nil, data: {})
  ContextStore.add_manual_dependency(
    name: name,
    host: host,
    method: method,
    status: status,
    duration_ms: duration_ms,
    kind: kind,
    data: data
  )
end

.configurationObject



13
14
15
# File 'lib/logister.rb', line 13

def configuration
  @configuration ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



17
18
19
20
# File 'lib/logister.rb', line 17

def configure
  yield(configuration)
  @reporter = nil
end

.flush(timeout: 2) ⇒ Object



46
47
48
# File 'lib/logister.rb', line 46

def flush(timeout: 2)
  reporter.flush(timeout: timeout)
end

.report_check_in(**kwargs) ⇒ Object



42
43
44
# File 'lib/logister.rb', line 42

def report_check_in(**kwargs)
  reporter.report_check_in(**kwargs)
end

.report_error(exception, **kwargs) ⇒ Object



26
27
28
# File 'lib/logister.rb', line 26

def report_error(exception, **kwargs)
  reporter.report_error(exception, **kwargs)
end

.report_log(**kwargs) ⇒ Object



38
39
40
# File 'lib/logister.rb', line 38

def report_log(**kwargs)
  reporter.report_log(**kwargs)
end

.report_metric(**kwargs) ⇒ Object



30
31
32
# File 'lib/logister.rb', line 30

def report_metric(**kwargs)
  reporter.report_metric(**kwargs)
end

.report_transaction(**kwargs) ⇒ Object



34
35
36
# File 'lib/logister.rb', line 34

def report_transaction(**kwargs)
  reporter.report_transaction(**kwargs)
end

.reporterObject



22
23
24
# File 'lib/logister.rb', line 22

def reporter
  @reporter ||= Reporter.new(configuration)
end

.shutdownObject



50
51
52
# File 'lib/logister.rb', line 50

def shutdown
  reporter.shutdown
end