Instrument database mode in service ping report
What does this MR do and why?
Addressing: #393573 (closed)
Adding database.mode
to the service ping report.
How to set up and validate locally
You can configure your database config/database.yml
in any of the 3 modes:
Database Configuration
- Single database
single-database
(noci:
entry)
development:
main:
....
- Single Database with CI Connection
single-database-ci-connection
:
development:
main:
database: gitlabhq_development
ci:
database: gitlabhq_development # the same as the one you have in main
database_tasks: false # the default is true
- Two databases
development:
main:
database: gitlabhq_development
database_tasks: true # that's the default value anyway
ci:
database: gitlabhq_development_ci # Different as the one you have in main
database_tasks: true
After you configure your database in any of the 3 modes, run these steps in Rails Console to see the database.mode
in the service ping report
Rails.cache.delete('usage_data')
data = ::Gitlab::Usage::ServicePingReport.for(output: :all_metrics_values)
puts data[:database] # You should see the database mode in the output
or
Rails.cache.delete('usage_data')
GitlabServicePingWorker.new.perform
RawUsageData.last.payload["database"]
References:
- https://docs.gitlab.com/ee/development/service_ping/
- https://docs.gitlab.com/ee/development/service_ping/troubleshooting.html#generate-a-fresh-new-service-ping
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #393573 (closed)
Edited by Omar Qunsul