Skip to main content
Glama
metrics.ts708 B
import { Histogram } from "@opentelemetry/api"; import { MeterProvider } from "@opentelemetry/sdk-metrics"; import { METER_NAME } from "../server/prometheus.js"; export class MetricRecorder { private toolCallDurationHistogram: Histogram; constructor(meterProvider: MeterProvider) { const meter = meterProvider.getMeter(METER_NAME); this.toolCallDurationHistogram = meter.createHistogram( "tool_call_duration_ms", { description: "Duration of tool calls in ms", unit: "ms", }, ); } public recordToolCallDuration( durationMs: number, labels: Record<string, string>, ): void { this.toolCallDurationHistogram.record(durationMs, labels); } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TheLunarCompany/lunar'

If you have feedback or need assistance with the MCP directory API, please join our Discord server