mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 02:31:29 +00:00
telemetry: Fix imports
Logging was missing from __init__.py which broke under mac. This adds that back in and remove unused imports from other files. The os check is also moved up to be the first thing we look for since is_google_host does not work with mac at the moment. Bug:326277821 Change-Id: I3f28838d367eb9583332fd33ad35d71c0851fe4b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6604498 Commit-Queue: Struan Shrimpton <sshrimp@google.com> Reviewed-by: Ben Pastene <bpastene@chromium.org>
This commit is contained in:
committed by
LUCI CQ
parent
68f0a29a64
commit
3be09c6d74
@@ -2,19 +2,16 @@
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
from typing import Optional
|
||||
import os
|
||||
import logging
|
||||
import socket
|
||||
import sys
|
||||
import pathlib
|
||||
|
||||
from opentelemetry import context as otel_context_api
|
||||
from opentelemetry import trace as otel_trace_api
|
||||
from opentelemetry.sdk import (
|
||||
resources as otel_resources,
|
||||
trace as otel_trace_sdk,
|
||||
)
|
||||
from opentelemetry.sdk.trace import export as otel_export
|
||||
from opentelemetry.util import types as otel_types
|
||||
|
||||
from . import config
|
||||
from . import clearcut_span_exporter
|
||||
@@ -71,11 +68,11 @@ def is_google_host() -> bool:
|
||||
def initialize(service_name,
|
||||
notice=DEFAULT_BANNER,
|
||||
cfg_file=config.DEFAULT_CONFIG_FILE):
|
||||
if not is_google_host():
|
||||
# TODO(326277821): Add support for other platforms
|
||||
if not sys.platform.startswith('linux'):
|
||||
return
|
||||
|
||||
# TODO(326277821): Add support for other platforms
|
||||
if not sys.platform == 'linux':
|
||||
if not is_google_host():
|
||||
return
|
||||
|
||||
cfg = config.Config(cfg_file)
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
"""Utility for opting in or out of metrics collection"""
|
||||
import argparse
|
||||
import sys
|
||||
import pathlib
|
||||
|
||||
import config
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
import getpass
|
||||
import re
|
||||
import pytest
|
||||
|
||||
from .proto import trace_span_pb2
|
||||
from . import anonymization
|
||||
|
||||
@@ -9,9 +9,8 @@ import time
|
||||
import urllib.error
|
||||
import urllib.request
|
||||
|
||||
from typing import Callable, Dict, Optional, Pattern, Sequence, Tuple
|
||||
from typing import Callable, Dict, Optional, Sequence
|
||||
from google.protobuf import (
|
||||
json_format,
|
||||
message as proto_msg,
|
||||
struct_pb2,
|
||||
)
|
||||
|
||||
@@ -5,20 +5,12 @@
|
||||
|
||||
import contextlib
|
||||
from typing import Any, Iterator, Optional, Sequence
|
||||
import logging
|
||||
import pathlib
|
||||
import sys
|
||||
|
||||
from opentelemetry import context as otel_context_api
|
||||
from opentelemetry import trace as otel_trace_api
|
||||
from opentelemetry.sdk import trace as otel_trace_sdk
|
||||
from opentelemetry.util import types as otel_types
|
||||
|
||||
from . import config
|
||||
from . import clearcut_span_exporter
|
||||
from . import detector
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def use_span(
|
||||
span: otel_trace_api.Span,
|
||||
|
||||
@@ -8,7 +8,6 @@ from typing import Sequence
|
||||
|
||||
from opentelemetry import trace as trace_api
|
||||
from opentelemetry.sdk import trace as trace_sdk
|
||||
from opentelemetry.sdk import resources
|
||||
from opentelemetry.sdk.trace import export as export_sdk
|
||||
|
||||
from . import trace as trace
|
||||
|
||||
Reference in New Issue
Block a user