Skip to content
Permalink
Browse files

Rename "scrap" to "scrape". (#60)

Thanks for the fix
  • Loading branch information...
mpereira authored and erebe committed Oct 24, 2019
1 parent b2675e1 commit 066cc15f222ed29d271579f2fa661656630f6163
@@ -56,26 +56,26 @@ The Cassandra exporter needs to run on every Cassandra nodes to get all the info
You can have a look at a full configuration file [here](https://github.com/criteo/cassandra_exporter/blob/master/config.yml)
The 2 main parts are :
1. blacklist
1. maxScrapFrequencyInSec
1. maxScrapeFrequencyInSec

In the `blacklist` block, you specify the metrics you don't want the exporter to scrape. This is important as JMX is an RPC mechanism and you don't want to trigger some of those RPC. For example, mbeans endpoint from `org:apache:cassandra:db:.*` does not expose any metrics but are used to trigger actions on Cassandra's nodes.

In the `maxScrapFrequencyInSec`, you specify the metrics you want to be scraped at which frequency.
Basically, starting from the set of all mbeans, the blacklist is applied first to filter this set and then the `maxScrapFrequencyInSec` is applied as a whitelist to filter the resulting set.
In the `maxScrapeFrequencyInSec`, you specify the metrics you want to be scraped at which frequency.
Basically, starting from the set of all mbeans, the blacklist is applied first to filter this set and then the `maxScrapeFrequencyInSec` is applied as a whitelist to filter the resulting set.

As an example, if we take as input set the metrics `{a, b, c}` and the config file is
```yaml
blacklist:
- a
maxScrapFrequencyInSec:
maxScrapeFrequencyInSec:
50:
- .*
3600:
- b
```
Cassandra Exporter will have the following behavior:
1. The metrics matching the blacklisted entries will never be scraped, here the metric `a` won't be available
1. In reverse order of frequency the metrics matching `maxScrapFrequencyInSec` will be scraped
1. In reverse order of frequency the metrics matching `maxScrapeFrequencyInSec` will be scraped
1. Metric `b` will be scraped every hour
1. Remaining metrics will be scrapped every 50s, here only `c`

@@ -150,7 +150,7 @@ blacklist:
# Don't scrape us
- com:criteo:nosql:cassandra:exporter:.*
maxScrapFrequencyInSec:
maxScrapeFrequencyInSec:
50:
- .*
@@ -46,7 +46,7 @@ blacklist:
# Don't scrap us
- com:criteo:nosql:cassandra:exporter:.*

maxScrapFrequencyInSec:
maxScrapeFrequencyInSec:
50:
- .*

@@ -45,7 +45,7 @@ blacklist:
# Don't scrap us
- com:criteo:nosql:cassandra:exporter:.*

maxScrapFrequencyInSec:
maxScrapeFrequencyInSec:
50:
- org:apache:cassandra:metrics:cache:.*
- org:apache:cassandra:metrics:commitlog:.*
@@ -45,7 +45,7 @@ blacklist:
# Don't scrap us
- com:criteo:nosql:cassandra:exporter:.*

maxScrapFrequencyInSec:
maxScrapeFrequencyInSec:
50:
- .*

@@ -22,7 +22,7 @@
private String listenAddress = "0.0.0.0";
private String user;
private String password;
private SortedMap<Integer, List<String>> maxScrapFrequencyInSec;
private SortedMap<Integer, List<String>> maxScrapeFrequencyInSec;

public static Optional<Config> fromFile(String filePath) {
Logger logger = LoggerFactory.getLogger(Config.class);
@@ -39,8 +39,8 @@
}
}

public SortedMap<Integer, List<String>> getMaxScrapFrequencyInSec() {
return maxScrapFrequencyInSec;
public SortedMap<Integer, List<String>> getMaxScrapeFrequencyInSec() {
return maxScrapeFrequencyInSec;
}

public Optional<String> getUser() {
@@ -24,7 +24,7 @@ public static void main(String[] args) throws Exception {
Config cfg = cfgO.get();
boolean isOneShot = Arrays.asList(args).contains("--oneshot");
HTTPServer server = new HTTPServer(cfg.getListenAddress(), cfg.getListenPort());
JmxScraper scrapper = new JmxScraper(String.format("service:jmx:rmi:///jndi/rmi://%s/jmxrmi", cfg.getHost()), cfg.getUser(), cfg.getPassword(), cfg.getSSL(), cfg.getBlacklist(), cfg.getMaxScrapFrequencyInSec());
JmxScraper scrapper = new JmxScraper(String.format("service:jmx:rmi:///jndi/rmi://%s/jmxrmi", cfg.getHost()), cfg.getUser(), cfg.getPassword(), cfg.getSSL(), cfg.getBlacklist(), cfg.getMaxScrapeFrequencyInSec());

if (isOneShot) {
scrapper.run(false);

0 comments on commit 066cc15

Please sign in to comment.
You can’t perform that action at this time.