Skip to content

Commit

Permalink
Rename "scrap" to "scrape". (#60)
Browse files Browse the repository at this point in the history
Thanks for the fix
  • Loading branch information
mpereira authored and Erèbe - Romain Gerard committed Oct 24, 2019
1 parent b2675e1 commit 066cc15
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down Expand Up @@ -150,7 +150,7 @@ blacklist:
# Don't scrape us
- com:criteo:nosql:cassandra:exporter:.*
maxScrapFrequencyInSec:
maxScrapeFrequencyInSec:
50:
- .*
Expand Down
2 changes: 1 addition & 1 deletion config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ blacklist:
# Don't scrap us
- com:criteo:nosql:cassandra:exporter:.*

maxScrapFrequencyInSec:
maxScrapeFrequencyInSec:
50:
- .*

Expand Down
2 changes: 1 addition & 1 deletion config_minimal_dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:.*
Expand Down
2 changes: 1 addition & 1 deletion docker/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ blacklist:
# Don't scrap us
- com:criteo:nosql:cassandra:exporter:.*

maxScrapFrequencyInSec:
maxScrapeFrequencyInSec:
50:
- .*

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/criteo/nosql/cassandra/exporter/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public final class Config {
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);
Expand All @@ -39,8 +39,8 @@ public static Optional<Config> fromFile(String filePath) {
}
}

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

public Optional<String> getUser() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 066cc15

Please sign in to comment.