port-ocean 0.27.6__py3-none-any.whl → 0.27.8__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.
@@ -212,7 +212,7 @@ class IntegrationClientMixin:
212
212
  async def post_integration_sync_metrics(
213
213
  self, metrics: list[dict[str, Any]]
214
214
  ) -> None:
215
- logger.debug("starting POST metrics request", metrics=metrics)
215
+ logger.info("starting POST metrics request", metrics=metrics)
216
216
  metrics_attributes = await self.get_metrics_attributes()
217
217
  headers = await self.auth.headers()
218
218
  url = metrics_attributes["ingestUrl"] + "/syncMetrics"
@@ -224,7 +224,7 @@ class IntegrationClientMixin:
224
224
  },
225
225
  )
226
226
  handle_port_status_code(response, should_log=False)
227
- logger.debug("Finished POST metrics request")
227
+ logger.info("Finished POST metrics request")
228
228
 
229
229
  async def put_integration_sync_metrics(self, kind_metrics: dict[str, Any]) -> None:
230
230
  logger.debug("starting PUT metrics request", kind_metrics=kind_metrics)
@@ -1,21 +1,22 @@
1
1
  import os
2
- from typing import Any, TYPE_CHECKING, Optional, Dict, List, Tuple
3
- from fastapi import APIRouter
4
- from port_ocean.exceptions.context import ResourceContextNotFoundError
2
+ from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple
3
+
5
4
  import prometheus_client
6
- from httpx import AsyncClient
7
- from fastapi.responses import PlainTextResponse
8
- from loguru import logger
9
- from port_ocean.context import metric_resource, resource
10
- from prometheus_client import Gauge
11
5
  import prometheus_client.openmetrics
12
6
  import prometheus_client.openmetrics.exposition
13
7
  import prometheus_client.parser
14
- from prometheus_client import multiprocess
8
+ from fastapi import APIRouter
9
+ from fastapi.responses import PlainTextResponse
10
+ from httpx import AsyncClient
11
+ from loguru import logger
12
+ from prometheus_client import Gauge, multiprocess
13
+
14
+ from port_ocean.context import metric_resource, resource
15
+ from port_ocean.exceptions.context import ResourceContextNotFoundError
15
16
 
16
17
  if TYPE_CHECKING:
17
- from port_ocean.config.settings import MetricsSettings, IntegrationSettings
18
18
  from port_ocean.clients.port.client import PortClient
19
+ from port_ocean.config.settings import IntegrationSettings, MetricsSettings
19
20
 
20
21
 
21
22
  class MetricPhase:
@@ -294,6 +295,7 @@ class Metrics:
294
295
  if kinds is None:
295
296
  return None
296
297
 
298
+ logger.info("Reporting sync metrics for kinds", kinds=kinds)
297
299
  metrics = []
298
300
 
299
301
  if blueprints is None:
@@ -303,6 +305,8 @@ class Metrics:
303
305
  metric = self.generate_metrics(metric_name, kind, blueprint)
304
306
  metrics.extend(metric)
305
307
 
308
+ logger.info("Generated metrics", metrics=metrics, kinds=kinds)
309
+
306
310
  try:
307
311
  await self.port_client.post_integration_sync_metrics(metrics)
308
312
  except Exception as e:
@@ -3,16 +3,16 @@ import logging
3
3
  import sys
4
4
  import threading
5
5
  import time
6
+ from copy import deepcopy
6
7
  from datetime import datetime
7
8
  from logging.handlers import MemoryHandler
9
+ from traceback import format_exception
8
10
  from typing import Any
9
11
 
10
12
  from loguru import logger
11
13
 
12
14
  from port_ocean import Ocean
13
15
  from port_ocean.context.ocean import ocean
14
- from copy import deepcopy
15
- from traceback import format_exception
16
16
 
17
17
 
18
18
  def _serialize_record(record: logging.LogRecord) -> dict[str, Any]:
@@ -53,7 +53,6 @@ class HTTPMemoryHandler(MemoryHandler):
53
53
  return None
54
54
 
55
55
  def emit(self, record: logging.LogRecord) -> None:
56
-
57
56
  self._serialized_buffer.append(_serialize_record(record))
58
57
  super().emit(record)
59
58
 
@@ -106,4 +105,4 @@ class HTTPMemoryHandler(MemoryHandler):
106
105
  try:
107
106
  await _ocean.port_client.ingest_integration_logs(logs_to_send)
108
107
  except Exception as e:
