Skip to content

Commit

Permalink
Grafana SQLite3 supports WAL
Browse files Browse the repository at this point in the history
Signed-off-by: Jamie Van Dyke <jamie.vandyke@digital.cabinet-office.gov.uk>
  • Loading branch information
dark5un authored and psycofdj committed Jun 5, 2023
1 parent 16387e3 commit 01f5aa8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions jobs/grafana/spec
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ properties:
description: "(MySQL only) The common name field of the certificate used by the mysql server. Not necessary if ssl_mode is set to 'skip-verify'"
grafana.database.log_queries:
description: "Set to true to log the sql calls and execution times"
grafana.database.wal:
description: "(SQLite3 only & optional) Setting it to true enables SQLite WAL (Write-Ahead Logging). Possible values are true, false. If not set defaults to false for Grafana"

grafana.remote_cache.type:
description: "Either 'redis', 'memcached', 'database'"
Expand Down
4 changes: 4 additions & 0 deletions jobs/grafana/templates/config/grafana.ini
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ path = /var/vcap/store/grafana/grafana.db
# For "sqlite3" only. cache mode setting used for connecting to the database
cache_mode = <%= cache_mode %>
<% end %>
<% if_p('grafana.database.wal') do |wal| %>
# Enable/disable Write-Ahead Logging, https://sqlite.org/wal.html. WAL has benefits when sqlite3 struggles with locks.
wal = <%= wal %>
<% end %>
<% elsif p('grafana.database.type') == "mysql" || p('grafana.database.type') == "postgres" %>
<%
database_host = nil
Expand Down

0 comments on commit 01f5aa8

Please sign in to comment.