Skip to content

Commit efc672d

Browse files
Release 1.12.12 (tracks 5ec85d9e05cd66e09277f165583468cea0338f3d)
1 parent 0d575bc commit efc672d

30 files changed

Lines changed: 92 additions & 1547 deletions
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.12.11"
1+
__version__ = "1.12.12"

dagster-cloud-examples/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ classifiers = [
1919
"Operating System :: OS Independent",
2020
]
2121
dependencies = [
22-
"dagster-cloud==1.12.11",
22+
"dagster-cloud==1.12.12",
2323
]
2424

2525
[project.license]

dagster-cloud/dagster_cloud/agent/dagster_cloud_agent.py

Lines changed: 33 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@
3232
from dagster_cloud_cli.core.workspace import CodeLocationDeployData
3333
from dagster_shared.record import replace
3434

35-
from dagster_cloud.agent.instrumentation.constants import DAGSTER_CLOUD_AGENT_METRIC_PREFIX
36-
from dagster_cloud.agent.instrumentation.run_launch import extract_run_attributes
37-
from dagster_cloud.agent.instrumentation.schedule import inspect_schedule_result
38-
from dagster_cloud.agent.instrumentation.sensor import inspect_sensor_result
3935
from dagster_cloud.agent.queries import (
4036
ADD_AGENT_HEARTBEATS_MUTATION,
4137
DEPLOYMENTS_QUERY,
@@ -59,7 +55,6 @@
5955
)
6056
from dagster_cloud.batching import Batcher
6157
from dagster_cloud.instance import DagsterCloudAgentInstance
62-
from dagster_cloud.opentelemetry.observers.execution_observer import observe_execution
6358
from dagster_cloud.util import SERVER_HANDLE_TAG, compressed_namedtuple_upload_file, is_isolated_run
6459
from dagster_cloud.version import __version__
6560
from dagster_cloud.workspace.user_code_launcher import (
@@ -981,29 +976,12 @@ def _handle_api_request(
981976
instance_ref=self._get_user_code_instance_ref(deployment_name),
982977
)
983978

984-
schedule_attributes = {
985-
"schedule": args.schedule_name,
986-
"repository": args.repository_origin.repository_name,
987-
"location": args.repository_origin.code_location_origin.location_name,
988-
"deployment": deployment_name,
989-
}
990-
991-
with observe_execution(
992-
opentelemetry=self._instance.opentelemetry,
993-
event_key=f"{DAGSTER_CLOUD_AGENT_METRIC_PREFIX}.schedule.evaluation",
994-
short_description="schedule evaluation requests",
995-
attributes=schedule_attributes,
996-
result_evaluator_callback=inspect_schedule_result,
997-
) as observer:
998-
serialized_schedule_data_or_error = client.external_schedule_execution(
999-
external_schedule_execution_args=args,
1000-
)
1001-
observer.evaluate_result(
1002-
serialized_data_or_error=serialized_schedule_data_or_error,
1003-
)
1004-
return DagsterCloudApiGrpcResponse(
1005-
serialized_response_or_error=serialized_schedule_data_or_error
1006-
)
979+
serialized_schedule_data_or_error = client.external_schedule_execution(
980+
external_schedule_execution_args=args,
981+
)
982+
return DagsterCloudApiGrpcResponse(
983+
serialized_response_or_error=serialized_schedule_data_or_error
984+
)
1007985

1008986
elif api_name == DagsterCloudApi.GET_EXTERNAL_SENSOR_EXECUTION_DATA:
1009987
client = self._get_grpc_client(
@@ -1015,27 +993,12 @@ def _handle_api_request(
1015993
instance_ref=self._get_user_code_instance_ref(deployment_name),
1016994
)
1017995

1018-
sensor_attributes = {
1019-
"sensor": args.sensor_name,
1020-
"repository": args.repository_origin.repository_name,
1021-
"location": args.repository_origin.code_location_origin.location_name,
1022-
"deployment": deployment_name,
1023-
}
1024-
1025-
with observe_execution(
1026-
opentelemetry=self._instance.opentelemetry,
1027-
event_key=f"{DAGSTER_CLOUD_AGENT_METRIC_PREFIX}.sensor.evaluation",
1028-
short_description="sensor evaluation requests",
1029-
attributes=sensor_attributes,
1030-
result_evaluator_callback=inspect_sensor_result,
1031-
) as observer:
1032-
serialized_sensor_data_or_error = client.external_sensor_execution(
1033-
sensor_execution_args=args,
1034-
)
1035-
observer.evaluate_result(serialized_sensor_data_or_error)
1036-
return DagsterCloudApiGrpcResponse(
1037-
serialized_response_or_error=serialized_sensor_data_or_error
1038-
)
996+
serialized_sensor_data_or_error = client.external_sensor_execution(
997+
sensor_execution_args=args,
998+
)
999+
return DagsterCloudApiGrpcResponse(
1000+
serialized_response_or_error=serialized_sensor_data_or_error
1001+
)
10391002
elif api_name == DagsterCloudApi.GET_EXTERNAL_NOTEBOOK_DATA:
10401003
client = self._get_grpc_client(
10411004
user_code_launcher, deployment_name, cast("str", location_name)
@@ -1066,42 +1029,32 @@ def _handle_api_request(
10661029
),
10671030
)
10681031

1069-
run_attributes = extract_run_attributes(deployment_name, run)
1070-
with observe_execution(
1071-
opentelemetry=self._instance.opentelemetry,
1072-
event_key=f"{DAGSTER_CLOUD_AGENT_METRIC_PREFIX}.run.launches",
1073-
short_description="run execution requests",
1074-
attributes=run_attributes,
1075-
) as observer:
1076-
launcher = scoped_instance.get_run_launcher_for_run(run) # type: ignore # (instance subclass)
1032+
launcher = scoped_instance.get_run_launcher_for_run(run) # type: ignore # (instance subclass)
10771033

1078-
if is_isolated_run(run):
1079-
launcher.launch_run(LaunchRunContext(dagster_run=run, workspace=None))
1080-
else:
1081-
scoped_instance.report_engine_event(
1082-
f"Launching {run.run_id} without an isolated run environment.",
1083-
run,
1084-
cls=self.__class__,
1085-
)
1034+
if is_isolated_run(run):
1035+
launcher.launch_run(LaunchRunContext(dagster_run=run, workspace=None))
1036+
else:
1037+
scoped_instance.report_engine_event(
1038+
f"Launching {run.run_id} without an isolated run environment.",
1039+
run,
1040+
cls=self.__class__,
1041+
)
10861042

1087-
run_location_name = cast(
1088-
"str",
1089-
run.remote_job_origin.repository_origin.code_location_origin.location_name,
1090-
)
1043+
run_location_name = cast(
1044+
"str",
1045+
run.remote_job_origin.repository_origin.code_location_origin.location_name,
1046+
)
10911047

1092-
server = user_code_launcher.get_grpc_server(
1093-
deployment_name, run_location_name
1094-
)
1048+
server = user_code_launcher.get_grpc_server(deployment_name, run_location_name)
10951049

1096-
# Record the server handle that we launched it on to for run monitoring
1097-
scoped_instance.add_run_tags(
1098-
run.run_id, new_tags={SERVER_HANDLE_TAG: str(server.server_handle)}
1099-
)
1050+
# Record the server handle that we launched it on to for run monitoring
1051+
scoped_instance.add_run_tags(
1052+
run.run_id, new_tags={SERVER_HANDLE_TAG: str(server.server_handle)}
1053+
)
11001054

1101-
launcher.launch_run_from_grpc_client(
1102-
scoped_instance, run, server.server_endpoint.create_client()
1103-
)
1104-
observer.evaluate_result(run=run)
1055+
launcher.launch_run_from_grpc_client(
1056+
scoped_instance, run, server.server_endpoint.create_client()
1057+
)
11051058

11061059
return DagsterCloudApiSuccess()
11071060
elif api_name == DagsterCloudApi.TERMINATE_RUN:

dagster-cloud/dagster_cloud/agent/instrumentation/__init__.py

Whitespace-only changes.

dagster-cloud/dagster_cloud/agent/instrumentation/constants.py

Lines changed: 0 additions & 2 deletions
This file was deleted.

dagster-cloud/dagster_cloud/agent/instrumentation/run_launch.py

Lines changed: 0 additions & 23 deletions
This file was deleted.

dagster-cloud/dagster_cloud/agent/instrumentation/schedule.py

Lines changed: 0 additions & 34 deletions
This file was deleted.

dagster-cloud/dagster_cloud/agent/instrumentation/sensor.py

Lines changed: 0 additions & 34 deletions
This file was deleted.

dagster-cloud/dagster_cloud/instance/__init__.py

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import copy
22
import socket
33
import uuid
4-
from collections.abc import Mapping, Sequence
4+
from collections.abc import Sequence
55
from contextlib import ExitStack
66
from functools import lru_cache
77
from typing import TYPE_CHECKING, Any, Optional, Union
@@ -34,11 +34,8 @@
3434

3535
from dagster_cloud.agent import AgentQueuesConfig
3636
from dagster_cloud.auth.constants import decode_agent_token
37-
from dagster_cloud.opentelemetry.config import opentelemetry_config_schema
38-
from dagster_cloud.opentelemetry.controller import OpenTelemetryController
3937
from dagster_cloud.storage.client import dagster_cloud_api_config
4038
from dagster_cloud.util import get_env_names_from_config, is_isolated_run
41-
from dagster_cloud.version import __version__
4239

4340
if TYPE_CHECKING:
4441
from requests import Session
@@ -83,7 +80,6 @@ def __init__(
8380
allowed_full_deployment_locations=None,
8481
allowed_branch_deployment_locations=None,
8582
agent_metrics=None,
86-
opentelemetry=None,
8783
**kwargs,
8884
):
8985
super().__init__(*args, **kwargs)
@@ -155,12 +151,6 @@ def __init__(
155151
allowed_branch_deployment_locations
156152
)
157153

158-
self._opentelemetry_config: Optional[Mapping[str, Any]] = self._get_processed_config(
159-
"opentelemetry", opentelemetry, opentelemetry_config_schema()
160-
)
161-
162-
self._opentelemetry_controller: Optional[OpenTelemetryController] = None
163-
164154
self._instance_uuid = str(uuid.uuid4())
165155

166156
@property
@@ -582,9 +572,6 @@ def config_schema(cls):
582572
is_required=False,
583573
description="List of allowed location names for branch deployments",
584574
),
585-
"opentelemetry": Field(
586-
opentelemetry_config_schema(), is_required=False, default_value={"enabled": False}
587-
),
588575
}
589576

590577
@classmethod
@@ -667,9 +654,6 @@ def config_defaults(base_dir):
667654

668655
def dispose(self) -> None:
669656
super().dispose()
670-
if self._opentelemetry_controller:
671-
self._opentelemetry_controller.dispose()
672-
self._opentelemetry_controller = None
673657
self._exit_stack.close()
674658

675659
@property
@@ -690,17 +674,6 @@ def dagster_cloud_run_worker_monitoring_interval_seconds(self) -> int:
690674
# potentially overridden interval in the serverless user code launcher
691675
return 30
692676

693-
@property
694-
def opentelemetry(self) -> OpenTelemetryController:
695-
if not self._opentelemetry_controller:
696-
self._opentelemetry_controller = OpenTelemetryController(
697-
instance_id=self.instance_uuid,
698-
version=__version__,
699-
config=self._opentelemetry_config,
700-
)
701-
702-
return self._opentelemetry_controller
703-
704677

705678
@lru_cache(maxsize=100) # Scales on order of active branch deployments
706679
def _cached_inject_deployment(

dagster-cloud/dagster_cloud/opentelemetry/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)