Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing key count metric #816

Merged
merged 3 commits into from
Jun 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public GetOnlineFeaturesResponse getOnlineFeatures(GetOnlineFeaturesRequest requ
entityStatusesMap.get(entityRow).putAll(statusMap);

// Populate metrics/log request
populateStaleKeyCountMetrics(statusMap, featureSetRequest);
populateCountMetrics(statusMap, featureSetRequest);
});
populateRequestCountMetrics(featureSetRequest);
logFeatureRows.add(featureRows);
Expand Down Expand Up @@ -287,7 +287,7 @@ private void logFeatureRowsTrace(
scope.span().log(ImmutableMap.of("event", "featureRows", "value", loggableFeatureRows));
}

private void populateStaleKeyCountMetrics(
private void populateCountMetrics(
Map<String, FieldStatus> statusMap, FeatureSetRequest featureSetRequest) {
String project = featureSetRequest.getSpec().getProject();
statusMap
Expand All @@ -296,6 +296,9 @@ private void populateStaleKeyCountMetrics(
es -> {
String featureRefString = es.getKey();
FieldStatus status = es.getValue();
if (status == FieldStatus.NOT_FOUND) {
Metrics.notFoundKeyCount.labels(project, featureRefString).inc();
}
if (status == FieldStatus.OUTSIDE_MAX_AGE) {
Metrics.staleKeyCount.labels(project, featureRefString).inc();
}
Expand Down
12 changes: 2 additions & 10 deletions serving/src/main/java/feast/serving/util/Metrics.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,14 @@ public class Metrics {
.labelNames("project", "feature_name")
.register();

public static final Counter missingKeyCount =
public static final Counter notFoundKeyCount =
Counter.build()
.name("missing_feature_count")
.name("not_found_feature_count")
.subsystem("feast_serving")
.help("number requested feature rows that were not found")
.labelNames("project", "feature_name")
.register();

public static final Counter invalidEncodingCount =
Counter.build()
.name("invalid_encoding_feature_count")
.subsystem("feast_serving")
.help("number requested feature rows that were stored with the wrong encoding")
.labelNames("project", "feature_name")
.register();

public static final Counter staleKeyCount =
Counter.build()
.name("stale_feature_count")
Expand Down