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

Add clientIP to scheduleInfo API log + chatty log cleanup #659

Merged
merged 1 commit into from
Apr 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public ExecuteStageRequest(
this.schedulingInfo = schedulingInfo;
this.durationType = durationType;
this.heartbeatIntervalSecs = (heartbeatIntervalSecs > 0) ? heartbeatIntervalSecs : DEFAULT_HEARTBEAT_INTERVAL_SECS;
log.info("heartbeat interval {}, using {}", heartbeatIntervalSecs, this.heartbeatIntervalSecs);
log.debug("heartbeat interval {}, using {}", heartbeatIntervalSecs, this.heartbeatIntervalSecs);
this.hasJobMaster = schedulingInfo != null && schedulingInfo.forStage(0) != null;
this.subscriptionTimeoutSecs = subscriptionTimeoutSecs;
this.minRuntimeSecs = minRuntimeSecs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,14 @@ private Route getJobDiscoveryRoutes() {
return route(
get(() -> route(
path(segment("assignmentresults").slash(PathMatchers.segment()), (jobId) ->
parameterOptional(
extractClientIP(clientIp ->
parameterOptional(
StringUnmarshallers.BOOLEAN,
"sendHB",
(sendHeartbeats) -> {
logger.debug(
"/assignmentresults/{} called",
jobId);
"/assignmentresults/{} called by {}",
jobId, clientIp);
schedulingInfoStreamGET.increment();
JobClusterManagerProto.GetJobSchedInfoRequest req =
new JobClusterManagerProto.GetJobSchedInfoRequest(
Expand Down Expand Up @@ -123,7 +124,7 @@ private Route getJobDiscoveryRoutes() {
jobId);
}
});
})
}))
),
path(segment("namedjobs").slash(PathMatchers.segment()), (jobCluster) ->
parameterOptional(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,10 +365,10 @@ private Route getJobInstanceRoute(String jobId) {
private Route getJobInstanceRoute(Optional<String> clusterName, String jobId) {
String endpoint;
if (clusterName.isPresent()) {
logger.info("GET /api/v1/jobClusters/{}/jobs/{} called", clusterName.get(), jobId);
logger.debug("GET /api/v1/jobClusters/{}/jobs/{} called", clusterName.get(), jobId);
endpoint = HttpRequestMetrics.Endpoints.JOB_CLUSTER_INSTANCE_JOBS;
} else {
logger.info("GET /api/v1/jobs/{} called", jobId);
logger.debug("GET /api/v1/jobs/{} called", jobId);
endpoint = HttpRequestMetrics.Endpoints.JOBS;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,13 @@ public Receive createReceive() {
.match(GetClusterUsageResponse.class, this::onGetClusterUsageResponse)
.match(GetClusterIdleInstancesResponse.class, this::onGetClusterIdleInstancesResponse)
.match(GetRuleSetResponse.class,
s -> log.info("[{}] Refreshed rule size: {}", s.getClusterID(), s.getRules().size()))
s -> log.debug("[{}] Refreshed rule size: {}", s.getClusterID(), s.getRules().size()))
.match(SetResourceClusterScalerStatusRequest.class, req -> {
onSetScalerStatus(req);
getSender().tell(Ack.getInstance(), self());
})
.match(ExpireSetScalerStatusRequest.class, this::onExpireSetScalerStatus)
.match(Ack.class, ack -> log.info("Received ack from {}", sender()))
.match(Ack.class, ack -> log.debug("Received ack from {}", sender()))
.build();
}

Expand Down Expand Up @@ -203,7 +203,7 @@ private void onGetClusterUsageResponse(GetClusterUsageResponse usageResponse) {
log.info("Informing scale decision: {}", decisionO.get());
switch (decisionO.get().getType()) {
case ScaleDown:
log.info("Scaling down, fetching idle instances.");
log.info("Scaling down, fetching idle instances: {}.", decisionO.get());
this.numScaleDown.increment();
this.resourceClusterActor.tell(
GetClusterIdleInstancesRequest.builder()
Expand Down Expand Up @@ -274,7 +274,7 @@ private void onTriggerClusterUsageRequest(TriggerClusterUsageRequest req) {
}

private void onTriggerClusterRuleRefreshRequest(TriggerClusterRuleRefreshRequest req) {
log.info("{}: Requesting cluster rule refresh", this.clusterId);
log.debug("{}: Requesting cluster rule refresh", this.clusterId);
this.fetchRuleSet();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ akka {

# Enables/disables the addition of a `Remote-Address` header
# holding the clients (remote) IP address.
remote-address-header = off
remote-address-header = on

# Enables/disables the addition of a `Raw-Request-URI` header holding the
# original raw request URI as the client has sent it.
Expand Down Expand Up @@ -1794,4 +1794,4 @@ akka {
}
}

}
}
Loading