Skip to content

Commit

Permalink
control-service: reduce logging (#2834)
Browse files Browse the repository at this point in the history
Why
Reducing unnecessary logging caused by the frequent async data jobs
deployment scheduled every minute.

```
2023-10-25 11:46:29,056 DEBUG [OpId:] ecutor-200 c.v.t.s.diag.telemetry.Telemetry Sending streaming telemetry to https://vcsa.vmware.com/ph-stg/api/hyper/send?_c=taurus.v0&_i=supecollider-control-service
2023-10-25 11:46:29,063 DEBUG [OpId:] ecutor-199 .t.s.k.DataJobsKubernetesService Datajob template file location is not set. Using internal datajob template.
2023-10-25 11:46:29,065 DEBUG [OpId:] ecutor-199 c.v.t.s.d.m.MetricsHelper        Failed to convert object to json: class java.util.LinkedHashMap: failed to lazily initialize a collection of role: com.vmware.taurus.service.model.DataJob.executions, could not initialize proxy - no Session (through reference chain: java.util.LinkedHashMap["data_job"]->com.vmware.taurus.service.model.DataJob["executions"])
2023-10-25 11:46:29,065 DEBUG [OpId:] ecutor-199 c.v.t.s.diag.telemetry.Telemetry Sending streaming telemetry to https://vcsa.vmware.com/ph-stg/api/hyper/send?_c=taurus.v0&_i=supecollider-control-service
2023-10-25 11:46:29,066 DEBUG [OpId:] ecutor-199 c.v.t.s.d.m.MetricsHelper        Failed to convert object to json: class java.util.LinkedHashMap: failed to lazily initialize a collection of role: com.vmware.taurus.service.model.DataJob.executions, could not initialize proxy - no Session (through reference chain: java.util.LinkedHashMap["deployment"]->com.vmware.taurus.service.model.DesiredDataJobDeployment["dataJob"]->com.vmware.taurus.service.model.DataJob["executions"])
2023-10-25 11:46:29,066 DEBUG [OpId:] ecutor-199 c.v.t.s.diag.telemetry.Telemetry Sending streaming telemetry to https://vcsa.vmware.com/ph-stg/api/hyper/send?_c=taurus.v0&_i=supecollider-control-service
2023-10-25 11:46:29,097 DEBUG [OpId:] ecutor-198 .t.s.k.DataJobsKubernetesService Datajob template file location is not set. Using internal datajob template.
```

What
Adjusted the logging levels for specific log statements.

Signed-off-by: Miroslav Ivanov [email protected]

Signed-off-by: Miroslav Ivanov [email protected]
  • Loading branch information
mivanov1988 authored Oct 25, 2023
1 parent ff1156a commit abffdf8
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private static String serializeObject(Object obj) {
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
result = mapper.writeValueAsString(obj);
} catch (JsonProcessingException e) {
log.debug("Failed to convert object to json: {}: {}", obj.getClass(), e.getMessage());
log.trace("Failed to convert object to json: {}: {}", obj.getClass(), e.getMessage());
result = "" + obj;
}
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void sendAsync(String payload) {
if (StringUtils.isBlank(this.telemetryEndpoint)) {
return;
}
log.debug("Sending streaming telemetry to {}", telemetryEndpoint);
log.trace("Sending streaming telemetry to {}", telemetryEndpoint);
HttpResponse.BodyHandler<String> handler = HttpResponse.BodyHandlers.ofString();

HttpRequest request =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ protected boolean getK8sSupportsV1CronJob() {

private V1CronJob loadV1CronjobTemplate() {
if (StringUtils.isEmpty(datajobTemplateFileLocation)) {
log.debug("Datajob template file location is not set. Using internal datajob template.");
log.trace("Datajob template file location is not set. Using internal datajob template.");
return loadInternalV1CronjobTemplate();
}
V1CronJob cronjobTemplate = loadConfigurableV1CronjobTemplate();
Expand All @@ -240,7 +240,7 @@ private V1CronJob loadV1CronjobTemplate() {

private V1beta1CronJob loadV1beta1CronjobTemplate() {
if (StringUtils.isEmpty(datajobTemplateFileLocation)) {
log.debug("Datajob template file location is not set. Using internal datajob template.");
log.trace("Datajob template file location is not set. Using internal datajob template.");
return loadInternalV1beta1CronjobTemplate();
}
V1beta1CronJob cronjobTemplate = loadConfigurableV1beta1CronjobTemplate();
Expand Down Expand Up @@ -278,7 +278,7 @@ private V1CronJob loadInternalV1CronjobTemplate() {
private V1beta1CronJob loadConfigurableV1beta1CronjobTemplate() {
// Check whether to use configurable datajob template at all.
if (StringUtils.isEmpty(datajobTemplateFileLocation)) {
log.debug("Datajob template file location is not set.");
log.trace("Datajob template file location is not set.");
return null;
}

Expand All @@ -295,7 +295,7 @@ private V1beta1CronJob loadConfigurableV1beta1CronjobTemplate() {
private V1CronJob loadConfigurableV1CronjobTemplate() {
// Check whether to use configurable datajob template at all.
if (StringUtils.isEmpty(datajobTemplateFileLocation)) {
log.debug("Datajob template file location is not set.");
log.trace("Datajob template file location is not set.");
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void updateDeployment(

if (DeploymentStatus.USER_ERROR.equals(desiredJobDeployment.getStatus())
|| DeploymentStatus.PLATFORM_ERROR.equals(desiredJobDeployment.getStatus())) {
log.debug(
log.trace(
"Skipping the data job [job_name={}] deployment due to the previously failed deployment"
+ " [status={}]",
dataJob.getName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public Set<String> listCronJobs() throws ApiException {
v1BetaCronJobs.getItems().stream()
.map(j -> j.getMetadata().getName())
.collect(Collectors.toSet());
log.debug("K8s V1Beta cron jobs: {}", v1BetaCronJobNames);
log.trace("K8s V1Beta cron jobs: {}", v1BetaCronJobNames);
return Stream.concat(v1CronJobNames.stream(), v1BetaCronJobNames.stream())
.collect(Collectors.toSet());
}
Expand Down

0 comments on commit abffdf8

Please sign in to comment.