diff --git a/core/go_pipeline/LogtailPlugin.cpp b/core/go_pipeline/LogtailPlugin.cpp index a163e68de0..d1d173c1a4 100644 --- a/core/go_pipeline/LogtailPlugin.cpp +++ b/core/go_pipeline/LogtailPlugin.cpp @@ -73,7 +73,7 @@ LogtailPlugin::LogtailPlugin() { mPluginCfg["LoongcollectorVersionTag"] = GetVersionTag(); mPluginCfg["LoongcollectorCheckPointFile"] = GetGoPluginCheckpoint(); mPluginCfg["LoongcollectorThirdPartyDir"] = GetAgentThirdPartyDir(); - mPluginCfg["PrometheusAuthorizationPath"] = GetAgentPrometheusAuthorizationPath(); + mPluginCfg["LoongcollectorPrometheusAuthorizationPath"] = GetAgentPrometheusAuthorizationPath(); mPluginCfg["HostIP"] = LoongCollectorMonitor::mIpAddr; mPluginCfg["Hostname"] = LoongCollectorMonitor::mHostname; mPluginCfg["EnableContainerdUpperDirDetect"] = BOOL_FLAG(enable_containerd_upper_dir_detect); diff --git a/pkg/config/global_config.go b/pkg/config/global_config.go index f2f9dd9a56..9e7d079597 100644 --- a/pkg/config/global_config.go +++ b/pkg/config/global_config.go @@ -29,7 +29,7 @@ type GlobalConfig struct { DefaultLogGroupQueueSize int Tags map[string]string // Directory to store prometheus configuration file. - PrometheusAuthorizationPath string + LoongcollectorPrometheusAuthorizationPath string // Directory to store loongcollector data, such as checkpoint, etc. LoongcollectorConfDir string // Directory to store loongcollector log config. @@ -69,23 +69,23 @@ var UserAgent = fmt.Sprintf("ilogtail/%v (%v)", BaseVersion, runtime.GOOS) // se func newGlobalConfig() (cfg GlobalConfig) { cfg = GlobalConfig{ - InputMaxFirstCollectDelayMs: 10000, // 10s - InputIntervalMs: 1000, // 1s - AggregatIntervalMs: 3000, - FlushIntervalMs: 3000, - DefaultLogQueueSize: 1000, - DefaultLogGroupQueueSize: 4, - LoongcollectorConfDir: "./conf/", - LoongcollectorLogConfDir: "./conf/", - LoongcollectorLogDir: "./log/", - LoongcollectorPluginLogName: "go_plugin.LOG", - LoongcollectorVersionTag: "loongcollector_version", - LoongcollectorCheckPointFile: "go_plugin_checkpoint", - LoongcollectorDataDir: "./data/", - LoongcollectorDebugDir: "./debug/", - LoongcollectorThirdPartyDir: "./thirdparty/", - PrometheusAuthorizationPath: "./conf/", - DelayStopSec: 300, + InputMaxFirstCollectDelayMs: 10000, // 10s + InputIntervalMs: 1000, // 1s + AggregatIntervalMs: 3000, + FlushIntervalMs: 3000, + DefaultLogQueueSize: 1000, + DefaultLogGroupQueueSize: 4, + LoongcollectorConfDir: "./conf/", + LoongcollectorLogConfDir: "./conf/", + LoongcollectorLogDir: "./log/", + LoongcollectorPluginLogName: "go_plugin.LOG", + LoongcollectorVersionTag: "loongcollector_version", + LoongcollectorCheckPointFile: "go_plugin_checkpoint", + LoongcollectorDataDir: "./data/", + LoongcollectorDebugDir: "./debug/", + LoongcollectorThirdPartyDir: "./thirdparty/", + LoongcollectorPrometheusAuthorizationPath: "./conf/", + DelayStopSec: 300, } return } diff --git a/plugins/input/prometheus/input_prometheus.go b/plugins/input/prometheus/input_prometheus.go index c4f08c969b..6a19c7cd62 100644 --- a/plugins/input/prometheus/input_prometheus.go +++ b/plugins/input/prometheus/input_prometheus.go @@ -85,7 +85,7 @@ func (p *ServiceStaticPrometheus) Init(context pipeline.Context) (int, error) { case p.Yaml != "": detail = []byte(p.Yaml) if p.AuthorizationPath == "" { - p.AuthorizationPath = config.LoongcollectorGlobalConfig.PrometheusAuthorizationPath + p.AuthorizationPath = config.LoongcollectorGlobalConfig.LoongcollectorPrometheusAuthorizationPath } case p.ConfigFilePath != "": f, err := os.Open(p.ConfigFilePath)