Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 4 additions & 2 deletions gprofiler/dynamic_profiling_management/heartbeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ def __init__(
api_server: str,
service_name: str,
server_token: str,
verify: bool = True,
):
self.api_server = api_server.rstrip("/")
self.service_name = service_name
self.server_token = server_token
self.verify = verify
self.hostname = get_hostname()
self.ip_address = self._get_local_ip()
self.last_command_id: Optional[str] = None
Expand Down Expand Up @@ -88,7 +90,7 @@ def send_heartbeat(self) -> Optional[Dict[str, Any]]:
"executed_command_ids": list(self.executed_command_ids),
}
url = f"{self.api_server}/api/metrics/heartbeat"
response = self.session.post(url, json=heartbeat_data, timeout=30)
response = self.session.post(url, json=heartbeat_data, timeout=30, verify=self.verify)

if response.status_code == 200:
result = response.json()
Expand Down Expand Up @@ -122,7 +124,7 @@ def send_command_completion(
"results_path": results_path,
}
url = f"{self.api_server}/api/metrics/command_completion"
response = self.session.post(url, json=completion_data, timeout=30)
response = self.session.post(url, json=completion_data, timeout=30, verify=self.verify)
if response.status_code == 200:
logger.info(f"Reported command completion for {command_id} (status={status})")
return True
Expand Down
1 change: 1 addition & 0 deletions gprofiler/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1364,6 +1364,7 @@ def main() -> None:
api_server=args.api_server,
service_name=args.service_name,
server_token=args.server_token,
verify=args.verify,
)

# Create dynamic profiler manager
Expand Down
Loading