Skip to content

Commit 417794e

Browse files
committed
Ignore errors from feast metric writer
Because this step is not crucial and we do not want to be overwhelmed with unpredictable error to metric store (influx db in this case)
1 parent c8c0623 commit 417794e

3 files changed

Lines changed: 25 additions & 14 deletions

File tree

charts/feast/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apiVersion: v1
2-
appVersion: "0.1.2"
2+
appVersion: "0.1.4"
33
description: A Helm chart to install Feast on kubernetes
44
name: feast
55
version: 0.1.2

charts/feast/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ core:
55
pullPolicy: IfNotPresent
66
registry: gcr.io/kf-feast
77
repository: feast-core
8-
tag: "0.1.1"
8+
tag: "0.1.4"
99
replicaCount: 1
1010
resources:
1111
limits:
@@ -84,7 +84,7 @@ serving:
8484
pullPolicy: IfNotPresent
8585
registry: gcr.io/kf-feast
8686
repository: feast-serving
87-
tag: "0.1.1"
87+
tag: "0.1.4"
8888
replicaCount: 1
8989
resources:
9090
limits:

ingestion/src/main/java/feast/ingestion/transform/WriteFeatureMetricsToInfluxDB.java

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import org.influxdb.InfluxDBFactory;
1616
import org.influxdb.dto.Point;
1717

18+
@SuppressWarnings("CatchMayIgnoreException")
1819
public class WriteFeatureMetricsToInfluxDB
1920
extends PTransform<PCollection<FeatureRowExtended>, PDone> {
2021

@@ -38,9 +39,14 @@ public PDone expand(PCollection<FeatureRowExtended> input) {
3839

3940
@Setup
4041
public void setup() {
41-
influxDB = InfluxDBFactory.connect(influxDbUrl);
42-
influxDB.setDatabase(influxDbDatabase);
43-
influxDB.enableBatch(BatchOptions.DEFAULTS);
42+
try {
43+
influxDB = InfluxDBFactory.connect(influxDbUrl);
44+
influxDB.setDatabase(influxDbDatabase);
45+
influxDB.enableBatch(BatchOptions.DEFAULTS);
46+
} catch (Exception e) {
47+
// Ignored because writing metrics is not a critical component of Feaast
48+
// and we do not want to get overwhelmed with failed connection logs
49+
}
4450
}
4551

4652
@FinishBundle
@@ -60,14 +66,19 @@ public void processElement(
6066
System.currentTimeMillis() / 1000L
6167
- featureRow.getEventTimestamp().getSeconds();
6268
double value = getValue(feature);
63-
influxDB.write(
64-
Point.measurement(influxDbMeasurement)
65-
.time(System.currentTimeMillis(), TimeUnit.MILLISECONDS)
66-
.addField("lag_in_seconds", lagInSeconds)
67-
.addField("value", value)
68-
.tag("feature_id", featureId)
69-
.tag("entity_name", featureRow.getEntityName())
70-
.build());
69+
try {
70+
influxDB.write(
71+
Point.measurement(influxDbMeasurement)
72+
.time(System.currentTimeMillis(), TimeUnit.MILLISECONDS)
73+
.addField("lag_in_seconds", lagInSeconds)
74+
.addField("value", value)
75+
.tag("feature_id", featureId)
76+
.tag("entity_name", featureRow.getEntityName())
77+
.build());
78+
} catch (Exception e) {
79+
// Ignored because writing metrics is not a critical component of Feaast
80+
// and we do not want to get overwhelmed with failed connection logs
81+
}
7182
}
7283
}
7384
}));

0 commit comments

Comments
 (0)