Debian Codegraph @

webapp/graphite/local_settings.py.example

raw ◀ ▶
1 Debian patch touch this file
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 #####################################
7 # General Configuration #
8 #####################################
9 #
10 # Set this to a long, random unique string to use as a secret key for this
11 # install. This key is used for salting of hashes used in auth tokens,
12 # CSRF middleware, cookie storage, etc. This should be set identically among
13 # instances if used behind a load balancer.
14 #SECRET_KEY = 'UNSAFE_DEFAULT'
15
16 # In Django 1.5+ set this to the list of hosts your graphite instances is
17 # accessible as. See:
18 # https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-ALLOWED_HOSTS
19 #ALLOWED_HOSTS = [ '*' ]
20
21 # Set your local timezone (Django's default is America/Chicago)
22 # If your graphs appear to be offset by a couple hours then this probably
23 # needs to be explicitly set to your local timezone.
24 #TIME_ZONE = 'America/Los_Angeles'
25
26 # Set the default short date format. See strftime(3) for supported sequences.
27 #DATE_FORMAT = '%m/%d'
28
29 # Override this to provide documentation specific to your Graphite deployment
30 #DOCUMENTATION_URL = "http://graphite.readthedocs.io/"
31
32 # Logging
33 # These can also be configured using Django's LOGGING:
34 # https://docs.djangoproject.com/en/1.11/topics/logging/
•35 LOG_ROTATION = False
36 #LOG_ROTATION_COUNT = 1
37 #LOG_RENDERING_PERFORMANCE = True
38 #LOG_CACHE_PERFORMANCE = True
39 #LOG_INFO_PERFORMANCE = False
40
41 # Filenames for log output, set to '-' to log to stderr
42 #LOG_FILE_INFO = 'info.log'
43 #LOG_FILE_EXCEPTION = 'exception.log'
44 #LOG_FILE_CACHE = 'cache.log'
45 #LOG_FILE_RENDERING = 'rendering.log'
46
47 # Enable full debug page display on exceptions (Internal Server Error pages)
48 #DEBUG = True
49
50 # If using RRD files and rrdcached, set to the address or socket of the daemon
51 #FLUSHRRDCACHED = 'unix:/var/run/rrdcached.sock'
52
53 # This lists the memcached servers that will be used by this webapp.
54 # If you have a cluster of webapps you should ensure all of them
55 # have the *exact* same value for this setting. That will maximize cache
56 # efficiency. Setting MEMCACHE_HOSTS to be empty will turn off use of
57 # memcached entirely.
58 #
59 # You should not use the loopback address (127.0.0.1) here if using clustering
60 # as every webapp in the cluster should use the exact same values to prevent
61 # unneeded cache misses. Set to [] to disable caching of images and fetched data
62 #MEMCACHE_HOSTS = ['10.10.10.10:11211', '10.10.10.11:11211', '10.10.10.12:11211']
63
64 # Metric data and graphs are cached for one minute by default. If defined,
65 # DEFAULT_CACHE_POLICY is a list of tuples of minimum query time ranges mapped
66 # to the cache duration for the results. This allows for larger queries to be
67 # cached for longer periods of times. All times are in seconds. If the policy is
68 # empty or undefined, all results will be cached for DEFAULT_CACHE_DURATION.
69 #DEFAULT_CACHE_DURATION = 60 # Cache images and data for 1 minute
70 #DEFAULT_CACHE_POLICY = [(0, 60), # default is 60 seconds
71 # (7200, 120), # >= 2 hour queries are cached 2 minutes
72 # (21600, 180)] # >= 6 hour queries are cached 3 minutes
73 #MEMCACHE_KEY_PREFIX = 'graphite'
74
75 # This lists the memcached options. Default is an empty dict.
76 # Accepted options depend on the Memcached implementation and the Django version.
77 # Until Django 1.10, options are used only for pylibmc.
78 # Starting from 1.11, options are used for both python-memcached and pylibmc.
79 #MEMCACHE_OPTIONS = { 'socket_timeout': 0.5 }
80
81 # this setting controls the default xFilesFactor used for query-time aggregation
82 DEFAULT_XFILES_FACTOR = 0
83
84 # Set URL_PREFIX when deploying graphite-web to a non-root location
85 #URL_PREFIX = '/graphite'
86
87 # Graphite uses Django Tagging to support tags in Events. By default each
88 # tag is limited to 50 characters in length.
89 #MAX_TAG_LENGTH = 50
90
91 # Interval for the Auto-Refresh feature in the Composer, measured in seconds.
92 #AUTO_REFRESH_INTERVAL = 60
93
94 # Timeouts for find and render requests
95 #FIND_TIMEOUT = 3.0 # Timeout for metric find requests
96 #FETCH_TIMEOUT = 3.0 # Timeout to fetch series data
97
98 # Allow UTF-8 metrics' names (can cause performance issues)
99 #UTF8_METRICS = False
100
101 # Default consolidation function ('sum', 'average', 'avg_zero', 'max', 'min', 'first', 'last')
102 # If not set average is used
103 #DEFAULT_CONSOLIDATION = 'sum'
104
105 #####################################
106 # Filesystem Paths #
•107 #####################################
108 #
109 # Change only GRAPHITE_ROOT if your install is merely shifted from /opt/graphite
110 # to somewhere else
111 GRAPHITE_ROOT = '/usr/share/graphite-web'
112
113 # Most installs done outside of a separate tree such as /opt/graphite will
114 # need to change these settings. Note that the default settings for each
115 # of these is relative to GRAPHITE_ROOT.
116 #CONF_DIR = '/opt/graphite/conf'
117 #STORAGE_DIR = '/opt/graphite/storage'
•118 #STATIC_ROOT = '/opt/graphite/static'
119 #LOG_DIR = '/opt/graphite/storage/log/webapp'
120 #INDEX_FILE = '/opt/graphite/storage/index' # Search index file
121
122 CONF_DIR = '/etc/graphite'
123 STORAGE_DIR = '/var/lib/graphite/whisper'
124 STATIC_ROOT = '/usr/share/graphite-web/static'
125 LOG_DIR = '/var/log/graphite'
126 INDEX_FILE = '/var/lib/graphite/search_index'
127
128 # To further or fully customize the paths, modify the following. Note that the
129 # default settings for each of these are relative to CONF_DIR and STORAGE_DIR
130 #
131 ## Webapp config files
132 #DASHBOARD_CONF = '/opt/graphite/conf/dashboard.conf'
133 #GRAPHTEMPLATES_CONF = '/opt/graphite/conf/graphTemplates.conf'
134
135 ## Data directories
136 #
137 # NOTE: If any directory is unreadable in STANDARD_DIRS it will break metric browsing
•138 #
139 #CERES_DIR = '/opt/graphite/storage/ceres'
140 #WHISPER_DIR = '/opt/graphite/storage/whisper'
141 #RRD_DIR = '/opt/graphite/storage/rrd'
142
143 WHISPER_DIR = '/var/lib/graphite/whisper'
144 #
145 # Data directories using the "Standard" metrics finder (i.e. not Ceres)
146 #STANDARD_DIRS = [WHISPER_DIR, RRD_DIR] # Default: set from the above variables
147
148 ## Data finders
149 # It is possible to use an alternate storage layer than the default, Whisper,
150 # in order to accommodate specific needs.
151 # See: http://graphite.readthedocs.io/en/latest/storage-backends.html
152 #
153 # STORAGE_FINDERS = (
154 # 'graphite.finders.remote.RemoteFinder',
155 # 'graphite.finders.standard.StandardFinder',
156 # 'graphite.finders.ceres.CeresFinder',
157 # )
158
159 #####################################
160 # Email Configuration #
161 #####################################
162 #
163 # This is used for emailing rendered graphs. The default backend is SMTP.
164 #EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
165 #
166 # To drop emails on the floor, enable the Dummy backend instead.
167 #EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend'
168
169 #EMAIL_HOST = 'localhost'
170 #EMAIL_PORT = 25
171 #EMAIL_HOST_USER = ''
172 #EMAIL_HOST_PASSWORD = ''
173 #EMAIL_USE_TLS = False
174
175
176 #####################################
177 # Authentication Configuration #
178 #####################################
179 #
180 ## LDAP / ActiveDirectory authentication setup
181 #USE_LDAP_AUTH = True
182 #LDAP_SERVER = "ldap.mycompany.com"
183 #LDAP_PORT = 389
184 #LDAP_USE_TLS = False
185
186 ## Manual URI / query setup
187 #LDAP_URI = "ldaps://ldap.mycompany.com:636"
188 #LDAP_SEARCH_BASE = "OU=users,DC=mycompany,DC=com"
189 #LDAP_BASE_USER = "CN=some_readonly_account,DC=mycompany,DC=com"
190 #LDAP_BASE_PASS = "readonly_account_password"
191 #LDAP_USER_QUERY = "(username=%s)" #For Active Directory use "(sAMAccountName=%s)"
192
193 # User DN template to use for binding (and authentication) against the
194 # LDAP server. %(username) is replaced with the username supplied at
195 # graphite login.
196 #LDAP_USER_DN_TEMPLATE = "CN=%(username)s,OU=users,DC=mycompany,DC=com"
197
198 # If you want to further customize the ldap connection options you should
199 # directly use ldap.set_option to set the ldap module's global options.
200 # For example:
201 #
202 #import ldap
203 #ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_ALLOW) # Use ldap.OPT_X_TLS_DEMAND to force TLS
204 #ldap.set_option(ldap.OPT_REFERRALS, 0) # Enable for Active Directory
205 #ldap.set_option(ldap.OPT_X_TLS_CACERTDIR, "/etc/ssl/ca")
206 #ldap.set_option(ldap.OPT_X_TLS_CERTFILE, "/etc/ssl/mycert.pem")
207 #ldap.set_option(ldap.OPT_X_TLS_KEYFILE, "/etc/ssl/mykey.pem")
208 #ldap.set_option(ldap.OPT_DEBUG_LEVEL, 65535) # To enable verbose debugging
209 # See http://www.python-ldap.org/ for further details on these options.
210
211 ## REMOTE_USER authentication. See: https://docs.djangoproject.com/en/dev/howto/auth-remote-user/
212 #USE_REMOTE_USER_AUTHENTICATION = True
213
214 # Override the URL for the login link (e.g. for django_openid_auth)
215 #LOGIN_URL = '/account/login'
216
217
218 ###############################
219 # Authorization for Dashboard #
220 ###############################
221 # By default, there is no security on dashboards - any user can add, change or delete them.
222 # This section provides 3 different authorization models, of varying strictness.
223
224 # If set to True, users must be logged in to save or delete dashboards. Defaults to False
225 #DASHBOARD_REQUIRE_AUTHENTICATION = True
226
227 # If set to the name of a user group, dashboards can be saved and deleted by any user in this
228 # group. Groups can be set in the Django Admin app, or in LDAP. Defaults to None.
229 # NOTE: Ignored if DASHBOARD_REQUIRE_AUTHENTICATION is not set
230 #DASHBOARD_REQUIRE_EDIT_GROUP = 'dashboard-editors-group'
231
232 # If set to True, dashboards can be saved or deleted by any user having the appropriate
233 # (change or delete) permission (as set in the Django Admin app). Defaults to False
234 # NOTE: Ignored if DASHBOARD_REQUIRE_AUTHENTICATION is not set
235 #DASHBOARD_REQUIRE_PERMISSIONS = True
236
237
238 ##########################
239 # Database Configuration #
240 ##########################
241 #
242 # By default sqlite is used. If you cluster multiple webapps you will need
243 # to setup an external database (such as MySQL) and configure all of the webapp
244 # instances to use the same database. Note that this database is only used to store
245 # Django models such as saved graphs, dashboards, user preferences, etc.
246 # Metric data is not stored here.
247 #
248 # DO NOT FORGET TO RUN MIGRATIONS AFTER SETTING UP A NEW DATABASE
249 # http://graphite.readthedocs.io/en/latest/config-database-setup.html
250 #
251 #
252 # The following built-in database engines are available:
253 # django.db.backends.postgresql_psycopg2
254 # django.db.backends.mysql
255 # django.db.backends.sqlite3
256 # django.db.backends.oracle
257 #
258 # The default is 'django.db.backends.sqlite3' with file 'graphite.db'
259 # located in STORAGE_DIR
260 #
261 #DATABASES = {
262 # 'default': {
263 # 'NAME': '/opt/graphite/storage/graphite.db',
264 # 'ENGINE': 'django.db.backends.sqlite3',
265 # 'USER': '',
266 # 'PASSWORD': '',
267 # 'HOST': '',
•268 # 'PORT': ''
269 # }
270 #}
271 #
272 DATABASES = {
273 'default': {
274 'NAME': '/var/lib/graphite/graphite.db',
275 'ENGINE': 'django.db.backends.sqlite3',
276 'USER': '',
277 'PASSWORD': '',
278 'HOST': '',
279 'PORT': ''
280 }
281 }
282
283
284 #########################
285 # Cluster Configuration #
286 #########################
287 #
288 # To avoid excessive DNS lookups you want to stick to using IP addresses only
289 # in this entire section.
290 #
291
292 # This should list the IP address (and optionally port) of the webapp on each
293 # remote server in the cluster. These servers must each have local access to
294 # metric data. Note that the first server to return a match for a query will be
295 # used.
296 #CLUSTER_SERVERS = ["10.0.2.2:80", "10.0.2.3:80"]
297
298 # Use a pool of worker threads to dispatch finder requests in parallel
299 #USE_WORKER_POOL = True
300
301 # Maximum number of worker threads for concurrent storage operations
302 #POOL_MAX_WORKERS = 10
303
304 # This setting controls whether https is used to communicate between cluster members
305 #INTRACLUSTER_HTTPS = False
306
307 # Time before retrying a failed remote webapp
308 #REMOTE_RETRY_DELAY = 60.0
309
310 # Fail all requests if any remote webapp call fails
311 #STORE_FAIL_ON_ERROR = False
312
313 # Try to detect when a cluster server is localhost and don't forward queries
314 #REMOTE_EXCLUDE_LOCAL = False
315
316 # Number of retries for a specific remote data fetch.
317 #MAX_FETCH_RETRIES = 2
318
319 #FIND_CACHE_DURATION = 300 # Time to cache remote metric find results
320 # If the query doesn't fall entirely within the FIND_TOLERANCE window
321 # we disregard the window. This prevents unnecessary remote fetches
322 # caused when carbon's cache skews node.intervals, giving the appearance
323 # remote systems have data we don't have locally, which we probably do.
324 #FIND_TOLERANCE = 2 * FIND_CACHE_DURATION
325
326 #REMOTE_STORE_USE_POST = False # Use POST instead of GET for remote requests
327
328 # Size of the buffer used for streaming remote cluster responses. Set to 0 to avoid streaming deserialization.
329 #REMOTE_BUFFER_SIZE = 1024 * 1024
330
331 # During a rebalance of a consistent hash cluster, after a partition event on a replication > 1 cluster,
332 # or in other cases we might receive multiple TimeSeries data for a metric key. Merge them together rather
333 # that choosing the "most complete" one (pre-0.9.14 behaviour).
334 #REMOTE_STORE_MERGE_RESULTS = True
335
336 # Provide a list of HTTP headers that you want forwarded on from this host
337 # when making a request to a remote webapp server in CLUSTER_SERVERS
338 #REMOTE_STORE_FORWARD_HEADERS = [] # An iterable of HTTP header names
339
340 ## Remote rendering settings
341 # Set to True to enable rendering of Graphs on a remote webapp
342 #REMOTE_RENDERING = True
343 # List of IP (and optionally port) of the webapp on each remote server that
344 # will be used for rendering. Note that each rendering host should have local
345 # access to metric data or should have CLUSTER_SERVERS configured
346 #RENDERING_HOSTS = []
347 #REMOTE_RENDER_CONNECT_TIMEOUT = 1.0
348
349 # If you are running multiple carbon-caches on this machine (typically behind
350 # a relay using consistent hashing), you'll need to list the ip address, cache
351 # query port, and instance name of each carbon-cache instance on the local
352 # machine (NOT every carbon-cache in the entire cluster). The default cache
353 # query port is 7002 and a common scheme is to use 7102 for instance b, 7202
354 # for instance c, etc.
355 # If you're using consistent hashing, please keep an order of hosts the same as
356 # order of DESTINATIONS in your relay - otherwise you'll get cache misses.
357 #
358 # You *should* use 127.0.0.1 here in most cases.
359 #
360 #CARBONLINK_HOSTS = ["127.0.0.1:7002:a", "127.0.0.1:7102:b", "127.0.0.1:7202:c"]
361 #CARBONLINK_TIMEOUT = 1.0
362 #CARBONLINK_RETRY_DELAY = 15 # Seconds to blacklist a failed remote server
363 # Set pickle protocol to use for Carbonlink requests,
364 # (default of -1 is HIGHEST_AVAILABLE for your Python version)
365 # see more: https://docs.python.org/3/library/pickle.html#data-stream-format
366 #CARBONLINK_PICKLE_PROTOCOL = -1
367
368 # Type of metric hashing function.
369 # The default `carbon_ch` is Graphite's traditional consistent-hashing implementation.
370 # Alternatively, you can use `fnv1a_ch`, which supports the Fowler-Noll-Vo hash
371 # function (FNV-1a) hash implementation offered by the carbon-c-relay project
372 # https://github.com/grobian/carbon-c-relay
373 #
374 # Supported values: carbon_ch, fnv1a_ch
375 #
376 #CARBONLINK_HASHING_TYPE = 'carbon_ch'
377
378 # A "keyfunc" is a user-defined python function that is given a metric name
379 # and returns a string that should be used when hashing the metric name.
380 # This is important when your hashing has to respect certain metric groupings.
381 #CARBONLINK_HASHING_KEYFUNC = "/opt/graphite/bin/keyfuncs.py:my_keyfunc"
382
383 # Prefix for internal carbon statistics.
384 #CARBON_METRIC_PREFIX='carbon'
385
386 # The replication factor to use with consistent hashing.
387 # This should usually match the value configured in Carbon.
388 #REPLICATION_FACTOR = 1
389
390 #####################################
391 # TagDB Settings #
392 #####################################
393 # Tag Database
394 #TAGDB = 'graphite.tags.localdatabase.LocalDatabaseTagDB'
395
396 # Time to cache seriesByTag results
397 #TAGDB_CACHE_DURATION = 60
398
399 # Autocomplete default result limit
400 #TAGDB_AUTOCOMPLETE_LIMIT = 100
401
402 # Settings for Redis TagDB
403 #TAGDB_REDIS_HOST = 'localhost'
404 #TAGDB_REDIS_PORT = 6379
405 #TAGDB_REDIS_DB = 0
406 #TAGDB_REDIS_PASSWORD = ''
407
408 # Settings for HTTP TagDB
409 #TAGDB_HTTP_URL = ''
410 #TAGDB_HTTP_USER = ''
411 #TAGDB_HTTP_PASSWORD = ''
412 # Does the remote TagDB support autocomplete?
413 #TAGDB_HTTP_AUTOCOMPLETE = False
414
415 #####################################
416 # Function plugins #
417 #####################################
418 # List of custom function plugin modules
419 # See: http://graphite.readthedocs.io/en/latest/functions.html#function-plugins
420 FUNCTION_PLUGINS = []
421
422 #####################################
423 # Additional Django Settings #
424 #####################################
425 # Uncomment the following line for direct access to Django settings such as
426 # MIDDLEWARE or APPS
427 #from graphite.app_settings import *