vellum-workflow-server 1.7.12__py3-none-any.whl → 1.7.13.post1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vellum-workflow-server
3
- Version: 1.7.12
3
+ Version: 1.7.13.post1
4
4
  Summary:
5
5
  License: AGPL
6
6
  Requires-Python: >=3.9.0,<4
@@ -29,7 +29,7 @@ Requires-Dist: pyjwt (==2.10.0)
29
29
  Requires-Dist: python-dotenv (==1.0.1)
30
30
  Requires-Dist: retrying (==1.3.4)
31
31
  Requires-Dist: sentry-sdk[flask] (==2.20.0)
32
- Requires-Dist: vellum-ai (==1.7.12)
32
+ Requires-Dist: vellum-ai (==1.7.13)
33
33
  Description-Content-Type: text/markdown
34
34
 
35
35
  # Vellum Workflow Runner Server
@@ -15,7 +15,8 @@ workflow_server/core/events.py,sha256=24MA66DVQuaLJJcZrS8IL1Zq4Ohi9CoouKZ5VgoH3C
15
15
  workflow_server/core/executor.py,sha256=rMpVgP3PqMnjHVYeuTdHvbYGwJW5C9O5TFGW926jFM0,16106
16
16
  workflow_server/core/utils.py,sha256=si0NB4Suurc-mn8NYdn59xM9CkPrfOP1aWEVrZvifDI,1929
17
17
  workflow_server/core/workflow_executor_context.py,sha256=Q2R0T2KkYZ1z52v8erDMysJfxSODbzPhDxBxX--k4Zw,3202
18
- workflow_server/server.py,sha256=lhHPmK1PhRZd6eCkj1C0acK3YwaApZgoPHghMChw0fc,1461
18
+ workflow_server/logging_config.py,sha256=Hvx1t8uhqMMinl-5qcef7ufUvzs6x14VRnCb7YZxEAg,1206
19
+ workflow_server/server.py,sha256=UnldeFS6iINBc-Kxl8LQcdAB2SGV6u-Xi5gy5EN466E,1729
19
20
  workflow_server/start.py,sha256=xSIobowtSLoZI86bbMkmEw3pqJHQaFdDyNffk4kGYL8,2544
20
21
  workflow_server/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
22
  workflow_server/utils/exit_handler.py,sha256=_FacDVi4zc3bfTA3D2mJsISePlJ8jpLrnGVo5-xZQFs,743
@@ -28,7 +29,7 @@ workflow_server/utils/tests/test_sentry_integration.py,sha256=14PfuW8AaQNNtqLmBs
28
29
  workflow_server/utils/tests/test_system_utils.py,sha256=_4GwXvVvU5BrATxUEWwQIPg0bzQXMWBtiBmjP8MTxJM,4314
29
30
  workflow_server/utils/tests/test_utils.py,sha256=0Nq6du8o-iBtTrip9_wgHES53JSiJbVdSXaBnPobw3s,6930
30
31
  workflow_server/utils/utils.py,sha256=m7iMJtor5SQLWu7jlJw-X5Q3nmbq69BCxTMv6qnFYrA,4835
31
- vellum_workflow_server-1.7.12.dist-info/METADATA,sha256=yZT9CluUxLUwMmq-Gs3R8WVEXX8PXL99urVqdXgonfw,2269
32
- vellum_workflow_server-1.7.12.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
33
- vellum_workflow_server-1.7.12.dist-info/entry_points.txt,sha256=uB_0yPkr7YV6RhEXzvFReUM8P4OQBlVXD6TN6eb9-oc,277
34
- vellum_workflow_server-1.7.12.dist-info/RECORD,,
32
+ vellum_workflow_server-1.7.13.post1.dist-info/METADATA,sha256=N9S9IyIcQAncCjAxdj9BicVIvd7HyANVvVE1bO4eO8k,2275
33
+ vellum_workflow_server-1.7.13.post1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
34
+ vellum_workflow_server-1.7.13.post1.dist-info/entry_points.txt,sha256=uB_0yPkr7YV6RhEXzvFReUM8P4OQBlVXD6TN6eb9-oc,277
35
+ vellum_workflow_server-1.7.13.post1.dist-info/RECORD,,
@@ -0,0 +1,39 @@
1
+ from datetime import datetime
2
+ import json
3
+ import logging
4
+
5
+
6
+ class GCPJsonFormatter(logging.Formatter):
7
+ """
8
+ Custom JSON formatter for Google Cloud Platform logging.
9
+
10
+ Outputs logs in JSON format with a 'severity' field that GCP Cloud Logging
11
+ can properly parse. This ensures INFO logs show up as INFO in GCP instead of ERROR.
12
+
13
+ See: https://cloud.google.com/logging/docs/structured-logging
14
+ """
15
+
16
+ SEVERITY_MAP = {
17
+ "DEBUG": "DEBUG",
18
+ "INFO": "INFO",
19
+ "WARNING": "WARNING",
20
+ "ERROR": "ERROR",
21
+ "CRITICAL": "CRITICAL",
22
+ }
23
+
24
+ def format(self, record: logging.LogRecord) -> str:
25
+ log_obj = {
26
+ "severity": self.SEVERITY_MAP.get(record.levelname, "DEFAULT"),
27
+ "message": record.getMessage(),
28
+ "timestamp": datetime.utcfromtimestamp(record.created).isoformat() + "Z",
29
+ "logging.googleapis.com/sourceLocation": {
30
+ "file": record.pathname,
31
+ "line": record.lineno,
32
+ "function": record.funcName,
33
+ },
34
+ }
35
+
36
+ if record.exc_info:
37
+ log_obj["exception"] = self.formatException(record.exc_info)
38
+
39
+ return json.dumps(log_obj)
workflow_server/server.py CHANGED
@@ -7,6 +7,7 @@ from workflow_server.api.auth_middleware import AuthMiddleware
7
7
  from workflow_server.api.healthz_view import bp as healthz_bp
8
8
  from workflow_server.api.workflow_view import bp as workflow_bp
9
9
  from workflow_server.config import is_development
10
+ from workflow_server.logging_config import GCPJsonFormatter
10
11
  from workflow_server.utils.sentry import init_sentry
11
12
  from workflow_server.utils.utils import get_version
12
13
 
@@ -14,11 +15,18 @@ from workflow_server.utils.utils import get_version
14
15
  # enable_log_proxy()
15
16
 
16
17
  logger = logging.getLogger(__name__)
17
- logging.basicConfig(
18
- level=logging.INFO,
19
- format="%(asctime)s.%(msecs)03d %(levelname)s %(module)s - %(funcName)s: %(message)s",
20
- datefmt="%Y-%m-%d %H:%M:%S",
21
- )
18
+
19
+ if is_development():
20
+ logging.basicConfig(
21
+ level=logging.INFO,
22
+ format="%(asctime)s.%(msecs)03d %(levelname)s %(module)s - %(funcName)s: %(message)s",
23
+ datefmt="%Y-%m-%d %H:%M:%S",
24
+ )
25
+ else:
26
+ handler = logging.StreamHandler()
27
+ handler.setFormatter(GCPJsonFormatter())
28
+ logging.root.addHandler(handler)
29
+ logging.root.setLevel(logging.INFO)
22
30
 
23
31
 
24
32
  def create_app() -> Flask: