ameliabooking
/
vendor
/
wordpress
/
mcp-adapter
/
includes
/
Infrastructure
/
Observability
/
Contracts
/
McpObservabilityHandlerInterface.php
ameliabooking
/
vendor
/
wordpress
/
mcp-adapter
/
includes
/
Infrastructure
/
Observability
/
Contracts
Last commit date
McpObservabilityHandlerInterface.php
2 months ago
McpObservabilityHandlerInterface.php
32 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Interface for MCP observability handlers. |
| 4 | * |
| 5 | * @package McpAdapter |
| 6 | */ |
| 7 | |
| 8 | declare( strict_types=1 ); |
| 9 | |
| 10 | namespace WP\MCP\Infrastructure\Observability\Contracts; |
| 11 | |
| 12 | /** |
| 13 | * Interface for handling MCP observability metrics and tracking. |
| 14 | * |
| 15 | * This interface defines the contract for observability handlers that can |
| 16 | * track metrics like request counts, timing, and error rates in the MCP adapter. |
| 17 | * Concrete implementations can integrate with various observability systems. |
| 18 | */ |
| 19 | interface McpObservabilityHandlerInterface { |
| 20 | |
| 21 | /** |
| 22 | * Emit a countable event for tracking with optional timing data. |
| 23 | * |
| 24 | * @param string $event The event name to record. |
| 25 | * @param array $tags Optional tags to attach to the event. |
| 26 | * @param float|null $duration_ms Optional duration in milliseconds for timing measurements. |
| 27 | * |
| 28 | * @return void |
| 29 | */ |
| 30 | public function record_event( string $event, array $tags = array(), ?float $duration_ms = null ): void; |
| 31 | } |
| 32 |