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

feat(load-generator): Adapt OpenFeature OFREP instead of IN_PROCESS #2114

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ SHIPPING_DOCKERFILE=./src/shipping/Dockerfile
# Flagd
FLAGD_HOST=flagd
FLAGD_PORT=8013
FLAGD_OFREP_PORT=8016

# Flagd UI
FLAGD_UI_HOST=flagd-ui
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ the release.
* [quote] Updated open-telemetry/exporter-otlp to 1.2.1 which includes the
fix for `IS_REMOTE` flag feature
([#2112](https://github.com/open-telemetry/opentelemetry-demo/pull/2112))
* [load-generator] Change OpenFeature Evaluation to Remote Evaluation Protocol,
based on [this issue in OpenFeature/python-sdk-contrib](https://github.com/open-feature/python-sdk-contrib/issues/198)
([#2114](https://github.com/open-telemetry/opentelemetry-demo/pull/2114))

## 2.0.1

Expand Down
3 changes: 2 additions & 1 deletion docker-compose.minimal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,8 @@ services:
"file:./etc/flagd/demo.flagd.json"
]
ports:
- 8013
- "${FLAGD_PORT}"
- "${FLAGD_OFREP_PORT}"
volumes:
- ./src/flagd:/etc/flagd
logging:
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,8 @@ services:
"file:./etc/flagd/demo.flagd.json"
]
ports:
- 8013
- "${FLAGD_PORT}"
- "${FLAGD_OFREP_PORT}"
volumes:
- ./src/flagd:/etc/flagd
logging:
Expand Down
5 changes: 3 additions & 2 deletions src/load-generator/locustfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from opentelemetry.sdk.resources import Resource

from openfeature import api
from openfeature.contrib.provider.flagd import FlagdProvider
from openfeature.contrib.provider.ofrep import OFREPProvider
from openfeature.contrib.hook.opentelemetry import TracingHook

from playwright.async_api import Route, Request
Expand Down Expand Up @@ -69,7 +69,8 @@
logging.info("Instrumentation complete")

# Initialize Flagd provider
api.set_provider(FlagdProvider(host=os.environ.get('FLAGD_HOST', 'flagd'), port=os.environ.get('FLAGD_PORT', 8013)))
base_url = f"http://{os.environ.get('FLAGD_HOST', 'localhost')}:{os.environ.get('FLAGD_OFREP_PORT', 8016)}"
api.set_provider(OFREPProvider(base_url=base_url))
api.add_hooks([TracingHook()])

def get_flagd_value(FlagName):
Expand Down
3 changes: 2 additions & 1 deletion src/load-generator/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ opentelemetry-sdk==1.30.0
opentelemetry-semantic-conventions==0.51b0
opentelemetry-util-http==0.51b0
openfeature-sdk==0.8.0
openfeature-provider-flagd==0.1.5
openfeature-provider-ofrep==0.1.1
openfeature-hooks-opentelemetry==0.2.0
protobuf==5.29.3
psutil==6.1.1
Expand All @@ -46,3 +46,4 @@ wrapt==1.17.2
zope-event==5.0
zope-interface==7.2
python-json-logger==3.2.1