-
Notifications
You must be signed in to change notification settings - Fork 490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace "whitelist/blacklist" with "allowed/blocked" #568
Changes from all commits
0191348
a66dc20
044c359
ebcd06b
ffc5d25
b36ef29
f5d2b16
c982c58
43b5784
62265f6
09d3e73
8eed6e5
c1b57ae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,12 +14,12 @@ | |
# To change other directory paths, add settings to this file. The following | ||
# configuration variables are available with these default values: | ||
# | ||
# STORAGE_DIR = $GRAPHITE_STORAGE_DIR | ||
# LOCAL_DATA_DIR = %(STORAGE_DIR)s/whisper/ | ||
# WHITELISTS_DIR = %(STORAGE_DIR)s/lists/ | ||
# CONF_DIR = %(STORAGE_DIR)s/conf/ | ||
# LOG_DIR = %(STORAGE_DIR)s/log/ | ||
# PID_DIR = %(STORAGE_DIR)s/ | ||
# STORAGE_DIR = $GRAPHITE_STORAGE_DIR | ||
# LOCAL_DATA_DIR = %(STORAGE_DIR)s/whisper/ | ||
# USE_METRIC_FILTERS = %(STORAGE_DIR)s/lists/ | ||
# CONF_DIR = %(STORAGE_DIR)s/conf/ | ||
# LOG_DIR = %(STORAGE_DIR)s/log/ | ||
# PID_DIR = %(STORAGE_DIR)s/ | ||
# | ||
# For FHS style directory structures, use: | ||
# | ||
|
@@ -112,7 +112,7 @@ CACHE_QUERY_PORT = 7002 | |
USE_FLOW_CONTROL = True | ||
|
||
# If enabled this setting is used to timeout metric client connection if no | ||
# metrics have been sent in specified time in seconds | ||
# metrics have been sent in specified time in seconds | ||
#METRIC_CLIENT_IDLE_TIMEOUT = None | ||
|
||
# By default, carbon-cache will log every whisper update and cache hit. | ||
|
@@ -176,14 +176,14 @@ WHISPER_AUTOFLUSH = False | |
|
||
# On systems which has a large number of metrics, an amount of Whisper write(2)'s | ||
# pageback sometimes cause disk thrashing due to memory shortage, so that abnormal | ||
# disk reads occur. Enabling this option makes it possible to decrease useless | ||
# disk reads occur. Enabling this option makes it possible to decrease useless | ||
# page cache memory by posix_fadvise(2) with POSIX_FADVISE_RANDOM option. | ||
# WHISPER_FADVISE_RANDOM = False | ||
|
||
# Set this to True to enable whitelisting and blacklisting of metrics in | ||
# CONF_DIR/whitelist.conf and CONF_DIR/blacklist.conf. If the whitelist is | ||
# missing or empty, all metrics will pass through | ||
# USE_WHITELIST = False | ||
# Set this to True to enable control over what metrics are allowed to be handled | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we simplify this line to: |
||
# CONF_DIR/allowed_metrics.conf and CONF_DIR/blocked_metrics.conf. If the | ||
# allowed list is missing or empty, all metrics will pass through. | ||
# USE_METRIC_FILTERS = False | ||
|
||
# By default, carbon itself will log statistics (such as a count, | ||
# metricsReceived) with the top level prefix of 'carbon' at an interval of 60 | ||
|
@@ -269,7 +269,7 @@ REPLICATION_FACTOR = 1 | |
|
||
# For REPLICATION_FACTOR >=2, set DIVERSE_REPLICAS to True to guarantee replicas | ||
# across distributed hosts. With this setting disabled, it's possible that replicas | ||
# may be sent to different caches on the same host. This has been the default | ||
# may be sent to different caches on the same host. This has been the default | ||
# behavior since introduction of 'consistent-hashing' relay method. | ||
# Note that enabling this on an existing pre-0.9.14 cluster will require rebalancing | ||
# your metrics across the cluster nodes using a tool like Carbonate. | ||
|
@@ -336,13 +336,13 @@ TIME_TO_DEFER_SENDING = 0.0001 | |
USE_FLOW_CONTROL = True | ||
|
||
# If enabled this setting is used to timeout metric client connection if no | ||
# metrics have been sent in specified time in seconds | ||
# metrics have been sent in specified time in seconds | ||
#METRIC_CLIENT_IDLE_TIMEOUT = None | ||
|
||
# Set this to True to enable whitelisting and blacklisting of metrics in | ||
# CONF_DIR/whitelist.conf and CONF_DIR/blacklist.conf. If the whitelist is | ||
# missing or empty, all metrics will pass through | ||
# USE_WHITELIST = False | ||
# Set this to True to enable control over what metrics are allowed to be handled | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. |
||
# CONF_DIR/allowed_metrics.conf and CONF_DIR/blocked_metrics.conf. If the | ||
# allowed list is missing or empty, all metrics will pass through. | ||
# USE_METRIC_FILTERS = False | ||
|
||
# By default, carbon itself will log statistics (such as a count, | ||
# metricsReceived) with the top level prefix of 'carbon' at an interval of 60 | ||
|
@@ -434,7 +434,7 @@ MAX_QUEUE_SIZE = 10000 | |
USE_FLOW_CONTROL = True | ||
|
||
# If enabled this setting is used to timeout metric client connection if no | ||
# metrics have been sent in specified time in seconds | ||
# metrics have been sent in specified time in seconds | ||
#METRIC_CLIENT_IDLE_TIMEOUT = None | ||
|
||
# This defines the maximum "message size" between carbon daemons. | ||
|
@@ -460,10 +460,10 @@ MAX_AGGREGATION_INTERVALS = 5 | |
# having to first wait rule.frequency seconds. | ||
# WRITE_BACK_FREQUENCY = 0 | ||
|
||
# Set this to True to enable whitelisting and blacklisting of metrics in | ||
# CONF_DIR/whitelist.conf and CONF_DIR/blacklist.conf. If the whitelist is | ||
# missing or empty, all metrics will pass through | ||
# USE_WHITELIST = False | ||
# Set this to True to enable control over what metrics are allowed to be handled | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And here. |
||
# CONF_DIR/allowed_metrics.conf and CONF_DIR/blocked_metrics.conf. If the | ||
# allowed list is missing or empty, all metrics will pass through. | ||
# USE_METRIC_FILTERS = False | ||
|
||
# By default, carbon itself will log statistics (such as a count, | ||
# metricsReceived) with the top level prefix of 'carbon' at an interval of 60 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,7 +73,7 @@ | |
DESTINATIONS=[], | ||
USE_FLOW_CONTROL=True, | ||
USE_INSECURE_UNPICKLER=False, | ||
USE_WHITELIST=False, | ||
USE_METRIC_FILTERS=False, | ||
CARBON_METRIC_PREFIX='carbon', | ||
CARBON_METRIC_INTERVAL=60, | ||
CACHE_WRITE_STRATEGY='sorted', | ||
|
@@ -191,8 +191,8 @@ class CarbonCacheOptions(usage.Options): | |
["config", "c", None, "Use the given config file."], | ||
["instance", "", "a", "Manage a specific carbon instance."], | ||
["logdir", "", None, "Write logs to the given directory."], | ||
["whitelist", "", None, "List of metric patterns to allow."], | ||
["blacklist", "", None, "List of metric patterns to disallow."], | ||
["allowed_metrics", "", None, "List of metric patterns to allow."], | ||
["blocked_metrics", "", None, "List of metric patterns to disallow."], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/disallow/block/? |
||
] | ||
|
||
def postOptions(self): | ||
|
@@ -220,7 +220,7 @@ def postOptions(self): | |
# Normalize and expand paths | ||
settings["STORAGE_DIR"] = os.path.normpath(os.path.expanduser(settings["STORAGE_DIR"])) | ||
settings["LOCAL_DATA_DIR"] = os.path.normpath(os.path.expanduser(settings["LOCAL_DATA_DIR"])) | ||
settings["WHITELISTS_DIR"] = os.path.normpath(os.path.expanduser(settings["WHITELISTS_DIR"])) | ||
settings["METRIC_FILTERS_DIR"] = os.path.normpath(os.path.expanduser(settings["METRIC_FILTERS_DIR"])) | ||
settings["PID_DIR"] = os.path.normpath(os.path.expanduser(settings["PID_DIR"])) | ||
settings["LOG_DIR"] = os.path.normpath(os.path.expanduser(settings["LOG_DIR"])) | ||
settings["pidfile"] = os.path.normpath(os.path.expanduser(settings["pidfile"])) | ||
|
@@ -272,13 +272,13 @@ def postOptions(self): | |
os.chown(logdir, self.parent["uid"], self.parent["gid"]) | ||
log.logToDir(logdir) | ||
|
||
if self["whitelist"] is None: | ||
self["whitelist"] = join(settings["CONF_DIR"], "whitelist.conf") | ||
settings["whitelist"] = self["whitelist"] | ||
if self["allowed_metrics"] is None: | ||
self["allowed_metrics"] = join(settings["CONF_DIR"], "allowed_metrics.conf") | ||
settings["allowed_metrics"] = self["allowed_metrics"] | ||
|
||
if self["blacklist"] is None: | ||
self["blacklist"] = join(settings["CONF_DIR"], "blacklist.conf") | ||
settings["blacklist"] = self["blacklist"] | ||
if self["blocked_metrics"] is None: | ||
self["blocked_metrics"] = join(settings["CONF_DIR"], "blocked_metrics.conf") | ||
settings["blocked_metrics"] = self["blocked_metrics"] | ||
|
||
def parseArgs(self, *action): | ||
"""If an action was provided, store it for further processing.""" | ||
|
@@ -453,13 +453,21 @@ def get_default_parser(usage="%prog [options] <start|stop|status>"): | |
default=None, | ||
help="Use the given config file") | ||
parser.add_option( | ||
"--whitelist", | ||
"--allowed_metrics", | ||
default=None, | ||
help="Use the given whitelist file") | ||
help="Use the given allowed_metrics file") | ||
parser.add_option( | ||
"--blacklist", | ||
"--blocked_metrics", | ||
default=None, | ||
help="Use the given blacklist file") | ||
help="Use the given blocked_metrics file") | ||
parser.add_option( | ||
"--whitelist", ##DEPRECATED | ||
default=None, | ||
help="DEPRECATED: Use the '--allowed_metrics' option") | ||
parser.add_option( | ||
"--blacklist", ##DEPRECATED | ||
default=None, | ||
help="DEPRECATED: Use the ''--blocked_metrics' option") | ||
parser.add_option( | ||
"--logdir", | ||
default=None, | ||
|
@@ -555,7 +563,7 @@ def read_config(program, options, **kwargs): | |
settings.setdefault( | ||
"LOCAL_DATA_DIR", join(settings["STORAGE_DIR"], "whisper")) | ||
settings.setdefault( | ||
"WHITELISTS_DIR", join(settings["STORAGE_DIR"], "lists")) | ||
"METRIC_FILTERS_DIR", join(settings["STORAGE_DIR"], "lists")) | ||
|
||
# Read configuration options from program-specific section. | ||
section = program[len("carbon-"):] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be
METRIC_FILTERS_DIR
, no?