mcp

package module
v0.0.0-...-bd409fd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

README

Monitor the three methods: beforeAny, onSuccess, and onError. All existing hook methods will execute these three methods. beforeAny serves as the start of OpenTelemetry (OTel) tracing, while onSuccess or onError marks the end of OTel tracing.

Currently, the stdio client and server cannot be correlated.

The monitored events are as follows:

MethodInitialize MCPMethod = "initialize"
MethodResourcesList MCPMethod = "resources/list"
MethodResourcesTemplatesList MCPMethod = "resources/templates/list"
MethodResourcesRead MCPMethod = "resources/read"
MethodPromptsList MCPMethod = "prompts/list"
MethodPromptsGet MCPMethod = "prompts/get"
MethodToolsList MCPMethod = "tools/list"
MethodToolsCall MCPMethod = "tools/call"

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClientInstrumenter = BuildClientCommonOtelInstrumenter()
View Source
var ServerInstrumenter = BuildServerCommonOtelInstrumenter()

Functions

func BuildClientCommonOtelInstrumenter

func BuildClientCommonOtelInstrumenter() instrumenter.Instrumenter[mcpRequest, any]

func BuildServerCommonOtelInstrumenter

func BuildServerCommonOtelInstrumenter() instrumenter.Instrumenter[mcpRequest, any]

Types

type LExperimentalAttributeExtractor

type LExperimentalAttributeExtractor struct {
	Base ai.AICommonAttrsExtractor[mcpRequest, any, aiCommonRequest]
}

func (LExperimentalAttributeExtractor) OnEnd

func (l LExperimentalAttributeExtractor) OnEnd(attributes []attribute.KeyValue, context context.Context, request mcpRequest, response any, err error) ([]attribute.KeyValue, context.Context)

func (LExperimentalAttributeExtractor) OnStart

func (l LExperimentalAttributeExtractor) OnStart(attributes []attribute.KeyValue, parentContext context.Context, request mcpRequest) ([]attribute.KeyValue, context.Context)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL