/******************************************************************************* * Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved * Unauthorized copying of this file, via any medium is strictly prohibited. * Proprietary and confidential. ******************************************************************************/#include "PrometheusMetrics.h"namespacezilliz{namespacevecwise{namespaceserver{ServerErrorPrometheusMetrics::Init(){ConfigNode&configNode=ServerConfig::GetInstance().GetConfig(CONFIG_METRIC);startup_=configNode.GetValue(CONFIG_METRIC_IS_STARTUP)=="true"?true:false;// Following should be read from config file.conststd::stringbind_address="8080";conststd::stringuri=std::string("/metrics");conststd::size_tnum_threads=2;// Init Exposerexposer_ptr_=std::make_shared<prometheus::Exposer>(bind_address,uri,num_threads);// Exposer Registryexposer_ptr_->RegisterCollectable(registry_);returnSERVER_SUCCESS;}}}}