-
Notifications
You must be signed in to change notification settings - Fork 16
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
Support service correlation for mirroring spans #431
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #431 +/- ##
============================================
- Coverage 79.88% 79.53% -0.36%
- Complexity 1419 1427 +8
============================================
Files 128 130 +2
Lines 5569 5692 +123
Branches 512 533 +21
============================================
+ Hits 4449 4527 +78
- Misses 884 912 +28
- Partials 236 253 +17
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
...c/main/java/org/hypertrace/traceenricher/enrichedspan/constants/utils/EnrichedSpanUtils.java
Outdated
Show resolved
Hide resolved
...spans-grouper/src/main/java/org/hypertrace/core/rawspansgrouper/RawSpanGrouperConstants.java
Outdated
Show resolved
Hide resolved
...per/raw-spans-grouper/src/main/java/org/hypertrace/core/rawspansgrouper/RawSpansGrouper.java
Outdated
Show resolved
Hide resolved
...r/raw-spans-grouper/src/main/java/org/hypertrace/core/rawspansgrouper/RawSpansProcessor.java
Outdated
Show resolved
Hide resolved
...r/raw-spans-grouper/src/main/java/org/hypertrace/core/rawspansgrouper/RawSpansProcessor.java
Outdated
Show resolved
Hide resolved
...r/raw-spans-grouper/src/main/java/org/hypertrace/core/rawspansgrouper/RawSpansProcessor.java
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
...src/main/java/org/hypertrace/traceenricher/enrichedspan/constants/EnrichedSpanConstants.java
Show resolved
Hide resolved
...spans-grouper/src/main/java/org/hypertrace/core/rawspansgrouper/RawSpanGrouperConstants.java
Outdated
Show resolved
Hide resolved
...per/raw-spans-grouper/src/main/java/org/hypertrace/core/rawspansgrouper/RawSpansGrouper.java
Outdated
Show resolved
Hide resolved
...r/raw-spans-grouper/src/main/java/org/hypertrace/core/rawspansgrouper/RawSpansProcessor.java
Outdated
Show resolved
Hide resolved
...r/raw-spans-grouper/src/main/java/org/hypertrace/core/rawspansgrouper/RawSpansProcessor.java
Outdated
Show resolved
Hide resolved
...r/raw-spans-grouper/src/main/java/org/hypertrace/core/rawspansgrouper/RawSpansProcessor.java
Outdated
Show resolved
Hide resolved
...r/raw-spans-grouper/src/main/java/org/hypertrace/core/rawspansgrouper/RawSpansProcessor.java
Outdated
Show resolved
Hide resolved
...r/raw-spans-grouper/src/main/java/org/hypertrace/core/rawspansgrouper/RawSpansProcessor.java
Outdated
Show resolved
Hide resolved
span-normalizer/span-normalizer-api/src/main/avro/trace-identity/IpIdentity.avdl
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
...raw-spans-grouper/src/main/java/org/hypertrace/core/rawspansgrouper/IpIdentityValidator.java
Outdated
Show resolved
Hide resolved
...w-spans-grouper/src/main/java/org/hypertrace/core/rawspansgrouper/PeerIdentityValidator.java
Outdated
Show resolved
Hide resolved
...w-spans-grouper/src/main/java/org/hypertrace/core/rawspansgrouper/PeerIdentityValidator.java
Outdated
Show resolved
Hide resolved
...spans-grouper/src/main/java/org/hypertrace/core/rawspansgrouper/RawSpanGrouperConstants.java
Show resolved
Hide resolved
@@ -0,0 +1,6 @@ | |||
@namespace("org.hypertrace.core.spannormalizer") | |||
protocol SpanMetadataProtocol { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move it to raw-spans-grouper
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is plan to merge grouper and normaliser, so keeping it together for now.
@@ -0,0 +1,15 @@ | |||
@namespace("org.hypertrace.core.spannormalizer") | |||
protocol PeerIdentityProtocol { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same move to raw spans grouper
HexUtils.getHex(event.getEventId()), | ||
event.getServiceName()); | ||
|
||
event |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we should add this in enrichedAttributes not attribute map. @skjindal93 I believe enriched attributes are for anything that traceable resolves and add to the span
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adding to enriched attributes since we changed the attribute name to PEER_SERVICE_NAME
...r/raw-spans-grouper/src/main/java/org/hypertrace/core/rawspansgrouper/RawSpansProcessor.java
Outdated
Show resolved
Hide resolved
...r/raw-spans-grouper/src/main/java/org/hypertrace/core/rawspansgrouper/RawSpansProcessor.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
String agentType = | ||
attributeMap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have access to EnrichedSpanUtils here? it generally has all this functions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but that is enriched attribute right? here we will not have the enriched attributes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the SpanAttributeUtils.getStringAttributeWithDefault()
...r/raw-spans-grouper/src/main/java/org/hypertrace/core/rawspansgrouper/RawSpansProcessor.java
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
...c/main/java/org/hypertrace/traceenricher/enrichedspan/constants/utils/EnrichedSpanUtils.java
Outdated
Show resolved
Hide resolved
@@ -33,6 +33,8 @@ dependencies { | |||
because("https://snyk.io/vuln/SNYK-JAVA-ORGGLASSFISHJERSEYCORE-1255637") | |||
} | |||
implementation(project(":span-normalizer:span-normalizer-api")) | |||
implementation(project(":semantic-convention-utils")) | |||
implementation(project(":hypertrace-trace-enricher:enriched-span-constants")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this changes should be part of Trace-Enricher.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We introduced new Attrs in EnrichedSpanConstants
and populating them here. So, added dependency
...spans-grouper/src/main/java/org/hypertrace/core/rawspansgrouper/RawSpanGrouperConstants.java
Show resolved
Hide resolved
...r/raw-spans-grouper/src/main/java/org/hypertrace/core/rawspansgrouper/RawSpansProcessor.java
Outdated
Show resolved
Hide resolved
Timestamps timestamps = | ||
traceLatencyMeter.trackEndToEndLatencyTimestamps( | ||
currentTimeMs, firstEntry ? currentTimeMs : traceState.getTraceStartTimestamp()); | ||
StructuredTrace trace = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We build structureTrace in two places - 1) TraceEmitPuncutator 2) Bypass condition.
This seems a third place. What is the condition for this - it's not very clear. Will the same trace be also emitted via TraceEmitPuncuator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the same trace be also emitted via TraceEmitPuncuator as we return in the caller function:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a comment
...r/raw-spans-grouper/src/main/java/org/hypertrace/core/rawspansgrouper/RawSpansProcessor.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/hypertrace/semantic/convention/utils/http/HttpSemanticConventionUtils.java
Show resolved
Hide resolved
|
||
peer.correlation = { | ||
enabled.customers = ["*"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a separate var: enable.all.customers = true
or false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the test app.conf
, so added *
in config. In the actual app.conf
it is empty. What is the need of enable.all.customers
, we can handle both using the same config.
@@ -0,0 +1,14 @@ | |||
@namespace("org.hypertrace.core.spannormalizer") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This requires in raw-spans-grouper. Shouldn't this be part of raw-spans-grouper
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There were some avros also like: TraceState
defined here that were getting used in raw-spans-grouper, so introduced them in a common place. What was the idea behind defining them earlier here? Should we move rest of them also to raw-spans-grouper then?
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@@ -197,6 +197,8 @@ public void process(Record<TraceIdentity, RawSpan> record) { | |||
} | |||
|
|||
Event event = value.getEvent(); | |||
// spans whose trace is not created by ByPass flow, their trace will be created in below |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: For now, it is controlled by customer_id. But, we should check if this is a mirroring agent or singleton trace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are checking if its a mirroring agent:
} | ||
|
||
@Override | ||
public boolean test(TraceIdentity traceIdentity, RawSpan rawSpan) { | ||
// tenant level spans bypass override | ||
if (bypassOverrideTenants.contains(rawSpan.getCustomerId()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bypassExclusionTenants or excludeTenantsFromBypass
@@ -70,6 +70,10 @@ data: | |||
{{- if hasKey .Values.spanNormalizerConfig.processor "bypassKey" }} | |||
bypass.key = "{{ .Values.spanNormalizerConfig.processor.bypassKey }}" | |||
{{- end }} | |||
|
|||
{{- if hasKey .Values.spanNormalizerConfig.processor "bypassOverrideTenants" }} | |||
bypass.override.tenants = "{{ .Values.spanNormalizerConfig.processor.bypassOverrideTenants | toJson }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bypass.exclusion.tenants.
Description
BREAKING CHANGE: Added a new state store in raw-spans-grouper:
peer-identity-to-span-metadata-store
Testing
Please describe the tests that you ran to verify your changes. Please summarize what did you test and what needs to be tested e.g. deployed and tested helm chart locally.
Checklist:
Documentation
Make sure that you have documented corresponding changes in this repository or hypertrace docs repo if required.