Skip to content

Commit

Permalink
Filter out internal attributes using the internal flag (#78)
Browse files Browse the repository at this point in the history
* filtered out attributes using the internal flag in the getAll method

* corrected mistake in if condition

* filtering out internal attributes

* snyk-scan fix

* same version for netty libs

Co-authored-by: Ankit Choudhary <[email protected]>
  • Loading branch information
ankitchoudhary111 and Ankit Choudhary authored Sep 24, 2021
1 parent 461fe95 commit f060ccc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import javax.inject.Inject;
import javax.inject.Singleton;
import org.hypertrace.core.attribute.service.cachingclient.CachingAttributeClient;
import org.hypertrace.core.attribute.service.v1.AttributeMetadataFilter;
import org.hypertrace.core.graphql.context.GraphQlRequestContext;
import org.hypertrace.core.graphql.spi.config.GraphQlServiceConfig;
import org.hypertrace.core.graphql.utils.grpc.GrpcChannelRegistry;
Expand Down Expand Up @@ -36,6 +37,7 @@ class CachingAttributeStore implements AttributeStore {
channelRegistry.forAddress(
serviceConfig.getAttributeServiceHost(),
serviceConfig.getAttributeServicePort()))
.withAttributeFilter(AttributeMetadataFilter.newBuilder().setInternal(false).build())
.withCacheExpiration(Duration.ofMinutes(5))
.withMaximumCacheContexts(1000)
.build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ void supportsBasicRead() {
AttributeModel spanIdAttribute =
DefaultAttributeModel.builder().scope("SPAN").key("id").build();
AttributeMetadata spanIdResponse =
AttributeMetadata.newBuilder().setScopeString("SPAN").setKey("id").build();
AttributeMetadata.newBuilder()
.setScopeString("SPAN")
.setKey("id")
.setInternal(false)
.build();

when(this.mockAttributeClient.get("SPAN", "id")).thenReturn(Single.just(spanIdResponse));
when(this.mockAttributeModeTranslator.translate(spanIdResponse))
Expand Down
6 changes: 3 additions & 3 deletions hypertrace-core-graphql-platform/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies {
api("org.hypertrace.core.grpcutils:grpc-client-utils:0.6.1")
api("org.hypertrace.core.grpcutils:grpc-client-rx-utils:0.6.1")
api("org.hypertrace.gateway.service:gateway-service-api:0.1.59")
api("org.hypertrace.core.attribute.service:caching-attribute-service-client:0.13.3")
api("org.hypertrace.core.attribute.service:caching-attribute-service-client:0.13.5")

api("com.google.inject:guice:4.2.3")
api("com.graphql-java:graphql-java:15.0")
Expand All @@ -35,10 +35,10 @@ dependencies {

runtime("org.apache.logging.log4j:log4j-slf4j-impl:2.14.0")
runtime("io.grpc:grpc-netty:1.40.0")
runtime("io.netty:netty-codec-http2:4.1.61.Final") {
runtime("io.netty:netty-codec-http2:4.1.68.Final") {
because("https://snyk.io/vuln/SNYK-JAVA-IONETTY-1083991")
}
runtime("io.netty:netty-handler-proxy:4.1.61.Final") {
runtime("io.netty:netty-handler-proxy:4.1.68.Final") {
because("https://snyk.io/vuln/SNYK-JAVA-IONETTY-1083991")
}
}
Expand Down

0 comments on commit f060ccc

Please sign in to comment.