Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add insights instrumentation - events and metrics #539

Merged
merged 76 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
d7e4a22
Add Honeybadger::Instrumentation class
roelbondoc May 2, 2024
d8e9c46
Add new configuration options for Insights
roelbondoc May 2, 2024
a556188
Add a CollectorWorker and collect block
roelbondoc May 2, 2024
21750be
Add Insight events for Rails via ActiveSupport::Notifictions
roelbondoc May 2, 2024
762da65
Add Insight events for ActiveJob notifications
roelbondoc May 2, 2024
53a1741
Add Insights for Sidekiq
roelbondoc May 2, 2024
ff5990a
Add Insights events for karafka
roelbondoc May 2, 2024
997e05e
Add Insights metrics gathering for solid_queue
roelbondoc May 2, 2024
b15d02e
Add a Puma plugin for Honeybadger
roelbondoc May 2, 2024
b06a6dc
Add Insights metrics for autotuner
roelbondoc May 2, 2024
c11c398
Add Insights events for net_http requests
roelbondoc May 2, 2024
da33856
Add spec for net_http plugin
roelbondoc May 2, 2024
3f48394
Add flushing of collector worker
roelbondoc May 3, 2024
820d6e5
Add spec for CollectorWorker
roelbondoc May 3, 2024
60dd43a
Add spec for agent
roelbondoc May 3, 2024
e940a76
Add some api documentation
roelbondoc May 3, 2024
51880d7
Report autotuner reports as events
roelbondoc May 6, 2024
acb7181
Enable cluster collection by default
roelbondoc May 6, 2024
1e5b671
Simplify configuration so there is only one main insights flag
roelbondoc May 9, 2024
5e0228b
Return nil if collection_interval is not configured
roelbondoc May 9, 2024
7bc1a83
Safe guard interval tick if for some reason it skips 0
roelbondoc May 9, 2024
5dc0626
Add some examples in the comments
roelbondoc May 10, 2024
78559c5
Apply suggestions from code review
roelbondoc May 10, 2024
c23f426
Simplify net_http payload
roelbondoc May 10, 2024
c4dc963
Make return value clear for nil config
roelbondoc May 10, 2024
40343cb
Simplify sidekiq utilization code
roelbondoc May 10, 2024
f2d9429
Update lib/honeybadger/config.rb
roelbondoc May 13, 2024
fcc4ef3
Rename histogram to measure
roelbondoc May 15, 2024
9e91cd3
Merge remote-tracking branch 'origin/master' into insights-events-ins…
roelbondoc May 15, 2024
b83aee1
Rename measure to time
roelbondoc May 17, 2024
ea0101d
Rename key to worker instead of index
roelbondoc May 17, 2024
00892cc
Update lib/honeybadger/agent.rb
roelbondoc May 21, 2024
85feb1f
Record request_id for action controller notifications
roelbondoc May 21, 2024
94cd569
Delegate metric methods to the module
roelbondoc May 21, 2024
200154d
Add request_id to context manager
roelbondoc May 22, 2024
ed41492
Add defaults for cluster_collection for sidekiq and solid_queue
roelbondoc May 22, 2024
16da78f
Prefix events with plugin name
roelbondoc May 22, 2024
a18cd47
Reverse it
roelbondoc May 22, 2024
adfb7ca
Generate timestamp with miliseconds
roelbondoc May 22, 2024
46b6c06
feat: implement metric registry for aggregation (#548)
roelbondoc May 22, 2024
d91e175
Do not attempt to record falsey values
roelbondoc May 22, 2024
67d3e36
Add infinity bin, and always send zero value bins
roelbondoc May 23, 2024
15a2f01
Fix typo
roelbondoc May 23, 2024
2e744f2
Add unit specs for metric types
roelbondoc May 23, 2024
a2077fc
Update version to beta string
roelbondoc May 23, 2024
76523b0
Update autotuner report event name
roelbondoc May 23, 2024
e6446b8
Merge branch 'master' into insights-events-instrumentation
stympy May 24, 2024
dae6bd3
Update default collection interval to 60 seconds
roelbondoc May 24, 2024
36530ec
Add specs for InstrumentationHelper module
roelbondoc May 24, 2024
874c43b
Refactor metrics api to be more uniform. Added specs
roelbondoc May 24, 2024
981e6f5
Switch from interval checking, to timed checking.
roelbondoc May 27, 2024
35bde80
Rename CollectorWorker to MetricsWorker
roelbondoc May 27, 2024
a8784d0
Better code organization.
roelbondoc May 27, 2024
95bbb40
Document 3 metric variants, and add specs
roelbondoc May 27, 2024
121746e
Remove unused files
roelbondoc May 27, 2024
521f895
Add hostname to all event payloads. Configurable.
roelbondoc May 28, 2024
9ad5e70
Add default config values for collection_interval
roelbondoc May 28, 2024
ee6f434
Report system information (mem/cpu load).
roelbondoc May 29, 2024
24b79be
Just send one event for all the system information.
roelbondoc May 29, 2024
803b7c9
Fix config context
roelbondoc May 29, 2024
dccbb7f
Add config for ignoring event types
roelbondoc May 29, 2024
07efc0d
Update lib/honeybadger/version.rb
roelbondoc May 30, 2024
c568495
Generate a hash for the metric signature
roelbondoc May 30, 2024
8326a19
Handle nil event_type
roelbondoc May 30, 2024
5d84e66
Update lib/honeybadger/agent.rb
roelbondoc May 30, 2024
8b7210c
Update description for events.ignore config
roelbondoc May 31, 2024
0b7cc47
Rename sampled to samples
roelbondoc May 31, 2024
7b5c8ba
Add more ActiveSupport::Notifications subscriptions
roelbondoc May 31, 2024
fff154d
Disable Net::HTTP instrumentation by default.
roelbondoc May 31, 2024
e09d15e
Fix spec
roelbondoc May 31, 2024
4a120f6
Use assignment instead of merge!
roelbondoc May 31, 2024
5f90555
Isolate metric calls to a specific agent
roelbondoc May 31, 2024
2676d6e
Fix call to monotonic_timer
roelbondoc May 31, 2024
9157106
Enable net_http with domain logging by default.
roelbondoc May 31, 2024
66fd331
Add config for separate max queue size for events. Increase batch size
roelbondoc Jun 3, 2024
0ec8957
Attempt to fix flakey spec in jruby
roelbondoc Jun 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/honeybadger/agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ def event(event_type, payload = {})

merged.merge!(Hash(payload))

return if config.ignored_events.any? { |check| merged[:event_type][check] }
return if config.ignored_events.any? { |check| merged[:event_type]&.match(check) }
roelbondoc marked this conversation as resolved.
Show resolved Hide resolved

events_worker.push(merged)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/honeybadger/metric.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def self.metric_type
end

def self.signature(metric_type, name, attributes)
roelbondoc marked this conversation as resolved.
Show resolved Hide resolved
"#{metric_type}-#{name}-#{attributes.keys.join('-')}-#{attributes.values.join('-')}".to_sym
Digest::SHA1.hexdigest("#{metric_type}-#{name}-#{attributes.keys.join('-')}-#{attributes.values.join('-')}").to_sym
end

def self.register(metric_name, attributes)
Expand Down
2 changes: 1 addition & 1 deletion lib/honeybadger/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Honeybadger
# The current String Honeybadger version.
VERSION = '5.11.0.beta1'.freeze
VERSION = '5.10.2'.freeze
end
9 changes: 9 additions & 0 deletions spec/unit/honeybadger/agent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,15 @@
expect(events_worker).to receive(:push)
end
end

context "when event type is nil" do
let(:ignored_events) { [/test/] }
let(:event_type) { nil }

it "does push an event" do
expect(events_worker).to receive(:push)
end
end
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/unit/honeybadger/metric_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
let(:name) { "capacity" }
let(:attributes) { { foo: "bar" } }

it { should eq :"gauge-capacity-foo-bar" }
it { should eq Digest::SHA1.hexdigest("gauge-capacity-foo-bar").to_sym }
end
end

Expand All @@ -39,7 +39,7 @@
let(:name) { "capacity" }
let(:attributes) { { foo: "bar" } }

it { should eq :"metric-capacity-foo-bar" }
it { should eq Digest::SHA1.hexdigest("metric-capacity-foo-bar").to_sym }
end
end
end