Skip to content

config: update diagcfg to properly set globalDir#6394

Merged
cce merged 2 commits intoalgorand:masterfrom
cce:diagcfg-telemetry
Jul 31, 2025
Merged

config: update diagcfg to properly set globalDir#6394
cce merged 2 commits intoalgorand:masterfrom
cce:diagcfg-telemetry

Conversation

@cce
Copy link
Copy Markdown
Contributor

@cce cce commented Jul 29, 2025

Summary

In #6325, the functions exported in logging/telemetry.go were changed from taking a genesisID string argument to configDir/globalDir string argument, and callers are supposed to look up the global configuration directory using config.GetGlobalConfigFileRoot to properly set this argument.

The diagcfg utility was previously passing an empty genesisID argument, and when that became an empty globalDir argument, the effective global configuration file path used inside logging.ReadTelemetryConfigOrDefault was filepath.Join("", TelemetryConfigFilename) which would not read the correct configuration.

@cce cce added the Bug-Fix label Jul 29, 2025
@cce cce requested review from Copilot and jannotti July 29, 2025 20:36
Copy link
Copy Markdown
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 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.go to use globalDir parameter names consistently
  • Modified diagcfg utility to call config.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

Comment thread cmd/diagcfg/telemetry.go Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@cce cce merged commit d9e8f58 into algorand:master Jul 31, 2025
32 checks passed
@cce cce deleted the diagcfg-telemetry branch July 31, 2025 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants