Class: Datadog::Core::Environment::AgentInfo
- Inherits:
-
Object
- Object
- Datadog::Core::Environment::AgentInfo
- Defined in:
- lib/datadog/core/environment/agent_info.rb
Overview
Retrieves the agent’s /info endpoint data. This data can be used to determine the capabilities of the local Datadog agent.
Instance Attribute Summary collapse
-
#agent_settings ⇒ Object
readonly
Returns the value of attribute agent_settings.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#propagation_checksum ⇒ Integer?
readonly
Returns the propagation checksum, comprising of process tags and optionally container tags (from the Trace Agent) Currently called/used by the DBM code to inject the propagation checksum into the SQL comment.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#fetch ⇒ Datadog::Core::Remote::Transport::HTTP::Negotiation::Response?
Fetches the information from the Trace Agent.
-
#initialize(agent_settings, logger: Datadog.logger) ⇒ AgentInfo
constructor
A new instance of AgentInfo.
Constructor Details
#initialize(agent_settings, logger: Datadog.logger) ⇒ AgentInfo
Returns a new instance of AgentInfo.
59 60 61 62 63 |
# File 'lib/datadog/core/environment/agent_info.rb', line 59 def initialize(agent_settings, logger: Datadog.logger) @agent_settings = agent_settings @logger = logger @client = Remote::Transport::HTTP.root(agent_settings: agent_settings, logger: logger) end |
Instance Attribute Details
#agent_settings ⇒ Object (readonly)
Returns the value of attribute agent_settings.
57 58 59 |
# File 'lib/datadog/core/environment/agent_info.rb', line 57 def agent_settings @agent_settings end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
57 58 59 |
# File 'lib/datadog/core/environment/agent_info.rb', line 57 def logger @logger end |
#propagation_checksum ⇒ Integer? (readonly)
Returns the propagation checksum, comprising of process tags and optionally container tags (from the Trace Agent) Currently called/used by the DBM code to inject the propagation checksum into the SQL comment.
This checksum is used for correlation across signals (traces, DBM, data streams, etc.) in environments
The checksum is populated by the trace transport’s periodic fetch calls.
88 89 90 |
# File 'lib/datadog/core/environment/agent_info.rb', line 88 def propagation_checksum @propagation_checksum end |
Instance Method Details
#==(other) ⇒ Object
77 78 79 |
# File 'lib/datadog/core/environment/agent_info.rb', line 77 def ==(other) other.is_a?(self.class) && other.agent_settings == agent_settings end |
#fetch ⇒ Datadog::Core::Remote::Transport::HTTP::Negotiation::Response?
Fetches the information from the Trace Agent.
68 69 70 71 72 73 74 75 |
# File 'lib/datadog/core/environment/agent_info.rb', line 68 def fetch res = @client.send_info return unless res.ok? update_propagation_checksum(res) res end |