Skip to content
Merged
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 @@ -122,6 +122,18 @@ protected boolean canResolveBackend(StructuredTraceGraph structuredTraceGraph, E
return true;
}

/**
* Method to check if backend uri is valid or not. This will enable any custom logic to be
* inserted in the implementing classes.
*
* @param backendURI backend URI information
* @return true if backend uri resolution is allowed
*/
protected boolean isValidBackendUri(String backendURI) {
// by default allow the backend uri to proceed
return true;
}

/** Checks if the candidateEntity is indeed a backend Entity */
private boolean isValidBackendEntity(
StructuredTrace trace, Event backendSpan, BackendInfo candidateInfo) {
Expand Down Expand Up @@ -311,8 +323,11 @@ public Optional<BackendInfo> resolve(
}

String backendUri = maybeBackendUri.get();
final Builder entityBuilder = getEntityBuilder(trace, event, type, backendUri);
if (!isValidBackendUri(backendUri)) {
return Optional.empty();
}

final Builder entityBuilder = getEntityBuilder(trace, event, type, backendUri);
backendProvider.getEntityAttributes(event).forEach(entityBuilder::putAttributes);
Map<String, org.hypertrace.core.datamodel.AttributeValue> enrichedAttributes =
new HashMap<>();
Expand Down