Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
Update Proxy heartbeat & logging (#502)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmc-msft authored Feb 4, 2021
1 parent 4abfbec commit c5bb0f0
Show file tree
Hide file tree
Showing 7 changed files with 294 additions and 56 deletions.
3 changes: 3 additions & 0 deletions src/agent/onefuzz-telemetry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ pub enum EventData {
CoveragePathsImported(u64),
CoverageMaxDepth(u64),
ToolName(String),
Region(String),
}

impl EventData {
Expand Down Expand Up @@ -109,6 +110,7 @@ impl EventData {
Self::CoverageMaxDepth(x) => ("coverage_paths_depth", x.to_string()),
Self::Coverage(x) => ("coverage", x.to_string()),
Self::ToolName(x) => ("tool_name", x.to_owned()),
Self::Region(x) => ("region", x.to_owned()),
}
}

Expand Down Expand Up @@ -146,6 +148,7 @@ impl EventData {
Self::CoverageMaxDepth(_) => true,
Self::Coverage(_) => true,
Self::ToolName(_) => true,
Self::Region(_) => false,
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/api-service/__app__/onefuzzlib/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import datetime
import logging
import os
from typing import List, Optional, Tuple

from azure.mgmt.compute.models import VirtualMachine
Expand All @@ -23,6 +24,7 @@
from .__version__ import __version__
from .azure.auth import build_auth
from .azure.containers import get_file_sas_url, save_blob
from .azure.creds import get_instance_id
from .azure.ip import get_public_ip
from .azure.queue import get_queue_sas
from .azure.storage import StorageType
Expand Down Expand Up @@ -211,6 +213,9 @@ 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_id=get_instance_id(),
)

save_blob(
Expand Down
Loading

0 comments on commit c5bb0f0

Please sign in to comment.