Skip to content
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

[featureflag] expose feature flag API via frontend #1

Merged
merged 1 commit into from
Jan 29, 2024

Conversation

basti1302
Copy link
Member

@basti1302 basti1302 commented Jan 29, 2024

This allows to do things like this for the ad service, the product catalog service, and the cart service.

curl -v -X PUT -H "Content-Type: application/json" ${otel-demo-frontend-url}/api/featureflags/adServiceFailure --data "{\"enabled\": 0.2}"

which would set the failure rate of the Ad service to 20%.

Also:

  • propagate the change from bool to float introduced in
    [featureflag]: use float to check for flag probability open-telemetry/opentelemetry-demo#1237
    more consistently via proto definitions by differentiating between
    the GetFlag operation (which evaluates the probabilty and therefore
    returns a bool) and all other operations, which need to operate with
    a float value/probability directly. To that end, the Flag grpc
    message has been split into two new types, FlagEvaluationResult
    and FlagDefinition.
  • Rename the UpdateFlag operation to UpdateFlagProbability, as it
    actually only updates the enabled/probability value, but not the
    description or the name.

@basti1302 basti1302 marked this pull request as draft January 29, 2024 08:09
Also:
* propagate the change from bool to float introduced in
  open-telemetry#1237
  more consistently via proto definitions by differentiating between
  the GetFlag operation (which evaluates the probabilty and therefore
  returns a bool) and all other operations, which need to operate with
  a float value/probability directly. To that end, the Flag grpc
  message has been split into two new types, FlagEvaluationResult
  and FlagDefinition.
* Rename the UpdateFlag operation to UpdateFlagProbability, as it
  actually only updates the enabled/probability value, but not the
  description or the name.
@@ -15,7 +15,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All go code in this PR is autogenerated, no manual change here. Also, non of the Go services relied on the GRPC interfaces that have been changed, so these services should not be affected.

@basti1302 basti1302 marked this pull request as ready for review January 29, 2024 12:00
@basti1302 basti1302 merged commit 56a294d into main Jan 29, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant