Method: Datadog::Core::Configuration#configure_onto
- Defined in:
- lib/datadog/core/configuration.rb
#configure_onto(target, **opts) ⇒ Object
Apply configuration changes only to a specific Ruby object.
Certain integrations or Datadog features may use these settings to customize behavior for this object.
An example of a #configure_onto call:
“‘ client = Net::HTTP.new(host, port) Datadog.configure_onto(client, service_name: ’api-requests’, split_by_domain: true) “‘
In this example, it will configure the ‘client` object with custom options `service_name: ’api-requests’, split_by_domain: true`. The ‘Net::HTTP` integration will then use these customized options when the `client` is used, whereas other clients will use the `service_name: ’http-requests’‘ configuration provided to the `Datadog.configure` call block.
#configure_onto is used to separate cases where spans generated by certain objects require exceptional options.
The configuration keyword arguments provided should match well known options defined in the integration or feature that would use them.
For example, for ‘Datadog.configure_onto(redis_client, **opts)`, `opts` can be any of the options in the Redis Tracing::Contrib::Redis::Configuration::Settings class.
130 131 132 |
# File 'lib/datadog/core/configuration.rb', line 130 def configure_onto(target, **opts) Pin.set_on(target, **opts) end |