Skip to content

Commit

Permalink
Hacky hack for instaclustr#112
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Trommer committed Sep 21, 2023
1 parent 406b05b commit 9327250
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ public String clusterName() {

@Override
public InetAddress localBroadcastAddress() {
return FBUtilities.getBroadcastAddressAndPort().toString(false);
return FBUtilities.getBroadcastAddressAndPort().getAddress();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected void collect(final Stream.Builder<NumericMetric> generationNumberMetri
final InetAddress endpointAddress = endpoint.getAddress();
final EndpointState state = gossiper.getEndpointStateForEndpoint(endpoint);

final Labels labels = metadataFactory.endpointLabels(endpoint.toString(false));
final Labels labels = metadataFactory.endpointLabels(endpointAddress);

generationNumberMetrics.add(new NumericMetric(labels, gossiper.getCurrentGenerationNumber(endpoint)));
downtimeMetrics.add(new NumericMetric(labels, millisecondsToSeconds(gossiper.getEndpointDowntime(endpoint))));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ public Labels endpointLabels(final InetAddress endpoint) {
}

public Labels endpointLabels(final String endpoint) {
return endpointLabels(InetAddresses.forString(endpoint));
// hacky workaround to fix https://github.com/instaclustr/cassandra-exporter/issues/112
String[] parts = endpoint.split("_");
return endpointLabels(InetAddresses.forString(parts[0]));
}

public abstract String clusterName();
Expand Down

0 comments on commit 9327250

Please sign in to comment.