Skip to content

Commit b194519

Browse files
authored
Handle potential NPE (#18966)
1 parent 4c6f520 commit b194519

File tree

1 file changed

+4
-3
lines changed
  • airbyte-metrics/metrics-lib/src/main/java/io/airbyte/metrics/lib

1 file changed

+4
-3
lines changed

airbyte-metrics/metrics-lib/src/main/java/io/airbyte/metrics/lib/MetricTags.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,18 @@ public class MetricTags {
2222
public static final String WORKFLOW_TYPE = "workflow_type";
2323
public static final String ATTEMPT_QUEUE = "attempt_queue";
2424
public static final String GEOGRAPHY = "geography";
25+
public static final String UNKNOWN = "unknown";
2526

2627
public static String getReleaseStage(final ReleaseStage stage) {
27-
return stage.getLiteral();
28+
return stage != null ? stage.getLiteral() : UNKNOWN;
2829
}
2930

3031
public static String getFailureOrigin(final FailureOrigin origin) {
31-
return origin.value();
32+
return origin != null ? origin.value() : UNKNOWN;
3233
}
3334

3435
public static String getJobStatus(final JobStatus status) {
35-
return status.getLiteral();
36+
return status != null ? status.getLiteral() : UNKNOWN;
3637
}
3738

3839
}

0 commit comments

Comments
 (0)