| Index: client/third_party/infra_libs/ts_mon/config.py
|
| diff --git a/client/third_party/infra_libs/ts_mon/config.py b/client/third_party/infra_libs/ts_mon/config.py
|
| index 51232b2ee72a36f09673caffa5308706682cc97b..8da453fe304125378c5b977d8f037b44c07db286 100644
|
| --- a/client/third_party/infra_libs/ts_mon/config.py
|
| +++ b/client/third_party/infra_libs/ts_mon/config.py
|
| @@ -83,9 +83,8 @@ def add_argparse_options(parser):
|
| 'whitelisting and deployment of credentials. (default: %(default)s)')
|
| parser.add_argument(
|
| '--ts-mon-endpoint',
|
| - help='url (including file://, pubsub://project/topic, https://) to post '
|
| - 'monitoring metrics to. If set, overrides the value in '
|
| - '--ts-mon-config-file')
|
| + help='url (file:// or https://) to post monitoring metrics to. If set, '
|
| + 'overrides the value in --ts-mon-config-file')
|
| parser.add_argument(
|
| '--ts-mon-credentials',
|
| help='path to a pkcs8 json credential file. If set, overrides the value '
|
| @@ -172,8 +171,8 @@ def add_argparse_options(parser):
|
|
|
| parser.add_argument(
|
| '--ts-mon-use-new-proto',
|
| - default=False, action='store_true',
|
| - help='use the new proto schema (default: false)')
|
| + default=True, action='store_true',
|
| + help='deprecated and ignored')
|
|
|
|
|
| def process_argparse_options(args):
|
| @@ -192,15 +191,12 @@ def process_argparse_options(args):
|
| endpoint = config.get('endpoint', '')
|
| credentials = config.get('credentials', '')
|
| autogen_hostname = config.get('autogen_hostname', False)
|
| - use_new_proto = config.get('use_new_proto', False)
|
|
|
| # Command-line args override the values in the config file.
|
| if args.ts_mon_endpoint is not None:
|
| endpoint = args.ts_mon_endpoint
|
| if args.ts_mon_credentials is not None:
|
| credentials = args.ts_mon_credentials
|
| - if args.ts_mon_use_new_proto:
|
| - use_new_proto = args.ts_mon_use_new_proto
|
|
|
| if args.ts_mon_target_type == 'device':
|
| hostname = args.ts_mon_device_hostname
|
| @@ -237,17 +233,6 @@ def process_argparse_options(args):
|
| if endpoint.startswith('file://'):
|
| interface.state.global_monitor = monitors.DebugMonitor(
|
| endpoint[len('file://'):])
|
| - elif endpoint.startswith('pubsub://'):
|
| - if credentials:
|
| - url = urlparse.urlparse(endpoint)
|
| - project = url.netloc
|
| - topic = url.path.strip('/')
|
| - interface.state.global_monitor = monitors.PubSubMonitor(
|
| - monitors.CredentialFactory.from_string(credentials), project, topic,
|
| - use_instrumented_http=True, ca_certs=args.ts_mon_ca_certs)
|
| - else:
|
| - logging.error('ts_mon monitoring is disabled because credentials are not '
|
| - 'available')
|
| elif endpoint.startswith('https://'):
|
| interface.state.global_monitor = monitors.HttpsMonitor(
|
| endpoint, monitors.CredentialFactory.from_string(credentials),
|
| @@ -259,7 +244,6 @@ def process_argparse_options(args):
|
| ' is invalid or not supported: %s', endpoint)
|
|
|
| interface.state.flush_mode = args.ts_mon_flush
|
| - interface.state.use_new_proto = use_new_proto
|
|
|
| if args.ts_mon_flush == 'auto':
|
| interface.state.flush_thread = interface._FlushThread(
|
|
|