add the instrumentation key to Info (#353)

This commit is contained in:
bmc-msft
2020-12-01 11:13:06 -05:00
committed by GitHub
parent 3f3193beeb
commit 7f97c142ed
3 changed files with 8 additions and 0 deletions

View File

@ -10,6 +10,7 @@ from ..onefuzzlib.azure.creds import (
get_base_region, get_base_region,
get_base_resource_group, get_base_resource_group,
get_insights_appid, get_insights_appid,
get_insights_instrumentation_key,
get_instance_id, get_instance_id,
get_subscription, get_subscription,
) )
@ -26,5 +27,6 @@ def main(req: func.HttpRequest) -> func.HttpResponse:
versions=versions(), versions=versions(),
instance_id=get_instance_id(), instance_id=get_instance_id(),
insights_appid=get_insights_appid(), insights_appid=get_insights_appid(),
insights_instrumentation_key=get_insights_instrumentation_key(),
) )
) )

View File

@ -82,6 +82,11 @@ def get_subscription() -> Any: # should be str
return parse_resource_id(os.environ["ONEFUZZ_DATA_STORAGE"])["subscription"] return parse_resource_id(os.environ["ONEFUZZ_DATA_STORAGE"])["subscription"]
@cached
def get_insights_instrumentation_key() -> Any: # should be str
return os.environ["ONEFUZZ_TELEMETRY"]
@cached @cached
def get_insights_appid() -> str: def get_insights_appid() -> str:
return os.environ["APPINSIGHTS_APPID"] return os.environ["APPINSIGHTS_APPID"]

View File

@ -38,6 +38,7 @@ class Info(BaseResponse):
versions: Dict[str, Version] versions: Dict[str, Version]
instance_id: Optional[UUID] instance_id: Optional[UUID]
insights_appid: Optional[str] insights_appid: Optional[str]
insights_instrumentation_key: Optional[str]
class ContainerInfoBase(BaseResponse): class ContainerInfoBase(BaseResponse):