-
Notifications
You must be signed in to change notification settings - Fork 170
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
If the query result is cached, it will always be marked as primary in the log. #307
Comments
I've a same question. |
Add below to your initializer to skip printing module MakaraLoggingSubscriber
# See https://github.com/instacart/makara/blob/e45ba090fce998dad9e9a2759426f4695009cfae/lib/makara/logging/subscriber.rb#L23
def current_wrapper_name(event)
return nil if event.payload[:cached]
super(event)
end
end
ActiveRecord::LogSubscriber.log_subscribers.each do |subscriber|
subscriber.extend ::MakaraLoggingSubscriber
end |
Hello, I have problem related to query log. They're not showing value from
database.yml default: &default
adapter: postgresql_makara
encoding: unicode
# For details on connection pooling, see Rails configuration guide
# https://guides.rubyonrails.org/configuring.html#database-pooling
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
development:
<<: *default
database: super_awesome_api_development
makara:
id: postgresql
# list your connections with the override values (they're merged into the top-level config)
# be sure to provide the role if primary, role is assumed to be a replica if not provided
connections:
- role: master
name: primary
blacklist_duration: 0
host: localhost
- role: replica
name: replica
host: localhost development.log
I don't know if this query hit primary or replica. Is there any config I should add? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello.
Thanks for the easy to use and awesome gem!
I'm currently verifying it for use in a production environment and found a phenomenon that I'm not sure if it's a bug or a specification, so I'd like to ask a question.
Versions
database.yml
Log
log/development.log
Question
The cached results are always output as
CACHE [primary]
in the log.I've been monitoring both primary and replica mysql with general-log output, but there is no log output on the primary, only on the replica.
I thought it would be better to show
CACHE [replica]
since it is a cache of the query results to replica.The text was updated successfully, but these errors were encountered: