2 min read
Instrument the client
async function tracedCall(url, init) {
const span = tracer.startSpan('credicorp.call', { attributes: { 'http.url': url } });
const start = performance.now();
try {
const res = await fetch(url, init);
span.setAttribute('credicorp.request_id', res.headers.get('X-Request-Id'));
span.setAttribute('http.status_code', res.status);
metrics.histogram('credicorp.latency', performance.now() - start);
if (!res.ok) metrics.increment('credicorp.errors');
return res;
} finally {
span.end();
}
}
Correlate with support
Because the span carries the request_id, a spike in your dashboard links directly to specific requests you can quote to support. This turns monitoring into actionable diagnostics.
Frequently asked questions
What metrics matter most?
Rate, errors and duration (the RED method). Add a saturation signal (your local rate-limit budget from RateLimit-Remaining) and you have full coverage.
How does tracing help with support?
Tagging spans with request_id lets you jump from a slow or failing trace straight to the exact request support can look up on their side.
Related reading

Quickstart: Log requests with the request id
The request_id on every response is your thread back to a specific call — log it structured, on success and…
Read →
Quickstart: Debug a failing public API call
When a call fails, work from the network inward: prove reachability, read the exact status and error code,…
Read →
Quickstart: handle rate limits on the public API
The public ring is rate-limited, and a 429 tells you exactly when to try again. Read the RateLimit-Remaining…
Read →
Quickstart: add timeouts and retries to a Node.js API client
A production API client needs a timeout and a retry policy. In Node, an AbortController bounds every request…
Read →Funding for UK limited companies
Credicorp lends to your company, not to you personally — short-term working capital with no personal guarantee. See what your business could access.