When starting the grafana server locally I see that the custom.ini file gets loaded from conf/
and below are the logs to confirm that.
INFO[12-04|11:10:38] Starting Grafana logger=server version=5.3.0-pre1 commit=71f42c7a5 compiled=2018-11-28T12:08:50-0800
INFO[12-04|11:10:38] Config loaded from logger=settings file=/Users/schittimilla/UMP/sherlock.io/src/github.com/grafana/grafana/conf/defaults.ini
INFO[12-04|11:10:38] Config loaded from logger=settings file=/Users/schittimilla/UMP/sherlock.io/src/github.com/grafana/grafana/conf/custom.ini
INFO[12-04|11:10:38] Config overridden from Environment variable logger=settings var="GF_DATABASE_TYPE=sqlite3"
INFO[12-04|11:10:38] Config overridden from Environment variable logger=settings var="GF_DATABASE_HOST=127.0.0.1:3306"
INFO[12-04|11:10:38] Config overridden from Environment variable logger=settings var="GF_DATABASE_NAME=grafana"
INFO[12-04|11:10:38] Config overridden from Environment variable logger=settings var="GF_DATABASE_USER=root"
INFO[12-04|11:10:38] Config overridden from Environment variable logger=settings var="GF_SESSION_PROVIDER=file"
INFO[12-04|11:10:38] Path Home logger=settings path=/Users/schittimilla/UMP/sherlock.io/src/github.com/grafana/grafana
INFO[12-04|11:10:38] Path Data logger=settings path=/Users/schittimilla/UMP/sherlock.io/src/github.com/grafana/grafana/data
INFO[12-04|11:10:38] Path Logs logger=settings path=/Users/schittimilla/UMP/sherlock.io/src/github.com/grafana/grafana/data/log
INFO[12-04|11:10:38] Path Plugins logger=settings path=/Users/schittimilla/UMP/sherlock.io/src/github.com/grafana/grafana/data/plugins
INFO[12-04|11:10:38] Path Provisioning logger=settings path=/Users/schittimilla/UMP/sherlock.io/src/github.com/grafana/grafana/conf/provisioning
INFO[12-04|11:10:38] App mode production logger=settings
INFO[12-04|11:10:38] Initializing SqlStore logger=server
INFO[12-04|11:10:38] Connecting to DB logger=sqlstore dbtype=sqlite3
INFO[12-04|11:10:38] Starting DB migration logger=migrator
INFO[12-04|11:10:38] Initializing HTTPServer logger=server
INFO[12-04|11:10:38] Initializing SearchService logger=server
INFO[12-04|11:10:38] Initializing PluginManager logger=server
INFO[12-04|11:10:38] Starting plugin search logger=plugins
INFO[12-04|11:10:38] Registering plugin logger=plugins name="Pie Chart"
INFO[12-04|11:10:38] Initializing InternalMetricsService logger=server
INFO[12-04|11:10:38] Initializing CleanUpService logger=server
INFO[12-04|11:10:38] Initializing NotificationService logger=server
INFO[12-04|11:10:38] Initializing ProvisioningService logger=server
INFO[12-04|11:10:38] Initializing RenderingService logger=server
INFO[12-04|11:10:38] Initializing TracingService logger=server
INFO[12-04|11:10:38] Initializing Stream Manager
INFO[12-04|11:10:38] HTTP Server Listen logger=http.server address=0.0.0.0:3000 protocol=http subUrl= socket=
But when running the grafana on a remote server I see custom.ini
config is not loaded and instead grafana.ini
is loaded from /etc/grafana
. Below are the logs from a remote server
t=2018-12-04T19:08:20+0000 lvl=info msg="Starting Grafana" logger=server version=5.3.0-pre1 commit=unknown-dev compiled=2018-11-28T23:20:04+0000
t=2018-12-04T19:08:20+0000 lvl=info msg="Config loaded from" logger=settings file=/usr/share/grafana/conf/defaults.ini
t=2018-12-04T19:08:20+0000 lvl=info msg="Config loaded from" logger=settings file=/etc/grafana/grafana.ini
t=2018-12-04T19:08:20+0000 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.data=/var/lib/grafana"
t=2018-12-04T19:08:20+0000 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.logs=/var/log/grafana"
t=2018-12-04T19:08:20+0000 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.plugins=/var/lib/grafana/plugins"
t=2018-12-04T19:08:20+0000 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.provisioning=/etc/grafana/provisioning"
t=2018-12-04T19:08:20+0000 lvl=info msg="Config overridden from command line" logger=settings arg="default.log.mode=console"
t=2018-12-04T19:08:20+0000 lvl=info msg="Config overridden from Environment variable" logger=settings var="GF_PATHS_DATA=/var/lib/grafana"
t=2018-12-04T19:08:20+0000 lvl=info msg="Config overridden from Environment variable" logger=settings var="GF_PATHS_LOGS=/var/log/grafana"
t=2018-12-04T19:08:20+0000 lvl=info msg="Config overridden from Environment variable" logger=settings var="GF_PATHS_PLUGINS=/var/lib/grafana/plugins"
t=2018-12-04T19:08:20+0000 lvl=info msg="Config overridden from Environment variable" logger=settings var="GF_PATHS_PROVISIONING=/etc/grafana/provisioning"
t=2018-12-04T19:08:20+0000 lvl=info msg="Config overridden from Environment variable" logger=settings var="GF_DATABASE_TYPE=mysql"
t=2018-12-04T19:08:20+0000 lvl=info msg="Config overridden from Environment variable" logger=settings var="GF_DATABASE_HOST=mysql:3306"
t=2018-12-04T19:08:20+0000 lvl=info msg="Config overridden from Environment variable" logger=settings var="GF_DATABASE_NAME=grafana"
t=2018-12-04T19:08:20+0000 lvl=info msg="Config overridden from Environment variable" logger=settings var="GF_DATABASE_USER=****"
t=2018-12-04T19:08:20+0000 lvl=info msg="Config overridden from Environment variable" logger=settings var="GF_DATABASE_PASSWORD=*********"
t=2018-12-04T19:08:20+0000 lvl=info msg="Config overridden from Environment variable" logger=settings var="GF_SESSION_PROVIDER=mysql"
t=2018-12-04T19:08:20+0000 lvl=info msg="Path Home" logger=settings path=/usr/share/grafana
t=2018-12-04T19:08:20+0000 lvl=info msg="Path Data" logger=settings path=/var/lib/grafana
t=2018-12-04T19:08:20+0000 lvl=info msg="Path Logs" logger=settings path=/var/log/grafana
t=2018-12-04T19:08:20+0000 lvl=info msg="Path Plugins" logger=settings path=/var/lib/grafana/plugins
t=2018-12-04T19:08:20+0000 lvl=info msg="Path Provisioning" logger=settings path=/etc/grafana/provisioning
t=2018-12-04T19:08:20+0000 lvl=info msg="App mode production" logger=settings
t=2018-12-04T19:08:20+0000 lvl=info msg="Initializing SqlStore" logger=server
t=2018-12-04T19:08:20+0000 lvl=info msg="Connecting to DB" logger=sqlstore dbtype=mysql
t=2018-12-04T19:08:20+0000 lvl=info msg="Starting DB migration" logger=migrator
t=2018-12-04T19:08:20+0000 lvl=info msg="Initializing HTTPServer" logger=server
t=2018-12-04T19:08:20+0000 lvl=info msg="Initializing SearchService" logger=server
t=2018-12-04T19:08:20+0000 lvl=info msg="Initializing PluginManager" logger=server
t=2018-12-04T19:08:20+0000 lvl=info msg="Starting plugin search" logger=plugins
t=2018-12-04T19:08:20+0000 lvl=info msg="Initializing InternalMetricsService" logger=server
t=2018-12-04T19:08:20+0000 lvl=info msg="Initializing AlertingService" logger=server
t=2018-12-04T19:08:20+0000 lvl=info msg="Initializing CleanUpService" logger=server
t=2018-12-04T19:08:20+0000 lvl=info msg="Initializing NotificationService" logger=server
t=2018-12-04T19:08:20+0000 lvl=info msg="Initializing ProvisioningService" logger=server
t=2018-12-04T19:08:20+0000 lvl=info msg="Initializing RenderingService" logger=server
t=2018-12-04T19:08:20+0000 lvl=info msg="Initializing TracingService" logger=server
panic: invalid DSN: missing the slash separating the database name
I am getting the above error, I think this is because my custom.ini file was not loaded. Here is my custom.ini
file
#################################### Database ############################
[database]
type = ${GF_DATABASE_TYPE}
host = ${GF_DATABASE_HOST}
name = ${GF_DATABASE_NAME}
user = ${GF_DATABASE_USER}
password = ${GF_DATABASE_PASSWORD}
ssl_mode = false
#################################### Session #############################
[session]
session_life_time = 43200
provider = ${GF_SESSION_PROVIDER}
provider_config = `${GF_DATABASE_USER}:${GF_DATABASE_PASSWORD}@tcp(${GF_DATABASE_HOST})/${GF_DATABASE_NAME}`