Skip to content

Commit

Permalink
[featureflag] expose feature flag API via frontend
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
basti1302 committed Jan 29, 2024
1 parent c9224a9 commit 45ad1bc
Show file tree
Hide file tree
Showing 13 changed files with 1,067 additions and 697 deletions.
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ services:
- CART_SERVICE_ADDR
- CHECKOUT_SERVICE_ADDR
- CURRENCY_SERVICE_ADDR
- FEATURE_FLAG_GRPC_SERVICE_ADDR
- PRODUCT_CATALOG_SERVICE_ADDR
- RECOMMENDATION_SERVICE_ADDR
- SHIPPING_SERVICE_ADDR
Expand Down
18 changes: 12 additions & 6 deletions pb/demo.proto
Original file line number Diff line number Diff line change
Expand Up @@ -271,41 +271,47 @@ service FeatureFlagService {
rpc DeleteFlag(DeleteFlagRequest) returns (DeleteFlagResponse) {}
}

message Flag {
message FlagEvaluationResult {
string name = 1;
string description = 2;
bool enabled = 3;
}

message FlagProbability {
string name = 1;
string description = 2;
float enabled = 3;
}

message GetFlagRequest {
string name = 1;
}

message GetFlagResponse {
Flag flag = 1;
FlagEvaluationResult flag = 1;
}

message CreateFlagRequest {
string name = 1;
string description = 2;
bool enabled = 3;
float enabled = 3;
}

message CreateFlagResponse {
Flag flag = 1;
FlagProbability flag = 1;
}

message UpdateFlagRequest {
string name = 1;
bool enabled = 2;
float enabled = 2;
}

message UpdateFlagResponse {}

message ListFlagsRequest {}

message ListFlagsResponse {
repeated Flag flag = 1;
repeated FlagProbability flag = 1;
}

message DeleteFlagRequest {
Expand Down
3 changes: 3 additions & 0 deletions restart-service.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/sh

set -euo pipefail

# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

Expand Down
Loading

0 comments on commit 45ad1bc

Please sign in to comment.