Skip to content

Commit

Permalink
LoongcollectorPrometheusAuthorizationPath
Browse files Browse the repository at this point in the history
  • Loading branch information
quzard committed Dec 31, 2024
1 parent 94cd582 commit 4ed0702
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion core/go_pipeline/LogtailPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
36 changes: 18 additions & 18 deletions pkg/config/global_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion plugins/input/prometheus/input_prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4ed0702

Please sign in to comment.