Skip to content

Making the logic for loading customs simplir#911

Merged
i3149 merged 1 commit into
mainfrom
simplify-customs
Jun 25, 2026
Merged

Making the logic for loading customs simplir#911
i3149 merged 1 commit into
mainfrom
simplify-customs

Conversation

@i3149

@i3149 i3149 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings June 25, 2026 15:09
@i3149 i3149 merged commit 7b6f40f into main Jun 25, 2026
3 checks passed
@i3149 i3149 deleted the simplify-customs branch June 25, 2026 15:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 aims to simplify how device custom columns (“customs”) are loaded via the Kentik gRPC API by replacing multiple environment-controlled code paths with a single “load customs for all devices” toggle and retaining optional lazy loading.

Changes:

  • Replaced KT_NO_CUSTOM_COLUMNS / KT_LOAD_CUSTOM_COLS_FOR_DEVS with a single KT_LOAD_CUSTOM_COLUMNS flag.
  • Added fullLoadCustoms to KentikApi and wired it into the ListDevices request’s NoCustomColumns behavior.
  • Removed per-device custom preloading logic in getDeviceInfoNew.

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

Comment thread pkg/api/api.go
Comment on lines 104 to +108
lazyLoadCustoms: kt.LookupEnvBool(KT_API_LAZY_LOAD_CUSTOMS, false),
fullLoadCustoms: kt.LookupEnvBool(KT_LOAD_CUSTOM_COLUMNS, false),
}

log.Infof("Setting API timeout to %v, loadInterfaces=%v, lazyLoadCustoms=%v", apiTimeout, kapi.loadInterfaces, kapi.lazyLoadCustoms)
log.Infof("Setting API timeout to %v, loadInterfaces=%v, lazyLoadCustoms=%v, fullyLoadCustoms=%v", apiTimeout, kapi.loadInterfaces, kapi.lazyLoadCustoms, kapi.fullLoadCustoms)
Comment thread pkg/api/api.go
Comment on lines 522 to 525
resDev := map[kt.Cid]kt.Devices{}
num := 0
deviceIds := []string{}
deviceCustomsLoad := map[string]bool{}
for _, pts := range strings.Split(kt.LookupEnvString(KT_LOAD_CUSTOM_COLS_FOR_DEVS, ""), ",") {
deviceCustomsLoad[pts] = true
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants