Skip to content
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

Do not skip service/operation indexing for firehose spans + a couple fixes #2090

Merged
merged 6 commits into from Feb 27, 2020

Conversation

yurishkuro
Copy link
Member

Which problem is this PR solving?

The transitive dep graphs view uses service & operation index to populate the dropdown. However, when traces are stored in the firehose mode, they are excluded from indexing (to reduce the load on storage), including the service/operation tables, which are actually very inexpensive to write because writes only happen once per 12hr period due to a cache in front of them.

Short description of the changes

Allow service/operation tables to be written even in firehose mode.

@yurishkuro yurishkuro requested a review from a team as a code owner February 26, 2020 21:46

func (s *SpanWriter) writeOtherIndexes(span *model.Span, ds *dbmodel.Span) error {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you use a more descriptive name here?

Copy link
Member Author

Choose a reason for hiding this comment

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

like what?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps this could just be writeIndexes like earlier, but it calls writeServiceOperationIndex? Might simplify the branching in writer.go as well.

Comment on lines +380 to +385
assert.Equal(t, "planet-express", serviceWritten.Load())
assert.Equal(t, dbmodel.Operation{
ServiceName: "planet-express",
SpanKind: "",
OperationName: "package-delivery",
}, operationWritten.Load())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are these not tested elsewhere? For e.g., if plugin/storage/cassandra/spanstore/writer.go L183 were removed - wouldn't other tests fail?

Copy link
Member Author

Choose a reason for hiding this comment

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

I am not testing whether index writing works, but whether it's invoked for firehose span. This is the only test that makes distinction between two types of indices.

@codecov
Copy link

codecov bot commented Feb 27, 2020

Codecov Report

Merging #2090 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2090      +/-   ##
=========================================
+ Coverage   96.29%   96.3%   +<.01%     
=========================================
  Files         214     214              
  Lines       10540   10542       +2     
=========================================
+ Hits        10150   10152       +2     
+ Misses        331     330       -1     
- Partials       59      60       +1
Impacted Files Coverage Δ
plugin/storage/cassandra/spanstore/writer.go 100% <100%> (ø) ⬆️
cmd/query/app/static_handler.go 86.84% <0%> (-1.76%) ⬇️
...lugin/sampling/strategystore/adaptive/processor.go 100% <0%> (+0.79%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4ba8417...1e1cbd5. Read the comment docs.

Yuri Shkuro added 2 commits February 27, 2020 11:15
Signed-off-by: Yuri Shkuro <ys@uber.com>
Signed-off-by: Yuri Shkuro <ys@uber.com>
Yuri Shkuro added 4 commits February 27, 2020 11:17
Signed-off-by: Yuri Shkuro <ys@uber.com>
…ymore.

which cqlsh prints /opt/cassandra/bin/cqlsh

Signed-off-by: Yuri Shkuro <ys@uber.com>
Signed-off-by: Yuri Shkuro <ys@uber.com>
Signed-off-by: Yuri Shkuro <ys@uber.com>
break
}
time.Sleep(500 * time.Microsecond)
}
tr.mb.AssertGaugeMetrics(t,
metricstest.ExpectedMetric{Name: "client_stats.connected_clients", Value: test.expGauge})
assert.EqualValues(t, test.expGauge, gaugeValue)
Copy link
Member Author

Choose a reason for hiding this comment

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

Unrelated change to fix a flaky test. There was a race condition with gauge value being 1 inside the loop and then dropping back to 0 by the time the AssertGaugeMetrics was called.

@@ -3,7 +3,7 @@
# This script is used in the Docker image jaegertracing/jaeger-cassandra-schema
# that allows installing Jaeger keyspace and schema without installing cqlsh.

CQLSH=${CQLSH:-"/usr/bin/cqlsh"}
CQLSH=${CQLSH:-"/opt/cassandra/bin/cqlsh"}
Copy link
Member Author

Choose a reason for hiding this comment

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

unrelated change to fix regression in Cassandra tests that were breaking CI.

@yurishkuro yurishkuro changed the title Do not skip service/operation indexing for firehose spans Do not skip service/operation indexing for firehose spans + a couple fixes Feb 27, 2020
@yurishkuro yurishkuro merged commit 74856ef into jaegertracing:master Feb 27, 2020
@yurishkuro yurishkuro deleted the dont-skip-indexing-ops branch February 27, 2020 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants