-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[ProductCatalogService] Add product catalog service problem patterns #1382
[ProductCatalogService] Add product catalog service problem patterns #1382
Conversation
Hey @klucsik, nice to see you here! |
9eba716
to
7084b43
Compare
7084b43
to
371b36f
Compare
Yes yes, we are on it, just having some learning path with commit signing :D |
Nice to work with you again :) EasyCLA is green |
Co-authored-by: Juliano Costa <julianocosta89@outlook.com>
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.
Thanks for the contribution! I'm not categorically opposed to these changes, but they seem like very blunt ways of triggering 100% failure scenarios for a service that already has failure scenarios available. Could you help me understand what you're trying to accomplish by adding these cases?
src/productcatalogservice/main.go
Outdated
@@ -237,6 +244,13 @@ func (p *productCatalog) GetProduct(ctx context.Context, req *pb.GetProductReque | |||
return nil, status.Errorf(codes.Internal, msg) | |||
} | |||
|
|||
if p.getFeatureFlag(ctx, "ItemNotFound") { |
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 a bit confused by this failure case -- do we need to force it via flag? Wouldn't simply passing an invalid product ID to the service trigger the same result as 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.
The flag would still need to be in place to control when to send the wrong id, but yeah, agree with you.
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.
Hmmmm, validating the PR I actually understood the scenario.
ItemNotFound
is being triggered just when navigating to the product page.
I can see that being used in demos, to showcase errors on a page that is part of the checkout flow.
ItemListInternal
on the other hand, fails on listing the products, so you can't even see the products.
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 could move the ItemNotFound logic to loadgenerator to query some clearly invalid products, the requirement from our end is to demonstrate a notfound error in the sample
src/productcatalogservice/main.go
Outdated
@@ -217,6 +217,13 @@ func (p *productCatalog) Watch(req *healthpb.HealthCheckRequest, ws healthpb.Hea | |||
func (p *productCatalog) ListProducts(ctx context.Context, req *pb.Empty) (*pb.ListProductsResponse, error) { | |||
span := trace.SpanFromContext(ctx) | |||
|
|||
if p.getFeatureFlag(ctx, "ItemListInternal") { |
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.
How would a 500 error happen here naturally? Is there a better way to represent this failure scenario?
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.
This 500 error is initially meant to be in the SearchProducts endpoint, but that is not called by anything, thats why I moved this to here to be able to throw an Internal error in a Go service, so we can demonstrate the detection of that.
I agree with @austinlparker's comment about introducing another feature flag for a simple blunt failure scenario. We already have several similar feature flags across different aspects of the demo. What observability demo and/or use cases are we trying to solve with this feature flag? |
@austinlparker @julianocosta89 @puckpuck Thank you for reading through my PR, and the comments. |
@klucsik we already have a feature flag in the Product Catalog service that will return a 500 for a specific product ID when the flag is enabled. Would the I want to leverage feature flags to showcase potential failures, but I would like the failures to be more than just blunt failures on a feature flag being positive. It would help that the failure was due to a specific scenario, such as a product ID or multiple specific products being purchased, etc. |
6344637
to
96969b6
Compare
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
@klucsik we have just merged a PR that removed the current FeatureFlagService in favor of OpenFeature and FlagD. |
Hey @julianocosta89. Sorry for going radiosilent about this. We discussed it a lot internally. |
@klucsik got it. |
Changes
Refactored the featre flag querying in ProductCatalogService to be reusable
Added Problems to ListProducts and GetProduct endpoints in the product catalog service:
Merge Requirements
For new features contributions please make sure you have completed the following
essential items:
CHANGELOG.md
updated to document new feature additions* [ ] Appropriate Helm chart updates in the [helm-charts][]