Skip to content

Commit f060ccc

Browse files
ankitchoudhary111Ankit Choudhary
and
Ankit Choudhary
authored
Filter out internal attributes using the internal flag (#78)
* 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]>
1 parent 461fe95 commit f060ccc

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

hypertrace-core-graphql-attribute-store/src/main/java/org/hypertrace/core/graphql/attributes/CachingAttributeStore.java

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import javax.inject.Inject;
88
import javax.inject.Singleton;
99
import org.hypertrace.core.attribute.service.cachingclient.CachingAttributeClient;
10+
import org.hypertrace.core.attribute.service.v1.AttributeMetadataFilter;
1011
import org.hypertrace.core.graphql.context.GraphQlRequestContext;
1112
import org.hypertrace.core.graphql.spi.config.GraphQlServiceConfig;
1213
import org.hypertrace.core.graphql.utils.grpc.GrpcChannelRegistry;
@@ -36,6 +37,7 @@ class CachingAttributeStore implements AttributeStore {
3637
channelRegistry.forAddress(
3738
serviceConfig.getAttributeServiceHost(),
3839
serviceConfig.getAttributeServicePort()))
40+
.withAttributeFilter(AttributeMetadataFilter.newBuilder().setInternal(false).build())
3941
.withCacheExpiration(Duration.ofMinutes(5))
4042
.withMaximumCacheContexts(1000)
4143
.build());

hypertrace-core-graphql-attribute-store/src/test/java/org/hypertrace/core/graphql/attributes/CachingAttributeStoreTest.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ void supportsBasicRead() {
5353
AttributeModel spanIdAttribute =
5454
DefaultAttributeModel.builder().scope("SPAN").key("id").build();
5555
AttributeMetadata spanIdResponse =
56-
AttributeMetadata.newBuilder().setScopeString("SPAN").setKey("id").build();
56+
AttributeMetadata.newBuilder()
57+
.setScopeString("SPAN")
58+
.setKey("id")
59+
.setInternal(false)
60+
.build();
5761

5862
when(this.mockAttributeClient.get("SPAN", "id")).thenReturn(Single.just(spanIdResponse));
5963
when(this.mockAttributeModeTranslator.translate(spanIdResponse))

hypertrace-core-graphql-platform/build.gradle.kts

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dependencies {
99
api("org.hypertrace.core.grpcutils:grpc-client-utils:0.6.1")
1010
api("org.hypertrace.core.grpcutils:grpc-client-rx-utils:0.6.1")
1111
api("org.hypertrace.gateway.service:gateway-service-api:0.1.59")
12-
api("org.hypertrace.core.attribute.service:caching-attribute-service-client:0.13.3")
12+
api("org.hypertrace.core.attribute.service:caching-attribute-service-client:0.13.5")
1313

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

3636
runtime("org.apache.logging.log4j:log4j-slf4j-impl:2.14.0")
3737
runtime("io.grpc:grpc-netty:1.40.0")
38-
runtime("io.netty:netty-codec-http2:4.1.61.Final") {
38+
runtime("io.netty:netty-codec-http2:4.1.68.Final") {
3939
because("https://snyk.io/vuln/SNYK-JAVA-IONETTY-1083991")
4040
}
41-
runtime("io.netty:netty-handler-proxy:4.1.61.Final") {
41+
runtime("io.netty:netty-handler-proxy:4.1.68.Final") {
4242
because("https://snyk.io/vuln/SNYK-JAVA-IONETTY-1083991")
4343
}
4444
}

0 commit comments

Comments
 (0)