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/reporting_scope.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, ReportingScope Classes: Client, Configuration, Middleware, Railtie, Reporter, RequestSubscriber, SqlSubscriber

Constant Summary collapse

VERSION =
'0.3.1'

Class Method Summary collapse

Class Method Details

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



71
72
73
74
75
76
77
78
# File 'lib/logister.rb', line 71

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



80
81
82
83
84
85
86
87
88
89
90
# File 'lib/logister.rb', line 80

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



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

def configuration
  @configuration ||= Configuration.new
end

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

Yields:



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

def configure
  yield(configuration)
  @reporter = nil
end

.flush(timeout: 2) ⇒ Object



63
64
65
# File 'lib/logister.rb', line 63

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

.record_deployment(**kwargs) ⇒ Object



59
60
61
# File 'lib/logister.rb', line 59

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

.report_check_in(**kwargs) ⇒ Object



55
56
57
# File 'lib/logister.rb', line 55

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

.report_error(exception, **kwargs) ⇒ Object



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

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

.report_log(**kwargs) ⇒ Object



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

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

.report_metric(**kwargs) ⇒ Object



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

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

.report_span(**kwargs) ⇒ Object



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

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

.report_transaction(**kwargs) ⇒ Object



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

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

.reporterObject



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

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

.reporting_suppressed?Boolean

Returns:

  • (Boolean)


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

def reporting_suppressed?
  ReportingScope.suppressed?
end

.shutdownObject



67
68
69
# File 'lib/logister.rb', line 67

def shutdown
  reporter.shutdown
end

.suppress_reporting(&block) ⇒ Object



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

def suppress_reporting(&block)
  ReportingScope.suppress(&block)
end