Class: Datadog::Core::Telemetry::Event::AppClientConfigurationChange Private

Inherits:
Base
  • Object
show all
Defined in:
lib/datadog/core/telemetry/event/app_client_configuration_change.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Telemetry class for the 'app-client-configuration-change' event

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(changes, origin) ⇒ AppClientConfigurationChange

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of AppClientConfigurationChange.



18
19
20
21
22
# File 'lib/datadog/core/telemetry/event/app_client_configuration_change.rb', line 18

def initialize(changes, origin)
  super()
  @changes = changes
  @origin = origin
end

Instance Attribute Details

#changesObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



12
13
14
# File 'lib/datadog/core/telemetry/event/app_client_configuration_change.rb', line 12

def changes
  @changes
end

#originObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



12
13
14
# File 'lib/datadog/core/telemetry/event/app_client_configuration_change.rb', line 12

def origin
  @origin
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



54
55
56
# File 'lib/datadog/core/telemetry/event/app_client_configuration_change.rb', line 54

def ==(other)
  other.is_a?(AppClientConfigurationChange) && other.changes == @changes && other.origin == @origin
end

#configurationObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/datadog/core/telemetry/event/app_client_configuration_change.rb', line 28

def configuration
  config = Datadog.configuration

  # @type var res: Array[telemetry_configuration]
  res = @changes.map do |name, value|
    {
      name: name,
      value: Telemetry::ConfigurationValue.convert(value),
      origin: @origin,
      seq_id: Configuration::Option::Precedence::REMOTE_CONFIGURATION.numeric.next,
    }
  end

  # DEV: This seems unnecessary (we send the state of sca_enabled for each remote config change)
  unless config.dig("appsec", "sca_enabled").nil?
    res << {
      name: "appsec.sca_enabled",
      value: config.appsec.sca_enabled,
      origin: "code",
      seq_id: Configuration::Option::Precedence::PROGRAMMATIC.numeric.next,
    }
  end

  res
end

#hashObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



60
61
62
# File 'lib/datadog/core/telemetry/event/app_client_configuration_change.rb', line 60

def hash
  [self.class, @changes, @origin].hash
end

#payloadObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



24
25
26
# File 'lib/datadog/core/telemetry/event/app_client_configuration_change.rb', line 24

def payload
  {configuration: configuration}
end

#typeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



14
15
16
# File 'lib/datadog/core/telemetry/event/app_client_configuration_change.rb', line 14

def type
  "app-client-configuration-change"
end