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. 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 = True 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 aggregration 82DEFAULT_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##################################### 102# Filesystem Paths # 103##################################### 104# 105# Change only GRAPHITE_ROOT if your install is merely shifted from /opt/graphite 106# to somewhere else 107#GRAPHITE_ROOT = '/opt/graphite' 108 109# Most installs done outside of a separate tree such as /opt/graphite will 110# need to change these settings. Note that the default settings for each 111# of these is relative to GRAPHITE_ROOT. 112#CONF_DIR = '/opt/graphite/conf' 113#STORAGE_DIR = '/opt/graphite/storage' 114#STATIC_ROOT = '/opt/graphite/static' 115CONF_DIR = '/usr/local/etc/graphite' 116STORAGE_DIR = '/var/db/carbon' 117STATIC_ROOT = '/usr/local/share/graphite-web/content' 118 119#LOG_DIR = '/opt/graphite/storage/log/webapp' 120#INDEX_FILE = '/opt/graphite/storage/index' # Search index file 121 122WHISPER_DIR = '/var/db/carbon/whisper' 123RRD_DIR = '/var/db/carbon/rrd' 124DATA_DIRS = [WHISPER_DIR, RRD_DIR] # Default: set from the above variables 125LOG_DIR = '/var/log/graphite' 126INDEX_FILE = '/var/db/graphite/index' # Search index file 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' 134DASHBOARD_CONF = '/usr/local/etc/graphite/dashboard.conf' 135GRAPHTEMPLATES_CONF = '/usr/local/etc/graphite/graphTemplates.conf' 136 137## Data directories 138# 139# NOTE: If any directory is unreadable in STANDARD_DIRS it will break metric browsing 140# 141#CERES_DIR = '/opt/graphite/storage/ceres' 142#WHISPER_DIR = '/opt/graphite/storage/whisper' 143#RRD_DIR = '/opt/graphite/storage/rrd' 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# 272DATABASES = { 273 'default': { 274 'NAME': '/var/db/graphite/graphite.db', 275 'ENGINE': 'django.db.backends.sqlite3', 276 } 277} 278 279######################### 280# Cluster Configuration # 281######################### 282# 283# To avoid excessive DNS lookups you want to stick to using IP addresses only 284# in this entire section. 285# 286 287# This should list the IP address (and optionally port) of the webapp on each 288# remote server in the cluster. These servers must each have local access to 289# metric data. Note that the first server to return a match for a query will be 290# used. 291#CLUSTER_SERVERS = ["10.0.2.2:80", "10.0.2.3:80"] 292 293# Use a pool of worker threads to dispatch finder requests in parallel 294#USE_WORKER_POOL = True 295 296# Maximum number of worker threads for concurrent storage operations 297#POOL_MAX_WORKERS = 10 298 299# This setting controls whether https is used to communicate between cluster members 300#INTRACLUSTER_HTTPS = False 301 302# Time before retrying a failed remote webapp 303#REMOTE_RETRY_DELAY = 60.0 304 305# Fail all requests if any remote webapp call fails 306#STORE_FAIL_ON_ERROR = False 307 308# Try to detect when a cluster server is localhost and don't forward queries 309#REMOTE_EXCLUDE_LOCAL = False 310 311# Number of retries for a specific remote data fetch. 312#MAX_FETCH_RETRIES = 2 313 314#FIND_CACHE_DURATION = 300 # Time to cache remote metric find results 315# If the query doesn't fall entirely within the FIND_TOLERANCE window 316# we disregard the window. This prevents unnecessary remote fetches 317# caused when carbon's cache skews node.intervals, giving the appearance 318# remote systems have data we don't have locally, which we probably do. 319#FIND_TOLERANCE = 2 * FIND_CACHE_DURATION 320 321#REMOTE_STORE_USE_POST = False # Use POST instead of GET for remote requests 322 323# Size of the buffer used for streaming remote cluster responses. Set to 0 to avoid streaming deserialization. 324#REMOTE_BUFFER_SIZE = 1024 * 1024 325 326# During a rebalance of a consistent hash cluster, after a partition event on a replication > 1 cluster, 327# or in other cases we might receive multiple TimeSeries data for a metric key. Merge them together rather 328# that choosing the "most complete" one (pre-0.9.14 behaviour). 329#REMOTE_STORE_MERGE_RESULTS = True 330 331# Provide a list of HTTP headers that you want forwarded on from this host 332# when making a request to a remote webapp server in CLUSTER_SERVERS 333#REMOTE_STORE_FORWARD_HEADERS = [] # An iterable of HTTP header names 334 335## Remote rendering settings 336# Set to True to enable rendering of Graphs on a remote webapp 337#REMOTE_RENDERING = True 338# List of IP (and optionally port) of the webapp on each remote server that 339# will be used for rendering. Note that each rendering host should have local 340# access to metric data or should have CLUSTER_SERVERS configured 341#RENDERING_HOSTS = [] 342#REMOTE_RENDER_CONNECT_TIMEOUT = 1.0 343 344# If you are running multiple carbon-caches on this machine (typically behind 345# a relay using consistent hashing), you'll need to list the ip address, cache 346# query port, and instance name of each carbon-cache instance on the local 347# machine (NOT every carbon-cache in the entire cluster). The default cache 348# query port is 7002 and a common scheme is to use 7102 for instance b, 7202 349# for instance c, etc. 350# If you're using consistent hashing, please keep an order of hosts the same as 351# order of DESTINATIONS in your relay - otherways you'll get cache misses. 352# 353# You *should* use 127.0.0.1 here in most cases. 354# 355#CARBONLINK_HOSTS = ["127.0.0.1:7002:a", "127.0.0.1:7102:b", "127.0.0.1:7202:c"] 356#CARBONLINK_TIMEOUT = 1.0 357#CARBONLINK_RETRY_DELAY = 15 # Seconds to blacklist a failed remote server 358# Set pickle protocol to use for Carbonlink requests, 359# (default of -1 is HIGHEST_AVAILABLE for your Python version) 360# see more: https://docs.python.org/3/library/pickle.html#data-stream-format 361#CARBONLINK_PICKLE_PROTOCOL = -1 362 363# Type of metric hashing function. 364# The default `carbon_ch` is Graphite's traditional consistent-hashing implementation. 365# Alternatively, you can use `fnv1a_ch`, which supports the Fowler-Noll-Vo hash 366# function (FNV-1a) hash implementation offered by the carbon-c-relay project 367# https://github.com/grobian/carbon-c-relay 368# 369# Supported values: carbon_ch, fnv1a_ch 370# 371#CARBONLINK_HASHING_TYPE = 'carbon_ch' 372 373# A "keyfunc" is a user-defined python function that is given a metric name 374# and returns a string that should be used when hashing the metric name. 375# This is important when your hashing has to respect certain metric groupings. 376#CARBONLINK_HASHING_KEYFUNC = "/opt/graphite/bin/keyfuncs.py:my_keyfunc" 377 378# Prefix for internal carbon statistics. 379#CARBON_METRIC_PREFIX='carbon' 380 381# The replication factor to use with consistent hashing. 382# This should usually match the value configured in Carbon. 383#REPLICATION_FACTOR = 1 384 385##################################### 386# TagDB Settings # 387##################################### 388# Tag Database 389#TAGDB = 'graphite.tags.localdatabase.LocalDatabaseTagDB' 390 391# Time to cache seriesByTag results 392#TAGDB_CACHE_DURATION = 60 393 394# Autocomplete default result limit 395#TAGDB_AUTOCOMPLETE_LIMIT = 100 396 397# Settings for Redis TagDB 398#TAGDB_REDIS_HOST = 'localhost' 399#TAGDB_REDIS_PORT = 6379 400#TAGDB_REDIS_DB = 0 401#TAGDB_REDIS_PASSWORD = '' 402 403# Settings for HTTP TagDB 404#TAGDB_HTTP_URL = '' 405#TAGDB_HTTP_USER = '' 406#TAGDB_HTTP_PASSWORD = '' 407# Does the remote TagDB support autocomplete? 408#TAGDB_HTTP_AUTOCOMPLETE = False 409 410##################################### 411# Function plugins # 412##################################### 413# List of custom function plugin modules 414# See: http://graphite.readthedocs.io/en/latest/functions.html#function-plugins 415FUNCTION_PLUGINS = [] 416 417##################################### 418# Additional Django Settings # 419##################################### 420# Uncomment the following line for direct access to Django settings such as 421# MIDDLEWARE or APPS 422#from graphite.app_settings import * 423