Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
Tag remote hosts for internode communication (#4719)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmaretic authored Apr 20, 2020
1 parent 266aeb0 commit 79b31f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ private CellFilterMetrics() {
public static final String TAG_CURRENT_SUSPECTED_LEADER = "isCurrentSuspectedLeader";
public static final String TAG_CLIENT = "client";
public static final String TAG_PAXOS_USE_CASE = "paxosUseCase";
public static final String TAG_REMOTE_HOST = "remoteHost";

public static final String COORDINATION_LAST_VALID_BOUND = "lastValidBound";
public static final String COORDINATION_CURRENT_TRANSACTIONS_SCHEMA_VERSION = "currentTransactionsSchemaVersion";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

import com.google.common.collect.ImmutableMap;
import com.google.common.net.HostAndPort;
import com.palantir.atlasdb.AtlasDbMetricNames;
import com.palantir.atlasdb.config.AuxiliaryRemotingParameters;
import com.palantir.atlasdb.config.RemotingClientConfigs;
import com.palantir.atlasdb.http.AtlasDbHttpClients;
Expand Down Expand Up @@ -160,7 +161,11 @@ private <T> KeyedStream<String, T> createInstrumentedRemoteProxies(Class<T> claz
.remotingClientConfig(() -> RemotingClientConfigs.DEFAULT)
.shouldSupportBlockingOperations(false)
.build()))
.map(proxy -> AtlasDbMetrics.instrumentWithTaggedMetrics(metrics().getTaggedRegistry(), clazz, proxy));
.map((host, proxy) -> AtlasDbMetrics.instrumentWithTaggedMetrics(
metrics().getTaggedRegistry(),
clazz,
proxy,
any -> ImmutableMap.of(AtlasDbMetricNames.TAG_REMOTE_HOST, host)));
}

private static HostAndPort convertAddressToHostAndPort(String url) {
Expand Down

0 comments on commit 79b31f2

Please sign in to comment.