Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
smetrics = None
# We need account and host ID to get server side configuration
if config.pull_server_side_config:
config.user_key_required(not config.daemon)
config.agent_key_required()
# Ensure all configured logs are created
if config.configured_logs and not config.datahub:
create_configured_logs(config.configured_logs)
if config.daemon:
daemonize()
# Start default transport channel
default_transport = DefaultTransport(config)
# Register resource monitoring
if config.agent_key != NOT_SET and config.v1_metrics != 'False':
log.debug("Enabling V1 metrics")
stats = Stats()
stats.start()
else:
log.debug("V1 metrics disabled")
formatter = formats.FormatSyslog(config.hostname, 'le',
config.metrics.token)
smetrics = metrics.Metrics(config.metrics, default_transport,
formatter, config.debug_metrics)
smetrics.start()
followers = []
transports = []