CanaryAnalysisExecutionStatusResponse.CanaryAnalysisExecutionStatusResponseBuilder responseBuilder = CanaryAnalysisExecutionStatusResponse.builder() .application(pipeline.getApplication()) .pipelineId(pipeline.getId()) .stageStatus(pipeline.getStages()
@Override public void checkRunnable(Execution pipeline) { if (front50Service == null) { throw new UnsupportedOperationException("Front50 not enabled, no way to validate pipeline. Fix this by setting front50.enabled: true"); } List<Map<String, Object>> pipelines = isStrategy(pipeline) ? front50Service.getStrategies(pipeline.getApplication()) : front50Service.getPipelines(pipeline.getApplication(), false); pipelines .stream() .filter(it -> it.get("id").equals(pipeline.getPipelineConfigId())) .findFirst() .ifPresent(it -> { if ((boolean) it.getOrDefault("disabled", false)) { throw new PipelineIsDisabled(it.get("id").toString(), it.get("application").toString(), it.get("name").toString()); } }); }
@Override public void beforeExecution(Persister persister, Execution execution) { if (execution.getApplication() == null) { return; } Id id = registry .createId("executions.started") .withTag("executionType", execution.getClass().getSimpleName().toLowerCase()) .withTag("application", execution.getApplication().toLowerCase()); registry.counter(id).increment(); }
private String render(String templateString, Execution pipeline) { DefaultRenderContext rc = new DefaultRenderContext(pipeline.getApplication(), null, mapper.convertValue(pipeline.getTrigger(), Map.class)); return renderer.render(templateString, rc); }
@Override public Object get(@Nullable Object key) { Object value = super.get(key); if (value != null) { log.warn( "Global context key \"{}\" accessed by {} {}[{}] \"{}\"", key, execution.getApplication(), execution.getType(), execution.getId(), Optional.ofNullable(execution.getName()).orElseGet(execution::getDescription) ); Id counterId = registry .createId("global.context.access") .withTag("application", execution.getApplication()) .withTag("key", String.valueOf(key)); registry .counter(counterId) .increment(); } return value; } }
value.put("executionId", execution.getId()); value.put("executionType", execution.getType().toString()); value.put("application", execution.getApplication()); execution.getApplication(), account, cluster,
protected Map<String, String> serializeExecution(@Nonnull Execution execution) { Map<String, String> map = new HashMap<>(); try { map.put("application", execution.getApplication()); map.put("canceled", String.valueOf(execution.isCanceled())); map.put("limitConcurrent", String.valueOf(execution.isLimitConcurrent()));
@Override public void afterExecution(Persister persister, Execution execution, ExecutionStatus executionStatus, boolean wasSuccessful) { if (execution.getType() != ORCHESTRATION) { // not concerned with pipelines right now (pipelines can have wait stages / manual judgments which skew execution time) return; } if (execution.getApplication() == null || execution.getStartTime() == null || execution.getEndTime() == null) { // should normally have all attributes but a guard just in case return; } Id id = registry .createId("executions.totalTime") .withTag("executionType", "orchestration") .withTag("successful", Boolean.valueOf(wasSuccessful).toString()) .withTag("application", execution.getApplication().toLowerCase()); registry.timer(id).record(execution.getEndTime() - execution.getStartTime(), TimeUnit.MILLISECONDS); } }
.createId("executions.deserialization.error") .withTag("executionType", execution.getType().toString()) .withTag("application", execution.getApplication());
CanaryAnalysisExecutionStatusResponse.CanaryAnalysisExecutionStatusResponseBuilder responseBuilder = CanaryAnalysisExecutionStatusResponse.builder() .application(pipeline.getApplication()) .pipelineId(pipeline.getId()) .stageStatus(pipeline.getStages()
c.sadd(appKey(execution.getType(), execution.getApplication()), execution.getId());