| name | figma-observability |
| description | Set up monitoring, metrics, and alerting for Figma API integrations.
Use when implementing observability for Figma operations, tracking API health,
or configuring alerts for rate limits and errors.
Trigger with phrases like "figma monitoring", "figma metrics",
"figma observability", "figma alerts", "figma dashboard".
|
| allowed-tools | Read, Write, Edit |
| version | 1.6.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","figma"] |
| compatibility | Designed for Claude Code |
Figma Observability
Overview
Monitor Figma REST API health with custom metrics, structured logging, and alerts. Track request latency, error rates, rate limit headroom, and cache hit rates.
Prerequisites
- Prometheus or compatible metrics backend (or use OpenTelemetry)
- Structured logging (pino, winston)
- Alerting system (PagerDuty, Slack, OpsGenie)
Instructions
Step 1: Instrumented Figma Client
class InstrumentedFigmaClient {
private metrics = {
requests: 0,
errors: 0,
rateLimits: 0,
totalLatencyMs: 0,
};
async request<T>(path: string, token: string): Promise<T> {
const start = performance.now();
const endpoint = path.replace(/[a-zA-Z0-9]{15,}/, ':key');
try {
const res = await fetch(`https://api.figma.com${path}`, {
headers: { 'X-Figma-Token': token },
});
const latencyMs = performance.now() - start;
this.metrics.requests++;
this.metrics. += latencyMs;
.(.({
: ,
endpoint,
: res.,
: .(latencyMs),
: {
: res..(),
: res..(),
},
}));
(res. === ) {
..++;
retryAfter = (res..() || );
(retryAfter);
}
(!res.) {
..++;
(res., res.());
}
res.();
} (error) {
(!(error )) {
..++;
.(.({
: ,
endpoint,
: error ? error. : ,
: .(performance.() - start),
}));
}
error;
}
}
() {
{
....,
: .. >
? .(.. / ..)
: ,
: .. >
? (.. / .. * ).() +
: ,
};
}
}