metrics

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package metrics provides Prometheus metrics for OpenPass MCP server.

It instruments MCP tool calls, authentication denials, approval outcomes, and vault operations with counters and histograms suitable for monitoring and alerting in production deployments.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RecordApproval

func RecordApproval(agent, outcome string)

RecordApproval records an approval outcome for a write operation. outcome should be "granted" or "denied".

func RecordAuthDenial

func RecordAuthDenial(reason, agent string)

RecordAuthDenial records an authentication or authorization denial. reason should describe why access was denied (e.g., "scope_denied", "write_denied").

func RecordMCPRequest

func RecordMCPRequest(tool, agent, status string, duration time.Duration)

RecordMCPRequest records an MCP tool request with its duration. status should be "success" or "error".

func RecordVaultOperation

func RecordVaultOperation(operation, status string)

RecordVaultOperation records a vault operation. operation describes the action (e.g., "read", "write", "delete"). status should be "success" or "error".

func Registry

func Registry() *prometheus.Registry

Registry returns the Prometheus registry used by OpenPass. Use this with promhttp.HandlerFor to serve metrics over HTTP.

Types

This section is empty.

Jump to

Keyboard shortcuts

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