omnata-plugin-runtime 0.11.5a322__tar.gz → 0.11.6a323__tar.gz
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.
- {omnata_plugin_runtime-0.11.5a322 → omnata_plugin_runtime-0.11.6a323}/PKG-INFO +1 -1
- {omnata_plugin_runtime-0.11.5a322 → omnata_plugin_runtime-0.11.6a323}/pyproject.toml +1 -1
- {omnata_plugin_runtime-0.11.5a322 → omnata_plugin_runtime-0.11.6a323}/src/omnata_plugin_runtime/logging.py +2 -1
- {omnata_plugin_runtime-0.11.5a322 → omnata_plugin_runtime-0.11.6a323}/src/omnata_plugin_runtime/omnata_plugin.py +24 -2
- {omnata_plugin_runtime-0.11.5a322 → omnata_plugin_runtime-0.11.6a323}/LICENSE +0 -0
- {omnata_plugin_runtime-0.11.5a322 → omnata_plugin_runtime-0.11.6a323}/README.md +0 -0
- {omnata_plugin_runtime-0.11.5a322 → omnata_plugin_runtime-0.11.6a323}/src/omnata_plugin_runtime/__init__.py +0 -0
- {omnata_plugin_runtime-0.11.5a322 → omnata_plugin_runtime-0.11.6a323}/src/omnata_plugin_runtime/api.py +0 -0
- {omnata_plugin_runtime-0.11.5a322 → omnata_plugin_runtime-0.11.6a323}/src/omnata_plugin_runtime/configuration.py +0 -0
- {omnata_plugin_runtime-0.11.5a322 → omnata_plugin_runtime-0.11.6a323}/src/omnata_plugin_runtime/forms.py +0 -0
- {omnata_plugin_runtime-0.11.5a322 → omnata_plugin_runtime-0.11.6a323}/src/omnata_plugin_runtime/json_schema.py +0 -0
- {omnata_plugin_runtime-0.11.5a322 → omnata_plugin_runtime-0.11.6a323}/src/omnata_plugin_runtime/plugin_entrypoints.py +0 -0
- {omnata_plugin_runtime-0.11.5a322 → omnata_plugin_runtime-0.11.6a323}/src/omnata_plugin_runtime/rate_limiting.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "omnata-plugin-runtime"
|
|
3
|
-
version = "0.11.
|
|
3
|
+
version = "0.11.6-a323"
|
|
4
4
|
description = "Classes and common runtime components for building and running Omnata Plugins"
|
|
5
5
|
authors = ["James Weakley <james.weakley@omnata.com>"]
|
|
6
6
|
readme = "README.md"
|
|
@@ -9,9 +9,10 @@ from typing import Dict, List, Optional
|
|
|
9
9
|
from snowflake.snowpark import Session
|
|
10
10
|
from pydantic import ValidationError
|
|
11
11
|
from snowflake import telemetry
|
|
12
|
-
from opentelemetry import trace
|
|
12
|
+
from opentelemetry import trace, metrics
|
|
13
13
|
|
|
14
14
|
tracer = trace.get_tracer('omnata_plugin_runtime')
|
|
15
|
+
meter = metrics.get_meter('omnata_plugin_runtime')
|
|
15
16
|
|
|
16
17
|
class CustomLoggerAdapter(logging.LoggerAdapter):
|
|
17
18
|
"""
|
|
@@ -48,7 +48,7 @@ from snowflake.snowpark import Session
|
|
|
48
48
|
from snowflake.snowpark.functions import col
|
|
49
49
|
from tenacity import Retrying, stop_after_attempt, wait_fixed, retry_if_exception_message
|
|
50
50
|
|
|
51
|
-
from .logging import OmnataPluginLogHandler, logger, tracer
|
|
51
|
+
from .logging import OmnataPluginLogHandler, logger, tracer, meter
|
|
52
52
|
from opentelemetry import context
|
|
53
53
|
import math
|
|
54
54
|
import numpy as np
|
|
@@ -2330,6 +2330,15 @@ def __managed_inbound_processing_worker(
|
|
|
2330
2330
|
try:
|
|
2331
2331
|
stream: StoredStreamConfiguration = streams_queue.get_nowait()
|
|
2332
2332
|
logger.debug(f"stream returned from queue: {stream}")
|
|
2333
|
+
sync_request: InboundSyncRequest = cast(
|
|
2334
|
+
InboundSyncRequest, plugin_class_obj._sync_request
|
|
2335
|
+
) # pylint: disable=protected-access
|
|
2336
|
+
stream_duration_counter = meter.create_histogram(
|
|
2337
|
+
name="omnata.sync_run.stream_duration",
|
|
2338
|
+
description="The duration of stream processing",
|
|
2339
|
+
unit="s",
|
|
2340
|
+
)
|
|
2341
|
+
start_time = time.time()
|
|
2333
2342
|
# restore the first argument, was originally the dataframe/generator but now it's the appropriately sized dataframe
|
|
2334
2343
|
try:
|
|
2335
2344
|
with tracer.start_as_current_span("managed_inbound_processing") as managed_inbound_processing_span:
|
|
@@ -2341,7 +2350,7 @@ def __managed_inbound_processing_worker(
|
|
|
2341
2350
|
logger.info(f"worker {worker_index} requested that {stream.stream_name} be not marked as complete")
|
|
2342
2351
|
else:
|
|
2343
2352
|
logger.info(f"worker {worker_index} marking stream {stream.stream_name} as complete")
|
|
2344
|
-
|
|
2353
|
+
sync_request.mark_stream_complete(stream.stream_name)
|
|
2345
2354
|
except InterruptedWhileWaitingException:
|
|
2346
2355
|
# If an inbound run is cancelled while waiting for rate limiting, this should mean that
|
|
2347
2356
|
# the cancellation is handled elsewhere, so we don't need to do anything special here other than stop waiting
|
|
@@ -2361,6 +2370,19 @@ def __managed_inbound_processing_worker(
|
|
|
2361
2370
|
omnata_plugin_logger.error(f"{type(e).__name__} syncing stream {stream.stream_name}",
|
|
2362
2371
|
exc_info=True,
|
|
2363
2372
|
extra={'stream_name':stream.stream_name})
|
|
2373
|
+
finally:
|
|
2374
|
+
duration = time.time() - start_time
|
|
2375
|
+
stream_duration_counter.record(
|
|
2376
|
+
duration,
|
|
2377
|
+
attributes={
|
|
2378
|
+
"stream_name": stream.stream_name,
|
|
2379
|
+
"sync_run_id": str(sync_request._run_id),
|
|
2380
|
+
"sync_id": str(sync_request._sync_id),
|
|
2381
|
+
"branch_name": str(sync_request._branch_name) if sync_request._branch_name is not None else 'main',
|
|
2382
|
+
"sync_direction": "inbound",
|
|
2383
|
+
"plugin_id": plugin_class_obj.get_manifest().plugin_id,
|
|
2384
|
+
},
|
|
2385
|
+
)
|
|
2364
2386
|
except queue.Empty:
|
|
2365
2387
|
logger.debug("streams queue is empty")
|
|
2366
2388
|
return
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|