• Dylan Griffith's avatar
    Log database duration per database · 42472bdd
    Dylan Griffith authored
    As part of https://gitlab.com/groups/gitlab-org/-/epics/5759 we're
    preparing the GitLab application to handle connections to multiple
    databases. As such we want to improve our observability to understand
    these multiple databases.
    
    This MR is a first step which will break down the total database
    duration of a request by the database name of the database connection.
    At present this will only be 1 extra field (`gitlabhq_production` on
    production) but in future it will automatically start logging
    information about the other databases we add.
    
    We assume that database name should be sufficient for distinguishing
    these connections in our logs for the time being. Technically we could
    be conneting to multiple database servers with the same database name
    but we don't plan on doing that first up and we can come up with a
    different way to identify hosts with the same database name later if
    that becomes necessary.
    42472bdd
structured_logger_spec.rb 15.4 KB