()
| 209 | |
| 210 | |
| 211 | def get_tunnel_connector_id(): |
| 212 | url = f'http://localhost:{METRICS_PORT}/ready' |
| 213 | |
| 214 | try: |
| 215 | resp = requests.get(url, timeout=1) |
| 216 | return resp.json()["connectorId"] |
| 217 | # cloudflared might already terminated |
| 218 | except requests.exceptions.ConnectionError as e: |
| 219 | LOGGER.warning(f"Failed to connect to {url}, error: {e}") |
| 220 | |
| 221 | |
| 222 | # In some cases we don't need to check response status, such as when sending batch requests to generate logs |
searching dependent graphs…