Skip to content

Commit

Permalink
fix(metric): Correctly indicate execution type in execution metrics (s…
Browse files Browse the repository at this point in the history
  • Loading branch information
marchello2000 authored Aug 6, 2020
1 parent 69b33e1 commit 837207a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void beforeExecution(Persister persister, PipelineExecution execution) {
Id id =
registry
.createId("executions.started")
.withTag("executionType", execution.getClass().getSimpleName().toLowerCase())
.withTag("executionType", execution.getType().toString())
.withTag("application", execution.getApplication().toLowerCase());

registry.counter(id).increment();
Expand Down Expand Up @@ -68,7 +68,7 @@ public void afterExecution(
Id id =
registry
.createId("executions.totalTime")
.withTag("executionType", "orchestration")
.withTag("executionType", execution.getType().toString())
.withTag("successful", Boolean.valueOf(wasSuccessful).toString())
.withTag("application", execution.getApplication().toLowerCase());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.netflix.spectator.api.Id;
import com.netflix.spectator.api.Registry;
import com.netflix.spinnaker.orca.api.pipeline.models.ExecutionStatus;
import com.netflix.spinnaker.orca.api.pipeline.models.ExecutionType;
import com.netflix.spinnaker.orca.api.pipeline.models.PipelineExecution;
import com.netflix.spinnaker.orca.pipeline.persistence.ExecutionRepository;
import java.util.HashMap;
Expand Down Expand Up @@ -58,7 +59,10 @@ public EnhancedMonitoringConfiguration(
Id runningOrchestrationsId =
registry
.createId("executions.running")
.withTag("executionType", "Orchestration"); // similar to what MetricsTagHelper is doing
.withTag(
"executionType",
ExecutionType.ORCHESTRATION
.toString()); // similar to what MetricsTagHelper is doing

for (String application : configuration.getApplications()) {
Id applicationSpecificId = runningOrchestrationsId.withTag("application", application);
Expand Down

0 comments on commit 837207a

Please sign in to comment.