Skip to content
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
2 changes: 1 addition & 1 deletion hypertrace-ingester/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dependencies {
implementation("org.hypertrace.core.kafkastreams.framework:kafka-streams-framework:0.1.9")
implementation("org.hypertrace.core.serviceframework:platform-service-framework:0.1.9")
implementation("org.hypertrace.core.serviceframework:platform-metrics:0.1.8")
implementation("org.hypertrace.core.datamodel:data-model:0.1.9")
implementation("org.hypertrace.core.datamodel:data-model:0.1.12")
implementation("org.hypertrace.core.viewgenerator:view-generator-framework:0.1.14")
implementation("com.typesafe:config:1.4.0")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ sourceSets {
dependencies {
api("com.google.protobuf:protobuf-java-util:3.13.0")

implementation("org.hypertrace.core.datamodel:data-model:0.1.9")
implementation("org.hypertrace.core.datamodel:data-model:0.1.12")
implementation(project(":span-normalizer:raw-span-constants"))
implementation(project(":span-normalizer:span-normalizer-constants"))
implementation("org.hypertrace.entity.service:entity-service-api:0.1.23")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ tasks.test {

dependencies {
implementation(project(":hypertrace-trace-enricher:enriched-span-constants"))
implementation("org.hypertrace.core.datamodel:data-model:0.1.9")
implementation("org.hypertrace.core.datamodel:data-model:0.1.12")

implementation("org.slf4j:slf4j-api:1.7.30")
implementation("org.apache.commons:commons-lang3:3.11")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies {
implementation(project(":semantic-convention-utils"))
implementation(project(":hypertrace-trace-enricher:trace-reader"))

implementation("org.hypertrace.core.datamodel:data-model:0.1.9")
implementation("org.hypertrace.core.datamodel:data-model:0.1.12")
implementation("org.hypertrace.entity.service:entity-service-client:0.1.23")
implementation("org.hypertrace.core.serviceframework:platform-metrics:0.1.18")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,29 +153,29 @@ private Optional<String> getGrpcAuthority(Event event) {

private Optional<String> getSanitizedHostValue(String value) {
if (StringUtils.isNotBlank(value)) {
String host = sanitizeHostValue(value);
if (!LOCALHOST.equalsIgnoreCase(host)) {
return Optional.of(host);
Optional<String> host = sanitizeHostValue(value);
if (host.isPresent() && !LOCALHOST.equalsIgnoreCase(host.get())) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need conditon - StringUtils.isEmpty(host.get()) - for case where host is not null but an empty "" string?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

equalsIgnoreCase() will take care of those.

return host;
}
}
return Optional.empty();
}

private String sanitizeHostValue(String host) {
private Optional<String> sanitizeHostValue(String host) {
if (host.contains(COLON) && !host.startsWith(COLON)) {
return COLON_SPLITTER.splitToList(host).get(0);
return Optional.ofNullable(COLON_SPLITTER.splitToList(host).get(0));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here host is coming as null or as an empty string "", will that handle an empty string case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If host is empty, it shouldn't even match host.contains(COLON) right?

}

// the value is a URL, just return the authority part of it.
try {
URI uri = new URI(host);
if (uri.getScheme() != null) {
return uri.getHost();
return Optional.ofNullable(uri.getHost());
}
return host;
return Optional.of(host);
} catch (URISyntaxException ignore) {
// ignore
return host;
return Optional.empty();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,16 @@ public void testEnrichEventWithAuthorityHeader() {
Assertions.assertEquals(EnrichedSpanUtils.getHostHeader(innerEntrySpan), "testHost");
}

@Test
public void testEnrichEventWithIncompleteAuthorityHeader() {
// Try with :port since that seems to be a valid value for some authority headers.
addEnrichedAttributeToEvent(innerEntrySpan,
RawSpanConstants.getValue(org.hypertrace.core.span.constants.v1.Http.HTTP_REQUEST_AUTHORITY_HEADER),
AttributeValueCreator.create(":9000"));
target.enrichEvent(trace, innerEntrySpan);
Assertions.assertNull(EnrichedSpanUtils.getHostHeader(innerEntrySpan));
}

@Test
public void testEnrichEventWithHostHeader() {
addEnrichedAttributeToEvent(innerEntrySpan,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ dependencies {
}

implementation(project(":hypertrace-trace-enricher:hypertrace-trace-enricher-impl"))
implementation("org.hypertrace.core.datamodel:data-model:0.1.9")
implementation("org.hypertrace.core.datamodel:data-model:0.1.12")
implementation("org.hypertrace.core.flinkutils:flink-utils:0.1.6")
implementation("org.hypertrace.core.serviceframework:platform-service-framework:0.1.18")
implementation("org.hypertrace.entity.service:entity-service-client:0.1.23")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

dependencies {
implementation("org.hypertrace.core.datamodel:data-model:0.1.9")
implementation("org.hypertrace.core.datamodel:data-model:0.1.12")

implementation("org.json:json:20201115")
implementation("org.apache.commons:commons-lang3:3.11")
Expand Down
2 changes: 1 addition & 1 deletion hypertrace-trace-enricher/trace-reader/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

dependencies {
implementation("org.hypertrace.core.datamodel:data-model:0.1.9")
implementation("org.hypertrace.core.datamodel:data-model:0.1.12")
implementation("org.hypertrace.core.attribute.service:attribute-service-api:0.8.7")
implementation("org.hypertrace.core.attribute.service:caching-attribute-service-client:0.8.7")
implementation("org.hypertrace.core.attribute.service:attribute-projection-registry:0.8.7")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ sourceSets {
}

dependencies {
api( "org.apache.avro:avro:1.9.2")
api( "org.apache.avro:avro:1.10.1")
}

Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ dependencies {

// TODO: migrate in core
implementation("org.hypertrace.core.viewgenerator:view-generator-framework:0.1.19")
implementation("org.hypertrace.core.datamodel:data-model:0.1.10")
implementation("org.hypertrace.core.datamodel:data-model:0.1.12")
implementation("org.hypertrace.core.serviceframework:platform-metrics:0.1.18")

implementation("org.hypertrace.entity.service:entity-service-api:0.1.21")

implementation("org.apache.avro:avro:1.9.2")
implementation("org.apache.avro:avro:1.10.1")
implementation("org.apache.commons:commons-lang3:3.11")

testImplementation("org.junit.jupiter:junit-jupiter:5.7.0")
Expand Down
2 changes: 1 addition & 1 deletion raw-spans-grouper/raw-spans-grouper/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ tasks.test {

dependencies {
implementation(project(":span-normalizer:span-normalizer-api"))
implementation("org.hypertrace.core.datamodel:data-model:0.1.10")
implementation("org.hypertrace.core.datamodel:data-model:0.1.12")
implementation("org.hypertrace.core.serviceframework:platform-service-framework:0.1.18")
implementation("org.hypertrace.core.serviceframework:platform-metrics:0.1.18")

Expand Down
2 changes: 1 addition & 1 deletion semantic-convention-utils/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies {
implementation(project(":span-normalizer:raw-span-constants"))
implementation(project(":span-normalizer:span-normalizer-constants"))

implementation("org.hypertrace.core.datamodel:data-model:0.1.9")
implementation("org.hypertrace.core.datamodel:data-model:0.1.12")
implementation("org.hypertrace.entity.service:entity-service-client:0.1.23")

implementation("org.apache.commons:commons-lang3:3.11")
Expand Down
2 changes: 1 addition & 1 deletion span-normalizer/span-normalizer-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ sourceSets {
}
dependencies {
api("com.google.api.grpc:proto-google-common-protos:1.12.0")
api( "org.apache.avro:avro:1.9.2")
api( "org.apache.avro:avro:1.10.1")
}
2 changes: 1 addition & 1 deletion span-normalizer/span-normalizer/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dependencies {
implementation(project(":span-normalizer:span-normalizer-constants"))
implementation(project(":semantic-convention-utils"))

implementation("org.hypertrace.core.datamodel:data-model:0.1.10")
implementation("org.hypertrace.core.datamodel:data-model:0.1.12")
implementation("org.hypertrace.core.serviceframework:platform-service-framework:0.1.18")
implementation("org.hypertrace.core.serviceframework:platform-metrics:0.1.18")
implementation("org.hypertrace.core.kafkastreams.framework:kafka-streams-framework:0.1.13")
Expand Down