Skip to content

Commit

Permalink
Remove reference to DataDog (#156)
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Thornton <ThorntonMatthew@users.noreply.github.com>
Co-authored-by: Matthew Thornton <ThorntonMatthew@users.noreply.github.com>
  • Loading branch information
ThorntonMatthew and ThorntonMatthew authored Oct 17, 2024
1 parent ba9d049 commit 60f14b4
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 82 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ gem 'coffee-rails', '~> 4.2', '>= 4.2.1'
gem 'jquery-rails', '>= 4.3.1'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
gem 'dogapi'
gem 'logstasher'

group :development, :test do
Expand Down
4 changes: 0 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ GEM
d3-rails (5.9.2)
railties (>= 3.1)
digest (3.1.1)
dogapi (1.39.0)
multi_json
dotenv (2.7.5)
dotenv-rails (2.7.5)
dotenv (= 2.7.5)
Expand Down Expand Up @@ -156,7 +154,6 @@ GEM
minitest (5.15.0)
momentjs-rails (2.20.1)
railties (>= 3.1)
multi_json (1.14.1)
neat (1.7.4)
bourbon (>= 4.0)
sass (>= 3.3)
Expand Down Expand Up @@ -294,7 +291,6 @@ DEPENDENCIES
caseflow!
coffee-rails (~> 4.2, >= 4.2.1)
connect_vbms!
dogapi
dotenv-rails (>= 2.1.2)
jbuilder (~> 2.5)
jquery-rails (>= 4.3.1)
Expand Down
30 changes: 0 additions & 30 deletions app/services/monitor_service.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
gem 'dogapi'

class MonitorService

attr_accessor :name, :polling_rate_sec, :time
Expand Down Expand Up @@ -34,11 +32,6 @@ def initialize
end

save

# Initialize dog so sub classes can use it as well as this parent abstract class
dd_api_key = ENV["DD_API_KEY"]
@dog = Dogapi::Client.new(dd_api_key)

end

def save
Expand Down Expand Up @@ -69,7 +62,6 @@ def failed
@failed_rate_5 -= @failed_rate_5 / 5.0
@failed_rate_5 += 1 / 5.0
save
self.update_datadog_metrics
end

def query
Expand Down Expand Up @@ -113,7 +105,6 @@ def query

@latency = latency

self.update_datadog_metrics
save
@pass
end
Expand All @@ -123,27 +114,6 @@ def query_service
# Set @pass to true/false according to the query result.
raise NotImplementedError.new("Implement the details of the query here")
end

## Update Datadog metrics or creates them
def update_datadog_metrics
update_dd_metrics_exectime = Benchmark.realtime do
@dog.batch_metrics do
@dog.emit_point("#{@name}.#{@api}.#{@env}.latency_summary","#{@latency}",
:tags => ["name:#{@name}", "api:#{@api}", "env:#{@env}"])
@dog.emit_point("#{@name}.#{@api}.#{@env}.latency_gauge","#{@latency}",
:tags => ["name:#{@name}", "api:#{@api}", "env:#{@env}"])
end

if @pass == true
@dog.emit_point("#{@name}.#{@api}.#{@env}.successful_query_total","1",
:tags => ["name:#{@name}", "api:#{@api}", "env:#{@env}"])
else
@dog.emit_point("#{@name}.#{@api}.#{@env}.failed_query_total","1",
:tags => ["name:#{@name}", "api:#{@api}", "env:#{@env}"])
end
end
Rails.logger.info("Latency DD Exec Time took: %p" % update_dd_metrics_exectime)
end
end


16 changes: 0 additions & 16 deletions app/services/trace_route_service.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
gem 'dogapi'

class TraceRouteService
attr_accessor :name, :time

Expand Down Expand Up @@ -28,7 +26,6 @@ class TraceRouteService
}.freeze

def initialize
@data_dog = Dogapi::Client.new(ENV["DD_API_KEY"])
@name = @@service_name
@time = 0
end
Expand Down Expand Up @@ -68,19 +65,6 @@ def query
object
end

@data_dog.batch_metrics do
endpoint_latencies.values.each do |latency|
latency[:latencies].each do |value|

@data_dog.emit_point(
"traceroute.#{ENV['DEPLOY_ENV']}.latency_summary",
value,
:tags => ["va_network_endpoint:#{latency[:tag]}", "url:#{latency[:ip]}"].compact
)
end
end
end

true
end

Expand Down
31 changes: 0 additions & 31 deletions app/services/vacols_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,37 +115,6 @@ def query_service
@pass = true
end

def update_datadog_metrics
# call the parent function
super
# then execute the bottom for vacols specific
update_vacols_dd_metrics_exectime = Benchmark.realtime do
@dog.batch_metrics do
# wait time by class
(@wait_time_by_class || []).each do |wtceach|
@dog.emit_point("vacols_performance", "#{wtceach['total_wait_time']}",
:tags => ["name:#{wtceach['wait_event']}", "env:#{@env}", "source:ash"])
end
# sys time model
(@sys_time_model || []).each do |stmeach|
@dog.emit_point("vacols_performance", "#{stmeach['time']}",
:tags => ["name:#{stmeach['stat_name']}", "env:#{@env}", "source:sys_time_model"])
end
# sum all db time 24 hrs
unless @sum_all_db_time_24hrs.nil? || @sum_all_db_time_24hrs.empty?
@dog.emit_point("vacols_performance", "#{@sum_all_db_time_24hrs.first['dbtime']}",
:tags => ["name:sum_all_db_time_24hrs", "env:#{@env}", "source:ash"])
end
# caseflow db time 24 hrs (ash)
unless @caseflow_db_time_24hrs.nil? || @caseflow_db_time_24hrs.empty?
@dog.emit_point("vacols_performance", "#{@caseflow_db_time_24hrs.first['dbtime']}",
:tags => ["name:caseflow_db_time_24hrs", "env:#{@env}", "source:ash"])
end
end
end
Rails.logger.info("Vacols Service DD Exec Time took: %p" % update_vacols_dd_metrics_exectime)
end

private

def should_reconnect_exception?(e)
Expand Down

0 comments on commit 60f14b4

Please sign in to comment.