File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -24,10 +24,11 @@ const (
2424)
2525
2626var (
27- EnablePing bool
28- IgnoreMissingVals bool
29- DsnOverride string
30- TargetLabel string
27+ EnablePing bool
28+ IgnoreMissingVals bool
29+ DsnOverride string
30+ TargetLabel string
31+ kingbaseDatabaseMode = os .Getenv ("KINGBASE.DATABASE_MODE" )
3132)
3233
3334// Load attempts to parse the given config file and return a Config object.
@@ -177,6 +178,13 @@ func (c *Config) YAML() ([]byte, error) {
177178// loadCollectorFiles resolves all collector file globs to files and loads the collectors they define.
178179func (c * Config ) loadCollectorFiles () error {
179180 baseDir := filepath .Dir (c .configFile )
181+
182+ // pg模式下写死采集sql文件
183+ if kingbaseDatabaseMode == "pg" {
184+ klog .Warningf ("Using pg mode, setting collector files to kingbase.collector.pg.yml" )
185+ c .CollectorFiles = []string {"kingbase.collector.pg.yml" }
186+ }
187+
180188 for _ , cfglob := range c .CollectorFiles {
181189 // Resolve relative paths by joining them to the configuration file's directory.
182190 if len (cfglob ) > 0 && ! filepath .IsAbs (cfglob ) {
You can’t perform that action at this time.
0 commit comments