Skip to content

Commit

Permalink
add deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
slicklash authored and grariel committed Aug 19, 2024
1 parent b6cbb3c commit a2b7192
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions gprofiler/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
from granulate_utils.linux.ns import is_running_in_init_pid
from granulate_utils.linux.process import is_process_running
from granulate_utils.metadata.cloud import get_aws_execution_env
from granulate_utils.metadata.databricks_client import DBXWebUIEnvWrapper, get_name_from_metadata
from psutil import NoSuchProcess, Process
from requests import RequestException, Timeout

Expand Down Expand Up @@ -798,11 +797,7 @@ def parse_cmd_args() -> configargparse.Namespace:
action="store_true",
dest="databricks_job_name_as_service_name",
default=False,
help="gProfiler will set service name to Databricks' job name on ephemeral clusters. It'll delay the beginning"
" of the profiling due to repeated waiting for Spark's metrics server."
' service name format is: "databricks-job-<JOB-NAME>".'
" Note that in any case that the job name is not available due to redaction,"
" gProfiler will fallback to use the clusterName property.",
help="Deprecated! Removed in version 1.49.0",
)

parser.add_argument(
Expand Down Expand Up @@ -1019,6 +1014,9 @@ def warn_about_deprecated_args(args: configargparse.Namespace) -> None:
if args.collect_spark_metrics:
logger.warning("--collect-spark-metrics is deprecated and removed in version 1.42.0")

if args.databricks_job_name_as_service_name:
logger.warning("--databricks-job-name-as-service-name is deprecated and removed in version 1.49.0")


def main() -> None:
args = parse_cmd_args()
Expand Down Expand Up @@ -1059,19 +1057,6 @@ def main() -> None:
# assume we run in the root cgroup (when containerized, that's our view)
usage_logger = CgroupsUsageLogger(logger, "/") if args.log_usage else NoopUsageLogger()

if args.databricks_job_name_as_service_name:
# "databricks" will be the default name in case of failure with --databricks-job-name-as-service-name flag
args.service_name = "databricks"
dbx_web_ui_wrapper = DBXWebUIEnvWrapper(logger)
dbx_metadata = dbx_web_ui_wrapper.all_props_dict
if dbx_metadata is not None:
service_suffix = get_name_from_metadata(dbx_metadata)
if service_suffix is not None:
args.service_name = f"databricks-{service_suffix}"

if remote_logs_handler is not None:
remote_logs_handler.update_service_name(args.service_name)

try:
logger.info(
"Running gProfiler", version=__version__, commandline=" ".join(sys.argv[1:]), arguments=args.__dict__
Expand Down

0 comments on commit a2b7192

Please sign in to comment.