Documentation
¶
Index ¶
- Constants
- Variables
- func Init()
- func RecordCatalogOperation(ctx context.Context, operation string, catalogName string, durationMs float64, ...)
- func RecordCatalogServers(ctx context.Context, catalogName string, serverCount int64)
- func RecordGatewayStart(ctx context.Context, transportMode string)
- func RecordInitialize(ctx context.Context, params *mcp.InitializeParams)
- func RecordListPrompts(ctx context.Context, clientName string)
- func RecordListResourceTemplates(ctx context.Context, clientName string)
- func RecordListResources(ctx context.Context, clientName string)
- func RecordListTools(ctx context.Context, clientName string)
- func RecordPromptDuration(ctx context.Context, promptName string, serverName string, durationMs float64, ...)
- func RecordPromptError(ctx context.Context, promptName string, serverName string, errorType string)
- func RecordPromptGet(ctx context.Context, promptName string, serverName string, clientName string)
- func RecordPromptList(ctx context.Context, serverName string, promptCount int)
- func RecordResourceDuration(ctx context.Context, resourceURI string, serverName string, durationMs float64, ...)
- func RecordResourceError(ctx context.Context, resourceURI string, serverName string, errorType string)
- func RecordResourceList(ctx context.Context, serverName string, resourceCount int)
- func RecordResourceRead(ctx context.Context, resourceURI string, serverName string, clientName string)
- func RecordResourceTemplateDuration(ctx context.Context, uriTemplate string, serverName string, durationMs float64, ...)
- func RecordResourceTemplateError(ctx context.Context, uriTemplate string, serverName string, errorType string)
- func RecordResourceTemplateList(ctx context.Context, serverName string, templateCount int)
- func RecordResourceTemplateRead(ctx context.Context, uriTemplate string, serverName string, clientName string)
- func RecordToolError(ctx context.Context, span trace.Span, serverName, serverType, toolName string)
- func RecordToolList(ctx context.Context, serverName string, toolCount int)
- func StartCommandSpan(ctx context.Context, commandPath string, attrs ...attribute.KeyValue) (context.Context, trace.Span)
- func StartInitializeSpan(ctx context.Context, attrs ...attribute.KeyValue) (context.Context, trace.Span)
- func StartInterceptorSpan(ctx context.Context, when, interceptorType string, attrs ...attribute.KeyValue) (context.Context, trace.Span)
- func StartListSpan(ctx context.Context, listType string, attrs ...attribute.KeyValue) (context.Context, trace.Span)
- func StartPromptSpan(ctx context.Context, promptName string, attrs ...attribute.KeyValue) (context.Context, trace.Span)
- func StartResourceSpan(ctx context.Context, resourceURI string, attrs ...attribute.KeyValue) (context.Context, trace.Span)
- func StartResourceTemplateSpan(ctx context.Context, uriTemplate string, attrs ...attribute.KeyValue) (context.Context, trace.Span)
- func StartToolCallSpan(ctx context.Context, toolName string, attrs ...attribute.KeyValue) (context.Context, trace.Span)
Constants ¶
const ( // ServiceName is the service name for MCP Gateway telemetry ServiceName = "docker-mcp-gateway" // TracerName is the tracer name for MCP Gateway TracerName = "github.com/docker/mcp-gateway" // MeterName is the meter name for MCP Gateway MeterName = "github.com/docker/mcp-gateway" )
Variables ¶
var ( // ToolCallCounter tracks the number of tool calls with server attribution ToolCallCounter metric.Int64Counter // ToolCallDuration tracks the duration of tool calls in milliseconds ToolCallDuration metric.Float64Histogram // ToolErrorCounter tracks tool call errors by type and server ToolErrorCounter metric.Int64Counter // GatewayStartCounter tracks gateway starts GatewayStartCounter metric.Int64Counter // InitializeCounter tracks initialize calls InitializeCounter metric.Int64Counter // ListToolsCounter tracks list tools calls ListToolsCounter metric.Int64Counter // Catalog operation metrics CatalogOperationsCounter metric.Int64Counter CatalogOperationDuration metric.Float64Histogram CatalogServersGauge metric.Int64Gauge // Tool discovery metrics ToolsDiscovered metric.Int64Gauge // Prompt operation metrics PromptGetCounter metric.Int64Counter PromptDuration metric.Float64Histogram PromptErrorCounter metric.Int64Counter PromptsDiscovered metric.Int64Gauge ListPromptsCounter metric.Int64Counter // Resource operation metrics ResourceReadCounter metric.Int64Counter ResourceDuration metric.Float64Histogram ResourceErrorCounter metric.Int64Counter ResourcesDiscovered metric.Int64Gauge ListResourcesCounter metric.Int64Counter // Resource template operation metrics ResourceTemplateReadCounter metric.Int64Counter ResourceTemplateDuration metric.Float64Histogram ResourceTemplateErrorCounter metric.Int64Counter ResourceTemplatesDiscovered metric.Int64Gauge ListResourceTemplatesCounter metric.Int64Counter )
Functions ¶
func RecordCatalogOperation ¶
func RecordCatalogOperation(ctx context.Context, operation string, catalogName string, durationMs float64, success bool)
RecordCatalogOperation records a catalog operation with duration
func RecordCatalogServers ¶
RecordCatalogServers records the number of servers in catalogs
func RecordGatewayStart ¶
RecordGatewayStart records a gateway start event
func RecordInitialize ¶
func RecordInitialize(ctx context.Context, params *mcp.InitializeParams)
func RecordListPrompts ¶
RecordListPrompts records a list prompts call (similar to RecordListTools)
func RecordListResourceTemplates ¶
RecordListResourceTemplates records a list resource templates call
func RecordListResources ¶
RecordListResources records a list resources call
func RecordListTools ¶
RecordListTools records a list tools call
func RecordPromptDuration ¶
func RecordPromptDuration(ctx context.Context, promptName string, serverName string, durationMs float64, clientName string)
RecordPromptDuration records the duration of a prompt operation
func RecordPromptError ¶
RecordPromptError records a prompt operation error
func RecordPromptGet ¶
RecordPromptGet records a prompt get operation
func RecordPromptList ¶
RecordPromptList records the number of prompts discovered from a server
func RecordResourceDuration ¶
func RecordResourceDuration(ctx context.Context, resourceURI string, serverName string, durationMs float64, clientName string)
RecordResourceDuration records the duration of a resource operation
func RecordResourceError ¶
func RecordResourceError(ctx context.Context, resourceURI string, serverName string, errorType string)
RecordResourceError records a resource operation error
func RecordResourceList ¶
RecordResourceList records the number of resources discovered from a server
func RecordResourceRead ¶
func RecordResourceRead(ctx context.Context, resourceURI string, serverName string, clientName string)
RecordResourceRead records a resource read operation
func RecordResourceTemplateDuration ¶
func RecordResourceTemplateDuration(ctx context.Context, uriTemplate string, serverName string, durationMs float64, clientName string)
RecordResourceTemplateDuration records the duration of a resource template operation
func RecordResourceTemplateError ¶
func RecordResourceTemplateError(ctx context.Context, uriTemplate string, serverName string, errorType string)
RecordResourceTemplateError records a resource template operation error
func RecordResourceTemplateList ¶
RecordResourceTemplateList records the number of resource templates discovered from a server
func RecordResourceTemplateRead ¶
func RecordResourceTemplateRead(ctx context.Context, uriTemplate string, serverName string, clientName string)
RecordResourceTemplateRead records a resource template read operation
func RecordToolError ¶
RecordToolError records a tool error with appropriate attributes
func RecordToolList ¶
RecordToolList records the number of tools discovered from a server
func StartCommandSpan ¶
func StartCommandSpan(ctx context.Context, commandPath string, attrs ...attribute.KeyValue) (context.Context, trace.Span)
StartCommandSpan starts a new span for a command execution
func StartInitializeSpan ¶
func StartInitializeSpan(ctx context.Context, attrs ...attribute.KeyValue) (context.Context, trace.Span)
StartListSpan starts a new span for a list operation (tools, prompts, resources)
func StartInterceptorSpan ¶
func StartInterceptorSpan(ctx context.Context, when, interceptorType string, attrs ...attribute.KeyValue) (context.Context, trace.Span)
StartInterceptorSpan starts a new span for interceptor execution
func StartListSpan ¶
func StartListSpan(ctx context.Context, listType string, attrs ...attribute.KeyValue) (context.Context, trace.Span)
StartListSpan starts a new span for a list operation (tools, prompts, resources)
func StartPromptSpan ¶
func StartPromptSpan(ctx context.Context, promptName string, attrs ...attribute.KeyValue) (context.Context, trace.Span)
StartPromptSpan starts a new span for a prompt operation
func StartResourceSpan ¶
func StartResourceSpan(ctx context.Context, resourceURI string, attrs ...attribute.KeyValue) (context.Context, trace.Span)
StartResourceSpan starts a new span for a resource operation
Types ¶
This section is empty.