Module: Chronos
- Extended by:
- ObservabilityFacade
- Defined in:
- lib/chronos.rb,
lib/chronos/core.rb,
lib/chronos/agent.rb,
lib/chronos/ports.rb,
lib/chronos/rails.rb,
lib/chronos/errors.rb,
lib/chronos/version.rb,
lib/chronos/adapters.rb,
lib/chronos/internal.rb,
lib/chronos/application.rb,
lib/chronos/core/notice.rb,
lib/chronos/integrations.rb,
lib/chronos/configuration.rb,
lib/chronos/rails/railtie.rb,
lib/chronos/core/sanitizer.rb,
lib/chronos/core/breadcrumb.rb,
lib/chronos/ports/transport.rb,
lib/chronos/rails/installer.rb,
lib/chronos/core/runtime_info.rb,
lib/chronos/integrations/rack.rb,
lib/chronos/core/notice_builder.rb,
lib/chronos/core/sql_normalizer.rb,
lib/chronos/ports/context_store.rb,
lib/chronos/core/safe_serializer.rb,
lib/chronos/core/telemetry_event.rb,
lib/chronos/integrations/sidekiq.rb,
lib/chronos/internal/safe_logger.rb,
lib/chronos/internal/worker_pool.rb,
lib/chronos/observability_facade.rb,
lib/chronos/core/backtrace_parser.rb,
lib/chronos/core/cache_normalizer.rb,
lib/chronos/core/metric_aggregate.rb,
lib/chronos/integrations/net_http.rb,
lib/chronos/configuration/snapshot.rb,
lib/chronos/core/deploy_normalizer.rb,
lib/chronos/internal/bounded_queue.rb,
lib/chronos/core/payload_serializer.rb,
lib/chronos/integrations/active_job.rb,
lib/chronos/integrations/capistrano.rb,
lib/chronos/internal/memory_backlog.rb,
lib/chronos/application/retry_policy.rb,
lib/chronos/configuration/validation.rb,
lib/chronos/core/correlation_context.rb,
lib/chronos/integrations/job_payload.rb,
lib/chronos/application/ignore_policy.rb,
lib/chronos/application/apm_aggregator.rb,
lib/chronos/adapters/net_http_transport.rb,
lib/chronos/application/circuit_breaker.rb,
lib/chronos/core/sensitive_value_filter.rb,
lib/chronos/configuration/apm_validation.rb,
lib/chronos/integrations/rack/middleware.rb,
lib/chronos/application/capture_exception.rb,
lib/chronos/application/capture_telemetry.rb,
lib/chronos/application/delivery_pipeline.rb,
lib/chronos/core/exception_cause_collector.rb,
lib/chronos/rails/notifications_subscriber.rb,
lib/chronos/application/dependency_reporter.rb,
lib/chronos/application/apm_error_classifier.rb,
lib/chronos/application/remote_configuration.rb,
lib/chronos/adapters/thread_local_context_store.rb,
lib/generators/chronos/install/install_generator.rb
Overview
Framework-independent public facade for the Chronos Ruby agent.
Defined Under Namespace
Modules: Adapters, Application, Core, Generators, Integrations, Internal, ObservabilityFacade, Ports, Rails
Classes: Agent, Configuration, ConfigurationError, Error
Constant Summary
collapse
- VERSION =
Current version of the legacy Chronos Ruby agent.
"0.9.0.pre.2".freeze
Class Method Summary
collapse
cache_integration_options, external_http_integration_options, instrument_net_http, notify_deploy, report_dependencies
Class Method Details
.add_breadcrumb(attributes = {}) ⇒ Object
105
106
107
108
109
110
|
# File 'lib/chronos.rb', line 105
def add_breadcrumb(attributes = {})
agent = current_agent
agent ? agent.add_breadcrumb(attributes) : false
rescue StandardError
false
end
|
.apm_integration_options ⇒ Object
126
127
128
129
130
131
|
# File 'lib/chronos.rb', line 126
def apm_integration_options
agent = current_agent
agent ? agent.apm_integration_options : {:enabled => false}
rescue StandardError
{:enabled => false}
end
|
.close(timeout = Agent::DEFAULT_FLUSH_TIMEOUT) ⇒ Object
173
174
175
176
177
178
179
180
181
182
|
# File 'lib/chronos.rb', line 173
def close(timeout = Agent::DEFAULT_FLUSH_TIMEOUT)
agent = @mutex.synchronize do
current = @agent
@agent = nil
current
end
agent ? agent.close(timeout) : true
rescue StandardError
false
end
|
71
72
73
74
75
76
77
78
79
80
81
82
|
# File 'lib/chronos.rb', line 71
def configure
configuration = Configuration.new
yield configuration if block_given?
agent = Agent.new(configuration.snapshot)
previous = nil
@mutex.synchronize do
previous = @agent
@agent = agent
end
previous.close if previous
configuration
end
|
162
163
164
|
# File 'lib/chronos.rb', line 162
def configured?
!current_agent.nil?
end
|
.flush(timeout = Agent::DEFAULT_FLUSH_TIMEOUT) ⇒ Object
166
167
168
169
170
171
|
# File 'lib/chronos.rb', line 166
def flush(timeout = Agent::DEFAULT_FLUSH_TIMEOUT)
agent = current_agent
agent ? agent.flush(timeout) : true
rescue StandardError
false
end
|
.ignore_if(&block) ⇒ Object
148
149
150
151
152
153
|
# File 'lib/chronos.rb', line 148
def ignore_if(&block)
agent = current_agent
agent ? agent.ignore_if(&block) : false
rescue StandardError
false
end
|
.notify(exception, context = {}) ⇒ Object
84
85
86
87
88
89
|
# File 'lib/chronos.rb', line 84
def notify(exception, context = {})
agent = current_agent
agent ? agent.notify(exception, context) : false
rescue StandardError
false
end
|
.notify_once(exception, context = {}) ⇒ Object
141
142
143
144
145
146
|
# File 'lib/chronos.rb', line 141
def notify_once(exception, context = {})
agent = current_agent
agent ? agent.notify_once(exception, context) : false
rescue StandardError
false
end
|
.notify_sync(exception, context = {}) ⇒ Object
91
92
93
94
95
96
|
# File 'lib/chronos.rb', line 91
def notify_sync(exception, context = {})
agent = current_agent
agent ? agent.notify_sync(exception, context) : false
rescue StandardError
false
end
|
.propagation_context ⇒ Object
Returns only trace/request identifiers for optional process-boundary adapters.
134
135
136
137
138
139
|
# File 'lib/chronos.rb', line 134
def propagation_context
agent = current_agent
agent ? agent.propagation_context : {}
rescue StandardError
{}
end
|
.rails_integration_options(environment = nil, console = false) ⇒ Object
155
156
157
158
159
160
|
# File 'lib/chronos.rb', line 155
def rails_integration_options(environment = nil, console = false)
agent = current_agent
agent ? agent.rails_integration_options(environment, console) : {:enabled => false}
rescue StandardError
{:enabled => false}
end
|
.record_event(event_type, payload = {}, context = {}) ⇒ Object
112
113
114
115
116
117
|
# File 'lib/chronos.rb', line 112
def record_event(event_type, payload = {}, context = {})
agent = current_agent
agent ? agent.record_event(event_type, payload, context) : false
rescue StandardError
false
end
|
.record_event_once(key, event_type, payload = {}, context = {}) ⇒ Object
119
120
121
122
123
124
|
# File 'lib/chronos.rb', line 119
def record_event_once(key, event_type, payload = {}, context = {})
agent = current_agent
agent ? agent.record_event_once(key, event_type, payload, context) : false
rescue StandardError
false
end
|
.with_context(context = {}) ⇒ Object
98
99
100
101
102
103
|
# File 'lib/chronos.rb', line 98
def with_context(context = {})
agent = current_agent
return yield unless agent
agent.with_context(context) { yield }
end
|