Class: Datadog::Core::Telemetry::Event::AppClientConfigurationChange
- Defined in:
- lib/datadog/core/telemetry/event.rb
Overview
Telemetry class for the ‘app-client-configuration-change’ event
Instance Attribute Summary collapse
-
#changes ⇒ Object
readonly
Returns the value of attribute changes.
-
#origin ⇒ Object
readonly
Returns the value of attribute origin.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #configuration ⇒ Object
- #hash ⇒ Object
-
#initialize(changes, origin) ⇒ AppClientConfigurationChange
constructor
A new instance of AppClientConfigurationChange.
- #payload ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(changes, origin) ⇒ AppClientConfigurationChange
Returns a new instance of AppClientConfigurationChange.
288 289 290 291 292 |
# File 'lib/datadog/core/telemetry/event.rb', line 288 def initialize(changes, origin) super() @changes = changes @origin = origin end |
Instance Attribute Details
#changes ⇒ Object (readonly)
Returns the value of attribute changes.
282 283 284 |
# File 'lib/datadog/core/telemetry/event.rb', line 282 def changes @changes end |
#origin ⇒ Object (readonly)
Returns the value of attribute origin.
282 283 284 |
# File 'lib/datadog/core/telemetry/event.rb', line 282 def origin @origin end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
323 324 325 |
# File 'lib/datadog/core/telemetry/event.rb', line 323 def ==(other) other.is_a?(AppClientConfigurationChange) && other.changes == @changes && other.origin == @origin end |
#configuration ⇒ Object
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 |
# File 'lib/datadog/core/telemetry/event.rb', line 298 def configuration config = Datadog.configuration seq_id = Event.configuration_sequence.next res = @changes.map do |name, value| { name: name, value: value, origin: @origin, seq_id: seq_id, } end unless config.dig('appsec', 'sca_enabled').nil? res << { name: 'appsec.sca_enabled', value: config.appsec.sca_enabled, origin: 'code', seq_id: seq_id, } end res end |
#hash ⇒ Object
329 330 331 |
# File 'lib/datadog/core/telemetry/event.rb', line 329 def hash [self.class, @changes, @origin].hash end |
#payload ⇒ Object
294 295 296 |
# File 'lib/datadog/core/telemetry/event.rb', line 294 def payload { configuration: configuration } end |
#type ⇒ Object
284 285 286 |
# File 'lib/datadog/core/telemetry/event.rb', line 284 def type 'app-client-configuration-change' end |