Skip to content
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

keyspace and table names in NodeInfo must be in lowercase. #36

Merged
merged 1 commit into from
Jan 30, 2019
Merged

keyspace and table names in NodeInfo must be in lowercase. #36

merged 1 commit into from
Jan 30, 2019

Conversation

krolser
Copy link
Contributor

@krolser krolser commented Jan 30, 2019

In the JmxScraper.java inside method getMetricPath() properties is transformed to lowercase.

    private String getMetricPath(ObjectName mbeanName, MBeanAttributeInfo attr) {
        String properties = PATTERN.matcher(mbeanName.toString())
                .replaceAll(metricSeparator)
                .replace(' ', '_') + metricSeparator + attr.getName();
        return properties.toLowerCase();  <====
    }

It's work great with the cql tables because when you create table using CREATE TABLE <tablename> statement, cassandra lowercase <tablename>.

Statements below are same:

CREATE TABLE test.NAME ( id UUID PRIMARY KEY, lastname text);
CREATE TABLE test.Name ( id UUID PRIMARY KEY, lastname text);
CREATE TABLE test.nAmE ( id UUID PRIMARY KEY, lastname text);

Everything work fine. But, if you have tables created using cassandra-cli, their names isn't lowercased inside cassandra.

Condition

if (nodeInfo.keyspaces.contains(keyspaceName) && nodeInfo.tables.contains(tableName)) { <==
    STATS.labels(nodeInfo.clusterName, nodeInfo.datacenterName, keyspaceName, tableName, metricName).set(value);
    return;
}

not true and label table is not set.

@erebe erebe merged commit 85773af into criteo:master Jan 30, 2019
@erebe
Copy link
Contributor

erebe commented Jan 30, 2019

Thanks will create a new release

@erebe
Copy link
Contributor

erebe commented Jan 30, 2019

Available in release 2.2.1
https://github.com/criteo/cassandra_exporter/releases/tag/2.2.1
Docker container is also updated

@krolser krolser deleted the bug-empty-tablename branch January 31, 2019 07:21
@krolser
Copy link
Contributor Author

krolser commented Jan 31, 2019

Thank you for fast response.
Everything work great. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants