-
Notifications
You must be signed in to change notification settings - Fork 8
Feature/exp telemetry #58
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4a7a64b
Added Accessor (#55)
mrm9084 91f7368
New OTel Integration (#54)
mrm9084 edb88b7
Merge branch 'main' into feature/exp-telemetry
mrm9084 18ada9b
Merge branch 'main' into feature/exp-telemetry
mrm9084 5893317
Merge branch 'main' into feature/exp-telemetry
mrm9084 ba8c7f7
Updating Version/Status
mrm9084 2f9089b
review comments
mrm9084 bee7905
Merge branch 'main' into feature/exp-telemetry
mrm9084 507e7a0
Update _version.py
mrm9084 1d195bc
Merge branch 'feature/exp-telemetry' of https://github.com/microsoft/…
mrm9084 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,5 @@ sphinx | |
sphinx_rtd_theme | ||
sphinx-toolbox | ||
myst_parser | ||
opentelemetry-api | ||
opentelemetry-sdk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ featuremanagerbase | |
quickstart | ||
rtype | ||
usefixtures | ||
urandom |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# ------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for | ||
# license information. | ||
# -------------------------------------------------------------------------- | ||
|
||
import json | ||
import os | ||
import sys | ||
from random_filter import RandomFilter | ||
from featuremanagement import FeatureManager, TargetingContext | ||
|
||
|
||
script_directory = os.path.dirname(os.path.abspath(sys.argv[0])) | ||
|
||
with open(script_directory + "/formatted_feature_flags.json", "r", encoding="utf-8") as f: | ||
feature_flags = json.load(f) | ||
|
||
USER_ID = "Adam" | ||
|
||
|
||
def my_targeting_accessor() -> TargetingContext: | ||
return TargetingContext(user_id=USER_ID) | ||
|
||
|
||
feature_manager = FeatureManager( | ||
feature_flags, feature_filters=[RandomFilter()], targeting_context_accessor=my_targeting_accessor | ||
) | ||
|
||
print(feature_manager.is_enabled("TestVariants")) | ||
print(feature_manager.get_variant("TestVariants").configuration) | ||
|
||
USER_ID = "Ellie" | ||
|
||
print(feature_manager.is_enabled("TestVariants")) | ||
print(feature_manager.get_variant("TestVariants").configuration) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Changing the return type from TargetingContext to Optional[TargetingContext] may lead to unexpected None values in downstream calls. Consider returning an empty TargetingContext() as a fallback to ensure consistency.
Copilot uses AI. Check for mistakes.