DEV Community

Vigilmon
Vigilmon

Posted on

How to Monitor Your Cloudinary Media API with Vigilmon

How to Monitor Your Cloudinary Media API with Vigilmon

Cloudinary is the image and video management platform powering media delivery for millions of websites. When Cloudinary's transformation or delivery API has issues, your site loads broken images, slow video streams, or placeholder blobs. Vigilmon monitors your Cloudinary integration before your users notice.

What Can Go Wrong with Cloudinary?

  • API quota exhausted — transformations stop working, images return 423
  • Cloud name invalid — after account rename or migration
  • Transformation timeout — large video transforms time out under load
  • CDN routing failureres.cloudinary.com unreachable from specific regions
  • Upload preset deleted — upload integrations start failing silently
  • API key revoked — management API calls return 401

Cloudinary Endpoints to Monitor

1. Image Delivery CDN

Cloudinary delivers images from:

https://res.cloudinary.com/{CLOUD_NAME}/image/upload/{PUBLIC_ID}
Enter fullscreen mode Exit fullscreen mode

Pick a stable image that's always in your media library (like your logo) and monitor its delivery URL:

https://res.cloudinary.com/your-cloud/image/upload/logo.png
Enter fullscreen mode Exit fullscreen mode

Vigilmon setup:

  1. URL: a stable image URL from your Cloudinary library
  2. Expected status: 200
  3. Expected header: Content-Type: image/*
  4. Interval: 5 minutes

This catches CDN delivery failures without needing API credentials.

2. Image Transformation

Test that transformations are working (not just raw delivery):

https://res.cloudinary.com/{CLOUD_NAME}/image/upload/w_100,h_100,c_fill/logo.png
Enter fullscreen mode Exit fullscreen mode

Add this as a second monitor. If delivery works but transformations fail (e.g., quota hit), only this monitor alerts.

3. Video Delivery

If your app serves video from Cloudinary:

https://res.cloudinary.com/{CLOUD_NAME}/video/upload/sample.mp4
Enter fullscreen mode Exit fullscreen mode

Monitor a stable video asset. You don't need the full video to load — just the HTTP 200 response header with Content-Type: video/*.

4. Cloudinary Management API (Account Health)

The Management API confirms your credentials are valid and your account is active:

curl https://api.cloudinary.com/v1_1/{CLOUD_NAME}/usage \
  -u 'API_KEY:API_SECRET'
Enter fullscreen mode Exit fullscreen mode

This returns your current usage stats and bandwidth. A 200 response means your account is in good standing.

Vigilmon setup:

  1. URL: https://api.cloudinary.com/v1_1/{CLOUD_NAME}/usage
  2. Authentication: Basic Auth (API Key : API Secret)
  3. Expected status: 200
  4. Keyword: "bandwidth" or "storage"
  5. Interval: 15 minutes (usage API doesn't need frequent polling)

5. Quota Usage Monitoring

Beyond availability, monitor your quota consumption. The usage endpoint returns:

{
  "plan": "free",
  "last_updated": "...",
  "transformations": { "usage": 450, "limit": 500 },
  "bandwidth": { "usage": 456789, "limit": 524288000 }
}
Enter fullscreen mode Exit fullscreen mode

While Vigilmon does keyword checks (not value comparisons), you can build a simple proxy endpoint that returns 200 when under quota and 503 when near the limit:

// /api/cloudinary-quota-health
const response = await fetch(`https://api.cloudinary.com/v1_1/${CLOUD_NAME}/usage`, {
  headers: { Authorization: `Basic ${btoa(`${API_KEY}:${API_SECRET}`)}` }
});
const data = await response.json();

const transformUsage = data.transformations.usage / data.transformations.limit;
if (transformUsage > 0.9) {
  return new Response(JSON.stringify({ status: 'quota_warning', usage: transformUsage }), { status: 503 });
}
return new Response(JSON.stringify({ status: 'ok' }));
Enter fullscreen mode Exit fullscreen mode

Monitor this proxy endpoint — Vigilmon alerts when quota hits 90%.

Monitoring Cloudinary's Status

Cloudinary publishes status at:

https://status.cloudinary.com/api/v2/status.json
Enter fullscreen mode Exit fullscreen mode

Add this as a supplementary monitor with keyword check: "All Systems Operational".

Alert Configuration

For image-heavy e-commerce (broken images = lost conversions):

  • CDN delivery: 1 failure → immediate Slack/PagerDuty
  • Transformation: 2 failures → Slack alert

For video-heavy platforms:

  • Video delivery: 1 failure → immediate alert
  • Consider monitoring from multiple regions (Cloudinary CDN can fail regionally)

For quota monitoring:

  • Quota proxy: 1 failure (503) → Slack alert + escalate to billing review

Custom Domain Delivery

If you use a custom CNAME for Cloudinary (e.g., media.yourapp.com → Cloudinary CDN), monitor that instead:

https://media.yourapp.com/image/upload/logo.png
Enter fullscreen mode Exit fullscreen mode

This also monitors your DNS and CDN configuration end-to-end.

Summary

Monitor URL What It Catches
Image CDN res.cloudinary.com/.../logo.png CDN failure, routing issues
Image transforms ...?w_100,h_100/logo.png Transformation quota exhausted
Video CDN res.cloudinary.com/.../sample.mp4 Video delivery failure
Management API api.cloudinary.com/v1_1/.../usage Account suspension, bad credentials
Quota health Your proxy endpoint Approaching transformation/bandwidth limits
Cloudinary status status.cloudinary.com/api/... Platform incidents

Monitor your Cloudinary integration with Vigilmon — free plan, instant alerts.


Vigilmon — uptime monitoring for media-driven applications.

Top comments (0)