-
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
[WIP] [query] use otel's implementation for constructing http and grpc servers #6055
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6055 +/- ##
==========================================
- Coverage 96.46% 96.34% -0.13%
==========================================
Files 352 352
Lines 19986 20045 +59
==========================================
+ Hits 19280 19312 +32
- Misses 522 544 +22
- Partials 184 189 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@yurishkuro do you have any thoughts on how to handle the sharing of ports problem? |
We should follow our deprecation policy of two versions notice. It means for v2 we can go to new method and distinct port. For v1 we need to print a warning if the same port is used telling the user this will not be supported in the future (call it out in release notes). Then two releases later we switch default to not allow same port but still support it via a special flag (deprecated from start), and then two releases later remove that too. This also means we should have another release tag "deprecated" and change release notes script to have a separate section for it. |
Got it! Let me make some changes. |
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
4f091a5
to
82044f5
Compare
@yurishkuro do you have any thoughts so far? it looks pretty messy but i'm not sure if there's a cleaner way to do this. |
cmd/query/app/server.go
Outdated
func NewServer(querySvc *querysvc.QueryService, | ||
func NewServer( | ||
ctx context.Context, | ||
host component.Host, |
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.
maybe we can wrap it into telemetery.Setting
cmd/query/app/server.go
Outdated
return nil, err | ||
} | ||
} else { | ||
telset.Logger.Error("using the same port for gRPC and HTTP is deprecated; please use dedicated host ports intead") |
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.
telset.Logger.Error("using the same port for gRPC and HTTP is deprecated; please use dedicated host ports intead") | |
telset.Logger.Warning("using the same port for gRPC and HTTP is deprecated; please use dedicated ports instead") |
cmd/query/app/server.go
Outdated
var grpcServer *grpc.Server | ||
var httpServer *httpServer | ||
if separatePorts { | ||
grpcServer, err = createGRPCServer(ctx, host, querySvc, metricsQuerySvc, options, tm, telset) |
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 think this is unnecessary bifurcation at this point. I would instead spit this function into two, create
and registerEndpoints(server)
. Pass legacy=separatePorts
argument to create
func createGRPCServer(legacy bool, ... {
if !legacy {
return otel.Create...
}
// legacy code
}
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.
@yurishkuro how would we register the endpoints after creating the server?
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.
Same way they are currently registered in the create() function. My point is that we're only changing how the server is created, not how endpoints are mounted into it.
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.
@yurishkuro otel's ToServer
takes in a handler, which has the routes registered to it. So how would we register the routes after creating the server using ToServer
?
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.
ok, so for grpc the order is (1) create server, (2) register handlers. For HTTP it's (1) create the root handler with all sub-handlers registered, and (2) create server. In both cases we can factor out the handlers creation, which are not different between v1/v2.
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
6f66c71
to
b0ee94f
Compare
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
@yurishkuro do you know why the all in one test is failing by any chance? |
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
It seems some unexpected spans are being created. This may not necessary be a bad thing, i.e. we may need to adjust the test to allow that. I'd recommend running the test with commented out |
@yurishkuro This is what I'm seeing in the jaeger UI. What're your thoughts? |
The /api/traces request, is it a GET or a POST? Get is ok to trace, post is not. |
@yurishkuro It looks to be a GET request. |
Ok, then how is it different from how the test worked before your change? Did we not have tracing on that endpoint? |
@yurishkuro It looks like the second trace that's the one that is new |
I think we should improve selectivity of the test - it should not be breaking if some extra trace is created, its objective is to check that the trace it needs is created. |
Which problem is this PR solving?
Description of the changes
How was this change tested?
Checklist
jaeger
:make lint test
jaeger-ui
:yarn lint
andyarn test