local_settings.py.j2 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. ## Graphite local_settings.py
  2. # Edit this file to customize the default Graphite webapp settings
  3. #
  4. # Additional customizations to Django settings can be added to this file as well
  5. #####################################
  6. # General Configuration #
  7. #####################################
  8. # Set this to a long, random unique string to use as a secret key for this
  9. # install. This key is used for salting of hashes used in auth tokens,
  10. # CRSF middleware, cookie storage, etc. This should be set identically among
  11. # instances if used behind a load balancer.
  12. SECRET_KEY = 'SAFE_DEFAULT'
  13. # In Django 1.5+ set this to the list of hosts your graphite instances is
  14. # accessible as. See:
  15. # https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-ALLOWED_HOSTS
  16. #ALLOWED_HOSTS = [ '*' ]
  17. # Set your local timezone (Django's default is America/Chicago)
  18. # If your graphs appear to be offset by a couple hours then this probably
  19. # needs to be explicitly set to your local timezone.
  20. TIME_ZONE = 'Europe/Berlin'
  21. # Override this to provide documentation specific to your Graphite deployment
  22. #DOCUMENTATION_URL = "http://graphite.readthedocs.org/"
  23. # Logging
  24. # True see: https://answers.launchpad.net/graphite/+question/159731
  25. LOG_RENDERING_PERFORMANCE = True
  26. LOG_CACHE_PERFORMANCE = True
  27. LOG_METRIC_ACCESS = True
  28. # Enable full debug page display on exceptions (Internal Server Error pages)
  29. DEBUG = False
  30. # If using RRD files and rrdcached, set to the address or socket of the daemon
  31. #FLUSHRRDCACHED = 'unix:/var/run/rrdcached.sock'
  32. # This lists the memcached servers that will be used by this webapp.
  33. # If you have a cluster of webapps you should ensure all of them
  34. # have the *exact* same value for this setting. That will maximize cache
  35. # efficiency. Setting MEMCACHE_HOSTS to be empty will turn off use of
  36. # memcached entirely.
  37. #
  38. # You should not use the loopback address (127.0.0.1) here if using clustering
  39. # as every webapp in the cluster should use the exact same values to prevent
  40. # unneeded cache misses. Set to [] to disable caching of images and fetched data
  41. #MEMCACHE_HOSTS = ['10.10.10.10:11211', '10.10.10.11:11211', '10.10.10.12:11211']
  42. DEFAULT_CACHE_DURATION = 60 # Cache images and data for 1 minute
  43. #####################################
  44. # Filesystem Paths #
  45. #####################################
  46. # Change only GRAPHITE_ROOT if your install is merely shifted from /opt/graphite
  47. # to somewhere else
  48. GRAPHITE_ROOT = '/usr/share/graphite-web'
  49. # Most installs done outside of a separate tree such as /opt/graphite will only
  50. # need to change these three settings. Note that the default settings for each
  51. # of these is relative to GRAPHITE_ROOT
  52. CONF_DIR = '/etc/graphite'
  53. STORAGE_DIR = '/var/lib/graphite/whisper'
  54. CONTENT_DIR = '/usr/share/graphite-web/static'
  55. # To further or fully customize the paths, modify the following. Note that the
  56. # default settings for each of these are relative to CONF_DIR and STORAGE_DIR
  57. #
  58. ## Webapp config files
  59. #DASHBOARD_CONF = '/opt/graphite/conf/dashboard.conf'
  60. #GRAPHTEMPLATES_CONF = '/opt/graphite/conf/graphTemplates.conf'
  61. ## Data directories
  62. # NOTE: If any directory is unreadable in DATA_DIRS it will break metric browsing
  63. WHISPER_DIR = '/var/lib/graphite/whisper'
  64. #RRD_DIR = '/opt/graphite/storage/rrd'
  65. #DATA_DIRS = [WHISPER_DIR, RRD_DIR] # Default: set from the above variables
  66. LOG_DIR = '/var/log/graphite'
  67. INDEX_FILE = '/var/lib/graphite/search_index' # Search index file
  68. #####################################
  69. # Email Configuration #
  70. #####################################
  71. # This is used for emailing rendered Graphs
  72. # Default backend is SMTP
  73. #EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
  74. #EMAIL_HOST = 'localhost'
  75. #EMAIL_PORT = 25
  76. #EMAIL_HOST_USER = ''
  77. #EMAIL_HOST_PASSWORD = ''
  78. #EMAIL_USE_TLS = False
  79. # To drop emails on the floor, enable the Dummy backend:
  80. #EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend'
  81. #####################################
  82. # Authentication Configuration #
  83. #####################################
  84. ## LDAP / ActiveDirectory authentication setup
  85. #USE_LDAP_AUTH = True
  86. #LDAP_SERVER = "ldap.mycompany.com"
  87. #LDAP_PORT = 389
  88. # OR
  89. #LDAP_URI = "ldaps://ldap.mycompany.com:636"
  90. #LDAP_SEARCH_BASE = "OU=users,DC=mycompany,DC=com"
  91. #LDAP_BASE_USER = "CN=some_readonly_account,DC=mycompany,DC=com"
  92. #LDAP_BASE_PASS = "readonly_account_password"
  93. #LDAP_USER_QUERY = "(username=%s)" #For Active Directory use "(sAMAccountName=%s)"
  94. #
  95. # If you want to further customize the ldap connection options you should
  96. # directly use ldap.set_option to set the ldap module's global options.
  97. # For example:
  98. #
  99. #import ldap
  100. #ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_ALLOW)
  101. #ldap.set_option(ldap.OPT_X_TLS_CACERTDIR, "/etc/ssl/ca")
  102. #ldap.set_option(ldap.OPT_X_TLS_CERTFILE, "/etc/ssl/mycert.pem")
  103. #ldap.set_option(ldap.OPT_X_TLS_KEYFILE, "/etc/ssl/mykey.pem")
  104. # See http://www.python-ldap.org/ for further details on these options.
  105. ## REMOTE_USER authentication. See: https://docs.djangoproject.com/en/dev/howto/auth-remote-user/
  106. #USE_REMOTE_USER_AUTHENTICATION = True
  107. # Override the URL for the login link (e.g. for django_openid_auth)
  108. #LOGIN_URL = '/account/login'
  109. ##########################
  110. # Database Configuration #
  111. ##########################
  112. # By default sqlite is used. If you cluster multiple webapps you will need
  113. # to setup an external database (such as MySQL) and configure all of the webapp
  114. # instances to use the same database. Note that this database is only used to store
  115. # Django models such as saved graphs, dashboards, user preferences, etc.
  116. # Metric data is not stored here.
  117. #
  118. # DO NOT FORGET TO RUN 'manage.py syncdb' AFTER SETTING UP A NEW DATABASE
  119. #
  120. # The following built-in database engines are available:
  121. # django.db.backends.postgresql # Removed in Django 1.4
  122. # django.db.backends.postgresql_psycopg2
  123. # django.db.backends.mysql
  124. # django.db.backends.sqlite3
  125. # django.db.backends.oracle
  126. #
  127. # The default is 'django.db.backends.sqlite3' with file 'graphite.db'
  128. # located in STORAGE_DIR
  129. #
  130. DATABASES = {
  131. 'default': {
  132. 'NAME': '/var/lib/graphite/graphite.db',
  133. 'ENGINE': 'django.db.backends.sqlite3',
  134. 'USER': '',
  135. 'PASSWORD': '',
  136. 'HOST': '',
  137. 'PORT': ''
  138. }
  139. }
  140. #########################
  141. # Cluster Configuration #
  142. #########################
  143. # (To avoid excessive DNS lookups you want to stick to using IP addresses only in this entire section)
  144. #
  145. # This should list the IP address (and optionally port) of the webapp on each
  146. # remote server in the cluster. These servers must each have local access to
  147. # metric data. Note that the first server to return a match for a query will be
  148. # used.
  149. CLUSTER_SERVERS = [{% for instance in graphite.cluster_servers %}"{{instance.server}}:{{instance.port}}"{% if not loop.last %}, {% endif %}{% endfor %}]
  150. ## These are timeout values (in seconds) for requests to remote webapps
  151. #REMOTE_STORE_FETCH_TIMEOUT = 6 # Timeout to fetch series data
  152. #REMOTE_STORE_FIND_TIMEOUT = 2.5 # Timeout for metric find requests
  153. #REMOTE_STORE_RETRY_DELAY = 60 # Time before retrying a failed remote webapp
  154. #REMOTE_STORE_USE_POST = False # Use POST instead of GET for remote requests
  155. #REMOTE_FIND_CACHE_DURATION = 300 # Time to cache remote metric find results
  156. ## Prefetch cache
  157. # set to True to fetch all metrics using a single http request per remote server
  158. # instead of one http request per target, per remote server.
  159. # Especially useful when generating graphs with more than 4-5 targets or if
  160. # there's significant latency between this server and the backends. (>20ms)
  161. #REMOTE_PREFETCH_DATA = False
  162. # During a rebalance of a consistent hash cluster, after a partition event on a replication > 1 cluster,
  163. # or in other cases we might receive multiple TimeSeries data for a metric key. Merge them together rather
  164. # that choosing the "most complete" one (pre-0.9.14 behaviour).
  165. #REMOTE_STORE_MERGE_RESULTS = True
  166. ## Remote rendering settings
  167. # Set to True to enable rendering of Graphs on a remote webapp
  168. #REMOTE_RENDERING = True
  169. # List of IP (and optionally port) of the webapp on each remote server that
  170. # will be used for rendering. Note that each rendering host should have local
  171. # access to metric data or should have CLUSTER_SERVERS configured
  172. #RENDERING_HOSTS = []
  173. #REMOTE_RENDER_CONNECT_TIMEOUT = 1.0
  174. # If you are running multiple carbon-caches on this machine (typically behind a relay using
  175. # consistent hashing), you'll need to list the ip address, cache query port, and instance name of each carbon-cache
  176. # instance on the local machine (NOT every carbon-cache in the entire cluster). The default cache query port is 7002
  177. # and a common scheme is to use 7102 for instance b, 7202 for instance c, etc.
  178. #
  179. # You *should* use 127.0.0.1 here in most cases
  180. #CARBONLINK_HOSTS = ["127.0.0.1:7002:a", "127.0.0.1:7102:b", "127.0.0.1:7202:c"]
  181. CARBONLINK_HOSTS = [{% for instance in graphite.cache_instances %}"127.0.0.1:{{7002 + loop.index * 100}}:{{instance.name}}"{% if not loop.last %}, {% endif %}{% endfor %}]
  182. #CARBONLINK_TIMEOUT = 1.0
  183. # Using 'query-bulk' queries for carbon
  184. # It's more effective, but python-carbon 0.9.13 (or latest from 0.9.x branch) is required
  185. # See https://github.com/graphite-project/carbon/pull/132 for details
  186. #CARBONLINK_QUERY_BULK = False
  187. #####################################
  188. # Additional Django Settings #
  189. #####################################
  190. # Uncomment the following line for direct access to Django settings such as
  191. # MIDDLEWARE_CLASSES or APPS
  192. #from graphite.app_settings import *