config: update diagcfg to properly set globalDir#6394
Merged
cce merged 2 commits intoalgorand:masterfrom Jul 31, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the diagcfg utility to properly read telemetry configuration files after API changes in #6325. The logging/telemetry functions now require a global configuration directory path instead of a genesis ID, and callers must use config.GetGlobalConfigFileRoot() to obtain the correct path.
- Updated function signatures in
logging/telemetry.goto useglobalDirparameter names consistently - Modified
diagcfgutility to callconfig.GetGlobalConfigFileRoot()instead of passing empty string - Added proper error handling for the global directory lookup
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| logging/telemetry.go | Updated parameter names from configDir to globalDir for consistency |
| cmd/diagcfg/telemetry.go | Fixed telemetry config reading by using proper global directory lookup |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
jannotti
approved these changes
Jul 31, 2025
onetechnical
approved these changes
Jul 31, 2025
This was referenced Jul 31, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In #6325, the functions exported in logging/telemetry.go were changed from taking a
genesisID stringargument toconfigDir/globalDir stringargument, and callers are supposed to look up the global configuration directory usingconfig.GetGlobalConfigFileRootto properly set this argument.The
diagcfgutility was previously passing an emptygenesisIDargument, and when that became an emptyglobalDirargument, the effective global configuration file path used insidelogging.ReadTelemetryConfigOrDefaultwasfilepath.Join("", TelemetryConfigFilename)which would not read the correct configuration.