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.
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.
| @@ -0,0 +1,6 @@ | |||
| @namespace("org.hypertrace.core.spannormalizer") | |||
| protocol SpanMetadataProtocol { | |||
There was a problem hiding this comment.
move it to raw-spans-grouper
There was a problem hiding this comment.
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.
same move to raw spans grouper
| HexUtils.getHex(event.getEventId()), | ||
| event.getServiceName()); | ||
|
|
||
| event |
There was a problem hiding this comment.
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.
adding to enriched attributes since we changed the attribute name to PEER_SERVICE_NAME
| } | ||
|
|
||
| String agentType = | ||
| attributeMap |
There was a problem hiding this comment.
do we have access to EnrichedSpanUtils here? it generally has all this functions
There was a problem hiding this comment.
but that is enriched attribute right? here we will not have the enriched attributes.
There was a problem hiding this comment.
Using the SpanAttributeUtils.getStringAttributeWithDefault()
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.
| } | ||
| 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.
Looks like this changes should be part of Trace-Enricher.
There was a problem hiding this comment.
We introduced new Attrs in EnrichedSpanConstants and populating them here. So, added dependency
| Timestamps timestamps = | ||
| traceLatencyMeter.trackEndToEndLatencyTimestamps( | ||
| currentTimeMs, firstEntry ? currentTimeMs : traceState.getTraceStartTimestamp()); | ||
| StructuredTrace trace = |
There was a problem hiding this comment.
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.
No, the same trace be also emitted via TraceEmitPuncuator as we return in the caller function:
There was a problem hiding this comment.
Added a comment
| trace.emit.punctuator.frequency = 15s | ||
|
|
||
| peer.correlation = { | ||
| enabled.customers = ["*"] |
There was a problem hiding this comment.
add a separate var: enable.all.customers = true or false
There was a problem hiding this comment.
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.
This requires in raw-spans-grouper. Shouldn't this be part of raw-spans-grouper
There was a problem hiding this comment.
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.
| } | ||
|
|
||
| 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.
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.
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.
bypassExclusionTenants or excludeTenantsFromBypass
| {{- end }} | ||
|
|
||
| {{- if hasKey .Values.spanNormalizerConfig.processor "bypassOverrideTenants" }} | ||
| bypass.override.tenants = "{{ .Values.spanNormalizerConfig.processor.bypassOverrideTenants | toJson }}" |
There was a problem hiding this comment.
bypass.exclusion.tenants.
Description
BREAKING CHANGE: Added a new state store in raw-spans-grouper:
peer-identity-to-span-metadata-storeTesting
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.