From 4c4bb3c899074a037c8ffdb0325897abe301bc89 Mon Sep 17 00:00:00 2001 From: Brian Caswell Date: Mon, 5 Apr 2021 11:24:29 -0400 Subject: [PATCH] clarify telemetry key names at the service level --- src/agent/onefuzz-agent/src/tasks/config.rs | 4 ---- src/agent/onefuzz-supervisor/src/config.rs | 8 -------- src/api-service/__app__/onefuzzlib/extension.py | 4 ++-- src/api-service/__app__/onefuzzlib/proxy.py | 4 ++-- src/api-service/__app__/onefuzzlib/tasks/config.py | 4 ++-- src/api-service/__app__/pool/__init__.py | 4 ++-- src/proxy-manager/src/config.rs | 7 ------- src/pytypes/onefuzztypes/models.py | 12 ++++++------ 8 files changed, 14 insertions(+), 33 deletions(-) diff --git a/src/agent/onefuzz-agent/src/tasks/config.rs b/src/agent/onefuzz-agent/src/tasks/config.rs index 5ab4f5220c..212f1114bc 100644 --- a/src/agent/onefuzz-agent/src/tasks/config.rs +++ b/src/agent/onefuzz-agent/src/tasks/config.rs @@ -35,12 +35,8 @@ pub struct CommonConfig { pub heartbeat_queue: Option, - // TODO: remove the alias once the service has been updated to match - #[serde(alias = "instrumentation_key")] pub instance_telemetry_key: Option, - // TODO: remove the alias once the service has been updated to match - #[serde(alias = "telemetry_key")] pub microsoft_telemetry_key: Option, #[serde(default)] diff --git a/src/agent/onefuzz-supervisor/src/config.rs b/src/agent/onefuzz-supervisor/src/config.rs index 1001ad5983..0292056972 100644 --- a/src/agent/onefuzz-supervisor/src/config.rs +++ b/src/agent/onefuzz-supervisor/src/config.rs @@ -27,12 +27,8 @@ pub struct StaticConfig { pub multi_tenant_domain: Option, - // TODO: remove the alias once the service has been updated to match - #[serde(alias = "instrumentation_key")] pub instance_telemetry_key: Option, - // TODO: remove the alias once the service has been updated to match - #[serde(alias = "telemetry_key")] pub microsoft_telemetry_key: Option, pub heartbeat_queue: Option, @@ -51,12 +47,8 @@ struct RawStaticConfig { pub multi_tenant_domain: Option, - // TODO: remove the alias once the service has been updated to match - #[serde(alias = "instrumentation_key")] pub instance_telemetry_key: Option, - // TODO: remove the alias once the service has been updated to match - #[serde(alias = "telemetry_key")] pub microsoft_telemetry_key: Option, pub heartbeat_queue: Option, diff --git a/src/api-service/__app__/onefuzzlib/extension.py b/src/api-service/__app__/onefuzzlib/extension.py index 150c790344..306af4559b 100644 --- a/src/api-service/__app__/onefuzzlib/extension.py +++ b/src/api-service/__app__/onefuzzlib/extension.py @@ -103,13 +103,13 @@ def build_pool_config(pool: Pool) -> str: config = AgentConfig( pool_name=pool.name, onefuzz_url=get_instance_url(), - instrumentation_key=os.environ.get("APPINSIGHTS_INSTRUMENTATIONKEY"), heartbeat_queue=get_queue_sas( "node-heartbeat", StorageType.config, add=True, ), - telemetry_key=os.environ.get("ONEFUZZ_TELEMETRY"), + instance_telemetry_key=os.environ.get("APPINSIGHTS_INSTRUMENTATIONKEY"), + microsoft_telemetry_key=os.environ.get("ONEFUZZ_TELEMETRY"), instance_id=get_instance_id(), ) diff --git a/src/api-service/__app__/onefuzzlib/proxy.py b/src/api-service/__app__/onefuzzlib/proxy.py index 60368f388c..24b7daa29b 100644 --- a/src/api-service/__app__/onefuzzlib/proxy.py +++ b/src/api-service/__app__/onefuzzlib/proxy.py @@ -222,8 +222,8 @@ def save_proxy_config(self) -> None: ), forwards=forwards, region=self.region, - instrumentation_key=os.environ.get("APPINSIGHTS_INSTRUMENTATIONKEY"), - telemetry_key=os.environ.get("ONEFUZZ_TELEMETRY"), + instance_telemetry_key=os.environ.get("APPINSIGHTS_INSTRUMENTATIONKEY"), + microsoft_telemetry_key=os.environ.get("ONEFUZZ_TELEMETRY"), instance_id=get_instance_id(), ) diff --git a/src/api-service/__app__/onefuzzlib/tasks/config.py b/src/api-service/__app__/onefuzzlib/tasks/config.py index 1508fb5a53..b19d9340eb 100644 --- a/src/api-service/__app__/onefuzzlib/tasks/config.py +++ b/src/api-service/__app__/onefuzzlib/tasks/config.py @@ -205,8 +205,8 @@ def build_task_config( job_id=job_id, task_id=task_id, task_type=task_config.task.type, - instrumentation_key=os.environ.get("APPINSIGHTS_INSTRUMENTATIONKEY"), - telemetry_key=os.environ.get("ONEFUZZ_TELEMETRY"), + instance_telemetry_key=os.environ.get("APPINSIGHTS_INSTRUMENTATIONKEY"), + microsoft_telemetry_key=os.environ.get("ONEFUZZ_TELEMETRY"), heartbeat_queue=get_queue_sas( "task-heartbeat", StorageType.config, diff --git a/src/api-service/__app__/pool/__init__.py b/src/api-service/__app__/pool/__init__.py index c7623749cd..e61ebf1ee4 100644 --- a/src/api-service/__app__/pool/__init__.py +++ b/src/api-service/__app__/pool/__init__.py @@ -31,8 +31,8 @@ def set_config(pool: Pool) -> Pool: pool.config = AgentConfig( pool_name=pool.name, onefuzz_url=get_instance_url(), - instrumentation_key=os.environ.get("APPINSIGHTS_INSTRUMENTATIONKEY"), - telemetry_key=os.environ.get("ONEFUZZ_TELEMETRY"), + instance_telemetry_key=os.environ.get("APPINSIGHTS_INSTRUMENTATIONKEY"), + microsoft_telemetry_key=os.environ.get("ONEFUZZ_TELEMETRY"), heartbeat_queue=get_queue_sas( "node-heartbeat", StorageType.config, diff --git a/src/proxy-manager/src/config.rs b/src/proxy-manager/src/config.rs index 2dfa82ef68..9c54491654 100644 --- a/src/proxy-manager/src/config.rs +++ b/src/proxy-manager/src/config.rs @@ -45,15 +45,8 @@ pub struct Forward { #[derive(Debug, Deserialize, Serialize, PartialEq, Clone)] pub struct ConfigData { pub instance_id: Uuid, - - // TODO: remove the alias once the service has been updated to match - #[serde(alias = "instrumentation_key")] pub instance_telemetry_key: Option, - - // TODO: remove the alias once the service has been updated to match - #[serde(alias = "telemetry_key")] pub microsoft_telemetry_key: Option, - pub region: String, pub url: Url, pub notification: Url, diff --git a/src/pytypes/onefuzztypes/models.py b/src/pytypes/onefuzztypes/models.py index d477e2e4fc..e542067913 100644 --- a/src/pytypes/onefuzztypes/models.py +++ b/src/pytypes/onefuzztypes/models.py @@ -362,8 +362,8 @@ class AgentConfig(BaseModel): onefuzz_url: str pool_name: PoolName heartbeat_queue: Optional[str] - instrumentation_key: Optional[str] - telemetry_key: Optional[str] + instance_telemetry_key: Optional[str] + microsoft_telemetry_key: Optional[str] multi_tenant_domain: Optional[str] instance_id: UUID @@ -373,8 +373,8 @@ class TaskUnitConfig(BaseModel): job_id: UUID task_id: UUID task_type: TaskType - instrumentation_key: Optional[str] - telemetry_key: Optional[str] + instance_telemetry_key: Optional[str] + microsoft_telemetry_key: Optional[str] heartbeat_queue: str # command_queue: str input_queue: Optional[str] @@ -433,8 +433,8 @@ class ProxyConfig(BaseModel): notification: str region: Region forwards: List[Forward] - instrumentation_key: Optional[str] - telemetry_key: Optional[str] + instance_telemetry_key: Optional[str] + microsoft_telemetry_key: Optional[str] instance_id: UUID