port-ocean 0.22.3__py3-none-any.whl → 0.22.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of port-ocean might be problematic. Click here for more details.

@@ -3,6 +3,7 @@ import os
3
3
  from logging import LogRecord
4
4
  from logging.handlers import QueueHandler, QueueListener
5
5
  from queue import Queue
6
+ import uuid
6
7
 
7
8
  import loguru
8
9
  from loguru import logger
@@ -13,9 +14,11 @@ from port_ocean.log.sensetive import sensitive_log_filter
13
14
  from port_ocean.utils.signal import signal_handler
14
15
 
15
16
 
16
- def setup_logger(level: LogLevelType, enable_http_handler: bool, instance: str) -> None:
17
+ def setup_logger(level: LogLevelType, enable_http_handler: bool) -> None:
17
18
  logger.remove()
18
- logger.configure(extra={"hostname": try_get_hostname(), "instance": instance})
19
+ logger.configure(
20
+ extra={"hostname": resolve_hostname(), "instance": str(uuid.uuid4())}
21
+ )
19
22
  _stdout_loguru_handler(level)
20
23
  if enable_http_handler:
21
24
  _http_loguru_handler(level)
@@ -25,8 +28,6 @@ def _stdout_loguru_handler(level: LogLevelType) -> None:
25
28
  logger_format = (
26
29
  "<green>{time:YYYY-MM-DD HH:mm:ss.SSS}</green> | "
27
30
  "<level>{level: <8}</level> | "
28
- "<cyan>{extra[integration_id]}</cyan> | "
29
- "<magenta>{extra[hostname]}</magenta> | "
30
31
  "<level>{message}</level>"
31
32
  )
32
33
  if level == "DEBUG":
@@ -78,7 +79,7 @@ def exception_deserializer(record: "loguru.Record") -> None:
78
79
  record["exception"] = exception._replace(value=fixed)
79
80
 
80
81
 
81
- def try_get_hostname() -> str:
82
+ def resolve_hostname() -> str:
82
83
  try:
83
84
  return os.uname().nodename
84
85
  except Exception:
port_ocean/run.py CHANGED
@@ -1,7 +1,6 @@
1
1
  import asyncio
2
2
  from inspect import getmembers
3
3
  from typing import Dict, Any, Type
4
- import uuid
5
4
 
6
5
  import uvicorn
7
6
  from pydantic import BaseModel
@@ -34,13 +33,11 @@ def run(
34
33
  config_override: Dict[str, Any] | None = None,
35
34
  ) -> None:
36
35
  application_settings = ApplicationSettings(log_level=log_level, port=port)
37
- instance = str(uuid.uuid4())
38
36
 
39
37
  init_signal_handler()
40
38
  setup_logger(
41
39
  application_settings.log_level,
42
40
  enable_http_handler=application_settings.enable_http_logging,
43
- instance=instance,
44
41
  )
45
42
 
46
43
  config_factory = _get_default_config_factory()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: port-ocean
3
- Version: 0.22.3
3
+ Version: 0.22.4
4
4
  Summary: Port Ocean is a CLI tool for managing your Port projects.
5
5
  Home-page: https://app.getport.io
6
6
  Keywords: ocean,port-ocean,port
@@ -136,12 +136,12 @@ port_ocean/helpers/metric/utils.py,sha256=1DlLR9FmUOpSlWSfY_tUEGcxRQY6ckAfbD3dnM
136
136
  port_ocean/helpers/retry.py,sha256=gmS4YxM6N4fboFp7GSgtOzyBJemxs46bnrz4L4rDS6Y,16136
137
137
  port_ocean/log/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
138
138
  port_ocean/log/handlers.py,sha256=ncVjgqrZRh6BhyRrA6DQG86Wsbxph1yWYuEC0cWfe-Q,3631
139
- port_ocean/log/logger_setup.py,sha256=hXaaM3D-rOeH0PpIqgm4UtRMkYvrg5DNfu5TT0_JAIs,2736
139
+ port_ocean/log/logger_setup.py,sha256=0K3zVG0YYrYOWEV8-rCGks1o-bMRxgHXlqawu9w_tSw,2656
140
140
  port_ocean/log/sensetive.py,sha256=lVKiZH6b7TkrZAMmhEJRhcl67HNM94e56x12DwFgCQk,2920
141
141
  port_ocean/middlewares.py,sha256=9wYCdyzRZGK1vjEJ28FY_DkfwDNENmXp504UKPf5NaQ,2727
142
142
  port_ocean/ocean.py,sha256=XmPmnjo-2oMZGvCLwIxPxwVNzXXzACzVR4JmlkXEOKY,7418
143
143
  port_ocean/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
144
- port_ocean/run.py,sha256=EsyOjkRmoUpGWFBx9duJ9SuWbYfpcDAfidqLdjK8bU8,2289
144
+ port_ocean/run.py,sha256=COoRSmLG4hbsjIW5DzhV0NYVegI9xHd1POv6sg4U1No,2217
145
145
  port_ocean/sonar-project.properties,sha256=X_wLzDOkEVmpGLRMb2fg9Rb0DxWwUFSvESId8qpvrPI,73
146
146
  port_ocean/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
147
147
  port_ocean/tests/clients/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -188,8 +188,8 @@ port_ocean/utils/repeat.py,sha256=U2OeCkHPWXmRTVoPV-VcJRlQhcYqPWI5NfmPlb1JIbc,32
188
188
  port_ocean/utils/signal.py,sha256=mMVq-1Ab5YpNiqN4PkiyTGlV_G0wkUDMMjTZp5z3pb0,1514
189
189
  port_ocean/utils/time.py,sha256=pufAOH5ZQI7gXvOvJoQXZXZJV-Dqktoj9Qp9eiRwmJ4,1939
190
190
  port_ocean/version.py,sha256=UsuJdvdQlazzKGD3Hd5-U7N69STh8Dq9ggJzQFnu9fU,177
191
- port_ocean-0.22.3.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
192
- port_ocean-0.22.3.dist-info/METADATA,sha256=K8Cam4nhmqFRa6rdvgu7p9vZ2BJvCRpHitqi3vwsZzs,6764
193
- port_ocean-0.22.3.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
194
- port_ocean-0.22.3.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
195
- port_ocean-0.22.3.dist-info/RECORD,,
191
+ port_ocean-0.22.4.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
192
+ port_ocean-0.22.4.dist-info/METADATA,sha256=ilbi_pJtvFG98ri9bFukecsZ8UsGVNUpG9q2veJGlhA,6764
193
+ port_ocean-0.22.4.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
194
+ port_ocean-0.22.4.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
195
+ port_ocean-0.22.4.dist-info/RECORD,,