Skip to content

Commit

Permalink
remove metrics - only use logs to track
Browse files Browse the repository at this point in the history
  • Loading branch information
liyaqin1 committed Feb 8, 2024
1 parent 7294c18 commit 8b631f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@

import com.fasterxml.jackson.databind.ObjectMapper;

import io.micrometer.core.instrument.Metrics;

public class GoalAnalyst {
private static final Logger LOG = LoggerFactory.getLogger(GoalAnalyst.class);
// Define lower value for hotfix and rollback priority to make sure they deploy first
Expand Down Expand Up @@ -566,14 +564,12 @@ void process(String envId, EnvironBean env, PingReportBean report, AgentBean age
hostTagBean.setEnv_id(envId);
hostTagBean.setCreate_date(System.currentTimeMillis());
hostTagDAO.insertOrUpdate(hostTagBean);
Metrics.counter("ec2TagsByDeployd", "create", "yes", "tagName", tagName, "tagValue", tagValue, "envName", env.getEnv_name(), "stageName", env.getStage_name(), "hostName", host).increment();
LOG.debug("insert host_tags with env id {}, host id {}, tag name {}, tag value {}", envId, host_id, tagName, tagValue);
LOG.debug("Create host tags from Deployd: insert host_tags with env id {}, host id {}, tag name {}, tag value {}", envId, host_id, tagName, tagValue);
} else if (tagValue.equals(hostTagBean.getTag_value()) == false) {
hostTagBean.setTag_value(tagValue);
hostTagBean.setCreate_date(System.currentTimeMillis());
hostTagDAO.insertOrUpdate(hostTagBean);
Metrics.counter("ec2TagsByDeployd", "create", "no", "tagName", tagName, "tagValue", tagValue, "envName", env.getEnv_name(), "stageName", env.getStage_name(), "hostName", host).increment();
LOG.debug("update host_tags with env id {}, host id {}, tag name {}, tag value {}", envId, host_id, tagName, tagValue);
LOG.debug("Update host tags from Deployd: update host_tags with env id {}, host id {}, tag name {}, tag value {}", envId, host_id, tagName, tagValue);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.concurrent.TimeUnit;

import io.micrometer.core.instrument.Counter;
import io.micrometer.core.instrument.Metrics;

public class DeployTagWorker implements Runnable {
private static final Logger LOG = LoggerFactory.getLogger(DeployTagWorker.class);
Expand Down Expand Up @@ -118,7 +117,7 @@ private void processEachEnvironConstraint(DeployConstraintBean bean) throws Exce
hostTagBean.setEnv_id(envId);
hostTagBean.setCreate_date(System.currentTimeMillis());
statements.add(hostTagDAO.genInsertOrUpdate(hostTagBean));
Metrics.counter("ec2TagsByWorker", "tagName", tagName, "tagValue", tagValue, "envName", environBean.getEnv_name(), "stageName", environBean.getStage_name(), "hostId", hostId).increment();
LOG.debug("Create host tags from CMDB: insert host_tags with env id {}, host id {}, tag name {}, tag value {}", envId, host_id, tagName, tagValue);
}
}
}
Expand Down

0 comments on commit 8b631f5

Please sign in to comment.