MM-21626, MM-21627 - Plugin API/Hooks Prometheus instrumentati… (#13825)
* MM-21626,MM-21627 - Plugin API/Hooks Prometheus instrumentation * Updated einterface mocks * Fixed supervisor tests * ignoring golint errors for plugin metrics wrappers * Making golangci happy * Using variadic form when generating wrapper code * Removed artificial delay * Removed comments from tests * Renaming plugin wrappers to api/hooks_timer_layer * updating vendor dir and mod files * Recording plugin api/hook responses in prometheus * Updated einterfaces-mocks * Updating go sum * Updating go sum * Fixing conflicts * More conflicts fixing Co-authored-by: mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
@@ -13,6 +13,7 @@ import (
|
||||
"time"
|
||||
|
||||
plugin "github.com/hashicorp/go-plugin"
|
||||
"github.com/mattermost/mattermost-server/v5/einterfaces"
|
||||
"github.com/mattermost/mattermost-server/v5/mlog"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
)
|
||||
@@ -25,7 +26,7 @@ type supervisor struct {
|
||||
pid int
|
||||
}
|
||||
|
||||
func newSupervisor(pluginInfo *model.BundleInfo, parentLogger *mlog.Logger, apiImpl API) (retSupervisor *supervisor, retErr error) {
|
||||
func newSupervisor(pluginInfo *model.BundleInfo, apiImpl API, parentLogger *mlog.Logger, metrics einterfaces.MetricsInterface) (retSupervisor *supervisor, retErr error) {
|
||||
sup := supervisor{}
|
||||
defer func() {
|
||||
if retErr != nil {
|
||||
@@ -43,7 +44,7 @@ func newSupervisor(pluginInfo *model.BundleInfo, parentLogger *mlog.Logger, apiI
|
||||
pluginMap := map[string]plugin.Plugin{
|
||||
"hooks": &hooksPlugin{
|
||||
log: wrappedLogger,
|
||||
apiImpl: apiImpl,
|
||||
apiImpl: &apiTimerLayer{pluginInfo.Manifest.Id, apiImpl, metrics},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -80,7 +81,7 @@ func newSupervisor(pluginInfo *model.BundleInfo, parentLogger *mlog.Logger, apiI
|
||||
return nil, err
|
||||
}
|
||||
|
||||
sup.hooks = raw.(Hooks)
|
||||
sup.hooks = &hooksTimerLayer{pluginInfo.Manifest.Id, raw.(Hooks), metrics}
|
||||
|
||||
impl, err := sup.hooks.Implemented()
|
||||
if err != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user