mirror of
https://github.com/cmur2/dyndnsd.git
synced 2025-07-12 07:11:17 +02:00
tracing: add opentracing for rack and dyndnsd with configurable jaeger-client support and spanmanager
This commit is contained in:
@ -17,5 +17,25 @@ module Dyndnsd
|
||||
rescue ArgumentError
|
||||
return false
|
||||
end
|
||||
|
||||
def self.user_allowed?(username, password, users)
|
||||
(users.key? username) && (users[username]['password'] == password)
|
||||
end
|
||||
|
||||
def self.changed?(hostname, myips, hosts)
|
||||
# myips order is always deterministic
|
||||
(!hosts.include? hostname) || (hosts[hostname] != myips)
|
||||
end
|
||||
|
||||
def self.span(operation, &block)
|
||||
span = OpenTracing.start_span(operation)
|
||||
span.set_tag('component', 'dyndnsd')
|
||||
span.set_tag('span.kind', 'server')
|
||||
begin
|
||||
block.call(span)
|
||||
ensure
|
||||
span.finish
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user