Skip to content

Commit

Permalink
[demo] Replace references to feature flag service with flagd (#4058)
Browse files Browse the repository at this point in the history
  • Loading branch information
austinlparker committed Mar 11, 2024
1 parent ae0a72b commit 5c81d39
Show file tree
Hide file tree
Showing 18 changed files with 106 additions and 244 deletions.
26 changes: 12 additions & 14 deletions content/en/docs/demo/_index.md
Expand Up @@ -23,19 +23,18 @@ Want to deploy the demo and see it in action? Start here.
Want to understand how a particular language's instrumentation works? Start
here.

| Language | Automatic Instrumentation | Instrumentation Libraries | Manual Instrumentation |
| ------------- | -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| .NET | | [Cart Service](services/cart/) | [Cart Service](services/cart/) |
| C++ | | | [Currency Service](services/currency/) |
| Erlang/Elixir | | [Feature Flag Service](services/feature-flag/) | [Feature Flag Service](services/feature-flag/) |
| Go | | [Accounting Service](services/accounting/), [Checkout Service](services/checkout/), [Product Catalog Service](services/product-catalog/) | [Checkout Service](services/checkout/), [Product Catalog Service](services/product-catalog/) |
| Java | [Ad Service](services/ad/) | | [Ad Service](services/ad/) |
| JavaScript | | [Frontend](services/frontend/) | [Frontend](services/frontend/), [Payment Service](services/payment/) |
| Kotlin | | [Fraud Detection Service](services/fraud-detection/) | |
| PHP | | [Quote Service](services/quote/) | [Quote Service](services/quote/) |
| Python | [Recommendation Service](services/recommendation/) | | [Recommendation Service](services/recommendation/) |
| Ruby | | [Email Service](services/email/) | [Email Service](services/email/) |
| Rust | | [Shipping Service](services/shipping/) | [Shipping Service](services/shipping/) |
| Language | Automatic Instrumentation | Instrumentation Libraries | Manual Instrumentation |
| ---------- | -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| .NET | | [Cart Service](services/cart/) | [Cart Service](services/cart/) |
| C++ | | | [Currency Service](services/currency/) |
| Go | | [Accounting Service](services/accounting/), [Checkout Service](services/checkout/), [Product Catalog Service](services/product-catalog/) | [Checkout Service](services/checkout/), [Product Catalog Service](services/product-catalog/) |
| Java | [Ad Service](services/ad/) | | [Ad Service](services/ad/) |
| JavaScript | | [Frontend](services/frontend/) | [Frontend](services/frontend/), [Payment Service](services/payment/) |
| Kotlin | | [Fraud Detection Service](services/fraud-detection/) | |
| PHP | | [Quote Service](services/quote/) | [Quote Service](services/quote/) |
| Python | [Recommendation Service](services/recommendation/) | | [Recommendation Service](services/recommendation/) |
| Ruby | | [Email Service](services/email/) | [Email Service](services/email/) |
| Rust | | [Shipping Service](services/shipping/) | [Shipping Service](services/shipping/) |

## Service Documentation

Expand All @@ -46,7 +45,6 @@ found here:
- [Cart Service](services/cart/)
- [Checkout Service](services/checkout/)
- [Email Service](services/email/)
- [Feature Flag Service](services/feature-flag/)
- [Frontend](services/frontend/)
- [Load Generator](services/load-generator/)
- [Payment Service](services/payment/)
Expand Down
15 changes: 0 additions & 15 deletions content/en/docs/demo/architecture.md
Expand Up @@ -28,19 +28,14 @@ productcatalogservice(Product Catalog Service):::golang
quoteservice(Quote Service):::php
recommendationservice(Recommendation Service):::python
shippingservice(Shipping Service):::rust
featureflagservice(Feature Flag Service):::erlang
featureflagstore[(Feature Flag Store<br/>&#40PostgreSQL DB&#41)]
queue[(queue<br/>&#40Kafka&#41)]
Internet -->|HTTP| frontendproxy
frontendproxy -->|HTTP| frontend
frontendproxy -->|HTTP| featureflagservice
loadgenerator -->|HTTP| frontendproxy
accountingservice -->|TCP| queue
cartservice --->|gRPC| featureflagservice
checkoutservice --->|gRPC| cartservice --> cache
checkoutservice --->|gRPC| productcatalogservice
checkoutservice --->|gRPC| currencyservice
Expand All @@ -59,16 +54,6 @@ frontend -->|gRPC| shippingservice -->|HTTP| quoteservice
frauddetectionservice -->|TCP| queue
adservice --->|gRPC| featureflagservice
productcatalogservice -->|gRPC| featureflagservice
recommendationservice -->|gRPC| featureflagservice
shippingservice -->|gRPC| featureflagservice
featureflagservice --> featureflagstore
end
classDef dotnet fill:#178600,color:white;
Expand Down
6 changes: 0 additions & 6 deletions content/en/docs/demo/development.md
Expand Up @@ -33,12 +33,6 @@ receive hints from IDEs such as IntelliJ or VS Code. It may be necessary to run
- pkg-config
- protobuf-compiler

### Elixir

- Erlang/OTP 23+
- Elixir 1.13+
- Rebar3 3.20+

### Go

- Go 1.19+
Expand Down
1 change: 0 additions & 1 deletion content/en/docs/demo/docker-deployment.md
Expand Up @@ -67,7 +67,6 @@ Once the images are built and containers are started you can access:

- Web store: <http://localhost:8080/>
- Grafana: <http://localhost:8080/grafana/>
- Feature Flags UI: <http://localhost:8080/feature/>
- Load Generator UI: <http://localhost:8080/loadgen/>
- Jaeger UI: <http://localhost:8080/jaeger/ui/>
- Tracetest UI: <http://localhost:11633/>, only when using `make start-odd`
Expand Down
18 changes: 13 additions & 5 deletions content/en/docs/demo/feature-flags.md
@@ -1,17 +1,25 @@
---
title: Feature Flags
aliases: [feature_flags]
cSpell:ignore: OLJCESPC7Z
cSpell:ignore: flagd OLJCESPC7Z
---

This demo comes with several feature flags which can control failure conditions
in specific services. By default the flags are disabled. Using the Feature Flags
UI <http://localhost:8080/feature> you will be able to control the status of
these feature flags.
The demo provides several feature flags that you can use to simulate different
scenarios. These flags are managed by [`flagd`](https://flagd.dev), a simple
feature flag service that supports [OpenFeature](https://openfeature.dev). Flag
values are stored in the `demo.flagd.json` file. To enable a flag, change the
`defaultVariant` value in the config file for a given flag to "on".

| Feature Flag | Service(s) | Description |
| ----------------------- | --------------- | -------------------------------------------------------------------------------------------------------- |
| `adServiceFailure` | Ad Service | Generate an error for `GetAds` 1/10th of the time |
| `cartServiceFailure` | Cart Service | Generate an error for `EmptyCart` 1/10th of the time |
| `productCatalogFailure` | Product Catalog | Generate an error for `GetProduct` requests with product id: `OLJCESPC7Z` |
| `recommendationCache` | Recommendation | Create a memory leak due to an exponentially growing cache. 1.4x growth, 50% of requests trigger growth. |

## Feature Flag Architecture

Please see the [flagd documentation](https://flagd.dev) for more information on
how flagd works, and the [OpenFeature](https://openfeature.dev) website for more
information on how OpenFeature works, along with documentation for the
OpenFeature API.
1 change: 0 additions & 1 deletion content/en/docs/demo/kubernetes-deployment.md
Expand Up @@ -73,7 +73,6 @@ With the frontendproxy port-forward set up, you can access:

- Web store: <http://localhost:8080/>
- Grafana: <http://localhost:8080/grafana/>
- Feature Flags UI: <http://localhost:8080/feature/>
- Load Generator UI: <http://localhost:8080/loadgen/>
- Jaeger UI: <http://localhost:8080/jaeger/ui/>

Expand Down
12 changes: 2 additions & 10 deletions content/en/docs/demo/requirements/architecture.md
Expand Up @@ -68,16 +68,8 @@ application written in Swift.

## Feature Flag Component

This component should consist of one (or more) services that provides a simple
feature flag configuration utility for the main application. It is made up of a
browser-based client/admin interface and a backend service or services. The role
of the client is to allow an operator to visualize the available feature flags
and toggle their state. The server should provide a catalog of feature flags
that main application services can register with and interrogate for their
current status and targeting rules.

The feature flag component should be implemented as an Erlang+Elixir/Phoenix
service. The catalog of feature flags should be stored in a Database.
Feature flagging is a crucial part of cloud native application development. The
demo uses OpenFeature, a CNCF incubating project, to manage feature flags.

## Orchestration and Deployment

Expand Down
33 changes: 16 additions & 17 deletions content/en/docs/demo/services/_index.md
Expand Up @@ -6,20 +6,19 @@ cSpell:ignore: loadgenerator

To visualize request flows, see the [Service Diagram](../architecture/).

| Service | Language | Description |
| ----------------------------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| [accountingservice](accounting/) | Go | Processes incoming orders and count the sum of all orders (mock/). |
| [adservice](ad/) | Java | Provides text ads based on given context words. |
| [cartservice](cart/) | .NET | Stores the items in the user's shopping cart in Redis and retrieves it. |
| [checkoutservice](checkout/) | Go | Retrieves user cart, prepares order and orchestrates the payment, shipping and the email notification. |
| [currencyservice](currency/) | C++ | Converts one money amount to another currency. Uses real values fetched from European Central Bank. It's the highest QPS service. |
| [emailservice](email/) | Ruby | Sends users an order confirmation email (mock/). |
| [frauddetectionservice](fraud-detection/) | Kotlin | Analyzes incoming orders and detects fraud attempts (mock/). |
| [featureflagservice](feature-flag/) | Erlang/Elixir | CRUD feature flag service to demonstrate various scenarios like fault injection & how to emit telemetry from a feature flag reliant service. |
| [frontend](frontend/) | JavaScript | Exposes an HTTP server to serve the website. Does not require sign up / login and generates session IDs for all users automatically. |
| [loadgenerator](load-generator/) | Python/Locust | Continuously sends requests imitating realistic user shopping flows to the frontend. |
| [paymentservice](payment/) | JavaScript | Charges the given credit card info (mock/) with the given amount and returns a transaction ID. |
| [productcatalogservice](product-catalog/) | Go | Provides the list of products from a JSON file and ability to search products and get individual products. |
| [quoteservice](quote/) | PHP | Calculates the shipping costs, based on the number of items to be shipped. |
| [recommendationservice](recommendation/) | Python | Recommends other products based on what's given in the cart. |
| [shippingservice](shipping/) | Rust | Gives shipping cost estimates based on the shopping cart. Ships items to the given address (mock/). |
| Service | Language | Description |
| ----------------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| [accountingservice](accounting/) | Go | Processes incoming orders and count the sum of all orders (mock/). |
| [adservice](ad/) | Java | Provides text ads based on given context words. |
| [cartservice](cart/) | .NET | Stores the items in the user's shopping cart in Redis and retrieves it. |
| [checkoutservice](checkout/) | Go | Retrieves user cart, prepares order and orchestrates the payment, shipping and the email notification. |
| [currencyservice](currency/) | C++ | Converts one money amount to another currency. Uses real values fetched from European Central Bank. It's the highest QPS service. |
| [emailservice](email/) | Ruby | Sends users an order confirmation email (mock/). |
| [frauddetectionservice](fraud-detection/) | Kotlin | Analyzes incoming orders and detects fraud attempts (mock/). |
| [frontend](frontend/) | JavaScript | Exposes an HTTP server to serve the website. Does not require sign up / login and generates session IDs for all users automatically. |
| [loadgenerator](load-generator/) | Python/Locust | Continuously sends requests imitating realistic user shopping flows to the frontend. |
| [paymentservice](payment/) | JavaScript | Charges the given credit card info (mock/) with the given amount and returns a transaction ID. |
| [productcatalogservice](product-catalog/) | Go | Provides the list of products from a JSON file and ability to search products and get individual products. |
| [quoteservice](quote/) | PHP | Calculates the shipping costs, based on the number of items to be shipped. |
| [recommendationservice](recommendation/) | Python | Recommends other products based on what's given in the cart. |
| [shippingservice](shipping/) | Rust | Gives shipping cost estimates based on the shopping cart. Ships items to the given address (mock/). |

0 comments on commit 5c81d39

Please sign in to comment.