109
- logger.debug(f"Failed to send logs to Port with error: {e}")
108
+ logger.error(f"Failed to send logs to Port with error: {e}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: port-ocean
3
- Version: 0.27.6
3
+ Version: 0.27.8
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
@@ -61,7 +61,7 @@ port_ocean/clients/port/client.py,sha256=dv0mxIOde6J-wFi1FXXZkoNPVHrZzY7RSMhNkDD
61
61
  port_ocean/clients/port/mixins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
62
62
  port_ocean/clients/port/mixins/blueprints.py,sha256=aMCG4zePsMSMjMLiGrU37h5z5_ElfMzTcTvqvOI5wXY,4683
63
63
  port_ocean/clients/port/mixins/entities.py,sha256=X2NqH00eK6TMJ3a3QEQRVQlKHzyj5l1FiPkIhonnbPg,24234
64
- port_ocean/clients/port/mixins/integrations.py,sha256=9G1vo3n9pG1t6siUmPdYtxXbfhGXKhWAWwKHr8x7tU4,11891
64
+ port_ocean/clients/port/mixins/integrations.py,sha256=ud9DQy14bJ2K3TiKqD53Dc1glp6N2x1dYFpdK96IIcc,11889
65
65
  port_ocean/clients/port/mixins/migrations.py,sha256=vdL_A_NNUogvzujyaRLIoZEu5vmKDY2BxTjoGP94YzI,1467
66
66
  port_ocean/clients/port/mixins/organization.py,sha256=A2cP5V49KnjoAXxjmnm_XGth4ftPSU0qURNfnyUyS_Y,1041
67
67
  port_ocean/clients/port/retry_transport.py,sha256=PtIZOAZ6V-ncpVysRUsPOgt8Sf01QLnTKB5YeKBxkJk,1861
@@ -141,12 +141,12 @@ port_ocean/exceptions/utils.py,sha256=gjOqpi-HpY1l4WlMFsGA9yzhxDhajhoGGdDDyGbLnq
141
141
  port_ocean/exceptions/webhook_processor.py,sha256=4SnkVzVwiacH_Ip4qs1hRHa6GanhnojW_TLTdQQtm7Y,363
142
142
  port_ocean/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
143
143
  port_ocean/helpers/async_client.py,sha256=LOgUlZ5Cs_WUSc8XujCVjPGvzZ_3AuFJNKPy0FKV3fA,1987
144
- port_ocean/helpers/metric/metric.py,sha256=Aacz7bOd8ZCwEPpXAdwLbKRXf28Z4wiViG_GXiV_xWg,14529
144
+ port_ocean/helpers/metric/metric.py,sha256=RwxPufa-f0j9FSOgb5JO_atlOv-JEwJJOOB1W1V0cDE,14643
145
145
  port_ocean/helpers/metric/utils.py,sha256=1lAgrxnZLuR_wUNDyPOPzLrm32b8cDdioob2lvnPQ1A,1619
146
146
  port_ocean/helpers/retry.py,sha256=VHAp6j9-Vid6aNR5sca3S0aW6b1S2oYw9vT9hi1N22U,18556
147
147
  port_ocean/helpers/stream.py,sha256=_UwsThzXynxWzL8OlBT1pmb2evZBi9HaaqeAGNuTuOI,2338
148
148
  port_ocean/log/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
149
- port_ocean/log/handlers.py,sha256=ncVjgqrZRh6BhyRrA6DQG86Wsbxph1yWYuEC0cWfe-Q,3631
149
+ port_ocean/log/handlers.py,sha256=LJ1WAfq7wYCrBpeLPihMKmWjdSahKKXNHFMRYkbk0Co,3630
150
150
  port_ocean/log/logger_setup.py,sha256=0K3zVG0YYrYOWEV8-rCGks1o-bMRxgHXlqawu9w_tSw,2656
151
151
  port_ocean/log/sensetive.py,sha256=lVKiZH6b7TkrZAMmhEJRhcl67HNM94e56x12DwFgCQk,2920
152
152
  port_ocean/middlewares.py,sha256=9wYCdyzRZGK1vjEJ28FY_DkfwDNENmXp504UKPf5NaQ,2727
@@ -207,8 +207,8 @@ port_ocean/utils/repeat.py,sha256=U2OeCkHPWXmRTVoPV-VcJRlQhcYqPWI5NfmPlb1JIbc,32
207
207
  port_ocean/utils/signal.py,sha256=mMVq-1Ab5YpNiqN4PkiyTGlV_G0wkUDMMjTZp5z3pb0,1514
208
208
  port_ocean/utils/time.py,sha256=pufAOH5ZQI7gXvOvJoQXZXZJV-Dqktoj9Qp9eiRwmJ4,1939
209
209
  port_ocean/version.py,sha256=UsuJdvdQlazzKGD3Hd5-U7N69STh8Dq9ggJzQFnu9fU,177
210
- port_ocean-0.27.6.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
211
- port_ocean-0.27.6.dist-info/METADATA,sha256=KzFgTmio2jk9gaqUyvyZDhMIsyanGS28gXG0J-1gzdg,7015
212
- port_ocean-0.27.6.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
213
- port_ocean-0.27.6.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
214
- port_ocean-0.27.6.dist-info/RECORD,,
210
+ port_ocean-0.27.8.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
211
+ port_ocean-0.27.8.dist-info/METADATA,sha256=osIO6vRaB8yTC5QRVTQbUQoguv0QuCFcNv3Js_NIVis,7015
212
+ port_ocean-0.27.8.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
213
+ port_ocean-0.27.8.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
214
+ port_ocean-0.27.8.dist-info/RECORD,,