-
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
Create a /deep-dependencies endpoint #6654
base: main
Are you sure you want to change the base?
Create a /deep-dependencies endpoint #6654
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6654 +/- ##
==========================================
- Coverage 96.06% 96.01% -0.06%
==========================================
Files 364 365 +1
Lines 20696 20730 +34
==========================================
+ Hits 19881 19903 +22
- Misses 622 631 +9
- Partials 193 196 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Please see comments in #6608, the same applies here |
8ff02e0
to
0e4d03e
Compare
@yurishkuro the /deep-dependencies url is working now, but there are some issues.
REC-20250203235503.mp4
|
Sorry I don't follow your points about focal service. Isn't that a user choice after you return the data? Is that an input to the endpoint that returns the data? In either case the dummy endpoint can ignore that input and always return the same data, and to test it you can specify the focal service in the query URL (I assume). Another thing I didn't understand is why did you have to run hotrod in your screencast? If the endpoint always returns dummy data, what was the point of sending data to Jaeger from HotROD? |
And yes, you will need to make a change to the UI to use a different URL for the data. We could make it configurable in the UI, to keep it backwards compatible. |
@yurishkuro If we go to This was also the reason I was running the hotrod example, to mock services and operations. Are there any other considerations? Otherwise, I will move on and write the tests for the same, and also raise a pr in the ui. |
4c624a3
to
2389215
Compare
@yurishkuro I have added the tests and also raised the PR in the UI. Please have a look once. |
_ ...any, /* args */ | ||
) *mux.Route { | ||
var handler http.Handler = http.HandlerFunc(f) | ||
handler = otelhttp.WithRouteTag(route, handler) |
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.
isn't tracing of the endpoint already taken care of at the top level?
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 wouldn't that only trace the parent span? As I understand, the parent tracer will not go recursively into the children spans. Please clariy once.
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 are not adding any child spans, you're adding another, duplicate layer of instrumentation. It's redundant.
Signed-off-by: adityachopra29 <[email protected]>
Signed-off-by: adityachopra29 <[email protected]>
Signed-off-by: adityachopra29 <[email protected]>
Signed-off-by: adityachopra29 <[email protected]>
Signed-off-by: adityachopra29 <[email protected]>
Signed-off-by: adityachopra29 <[email protected]>
Signed-off-by: adityachopra29 <[email protected]>
Signed-off-by: adityachopra29 <[email protected]>
Signed-off-by: adityachopra29 <[email protected]>
b9c8a50
to
0370b33
Compare
@yurishkuro I have made the changes. Please have a look. |
// HTTPGateway exposes analytics HTTP endpoints. | ||
type HTTPGateway struct{} | ||
|
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.
not used
// HTTPGateway exposes analytics HTTP endpoints. | |
type HTTPGateway struct{} |
@@ -0,0 +1,90 @@ | |||
// Copyright (c) 2025 The Jaeger Authors. |
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 is the file called http_gateway? It does nothing of the sort.
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.
Yes. I had named it before when I had made the gateway struct. Will rename it to deep_dependencies_handler
|
||
res, err := json.Marshal(dependencies) | ||
if err != nil { | ||
http.Error(w, "Failed to encode response", http.StatusNotImplemented) |
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.
StatusNotImplemented
it IS implemented.
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 will use InternalServerError.
if basePath != "" && basePath != "/" { | ||
gw.router = gw.router.PathPrefix(basePath).Subrouter() | ||
} |
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 is this relevant?
) *testGateway { | ||
gw := setupHTTPGatewayNoServer(t, basePath) | ||
|
||
httpServer := httptest.NewServer(gw.router) |
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 no need to set up a server to test the RegisterRouter function. You can do it all with a mock http response recorder.
Signed-off-by: adityachopra29 <[email protected]>
Signed-off-by: adityachopra29 <[email protected]>
Signed-off-by: adityachopra29 <[email protected]>
router *mux.Router, | ||
f func(http.ResponseWriter, *http.Request), | ||
route string, | ||
_ ...any, /* args */ |
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.
what is this for?
@@ -183,6 +183,8 @@ func initRouter( | |||
Tracer: telset.TracerProvider, | |||
}).RegisterRoutes(r) | |||
|
|||
analytics.RegisterRoutes(r) |
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 isn't it called from apiHandler.RegisterRoutes(r)
?
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 use the exact same structure/organization of code as in #6608
Which problem is this PR solving?
Description of the changes
How was this change tested?
Checklist
jaeger
:make lint test
jaeger-ui
:npm run lint
andnpm run test