From 7808e74260037a63dfd1188363125f242818b4d8 Mon Sep 17 00:00:00 2001 From: Will Browne Date: Thu, 6 Apr 2023 11:50:50 +0100 Subject: [PATCH] Plugins: Skip instrumenting plugin build info for core and bundled plugins (#66105) * only instrument plugin build for non core/bundled plugins * fix import --- pkg/plugins/manager/loader/loader.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/plugins/manager/loader/loader.go b/pkg/plugins/manager/loader/loader.go index 6a75a5fb48f..2349b4d255e 100644 --- a/pkg/plugins/manager/loader/loader.go +++ b/pkg/plugins/manager/loader/loader.go @@ -166,8 +166,6 @@ func (l *Loader) loadPlugins(ctx context.Context, src plugins.PluginSource, foun if err != nil { return nil, err } - metrics.SetPluginBuildInformation(p.ID, string(p.Type), p.Info.Version, string(p.Signature)) - if errDeclareRoles := l.roleRegistry.DeclarePluginRoles(ctx, p.ID, p.Name, p.Roles); errDeclareRoles != nil { l.log.Warn("Declare plugin roles failed.", "pluginID", p.ID, "err", errDeclareRoles) } @@ -177,6 +175,10 @@ func (l *Loader) loadPlugins(ctx context.Context, src plugins.PluginSource, foun if err := l.load(ctx, p); err != nil { l.log.Error("Could not start plugin", "pluginId", p.ID, "err", err) } + + if !p.IsCorePlugin() && !p.IsBundledPlugin() { + metrics.SetPluginBuildInformation(p.ID, string(p.Type), p.Info.Version, string(p.Signature)) + } } return verifiedPlugins, nil