Returns the shared SDK client instance, using the current global configuration. To use the SDK as a singleton, first make sure you have called :func:`Traceloop.init()` at startup time. Then ``get()`` will return the same shared :class:`Traceloop.client.Client` insta
()
| 298 | |
| 299 | @staticmethod |
| 300 | def get(): |
| 301 | """ |
| 302 | Returns the shared SDK client instance, using the current global configuration. |
| 303 | |
| 304 | To use the SDK as a singleton, first make sure you have called :func:`Traceloop.init()` |
| 305 | at startup time. Then ``get()`` will return the same shared :class:`Traceloop.client.Client` |
| 306 | instance each time. The client will be initialized if it has not been already. |
| 307 | |
| 308 | If you need to create multiple client instances with different configurations, instead of this |
| 309 | singleton approach you can call the :class:`Traceloop.client.Client` constructor directly instead. |
| 310 | """ |
| 311 | if not Traceloop.__client: |
| 312 | raise Exception( |
| 313 | "Client not initialized, you should call Traceloop.init() first. " |
| 314 | "If you are still getting this error - you are missing the api key" |
| 315 | ) |
| 316 | return Traceloop.__client |
no outgoing calls