Skip to content

Conversation

@ilyam8
Copy link
Member

@ilyam8 ilyam8 commented Nov 24, 2025

Summary

Fixes #21343

Test Plan
Additional Information
For users: How does this change affect me?

Summary by cubic

Prioritizes environment-provided config directories in go.d over build-time defaults, so runtime overrides take effect. In terminal runs, ignores env-provided dirs and watch path to prevent accidental overrides.

  • Bug Fixes
    • User config: initUserRoots now checks NETDATA_USER_CONFIG_DIR (env) before buildinfo.UserConfigDir.
    • Stock config: initStockRoot now uses the env-provided stock config dir first, then buildinfo.StockConfigDir, then the relative fallback.
    • Terminal runs: if stdout/stderr is a TTY, ignore NETDATA_USER_CONFIG_DIR, NETDATA_STOCK_CONFIG_DIR, and NETDATA_PLUGINS_GOD_WATCH_PATH.

Written for commit 9fb07ce. Summary will update automatically on new commits.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the configuration directory priority logic to prefer environment-provided directories over build-time defaults. The change ensures that runtime environment variables take precedence when determining configuration paths.

Key Changes:

  • Reversed priority order to check environment variables before buildinfo constants
  • Updated comments to reflect the new precedence rules

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@ilyam8 ilyam8 merged commit a7cd2fe into netdata:master Nov 24, 2025
116 checks passed
@ilyam8 ilyam8 deleted the go.d-env-dirs branch November 24, 2025 11:36
stelfrag pushed a commit to stelfrag/netdata that referenced this pull request Dec 2, 2025
@stelfrag stelfrag mentioned this pull request Dec 2, 2025
Ferroin pushed a commit that referenced this pull request Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/collectors Everything related to data collection area/go collectors/go.d

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Multiple collectors no data

2 participants