├── README.md ├── conf ├── aggregation-rules.conf.example ├── blacklist.conf.example ├── carbon.amqp.conf.example ├── carbon.conf ├── carbon.conf.example ├── relay-rules.conf.example ├── rewrite-rules.conf.example ├── storage-aggregation.conf ├── storage-aggregation.conf.example ├── storage-schemas.conf ├── storage-schemas.conf.example └── whitelist.conf.example └── docker-compose.yml /README.md: -------------------------------------------------------------------------------- 1 | # graphite-api + Grafana docker-compose recipe 2 | 3 | ## Usage 4 | 5 | $ docker-compose up -d 6 | 7 | ## Configure 8 | 9 | ### Containers 10 | 11 | See `./docker-compose.yml` 12 | 13 | > Notice that `grafana` and `graphite` are not linked with each other - you can deploy them on separate servers, just deleting the part you don't need. 14 | 15 | ### Carbon / Whisper 16 | 17 | `./conf` 18 | 19 | > SEEALSO: [ennexa/graphite](https://hub.docker.com/r/ennexa/graphite/~/dockerfile/) 20 | 21 | ### Grafana 22 | 23 | Add `environment` in `./docker-compose.yml`. 24 | 25 | > SEEALSO: [grafana/grafana](https://hub.docker.com/r/grafana/grafana), [Configuration - Grafana Documentation](http://docs.grafana.org/installation/configuration/) 26 | -------------------------------------------------------------------------------- /conf/aggregation-rules.conf.example: -------------------------------------------------------------------------------- 1 | # The form of each line in this file should be as follows: 2 | # 3 | # output_template (frequency) = method input_pattern 4 | # 5 | # This will capture any received metrics that match 'input_pattern' 6 | # for calculating an aggregate metric. The calculation will occur 7 | # every 'frequency' seconds and the 'method' can specify 'sum' or 8 | # 'avg'. The name of the aggregate metric will be derived from 9 | # 'output_template' filling in any captured fields from 'input_pattern'. 10 | # 11 | # For example, if you're metric naming scheme is: 12 | # 13 | # .applications... 14 | # 15 | # You could configure some aggregations like so: 16 | # 17 | # .applications..all.requests (60) = sum .applications..*.requests 18 | # .applications..all.latency (60) = avg .applications..*.latency 19 | # 20 | # As an example, if the following metrics are received: 21 | # 22 | # prod.applications.apache.www01.requests 23 | # prod.applications.apache.www01.requests 24 | # 25 | # They would all go into the same aggregation buffer and after 60 seconds the 26 | # aggregate metric 'prod.applications.apache.all.requests' would be calculated 27 | # by summing their values. 28 | # 29 | # Template components such as will match everything up to the next dot. 30 | # To match metric multiple components including the dots, use <> in the 31 | # input template: 32 | # 33 | # .applications..all. (60) = sum .applications..*.<> 34 | # 35 | # It is also possible to use regular expressions. Following the example above 36 | # when using: 37 | # 38 | # .applications...requests (60) = sum .applications..\d{2}.requests 39 | # 40 | # You will end up with 'prod.applications.apache.www.requests' instead of 41 | # 'prod.applications.apache.all.requests'. 42 | # 43 | # Note that any time this file is modified, it will be re-read automatically. 44 | -------------------------------------------------------------------------------- /conf/blacklist.conf.example: -------------------------------------------------------------------------------- 1 | # This file takes a single regular expression per line 2 | # If USE_WHITELIST is set to True in carbon.conf, any metrics received which 3 | # match one of these expressions will be dropped 4 | # This file is reloaded automatically when changes are made 5 | ^some\.noisy\.metric\.prefix\..* 6 | -------------------------------------------------------------------------------- /conf/carbon.amqp.conf.example: -------------------------------------------------------------------------------- 1 | # This is a configuration file with AMQP enabled 2 | 3 | [cache] 4 | LOCAL_DATA_DIR = 5 | 6 | # Specify the user to drop privileges to 7 | # If this is blank carbon runs as the user that invokes it 8 | # This user must have write access to the local data directory 9 | USER = 10 | 11 | # Limit the size of the cache to avoid swapping or becoming CPU bound. 12 | # Sorts and serving cache queries gets more expensive as the cache grows. 13 | # Use the value "inf" (infinity) for an unlimited cache size. 14 | MAX_CACHE_SIZE = inf 15 | 16 | # Limits the number of whisper update_many() calls per second, which effectively 17 | # means the number of write requests sent to the disk. This is intended to 18 | # prevent over-utilizing the disk and thus starving the rest of the system. 19 | # When the rate of required updates exceeds this, then carbon's caching will 20 | # take effect and increase the overall throughput accordingly. 21 | MAX_UPDATES_PER_SECOND = 1000 22 | 23 | # Softly limits the number of whisper files that get created each minute. 24 | # Setting this value low (like at 50) is a good way to ensure your graphite 25 | # system will not be adversely impacted when a bunch of new metrics are 26 | # sent to it. The trade off is that it will take much longer for those metrics' 27 | # database files to all get created and thus longer until the data becomes usable. 28 | # Setting this value high (like "inf" for infinity) will cause graphite to create 29 | # the files quickly but at the risk of slowing I/O down considerably for a while. 30 | MAX_CREATES_PER_MINUTE = inf 31 | 32 | LINE_RECEIVER_INTERFACE = 0.0.0.0 33 | LINE_RECEIVER_PORT = 2003 34 | 35 | UDP_RECEIVER_INTERFACE = 0.0.0.0 36 | UDP_RECEIVER_PORT = 2003 37 | 38 | PICKLE_RECEIVER_INTERFACE = 0.0.0.0 39 | PICKLE_RECEIVER_PORT = 2004 40 | 41 | CACHE_QUERY_INTERFACE = 0.0.0.0 42 | CACHE_QUERY_PORT = 7002 43 | 44 | # Enable AMQP if you want to receve metrics using you amqp broker 45 | ENABLE_AMQP = True 46 | 47 | # Verbose means a line will be logged for every metric received 48 | # useful for testing 49 | AMQP_VERBOSE = True 50 | 51 | # your credentials for the amqp server 52 | # AMQP_USER = guest 53 | # AMQP_PASSWORD = guest 54 | 55 | # the network settings for the amqp server 56 | # AMQP_HOST = localhost 57 | # AMQP_PORT = 5672 58 | 59 | # if you want to include the metric name as part of the message body 60 | # instead of as the routing key, set this to True 61 | # AMQP_METRIC_NAME_IN_BODY = False 62 | 63 | # NOTE: you cannot run both a cache and a relay on the same server 64 | # with the default configuration, you have to specify a distinict 65 | # interfaces and ports for the listeners. 66 | 67 | [relay] 68 | LINE_RECEIVER_INTERFACE = 0.0.0.0 69 | LINE_RECEIVER_PORT = 2003 70 | 71 | PICKLE_RECEIVER_INTERFACE = 0.0.0.0 72 | PICKLE_RECEIVER_PORT = 2004 73 | 74 | CACHE_SERVERS = server1, server2, server3 75 | MAX_QUEUE_SIZE = 10000 76 | -------------------------------------------------------------------------------- /conf/carbon.conf: -------------------------------------------------------------------------------- 1 | [cache] 2 | # Configure carbon directories. 3 | # 4 | # OS environment variables can be used to tell carbon where graphite is 5 | # installed, where to read configuration from and where to write data. 6 | # 7 | # GRAPHITE_ROOT - Root directory of the graphite installation. 8 | # Defaults to ../ 9 | # GRAPHITE_CONF_DIR - Configuration directory (where this file lives). 10 | # Defaults to $GRAPHITE_ROOT/conf/ 11 | # GRAPHITE_STORAGE_DIR - Storage directory for whipser/rrd/log/pid files. 12 | # Defaults to $GRAPHITE_ROOT/storage/ 13 | # 14 | # To change other directory paths, add settings to this file. The following 15 | # configuration variables are available with these default values: 16 | # 17 | 18 | # STORAGE_DIR = /opt/graphite/storage/whisper/ 19 | # CONF_DIR = /opt/graphite/conf/ 20 | # LOG_DIR = /opt/graphite/storage/log/ 21 | # PID_DIR = /var/run/ 22 | 23 | LOCAL_DATA_DIR = /opt/graphite/storage/whisper/ 24 | 25 | # Enable daily log rotation. If disabled, a kill -HUP can be used after a manual rotate 26 | ENABLE_LOGROTATION = True 27 | 28 | # Specify the user to drop privileges to 29 | # If this is blank carbon runs as the user that invokes it 30 | # This user must have write access to the local data directory 31 | USER = 32 | # 33 | # NOTE: The above settings must be set under [relay] and [aggregator] 34 | # to take effect for those daemons as well 35 | 36 | # Limit the size of the cache to avoid swapping or becoming CPU bound. 37 | # Sorts and serving cache queries gets more expensive as the cache grows. 38 | # Use the value "inf" (infinity) for an unlimited cache size. 39 | MAX_CACHE_SIZE = inf 40 | 41 | # Limits the number of whisper update_many() calls per second, which effectively 42 | # means the number of write requests sent to the disk. This is intended to 43 | # prevent over-utilizing the disk and thus starving the rest of the system. 44 | # When the rate of required updates exceeds this, then carbon's caching will 45 | # take effect and increase the overall throughput accordingly. 46 | MAX_UPDATES_PER_SECOND = 500 47 | 48 | # If defined, this changes the MAX_UPDATES_PER_SECOND in Carbon when a 49 | # stop/shutdown is initiated. This helps when MAX_UPDATES_PER_SECOND is 50 | # relatively low and carbon has cached a lot of updates; it enables the carbon 51 | # daemon to shutdown more quickly. 52 | # MAX_UPDATES_PER_SECOND_ON_SHUTDOWN = 1000 53 | 54 | # Softly limits the number of whisper files that get created each minute. 55 | # Setting this value low (like at 50) is a good way to ensure your graphite 56 | # system will not be adversely impacted when a bunch of new metrics are 57 | # sent to it. The trade off is that it will take much longer for those metrics' 58 | # database files to all get created and thus longer until the data becomes usable. 59 | # Setting this value high (like "inf" for infinity) will cause graphite to create 60 | # the files quickly but at the risk of slowing I/O down considerably for a while. 61 | MAX_CREATES_PER_MINUTE = 50 62 | 63 | LINE_RECEIVER_INTERFACE = 0.0.0.0 64 | LINE_RECEIVER_PORT = 2003 65 | 66 | # Set this to True to enable the UDP listener. By default this is off 67 | # because it is very common to run multiple carbon daemons and managing 68 | # another (rarely used) port for every carbon instance is not fun. 69 | ENABLE_UDP_LISTENER = True 70 | UDP_RECEIVER_INTERFACE = 0.0.0.0 71 | UDP_RECEIVER_PORT = 2003 72 | 73 | PICKLE_RECEIVER_INTERFACE = 0.0.0.0 74 | PICKLE_RECEIVER_PORT = 2004 75 | 76 | # Set to false to disable logging of successful connections 77 | LOG_LISTENER_CONNECTIONS = False 78 | 79 | # Per security concerns outlined in Bug #817247 the pickle receiver 80 | # will use a more secure and slightly less efficient unpickler. 81 | # Set this to True to revert to the old-fashioned insecure unpickler. 82 | USE_INSECURE_UNPICKLER = False 83 | 84 | CACHE_QUERY_INTERFACE = 0.0.0.0 85 | CACHE_QUERY_PORT = 7002 86 | 87 | # Set this to False to drop datapoints received after the cache 88 | # reaches MAX_CACHE_SIZE. If this is True (the default) then sockets 89 | # over which metrics are received will temporarily stop accepting 90 | # data until the cache size falls below 95% MAX_CACHE_SIZE. 91 | USE_FLOW_CONTROL = True 92 | 93 | # By default, carbon-cache will log every whisper update and cache hit. This can be excessive and 94 | # degrade performance if logging on the same volume as the whisper data is stored. 95 | LOG_UPDATES = False 96 | LOG_CACHE_HITS = False 97 | LOG_CACHE_QUEUE_SORTS = True 98 | 99 | # The thread that writes metrics to disk can use on of the following strategies 100 | # determining the order in which metrics are removed from cache and flushed to 101 | # disk. The default option preserves the same behavior as has been historically 102 | # available in version 0.9.10. 103 | # 104 | # sorted - All metrics in the cache will be counted and an ordered list of 105 | # them will be sorted according to the number of datapoints in the cache at the 106 | # moment of the list's creation. Metrics will then be flushed from the cache to 107 | # disk in that order. 108 | # 109 | # max - The writer thread will always pop and flush the metric from cache 110 | # that has the most datapoints. This will give a strong flush preference to 111 | # frequently updated metrics and will also reduce random file-io. Infrequently 112 | # updated metrics may only ever be persisted to disk at daemon shutdown if 113 | # there are a large number of metrics which receive very frequent updates OR if 114 | # disk i/o is very slow. 115 | # 116 | # naive - Metrics will be flushed from the cache to disk in an unordered 117 | # fashion. This strategy may be desirable in situations where the storage for 118 | # whisper files is solid state, CPU resources are very limited or deference to 119 | # the OS's i/o scheduler is expected to compensate for the random write 120 | # pattern. 121 | # 122 | CACHE_WRITE_STRATEGY = sorted 123 | 124 | # On some systems it is desirable for whisper to write synchronously. 125 | # Set this option to True if you'd like to try this. Basically it will 126 | # shift the onus of buffering writes from the kernel into carbon's cache. 127 | WHISPER_AUTOFLUSH = False 128 | 129 | # By default new Whisper files are created pre-allocated with the data region 130 | # filled with zeros to prevent fragmentation and speed up contiguous reads and 131 | # writes (which are common). Enabling this option will cause Whisper to create 132 | # the file sparsely instead. Enabling this option may allow a large increase of 133 | # MAX_CREATES_PER_MINUTE but may have longer term performance implications 134 | # depending on the underlying storage configuration. 135 | # WHISPER_SPARSE_CREATE = False 136 | 137 | # Only beneficial on linux filesystems that support the fallocate system call. 138 | # It maintains the benefits of contiguous reads/writes, but with a potentially 139 | # much faster creation speed, by allowing the kernel to handle the block 140 | # allocation and zero-ing. Enabling this option may allow a large increase of 141 | # MAX_CREATES_PER_MINUTE. If enabled on an OS or filesystem that is unsupported 142 | # this option will gracefully fallback to standard POSIX file access methods. 143 | WHISPER_FALLOCATE_CREATE = True 144 | 145 | # Enabling this option will cause Whisper to lock each Whisper file it writes 146 | # to with an exclusive lock (LOCK_EX, see: man 2 flock). This is useful when 147 | # multiple carbon-cache daemons are writing to the same files 148 | # WHISPER_LOCK_WRITES = False 149 | 150 | # Set this to True to enable whitelisting and blacklisting of metrics in 151 | # CONF_DIR/whitelist and CONF_DIR/blacklist. If the whitelist is missing or 152 | # empty, all metrics will pass through 153 | # USE_WHITELIST = False 154 | 155 | # By default, carbon itself will log statistics (such as a count, 156 | # metricsReceived) with the top level prefix of 'carbon' at an interval of 60 157 | # seconds. Set CARBON_METRIC_INTERVAL to 0 to disable instrumentation 158 | # CARBON_METRIC_PREFIX = carbon 159 | # CARBON_METRIC_INTERVAL = 60 160 | 161 | # Enable AMQP if you want to receve metrics using an amqp broker 162 | # ENABLE_AMQP = False 163 | 164 | # Verbose means a line will be logged for every metric received 165 | # useful for testing 166 | # AMQP_VERBOSE = False 167 | 168 | # AMQP_HOST = localhost 169 | # AMQP_PORT = 5672 170 | # AMQP_VHOST = / 171 | # AMQP_USER = guest 172 | # AMQP_PASSWORD = guest 173 | # AMQP_EXCHANGE = graphite 174 | # AMQP_METRIC_NAME_IN_BODY = False 175 | 176 | # The manhole interface allows you to SSH into the carbon daemon 177 | # and get a python interpreter. BE CAREFUL WITH THIS! If you do 178 | # something like time.sleep() in the interpreter, the whole process 179 | # will sleep! This is *extremely* helpful in debugging, assuming 180 | # you are familiar with the code. If you are not, please don't 181 | # mess with this, you are asking for trouble :) 182 | # 183 | # ENABLE_MANHOLE = False 184 | # MANHOLE_INTERFACE = 127.0.0.1 185 | # MANHOLE_PORT = 7222 186 | # MANHOLE_USER = admin 187 | # MANHOLE_PUBLIC_KEY = ssh-rsa AAAAB3NzaC1yc2EAAAABiwAaAIEAoxN0sv/e4eZCPpi3N3KYvyzRaBaMeS2RsOQ/cDuKv11dlNzVeiyc3RFmCv5Rjwn/lQ79y0zyHxw67qLyhQ/kDzINc4cY41ivuQXm2tPmgvexdrBv5nsfEpjs3gLZfJnyvlcVyWK/lId8WUvEWSWHTzsbtmXAF2raJMdgLTbQ8wE= 188 | 189 | # Patterns for all of the metrics this machine will store. Read more at 190 | # http://en.wikipedia.org/wiki/Advanced_Message_Queuing_Protocol#Bindings 191 | # 192 | # Example: store all sales, linux servers, and utilization metrics 193 | # BIND_PATTERNS = sales.#, servers.linux.#, #.utilization 194 | # 195 | # Example: store everything 196 | # BIND_PATTERNS = # 197 | 198 | # To configure special settings for the carbon-cache instance 'b', uncomment this: 199 | #[cache:b] 200 | #LINE_RECEIVER_PORT = 2103 201 | #PICKLE_RECEIVER_PORT = 2104 202 | #CACHE_QUERY_PORT = 7102 203 | # and any other settings you want to customize, defaults are inherited 204 | # from [carbon] section. 205 | # You can then specify the --instance=b option to manage this instance 206 | 207 | 208 | 209 | [relay] 210 | LINE_RECEIVER_INTERFACE = 0.0.0.0 211 | LINE_RECEIVER_PORT = 2013 212 | PICKLE_RECEIVER_INTERFACE = 0.0.0.0 213 | PICKLE_RECEIVER_PORT = 2014 214 | UDP_RECEIVER_INTERFACE = 0.0.0.0 215 | UDP_RECEIVER_PORT = 2013 216 | 217 | 218 | # Set to false to disable logging of successful connections 219 | LOG_LISTENER_CONNECTIONS = True 220 | 221 | # Carbon-relay has several options for metric routing controlled by RELAY_METHOD 222 | # 223 | # Use relay-rules.conf to route metrics to destinations based on pattern rules 224 | #RELAY_METHOD = rules 225 | # 226 | # Use consistent-hashing for even distribution of metrics between destinations 227 | #RELAY_METHOD = consistent-hashing 228 | # 229 | # Use consistent-hashing but take into account an aggregation-rules.conf shared 230 | # by downstream carbon-aggregator daemons. This will ensure that all metrics 231 | # that map to a given aggregation rule are sent to the same carbon-aggregator 232 | # instance. 233 | # Enable this for carbon-relays that send to a group of carbon-aggregators 234 | #RELAY_METHOD = aggregated-consistent-hashing 235 | RELAY_METHOD = rules 236 | 237 | # If you use consistent-hashing you can add redundancy by replicating every 238 | # datapoint to more than one machine. 239 | REPLICATION_FACTOR = 1 240 | 241 | # This is a list of carbon daemons we will send any relayed or 242 | # generated metrics to. The default provided would send to a single 243 | # carbon-cache instance on the default port. However if you 244 | # use multiple carbon-cache instances then it would look like this: 245 | # 246 | # DESTINATIONS = 127.0.0.1:2004:a, 127.0.0.1:2104:b 247 | # 248 | # The general form is IP:PORT:INSTANCE where the :INSTANCE part is 249 | # optional and refers to the "None" instance if omitted. 250 | # 251 | # Note that if the destinations are all carbon-caches then this should 252 | # exactly match the webapp's CARBONLINK_HOSTS setting in terms of 253 | # instances listed (order matters!). 254 | # 255 | # If using RELAY_METHOD = rules, all destinations used in relay-rules.conf 256 | # must be defined in this list 257 | DESTINATIONS = 127.0.0.1:2004 258 | 259 | # This defines the maximum "message size" between carbon daemons. 260 | # You shouldn't need to tune this unless you really know what you're doing. 261 | MAX_DATAPOINTS_PER_MESSAGE = 500 262 | MAX_QUEUE_SIZE = 10000 263 | 264 | # Set this to False to drop datapoints when any send queue (sending datapoints 265 | # to a downstream carbon daemon) hits MAX_QUEUE_SIZE. If this is True (the 266 | # default) then sockets over which metrics are received will temporarily stop accepting 267 | # data until the send queues fall below 80% MAX_QUEUE_SIZE. 268 | USE_FLOW_CONTROL = True 269 | 270 | # Set this to True to enable whitelisting and blacklisting of metrics in 271 | # CONF_DIR/whitelist and CONF_DIR/blacklist. If the whitelist is missing or 272 | # empty, all metrics will pass through 273 | # USE_WHITELIST = False 274 | 275 | # By default, carbon itself will log statistics (such as a count, 276 | # metricsReceived) with the top level prefix of 'carbon' at an interval of 60 277 | # seconds. Set CARBON_METRIC_INTERVAL to 0 to disable instrumentation 278 | # CARBON_METRIC_PREFIX = carbon 279 | # CARBON_METRIC_INTERVAL = 60 280 | 281 | 282 | [aggregator] 283 | LINE_RECEIVER_INTERFACE = 0.0.0.0 284 | LINE_RECEIVER_PORT = 2023 285 | 286 | PICKLE_RECEIVER_INTERFACE = 0.0.0.0 287 | PICKLE_RECEIVER_PORT = 2024 288 | 289 | # Set to false to disable logging of successful connections 290 | LOG_LISTENER_CONNECTIONS = False 291 | 292 | # If set true, metric received will be forwarded to DESTINATIONS in addition to 293 | # the output of the aggregation rules. If set false the carbon-aggregator will 294 | # only ever send the output of aggregation. 295 | FORWARD_ALL = True 296 | 297 | # This is a list of carbon daemons we will send any relayed or 298 | # generated metrics to. The default provided would send to a single 299 | # carbon-cache instance on the default port. However if you 300 | # use multiple carbon-cache instances then it would look like this: 301 | # 302 | # DESTINATIONS = 127.0.0.1:2004:a, 127.0.0.1:2104:b 303 | # 304 | # The format is comma-delimited IP:PORT:INSTANCE where the :INSTANCE part is 305 | # optional and refers to the "None" instance if omitted. 306 | # 307 | # Note that if the destinations are all carbon-caches then this should 308 | # exactly match the webapp's CARBONLINK_HOSTS setting in terms of 309 | # instances listed (order matters!). 310 | DESTINATIONS = 127.0.0.1:2004 311 | 312 | # If you want to add redundancy to your data by replicating every 313 | # datapoint to more than one machine, increase this. 314 | REPLICATION_FACTOR = 1 315 | 316 | # This is the maximum number of datapoints that can be queued up 317 | # for a single destination. Once this limit is hit, we will 318 | # stop accepting new data if USE_FLOW_CONTROL is True, otherwise 319 | # we will drop any subsequently received datapoints. 320 | MAX_QUEUE_SIZE = 10000 321 | 322 | # Set this to False to drop datapoints when any send queue (sending datapoints 323 | # to a downstream carbon daemon) hits MAX_QUEUE_SIZE. If this is True (the 324 | # default) then sockets over which metrics are received will temporarily stop accepting 325 | # data until the send queues fall below 80% MAX_QUEUE_SIZE. 326 | USE_FLOW_CONTROL = True 327 | 328 | # This defines the maximum "message size" between carbon daemons. 329 | # You shouldn't need to tune this unless you really know what you're doing. 330 | MAX_DATAPOINTS_PER_MESSAGE = 500 331 | 332 | # This defines how many datapoints the aggregator remembers for 333 | # each metric. Aggregation only happens for datapoints that fall in 334 | # the past MAX_AGGREGATION_INTERVALS * intervalSize seconds. 335 | MAX_AGGREGATION_INTERVALS = 5 336 | 337 | # By default (WRITE_BACK_FREQUENCY = 0), carbon-aggregator will write back 338 | # aggregated data points once every rule.frequency seconds, on a per-rule basis. 339 | # Set this (WRITE_BACK_FREQUENCY = N) to write back all aggregated data points 340 | # every N seconds, independent of rule frequency. This is useful, for example, 341 | # to be able to query partially aggregated metrics from carbon-cache without 342 | # having to first wait rule.frequency seconds. 343 | # WRITE_BACK_FREQUENCY = 0 344 | 345 | # Set this to True to enable whitelisting and blacklisting of metrics in 346 | # CONF_DIR/whitelist and CONF_DIR/blacklist. If the whitelist is missing or 347 | # empty, all metrics will pass through 348 | # USE_WHITELIST = False 349 | 350 | # By default, carbon itself will log statistics (such as a count, 351 | # metricsReceived) with the top level prefix of 'carbon' at an interval of 60 352 | # seconds. Set CARBON_METRIC_INTERVAL to 0 to disable instrumentation 353 | # CARBON_METRIC_PREFIX = carbon 354 | # CARBON_METRIC_INTERVAL = 60 -------------------------------------------------------------------------------- /conf/carbon.conf.example: -------------------------------------------------------------------------------- 1 | [cache] 2 | # Configure carbon directories. 3 | # 4 | # OS environment variables can be used to tell carbon where graphite is 5 | # installed, where to read configuration from and where to write data. 6 | # 7 | # GRAPHITE_ROOT - Root directory of the graphite installation. 8 | # Defaults to ../ 9 | # GRAPHITE_CONF_DIR - Configuration directory (where this file lives). 10 | # Defaults to $GRAPHITE_ROOT/conf/ 11 | # GRAPHITE_STORAGE_DIR - Storage directory for whisper/rrd/log/pid files. 12 | # Defaults to $GRAPHITE_ROOT/storage/ 13 | # 14 | # To change other directory paths, add settings to this file. The following 15 | # configuration variables are available with these default values: 16 | # 17 | # STORAGE_DIR = $GRAPHITE_STORAGE_DIR 18 | # LOCAL_DATA_DIR = STORAGE_DIR/whisper/ 19 | # WHITELISTS_DIR = STORAGE_DIR/lists/ 20 | # CONF_DIR = STORAGE_DIR/conf/ 21 | # LOG_DIR = STORAGE_DIR/log/ 22 | # PID_DIR = STORAGE_DIR/ 23 | # 24 | # For FHS style directory structures, use: 25 | # 26 | # STORAGE_DIR = /var/lib/carbon/ 27 | # CONF_DIR = /etc/carbon/ 28 | # LOG_DIR = /var/log/carbon/ 29 | # PID_DIR = /var/run/ 30 | # 31 | #LOCAL_DATA_DIR = /opt/graphite/storage/whisper/ 32 | 33 | # Enable daily log rotation. If disabled, carbon will automatically re-open 34 | # the file if it's rotated out of place (e.g. by logrotate daemon) 35 | ENABLE_LOGROTATION = True 36 | 37 | # Specify the user to drop privileges to 38 | # If this is blank carbon runs as the user that invokes it 39 | # This user must have write access to the local data directory 40 | USER = 41 | # 42 | # NOTE: The above settings must be set under [relay] and [aggregator] 43 | # to take effect for those daemons as well 44 | 45 | # Limit the size of the cache to avoid swapping or becoming CPU bound. 46 | # Sorts and serving cache queries gets more expensive as the cache grows. 47 | # Use the value "inf" (infinity) for an unlimited cache size. 48 | MAX_CACHE_SIZE = inf 49 | 50 | # Limits the number of whisper update_many() calls per second, which effectively 51 | # means the number of write requests sent to the disk. This is intended to 52 | # prevent over-utilizing the disk and thus starving the rest of the system. 53 | # When the rate of required updates exceeds this, then carbon's caching will 54 | # take effect and increase the overall throughput accordingly. 55 | MAX_UPDATES_PER_SECOND = 500 56 | 57 | # If defined, this changes the MAX_UPDATES_PER_SECOND in Carbon when a 58 | # stop/shutdown is initiated. This helps when MAX_UPDATES_PER_SECOND is 59 | # relatively low and carbon has cached a lot of updates; it enables the carbon 60 | # daemon to shutdown more quickly. 61 | # MAX_UPDATES_PER_SECOND_ON_SHUTDOWN = 1000 62 | 63 | # Softly limits the number of whisper files that get created each minute. 64 | # Setting this value low (e.g. 50) is a good way to ensure that your carbon 65 | # system will not be adversely impacted when a bunch of new metrics are 66 | # sent to it. The trade off is that any metrics received in excess of this 67 | # value will be silently dropped, and the whisper file will not be created 68 | # until such point as a subsequent metric is received and fits within the 69 | # defined rate limit. Setting this value high (like "inf" for infinity) will 70 | # cause carbon to create the files quickly but at the risk of increased I/O. 71 | MAX_CREATES_PER_MINUTE = 50 72 | 73 | # Set the interface and port for the line (plain text) listener. Setting the 74 | # interface to 0.0.0.0 listens on all interfaces. Port can be set to 0 to 75 | # disable this listener if it is not required. 76 | LINE_RECEIVER_INTERFACE = 0.0.0.0 77 | LINE_RECEIVER_PORT = 2003 78 | 79 | # Set the TCP backlog for the listen socket created by the line receiver. You 80 | # shouldn't change this unless you know what you're doing. 81 | # LINE_RECEIVER_BACKLOG = 1024 82 | 83 | # Set this to True to enable the UDP listener. By default this is off 84 | # because it is very common to run multiple carbon daemons and managing 85 | # another (rarely used) port for every carbon instance is not fun. 86 | ENABLE_UDP_LISTENER = False 87 | UDP_RECEIVER_INTERFACE = 0.0.0.0 88 | UDP_RECEIVER_PORT = 2003 89 | 90 | # Set the interface and port for the pickle listener. Setting the interface to 91 | # 0.0.0.0 listens on all interfaces. Port can be set to 0 to disable this 92 | # listener if it is not required. 93 | PICKLE_RECEIVER_INTERFACE = 0.0.0.0 94 | PICKLE_RECEIVER_PORT = 2004 95 | 96 | # Set the TCP backlog for the listen socket created by the pickle receiver. You 97 | # shouldn't change this unless you know what you're doing. 98 | # PICKLE_RECEIVER_BACKLOG = 1024 99 | 100 | # Set to false to disable logging of successful connections 101 | LOG_LISTENER_CONNECTIONS = True 102 | 103 | # Per security concerns outlined in Bug #817247 the pickle receiver 104 | # will use a more secure and slightly less efficient unpickler. 105 | # Set this to True to revert to the old-fashioned insecure unpickler. 106 | USE_INSECURE_UNPICKLER = False 107 | 108 | CACHE_QUERY_INTERFACE = 0.0.0.0 109 | CACHE_QUERY_PORT = 7002 110 | 111 | # Set the TCP backlog for the listen socket created by the cache query 112 | # listener. You shouldn't change this unless you know what you're doing. 113 | # CACHE_QUERY_BACKLOG = 1024 114 | 115 | # Set this to False to drop datapoints received after the cache 116 | # reaches MAX_CACHE_SIZE. If this is True (the default) then sockets 117 | # over which metrics are received will temporarily stop accepting 118 | # data until the cache size falls below 95% MAX_CACHE_SIZE. 119 | USE_FLOW_CONTROL = True 120 | 121 | # By default, carbon-cache will log every whisper update and cache hit. This can be excessive and 122 | # degrade performance if logging on the same volume as the whisper data is stored. 123 | LOG_UPDATES = False 124 | LOG_CACHE_HITS = False 125 | LOG_CACHE_QUEUE_SORTS = True 126 | 127 | # The thread that writes metrics to disk can use on of the following strategies 128 | # determining the order in which metrics are removed from cache and flushed to 129 | # disk. The default option preserves the same behavior as has been historically 130 | # available in version 0.9.10. 131 | # 132 | # sorted - All metrics in the cache will be counted and an ordered list of 133 | # them will be sorted according to the number of datapoints in the cache at the 134 | # moment of the list's creation. Metrics will then be flushed from the cache to 135 | # disk in that order. 136 | # 137 | # max - The writer thread will always pop and flush the metric from cache 138 | # that has the most datapoints. This will give a strong flush preference to 139 | # frequently updated metrics and will also reduce random file-io. Infrequently 140 | # updated metrics may only ever be persisted to disk at daemon shutdown if 141 | # there are a large number of metrics which receive very frequent updates OR if 142 | # disk i/o is very slow. 143 | # 144 | # naive - Metrics will be flushed from the cache to disk in an unordered 145 | # fashion. This strategy may be desirable in situations where the storage for 146 | # whisper files is solid state, CPU resources are very limited or deference to 147 | # the OS's i/o scheduler is expected to compensate for the random write 148 | # pattern. 149 | # 150 | CACHE_WRITE_STRATEGY = sorted 151 | 152 | # On some systems it is desirable for whisper to write synchronously. 153 | # Set this option to True if you'd like to try this. Basically it will 154 | # shift the onus of buffering writes from the kernel into carbon's cache. 155 | WHISPER_AUTOFLUSH = False 156 | 157 | # By default new Whisper files are created pre-allocated with the data region 158 | # filled with zeros to prevent fragmentation and speed up contiguous reads and 159 | # writes (which are common). Enabling this option will cause Whisper to create 160 | # the file sparsely instead. Enabling this option may allow a large increase of 161 | # MAX_CREATES_PER_MINUTE but may have longer term performance implications 162 | # depending on the underlying storage configuration. 163 | # WHISPER_SPARSE_CREATE = False 164 | 165 | # Only beneficial on linux filesystems that support the fallocate system call. 166 | # It maintains the benefits of contiguous reads/writes, but with a potentially 167 | # much faster creation speed, by allowing the kernel to handle the block 168 | # allocation and zero-ing. Enabling this option may allow a large increase of 169 | # MAX_CREATES_PER_MINUTE. If enabled on an OS or filesystem that is unsupported 170 | # this option will gracefully fallback to standard POSIX file access methods. 171 | WHISPER_FALLOCATE_CREATE = True 172 | 173 | # Enabling this option will cause Whisper to lock each Whisper file it writes 174 | # to with an exclusive lock (LOCK_EX, see: man 2 flock). This is useful when 175 | # multiple carbon-cache daemons are writing to the same files 176 | # WHISPER_LOCK_WRITES = False 177 | 178 | # Set this to True to enable whitelisting and blacklisting of metrics in 179 | # CONF_DIR/whitelist and CONF_DIR/blacklist. If the whitelist is missing or 180 | # empty, all metrics will pass through 181 | # USE_WHITELIST = False 182 | 183 | # By default, carbon itself will log statistics (such as a count, 184 | # metricsReceived) with the top level prefix of 'carbon' at an interval of 60 185 | # seconds. Set CARBON_METRIC_INTERVAL to 0 to disable instrumentation 186 | # CARBON_METRIC_PREFIX = carbon 187 | # CARBON_METRIC_INTERVAL = 60 188 | 189 | # Enable AMQP if you want to receve metrics using an amqp broker 190 | # ENABLE_AMQP = False 191 | 192 | # Verbose means a line will be logged for every metric received 193 | # useful for testing 194 | # AMQP_VERBOSE = False 195 | 196 | # AMQP_HOST = localhost 197 | # AMQP_PORT = 5672 198 | # AMQP_VHOST = / 199 | # AMQP_USER = guest 200 | # AMQP_PASSWORD = guest 201 | # AMQP_EXCHANGE = graphite 202 | # AMQP_METRIC_NAME_IN_BODY = False 203 | 204 | # The manhole interface allows you to SSH into the carbon daemon 205 | # and get a python interpreter. BE CAREFUL WITH THIS! If you do 206 | # something like time.sleep() in the interpreter, the whole process 207 | # will sleep! This is *extremely* helpful in debugging, assuming 208 | # you are familiar with the code. If you are not, please don't 209 | # mess with this, you are asking for trouble :) 210 | # 211 | # ENABLE_MANHOLE = False 212 | # MANHOLE_INTERFACE = 127.0.0.1 213 | # MANHOLE_PORT = 7222 214 | # MANHOLE_USER = admin 215 | # MANHOLE_PUBLIC_KEY = ssh-rsa AAAAB3NzaC1yc2EAAAABiwAaAIEAoxN0sv/e4eZCPpi3N3KYvyzRaBaMeS2RsOQ/cDuKv11dlNzVeiyc3RFmCv5Rjwn/lQ79y0zyHxw67qLyhQ/kDzINc4cY41ivuQXm2tPmgvexdrBv5nsfEpjs3gLZfJnyvlcVyWK/lId8WUvEWSWHTzsbtmXAF2raJMdgLTbQ8wE= 216 | 217 | # Patterns for all of the metrics this machine will store. Read more at 218 | # http://en.wikipedia.org/wiki/Advanced_Message_Queuing_Protocol#Bindings 219 | # 220 | # Example: store all sales, linux servers, and utilization metrics 221 | # BIND_PATTERNS = sales.#, servers.linux.#, #.utilization 222 | # 223 | # Example: store everything 224 | # BIND_PATTERNS = # 225 | 226 | # To configure special settings for the carbon-cache instance 'b', uncomment this: 227 | #[cache:b] 228 | #LINE_RECEIVER_PORT = 2103 229 | #PICKLE_RECEIVER_PORT = 2104 230 | #CACHE_QUERY_PORT = 7102 231 | # and any other settings you want to customize, defaults are inherited 232 | # from [carbon] section. 233 | # You can then specify the --instance=b option to manage this instance 234 | 235 | 236 | 237 | [relay] 238 | LINE_RECEIVER_INTERFACE = 0.0.0.0 239 | LINE_RECEIVER_PORT = 2013 240 | PICKLE_RECEIVER_INTERFACE = 0.0.0.0 241 | PICKLE_RECEIVER_PORT = 2014 242 | 243 | # Set to false to disable logging of successful connections 244 | LOG_LISTENER_CONNECTIONS = True 245 | 246 | # Carbon-relay has several options for metric routing controlled by RELAY_METHOD 247 | # 248 | # Use relay-rules.conf to route metrics to destinations based on pattern rules 249 | #RELAY_METHOD = rules 250 | # 251 | # Use consistent-hashing for even distribution of metrics between destinations 252 | #RELAY_METHOD = consistent-hashing 253 | # 254 | # Use consistent-hashing but take into account an aggregation-rules.conf shared 255 | # by downstream carbon-aggregator daemons. This will ensure that all metrics 256 | # that map to a given aggregation rule are sent to the same carbon-aggregator 257 | # instance. 258 | # Enable this for carbon-relays that send to a group of carbon-aggregators 259 | #RELAY_METHOD = aggregated-consistent-hashing 260 | RELAY_METHOD = rules 261 | 262 | # If you use consistent-hashing you can add redundancy by replicating every 263 | # datapoint to more than one machine. 264 | REPLICATION_FACTOR = 1 265 | 266 | # For REPLICATION_FACTOR >=2, set DIVERSE_REPLICAS to True to guarantee replicas 267 | # across distributed hosts. With this setting disabled, it's possible that replicas 268 | # may be sent to different caches on the same host. This has been the default 269 | # behavior since introduction of 'consistent-hashing' relay method. 270 | # Note that enabling this on an existing pre-0.9.14 cluster will require rebalancing 271 | # your metrics across the cluster nodes using a tool like Carbonate. 272 | #DIVERSE_REPLICAS = False 273 | 274 | # This is a list of carbon daemons we will send any relayed or 275 | # generated metrics to. The default provided would send to a single 276 | # carbon-cache instance on the default port. However if you 277 | # use multiple carbon-cache instances then it would look like this: 278 | # 279 | # DESTINATIONS = 127.0.0.1:2004:a, 127.0.0.1:2104:b 280 | # 281 | # The general form is IP:PORT:INSTANCE where the :INSTANCE part is 282 | # optional and refers to the "None" instance if omitted. 283 | # 284 | # Note that if the destinations are all carbon-caches then this should 285 | # exactly match the webapp's CARBONLINK_HOSTS setting in terms of 286 | # instances listed (order matters!). 287 | # 288 | # If using RELAY_METHOD = rules, all destinations used in relay-rules.conf 289 | # must be defined in this list 290 | DESTINATIONS = 127.0.0.1:2004 291 | 292 | # This defines the maximum "message size" between carbon daemons. 293 | # You shouldn't need to tune this unless you really know what you're doing. 294 | MAX_DATAPOINTS_PER_MESSAGE = 500 295 | MAX_QUEUE_SIZE = 10000 296 | 297 | # This is the percentage that the queue must be empty before it will accept 298 | # more messages. For a larger site, if the queue is very large it makes sense 299 | # to tune this to allow for incoming stats. So if you have an average 300 | # flow of 100k stats/minute, and a MAX_QUEUE_SIZE of 3,000,000, it makes sense 301 | # to allow stats to start flowing when you've cleared the queue to 95% since 302 | # you should have space to accommodate the next minute's worth of stats 303 | # even before the relay incrementally clears more of the queue 304 | QUEUE_LOW_WATERMARK_PCT = 0.8 305 | 306 | # Set this to False to drop datapoints when any send queue (sending datapoints 307 | # to a downstream carbon daemon) hits MAX_QUEUE_SIZE. If this is True (the 308 | # default) then sockets over which metrics are received will temporarily stop accepting 309 | # data until the send queues fall below QUEUE_LOW_WATERMARK_PCT * MAX_QUEUE_SIZE. 310 | USE_FLOW_CONTROL = True 311 | 312 | # Set this to True to enable whitelisting and blacklisting of metrics in 313 | # CONF_DIR/whitelist and CONF_DIR/blacklist. If the whitelist is missing or 314 | # empty, all metrics will pass through 315 | # USE_WHITELIST = False 316 | 317 | # By default, carbon itself will log statistics (such as a count, 318 | # metricsReceived) with the top level prefix of 'carbon' at an interval of 60 319 | # seconds. Set CARBON_METRIC_INTERVAL to 0 to disable instrumentation 320 | # CARBON_METRIC_PREFIX = carbon 321 | # CARBON_METRIC_INTERVAL = 60 322 | 323 | 324 | [aggregator] 325 | LINE_RECEIVER_INTERFACE = 0.0.0.0 326 | LINE_RECEIVER_PORT = 2023 327 | 328 | PICKLE_RECEIVER_INTERFACE = 0.0.0.0 329 | PICKLE_RECEIVER_PORT = 2024 330 | 331 | # Set to false to disable logging of successful connections 332 | LOG_LISTENER_CONNECTIONS = True 333 | 334 | # If set true, metric received will be forwarded to DESTINATIONS in addition to 335 | # the output of the aggregation rules. If set false the carbon-aggregator will 336 | # only ever send the output of aggregation. Default value is set to false and will not forward 337 | FORWARD_ALL = False 338 | 339 | # Filenames of the configuration files to use for this instance of aggregator. 340 | # Filenames are relative to CONF_DIR. 341 | # 342 | # AGGREGATION_RULES = aggregation-rules.conf 343 | # REWRITE_RULES = rewrite-rules.conf 344 | 345 | # This is a list of carbon daemons we will send any relayed or 346 | # generated metrics to. The default provided would send to a single 347 | # carbon-cache instance on the default port. However if you 348 | # use multiple carbon-cache instances then it would look like this: 349 | # 350 | # DESTINATIONS = 127.0.0.1:2004:a, 127.0.0.1:2104:b 351 | # 352 | # The format is comma-delimited IP:PORT:INSTANCE where the :INSTANCE part is 353 | # optional and refers to the "None" instance if omitted. 354 | # 355 | # Note that if the destinations are all carbon-caches then this should 356 | # exactly match the webapp's CARBONLINK_HOSTS setting in terms of 357 | # instances listed (order matters!). 358 | DESTINATIONS = 127.0.0.1:2004 359 | 360 | # If you want to add redundancy to your data by replicating every 361 | # datapoint to more than one machine, increase this. 362 | REPLICATION_FACTOR = 1 363 | 364 | # This is the maximum number of datapoints that can be queued up 365 | # for a single destination. Once this limit is hit, we will 366 | # stop accepting new data if USE_FLOW_CONTROL is True, otherwise 367 | # we will drop any subsequently received datapoints. 368 | MAX_QUEUE_SIZE = 10000 369 | 370 | # Set this to False to drop datapoints when any send queue (sending datapoints 371 | # to a downstream carbon daemon) hits MAX_QUEUE_SIZE. If this is True (the 372 | # default) then sockets over which metrics are received will temporarily stop accepting 373 | # data until the send queues fall below 80% MAX_QUEUE_SIZE. 374 | USE_FLOW_CONTROL = True 375 | 376 | # This defines the maximum "message size" between carbon daemons. 377 | # You shouldn't need to tune this unless you really know what you're doing. 378 | MAX_DATAPOINTS_PER_MESSAGE = 500 379 | 380 | # This defines how many datapoints the aggregator remembers for 381 | # each metric. Aggregation only happens for datapoints that fall in 382 | # the past MAX_AGGREGATION_INTERVALS * intervalSize seconds. 383 | MAX_AGGREGATION_INTERVALS = 5 384 | 385 | # By default (WRITE_BACK_FREQUENCY = 0), carbon-aggregator will write back 386 | # aggregated data points once every rule.frequency seconds, on a per-rule basis. 387 | # Set this (WRITE_BACK_FREQUENCY = N) to write back all aggregated data points 388 | # every N seconds, independent of rule frequency. This is useful, for example, 389 | # to be able to query partially aggregated metrics from carbon-cache without 390 | # having to first wait rule.frequency seconds. 391 | # WRITE_BACK_FREQUENCY = 0 392 | 393 | # Set this to True to enable whitelisting and blacklisting of metrics in 394 | # CONF_DIR/whitelist and CONF_DIR/blacklist. If the whitelist is missing or 395 | # empty, all metrics will pass through 396 | # USE_WHITELIST = False 397 | 398 | # By default, carbon itself will log statistics (such as a count, 399 | # metricsReceived) with the top level prefix of 'carbon' at an interval of 60 400 | # seconds. Set CARBON_METRIC_INTERVAL to 0 to disable instrumentation 401 | # CARBON_METRIC_PREFIX = carbon 402 | # CARBON_METRIC_INTERVAL = 60 403 | -------------------------------------------------------------------------------- /conf/relay-rules.conf.example: -------------------------------------------------------------------------------- 1 | # Relay destination rules for carbon-relay. Entries are scanned in order, 2 | # and the first pattern a metric matches will cause processing to cease after sending 3 | # unless `continue` is set to true 4 | # 5 | # [name] 6 | # pattern = 7 | # destinations = 8 | # continue = # default: False 9 | # 10 | # name: Arbitrary unique name to identify the rule 11 | # pattern: Regex pattern to match against the metric name 12 | # destinations: Comma-separated list of destinations. 13 | # ex: 127.0.0.1:2004:a, 10.1.2.4:2004, myserver.mydomain.com:2004 14 | # continue: Continue processing rules if this rule matches (default: False) 15 | 16 | # You must have exactly one section with 'default = true' 17 | # Note that all destinations listed must also exist in carbon.conf 18 | # in the DESTINATIONS setting in the [relay] section 19 | [default] 20 | default = true 21 | destinations = 127.0.0.1:2004:a, 127.0.0.1:2104:b 22 | -------------------------------------------------------------------------------- /conf/rewrite-rules.conf.example: -------------------------------------------------------------------------------- 1 | # This file defines regular expression patterns that can be used to 2 | # rewrite metric names in a search & replace fashion. It consists of two 3 | # sections, [pre] and [post]. The rules in the pre section are applied to 4 | # metric names as soon as they are received. The post rules are applied 5 | # after aggregation has taken place. 6 | # 7 | # The general form of each rule is as follows: 8 | # 9 | # regex-pattern = replacement-text 10 | # 11 | # For example: 12 | # 13 | # [post] 14 | # _sum$ = 15 | # _avg$ = 16 | # 17 | # These rules would strip off a suffix of _sum or _avg from any metric names 18 | # after aggregation. 19 | -------------------------------------------------------------------------------- /conf/storage-aggregation.conf: -------------------------------------------------------------------------------- 1 | # Aggregation methods for whisper files. Entries are scanned in order, 2 | # and first match wins. This file is scanned for changes every 60 seconds 3 | # 4 | # [name] 5 | # pattern = 6 | # xFilesFactor = 7 | # aggregationMethod = 8 | # 9 | # name: Arbitrary unique name for the rule 10 | # pattern: Regex pattern to match against the metric name 11 | # xFilesFactor: Ratio of valid data points required for aggregation to the next retention to occur 12 | # aggregationMethod: function to apply to data points for aggregation 13 | # 14 | [min] 15 | pattern = \.min$ 16 | xFilesFactor = 0.1 17 | aggregationMethod = min 18 | 19 | [max] 20 | pattern = \.max$ 21 | xFilesFactor = 0.1 22 | aggregationMethod = max 23 | 24 | [count] 25 | pattern = \.count$ 26 | xFilesFactor = 0 27 | aggregationMethod = sum 28 | 29 | [lower] 30 | pattern = \.lower(_\d+)?$ 31 | xFilesFactor = 0.1 32 | aggregationMethod = min 33 | 34 | [upper] 35 | pattern = \.upper(_\d+)?$ 36 | xFilesFactor = 0.1 37 | aggregationMethod = max 38 | 39 | [sum] 40 | pattern = \.sum$ 41 | xFilesFactor = 0 42 | aggregationMethod = sum 43 | 44 | [gauges] 45 | pattern = ^.*\.gauges\..* 46 | xFilesFactor = 0 47 | aggregationMethod = last 48 | 49 | [default_average] 50 | pattern = .* 51 | xFilesFactor = 0.5 52 | aggregationMethod = average -------------------------------------------------------------------------------- /conf/storage-aggregation.conf.example: -------------------------------------------------------------------------------- 1 | # Aggregation methods for whisper files. Entries are scanned in order, 2 | # and first match wins. This file is scanned for changes every 60 seconds 3 | # 4 | # [name] 5 | # pattern = 6 | # xFilesFactor = 7 | # aggregationMethod = 8 | # 9 | # name: Arbitrary unique name for the rule 10 | # pattern: Regex pattern to match against the metric name 11 | # xFilesFactor: Ratio of valid data points required for aggregation to the next retention to occur 12 | # aggregationMethod: function to apply to data points for aggregation 13 | # 14 | [min] 15 | pattern = \.min$ 16 | xFilesFactor = 0.1 17 | aggregationMethod = min 18 | 19 | [max] 20 | pattern = \.max$ 21 | xFilesFactor = 0.1 22 | aggregationMethod = max 23 | 24 | [sum] 25 | pattern = \.count$ 26 | xFilesFactor = 0 27 | aggregationMethod = sum 28 | 29 | [default_average] 30 | pattern = .* 31 | xFilesFactor = 0.5 32 | aggregationMethod = average 33 | -------------------------------------------------------------------------------- /conf/storage-schemas.conf: -------------------------------------------------------------------------------- 1 | # Schema definitions for Whisper files. Entries are scanned in order, 2 | # and first match wins. This file is scanned for changes every 60 seconds. 3 | # 4 | # [name] 5 | # pattern = regex 6 | # retentions = timePerPoint:timeToStore, timePerPoint:timeToStore, ... 7 | 8 | # Carbon's internal metrics. This entry should match what is specified in 9 | # CARBON_METRIC_PREFIX and CARBON_METRIC_INTERVAL settings 10 | [carbon] 11 | pattern = ^carbon\. 12 | retentions = 5s:1d,1m:90d 13 | 14 | [collectd] 15 | pattern = ^collectd.* 16 | retentions = 10s:1d,1m:90d,10m:1y,1h:5y 17 | 18 | [statsd] 19 | pattern = ^stats.* 20 | retentions = 10s:1d,1m:90d,10m:1y,1h:5y 21 | 22 | [default_1min_for_1day] 23 | pattern = .* 24 | retentions = 5s:1d,1m:30d 25 | -------------------------------------------------------------------------------- /conf/storage-schemas.conf.example: -------------------------------------------------------------------------------- 1 | # Schema definitions for Whisper files. Entries are scanned in order, 2 | # and first match wins. This file is scanned for changes every 60 seconds. 3 | # 4 | # [name] 5 | # pattern = regex 6 | # retentions = timePerPoint:timeToStore, timePerPoint:timeToStore, ... 7 | 8 | # Carbon's internal metrics. This entry should match what is specified in 9 | # CARBON_METRIC_PREFIX and CARBON_METRIC_INTERVAL settings 10 | [carbon] 11 | pattern = ^carbon\. 12 | retentions = 60:90d 13 | 14 | [default_1min_for_1day] 15 | pattern = .* 16 | retentions = 60s:1d 17 | -------------------------------------------------------------------------------- /conf/whitelist.conf.example: -------------------------------------------------------------------------------- 1 | # This file takes a single regular expression per line 2 | # If USE_WHITELIST is set to True in carbon.conf, only metrics received which 3 | # match one of these expressions will be persisted. If this file is empty or 4 | # missing, all metrics will pass through. 5 | # This file is reloaded automatically when changes are made 6 | .* 7 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | graphite: 4 | image: ennexa/graphite 5 | container_name: graphite 6 | volumes: 7 | - ./conf:/opt/graphite/conf 8 | - /data/whisper:/opt/graphite/storage/whisper 9 | ports: 10 | - '60004:8000' # graphite-api 11 | - '60001:2003' 12 | - '60001:2003/udp' 13 | - '60002:2004' 14 | - '60003:2005' 15 | grafana: 16 | image: grafana/grafana 17 | container_name: grafana 18 | volumes: 19 | - /data/grafana:/var/lib/grafana 20 | ports: 21 | - '60010:3000' 22 | environment: 23 | - GF_SERVER_ROOT_URL=http://grafana.local 24 | - GF_SECURITY_ADMIN_PASSWORD=admin 25 | - GF_USERS_ALLOW_SIGN_UP=false 26 | - GF_USERS_ALLOW_ORG_CREATE=false 27 | - GF_AUTH_ANONYMOUS_ENABLED=true 28 | - GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-simple-json-datasource 29 | --------------------------------------------------------------------------------