Plugins: Add metric to track plugin backend target (#95976)
* add metric to track plugin backend target * tidy * fix test
This commit is contained in:
@@ -127,6 +127,16 @@ func ReportBuildMetrics(_ context.Context, p *plugins.Plugin) (*plugins.Plugin,
|
||||
if !p.IsCorePlugin() && !p.IsBundledPlugin() {
|
||||
metrics.SetPluginBuildInformation(p.ID, string(p.Type), p.Info.Version, string(p.Signature))
|
||||
}
|
||||
|
||||
return p, nil
|
||||
}
|
||||
|
||||
// ReportTargetMetrics reports target information for all backend plugins.
|
||||
func ReportTargetMetrics(_ context.Context, p *plugins.Plugin) (*plugins.Plugin, error) {
|
||||
if p.Backend {
|
||||
metrics.SetPluginTargetInformation(p.ID, string(p.Target()))
|
||||
}
|
||||
|
||||
return p, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user