-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Remove ParentSpanID from domain model #831
Conversation
func (s *Span) ParentSpanID() SpanID { | ||
for i := range s.References { | ||
ref := &s.References[i] | ||
if ref.TraceID == s.TraceID && ref.RefType == ChildOf { |
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've always wondered, why do we need traceid to be part of spanref? what use case is there when a span has a spanref to a different traceid?
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.
meta-traces; multi-trace joins in buffered writes
// ParentSpanID returns ID of a parent span if it exists. | ||
// It searches for the first child-of reference pointing to the same trace ID. | ||
func (s *Span) ParentSpanID() SpanID { | ||
for i := range s.References { |
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.
why not iterate over the reference directly? ie for _, ref :=
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.
each iteration will have to copy 4 words into the on-stack var
8b08701
to
beb4a57
Compare
Signed-off-by: Yuri Shkuro <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
beb4a57
to
3ed6401
Compare
* master: (38 commits) Preparing release 1.5.0 (jaegertracing#847) Add bounds to memory storage (jaegertracing#845) Add metric for debug traces (jaegertracing#796) Change metrics naming scheme (jaegertracing#776) Bump gocql version (jaegertracing#829) Remove ParentSpanID from domain model (jaegertracing#831) Make gas run quiet (jaegertracing#838) Revert "Make gas run quite" Revert "Install gas from install-ci" Install gas from install-ci Make gas run quite Add 'gas' for security problems scanning (jaegertracing#830) Add ability to adjust static sampling probabilities per operation (jaegertracing#827) Support log-level flag on agent (jaegertracing#828) Remove unused function (jaegertracing#822) Add healthcheck to standalone (jaegertracing#784) Do not use KeyValue fields directly and use KeyValues as decorator only (jaegertracing#810) Add ContaAzul to the adopters list (jaegertracing#806) Add ISSUE_TEMPLATE and PULL_REQUEST_TEMPLATE (jaegertracing#805) Upgrade to go 1.10 (jaegertracing#792) ... # Conflicts: # cmd/agent/app/builder.go # cmd/collector/main.go # cmd/query/main.go # cmd/standalone/main.go
Resolves #824
This implements option 1 from #824 by removing ParentSpanID from the domain model and only using the References array.
ParentSpanID
is replaced with an accessorParentSpanID()
that returns the span ID of the firstchild-of
reference for the same trace ID.Once unfortunate discovery: both Cassandra and Elasticsearch models kept the ParentID field in their respective models. It is no longer populated in the domain->db model conversions, but still has to be taken into account in the dbmodel->domain conversion for backwards compatibility with existing data. I don't know of a better solution.
A side effect of that is that we won't be able to use gogoprotobuf-generated model (from #773) to generate the JSON for Elasticsearch. The plan would be to move
model/converter/json
code intoplugin/storage/es/dbmodel
, similar toplugin/storage/cassandra/dbmodel
, while the UI JSON model will be produced directly from protobuf model.This change is