Setup telemetry. EH Forwarder Bot framework includes NO code that uploads your log or any other data to anywhere. To enable telemetry functionality, additional modules need to be installed manually, and explicit settings must be added in the configuration file. See :doc:`teleme
(key: str)
| 213 | |
| 214 | |
| 215 | def setup_telemetry(key: str): |
| 216 | """Setup telemetry. |
| 217 | |
| 218 | EH Forwarder Bot framework includes NO code that uploads your log |
| 219 | or any other data to anywhere. |
| 220 | |
| 221 | To enable telemetry functionality, additional modules need to be |
| 222 | installed manually, and explicit settings must be added in the configuration |
| 223 | file. See :doc:`telemetry` for details. |
| 224 | """ |
| 225 | |
| 226 | if not isinstance(key, str): |
| 227 | return |
| 228 | |
| 229 | if key not in (CAPTURE_EXCEPTIONS, CAPTURE_LOG, CAPTURE_LOG_ANALYSIS): |
| 230 | return |
| 231 | |
| 232 | telemetry_config = {} |
| 233 | if key in (CAPTURE_LOG, CAPTURE_LOG_ANALYSIS): |
| 234 | telemetry_config.update({"sentry": {"enable": True, "capture_logs": True}}) |
| 235 | if key == CAPTURE_LOG_ANALYSIS: |
| 236 | telemetry_config.update({ |
| 237 | "logz": {"enable": True}, |
| 238 | "loggly": {"enable": True}, |
| 239 | "logdna": {"enable": True} |
| 240 | }) |
| 241 | |
| 242 | global telemetry |
| 243 | |
| 244 | import telemetry_1a23 |
| 245 | telemetry_1a23.init('ehforwarderbot', telemetry_config) |
| 246 | telemetry_1a23.set_metadata({"ehforwarderbot": __version__}) |
| 247 | |
| 248 | telemetry = telemetry_1a23 |
| 249 | |
| 250 | |
| 251 | def telemetry_set_metadata(metadata: Dict[str, str]): |