-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[jaeger-v2] add GRPC storage backend integration test #5259
[jaeger-v2] add GRPC storage backend integration test #5259
Conversation
Signed-off-by: James Ryans <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5259 +/- ##
=======================================
Coverage 95.05% 95.06%
=======================================
Files 339 340 +1
Lines 16529 16597 +68
=======================================
+ Hits 15712 15778 +66
- Misses 629 630 +1
- Partials 188 189 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: James Ryans <[email protected]>
Signed-off-by: James Ryans <[email protected]>
Signed-off-by: James Ryans <[email protected]>
Am I allowed to split the |
cmd/jaeger/integration/grpc_test.go
Outdated
"github.com/open-telemetry/opentelemetry-collector-contrib/testbed/testbed" | ||
"github.com/stretchr/testify/require" | ||
|
||
"github.com/jaegertracing/jaeger/cmd/jaeger/integration/datareceivers" |
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 you foresee other data receivers? If not we could define this directly in integration pkg since they are closely coupled. And we could also move integration pkg under internal so that you can call components() 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.
Thoughts?
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 you foresee other data receivers?
We will need another data receivers for Kafka, I've created one at #4971. Actually, I've just read your comment at Kafka data receiver that you prefer this package to be moved under "$root/internal/cit/". Is that still relevant?
we could also move integration pkg under internal so that you can call components() function
I've just tried that to move cmd/jaeger/integration
to cmd/jaeger/internal/integration
but I can't call the components() function when it is in private. Am I miss understood something here?
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.
Yeah we'd still need Components as public, I suppose. Although another alternative is to define your own components for integration tests, as you probably won't need everything from production build.
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.
Okay, I just felt like making the Components function public, since it will still be kept private within the internal directory. Defining a different components function means maintaining two similar functions with different environments, which could lead to oversight in the future (probably? this is only my thought process).
Signed-off-by: James Ryans <[email protected]>
Signed-off-by: James Ryans <[email protected]>
Signed-off-by: James Ryans <[email protected]>
The unit tests CI is failing due to jaeger storage extension goroutine leak but I still cannot find the cause. It's so hard to replicate, I can't even reproduce the error once.
|
…twork Signed-off-by: James Ryans <[email protected]>
Not sure if this actually solves the issue but I've changed the |
This may cause the execution to go through a different code path and reduce code coverage (just guessing). |
Hmm.. from my understanding, I believe this unit test is to cover this line of code, which both jaeger/cmd/jaeger/internal/extension/jaegerstorage/extension.go Lines 91 to 93 in b990fe9
And also, to back up my argument, I've done test coverage locally specific only to the Or do you have any suggestions on how to fix this? Perhaps I'm doing it wrong. Because I've looked into another similar issue https://gitlab.com/gitlab-org/gitaly/-/issues/4916 and they fixed it by changing the URL to connect to localhost in the unit test too. |
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'm good with badurl change
Signed-off-by: James Ryans <[email protected]>
Signed-off-by: James Ryans <[email protected]>
Signed-off-by: James Ryans <[email protected]>
I've made some adjustments:
|
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.
jaeger-ui sub module should not be changing in this PR, right?
) | ||
|
||
func TestGRPCStorage(t *testing.T) { | ||
if os.Getenv("STORAGE") != "jaeger_grpc" { |
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.
Q: why do you want it to have jaeger prefix? What other possibilities are there? Would es storage also have jaeger prefix?
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.
Actually, now that you mention it, we don't need the jaeger_
prefix. I thought we might need it to differentiate the v1 and v2 envvar so they wouldn't collide, but they are already separated by the Makefile target. V1 calls storage-integration-test
, and v2 calls jaeger-storage-integration-test
. I'll remove the prefix.
func TestGRPCStorage(t *testing.T) { | ||
if os.Getenv("STORAGE") != "jaeger_grpc" { | ||
t.Skip("Integration test against Jaeger-V2 GRPC skipped; set STORAGE env var to jaeger_grpc to run this") | ||
} |
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 you foresee NOT using envvar to enable/skip storage tests? If it's always going to be used we could move the check to s.Test().
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.
Okay, I think it's always going to be used. Will move it.
// Hacky way to get the storage extension name. | ||
// This way we don't need to modify this, | ||
// when a new storage backend is added. | ||
name := "" |
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.
Please explain what you are trying to do. Can we not create the component always with the same name for integration tests?
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.
From the architecture at issue #5254, I've designed that the data receiver will utilize the artificial jaeger receiver to pull the traces from the database which is through jaeger storage extension. Because of that, we need to host another jaeger storage extension that lives in the data receiver, and the jaeger receiver will point to that extension.
So, since the jaeger storage extension in the data receiver is a duplication from the collector's extension, I unmarshal the extension config to be used for the data receiver to host it. But now the jaeger receiver needs to know the name of that storage to be set at TraceStorage
, so I need to scrape it through the config whether it is in Memory/Badger/GRPC/Elasticsearch.
But while explaining, I've thought of another easier way to set the jaeger receiver TraceStorage
. Which is I just need to get it from the exporter. I'm changing the implementation right now and add the explanation to newDataReceiver
function.
This is because I merged this change #5255 from |
Signed-off-by: James Ryans <[email protected]>
Signed-off-by: James Ryans <[email protected]>
Signed-off-by: James Ryans <[email protected]>
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.
to fix jaeger-ui:
- git checkout main
- git submodule update
- git checkout your-branch
- git status (should show jaeger-ui as changed)
- git commit -s
|
||
config, err := os.ReadFile(s.ConfigFile) | ||
require.NoError(t, err) | ||
log.Println(string(config)) |
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.
t.Log
Signed-off-by: James Ryans <[email protected]>
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.
You used to have all kinds of diagrams explaining the set up of these integration tests, where are those? I only see one README, which is quite short.
Signed-off-by: James Ryans <[email protected]>
Signed-off-by: James Ryans <[email protected]>
I forgot to add the README but I have now added it. Currently, there's only one diagram for the general architecture of the integration test. For additional diagrams, I've referred to the Testbed README since they have their own diagram and another diagram will be included with the Jaeger-v2 Kafka PR. |
@james-ryans can we add goleaks check?
|
Yes, but apparently it has a goroutine leaking from the testbed. There's no functionality to close the data sender's gRPC connection, I'll try to solve the upstream issue first then get back here. |
Which problem is this PR solving?
Description of the changes
grpc-integration-test.sh
script to run a jaeger remote storage and execute the end-to-end test through the OpenTelemetry Collector pipeline with the jaeger storage extension inside connected to the remote storage. To have a visualization of this architecture, see the proposal at [jaeger-v2] Storage backend integration tests #5254How was this change tested?
./scripts/grpc-integration-test.sh latest
and the whole remote storage and pipeline will be built and executed for you.jaeger-query
component to query traces from the remote storage for manual checks.Checklist
jaeger
:make lint test
jaeger-ui
:yarn lint
andyarn test