Plugins: Add backend target to instrumentation (#61980)

* add target

* fix test
This commit is contained in:
Will Browne
2023-01-24 16:18:34 +01:00
committed by GitHub
parent 6e126596e0
commit 958eea2f78
7 changed files with 68 additions and 18 deletions

View File

@ -267,6 +267,16 @@ func (p *Plugin) Exited() bool {
return false
}
func (p *Plugin) Target() backendplugin.Target {
if !p.Backend {
return backendplugin.TargetNone
}
if p.client == nil {
return backendplugin.TargetUnknown
}
return p.client.Target()
}
func (p *Plugin) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error) {
pluginClient, ok := p.Client()
if !ok {