-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add dalli
support
#196
Add dalli
support
#196
Conversation
6e1d919
to
231b553
Compare
|
||
module Datadog | ||
module Contrib | ||
module Dalli |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@p-lambert let's write a bit of documentation for this contrib module.
39a3c91
to
5b82c79
Compare
5b82c79
to
91fd2ba
Compare
docs/GettingStarted.md
Outdated
Dalli integration will trace all calls to your `memcached` server: | ||
|
||
require 'dalli' | ||
require 'ddtrace' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't we need to patch / patch all something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will add that as a general example; unfortunately for Rails it will be:
require 'ddtrace'
# Tracing configuration
Rails.configuration.datadog_trace = {
auto_instrument: true,
auto_instrument_redis: true,
auto_instrument_grape: true,
default_service: ENV['RAILS_SERVICE'] || 'rails-local',
default_database_service: ENV['RAILS_MYSQL_SERVICE'] || 'db-local',
default_cache_service: ENV['RAILS_CACHE_SERVICE'] || 'cache-local',
default_controller_service: ENV['RAILS_CONTROLLER_SERVICE'] || 'controller-local',
trace_agent_hostname: ENV['DATADOG_TRACER'] || 'datadog'
}
Datadog::Monkey.patch_module(:dalli)
pin = Datadog::Pin.get_from(::Dalli)
pin.service = 'dalli-cache'
mostly because we have some things that are patched via Rails settings, and others that are not. I'd say to not add Dalli to the auto_instrument_*
since we're planning to remove this settings in favor of a better way to configure our integrations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's wait for the CI that is green and merge it. I've updated the docs so the patch_module
call is here, and we show also how to update the service name.
After the Configuration
change, I think it will be far better. For now, let's stick to the legacy API.
Overview
Dalli integration will trace all calls to your memcached server: