-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Imageprovider #1462
Imageprovider #1462
Conversation
e61dae3
to
cb48141
Compare
Although this is valid in demonstrating the nginx-otel capabilities, it does not add much to the overall design IMO. Moreover, instead of nginx, we could rely on Apache as well[1], or many many other providers that already support otel. |
I don't have strong opinion on the design, I think more tech is demonstrated, more value we can provide. I looked into envoys fault injecting and its rather nice indeed.
As I see, thisngx_otel_module is the support in nginx ecosystem for otel, so I don't really understand your point, can you provide more context? |
@klucsik I didn't have time to look at it yet (at KubeCon ATM), but I'm just wondering, is this service being called by anyone? |
Hey, have fun at KubeCON :) |
@klucsik I've played around with this PR and I'd like to open a discussion here. Currently this is implemented in a way that
I wonder if instead of it, we should have something like this:
or
In that case, the location of the image would be stored in the I'm also pinging @puckpuck and @austinlparker here to get their opinion on this. |
The pattern I'd usually expect for something like this would be that images would be on a CDN (either a subdomain or a separate site) so I'd expect to see a call chain like
Where the URLs of the images are partials returned by the product catalog that the frontend picks based on env vars or whatever (e.g., when running locally it picks from a local file path, in staging from , in prod from the CDN?) |
I agree with that of a separate site or subdomain would be the most real-world-like setup, but that would add more complexity what we need here in my opinion. I like the url-partials coming from product catalog service, and the frontend is fetching based on that. |
@klucsik I'd go for that:
Then we would have this:
|
In this case we do not need to worry about different stages and so on. |
the url partial is already coming from the productcatalog service: opentelemetry-demo/pb/demo.proto Line 81 in e18bb82
So the main modification would be that the image goes through the frontendservice server part (the apigateway would be the obvious place for this) instead of just directly going to the imageprovider through the frontendproxy.
and
Can we connect them? I suppose we can pass down the span context to the request going to the imageprovider. I did manage to send arbitrary headers to the image request with some useeffect magic (kudos to @EislM0203): If we just connect the traces without the apigateway thingie we would still get something like this I suppose:
would that be suffice? |
I wasn't expecting 2 traces TBH. Maybe I got lost here, but why do we need the ATM in the I though that was also a possibility for the frontend. No? |
I'm no nextjs expert, but as I see it now, the imageloading is initiated in the client (aka browser), and its a separate request from the main pageload. I assume we can force it to render every bit on server side, but that would prevent me doing the slowloading problem pattern (images are randomly slowed and visually complete rendering takes a long time), and doesn't seems to be a good idea. |
Ah, no need for a hacky solution. I don't like the approach which we go twice over the frontend-proxy though. I'd vote for the 1st suggestion here then: @austinlparker, any thoughts? |
…ion to it Signed-off-by: krisztian.klucsik <[email protected]>
It comes from the browser client. What we see there as frontend, is the server part of the frontend. |
Also, is this expected?
|
Makes sense, thx for clarifying! |
Oh the leading / should be removed, I'll check it. Nice catch |
fixed |
Changes
Added an nginx service to serve the images for the frontend. The service is instrumented with ngx_otel_module.
This adds a new technology demonstration (nginx) and in the future we can introduce more problem patterns (for example adding a sleep module in nginx based on a featureflag to simulate slow loading of images).
Merge Requirements
For new features contributions please make sure you have completed the following
essential items:
CHANGELOG.md
updated to document new feature additions