· 9 years ago · Mar 15, 2017, 01:28 PM
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# CRSF middleware, cookie storage, etc. This should be set identically among
13# instances if used behind a load balancer.
14SECRET_KEY = 'Innagoddadavida!01'
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#LOG_ROTATION = True
34#LOG_ROTATION_COUNT = 1
35#LOG_RENDERING_PERFORMANCE = True
36#LOG_CACHE_PERFORMANCE = True
37
38# Enable full debug page display on exceptions (Internal Server Error pages)
39DEBUG = True
40
41# If using RRD files and rrdcached, set to the address or socket of the daemon
42#FLUSHRRDCACHED = 'unix:/var/run/rrdcached.sock'
43
44# This lists the memcached servers that will be used by this webapp.
45# If you have a cluster of webapps you should ensure all of them
46# have the *exact* same value for this setting. That will maximize cache
47# efficiency. Setting MEMCACHE_HOSTS to be empty will turn off use of
48# memcached entirely.
49#
50# You should not use the loopback address (127.0.0.1) here if using clustering
51# as every webapp in the cluster should use the exact same values to prevent
52# unneeded cache misses. Set to [] to disable caching of images and fetched data
53#MEMCACHE_HOSTS = ['10.10.10.10:11211', '10.10.10.11:11211', '10.10.10.12:11211']
54
55# Metric data and graphs are cached for one minute by default. If defined,
56# DEFAULT_CACHE_POLICY is a list of tuples of minimum query time ranges mapped
57# to the cache duration for the results. This allows for larger queries to be
58# cached for longer periods of times. All times are in seconds. If the policy is
59# empty or undefined, all results will be cached for DEFAULT_CACHE_DURATION.
60#DEFAULT_CACHE_DURATION = 60 # Cache images and data for 1 minute
61#DEFAULT_CACHE_POLICY = [(0, 60), # default is 60 seconds
62# (7200, 120), # >= 2 hour queries are cached 2 minutes
63# (21600, 180)] # >= 6 hour queries are cached 3 minutes
64#MEMCACHE_KEY_PREFIX = 'graphite'
65
66
67# This lists the memcached options. Default is an empty dict.
68# Accepted options depend on the Memcached implementation and the Django version.
69# Until Django 1.10, options are used only for pylibmc.
70# Starting from 1.11, options are used for both python-memcached and pylibmc.
71#MEMCACHE_OPTIONS = { 'socket_timeout': 0.5 }
72
73# Set URL_PREFIX when deploying graphite-web to a non-root location
74#URL_PREFIX = '/graphite'
75
76# Graphite uses Django Tagging to support tags in Events. By default each
77# tag is limited to 50 characters in length.
78#MAX_TAG_LENGTH = 50
79
80# Interval for the Auto-Refresh feature in the Composer, measured in seconds.
81#AUTO_REFRESH_INTERVAL = 60
82
83#####################################
84# Filesystem Paths #
85#####################################
86#
87# Change only GRAPHITE_ROOT if your install is merely shifted from /opt/graphite
88# to somewhere else
89#GRAPHITE_ROOT = '/opt/graphite'
90
91# Most installs done outside of a separate tree such as /opt/graphite will
92# need to change these settings. Note that the default settings for each
93# of these is relative to GRAPHITE_ROOT.
94#CONF_DIR = '/opt/graphite/conf'
95#STORAGE_DIR = '/opt/graphite/storage'
96#STATIC_ROOT = '/opt/graphite/static'
97#LOG_DIR = '/opt/graphite/storage/log/webapp'
98#INDEX_FILE = '/opt/graphite/storage/index' # Search index file
99
100# To further or fully customize the paths, modify the following. Note that the
101# default settings for each of these are relative to CONF_DIR and STORAGE_DIR
102#
103## Webapp config files
104#DASHBOARD_CONF = '/opt/graphite/conf/dashboard.conf'
105#GRAPHTEMPLATES_CONF = '/opt/graphite/conf/graphTemplates.conf'
106
107## Data directories
108#
109# NOTE: If any directory is unreadable in STANDARD_DIRS it will break metric browsing
110#
111#CERES_DIR = '/opt/graphite/storage/ceres'
112#WHISPER_DIR = '/opt/graphite/storage/whisper'
113#RRD_DIR = '/opt/graphite/storage/rrd'
114#
115# Data directories using the "Standard" metrics finder (i.e. not Ceres)
116#STANDARD_DIRS = [WHISPER_DIR, RRD_DIR] # Default: set from the above variables
117
118
119#####################################
120# Email Configuration #
121#####################################
122#
123# This is used for emailing rendered graphs. The default backend is SMTP.
124#EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
125#
126# To drop emails on the floor, enable the Dummy backend instead.
127#EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend'
128
129#EMAIL_HOST = 'localhost'
130#EMAIL_PORT = 25
131#EMAIL_HOST_USER = ''
132#EMAIL_HOST_PASSWORD = ''
133#EMAIL_USE_TLS = False
134
135
136#####################################
137# Authentication Configuration #
138#####################################
139#
140## LDAP / ActiveDirectory authentication setup
141#USE_LDAP_AUTH = True
142#LDAP_SERVER = "ldap.mycompany.com"
143#LDAP_PORT = 389
144#LDAP_USE_TLS = False
145
146## Manual URI / query setup
147#LDAP_URI = "ldaps://ldap.mycompany.com:636"
148#LDAP_SEARCH_BASE = "OU=users,DC=mycompany,DC=com"
149#LDAP_BASE_USER = "CN=some_readonly_account,DC=mycompany,DC=com"
150#LDAP_BASE_PASS = "readonly_account_password"
151#LDAP_USER_QUERY = "(username=%s)" #For Active Directory use "(sAMAccountName=%s)"
152
153# User DN template to use for binding (and authentication) against the
154# LDAP server. %(username) is replaced with the username supplied at
155# graphite login.
156#LDAP_USER_DN_TEMPLATE = "CN=%(username)s,OU=users,DC=mycompany,DC=com"
157
158# If you want to further customize the ldap connection options you should
159# directly use ldap.set_option to set the ldap module's global options.
160# For example:
161#
162#import ldap
163#ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_ALLOW) # Use ldap.OPT_X_TLS_DEMAND to force TLS
164#ldap.set_option(ldap.OPT_REFERRALS, 0) # Enable for Active Directory
165#ldap.set_option(ldap.OPT_X_TLS_CACERTDIR, "/etc/ssl/ca")
166#ldap.set_option(ldap.OPT_X_TLS_CERTFILE, "/etc/ssl/mycert.pem")
167#ldap.set_option(ldap.OPT_X_TLS_KEYFILE, "/etc/ssl/mykey.pem")
168#ldap.set_option(ldap.OPT_DEBUG_LEVEL, 65535) # To enable verbose debugging
169# See http://www.python-ldap.org/ for further details on these options.
170
171## REMOTE_USER authentication. See: https://docs.djangoproject.com/en/dev/howto/auth-remote-user/
172#USE_REMOTE_USER_AUTHENTICATION = True
173
174# Override the URL for the login link (e.g. for django_openid_auth)
175#LOGIN_URL = '/account/login'
176
177
178###############################
179# Authorization for Dashboard #
180###############################
181# By default, there is no security on dashboards - any user can add, change or delete them.
182# This section provides 3 different authorization models, of varying strictness.
183
184# If set to True, users must be logged in to save or delete dashboards. Defaults to False
185#DASHBOARD_REQUIRE_AUTHENTICATION = True
186
187# If set to the name of a user group, dashboards can be saved and deleted by any user in this
188# group. Groups can be set in the Django Admin app, or in LDAP. Defaults to None.
189# NOTE: Ignored if DASHBOARD_REQUIRE_AUTHENTICATION is not set
190#DASHBOARD_REQUIRE_EDIT_GROUP = 'dashboard-editors-group'
191
192# If set to True, dashboards can be saved or deleted by any user having the appropriate
193# (change or delete) permission (as set in the Django Admin app). Defaults to False
194# NOTE: Ignored if DASHBOARD_REQUIRE_AUTHENTICATION is not set
195#DASHBOARD_REQUIRE_PERMISSIONS = True
196
197
198##########################
199# Database Configuration #
200##########################
201#
202# By default sqlite is used. If you cluster multiple webapps you will need
203# to setup an external database (such as MySQL) and configure all of the webapp
204# instances to use the same database. Note that this database is only used to store
205# Django models such as saved graphs, dashboards, user preferences, etc.
206# Metric data is not stored here.
207#
208# DO NOT FORGET TO RUN MIGRATIONS AFTER SETTING UP A NEW DATABASE
209# http://graphite.readthedocs.io/en/latest/config-database-setup.html
210#
211#
212# The following built-in database engines are available:
213# django.db.backends.postgresql_psycopg2
214# django.db.backends.mysql
215# django.db.backends.sqlite3
216# django.db.backends.oracle
217#
218# The default is 'django.db.backends.sqlite3' with file 'graphite.db'
219# located in STORAGE_DIR
220#
221DATABASES = {
222 'default': {
223 'NAME': '/opt/graphite/storage/graphite.db',
224 'ENGINE': 'django.db.backends.postgresql',
225 'USER': 'graphite',
226 'PASSWORD': 'XXXXXXXXXXX',
227 'HOST': 'localhost',
228 'PORT': '5432'
229 }
230}
231#
232
233
234#########################
235# Cluster Configuration #
236#########################
237#
238# To avoid excessive DNS lookups you want to stick to using IP addresses only
239# in this entire section.
240#
241
242# This should list the IP address (and optionally port) of the webapp on each
243# remote server in the cluster. These servers must each have local access to
244# metric data. Note that the first server to return a match for a query will be
245# used.
246#CLUSTER_SERVERS = ["10.0.2.2:80", "10.0.2.3:80"]
247
248# This setting controls whether https is used to communicate between cluster members
249#INTRACLUSTER_HTTPS = False
250
251# These are timeout values (in seconds) for requests to remote webapps
252#REMOTE_FIND_TIMEOUT = 3.0 # Timeout for metric find requests
253#REMOTE_FETCH_TIMEOUT = 3.0 # Timeout to fetch series data
254#REMOTE_RETRY_DELAY = 60.0 # Time before retrying a failed remote webapp
255
256# Try to detect when a cluster server is localhost and don't forward queries
257#REMOTE_EXCLUDE_LOCAL = False
258
259# Number of retries for a specific remote data fetch.
260#MAX_FETCH_RETRIES = 2
261
262#FIND_CACHE_DURATION = 300 # Time to cache remote metric find results
263# If the query doesn't fall entirely within the FIND_TOLERANCE window
264# we disregard the window. This prevents unnecessary remote fetches
265# caused when carbon's cache skews node.intervals, giving the appearance
266# remote systems have data we don't have locally, which we probably do.
267#FIND_TOLERANCE = 2 * FIND_CACHE_DURATION
268
269# During a rebalance of a consistent hash cluster, after a partition event on a replication > 1 cluster,
270# or in other cases we might receive multiple TimeSeries data for a metric key. Merge them together rather
271# that choosing the "most complete" one (pre-0.9.14 behaviour).
272#REMOTE_STORE_MERGE_RESULTS = True
273
274# Provide a list of HTTP headers that you want forwarded on from this host
275# when making a request to a remote webapp server in CLUSTER_SERVERS
276#REMOTE_STORE_FORWARD_HEADERS = [] # An iterable of HTTP header names
277
278## Remote rendering settings
279# Set to True to enable rendering of Graphs on a remote webapp
280#REMOTE_RENDERING = True
281# List of IP (and optionally port) of the webapp on each remote server that
282# will be used for rendering. Note that each rendering host should have local
283# access to metric data or should have CLUSTER_SERVERS configured
284#RENDERING_HOSTS = []
285#REMOTE_RENDER_CONNECT_TIMEOUT = 1.0
286
287# If you are running multiple carbon-caches on this machine (typically behind
288# a relay using consistent hashing), you'll need to list the ip address, cache
289# query port, and instance name of each carbon-cache instance on the local
290# machine (NOT every carbon-cache in the entire cluster). The default cache
291# query port is 7002 and a common scheme is to use 7102 for instance b, 7202
292# for instance c, etc.
293# If you're using consistent hashing, please keep an order of hosts the same as
294# order of DESTINATIONS in your relay - otherways you'll get cache misses.
295#
296# You *should* use 127.0.0.1 here in most cases.
297#
298#CARBONLINK_HOSTS = ["127.0.0.1:7002:a", "127.0.0.1:7102:b", "127.0.0.1:7202:c"]
299#CARBONLINK_TIMEOUT = 1.0
300#CARBONLINK_RETRY_DELAY = 15 # Seconds to blacklist a failed remote server
301#
302
303# Type of metric hashing function.
304# The default `carbon_ch` is Graphite's traditional consistent-hashing implementation.
305# Alternatively, you can use `fnv1a_ch`, which supports the Fowler-Noll-Vo hash
306# function (FNV-1a) hash implementation offered by the carbon-c-relay project
307# https://github.com/grobian/carbon-c-relay
308#
309# Supported values: carbon_ch, fnv1a_ch
310#
311#CARBONLINK_HASHING_TYPE = 'carbon_ch'
312
313# A "keyfunc" is a user-defined python function that is given a metric name
314# and returns a string that should be used when hashing the metric name.
315# This is important when your hashing has to respect certain metric groupings.
316#CARBONLINK_HASHING_KEYFUNC = "/opt/graphite/bin/keyfuncs.py:my_keyfunc"
317
318# Prefix for internal carbon statistics.
319#CARBON_METRIC_PREFIX='carbon'
320
321# The replication factor to use with consistent hashing.
322# This should usually match the value configured in Carbon.
323#REPLICATION_FACTOR = 1
324
325
326#####################################
327# Additional Django Settings #
328#####################################
329# Uncomment the following line for direct access to Django settings such as
330# MIDDLEWARE_CLASSES or APPS
331#from graphite.app_settings import *