Skip to content

Commit 4b2dd63

Browse files
fix(agent): heartbeat URL built from base URL, not ingest path
Was appending /api/agent/heartbeat to the full ingest endpoint URL, producing broken paths like /v1/metrics/ingest/api/agent/heartbeat. Now parses scheme+netloc from endpoint to build the correct base URL. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent de2dd8a commit 4b2dd63

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

agent/agent.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,10 @@ def send_heartbeat(
358358
location_hint: str = "",
359359
gpu_names: Optional[List[str]] = None,
360360
) -> None:
361-
url = endpoint.rstrip("/") + "/api/agent/heartbeat"
361+
from urllib.parse import urlparse
362+
parsed = urlparse(endpoint)
363+
base = f"{parsed.scheme}://{parsed.netloc}"
364+
url = base + "/api/agent/heartbeat"
362365
payload = {
363366
"agent_version": AGENT_VERSION,
364367
"hostname": socket.gethostname(),

0 commit comments

Comments
 (0)