
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/">
    <channel>
        <title><![CDATA[ The Cloudflare Blog ]]></title>
        <description><![CDATA[ Get the latest news on how products at Cloudflare are built, technologies used, and join the teams helping to build a better Internet. ]]></description>
        <link>https://blog.cloudflare.com</link>
        <atom:link href="https://blog.cloudflare.com/" rel="self" type="application/rss+xml"/>
        <language>en-us</language>
        <image>
            <url>https://blog.cloudflare.com/favicon.png</url>
            <title>The Cloudflare Blog</title>
            <link>https://blog.cloudflare.com</link>
        </image>
        <lastBuildDate>Sat, 04 Apr 2026 06:42:12 GMT</lastBuildDate>
        <item>
            <title><![CDATA[Builder Day 2024: 18 big updates to the Workers platform]]></title>
            <link>https://blog.cloudflare.com/builder-day-2024-announcements/</link>
            <pubDate>Thu, 26 Sep 2024 21:00:00 GMT</pubDate>
            <description><![CDATA[ To celebrate Builder Day 2024, we’re shipping 18 updates inspired by direct feedback from developers building on Cloudflare. This includes new capabilities, like running evals with AI Gateway, beta  ]]></description>
            <content:encoded><![CDATA[ <p>To celebrate <a href="https://builderday.pages.dev/"><u>Builder Day 2024</u></a>, we’re shipping 18 updates inspired by direct feedback from developers building on Cloudflare. Choosing a platform isn't just about current technologies and services — it's about betting on a partner that will evolve with your needs as your project grows and the tech landscape shifts. We’re in it for the long haul with you.</p>
    <div>
      <h3>Watch on Cloudflare TV</h3>
      <a href="#watch-on-cloudflare-tv">
        
      </a>
    </div>
    <div>
  
</div><p><b>Starting today, you can:</b></p><ul><li><p><a href="#logs-for-every-worker">Persist logs from your Worker and query them directly on the Cloudflare dashboard</a></p></li><li><p><a href="#connect-to-private-databases-from-workers">Connect your Worker to private databases (isolated in VPCs) using Hyperdrive</a></p></li><li><p><a href="#improved-node.js-compatibility-is-now-ga">Use a wider set of NPM packages on Cloudflare Workers, via improved Node.js compatibility</a></p></li><li><p><a href="#cloudflare-joins-opennext">Deploy Next.js apps that use the Node.js runtime to Cloudflare, via OpenNext</a></p></li><li><p><a href="https://blog.cloudflare.com/workers-ai-bigger-better-faster/">Run Evals with AI Gateway, now in Open Beta</a></p></li><li><p><a href="https://blog.cloudflare.com/sqlite-in-durable-objects">Read from and write to SQLite with zero-latency from every Durable Object</a></p></li></ul><p><b>We’ve brought key features from </b><a href="https://blog.cloudflare.com/pages-and-workers-are-converging-into-one-experience/"><b><u>Pages to Workers</u></b></a><b>, allowing you to: </b></p><ul><li><p><a href="#static-asset-hosting">Upload and serve static assets as part of your Worker, and use popular frameworks with Workers</a></p></li><li><p><a href="#continuous-integration-and-delivery">Automatically build and deploy each pull request to your Worker’s git repository</a></p></li><li><p><a href="#workers-preview-urls">Get back a preview deployment URL for each version of your Worker</a></p></li></ul><p><b>Four things are going GA and are officially production-ready:</b></p><ul><li><p><a href="#gradual-deployments">Gradual Deployments</a>: Deploy changes to your Worker gradually, on a percentage basis of traffic</p></li><li><p><a href="#queues-is-ga">Cloudflare Queues</a><b>:</b> Now with much higher throughput and concurrency limits</p></li><li><p><a href="#event-notifications-for-r2-is-now-ga">R2 Event Notifications</a><b>:</b> Tightly integrated with Queues for event-driven applications</p></li><li><p><a href="https://blog.cloudflare.com/workers-ai-bigger-better-faster/">Vectorize</a>: Globally distributed vector database, now faster, with larger indexes, and new pricing</p></li></ul><p><b>The Workers platform is getting faster:</b></p><ul><li><p><a href="https://blog.cloudflare.com/faster-workers-kv">We made Workers KV up to 3x faster.</a> Which makes serving static assets from Workers and Pages faster!</p></li><li><p><a href="https://blog.cloudflare.com/making-workers-ai-faster/ ">Workers AI now has much faster Time-to-First-Token (TTFT)</a>, backed by more powerful GPUs</p></li></ul><p><b>And we’re lowering the cost of building on Cloudflare:</b></p><ul><li><p><a href="#removing-serverless-microservices-tax">Requests made through Service Bindings and to Tail Workers are now free</a></p></li><li><p><a href="#image-optimization-free-for-everyone">Cloudflare Images is introducing a free tier for everyone with a Cloudflare account</a></p></li><li><p>We’ve <a href="https://blog.cloudflare.com/workers-ai-bigger-better-faster">simplified Workers AI pricing</a> to use industry standard units of measure</p></li></ul><p>Everything in this post is available for you to use today. Keep reading to learn more, and watch the <a href="https://cloudflare.tv/event/builder-day-live-stream/xvm4qdgm"><u>Builder Day Live Stream</u></a> for demos and more.</p><h2>Persistent Logs for every Worker</h2><p>Starting today in open beta, you can automatically retain logs from your Worker, with full search, query, and filtering capabilities available directly within the Cloudflare dashboard. All newly created Workers will have this setting automatically enabled. This marks the first step in the development of our observability platform, following <a href="https://blog.cloudflare.com/cloudflare-acquires-baselime-expands-observability-capabilities/"><u>Cloudflare’s acquisition of Baselime</u></a>.</p><p>Getting started is easy – just add two lines to your Worker’s wrangler.toml and redeploy:</p>
            <pre><code>[observability]
enabled = true
</code></pre>
            <p>Workers Logs allow you to view all logs emitted from your Worker. When enabled, each <code>console.log</code> message, error, and exception is published as a separate event. Every Worker invocation (i.e. requests, alarms, rpc, etc.) also publishes an enriched execution log that contains invocation metadata. You can view logs in the <code>Logs</code> tab of your Worker in the dashboard, where you can filter on any event field, such as time, error code, message, or your own custom field.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3rPKtYlXEgN1u8utUuXxJR/c2fc4dcff2a7574d8ad9f92edbe867fe/image2.png" />
          </figure><p>If you’ve ever had to piece together the puzzle of unusual metrics, such as a spike in errors or latency, you know how frustrating it is to connect metrics to traces and logs that often live in independent data silos. Workers Logs is the first piece of a new observability platform we are building that helps you easily correlate telemetry data, and surfaces insights to help you <i>understand</i>. We’ll structure your telemetry data so you have the full context to ask the right questions, and can quickly and easily analyze the behavior of your applications. This is just the beginning for observability tools for Workers. We are already working on automatically emitting distributed traces from Workers, with real time errors and wide, high dimensionality events coming soon as well. </p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/XiRuQjqzVEld2eCIVVHPh/7c8938479e1f254699487dfe23caade4/Screenshot_2024-09-25_at_3.06.00_PM.png" />
          </figure><p>Starting November 1, 2024, Workers Logs will cost $0.60 per million log lines written after the included volume, as shown in the table below. Querying your logs is free. This makes it easy to estimate and forecast your costs — we think you shouldn’t have to calculate the number of ‘Gigabytes Ingested’ to understand what you’ll pay.</p>
<div><table><thead>
  <tr>
    <th></th>
    <th><span>Workers Free</span></th>
    <th><span>Workers Paid</span></th>
  </tr></thead>
<tbody>
  <tr>
    <td><span>Included Volume</span></td>
    <td><span>200,000 logs per day</span></td>
    <td><span>20,000,000 logs per month</span></td>
  </tr>
  <tr>
    <td><span>Additional Events</span></td>
    <td><span>N/A</span></td>
    <td><span>$0.60 per million logs</span></td>
  </tr>
  <tr>
    <td><span>Retention</span></td>
    <td><span>3 days</span></td>
    <td><span>7 days</span></td>
  </tr>
</tbody></table></div><p>Try out Workers Logs today. You can learn more from our <a href="https://developers.cloudflare.com/workers/observability/logs/workers-logs/"><u>developer documentation</u></a>, and give us feedback directly in the #workers-observability channel on <a href="https://discord.cloudflare.com/"><u>Discord</u></a>.</p><h2>Connect to private databases from Workers</h2><p>Starting today, you can now use <a href="https://developers.cloudflare.com/hyperdrive/"><u>Hyperdrive</u></a>, <a href="https://www.cloudflare.com/en-ca/products/tunnel/"><u>Cloudflare Tunnels</u></a> and <a href="https://www.cloudflare.com/zero-trust/products/access/"><u>Access</u></a> together to securely connect to databases that are isolated in a private network. </p><p><a href="https://developers.cloudflare.com/hyperdrive/"><u>Hyperdrive</u></a> enables you to build on Workers with your existing regional databases. It accelerates database queries using Cloudflare’s network, caching data close to end users and pooling connections close to the database. But there’s been a major blocker preventing you from building with Hyperdrive: network isolation.</p><p>The majority of databases today aren’t publicly accessible on the Internet. Data is highly sensitive and placing databases within private networks like a <a href="https://www.cloudflare.com/learning/cloud/what-is-a-virtual-private-cloud/"><u>virtual private cloud (VPC)</u></a> keeps data secure. But to date, that has also meant that your data is held captive within your cloud provider, preventing you from building on Workers. </p><p>Today, we’re enabling Hyperdrive to <a href="https://developers.cloudflare.com/hyperdrive/configuration/connect-to-private-database/"><u>securely connect to private databases</u></a> using <a href="https://www.cloudflare.com/en-ca/products/tunnel/"><u>Cloudflare Tunnels</u></a> and <a href="https://www.cloudflare.com/zero-trust/products/access/"><u>Cloudflare Access</u></a>. With a Cloudflare Tunnel running in your private network, Hyperdrive can securely connect to your database and start speeding up your queries.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3ozsfXdsWFJlfRhhulMClT/61ec772a843880370e81eeec190000fa/BLOG-2517_4.png" />
          </figure><p>With this update, Hyperdrive makes it possible for you to build full-stack applications on Workers with your existing databases, network-isolated or not. Whether you’re using <a href="https://developers.cloudflare.com/hyperdrive/examples/aws-rds-aurora/"><u>Amazon RDS</u></a>, <a href="https://developers.cloudflare.com/hyperdrive/examples/aws-rds-aurora/"><u>Amazon Aurora</u></a>, <a href="https://developers.cloudflare.com/hyperdrive/examples/google-cloud-sql/"><u>Google Cloud SQL</u></a>, <a href="https://azure.microsoft.com/en-gb/products/category/databases"><u>Azure Database</u></a>, or any other provider, Hyperdrive can connect to your databases and optimize your database connections to provide the fast performance you’ve come to expect with building on Workers.</p><h2>Improved Node.js compatibility is now GA</h2><p>Earlier this month, we <a href="https://blog.cloudflare.com/more-npm-packages-on-cloudflare-workers-combining-polyfills-and-native-code/"><u>overhauled our support for Node.js APIs in the Workers runtime</u></a>. With <a href="https://workers-nodejs-compat-matrix.pages.dev/"><u>twice as many Node APIs</u></a> now supported on Workers, you can now use a wider set of NPM packages to build a broader range of applications. Today, we’re happy to announce that improved Node.js compatibility is GA.</p><p>To give it a try, enable the nodejs_compat compatibility flag, and set your compatibility date to on or after 2024-09-23:</p>
            <pre><code>compatibility_flags = ["nodejs_compat"]
compatibility_date = "2024-09-23"
</code></pre>
            <p>Read the <a href="https://developers.cloudflare.com/workers/runtime-apis/nodejs/"><u>developer documentation</u></a> to learn more about how to opt-in your Workers to try it today. If you encounter any bugs or want to report feedback, <a href="https://github.com/cloudflare/workers-sdk/issues/new?assignees=&amp;labels=bug&amp;projects=&amp;template=bug-template.yaml&amp;title=%F0%9F%90%9B+BUG%3A"><u>open an issue</u></a>.</p><h2>Build frontend applications on Workers with Static Asset Hosting</h2><p>Starting today in open beta, you now can upload and serve HTML, CSS, and client-side JavaScript directly as part of your Worker. This means you can build dynamic, server-side rendered applications on Workers using popular frameworks such as Astro, Remix, Next.js and Svelte (full list <a href="https://developers.cloudflare.com/workers/frameworks"><u>here</u></a>), with more coming soon.</p><p>You can now deploy applications to Workers that previously could only be deployed to Cloudflare Pages and use features that are not yet supported in Pages, including <a href="https://developers.cloudflare.com/workers/observability/logging/logpush/"><u>Logpush</u></a>, <a href="https://developers.cloudflare.com/hyperdrive/#_top"><u>Hyperdrive</u></a>, <a href="https://developers.cloudflare.com/workers/configuration/cron-triggers/"><u>Cron Triggers</u></a>, <a href="https://developers.cloudflare.com/queues/configuration/configure-queues/#consumer"><u>Queue Consumers</u></a>, and <a href="https://developers.cloudflare.com/workers/configuration/versions-and-deployments/"><u>Gradual Deployments</u></a>. </p><p>To get started, create a new project with <a href="https://developers.cloudflare.com/workers/frameworks"><u>create-cloudflare</u></a>. For example, to create a new Astro project:  </p>
            <pre><code>npm create cloudflare@latest -- my-astro-app --framework=astro --experimental
</code></pre>
            <p>Visit our <a href="https://developers.cloudflare.com/workers/static-assets/"><u>developer documentation</u></a> to learn more about setting up a new front-end application on Workers and watch a <a href="https://youtu.be/W45MIi_t_go"><u>quick demo</u></a> to learn about how you can deploy an existing application to Workers. Static assets aren’t just for Workers written in JavaScript! You can serve static assets from <a href="https://developers.cloudflare.com/workers/languages/python/"><u>Workers written in Python</u></a> or even <a href="https://github.com/cloudflare/workers-rs/tree/main/templates/leptos/README.md"><u>deploy a Leptos app using workers-rs</u></a>.</p><p>If you’re wondering “<i>What about Pages?” </i>— rest assured, Pages will remain fully supported. We’ve heard from developers that as we’ve added new features to Workers and Pages, the choice of which product to use has become challenging. We’re closing this gap by bringing asset hosting, CI/CD and Preview URLs to Workers this Birthday Week.</p><p>To make the upfront choice Cloudflare Workers and Pages more transparent, we’ve created a <a href="https://developers.cloudflare.com/workers/static-assets/compatibility-matrix/"><u>compatibility matrix</u></a>. Looking ahead, we plan to bridge the remaining gaps between Workers and Pages and provide ways to migrate your Pages projects to Workers.</p><h2>Cloudflare joins OpenNext to deploy Next.js apps to Workers</h2><p>Starting today, as an early developer preview, you can use <a href="https://opennext.js.org//cloudflare"><u>OpenNext</u></a> to deploy Next.js apps to Cloudflare Workers via <a href="https://npmjs.org/@opennextjs/cloudflare"><u>@opennextjs/cloudflare</u></a>, a new npm package that lets you use the <a href="https://nextjs.org/docs/app/building-your-application/rendering/edge-and-nodejs-runtimes"><u>Node.js “runtime” in Next.js</u></a> on Workers.</p><p>This new adapter is powered by our <a href="https://blog.cloudflare.com/more-npm-packages-on-cloudflare-workers-combining-polyfills-and-native-code/"><u>new Node.js compatibility layer</u></a>, newly introduced <a href="#static-asset-hosting"><u>Static Assets for Workers</u></a>, and Workers KV, which is <a href="https://blog.cloudflare.com/faster-workers-kv"><u>now up to 3x faster</u></a>. It unlocks support for <a href="https://nextjs.org/docs/app/building-your-application/data-fetching/incremental-static-regeneration"><u>Incremental Static Regeneration (ISR)</u></a>, <a href="https://nextjs.org/docs/pages/building-your-application/routing/custom-error"><u>custom error pages</u></a>, and other Next.js features that our previous adapter, <a href="https://developers.cloudflare.com/pages/framework-guides/nextjs/ssr/get-started/"><u>@cloudflare/next-on-pages</u></a>, could not support, as it was only compatible with the Edge “runtime” in Next.js.</p><p><a href="https://blog.cloudflare.com/aws-egregious-egress/"><u>Cloud providers shouldn’t lock you in</u></a>. Like cloud compute and storage, open source frameworks should be portable — you should be able to deploy them to different cloud providers. The goal of the OpenNext project is to make sure you can deploy Next.js apps to any cloud platform, originally to AWS, and now Cloudflare. We’re excited to contribute to the OpenNext community, and give developers the freedom to run on the cloud that fits their applications needs (and <a href="https://blog.cloudflare.com/workers-pricing-scale-to-zero/"><u>budget</u></a>) best.</p><p>To get started by reading the <a href="https://opennext.js.org//cloudflare/get-started"><u>OpenNext docs</u></a>, which provide examples and a guide on how to add <a href="https://npmjs.org/@opennextjs/cloudflare"><u>@opennextjs/cloudflare</u></a> to your Next.js app.</p><p>We want your feedback! Report issues and contribute code at <a href="https://github.com/opennextjs/opennextjs-cloudflare/"><u>opennextjs/opennextjs-cloudflare on GitHub</u></a>, and join the discussion on the <a href="https://discord.gg/WUNsBM69"><u>OpenNext Discord</u></a>.</p>
            <pre><code>npm create cloudflare@latest -- my-next-app --framework=next --experimental
</code></pre>
            <h2>Continuous Integration &amp; Delivery (CI/CD) with Workers Builds</h2><p>Now in open beta, you can connect a GitHub or GitLab repository to a Worker, and Cloudflare will automatically build and deploy your changes each time you push a commit. Workers Builds provides an integrated CI/CD workflow you can use to build and deploy everything from full-stack applications built with the most popular frameworks to simple static websites. Just add your build command and let Workers Builds take care of the rest. </p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1K9izEbBxIlA0nXbNKJ1Od/55ecf9e56ecbc33aeb88df7ede1afddc/BLOG-2517_5.png" />
          </figure><p>While in open beta, Workers Builds is free to use, with a limit of one concurrent build per account, and unlimited build minutes per month. Once Workers Builds is Generally Available in early 2025, you will be billed based on the number of build minutes you use each month, and have a higher number of concurrent builds.</p>
<div><table><thead>
  <tr>
    <th></th>
    <th><span>Workers Free</span></th>
    <th><span>Workers Paid</span></th>
  </tr></thead>
<tbody>
  <tr>
    <td><span>Build minutes, </span><span>open beta</span></td>
    <td><span>Unlimited</span></td>
    <td><span>Unlimited</span></td>
  </tr>
  <tr>
    <td><span>Concurrent builds, </span><span>open beta</span></td>
    <td><span>1</span></td>
    <td><span>1</span></td>
  </tr>
  <tr>
    <td><span>Build minutes, </span><span>general availability</span></td>
    <td><span>3,000 minutes included per month</span></td>
    <td><span>6,000 minutes included per month </span><br /><span>+$0.005 per additional build minute</span></td>
  </tr>
  <tr>
    <td><span>Concurrent builds, </span><span>general availability</span></td>
    <td><span>1</span></td>
    <td><span>6</span></td>
  </tr>
</tbody></table></div><p><a href="https://developers.cloudflare.com/workers/ci-cd/builds/"><u>Read the docs</u></a> to learn more about how to deploy your first project with Workers Builds.</p><h2>Workers preview URLs</h2><p>Each newly uploaded version of a Worker now automatically generates a preview URL. Preview URLs make it easier for you to collaborate with your team during development, and can be used to test and identify issues in a preview environment before they are deployed to production.</p><p>When you upload a version of your Worker via the Wrangler CLI, Wrangler will display the preview URL once your upload succeeds. You can also find preview URLs for each version of your Worker in the Cloudflare dashboard:</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/29iDm0x8QQex5ryatk23e1/ecfdba5b98b6e0c22350087a6035442d/BLOG-2517_6.png" />
          </figure><p>Preview URLs for Workers are similar to Pages <a href="https://developers.cloudflare.com/pages/configuration/preview-deployments/"><u>preview deployments</u></a> — they run on your Worker’s <code>workers.dev</code> subdomain and allow you to view changes applied on a new version of your application before the changes are deployed.</p><p>Learn more about preview URLs by visiting our <a href="https://developers.cloudflare.com/workers/configuration/previews"><u>developer documentation</u></a>. </p><h2>Safely release to production with Gradual Deployments</h2><p>At Developer Week, we launched <a href="https://developers.cloudflare.com/workers/configuration/versions-and-deployments/gradual-deployments/#_top"><u>Gradual Deployments</u></a> for Workers and Durable Objects to make it safer and easier to deploy changes to your applications. Gradual Deployments is now GA — we have been using it ourselves at Cloudflare for mission-critical services built on Workers since early 2024.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2FOHnaYqTyhuJRZVdERWdh/52df3d29622ccca9118d1cb49de19ae8/BLOG-2517_7.png" />
          </figure><p>Gradual deployments can help you stay on top of availability SLAs and minimize application downtime by surfacing issues early. Internally at Cloudflare, every single service built on Workers uses gradual deployments to roll out new changes. Each new version gets released in stages —– 0.05%, 0.5%, 3%, 10%, 25%, 50%, 75% and 100% with time to soak between each stage. Throughout the roll-out, we keep an eye on metrics (which are often instrumented with <a href="https://developers.cloudflare.com/analytics/analytics-engine/"><u>Workers Analytics Engine</u></a>!) and we <a href="https://developers.cloudflare.com/workers/configuration/versions-and-deployments/rollbacks/"><u>roll back</u></a> if we encounter issues. </p><p>Using gradual deployments is as simple as swapping out the <a href="https://developers.cloudflare.com/workers/wrangler/commands/#versions"><u>wrangler commands</u></a>, <a href="https://developers.cloudflare.com/api/operations/worker-versions-upload-version"><u>API endpoints</u></a>, and/or using “Save version” in the code editor that is built into the Workers dashboard. Read the <a href="https://developers.cloudflare.com/workers/configuration/versions-and-deployments/"><u>developer documentation</u></a> to learn more and get started. </p><h2>Queues is GA, with higher throughput and concurrency limits</h2><p><a href="https://developers.cloudflare.com/queues/"><u>Cloudflare Queues</u></a> is now generally available with higher limits. </p><p>Queues let a developer decouple their Workers into event driven services. <i>Producer </i>Workers write events to a Queue, and <i>consumer </i>Workers are invoked to take actions on the events. For example, you can use a Queue to decouple an e-commerce website from a service which sends purchase confirmation emails to users.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3cpkxgIQSYLrwbfhDSL2A5/97818131c1f4f7d2e8b8d76dcc8c7f9a/BLOG-2517_8.png" />
          </figure><p>Throughput and concurrency limits for Queues are now significantly higher, which means you can push more messages through a Queue, and consume them faster.</p><ul><li><p><b>Throughput:</b> Each queue can now process 5000 messages per second (previously 400 per second).</p></li><li><p><b>Concurrency:</b> Each queue can now have up to 250 <a href="https://developers.cloudflare.com/queues/configuration/consumer-concurrency/"><u>concurrent consumers</u></a> (previously 20 concurrent consumers). </p></li></ul><p>Since we <a href="https://blog.cloudflare.com/introducing-cloudflare-queues/"><u>announced Queues in beta</u></a>, we’ve added the following functionality:</p><ul><li><p><a href="https://developers.cloudflare.com/queues/configuration/batching-retries/#batching"><u>Batch sizes can be customized</u></a>, to reduce the number of consumer Worker invocations and thus reduce cost.</p></li><li><p><a href="https://developers.cloudflare.com/queues/configuration/batching-retries/#delay-messages"><u>Individual messages can be delayed</u></a>, so you can back off due to external API rate limits.</p></li><li><p><a href="https://developers.cloudflare.com/queues/configuration/pull-consumers/"><u>HTTP Pull consumers</u></a> allow messages to be consumed outside Workers, with zero data egress costs.</p></li></ul><p>Queues can be used by any developer on a Workers Paid plan. Head over to our <a href="https://developers.cloudflare.com/queues/get-started/"><u>getting started</u><i><u> </u></i><u>guide</u></a> to start building with Queues.</p><h2>Event notifications for R2 is now GA</h2><p>We’re excited to announce that event notifications for R2 is now generally available. Whether it’s kicking off image processing after a user uploads a file or triggering a sync to an external data warehouse when new analytics data is generated, many applications need to be able to reliably respond when events happen. <a href="https://blog.cloudflare.com/r2-events-gcs-migration-infrequent-access/#event-notifications-open-beta"><u>Event notifications</u></a> for <a href="https://developers.cloudflare.com/r2/"><u>Cloudflare R2</u></a> give you the ability to build event-driven applications and workflows that react to changes in your data.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/73t1PtQg576iv7m95HHjGL/26cd028004f5b669e41a89a7265c5a14/BLOG-2517_9.png" />
          </figure><p>Here’s how it works: When data in your R2 bucket changes, event notifications are sent to your queue. You can consume these notifications with a <a href="https://developers.cloudflare.com/queues/reference/how-queues-works/#create-a-consumer-worker"><u>consumer Worker </u></a>or <a href="https://developers.cloudflare.com/queues/configuration/pull-consumers/"><u>pull them over HTTP</u></a> from outside of Cloudflare Workers.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4NSN5r40rmXy0FMGOKvdAd/7d0c0637ccc478881528339304942948/BLOG-2517_10.png" />
          </figure><p>Since we introduced event notifications in <a href="https://blog.cloudflare.com/r2-events-gcs-migration-infrequent-access/#event-notifications-open-beta"><u>open beta</u></a> earlier this year, we’ve made significant improvements based on your feedback:</p><ul><li><p>We increased reliability of event notifications with throughput improvements from Queues. R2 event notifications can now scale to thousands of writes per second.</p></li><li><p>You can now configure event notifications directly from the Cloudflare dashboard (in addition to <a href="https://developers.cloudflare.com/workers/wrangler/commands/#notification-create"><u>Wrangler</u></a>).</p></li><li><p>There is now support for receiving notifications triggered by <a href="https://developers.cloudflare.com/r2/buckets/object-lifecycles/"><u>object lifecycle deletes</u></a>.</p></li><li><p>You can now set up multiple notification rules for a single queue on a bucket.</p></li></ul><p>Visit <a href="https://developers.cloudflare.com/r2/buckets/event-notifications/"><u>our documentation</u></a> to learn about how to set up event notifications for your R2 buckets.</p><h2>Removing the serverless microservices tax: No more request fees for Service Bindings and Tail Workers</h2><p>Earlier this year, we quietly changed Workers pricing to lower your costs. As of July 2024, you are no longer charged for requests between Workers on your account made via <a href="https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/"><u>Service Bindings</u></a>, or for invocations of <a href="https://developers.cloudflare.com/workers/observability/logging/tail-workers/"><u>Tail Workers.</u></a> For example, let’s say you have the following chain of Workers: </p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1PTgWu9XiGJNoWrHTduQdB/84e1f6ee0788f99684440a9db7b4e6c1/BLOG-2517_11.png" />
          </figure><p>Each request from a client results in three Workers invocations. Previously, we charged you for each of these invocations, plus the CPU time for each of these Workers. With this change, we only charge you for the first request from the client, plus the CPU time used by each Worker.</p><p>This eliminates the additional cost of breaking a monolithic serverless app into microservices. In 2023, we introduced new <a href="https://blog.cloudflare.com/workers-pricing-scale-to-zero/"><u>pricing based on CPU time</u></a>, rather than duration, so you don’t have to worry about being billed for time spent waiting on I/O. This includes I/O to other Workers. With this change, you’re only billed for the first request in the chain, eliminating the other additional cost of using multiple Workers.</p><p>When you build microservices on Workers, you face fewer trade offs than on other compute platforms. Service bindings have <a href="https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/"><u>zero network overhead</u></a> by default, a built-in <a href="https://blog.cloudflare.com/javascript-native-rpc/"><u>JavaScript RPC system</u></a>, and a security model with <a href="https://blog.cloudflare.com/workers-environment-live-object-bindings/"><u>fewer footguns and simpler configuration</u></a>. We’re excited to improve this further with this pricing change.</p><h2>Image optimization is available to everyone for free — no subscription needed</h2><p>Starting today, you can use <a href="https://developers.cloudflare.com/images/transform-images/transform-via-url/"><u>Cloudflare Images</u></a> for free to optimize your images with up to 5,000 transformations per month.</p><p>Large, oversized images can throttle your application speed and page load times. We built <a href="https://developers.cloudflare.com/images/"><u>Cloudflare Images</u></a> to let you dynamically optimize images in the correct dimensions and formats for each use case, all while storing only the original image.</p><p>In the spirit of Birthday Week, we’re making image optimization available to everyone with a Cloudflare account, no subscription needed. You’ll be able to use Images to transform images that are stored outside of Images, such as in R2.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/49UPZRpeAp79qugqstqbT7/5e23fb4c7a458f5d00b401383bd6e777/BLOG-2517_12.png" />
          </figure><p>Transformations are served from your zone through a specially formatted URL with parameters that specify how an image should be optimized. For example, the transformation URL below uses the <code>format</code> parameter to automatically serve the image in the most optimal format for the requesting browser:</p>
            <pre><code>https://example.com/cdn-cgi/image/format=auto/thumbnail.png</code></pre>
            <p>This means that the original PNG image may be served as AVIF to one user and WebP to another. Without a subscription, transforming images from remote sources is free up to 5,000 unique transformations per month. Once you exceed this limit, any already cached transformations will continue to be served, but you’ll need a <a href="https://dash.cloudflare.com/?to=/:account/images"><u>paid Images plan</u></a> to request new transformations or to purchase storage within Images.</p><p>To get started, navigate to <a href="https://dash.cloudflare.com/?to=/:account/images"><u>Images in the dashboard</u></a> to enable transformations on your zone.</p>
    <div>
      <h2>Dive deep into more announcements from Builder Day</h2>
      <a href="#dive-deep-into-more-announcements-from-builder-day">
        
      </a>
    </div>
    <p>We shipped so much that we couldn’t possibly fit it all in one blog post. These posts dive into the technical details of what we’re announcing at Builder Day:</p><ul><li><p><a href="https://blog.cloudflare.com/workers-ai-bigger-better-faster"><u>Cloudflare’s Bigger, Better, Faster AI platform</u></a></p></li><li><p><a href="https://blog.cloudflare.com/making-workers-ai-faster"><u>Making Workers AI faster with KV cache compression, speculative decoding, and upgraded hardware</u></a></p></li><li><p><a href="https://blog.cloudflare.com/faster-workers-kv"><u>We made Workers KV up to 3x faster — here’s the data</u></a></p></li><li><p><a href="https://blog.cloudflare.com/sqlite-in-durable-objects"><u>Zero-latency SQLite storage in every Durable Object</u></a></p></li></ul>
    <div>
      <h2>Build the next big thing on Cloudflare</h2>
      <a href="#build-the-next-big-thing-on-cloudflare">
        
      </a>
    </div>
    <p>Cloudflare is for builders, and everything we’re announcing at Builder Day, you can start building with right away. We’re now offering <a href="http://blog.cloudflare.com/startup-program-250k-credits"><u>$250,000 in credits to use on our Developer Platform to qualified startups</u></a>, so that you can get going even faster, and become the next company to reach hypergrowth scale with a small team, and not waste time provisioning infrastructure and doing undifferentiated heavy lifting. Focus on shipping, and we’ll take care of the rest.</p><p>Apply to the startup program <a href="https://www.cloudflare.com/forstartups/"><u>here</u></a>, or stop by and say hello in the <a href="https://discord.cloudflare.com/"><u>Cloudflare Developers Discord</u></a>.</p> ]]></content:encoded>
            <category><![CDATA[Birthday Week]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <category><![CDATA[undefined]]></category>
            <category><![CDATA[Queues]]></category>
            <category><![CDATA[Cloudflare Images]]></category>
            <guid isPermaLink="false">6ct91ZmJYzPu9n9pt8sNBm</guid>
            <dc:creator>Tanushree Sharma</dc:creator>
            <dc:creator>Rohin Lohe</dc:creator>
            <dc:creator>Anni Wang</dc:creator>
            <dc:creator>Nevi Shah</dc:creator>
        </item>
        <item>
            <title><![CDATA[Browser Rendering API GA, rolling out Cloudflare Snippets, SWR, and bringing Workers for Platforms to all users]]></title>
            <link>https://blog.cloudflare.com/browser-rendering-api-ga-rolling-out-cloudflare-snippets-swr-and-bringing-workers-for-platforms-to-our-paygo-plans/</link>
            <pubDate>Fri, 05 Apr 2024 13:01:00 GMT</pubDate>
            <description><![CDATA[ Browser Rendering API is now available to all paid Workers customers with improved session management ]]></description>
            <content:encoded><![CDATA[ <p></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5kiBNiPfz0fqooxige54uO/378848632e2d4633c9f41678f1cff82c/Workers-for-Platforms-now-available-for-PAYGO.png" />
            
            </figure>
    <div>
      <h3>Browser Rendering API is now available to all paid Workers customers with improved session management</h3>
      <a href="#browser-rendering-api-is-now-available-to-all-paid-workers-customers-with-improved-session-management">
        
      </a>
    </div>
    <p>In May 2023, we <a href="/browser-rendering-open-beta">announced</a> the open beta program for the <a href="https://developers.cloudflare.com/browser-rendering/">Browser Rendering API</a>. Browser Rendering allows developers to programmatically control and interact with a headless browser instance and create automation flows for their applications and products.</p><p>At the same time, we launched a version of the <a href="https://developers.cloudflare.com/browser-rendering/platform/puppeteer/">Puppeteer library</a> that works with Browser Rendering. With that, developers can use a familiar API on top of Cloudflare Workers to create all sorts of workflows, such as taking screenshots of pages or automatic software testing.</p><p>Today, we take Browser Rendering one step further, taking it out of beta and making it available to all paid Workers' plans. Furthermore, we are enhancing our API and introducing a new feature that we've been discussing for a long time in the open beta community: session management.</p>
    <div>
      <h3>Session Management</h3>
      <a href="#session-management">
        
      </a>
    </div>
    <p>Session management allows developers to reuse previously opened browsers across Worker's scripts. Reusing browser sessions has the advantage that you don't need to instantiate a new browser for every request and every task, drastically increasing performance and lowering costs.</p><p>Before, to keep a browser instance alive and reuse it, you'd have to implement complex code using Durable Objects. Now, we've simplified that for you by keeping your browsers running in the background and extending the Puppeteer API with new <a href="https://developers.cloudflare.com/browser-rendering/platform/puppeteer/#session-management">session management methods</a> that give you access to all of your running sessions, activity history, and active limits.</p><p>Here’s how you can list your active sessions:</p>
            <pre><code>const sessions = await puppeteer.sessions(env.RENDERING);
console.log(sessions);
[
   {
      "connectionId": "2a2246fa-e234-4dc1-8433-87e6cee80145",
      "connectionStartTime": 1711621704607,
      "sessionId": "478f4d7d-e943-40f6-a414-837d3736a1dc",
      "startTime": 1711621703708
   },
   {
      "sessionId": "565e05fb-4d2a-402b-869b-5b65b1381db7",
      "startTime": 1711621703808
   }
]</code></pre>
            <p>We have added a Worker script <a href="https://developers.cloudflare.com/browser-rendering/get-started/reuse-sessions/#4-code">example on how to use session management</a> to the Developer Documentation.</p>
    <div>
      <h3>Analytics and logs</h3>
      <a href="#analytics-and-logs">
        
      </a>
    </div>
    <p>Observability is an essential part of any Cloudflare product. You can find detailed analytics and logs of your Browser Rendering usage in the dashboard under your account's Worker &amp; Pages section.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2jlU3vFhUa0fXCF7lKYq73/9e63676a0dc7bc54da3ab4cf5efd85dd/image4-10.png" />
            
            </figure><p>Browser Rendering is now available to all customers with a paid Workers plan. Each account is <a href="https://developers.cloudflare.com/browser-rendering/platform/limits/">limited</a> to running two new browsers per minute and two concurrent browsers at no cost during this period. Check our <a href="https://developers.cloudflare.com/browser-rendering/get-started/">developers page</a> to get started.</p>
    <div>
      <h3>We are rolling out access to Cloudflare Snippets</h3>
      <a href="#we-are-rolling-out-access-to-cloudflare-snippets">
        
      </a>
    </div>
    <p>Powerful, programmable, and free of charge, Snippets are the best way to perform complex HTTP request and response modifications on Cloudflare. What was once too advanced to achieve using Rules products is now possible with Snippets. Since the initial <a href="/snippets-announcement">announcement</a> during Developer Week 2022, the promise of extending out-of-the-box Rules functionality by writing simple JavaScript code is keeping the Cloudflare community excited.</p><p>During the first 3 months of 2024 alone, the amount of traffic going through Snippets increased over 7x, from an average of 2,200 requests per second in early January to more than 17,000 in March.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6XCqU9QOeEcg9KoaOShf4x/94bba253b62bf832126baf20b18f5cb4/image2-14.png" />
            
            </figure><p>However, instead of opening the floodgates and letting millions of Cloudflare users in to test (and potentially break) Snippets in the most unexpected ways, we are going to pace ourselves and opt for a phased rollout, much like the newly released <a href="/workers-production-safety">Gradual Rollouts</a> for Workers.</p><p>In the next few weeks, 5% of Cloudflare users will start seeing “Snippets” under the Rules tab of the zone-level menu in their dashboard. If you happen to be part of the first 5%, snip into action and try out how fast and powerful Snippets are even for <a href="/cloudflare-snippets-alpha#what-can-you-build-with-cloudflare-snippets">advanced use cases</a> like dynamically changing the date in headers or A / B testing leveraging the `math.random` function. Whatever you use Snippets for, just keep one thing in mind: this is still an alpha, so please do not use Snippets for production traffic just yet.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/45mBS7TWL4BL6skGoXRDn3/a99f87e1d885e457b1bb35af5773fdb2/Screenshot-2024-04-04-at-6.12.42-PM.png" />
            
            </figure><p>Until then, keep your eyes out for the new Snippets tab in the Cloudflare dashboard and learn more how powerful and flexible Snippets are at the <a href="https://developers.cloudflare.com/rules/snippets">developer documentation</a> in the meantime.</p>
    <div>
      <h3>Coming soon: asynchronous revalidation with stale-while-revalidate</h3>
      <a href="#coming-soon-asynchronous-revalidation-with-stale-while-revalidate">
        
      </a>
    </div>
    <p>One of the features most requested by our customers is the asynchronous revalidation with stale-while-revalidate (SWR) cache directive, and we will be bringing this to you in the second half of 2024.  This functionality will be available by design as part of our new CDN architecture that is being built using Rust with performance and memory safety at top of mind.</p><p>Currently, when a client requests a resource, such as a web page or an image, Cloudflare checks to see if the asset is in cache and provides a cached copy if available. If the file is not in the cache or has expired and become stale, Cloudflare connects to the origin server to check for a fresh version of the file and forwards this fresh version to the end user. This wait time adds latency to these requests and impacts performance.</p><p>Stale-while-revalidate is a cache directive that allows the expired or stale version of the asset to be served to the end user while simultaneously allowing Cloudflare to check the origin to see if there's a fresher version of the resource available. If an updated version exists, the origin forwards it to Cloudflare, updating the cache in the process. This mechanism allows the client to receive a response quickly from the cache while ensuring that it always has access to the most up-to-date content. Stale-while-revalidate strikes a balance between serving content efficiently and ensuring its freshness, resulting in improved performance and a smoother user experience.</p><p>Customers who want to be part of our beta testers and “cache” in on the fun can register <a href="https://forms.gle/EEFDtB97sLG5G5Ui9">here</a>, and we will let you know when the feature is ready for testing!</p>
    <div>
      <h3>Coming on April 16, 2024: Workers for Platforms for our pay-as-you-go plan</h3>
      <a href="#coming-on-april-16-2024-workers-for-platforms-for-our-pay-as-you-go-plan">
        
      </a>
    </div>
    <p>Today, we’re excited to share that on April 16th, Workers for Platforms will be available to all developers through our new $25 pay-as-you-go plan!</p><p>Workers for Platforms is changing the way we build software – it gives you the ability to embed personalization and customization directly into your product. With Workers for Platforms, you can deploy custom code on behalf of your users or let your users directly deploy their own code to your platform, without you or your users having to manage any infrastructure. You can use Workers for Platforms with all the exciting announcements that have come out this Developer Week – it supports all the <a href="https://developers.cloudflare.com/workers/configuration/bindings/">bindings</a> that come with Workers (including <a href="https://developers.cloudflare.com/workers-ai/">Workers AI</a>, <a href="https://developers.cloudflare.com/d1/">D1</a> and <a href="https://developers.cloudflare.com/durable-objects/">Durable Objects</a>) as well as <a href="https://developers.cloudflare.com/workers/languages/python/">Python Workers</a>.  </p><p>Here’s what some of our customers – ranging from enterprises to startups – are building on Workers for Platforms:</p><ul><li><p><a href="https://www.shopify.com/plus/solutions/headless-commerce">Shopify Oxygen</a> is a hosting platform for their Remix-based eCommerce framework Hydrogen, and it’s built on Workers for Platforms! The Hydrogen/Oxygen combination gives Shopify merchants control over their buyer experience without the restrictions of generic storefront templates.</p></li><li><p><a href="https://grafbase.com/">Grafbase</a> is a data platform for developers to create a serverless GraphQL API that unifies data sources across a business under one endpoint. They use Workers for Platforms to give their developers the control and flexibility to deploy their own code written in JavaScript/TypeScript or WASM.</p></li><li><p><a href="https://www.triplit.dev/">Triplit</a> is an open-source database that syncs data between server and browser in real-time. It allows users to build low latency, real-time applications with features like relational querying, schema management and server-side storage built in. Their query and sync engine is built on top of Durable Objects, and they’re using Workers for Platforms to allow their customers to package custom Javascript alongside their Triplit DB instance.</p></li></ul>
    <div>
      <h3>Tools for observability and platform level controls</h3>
      <a href="#tools-for-observability-and-platform-level-controls">
        
      </a>
    </div>
    <p>Workers for Platforms doesn’t just allow you to deploy Workers to your platform – we also know how important it is to have observability and control over your users’ Workers. We have a few solutions that help with this:</p><ul><li><p><a href="https://developers.cloudflare.com/cloudflare-for-platforms/workers-for-platforms/platform/custom-limits/">Custom Limits</a>: Set CPU time or subrequest caps on your users’ Workers. Can be used to set limits in order to control your costs on Cloudflare and/or shape your own pricing and packaging model. For example, if you run a freemium model on your platform, you can lower the CPU time limit for customers on your free tier.</p></li><li><p><a href="https://developers.cloudflare.com/workers/observability/logging/tail-workers/">Tail Workers</a>: Tail Worker events contain metadata about the Worker, console.log() messages, and capture any unhandled exceptions. They can be used to provide your developers with live logging in order to monitor for errors and troubleshoot in real time.</p></li><li><p><a href="https://developers.cloudflare.com/cloudflare-for-platforms/workers-for-platforms/reference/outbound-workers/">Outbound Workers</a>: Get visibility into all outgoing requests from your users’ Workers. Outbound Workers sit between user Workers and the fetch() requests they make, so you get full visibility over the request before it’s sent out to the Internet.</p></li></ul>
    <div>
      <h3>Pricing</h3>
      <a href="#pricing">
        
      </a>
    </div>
    <p>We wanted to make sure that Workers for Platforms was affordable for hobbyists, solo developers, and indie developers. Workers for Platforms is part of a new $25 pay-as-you-go plan, and it includes the following:</p>
<table>
<thead>
  <tr>
    <th></th>
    <th><span>Included Amounts</span></th>
  </tr>
</thead>
<tbody>
  <tr>
    <td><span>Requests</span></td>
    <td><span>20 million requests/month </span><br /><span>+$0.30 per additional million</span></td>
  </tr>
  <tr>
    <td><span>CPU time</span></td>
    <td><span>60 million CPU milliseconds/month</span><br /><span>+$0.02 per additional million CPU milliseconds</span></td>
  </tr>
  <tr>
    <td><span>Scripts</span></td>
    <td><span>1000 scripts</span><br /><span>+0.02 per additional script/month</span></td>
  </tr>
</tbody>
</table>
    <div>
      <h3>Workers for Platforms will be available to purchase on April 16, 2024!</h3>
      <a href="#workers-for-platforms-will-be-available-to-purchase-on-april-16-2024">
        
      </a>
    </div>
    <p>The Workers for Platforms will be available to purchase under the Workers for Platforms tab on the Cloudflare Dashboard on April 16, 2024.</p><p>In the meantime, to learn more about Workers for Platforms, check out our <a href="https://github.com/cloudflare/workers-for-platforms-example">starter project</a> and <a href="https://developers.cloudflare.com/cloudflare-for-platforms/workers-for-platforms/">developer documentation</a>.</p> ]]></content:encoded>
            <category><![CDATA[Developer Week]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <category><![CDATA[Application Services]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[General Availability]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <guid isPermaLink="false">2wPhlTmw4FThQkJsChhkwy</guid>
            <dc:creator>Tanushree Sharma</dc:creator>
            <dc:creator>Celso Martinho</dc:creator>
            <dc:creator>Nikita Cano</dc:creator>
            <dc:creator>Matt Bullock</dc:creator>
            <dc:creator>Tim Kornhammar</dc:creator>
        </item>
        <item>
            <title><![CDATA[New tools for production safety — Gradual deployments, Source maps, Rate Limiting, and new SDKs]]></title>
            <link>https://blog.cloudflare.com/workers-production-safety/</link>
            <pubDate>Thu, 04 Apr 2024 13:05:00 GMT</pubDate>
            <description><![CDATA[ Today we are announcing five updates that put more power in your hands – Gradual Deployments, Source mapped stack traces in Tail Workers, a new Rate Limiting API, brand-new API SDKs, and updates to Durable Objects – each built with mission-critical production services in mind ]]></description>
            <content:encoded><![CDATA[ <p></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6HeyqozVOGygo2RCNnunIq/b429dc5b9f81c9fed6dfc0d200d296e5/image4-7.png" />
            
            </figure><p>2024’s Developer Week is all about production readiness. On Monday. April 1, we <a href="/making-full-stack-easier-d1-ga-hyperdrive-queues/">announced</a> that <a href="https://developers.cloudflare.com/d1/">D1</a>, <a href="https://developers.cloudflare.com/queues/">Queues</a>, <a href="https://developers.cloudflare.com/hyperdrive/">Hyperdrive</a>, and <a href="https://developers.cloudflare.com/analytics/analytics-engine/">Workers Analytics Engine</a> are ready for production scale and generally available. On Tuesday, April 2, we <a href="/workers-ai-ga-huggingface-loras-python-support">announced</a> the same about our inference platform, <a href="https://developers.cloudflare.com/workers-ai/">Workers AI</a>. And we’re not nearly done yet.</p><p>However, production readiness isn’t just about the scale and reliability of the services you build with. You also need tools to make changes safely and reliably. You depend not just on what Cloudflare provides, but on being able to precisely control and tailor how Cloudflare behaves to the needs of your application.</p><p>Today we are announcing five updates that put more power in your hands – Gradual Deployments, source mapped stack traces in Tail Workers, a new Rate Limiting API, brand-new API SDKs, and updates to Durable Objects – each built with mission-critical production services in mind. We build our own products using Workers, including <a href="https://developers.cloudflare.com/cloudflare-one/policies/access/">Access</a>, <a href="https://developers.cloudflare.com/r2/">R2</a>, <a href="https://developers.cloudflare.com/kv/">KV</a>, <a href="https://developers.cloudflare.com/waiting-room/">Waiting Room</a>, <a href="https://developers.cloudflare.com/vectorize/">Vectorize</a>, <a href="https://developers.cloudflare.com/queues/">Queues</a>, <a href="https://developers.cloudflare.com/stream/">Stream</a>, and more. We rely on each of these new features ourselves to ensure that we are production ready – and now we’re excited to bring them to everyone.</p>
    <div>
      <h3>Gradually deploy changes to Workers and Durable Objects</h3>
      <a href="#gradually-deploy-changes-to-workers-and-durable-objects">
        
      </a>
    </div>
    <p>Deploying a Worker is nearly instantaneous – a few seconds and your change is live <a href="https://www.cloudflare.com/network/">everywhere</a>.</p><p>When you reach production scale, each change you make carries greater risk, both in terms of volume and expectations. You need to meet your 99.99% availability SLA, or have an ambitious P90 latency SLO. A bad deployment that’s live for 100% of traffic for 45 seconds could mean millions of failed requests. A subtle code change could cause a thundering herd of retries to an overwhelmed backend, if rolled out all at once. These are the kinds of risks we consider and mitigate ourselves for our own services built on Workers.</p><p>The way to mitigate these risks is to deploy changes gradually – commonly called rolling deployments:</p><ol><li><p>The current version of your application runs in production.</p></li><li><p>You deploy the new version of your application to production, but only route a small percentage of traffic to this new version, and wait for it to “soak” in production, monitoring for regressions and bugs. If something bad happens, you’ve caught it early at a small percentage (e.g. 1%) of traffic and can revert quickly.</p></li><li><p>You gradually increment the percentage of traffic until the new version receives 100%, at which point it is fully rolled out.</p></li></ol><p>Today we’re opening up a first-class way to deploy code changes gradually to Workers and Durable Objects via the <a href="https://developers.cloudflare.com/api/operations/worker-deployments-list-deployments">Cloudflare API</a>, the <a href="https://developers.cloudflare.com/workers/configuration/versions-and-deployments/gradual-deployments/#via-wrangler">Wrangler CLI</a>, or the <a href="https://developers.cloudflare.com/workers/configuration/versions-and-deployments/gradual-deployments/#via-the-cloudflare-dashboard">Workers dashboard</a>. Gradual Deployments is entering open beta – you can use Gradual Deployments with any Cloudflare account that is on the <a href="https://developers.cloudflare.com/workers/platform/pricing/#workers">Workers Free plan</a>, and very soon you’ll be able to start using Gradual Deployments with Cloudflare accounts on the <a href="https://developers.cloudflare.com/workers/platform/pricing/#workers">Workers Paid</a> and Enterprise plans. You’ll see a banner on the Workers dashboard once your account has access.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5C2hc1EtfppDeWWDxJBh3K/3235bfa198e136bfac793f877415011d/pasted-image-0.png" />
            
            </figure><p>When you have two versions of your Worker or Durable Object running concurrently in production, you almost certainly want to be able to filter your metrics, exceptions, and logs by version. This can help you spot production issues early, when the new version is only rolled out to a small percentage of traffic, or compare performance metrics when splitting traffic 50/50. We’ve also added <a href="https://www.cloudflare.com/learning/performance/what-is-observability/">observability</a> at a version level across our platform:</p><ul><li><p>You can filter analytics in the Workers dashboard and via the <a href="https://developers.cloudflare.com/analytics/graphql-api/">GraphQL Analytics API</a> by version.</p></li><li><p><a href="https://developers.cloudflare.com/workers/observability/logging/logpush/">Workers Trace Events</a> and <a href="https://developers.cloudflare.com/workers/observability/logging/tail-workers/">Tail Worker</a> events include the version ID of your Worker, along with optional version message and version tag fields.</p></li><li><p>When using <a href="https://developers.cloudflare.com/workers/wrangler/commands/#tail">wrangler tail</a> to view live logs, you can view logs for a specific version.</p></li><li><p>You can access version ID, message, and tag from within your Worker’s code, by configuring the <a href="https://developers.cloudflare.com/workers/runtime-apis/bindings/version-metadata/">Version Metadata binding</a>.</p></li></ul><p>You may also want to make sure that each client or user only sees a consistent version of your Worker. We’ve added <a href="https://developers.cloudflare.com/workers/configuration/versions-and-deployments/gradual-deployments/#version-keys-and-session-affinity">Version Affinity</a> so that requests associated with a particular identifier (such as user, session, or any unique ID) are always handled by a consistent version of your Worker. <a href="https://developers.cloudflare.com/workers/configuration/versions-and-deployments/gradual-deployments/#version-keys-and-session-affinity">Session Affinity</a>, when used with <a href="https://developers.cloudflare.com/workers/configuration/versions-and-deployments/gradual-deployments/#setting-cloudflare-workers-version-key-using-ruleset-engine">Ruleset Engine</a>, gives you full control over both the mechanism and identifier used to ensure “stickiness”.</p><p>Gradual Deployments is entering open beta. As we move towards GA, we’re working to support:</p><ul><li><p><b>Version Overrides.</b> Invoke a specific version of your Worker in order to test before it serves any production traffic. This will allow you to create Blue-Green Deployments.</p></li><li><p><b>Cloudflare Pages.</b> Let the <a href="https://www.cloudflare.com/learning/serverless/glossary/what-is-ci-cd/">CI/CD system</a> in Pages automatically progress the deployments on your behalf.</p></li><li><p><b>Automatic rollbacks.</b> Roll back deployments automatically when the error rate spikes for a new version of your Worker.</p></li></ul><p>We’re looking forward to hearing your feedback! Let us know what you think through <a href="https://www.cloudflare.com/lp/developer-week-deployments/">this</a> feedback form or reach out in our <a href="https://discord.gg/HJvPcPcN">Developer Discord</a> in the #workers-gradual-deployments-beta channel.</p>
    <div>
      <h3>Source mapped stack traces in Tail Workers</h3>
      <a href="#source-mapped-stack-traces-in-tail-workers">
        
      </a>
    </div>
    <p>Production readiness means tracking errors and exceptions, and trying to drive them down to zero. When an error occurs, the first thing you typically want to look at is the error’s <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/stack">stack trace</a> – the specific functions that were called, in what order, from which line and file, and with what arguments.</p><p>Most JavaScript code – not just on Workers, but across platforms – is first bundled, often transpiled, and then minified before being deployed to production. This is done behind the scenes to create smaller bundles to optimize performance and convert from Typescript to JavaScript if needed.</p><p>If you’ve ever seen an exception return a stack trace like: /src/index.js:1:342,it means the error occurred on the 342nd character of your function’s minified code. This is clearly not very helpful for debugging.</p><p><a href="https://web.dev/articles/source-maps">Source maps</a> solve this – they map compiled and minified code back to the original code that you wrote. Source maps are combined with the stack trace returned by the JavaScript runtime in order to present you with a human-readable stack trace. For example, the following stack trace shows that the Worker received an unexpected null value on line 30 of the down.ts file. This is a useful starting point for debugging, and you can move down the stack trace to understand the functions that were called that were set that resulted in the null value.</p>
            <pre><code>Unexpected input value: null
  at parseBytes (src/down.ts:30:8)
  at down_default (src/down.ts:10:19)
  at Object.fetch (src/index.ts:11:12)</code></pre>
            <p>Here’s how it works:</p><ol><li><p>When you set upload_source_maps = true in your <a href="https://developers.cloudflare.com/workers/wrangler/configuration/">wrangler.toml</a>, Wrangler will automatically generate and upload any source map files when you run <a href="https://developers.cloudflare.com/workers/wrangler/commands/#deploy">wrangler deploy</a> or <a href="https://developers.cloudflare.com/workers/wrangler/commands/#versions">wrangler versions upload</a>.</p></li><li><p>When your Worker throws an uncaught exception, we fetch the source map and use it to map the stack trace of the exception back to lines of your Worker’s original source code.</p></li><li><p>You can then view this deobfuscated stack trace in <a href="https://developers.cloudflare.com/workers/observability/logging/real-time-logs/">real-time logs</a> or in <a href="https://developers.cloudflare.com/workers/observability/logging/tail-workers/">Tail Workers</a>.</p></li></ol><p>Starting today, in open beta, you can upload source maps to Cloudflare when you deploy your Worker – <a href="https://developers.cloudflare.com/workers/observability/source-maps">get started by reading the docs</a>. And starting on April 15th , the Workers runtime will start using source maps to deobfuscate stack traces. We’ll post a notification in the Cloudflare dashboard and post on our <a href="https://twitter.com/CloudflareDev?ref_src=twsrc%5Egoogle%7Ctwcamp%5Eserp%7Ctwgr%5Eauthor">Cloudflare Developers X account</a> when source mapped stack traces are available.</p>
    <div>
      <h3>New Rate Limiting API in Workers</h3>
      <a href="#new-rate-limiting-api-in-workers">
        
      </a>
    </div>
    <p>An API is only production ready if it has a sensible <a href="https://www.cloudflare.com/learning/bots/what-is-rate-limiting/">rate limit</a>. And as you grow, so does the complexity and diversity of limits that you need to enforce in order to balance the needs of specific customers, protect the health of your service, or enforce and adjust limits in specific scenarios. Cloudflare’s own API has this challenge – each of our dozens of products, each with many API endpoints, may need to enforce different rate limits.</p><p>You’ve been able to configure <a href="https://developers.cloudflare.com/waf/rate-limiting-rules/">Rate Limiting rules</a> on Cloudflare since 2017. But until today, the only way to control this was in the Cloudflare dashboard or via the Cloudflare API. It hasn’t been possible to define behavior at <i>runtime</i>, or write code in a Worker that interacts directly with rate limits – you could only control whether a request is rate limited or not before it hits your Worker.</p><p>Today we’re introducing a new API, in open beta, that gives you direct access to rate limits from your Worker. It’s lightning fast, backed by memcached, and dead simple to add to your Worker. For example, the following configuration defines a rate limit of 100 requests within a 60-second period:</p>
            <pre><code>[[unsafe.bindings]]
name = "RATE_LIMITER"
type = "ratelimit"
namespace_id = "1001" # An identifier unique to your Cloudflare account

# Limit: the number of tokens allowed within a given period, in a single Cloudflare location
# Period: the duration of the period, in seconds. Must be either 60 or 10
simple = { limit = 100, period = 60 } </code></pre>
            <p>Then, in your Worker, you can call the limit method on the RATE_LIMITER binding, providing a key of your choosing. Given the configuration above, this code will return a <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429">HTTP 429</a> response status code once more than 100 requests to a specific path are made within a 60-second period:</p>
            <pre><code>export default {
  async fetch(request, env) {
    const { pathname } = new URL(request.url)

    const { success } = await env.RATE_LIMITER.limit({ key: pathname })
    if (!success) {
      return new Response(`429 Failure – rate limit exceeded for ${pathname}`, { status: 429 })
    }

    return new Response(`Success!`)
  }
}</code></pre>
            <p>Now that Workers can connect directly to a data store like memcached, what else could we provide? Counters? Locks? An <a href="https://github.com/cloudflare/workerd/pull/1666">in-memory cache</a>? Rate limiting is the first of many primitives that we’re exploring providing in Workers that address questions we’ve gotten for years about where a temporary shared state that spans many Worker <a href="https://developers.cloudflare.com/workers/reference/how-workers-works/#isolates">isolates</a> should live. If you rely on putting state in the global scope of your Worker today, we’re working on better primitives that are purpose-built for specific use cases.</p><p>The Rate Limiting API in Workers is in open beta, and you can get started by <a href="https://developers.cloudflare.com/workers/runtime-apis/bindings/rate-limit">reading the docs</a>.</p>
    <div>
      <h3>New auto-generated SDKs for Cloudflare’s API</h3>
      <a href="#new-auto-generated-sdks-for-cloudflares-api">
        
      </a>
    </div>
    <p>Production readiness means going from making changes by clicking buttons in a dashboard to making changes programmatically, using an infrastructure-as-code approach like <a href="https://github.com/cloudflare/terraform-provider-cloudflare">Terraform</a> or <a href="https://github.com/pulumi/pulumi-cloudflare">Pulumi</a>, or by making API requests directly, either on your own or via an SDK.</p><p>The <a href="https://developers.cloudflare.com/api/">Cloudflare API</a> is massive, and constantly adding new capabilities – on average we <a href="https://github.com/cloudflare/api-schemas/activity">update our API schemas between 20 and 30 times per day</a>. But to date, our API SDKs have been built and maintained manually, so we had a burning need to automate this.</p><p>We’ve done that, and today we’re announcing new client SDKs for the Cloudflare API in three languages – <a href="https://github.com/cloudflare/cloudflare-typescript">Typescript</a>, <a href="https://github.com/cloudflare/cloudflare-python">Python</a> and <a href="https://github.com/cloudflare/cloudflare-go">Go</a> – with more languages on the way.</p><p>Each SDK is generated automatically using <a href="https://www.stainlessapi.com/">Stainless API</a>, based on the <a href="https://github.com/cloudflare/api-schemas">OpenAPI schemas</a> that define the structure and capabilities of each of our API endpoints. This means that when we add any new functionality to the Cloudflare API, across any Cloudflare product, these API SDKs are automatically regenerated, and new versions are published, ensuring that they are correct and up-to-date.</p><p>You can install the SDKs by running one of the following commands:</p>
            <pre><code>// Typescript
npm install cloudflare

// Python
pip install cloudflare

// Go
go get -u github.com/cloudflare/cloudflare-go/v2</code></pre>
            <p>If you use Terraform or Pulumi, under the hood, Cloudflare’s Terraform Provider currently uses the existing, non-automated <a href="https://github.com/cloudflare/cloudflare-go">Go SDK</a>. When you run terraform apply, the Cloudflare Terraform Provider determines which API requests to make in what order, and executes these using the Go SDK.</p><p>The new, auto-generated Go SDK clears a path towards more comprehensive Terraform support for all Cloudflare products, providing a base set of tools that can be relied upon to be both correct and up-to-date with the latest API changes. We’re building towards a future where any time a product team at Cloudflare builds a new feature that is exposed via the Cloudflare API, it is automatically supported by the SDKs. Expect more updates on this throughout 2024.</p>
    <div>
      <h3>Durable Object namespace analytics and WebSocket Hibernation GA</h3>
      <a href="#durable-object-namespace-analytics-and-websocket-hibernation-ga">
        
      </a>
    </div>
    <p>Many of our own products, including <a href="https://developers.cloudflare.com/waiting-room/">Waiting Room</a>, <a href="https://developers.cloudflare.com/r2/">R2</a>, and <a href="https://developers.cloudflare.com/queues/">Queues</a>, as well as platforms like <a href="https://www.partykit.io/">PartyKit</a>, are built using <a href="https://developers.cloudflare.com/durable-objects/">Durable Objects</a>. Deployed globally, including newly added support for Oceania, you can think of Durable Objects like singleton Workers that can provide a single point of coordination and <a href="https://developers.cloudflare.com/durable-objects/api/transactional-storage-api/">persist state</a>. They’re perfect for applications that need real-time user coordination, like interactive chat or collaborative editing. Take Atlassian’s word for it:</p><blockquote><p><i>One of our new capabilities is</i> <a href="https://www.atlassian.com/software/confluence/whiteboards"><i>Confluence whiteboards</i></a><i>, which provides a freeform way to capture unstructured work like brainstorming and early planning before teams document it more formally. The team considered many options for real-time collaboration and ultimately decided to use Cloudflare’s Durable Objects. Durable Objects have proven to be a fantastic fit for this problem space, with a unique combination of functionalities that has allowed us to greatly simplify our infrastructure and easily scale to a large number of users. -</i> <a href="https://www.atlassian.com/software/confluence/whiteboards"><i>Atlassian</i></a></p></blockquote><p>We haven’t previously exposed associated analytical trends in the dashboard, making it hard to understand the usage patterns and error rates within a <a href="https://developers.cloudflare.com/durable-objects/configuration/access-durable-object-from-a-worker/#generate-ids-randomly">Durable Objects namespace</a> unless you used the <a href="https://developers.cloudflare.com/analytics/graphql-api/">GraphQL Analytics API</a> directly. The <a href="https://dash.cloudflare.com/?to=/:account/workers/durable-objects">Durable Objects dashboard</a> has now been revamped, letting you drill down into metrics, and go as deep as you need.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2wFlllqLKz9G1J7ZU4cAfp/67b84ff52331c449bfbbb291fec01ffa/pasted-image-0--1-.png" />
            
            </figure><p>From <a href="/introducing-workers-durable-objects">day one</a>, Durable Objects have supported <a href="https://developer.mozilla.org/en-US/docs/Web/API/WebSocket">WebSockets</a>, allowing many clients to directly connect to a Durable Object to send and receive messages.</p><p>However, sometimes client applications open a WebSocket connection and then eventually stop doing...anything. Think about that tab you’ve had sitting open in your browser for the last 5 hours, but haven’t touched. If it uses WebSockets to send and receive messages, it effectively has a long-lived TCP connection that isn’t being used for anything. If this connection is to a Durable Object, the Durable Object must stay running, waiting for something to happen, consuming memory, and costing you money.</p><p>We first <a href="/workers-pricing-scale-to-zero">introduced WebSocket Hibernation</a> to solve this problem, and today we’re announcing that this feature is out of beta and is Generally Available. With WebSocket Hibernation, you set an automatic response to be used while hibernating and serialize state such that it survives hibernation. This gives Cloudflare the inputs we need in order to maintain open WebSocket connections from clients while “hibernating” the Durable Object such that it is not actively running, and you are not billed for idle time. The result is that your state is always available in-memory when you actually need it, but isn’t unnecessarily kept around when it’s not. As long as your Durable Object is hibernating, even if there are active clients still connected over a WebSocket, you won’t be billed for duration.</p><p>In addition, we’ve heard developer feedback on the costs of incoming WebSocket messages to Durable Objects, which favor smaller, more frequent messages for real-time communication. Starting today incoming WebSocket messages will be billed at the equivalent of 1/20th of a request (as opposed to 1 message being the equivalent of 1 request as it has been up until now). Following a <a href="https://developers.cloudflare.com/durable-objects/platform/pricing/#example-4">pricing example</a>:</p>
<table>
<thead>
  <tr>
    <th></th>
    <th><span>WebSocket Connection Requests</span></th>
    <th><span>Incoming WebSocket Messages</span></th>
    <th><span>Billed Requests</span></th>
    <th><span>Request Billing</span></th>
  </tr>
</thead>
<tbody>
  <tr>
    <td><span>Before</span></td>
    <td><span>10K</span></td>
    <td><span>432M</span></td>
    <td><span>432,010,000</span></td>
    <td><span>$64.65</span></td>
  </tr>
  <tr>
    <td><span>After</span></td>
    <td><span>10K</span></td>
    <td><span>432M</span></td>
    <td><span>21,610,000</span></td>
    <td><span>$3.09</span></td>
  </tr>
</tbody>
</table>
    <div>
      <h3>Production ready, without production complexity</h3>
      <a href="#production-ready-without-production-complexity">
        
      </a>
    </div>
    <p>Becoming production ready on the last generation of cloud platforms meant slowing down how fast you shipped. It meant stitching together many disconnected tools or standing up whole teams to work on internal platforms. You had to retrofit your own productivity layers onto platforms that put up roadblocks.</p><p>The Cloudflare Developer Platform is grown up and production ready, and committed to being an integrated platform where products intuitively work together and where there aren’t 10 ways to do the same thing, with no need for a compatibility matrix to help understand what works together. Each of these updates shows this in action, integrating new functionality across products and parts of Cloudflare’s platform.</p><p>To that end, we want to hear from you about not only what you want to see next, but where you think we could be even simpler, or where you think our products could work better together. Tell us where you think we could do more – the <a href="https://discord.cloudflare.com/">Cloudflare Developers Discord</a> is always open.</p> ]]></content:encoded>
            <category><![CDATA[Developer Week]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <category><![CDATA[Rate Limiting]]></category>
            <category><![CDATA[SDK]]></category>
            <category><![CDATA[Observability]]></category>
            <guid isPermaLink="false">2IHoIDHRhxpNxOfd1ihQ0Y</guid>
            <dc:creator>Tanushree Sharma</dc:creator>
            <dc:creator>Jacob Bednarz</dc:creator>
        </item>
        <item>
            <title><![CDATA[Running Serverless Puppeteer with Workers and Durable Objects]]></title>
            <link>https://blog.cloudflare.com/running-serverless-puppeteer-workers-durable-objects/</link>
            <pubDate>Thu, 28 Sep 2023 13:00:38 GMT</pubDate>
            <description><![CDATA[ We’ve heard from developers that configuring and maintaining their own serverless browser automation systems can be quite painful. The Workers Browser Rendering API solves this ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Last year, we <a href="/introducing-workers-browser-rendering-api/">announced the Browser Rendering API</a> – letting users running Puppeteer, a browser automation library, directly in Workers. Puppeteer is one of the most popular libraries used to interact with a headless browser instance to accomplish tasks like taking screenshots, generating PDFs, crawling web pages, and testing <a href="https://www.cloudflare.com/learning/security/what-is-web-application-security/">web applications</a>. We’ve heard from developers that configuring and maintaining their own serverless browser automation systems can be quite painful.</p><p>The <a href="https://developers.cloudflare.com/browser-rendering/">Workers Browser Rendering API</a> solves this. It makes the Puppeteer library available directly in your Worker, connected to a real web browser, without the need to configure and manage infrastructure or keep browser sessions warm yourself. You can use <a href="https://www.npmjs.com/package/@cloudflare/puppeteer">@cloudflare/puppeteer</a> to run the full Puppeteer API directly on Workers!</p><p>We’ve seen so much interest from the developer community since launching last year. While the Browser Rendering API is still in beta (sign up to our <a href="https://www.cloudflare.com/lp/workers-browser-rendering-api/?ref=blog.cloudflare.com&amp;cf_target_id=99BC25CE5278572504B986049859D8A2">waitlist</a> to get access), we wanted to share a way to get more out of our <a href="https://developers.cloudflare.com/browser-rendering/platform/limits/">current limits</a> by using the Browser Rendering API with <a href="https://developers.cloudflare.com/durable-objects/">Durable Objects</a>. We’ll also be sharing pricing for the Rendering API, so you can build knowing exactly what you’ll pay for.</p>
    <div>
      <h3>Building a responsive web design testing tool with the Browser Rendering API</h3>
      <a href="#building-a-responsive-web-design-testing-tool-with-the-browser-rendering-api">
        
      </a>
    </div>
    <p>As a designer or frontend developer, you want to make sure that content is well-designed for visitors browsing on different screen sizes. With the number of possible devices that users are browsing on are growing, it becomes difficult to test all the possibilities manually. While there are many testing tools on the market, we want to show how easy it is to create your own Chromium based tool with the Workers Browser Rendering API and Durable Objects.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/OQNeORd8VW4RffHGH8ndq/b94872dfb08664a524eae20227785acf/pasted-image-0--6--2.png" />
            
            </figure><p>We’ll be using the Worker to handle any incoming requests, pass them to the Durable Object to take screenshots and store them in an R2 bucket. The Durable Object is used to create a browser session that’s persistent. By using <a href="https://developers.cloudflare.com/durable-objects/api/alarms-in-durable-objects/">Durable Object Alarms</a> we can keep browsers open for longer and reuse browser sessions across requests.</p><p>Let’s dive into how we can build this application:</p><ol><li><p>Create a Worker with a Durable Object, Browser Rendering API binding and R2 bucket. This is the resulting wrangler.toml:</p></li></ol>
            <pre><code>name = "rendering-api-demo"
main = "src/index.js"
compatibility_date = "2023-09-04"
compatibility_flags = [ "nodejs_compat"]
account_id = "c05e6a39aa4ccdd53ad17032f8a4dc10"


# Browser Rendering API binding
browser = { binding = "MYBROWSER" }

# Bind an R2 Bucket
[[r2_buckets]]
binding = "BUCKET"
bucket_name = "screenshots"

# Binding to a Durable Object
[[durable_objects.bindings]]
name = "BROWSER"
class_name = "Browser"

[[migrations]]
tag = "v1" # Should be unique for each entry
new_classes = ["Browser"] # Array of new classes</code></pre>
            <p>2. Define the Worker</p><p>This Worker simply passes the request onto the Durable Object.</p>
            <pre><code>export default {
	async fetch(request, env) {

		let id = env.BROWSER.idFromName("browser");
		let obj = env.BROWSER.get(id);
	  
		// Send a request to the Durable Object, then await its response.
		let resp = await obj.fetch(request.url);
		let count = await resp.text();
	  
		return new Response("success");
	}
};</code></pre>
            <p>3. Define the Durable Object class</p>
            <pre><code>const KEEP_BROWSER_ALIVE_IN_SECONDS = 60;

export class Browser {
	constructor(state, env) {
		this.state = state;
		this.env = env;
		this.keptAliveInSeconds = 0;
		this.storage = this.state.storage;
	}
  
	async fetch(request) {
		// screen resolutions to test out
		const width = [1920, 1366, 1536, 360, 414]
		const height = [1080, 768, 864, 640, 896]

		// use the current date and time to create a folder structure for R2
		const nowDate = new Date()
		var coeff = 1000 * 60 * 5
		var roundedDate = (new Date(Math.round(nowDate.getTime() / coeff) * coeff)).toString();
		var folder = roundedDate.split(" GMT")[0]

		//if there's a browser session open, re-use it
		if (!this.browser) {
			console.log(`Browser DO: Starting new instance`);
			try {
			  this.browser = await puppeteer.launch(this.env.MYBROWSER);
			} catch (e) {
			  console.log(`Browser DO: Could not start browser instance. Error: ${e}`);
			}
		  }
		
		// Reset keptAlive after each call to the DO
		this.keptAliveInSeconds = 0;
		
		const page = await this.browser.newPage();

		// take screenshots of each screen size 
		for (let i = 0; i &lt; width.length; i++) {
			await page.setViewport({ width: width[i], height: height[i] });
			await page.goto("https://workers.cloudflare.com/");
			const fileName = "screenshot_" + width[i] + "x" + height[i]
			const sc = await page.screenshot({
				path: fileName + ".jpg"
			}
			);

			this.env.BUCKET.put(folder + "/"+ fileName + ".jpg", sc);
		  }
		
		// Reset keptAlive after performing tasks to the DO.
		this.keptAliveInSeconds = 0;

		// set the first alarm to keep DO alive
		let currentAlarm = await this.storage.getAlarm();
		if (currentAlarm == null) {
		console.log(`Browser DO: setting alarm`);
		const TEN_SECONDS = 10 * 1000;
		this.storage.setAlarm(Date.now() + TEN_SECONDS);
		}
		
		await this.browser.close();
		return new Response("success");
	}

	async alarm() {
		this.keptAliveInSeconds += 10;
	
		// Extend browser DO life
		if (this.keptAliveInSeconds &lt; KEEP_BROWSER_ALIVE_IN_SECONDS) {
		  console.log(`Browser DO: has been kept alive for ${this.keptAliveInSeconds} seconds. Extending lifespan.`);
		  this.storage.setAlarm(Date.now() + 10 * 1000);
		} else console.log(`Browser DO: cxceeded life of ${KEEP_BROWSER_ALIVE_IN_SECONDS}. Browser DO will be shut down in 10 seconds.`);
	  }

  }</code></pre>
            <p>That’s it! With less than a hundred lines of code, you can fully customize a powerful tool to automate responsive web design testing. You can even incorporate it into your CI pipeline to automatically test different window sizes with each build and verify the result is as expected by using an automated library like <a href="https://www.npmjs.com/package/pixelmatch">pixelmatch</a>.</p>
    <div>
      <h3>How much will this cost?</h3>
      <a href="#how-much-will-this-cost">
        
      </a>
    </div>
    <p>We’ve spoken to many customers deploying a Puppeteer service on their own infrastructure, on <a href="https://www.cloudflare.com/learning/cloud/what-is-a-public-cloud/">public cloud containers</a> or <a href="https://www.cloudflare.com/learning/serverless/glossary/function-as-a-service-faas/">functions</a> or using managed services. The common theme that we’ve heard is that these services are costly – costly to maintain and expensive to run.</p><p>While you won’t be billed for the Browser Rendering API yet, we want to be transparent with you about costs you start building. We know it’s important to understand the pricing structure so that you don’t get a surprise bill and so that you can design your application efficiently.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6gFIbTnuDafnmpIH2FpQUX/94ce188a354578aae872971f974fd4b4/pasted-image-0--7--2.png" />
            
            </figure><p>You pay based on two usage metrics:</p><ol><li><p>Number of sessions: A Browser Session is a new instance of a browser being launched</p></li><li><p>Number of concurrent sessions: Concurrent Sessions is the number of browser instances open at once</p></li></ol><p>Using Durable Objects to persist browser sessions improves performance by eliminating the time that it takes to spin up a new browser session. Since it re-uses sessions, it cuts down on the number of concurrent sessions needed. We highly encourage this model of session re-use if you expect to see consistent traffic for applications that you build on the Browser Rendering API.</p><p>If you have feedback about this pricing, we’re all ears. Feel free to reach out through <a href="https://discord.gg/8Gs9T6jN">Discord</a> (channel name: browser-rendering-api-beta) and share your thoughts.</p>
    <div>
      <h3>Get Started</h3>
      <a href="#get-started">
        
      </a>
    </div>
    <p>Sign up to our <a href="https://www.cloudflare.com/lp/workers-browser-rendering-api/?ref=blog.cloudflare.com&amp;cf_target_id=99BC25CE5278572504B986049859D8A2">waitlist</a> to get access to the Workers Browser Rendering API. We’re so excited to see what you build! Share your creations with us on Twitter/X <a href="https://www.twitter.com/cloudflaredev">@CloudflareDev</a> or on our Discord community.</p> ]]></content:encoded>
            <category><![CDATA[Birthday Week]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Durable Objects]]></category>
            <category><![CDATA[JavaScript]]></category>
            <category><![CDATA[Developers]]></category>
            <guid isPermaLink="false">341i4XnnUcmAjy5VZm855W</guid>
            <dc:creator>Tanushree Sharma</dc:creator>
        </item>
        <item>
            <title><![CDATA[Cloudflare Integrations Marketplace introduces three new partners: Sentry, Momento and Turso]]></title>
            <link>https://blog.cloudflare.com/cloudflare-integrations-marketplace-new-partners-sentry-momento-turso/</link>
            <pubDate>Thu, 28 Sep 2023 13:00:36 GMT</pubDate>
            <description><![CDATA[ We introduced integrations with Supabase, PlanetScale, Neon and Upstash. Today, we are thrilled to introduce our newest additions to Cloudflare’s Integrations Marketplace – Sentry, Turso and Momento ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Building modern full-stack applications requires connecting to many hosted third party services, from observability platforms to databases and more. All too often, this means spending time doing busywork, managing credentials and writing glue code just to get started. This is why we’re building out the Cloudflare Integrations Marketplace to allow developers to easily discover, configure and deploy products to use with Workers.</p><p>Earlier this year, we introduced integrations with <a href="/announcing-database-integrations/">Supabase, PlanetScale, Neon</a> and <a href="/cloudflare-workers-database-integration-with-upstash/">Upstash</a>. Today, we are thrilled to introduce our newest additions to Cloudflare’s Integrations Marketplace – <a href="https://developers.cloudflare.com/workers/observability/sentry-integration/">Sentry</a>, <a href="https://developers.cloudflare.com/workers/databases/native-integrations/turso/">Turso</a> and <a href="https://developers.cloudflare.com/workers/databases/native-integrations/momento/">Momento</a>.</p><p>Let's take a closer look at some of the exciting integration providers that are now part of the Workers Integration Marketplace.</p>
    <div>
      <h3>Improve performance and reliability by connecting Workers to Sentry</h3>
      <a href="#improve-performance-and-reliability-by-connecting-workers-to-sentry">
        
      </a>
    </div>
    <p>When your Worker encounters an error you want to know what happened and exactly what line of code triggered it. <a href="https://sentry.io/welcome/">Sentry</a> is an <a href="https://www.cloudflare.com/application-services/solutions/app-performance-monitoring/">application monitoring</a> platform that helps developers identify and resolve issues in real-time.</p><p>The <a href="https://developers.cloudflare.com/workers/observability/sentry-integration/">Workers and Sentry integration</a> automatically sends errors, exceptions and <code>console.log()</code> messages from your Worker to Sentry with no code changes required. Here’s how it works:</p><ol><li><p>You enable the integration from the Cloudflare Dashboard.</p></li><li><p>The credentials from the Sentry project of your choice are automatically added to your Worker.</p></li><li><p>You can configure <a href="https://docs.sentry.io/platforms/javascript/configuration/sampling/#configuring-the-transaction-sample-rate">sampling</a> to control the volume of events you want sent to Sentry. This includes selecting the sample rate for different status codes and exceptions.</p></li><li><p>Cloudflare deploys a <a href="https://developers.cloudflare.com/workers/observability/tail-workers/">Tail Worker</a> behind the scenes that contains all the logic needed to capture and send data to Sentry.</p></li><li><p>Like magic, errors, exceptions, and log messages are automatically sent to your Sentry project.</p></li></ol><p>In the future, we’ll be improving this integration by adding support for uploading source maps and stack traces so that you can pinpoint exactly which line of your code caused the issue. We’ll also be tying in <a href="https://developers.cloudflare.com/workers/configuration/deployments/">Workers deployments</a> with <a href="https://docs.sentry.io/product/releases/">Sentry releases</a> to correlate new versions of your Worker with events in Sentry that help pinpoint problematic deployments. Check out our <a href="https://developers.cloudflare.com/workers/observability/sentry-integration/">developer documentation</a> for more information.</p>
    <div>
      <h3>Develop at the Data Edge with Turso + Workers</h3>
      <a href="#develop-at-the-data-edge-with-turso-workers">
        
      </a>
    </div>
    <p><a href="https://turso.tech/">Turso</a> is an edge-hosted, distributed database based on libSQL, an open-source fork of SQLite. Turso focuses on providing a global service that minimizes query latency (and thus, application latency!). It’s perfect for use with Cloudflare Workers – both compute and data are served close to users.</p><p>Turso follows the model of having one primary database with replicas that are located globally, close to users. Turso automatically routes requests to a replica closest to where the Worker was invoked. This model works very efficiently for read heavy applications since read requests can be served globally. If you’re running an application that has heavy write workloads, or want to cut down on replication costs, you can run Turso with just the <a href="https://docs.turso.tech/concepts#primary">primary</a> instance and use <a href="https://developers.cloudflare.com/workers/configuration/smart-placement/">Smart Placement</a> to speed up queries.</p><p>The Turso and Workers integration automatically pulls in Turso API credentials and adds them as secrets to your Worker, so that you can start using Turso by simply establishing a connection using the <a href="https://www.npmjs.com/package/@libsql/client">libsql SDK</a>. Get started with the Turso and Workers Integration today by heading to our <a href="https://developers.cloudflare.com/workers/databases/native-integrations/turso/">developer documentation</a>.</p>
    <div>
      <h3>Cache responses from data stores with Momento</h3>
      <a href="#cache-responses-from-data-stores-with-momento">
        
      </a>
    </div>
    <p><a href="https://www.gomomento.com/services/cache">Momento Cache</a> is a low latency serverless caching solution that can be used on top of relational databases, key-value databases or object stores to get faster load times and better performance. Momento abstracts details like scaling, warming and replication so that users can deploy cache in a matter of minutes.</p><p>The Momento and Workers integration automatically pulls in your Momento API key using an OAuth2 flow. The Momento API key is added as a secret in Workers and, from there, you can start using the <a href="https://www.npmjs.com/package/@gomomento/sdk">Momento SDK</a> in Workers. Head to our <a href="https://developers.cloudflare.com/workers/databases/native-integrations/momento/">developer documentation</a> to learn more and use the Momento and Workers integration!</p>
    <div>
      <h3>Try integrations out today</h3>
      <a href="#try-integrations-out-today">
        
      </a>
    </div>
    <p>We want to give you back time, so that you can focus less on configuring and connecting third party tools to Workers and spend more time building. We’re excited to see what you build with integrations. Share your projects with us on Twitter (<a href="https://twitter.com/cloudflaredev">@CloudflareDev</a>) and stay tuned for more exciting updates as we continue to grow our Integrations Marketplace!</p><p>If you would like to partner with Cloudflare and build an integration, please fill out the <a href="https://www.cloudflare.com/partners/technology-partners/">partner request form</a> and we'll be in touch.</p> ]]></content:encoded>
            <category><![CDATA[Birthday Week]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <category><![CDATA[Observability]]></category>
            <category><![CDATA[Edge Database]]></category>
            <category><![CDATA[Cache]]></category>
            <category><![CDATA[Partners]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <guid isPermaLink="false">HkjVgVT5KZ05Cjk2u6S99</guid>
            <dc:creator>Tanushree Sharma</dc:creator>
        </item>
        <item>
            <title><![CDATA[How Cloudflare is powering the next generation of platforms with Workers]]></title>
            <link>https://blog.cloudflare.com/powering-platforms-on-workers/</link>
            <pubDate>Thu, 18 May 2023 13:00:01 GMT</pubDate>
            <description><![CDATA[ Workers for Platforms is our Workers offering for customers building new platforms on Cloudflare Workers. Let’s take a look back and recap why we built Workers for Platforms, show you some of the most interesting problems our customers have been solving and share new features that are now available! ]]></description>
            <content:encoded><![CDATA[ <p></p><p>We launched Workers for Platforms, our Workers offering for SaaS businesses, almost exactly one year ago to the date! We’ve seen a wide array of customers using Workers for Platforms – from e-commerce to CMS, low-code/no-code platforms and also a new wave of AI businesses running tailored inference models for their end customers!</p><p>Let’s take a look back and recap why we built Workers for Platforms, show you some of the most interesting problems our customers have been solving and share new features that are now available!</p>
    <div>
      <h2>What is Workers for Platforms?</h2>
      <a href="#what-is-workers-for-platforms">
        
      </a>
    </div>
    <p>SaaS businesses are all too familiar with the never ending need to keep up with their users' feature requests. Thinking back, the introduction of Workers at Cloudflare was to solve this very pain point. Workers gave our customers the power to program our network to meet their specific requirements!</p><p>Need to implement complex load balancing across many origins? <i>Write a Worker.</i> Want a custom set of WAF rules for each region your business operates in? <i>Go crazy, write a Worker.</i></p><p>We heard the same themes coming up with our customers – which is why we partnered with early customers to build Workers for Platforms. We worked with the Shopify Oxygen team early on in their journey to create a built-in hosting platform for Hydrogen, their Remix-based eCommerce framework. Shopify’s Hydrogen/Oxygen combination gives their merchants the flexibility to build out personalized shopping for buyers. It’s an experience that storefront developers can make their own, and it’s powered by Cloudflare Workers behind the scenes. For more details, check out Shopify’s “<a href="https://shopify.engineering/how-we-built-oxygen">How we Built Oxygen</a>” blog post.</p><blockquote><p><i>Oxygen is Shopify's built-in hosting platform for Hydrogen storefronts, designed to provide users with a seamless experience in deploying and managing their ecommerce sites. Our integration with Workers for Platforms has been instrumental to our success in providing fast, globally-available, and secure storefronts for our merchants. The flexibility of Cloudflare's platform has allowed us to build delightful merchant experiences that integrate effortlessly with the best that the Shopify ecosystem has to offer.</i><i>-</i> <b>Lance Lafontaine</b>, Senior Developer <a href="https://shopify.dev/docs/custom-storefronts/oxygen">Shopify Oxygen</a></p></blockquote><p>Another customer that we’ve been working very closely with is Grafbase. Grafbase started out on the <a href="https://www.cloudflare.com/forstartups/?ref=blog.cloudflare.com">Cloudflare for Startups</a> program, building their company from the ground up on Workers. Grafbase gives their customers the ability to deploy serverless GraphQL backends instantly. On top of that, their developers can build custom GraphQL resolvers to program their own business logic right at the edge. Using Workers and Workers for Platforms means that Grafbase can focus their team on building Grafbase, rather than having to focus on building and architecting at the infrastructure layer.</p><blockquote><p><i>Our mission at Grafbase is to enable developers to deploy globally fast GraphQL APIs without worrying about complex infrastructure. We provide a unified data layer at the edge that accelerates development by providing a single endpoint for all your data sources. We needed a way to deploy serverless GraphQL gateways for our customers with fast performance globally without cold starts. We experimented with container-based workloads and FaaS solutions, but turned our attention to WebAssembly (Wasm) in order to achieve our performance targets. We chose Rust to build the Grafbase platform for its performance, type system, and its Wasm tooling. Cloudflare Workers was a natural fit for us given our decision to go with Wasm. On top of using Workers to build our platform, we also wanted to give customers the control and flexibility to deploy their own logic. Workers for Platforms gave us the ability to deploy customer code written in JavaScript/TypeScript or Wasm straight to the edge.</i><i>-</i> <b>Fredrik Björk</b>, Founder &amp; CEO at <a href="https://grafbase.com/">Grafbase</a></p></blockquote><p>Over the past year, it’s been incredible seeing the velocity that building on Workers allows companies both big and small to move at.</p>
    <div>
      <h2>New building blocks</h2>
      <a href="#new-building-blocks">
        
      </a>
    </div>
    <p>Workers for Platforms uses <a href="https://developers.cloudflare.com/cloudflare-for-platforms/workers-for-platforms/learning/how-workers-for-platforms-works/#dynamic-dispatch-worker">Dynamic Dispatch</a> to give our customers, like Shopify and Grafbase, the ability to run their own Worker before user code that’s written by Shopify and Grafbase’s developers is executed. With Dynamic Dispatch, Workers for Platforms customers (referred to as platform customers) can authenticate requests, add context to a request or run any custom code before their developer’s Workers (referred to as user Workers) are called.</p><p>This is a key building block for Workers for Platforms, but we’ve also heard requests for even more levels of visibility and control from our platform customers. Delivering on this theme, we’re releasing three new highly requested features:</p>
    <div>
      <h3>Outbound Workers</h3>
      <a href="#outbound-workers">
        
      </a>
    </div>
    <p>Dynamic Dispatch gives platforms visibility into all incoming requests to their user’s Workers, but customers have also asked for visibility into all outgoing requests from their user’s Workers in order to do things like:</p><ul><li><p>Log all subrequests in order to identify malicious hosts or usage patterns</p></li><li><p>Create allow or block lists for hostnames requested by user Workers</p></li><li><p>Configure authentication to your APIs behind the scenes (without end developers needing to set credentials)</p></li></ul><p>Outbound Workers sit between user Workers and fetch() requests out to the Internet. User Workers will trigger a <a href="https://maddy-outbound-workers.cloudflare-docs-7ou.pages.dev/workers/runtime-apis/fetch-event/">FetchEvent</a> on the Outbound Worker and from there platform customers have full visibility over the request before it’s sent out.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/74ISEbqaIX58uc6z88wV0s/28a040fdb9e044b8420dbf7930bf27aa/image1-48.png" />
            
            </figure><p>It’s also important to have context in the Outbound Worker to answer questions like “which user Worker is this request coming from?”. You can declare variables to pass through to the Outbound Worker in the dispatch namespaces binding:</p>
            <pre><code>[[dispatch_namespaces]]
binding = "dispatcher"
namespace = "&lt;NAMESPACE_NAME&gt;"
outbound = {service = "&lt;SERVICE_NAME&gt;", parameters = [customer_name,url]}</code></pre>
            <p>From there, the variables declared in the binding can be accessed in the Outbound Worker through env. <code>&lt;VAR_NAME&gt;</code>.</p>
    <div>
      <h3>Custom Limits</h3>
      <a href="#custom-limits">
        
      </a>
    </div>
    <p>Workers are really powerful, but, as a platform, you may want guardrails around their capabilities to shape your pricing and packaging model. For example, if you run a freemium model on your platform, you may want to set a lower CPU time limit for customers on your free tier.</p><p>Custom Limits let you set usage caps for CPU time and number of subrequests on your customer’s Workers. Custom limits are set from within your dynamic dispatch Worker allowing them to be dynamically scripted. They can also be combined to set limits based on <a href="https://developers.cloudflare.com/cloudflare-for-platforms/workers-for-platforms/platform/tags/">script tags</a>.</p><p>Here’s an example of a Dynamic Dispatch Worker that puts both Outbound Workers and Custom Limits together:</p>
            <pre><code>export default {
async fetch(request, env) {
  try {
    let workerName = new URL(request.url).host.split('.')[0];
    let userWorker = env.dispatcher.get(
      workerName,
      {},
      {// outbound arguments
       outbound: {
           customer_name: workerName,
           url: request.url},
        // set limits
       limits: {cpuMs: 10, subRequests: 5}
      }
    );
    return await userWorker.fetch(request);
  } catch (e) {
    if (e.message.startsWith('Worker not found')) {
      return new Response('', { status: 404 });
    }
    return new Response(e.message, { status: 500 });
  }
}
};</code></pre>
            <p>They’re both incredibly simple to configure, and the best part – the configuration is completely programmatic. You have the flexibility to build on both of these features with your own custom logic!</p>
    <div>
      <h3>Tail Workers</h3>
      <a href="#tail-workers">
        
      </a>
    </div>
    <p>Live logging is an essential piece of the developer experience. It allows developers to monitor for errors and troubleshoot in real time. On Workers, giving users real time logs though <code>wrangler tail</code> is a feature that developers love! Now with Tail Workers, platform customers can give their users the same level of visibility to provide a faster debugging experience.</p><p>Tail Worker logs contain metadata about the original trigger event (like the incoming URL and status code for fetches), console.log() messages and capture any unhandled exceptions. Tail Workers can be added to the Dynamic Dispatch Worker in order to capture logs from both the Dynamic Dispatch Worker and any User Workers that are called.</p><p>A Tail Worker can be configured by adding the following to the <code>wrangler.toml</code> file of the producing script</p>
            <pre><code>tail_consumers = [{service = "&lt;TAIL_WORKER_NAME&gt;", environment = "&lt;ENVIRONMENT_NAME&gt;"}]</code></pre>
            <p>From there, events are captured in the Tail Worker using a new tail handler:</p>
            <pre><code>export default {
  async tail(events) =&gt; {
    fetch("https://example.com/endpoint", {
      method: "POST",
      body: JSON.stringify(events),
    })
  }
}</code></pre>
            <p>Tail Workers are full-fledged Workers empowered by the usual Worker ecosystem. You can send events to any HTTP endpoint, like for example a logging service that parses the events and passes on real-time logs to customers.</p>
    <div>
      <h2>Try it out!</h2>
      <a href="#try-it-out">
        
      </a>
    </div>
    <p>All three of these features are now in open beta for users with access to Workers for Platforms. For more details and try them out for yourself, check out our developer documentation:</p><ul><li><p><a href="https://developers.cloudflare.com/cloudflare-for-platforms/workers-for-platforms/platform/outbound-workers/">Outbound Workers</a></p></li><li><p><a href="https://developers.cloudflare.com/cloudflare-for-platforms/workers-for-platforms/platform/custom-limits/">Custom Limits</a></p></li><li><p><a href="https://developers.cloudflare.com/workers/platform/tail-workers">Tail Workers</a></p></li></ul><p>Workers for Platforms is an enterprise only product (for now) but we’ve heard a lot of interest from developers. In the later half of the year, we’ll be bringing Workers for Platforms down to our pay as you go plan! In the meantime, if you’re itching to get started, reach out to us through the <a href="https://discord.cloudflare.com/">Cloudflare Developer Discord</a> (channel name: workers-for-platforms).</p>
    <div>
      <h3>Watch on Cloudflare TV</h3>
      <a href="#watch-on-cloudflare-tv">
        
      </a>
    </div>
    <div></div> ]]></content:encoded>
            <category><![CDATA[Developer Week]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[Serverless]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <guid isPermaLink="false">6KYE0S5UOjVcVum73JwOp0</guid>
            <dc:creator>Nathan Disidore</dc:creator>
            <dc:creator>Tanushree Sharma</dc:creator>
        </item>
        <item>
            <title><![CDATA[Announcing database integrations: a few clicks to connect to Neon, PlanetScale and Supabase on Workers]]></title>
            <link>https://blog.cloudflare.com/announcing-database-integrations/</link>
            <pubDate>Tue, 16 May 2023 13:05:00 GMT</pubDate>
            <description><![CDATA[ Today we’re announcing Database Integrations  – making it seamless to connect to your database of choice on Workers.  ]]></description>
            <content:encoded><![CDATA[ <p></p><p><i>This blog post references a feature which has updated documentation. For the latest reference content, visit </i><a href="https://developers.cloudflare.com/workers/databases/third-party-integrations/"><i>https://developers.cloudflare.com/workers/databases/third-party-integrations/</i></a></p><p>One of the best feelings as a developer is seeing your idea come to life. You want to move fast and Cloudflare’s developer platform gives you the tools to take your applications from 0 to 100 within minutes.</p><p>One thing that we’ve heard slows developers down is the question: <i>“What databases can be used with Workers?”</i>. Developers stumble when it comes to things like finding the databases that Workers can connect to, the right library or driver that's compatible with Workers and translating boilerplate examples to something that can run on our developer platform.</p><p>Today we’re announcing Database Integrations  – making it seamless to connect to your database of choice on Workers. To start, we’ve added some of the most popular databases that support HTTP connections: <a href="https://neon.tech/">Neon</a>, <a href="https://planetscale.com/">PlanetScale</a> and <a href="https://supabase.com/">Supabase</a> with more (like Prisma, Fauna, MongoDB Atlas) to come!</p>
    <div>
      <h2>Focus more on code, less on config</h2>
      <a href="#focus-more-on-code-less-on-config">
        
      </a>
    </div>
    <p>Our <a href="https://www.cloudflare.com/developer-platform/products/d1/">serverless SQL database</a>, D1, launched in open alpha last year, and we’re continuing to invest in making it production ready (stay tuned for an exciting update later this week!). We also recognize that there are plenty of flavours of databases, and we want developers to have the freedom to select what’s best for them and pair it with our powerful compute offering.</p><p>On our second day of this Developer Week 2023, data is in the spotlight. We’re taking huge strides in making it possible and more performant to connect to databases from Workers (spoiler alert!):</p><ul><li><p><a href="/workers-tcp-socket-api-connect-databases">Announcing connect() — a new API for creating TCP sockets from Cloudflare Workers</a></p></li><li><p><a href="/announcing-database-integrations">Smart Placement speeds up applications by moving code close to your backend — no config needed</a></p></li></ul><p>Making it possible and performant is just the start, we also want to make connecting to databases painless. Databases have specific protocols, drivers, APIs and vendor specific features that you need to understand in order to get up and running. With Database Integrations, we want to make this process foolproof.</p><p>Whether you’re working on your first project or your hundredth project, you should be able to connect to your database of choice with your eyes closed. With Database Integrations, you can spend less time focusing on configuration and more on doing what you love – building your applications!</p>
    <div>
      <h2>What does this experience look like?</h2>
      <a href="#what-does-this-experience-look-like">
        
      </a>
    </div>
    
    <div>
      <h3>Discoverability</h3>
      <a href="#discoverability">
        
      </a>
    </div>
    <p>If you’re starting a project from scratch or want to connect Workers to an existing database, you want to know <i>“What are my options?”</i>.</p><p>Workers supports connections to a wide array of database providers over HTTP.  With newly released <a href="/workers-tcp-socket-api-connect-databases">outbound TCP support</a>, the databases that you can connect to on Workers will only grow!</p><p>In the new “Integrations” tab, you’ll be able to view all the databases that we support and add the integration to your Worker directly from here. To start, we have support for Neon, PlanetScale and Supabase with many more coming soon.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/72AInQBXAsWNkEcBr3DPeo/3c546a2d7e2cfdf403ffac91154f172a/image2-10.png" />
            
            </figure>
    <div>
      <h3>Authentication</h3>
      <a href="#authentication">
        
      </a>
    </div>
    <p>You should never have to copy and paste your database credentials or other parts of the connection string.</p><p>Once you hit “Add Integration” we take you through an OAuth2 flow that automatically gets the right configuration from your database provider and adds them as encrypted environment variables to your Worker.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4DKr9USRBKD90foCkyPkLM/b9bedf4c535ed33c1b42bdc176f066c3/integration-flow.png" />
            
            </figure><p>Once you have credentials set up, check out our <a href="https://developers.cloudflare.com/workers/learning/integrations/databases/#native-database-integrations-beta">documentation</a> for examples on how to get started using the data platform’s client library. What’s more – we have templates coming that will allow you to get started even faster!</p><p>That’s it! With database integrations, you can connect your Worker with your database in just a few clicks. Head to your Worker &gt; Settings &gt; Integrations to try it out today.</p>
    <div>
      <h2>What’s next?</h2>
      <a href="#whats-next">
        
      </a>
    </div>
    <p>We’ve only just scratched the surface with Database Integrations and there’s a ton more coming soon!</p><p>While we’ll be continuing to add support for more popular data platforms we also know that it's impossible for us to keep up in a moving landscape. We’ve been working on an integrations platform so that any database provider can easily build their own integration with Workers. As a developer, this means that you can start tinkering with the next new database right away on Workers.</p><p>Additionally, we’re working on adding wrangler support, so you can create integrations directly from the CLI. We’ll also be adding support for account level environment variables in order for you to share integrations across the Workers in your account.</p><p>We’re really excited about the potential here and to see all the new creations from our developers! Be sure to join <a href="https://discord.gg/cloudflaredev">Cloudflare’s Developer Discord</a> and share your projects. Happy building!</p> ]]></content:encoded>
            <category><![CDATA[Developer Week]]></category>
            <category><![CDATA[Latin America]]></category>
            <category><![CDATA[SASE]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <category><![CDATA[Serverless]]></category>
            <category><![CDATA[Database]]></category>
            <category><![CDATA[Internet Performance]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <category><![CDATA[Connectivity Cloud]]></category>
            <guid isPermaLink="false">bAEI0IEwgtOSNAWKw64Zl</guid>
            <dc:creator>Shaun Persad</dc:creator>
            <dc:creator>Emily Chen</dc:creator>
            <dc:creator>Tanushree Sharma</dc:creator>
        </item>
        <item>
            <title><![CDATA[Smart Placement speeds up applications by moving code close to your backend — no config needed]]></title>
            <link>https://blog.cloudflare.com/announcing-workers-smart-placement/</link>
            <pubDate>Tue, 16 May 2023 13:00:46 GMT</pubDate>
            <description><![CDATA[ Smart Placement automatically places your workloads in an optimal location that minimizes latency and speeds up your applications! ]]></description>
            <content:encoded><![CDATA[ 
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/68NfZl5AwLPrk573wmR7Id/e605ccc58d1612b69beef233229ae79f/image2-14.png" />
            
            </figure><p>We’ve all experienced the frustrations of slow loading websites, or an app that seems to stall when it needs to call an API for an update. Anything less than instant and your mind wanders to something else...</p><p>One way to make things fast is to bring resources as close to the user as possible — this is what Cloudflare has been doing with compute by running within milliseconds of most of the world’s population. But, counterintuitive as it may seem, sometimes bringing compute closer to the user can actually slow applications down. If your application needs to connect to APIs, databases or other resources that aren’t located near the end user then it can be more performant to run the application near the resources instead of the user.</p><p>So today we’re excited to announce Smart Placement for Workers and Pages Functions, making every interaction as fast as possible. With Smart Placement, Cloudflare is taking serverless computing to the Supercloud by moving compute resources to optimal locations in order to speed up applications. The best part – it’s completely automatic, without any extra input (like the dreaded “region”) needed.</p><p>Smart Placement is available now, in open beta, to all Workers and Pages customers!</p><p><a href="https://smart-placement-demo.pages.dev/">Check out our demo on how Smart Placement works!</a></p><p></p>
    <div>
      <h2>The serverless shift</h2>
      <a href="#the-serverless-shift">
        
      </a>
    </div>
    <p>Cloudflare’s anycast network is built to process requests <i>instantly and close to the user</i>. As a developer, that’s what makes Cloudflare Workers, our serverless compute offering so compelling. Competitors are bounded by “regions” while Workers run everywhere — hence we have one region: Earth. Requests handled entirely by Workers can be processed right then and there, without ever having to hit an origin server.</p><p>While this concept of serverless was originally considered to be for lightweight tasks, serverless computing has been seeing a shift in recent years. It’s being used to replace traditional architecture, which relies on origin servers and self-managed infrastructure, instead of simply augmenting it. We’re seeing more and more of these use cases with Workers and Pages users.</p>
    <div>
      <h3>Serverless needs state</h3>
      <a href="#serverless-needs-state">
        
      </a>
    </div>
    <p>With the shift to going serverless and building entire applications on Workers comes a need for data. Storing information about previous actions or events lets you build personalized, interactive applications. Say you need to create user profiles, store which page a user left off at, which SKUs a user has in their cart – all of these are mapped to data points used to maintain state. Backend services like relational databases, key-value stores, blob storage, and APIs all let you build stateful applications.</p>
    <div>
      <h3>Cloudflare compute + storage: a powerful duo</h3>
      <a href="#cloudflare-compute-storage-a-powerful-duo">
        
      </a>
    </div>
    <p>We have our own growing suite of storage offerings: Workers KV, Durable Objects, D1, <a href="https://www.cloudflare.com/developer-platform/r2/">R2</a>. As we’re maturing our data products, we think deeply about their interactions with Workers so that you don’t have to! For example, another approach that has better performance in some cases is moving storage, rather than compute close to users. If you’re using Durable Objects to create a real-time game we could move the Durable Objects to minimize latency for all users.</p><p>Our goal for the future state is that you set mode = "smart"and we evaluate the optimal placement of all your resources with no additional configuration needed.</p>
    <div>
      <h3>Cloudflare compute + ${backendService}</h3>
      <a href="#cloudflare-compute-backendservice">
        
      </a>
    </div>
    <p>Today, the primary use case for Smart Placement is when you’re using non-Cloudflare services like external databases or third party APIs for your applications.</p><p>Many backend services, whether they’re self-hosted or managed services, are centralized, meaning that data is stored and managed in a single location. Your users are global and Workers are global, but your backend is centralized.</p><p>If your code makes multiple requests to your backend services they could be crossing the globe multiple times, having a big hit on performance. Some services offer data replication and caching which help to improve performance, but also come with trade-offs like data consistency and higher costs that should be weighed against your use case.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6Xh0tIBnMeZp7z1mDeonqd/2d55124ff2c831d964eb36a98852a968/map.png" />
            
            </figure><p>The Cloudflare network is <a href="https://www.cloudflare.com/network/">~50ms from 95% of the world’s connected population</a>. Turning this on its head, we're also very close to your backend services.</p>
    <div>
      <h2>Application performance is user experience</h2>
      <a href="#application-performance-is-user-experience">
        
      </a>
    </div>
    <p>Let’s understand how moving compute close to your backend services could decrease application latency by walking through an example:</p><p>Say you have a user in Sydney, Australia who’s accessing an application running on Workers. This application makes three round trips to a database located in Frankfurt, Germany in order to serve the user’s request.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4EGjgjjCqADFBQGq5OXVFC/cfd95273a6e9a7afbe09ab27e3c90104/download--1--6.png" />
            
            </figure><p>Intuitively, you can guess that the bottleneck is going to be the time that it takes the Worker to perform multiple round trips to your database. Instead of the Worker being invoked close to the user, what if it was invoked in a data center closest to the database instead?</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4D4IOJIAlHuGYce5DqjGky/09d291252b813c1981cac9ef19cb1fd7/wAAAABJRU5ErkJggg__" />
            
            </figure><p>Let’s put this to the test.</p><p>We measured the request duration for a Worker without Smart Placement and compared it to one with Smart Placement enabled. For both tests, we sent 3,500 requests from Sydney to a Worker which does three round trips to an <a href="https://upstash.com/">Upstash</a> instance (free-tier) located in eu-central-1 (Frankfurt).</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/54nvh0FI2RcDh1gQ9ea4Tq/6a0ca6a7ea678cd965c79b25d7b90874/image3-7.png" />
            
            </figure><p>The results are clear! In this example, moving the Worker close to the backend <b>improved</b> <b>application performance by 4-8x</b>.</p>
    <div>
      <h2>Network decisions shouldn’t be human decisions</h2>
      <a href="#network-decisions-shouldnt-be-human-decisions">
        
      </a>
    </div>
    <p>As a developer, you should focus on what you do best – building applications – without needing to worry about the network decisions that will make your application faster.</p><p>Cloudflare has a unique vantage point: our network gathers intelligence around the optimal paths between users, Cloudflare data centers and back-end servers – we have lots of experience in this area with <a href="/argo/">Argo Smart Routing</a>. Smart Placement takes these factors into consideration to automatically place your Worker in the best spot to minimize overall request duration.</p><p>So, how does Smart Placement work?</p><p>Smart Placement can be enabled on a per-Worker basis under the “Settings” tab or in your wrangler.toml file:</p>
            <pre><code>[placement]
mode = "smart"</code></pre>
            <p>Once you enable Smart Placement on your Worker or Pages Function, the Smart Placement algorithm analyzes fetch requests (also known as subrequests) that your Worker is making in real time. It then compares these to latency data aggregated by our network. If we detect that on average your Worker makes more than one subrequest to a back-end resource, then your Worker will automatically get invoked from the optimal data center!</p><p>There are some back-end services that, for good reason, are not considered by the Smart Placement algorithm:</p><ul><li><p>Globally distributed services: If the services that your Worker communicates with are geo-distributed in many regions, Smart Placement isn’t a good fit. We automatically rule these out of the Smart Placement optimization.</p></li><li><p>Analytics or logging services: Requests to analytics or logging services don’t need to be in the critical path of your application. <a href="https://developers.cloudflare.com/workers/runtime-apis/fetch-event/?ref=blog.cloudflare.com#waituntil"><code>waitUntil()</code></a> should be used so that the response back to users isn’t blocked when instrumenting your code. Since <code>waitUntil()</code> doesn’t impact the request duration from a user’s perspective, we automatically rule analytics/logging services out of the Smart Placement optimization.</p></li></ul><p>Refer to our <a href="https://developers.cloudflare.com/workers/platform/smart-placement/#supported-backends">documentation</a> for a list of services not considered by the Smart Placement algorithm.</p><p>Once Smart Placement kicks in, you’ll be able to see a new “Request Duration” tab on your Worker. We route 1% of requests without Smart Placement enabled so that you can see its impact on request duration.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2IicbhnuU143f8T6EJc9s4/2f24b79cc4b019123b1e7ed2df4cd02a/download-9.png" />
            
            </figure><p>And yes, it is really that easy!</p><p>Try out Smart Placement by checking out our <a href="https://smart-placement-demo.pages.dev/">demo</a> (it’s a lot of fun to play with!). To learn more, visit our <a href="https://developers.cloudflare.com/workers/platform/smart-placement/">developer documentation</a>.</p>
    <div>
      <h2>What’s next for Smart Placement?</h2>
      <a href="#whats-next-for-smart-placement">
        
      </a>
    </div>
    <p>We’re only getting started! We have lots of ideas on how we can improve Smart Placement:</p><ul><li><p>Support for calculating the optimal location when the application uses multiple back-ends</p></li><li><p>Fine-tuned placement (e.g. if your Worker uses multiple back-ends depending on the path. We calculate the optimal placement per path instead of per-Worker)</p></li><li><p>Support for TCP based connections</p></li></ul><p>We would like to hear from you! If you have feedback or feature requests, reach out through the <a href="https://discord.com/invite/cloudflaredev">Cloudflare Developer Discord</a>.</p>
    <div>
      <h3>Watch on Cloudflare TV</h3>
      <a href="#watch-on-cloudflare-tv">
        
      </a>
    </div>
    <div></div> ]]></content:encoded>
            <category><![CDATA[Developer Week]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <category><![CDATA[Serverless]]></category>
            <category><![CDATA[Database]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <guid isPermaLink="false">7AkCd01DEJfXbjEGoK8Uzq</guid>
            <dc:creator>Michael Hart</dc:creator>
            <dc:creator>Serena Shah-Simpson</dc:creator>
            <dc:creator>Tanushree Sharma</dc:creator>
        </item>
        <item>
            <title><![CDATA[Mutual TLS now available for Workers]]></title>
            <link>https://blog.cloudflare.com/mtls-workers/</link>
            <pubDate>Mon, 13 Mar 2023 13:00:00 GMT</pubDate>
            <description><![CDATA[ Mutual TLS is used to secure a range of network services and applications: APIs, web applications, microservices, databases and IoT devices. With mTLS support for Workers you can use Workers to authenticate to any service secured by mTLS directly! ]]></description>
            <content:encoded><![CDATA[ <p></p><p>In today’s digital world, security is a top priority for businesses. Whether you’re a Fortune 500 company or a startup just taking off, it’s essential to implement security measures in order to protect sensitive information. Security starts inside an organization; it starts with having <a href="https://www.cloudflare.com/learning/security/glossary/what-is-zero-trust/">Zero Trust principles</a> that protect access to resources.</p><p>Mutual TLS (mTLS) is useful in a Zero Trust world to secure a wide range of network services and applications: APIs, web applications, microservices, databases and IoT devices. Cloudflare has products that enforce mTLS: <a href="https://www.cloudflare.com/products/api-gateway/">API Shield</a> uses it to secure API endpoints and <a href="https://www.cloudflare.com/products/zero-trust/access/">Cloudflare Access</a> uses it to secure applications. Now, with mTLS support for Workers you can use Workers to authenticate to services secured by mTLS directly. mTLS for Workers is now generally available for all Workers customers!</p>
    <div>
      <h3>A recap on how TLS works</h3>
      <a href="#a-recap-on-how-tls-works">
        
      </a>
    </div>
    <p>Before diving into mTLS, let’s first understand what TLS (Transport Layer Security) is. Any website that uses HTTPS, like the one you’re reading this blog on, uses TLS encryption. TLS is used to create private communications on the Internet – it gives users assurance that the website you’re connecting to is legitimate and any information passed to it is encrypted.</p><p>TLS is enforced through a TLS handshake where the client and server exchange messages in order to create a secure connection. The handshake consists of several steps outlined below:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7KkcVehx0zunn4wVQmFsat/525b79d21264f64000f5a88086dd1edf/pasted-image-0-4.png" />
            
            </figure><p>The client and server exchange cryptographic keys, the client authenticates the server's identity and the client and server generate a secret key that’s used to create an encrypted connection.</p><p>For most connections over the public Internet TLS is sufficient. If you have a website, for example a landing page, storefront or documentation, you want any user to be able to navigate to it – validating the identity of the client isn’t necessary. But, if you have services that run on a corporate network or private/sensitive applications you may want access to be locked down to only authorized clients.</p>
    <div>
      <h3>Enter mTLS</h3>
      <a href="#enter-mtls">
        
      </a>
    </div>
    <p>With mTLS, both the client and server present a digital certificate during the TLS handshake to mutually verify each other’s credentials and prove identities. mTLS adds additional steps to the TLS handshake in order to authenticate the client as well as the server.</p><p>In comparison to TLS, with mTLS the server also sends a ‘Certificate Request’ message that contains a list of parties that it trusts and it tells the client to respond with its certificate. The mTLS authentication process is outlined below:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7eacWWZ0IBh5Cwa76YTvKt/f48f8880ca74436227e98d87f28ab9b7/pasted-image-0--1--1.png" />
            
            </figure><p>mTLS is typically used when a managed list of clients (eg. users, devices) need access to a server. It uses cryptographically signed certificates for authentication, which are harder to spoof than passwords or tokens. Some common use cases include: communications between APIs or microservices, database connections from authorized hosts, and machine-to-machine IoT connections.</p>
    <div>
      <h3>Introducing mTLS on Workers</h3>
      <a href="#introducing-mtls-on-workers">
        
      </a>
    </div>
    <p>With mTLS support on Workers, your Workers can now communicate with resources that enforce an mTLS connection. mTLS through Workers can be configured in just a few easy steps:</p><p>1. Upload a client certificate and private key obtained from your service that enforces mTLS using wrangler</p>
            <pre><code>wrangler mtls-certificate upload --cert cert.pem --key key.pem --name my-client-cert</code></pre>
            <p>2. Add a mtls_certificates binding in your project’s wrangler.toml file. The CERTIFICATE_ID is returned after your certificate is uploaded in step 1</p>
            <pre><code>mtls_certificates = [
 { binding = "MY_CERT", certificate_id = "&lt;CERTIFICATE_ID&gt;" }
]</code></pre>
            <p>3. Add the mTLS binding to any fetch() requests. This will present the client certificate when establishing the TLS connection.</p>
            <pre><code>index.js

export default {
   async fetch(request, environment) {
       return await environment.MY_CERT.fetch("https://example-secure-origin.com")
   }

}</code></pre>
            <p>To get per-request granularity, you can configure multiple mTLS certificates if you’re connecting to multiple hosts within the same Worker. There’s a limit of 1,000 certificates that can be uploaded per account. Contact your account team or reach out through the <a href="https://discord.gg/cloudflaredev">Cloudflare Developer Discord</a> if you need more certificates.</p>
    <div>
      <h3>Try it yourself</h3>
      <a href="#try-it-yourself">
        
      </a>
    </div>
    <p>It’s that easy! For more information and to try it yourself, refer to our developer documentation – <a href="https://developers.cloudflare.com/workers/runtime-apis/mtls/">client authentication with mTLS</a>.</p><p>We love to see what you’re developing on Workers. Join our <a href="https://discord.gg/cloudflaredev">Discord community</a> and show us what you’re building!</p> ]]></content:encoded>
            <category><![CDATA[Security Week]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <category><![CDATA[TLS]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <guid isPermaLink="false">6H38WT9SkzKXQsQRivBXFz</guid>
            <dc:creator>Tanushree Sharma</dc:creator>
            <dc:creator>Dina Kozlov</dc:creator>
        </item>
        <item>
            <title><![CDATA[Send Cloudflare Workers logs to a destination of your choice with Workers Trace Events Logpush]]></title>
            <link>https://blog.cloudflare.com/workers-logpush-ga/</link>
            <pubDate>Fri, 18 Nov 2022 14:02:00 GMT</pubDate>
            <description><![CDATA[ Workers Trace Events Logpush gives new levels of visibility into Workers invocations, console.log messages and errors. It is now available to everyone on the Workers Paid and Enterprise plans! ]]></description>
            <content:encoded><![CDATA[ <p><i></i></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3VEcX6imb8GNqH9SUD8R6k/addd0bbaf70fd0be029477e06d6ac53c/image1-67.png" />
            
            </figure><p>When writing code, you can only move as fast as you can debug.</p><p>Our goal at Cloudflare is to give our developers the tools to deploy applications faster than ever before. This means giving you tools to do everything from initializing your Workers project to having visibility into your application successfully serving production traffic.</p><p>Last year we introduced <a href="/introducing-workers-dashboard-logs/"><code>wrangler tail</code></a>, letting you access a live stream of Workers logs to help pinpoint errors to debug your applications. Workers Trace Events Logpush (or just Workers Logpush for short) extends this functionality – you can use it to send Workers logs to an <a href="https://www.cloudflare.com/learning/cloud/what-is-object-storage/">object storage</a> destination or analytics platform of your choice.</p><p>Workers Logpush is now available to everyone on the Workers Paid plan! Read on to learn how to get started and about pricing information.</p>
    <div>
      <h3>Move fast and <i>don’t</i> break things</h3>
      <a href="#move-fast-and-dont-break-things">
        
      </a>
    </div>
    <p>With the rise of platforms like Cloudflare Workers over containers and VMs, it now takes just minutes to deploy applications. But, when building an application, any tech stack that you choose comes with its own set of trade-offs.</p><p>As a developer, choosing Workers means you don't need to worry about any of the underlying architecture. You just write code, and it works (hopefully!). A common criticism of this style of platform is that <a href="https://www.cloudflare.com/learning/performance/what-is-observability/">observability</a> becomes more difficult.</p><p>We want to change that.</p><p>Over the years, we’ve made improvements to the testing and debugging tools that we offer — <a href="https://developers.cloudflare.com/workers/learning/debugging-workers/#local-testing-with-wrangler-dev"><code>wrangler dev</code></a>, <a href="https://miniflare.dev/"><code>Miniflare</code></a> and most recently our open sourced runtime <a href="/workerd-open-source-workers-runtime/"><code>workerd</code></a>. These improvements have made debugging locally and running unit tests much easier. However, there will always be edge cases or bugs that are only replicated in production environments.</p>
    <div>
      <h3>If something does break…enter Workers Logpush</h3>
      <a href="#if-something-does-break-enter-workers-logpush">
        
      </a>
    </div>
    <p>Wrangler tail lets you view logs in real time, but we’ve heard from developers that you would also like to set up monitoring for your services and have a historical record to look back on. Workers Logpush includes metadata about requests, <code>console.log()</code> messages and any uncaught exceptions. To give you an idea of what it looks like, below is a sample log line:</p>
            <pre><code>{
   "AccountID":12345678,
   "Event":{
      "RayID":"7605d2b69f961000",
      "Request":{
         "URL":"https://example.com",
         "Method":"GET"
      },
      "Response":{
         "status":200
      },
      "EventTimestampMs":1666814897697,
      "EventType":"fetch",
      "Exceptions":[
      ],
      "Logs":[
         {
            "Level":"log",
            "Message":[
               "please work!"
            ],
            "TimestampMs":1666814897697
         }
      ],
      "Outcome":"ok",
      "ScriptName":"example-script"
   }</code></pre>
            <p><a href="https://developers.cloudflare.com/logs/">Logpush</a> has support for the most popular observability tools. Send logs to Datadog, New Relic or even <a href="https://www.cloudflare.com/developer-platform/products/r2/">R2</a> for storage and <a href="https://developers.cloudflare.com/logs/r2-log-retrieval/">ad hoc querying</a>.</p>
    <div>
      <h3>Pricing</h3>
      <a href="#pricing">
        
      </a>
    </div>
    <p>Workers Logpush is available to both customers on our Workers Paid and Enterprise plans. We wanted this to be very affordable for our developers. Workers Logpush is priced at $0.05 per million requests, and we only charge you for requests that result in logs delivered to an end destination after any filtering or sampling is applied. It also has an included usage of 10M requests each month.</p>
    <div>
      <h3>Configuration</h3>
      <a href="#configuration">
        
      </a>
    </div>
    <p>Logpush is incredibly simple to set up.</p><p>1. Create a Logpush job. The following example sends Workers logs to R2.</p>
            <pre><code>curl -X POST 'https://api.cloudflare.com/client/v4/accounts/&lt;ACCOUNT_ID&gt;/logpush/jobs' \
-H 'X-Auth-Key: &lt;API_KEY&gt;' \
-H 'X-Auth-Email: &lt;EMAIL&gt;' \
-H 'Content-Type: application/json' \
-d '{
"name": "workers-logpush",
"logpull_options": "fields=Event,EventTimestampMs,Outcome,Exceptions,Logs,ScriptName",
"destination_conf": "r2://&lt;BUCKET_PATH&gt;/{DATE}?account-id=&lt;ACCOUNT_ID&gt;&amp;access-key-id=&lt;R2_ACCESS_KEY_ID&gt;&amp;secret-access-key=&lt;R2_SECRET_ACCESS_KEY&gt;",
"dataset": "workers_trace_events",
"enabled": true
}'| jq .</code></pre>
            <p>In Logpush, you can also configure <a href="https://developers.cloudflare.com/logs/reference/filters/">filters</a> and a <a href="https://developers.cloudflare.com/logs/get-started/api-configuration/#sampling-rate">sampling rate</a> to have more control of the volume of data that is sent to your configured destination. For example if you only want to receive logs for resulted in an exception, you could add the following under <code>logpull_options</code>:</p>
            <pre><code>"filter":"{\"where\": {\"key\":\"Outcome\",\"operator\":\"eq\",\"value\":\"exception\"}}"</code></pre>
            <p>2. Enable logging on your Workers script</p><p>You can do this by adding a new property, <code>logpush = true</code>, to your <code>wrangler.toml</code> file. This can be added either in the top level configuration or under an environment. Any new scripts with this property will automatically get picked up by the Logpush job.</p>
    <div>
      <h3>Get started today!</h3>
      <a href="#get-started-today">
        
      </a>
    </div>
    <p>Both customers on our Workers Paid Plan and Enterprise plan can get started with Workers Logpush now! The full guide on how to get started is <a href="https://developers.cloudflare.com/workers/platform/logpush/">here</a>.</p> ]]></content:encoded>
            <category><![CDATA[Developer Week]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Logs]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <guid isPermaLink="false">46Q2u0uEAjXfaGwka0ZUnC</guid>
            <dc:creator>Tanushree Sharma</dc:creator>
        </item>
        <item>
            <title><![CDATA[Automate an isolated browser instance with just a few lines of code]]></title>
            <link>https://blog.cloudflare.com/introducing-workers-browser-rendering-api/</link>
            <pubDate>Wed, 16 Nov 2022 14:00:00 GMT</pubDate>
            <description><![CDATA[ Workers Browser Rendering API is our out-of-the-box solution for simplifying developer workflows, including capturing images or screenshots, by running browser automation in Workers. If you’re interested, sign up for the waitlist. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>If you’ve ever created a website that shows any kind of analytics, you’ve probably also thought about adding a “Save Image” or “Save as PDF” button to store and share results. This isn’t as easy as it seems (I can attest to this firsthand) and it’s not long before you go down a rabbit hole of trying 10 different libraries, hoping one will work.</p><p>This is why we’re excited to announce a private beta of the Workers Browser Rendering API, improving the browser automation experience for developers. With browser automation, you can programmatically do anything that a user can do when interacting with a browser.</p><p>The Workers Browser Rendering API, or just Rendering API for short, is our out-of-the-box solution for simplifying developer workflows, including capturing images or screenshots, by running browser automation in Workers.</p>
    <div>
      <h3>Browser automation, everywhere</h3>
      <a href="#browser-automation-everywhere">
        
      </a>
    </div>
    <p>As with many of the best Cloudflare products, Rendering API was born out of an internal need. Many of our teams were setting up or wanted to set up their own tools to perform what sounds like an incredibly simple task: taking automated screenshots.</p><p>When gathering use cases, we realized that much of what our internal teams wanted would also be useful for our customers. Some notable ones are:</p><ul><li><p>Taking screenshots for social sharing thumbnails or preview images</p></li><li><p>Emailed daily screenshots of dashboards (requested specifically by our SVP of Engineering)</p></li><li><p>Reporting bugs on websites and sending them directly to frontend teams</p></li></ul><p>Not to mention use cases for other browser automation functions like:</p><p><b>Testing UI/UX Flows</b>End-to-end (E2E) testing is used to minimic user behaviour and can identify bugs that unit tests or integration tests have missed. And let’s be honest – no developer wants to manually check the user flow each time they make changes to their application. E2E tests can be especially useful to verify logic on your customer’s critical path like account creation, authentication or checkout.</p><p><b>Performance Tests</b>Application performance metrics, such as page load time, directly impact your user’s experience and your SEO rankings. To avoid performance regressions, you want to test impact on latency in conditions that are as close as possible to your production environment before you merge. By automating performance testing you can measure if your proposed changes will result in a degraded experience for your uses and make improvements accordingly.  </p>
    <div>
      <h3>Unlocking a new building block</h3>
      <a href="#unlocking-a-new-building-block">
        
      </a>
    </div>
    <p>One of the most common browser automation frameworks is <a href="https://github.com/puppeteer/puppeteer">Puppeteer</a>. It’s common to run Puppeteer in a containerization tool like Docker or in a serverless environment. Taking automated screenshots should be as easy as writing some code, hitting deploy and having it run when a particular event is triggered or on a regular schedule.</p><p>It should be, but it's not.</p><p>Even on a serverless solution like AWS Lambda, running Puppeteer means packaging it, making sure dependencies are covered, uploading packages to S3 and deploying using Layers. Whether using Docker or something like Lambda, it’s clear that this is not easy to set up.</p><p>One of the pillars of Cloudflare’s development platform is to provide our developers with tools that are incredibly simple, yet powerful to build on. Rendering API is our out-of-the-box solution for running Puppeteer in Workers.</p>
    <div>
      <h3>Screenshotting made simple</h3>
      <a href="#screenshotting-made-simple">
        
      </a>
    </div>
    <p>To start, the Rendering API will have support for navigating to a webpage and taking a screenshot, with more functions to follow. To use it, all you need to do is add our new browser binding to your project’s <code>wrangler.toml</code> file</p><p>wrangler.toml</p>
            <pre><code>bindings = [
 { name = "my_browser” type = "browser" }
]</code></pre>
            <p>From there, taking a screenshot and saving it to R2 is as simple as:</p><p>script.ts</p>
            <pre><code>import puppeteer from '@cloudflare/puppeteer'

export default {
    async fetch(request: Request, env: Env): Promise&lt;Response&gt; {
        const browser = await puppeteer.launch({
            browserBinding: env.MY_BROWSER
        })
        const page = await browser.newPage()

        await page.goto("https://example.com/")
        const img = await page.screenshot() as Buffer
        await browser.close()

        //upload to R2
        try {
            await env.MY_BUCKET.put("screenshot.jpg", img);
            return new Response(`Success!`);
        } catch (e) {
            return new Response('', { status: 400 })
        }
    }
}</code></pre>
            <p>Down the line, we have plans to add full Puppeteer support, including functions like <code>page.type</code>, <code>page.click</code>, <code>page.evaluate</code>!</p>
    <div>
      <h3>What’s happening under the hood?</h3>
      <a href="#whats-happening-under-the-hood">
        
      </a>
    </div>
    <p><a href="https://www.cloudflare.com/learning/access-management/what-is-browser-isolation/">Remote browser isolation technology</a> is an integral part of our <a href="https://www.cloudflare.com/products/zero-trust/">Zero Trust</a> product offering. Remote browser isolation lets users interact with a web browser that instead of running on the client’s device, runs in a remote environment. The Rendering API repurposes this under the hood!</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2vVRXYPzKbQekTnLyMRyW6/4df732b07e3b883341b40bc81826d1b2/image2-32.png" />
            
            </figure><p>We’ve wrapped the Puppeteer library so that it can be run directly from your own Worker. You can think of your Worker as the client. Each of Cloudflare’s data centers has a pool of warm browsers ready to go and when a Worker requests a browser, the browser is instantly returned and is connected to via a WebSocket. Once the WebSocket connection is established, our internal browser API Worker handles all communication to the browser session via the Chrome Devtools Protocol.</p><p>To ensure the security of your Worker, individual remote browsers are run as disposable instances – one instance per request, and never shared. They are secured using gVisor to protect against kernel level exploits. On top of that, the browser is running sandboxed processes with the lowest privilege level using a Linux seccomp profile.</p><p>The Rendering API should be used when you’re building and testing your applications.  To prevent abuse, <a href="https://www.cloudflare.com/products/bot-management/">Cloudflare Bot Management</a> has baked in signals to indicate that a request is coming from a Worker running Puppeteer. As a Cloudflare Bot Management customer, this will automatically be added to your blocklist, with the option to explicitly opt in and allow it.</p>
    <div>
      <h3>How can you get started?</h3>
      <a href="#how-can-you-get-started">
        
      </a>
    </div>
    <p>We’re introducing the Workers Browser Rendering API in closed beta. If you’re interested, please tell us a bit about your use case and join the <a href="https://www.cloudflare.com/lp/workers-browser-rendering-api">waitlist</a>. We would love to hear what else you want to build using the Workers Browser Rendering API, let us know in the Workers channel on the <a href="https://discord.gg/cloudflaredev">Cloudflare Developers Discord</a>!</p> ]]></content:encoded>
            <category><![CDATA[Developer Week]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <category><![CDATA[Supercloud]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <guid isPermaLink="false">77JCHvFSvpxkPeIQOoGhuC</guid>
            <dc:creator>Tanushree Sharma</dc:creator>
            <dc:creator>Trevor Sundberg</dc:creator>
        </item>
        <item>
            <title><![CDATA[Xata Workers: client-side database access without client-side secrets]]></title>
            <link>https://blog.cloudflare.com/xata-customer-story/</link>
            <pubDate>Wed, 16 Nov 2022 14:00:00 GMT</pubDate>
            <description><![CDATA[ Xata is on a mission to solve the industry’s hardest data problems with their Serverless Data Platform. We’re excited to have Xata building their serverless functions product – Xata Workers – on top of Workers for Platforms. Here is Xata’s story. ]]></description>
            <content:encoded><![CDATA[ 
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2Er0jWZdhwSZumjJxjt1yW/bfc90b6c901f250dfa64557f5d5ad6c1/Customer-Story_-Xata_light.png" />
            
            </figure><p>We’re excited to have Xata building their serverless functions product – Xata Workers – on top of <a href="https://developers.cloudflare.com/cloudflare-for-platforms/workers-for-platforms/">Workers for Platforms</a>. Xata Workers act as middleware to simplify database access and allow their developers to deploy functions that sit in front of their databases. Workers for Platforms opens up a whole suite of use cases for Xata developers all while providing the security, scalability and performance of Cloudflare Workers.</p><p>Now, handing it over to Alexis, a Senior Software Engineer at Xata to tell us more.</p>
    <div>
      <h3>Introduction</h3>
      <a href="#introduction">
        
      </a>
    </div>
    <p>In the last few years, there's been a rise of Jamstack, and new ways of thinking about the cloud that some people call serverless or edge computing. Instead of maintaining dedicated servers to run a single service, these architectures split applications in smaller services or functions.</p><p>By simplifying the state and context of our applications, we can benefit from external providers deploying these functions in dozens of servers across the globe. This architecture benefits the developer and user experience alike. Developers don’t have to manage servers, and users don’t have to experience latency. Your application simply scales, even if you receive hundreds of thousands of unexpected visitors.</p><p>When it comes to databases though, we still struggle with the complexity of orchestrating replication, failover and high availability. Traditional databases are difficult to scale horizontally and usually require a lot of infrastructure maintenance or learning complex database optimization concepts.</p><p>At Xata we are building a modern data platform designed for scalable applications. It allows you to focus on your application logic, instead of having to worry about how the data is stored.</p>
    <div>
      <h3>Making databases accessible to everyone</h3>
      <a href="#making-databases-accessible-to-everyone">
        
      </a>
    </div>
    <p>We started Xata with the mission of helping developers build their applications and forget about maintaining the underlying infrastructure.</p><p>With that mission in mind, we asked ourselves: how can we make databases accessible to everyone? How can we provide a delightful experience for a frontend engineer or designer using a database?</p><p>To begin with, we built an appealing web dashboard, that any developer — no matter their experience — can be comfortable using to work with their data.</p><p>Whether they’re defining or refining their schema, viewing or adding records, fine-tuning search results with query boosters, or getting code snippets to speed up development with our SDK. We believe that only the best user experience can provide the best development experience.</p><p>We identified a major challenge amongst our user base early on. Many front-end developers want to access their database from client-side code.</p><p>Allowing access to a database from client-side code comes with several security risks if not done properly. For example, someone could inspect the code, find the credentials, and if they weren’t scoped to a single operation, potentially query or modify other parts of the database. Unfortunately, this is a common reason for data leaks and security breaches.</p><p>It was a hard problem to solve, and after plenty of brainstorming, we agreed on two potential ways forward: implementing row-level access rules or writing API routes that talked to the database from server code.</p><p>Row-level access rules are a good way to solve this, but they would have required us to define our own opinionated language. For our users, it would have been hard to migrate away when they outgrow this solution. Instead, we preferred to focus on making serverless functions easier for our users.</p><p>Typically, serverless functions require you to either choose a full stack framework or manually write, compile, deploy and use them. This generally adds a lot of cognitive overhead even to choose the right solution. We wanted to simplify accessing the database from the frontend without sacrificing flexibility for developers. This is why we decided to build Xata Workers.</p>
    <div>
      <h3>Xata Workers</h3>
      <a href="#xata-workers">
        
      </a>
    </div>
    <p>A Xata Worker is a function that a developer can write in JavaScript or TypeScript as client-side code. Rather than being executed client-side, it will actually be executed on Cloudflare’s global network.</p><p>You can think of a Xata Worker as a <code>getServerSideProps</code> function in Next.js or a <code>loader</code> function in Remix. You write your server logic in a function and our tooling takes care of deploying and running it server-side for you (yes, it’s that easy).</p><p>The main difference with other alternatives is that Xata Workers are, by design, agnostic to a framework or hosting provider. You can use them to build any kind of application or website, and even upload it as static HTML in a service like GitHub Pages or S3. You don't need a full stack web framework to use Xata Workers.</p><p>With our command line tool, we handle the build and deployment process. When the function is invoked, the Xata Worker actually makes a request to a serverless function over the network.</p>
            <pre><code>import { useQuery } from '@tanstack/react-query';
import { xataWorker } from '~/xata';

const listProducts = xataWorker('listProducts', async ({ xata }) =&gt; {
  return await xata.db.products.sort('popularity', 'desc').getMany();
});

export const Home = () =&gt; {
  const { data = [] } = useQuery(['products'], listProducts);

  return (
    &lt;Grid&gt;
      {data.map((product) =&gt; (
        &lt;ProductCard key={product.id} product={product} /&gt;
      ))}
    &lt;/Grid&gt;
  );
};</code></pre>
            <p>In the code snippet above, you can see a React component that connects to an e-commerce database with products on sale. Inside the UI component, with a popular client-side data fetching library, data is retrieved from the serverless function and for each product it renders another component in a grid.</p><p>As you can see a Xata Worker is a function that wraps any user-defined code and receives an instance of our SDK as a parameter. This instance has access to the database and, given that the code doesn’t run on the browser anymore, your secrets are not exposed for malicious usage.</p><p>When using a Xata Worker in TypeScript, our command line tool also generates custom types based on your schema. These types offer type-safety for your queries or mutations, and improve your developer experience by adding extra intellisense to your IDE.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/unkthtmJ4gjYyXKpnabLY/cbf58292a45bd344e045d4969c937f35/Untitled.png" />
            
            </figure><p>A Xata Worker, like any other function, can receive additional parameters that pass application state, context or user tokens. The code you write in the function can either return an object that will be serialized over the network with a superset of JSON to support dates and other non-primitive data types, or a full response with a custom status code and headers.</p><p>Developers can write all their logic, including their own authentication and authorization. Unlike complex row level access control rules, you can easily express your logic without constraints and even unit test it with the rest of your code.</p>
    <div>
      <h3>How we use Cloudflare</h3>
      <a href="#how-we-use-cloudflare">
        
      </a>
    </div>
    <p>We are happy to join the <a href="/welcome-to-the-supercloud-and-developer-week-2022/">Supercloud</a> movement, Cloudflare has an excellent track record, and we are using <a href="https://developers.cloudflare.com/cloudflare-for-platforms/workers-for-platforms/">Cloudflare Workers for Platforms</a> to host our serverless functions. By using the Workers isolated execution contexts we reduce security risks of running untrusted code on our own while being close to our users, resulting in super low latency.</p><p>All of it, without having to deploy extra infrastructure to handle our user’s application load or ask them to configure how the serverless functions should be deployed. It really feels like magic! Now, let's dive into the internals of how we use Cloudflare to run our Xata Workers.</p><p>For every workspace in Xata we create a Worker Namespace, a Workers for Platform concept to organize Workers and restrict the routing between them. We used Namespaces to group and encapsulate the different functions coming from all the databases built by a client or team.</p><p>When a user deploys a Xata Worker, we create a new Worker Script, and we upload the compiled code to its Namespace. Each script has a unique name with a compilation identifier so that the user can have multiple versions of the same function running at the same time.</p><p>During the compilation, we inject the database connection details and the database name. This way, the function can connect to the database without leaking secrets and restricting the scope of access to the database, all of it transparently for the developer.</p><p>When the client-side application runs a Xata Worker, it calls a Dispatcher function that processes the request and calls the correct Worker Script. The dispatcher function is also responsible for configuring the CORS headers and the log drain that can be used by the developer to debug their functions.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5KExHCF6dxsH9hlKzg5d5h/f3bb4ad510696f30312267df487ae3c1/Untitled--1-.png" />
            
            </figure><p>By using Cloudflare, we are also able to benefit from other products in the Workers ecosystem. For example, we can provide an easy way to cache the results of a query in Cloudflare's global network. That way, we can serve the results for read-only queries directly from locations closer to the end users, without having to call the database again and again for every Worker invocation. For the developer, it's only a matter of adding a "cache" parameter to their query with the number of milliseconds they want to cache the results in a KV Namespace.</p>
            <pre><code>import { xataWorker } from '~/xata';

const listProducts = xataWorker('listProducts', async ({ xata }) =&gt; {
  return await xata.db.products.sort('popularity', 'desc').getMany({
    cache: 15 * 60 * 1000 // TTL
  });
});</code></pre>
            <p>In development mode, we provide a command to run the functions locally and test them before deploying them to production. This enables rapid development workflows with real-time filesystem change monitoring and hot reloading of the workers code. Internally, we use the latest version of miniflare to emulate the Cloudflare Workers runtime, mimicking the real production environment.</p>
    <div>
      <h3>Conclusion</h3>
      <a href="#conclusion">
        
      </a>
    </div>
    <p>Xata is now out of beta and available for everyone. We offer a generous free tier that allows you to build and deploy your applications and only pay to scale them when you actually need it.</p><p>You can <a href="https://app.xata.io">sign up for free</a>, create a database in seconds and enjoy features such as branching with zero downtime migrations, search and analytics, transactions, and many others. Check out our <a href="https://xata.io">website</a> to learn more!</p><p>Xata Workers are currently in private beta. If you are interested in trying them out, you can sign up for the <a href="https://xata.io/beta/workers">waitlist</a> and talk us through your use case. We are looking for developers that are willing to provide feedback and shape this new feature for our serverless data platform.</p><p>We are very proud of our collaboration with Cloudflare for this new feature. Processing data closer to where it's being requested is the future of computing and we are excited to be part of this movement. We look forward to seeing what you build with Xata Workers.</p> ]]></content:encoded>
            <category><![CDATA[Developer Week]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <category><![CDATA[Serverless]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[Guest Post]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <guid isPermaLink="false">lbsVJBHHzqUTlcfGAM1kD</guid>
            <dc:creator>Alexis Rico (Guest Author)</dc:creator>
            <dc:creator>Tanushree Sharma</dc:creator>
        </item>
        <item>
            <title><![CDATA[The easiest way to build a modern SaaS application]]></title>
            <link>https://blog.cloudflare.com/workers-for-platforms-ga/</link>
            <pubDate>Wed, 21 Sep 2022 13:30:00 GMT</pubDate>
            <description><![CDATA[ With Workers for Platforms, your customers can build custom logic to meet their needs right into your application. We’re excited to announce that Workers for Platforms is now in GA for all Enterprise customers ]]></description>
            <content:encoded><![CDATA[ <p></p><p>The Software as a Service (SaaS) model has changed the way we work – <a href="https://99firms.com/blog/saas-statistics/#gref">80% of businesses use at least one SaaS application</a>. Instead of investing in building proprietary software or installing and maintaining on-prem licensed software, SaaS vendors provide businesses with out-of-the-box solutions.</p><p>SaaS has many benefits over the traditional software model: cost savings, continuous updates and scalability, to name a few. However, any managed solution comes with trade-offs. As a business, one of the biggest challenges in adopting SaaS tooling is loss of customization. Not every business uses software in the same way and as you grow as a SaaS company it’s not long until you get customers saying “if only I could do X”.</p><p>Enter Workers for Platforms – Cloudflare's serverless functions offering for SaaS businesses. With Workers for Platforms, your customers can build custom logic to meet their requirements right into your application.</p><p>We’re excited to announce that Workers for Platforms is now in GA for all Enterprise customers! If you’re an existing customer, reach out to your Customer Success Manager (CSM) to get access. For new customers, fill out our <a href="https://www.cloudflare.com/plans/enterprise/discover/contact/">contact form</a> to get started.</p>
    <div>
      <h3>The conundrum of customization</h3>
      <a href="#the-conundrum-of-customization">
        
      </a>
    </div>
    <p>As a SaaS business invested in capturing the widest market, you want to build a universal solution that can be used by customers of different sizes, in various industries and regions. However, every one of your customers has a unique set of tools and vendors and best practices. A generalized platform doesn’t always meet their needs.</p><p>For SaaS companies, once you get in the business of creating customizations yourself, it can be hard to keep up with seemingly never ending requests. You want your engineering teams to focus on building out your core business instead of building and maintaining custom solutions for each of your customer’s use cases.</p><p>With Workers for Platforms, you can give your customers the ability to write code that customizes <i>your</i> software. This gives your customers the flexibility to meet their exact use case while also freeing up internal engineering time  – it’s a win-win!</p>
    <div>
      <h3>How is this different from Workers?</h3>
      <a href="#how-is-this-different-from-workers">
        
      </a>
    </div>
    <p><a href="https://workers.cloudflare.com/">Workers</a> is Cloudflare’s serverless execution environment that runs your code on Cloudflare’s global network. Workers is lightning fast and scalable; running at data centers in <a href="https://www.cloudflare.com/network/">more than 275 cities</a> globally and serving requests from as close as possible to the end user. Workers for Platforms extends the power of Workers to our customer’s developers!</p>
    <div>
      <h3>So, what’s new?</h3>
      <a href="#so-whats-new">
        
      </a>
    </div>
    <p><b>Dispatch Worker:</b> As a platform customer, you want to have full control over how end developer code fits in with your <a href="https://www.cloudflare.com/learning/security/api/what-is-an-api/">APIs</a>. A Dispatch Worker is written by our platform customers to run their own logic before <i>dispatching</i> (aka routing) to Workers written by end developers. In addition to routing, it can be used to run authentication, create boilerplate functions and sanitize responses.</p><p><b>User Workers:</b> User Workers are written by end developers, that is, our customers’ developers. End developers can deploy User Workers to script automated actions, create integrations or modify response payload to return custom content. Unlike self-managed Function-as-a-Service (FaaS) options, with Workers for Platforms, end developers don’t need to worry about setting up and maintaining their code on any 3rd party platform. All they need to do is upload their code and you – or rather Cloudflare – takes care of the rest.</p><p><b>Unlimited Scripts:</b> Yes, you read that correctly! With hundreds-plus end developers, the existing 100 script limit for Workers won’t cut it for Workers for Platforms customers. Some of our Workers for Platforms customers even deploy a new script each time their end developers make a change to their code in order to maintain version control and to easily revert to a previous state if a bug is deployed.</p><p><b>Dynamic Dispatch Namespaces:</b> If you’ve used Workers before, you may be familiar with a feature we released earlier this year, <a href="/service-bindings-ga/">Service Bindings</a>. Service Bindings are a way for two Workers to communicate with each other. They allow developers to break up their applications into modules that can be chained together. Service Bindings explicitly link two Workers together, and they’re meant for use cases where you know exactly which Workers need to communicate with each other.</p><p>Service Bindings don’t work in the Workers for Platforms model because User Workers are uploaded ad hoc. Dynamic Dispatch Namespaces is our solution to this! A Dispatch Namespace is composed of a collection of User Workers. With Dispatch Namespaces, a Dispatch Worker can be used to call any User Worker in a namespace (similar to how Service Bindings work) but without needing to explicitly pre-define the relationship.</p><p>Read more about how to use these features below!</p>
    <div>
      <h3>How to use Workers for Platforms</h3>
      <a href="#how-to-use-workers-for-platforms">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5r7SqdBoNmEKVCECpx9aYC/3d223f93e94f61a6708b3cffeaae65f5/image1-27.png" />
            
            </figure>
    <div>
      <h3>Dispatch Workers</h3>
      <a href="#dispatch-workers">
        
      </a>
    </div>
    <p>Dispatch Workers are the entry point for requests to Workers in a Dispatch Namespace. The Dispatch Worker can be used to run any functions ahead of User Workers. They can make a request to any User Workers in the Dispatch Namespace, and they ultimately handle the routing to User Workers.</p><p>Dispatch Workers are created the same way as a regular Worker, except they need a Dispatch Namespace binding in the project’s <a href="https://developers.cloudflare.com/workers/cli-wrangler/configuration/"><code>wrangler.toml</code></a> configuration file.</p>
            <pre><code>[[dispatch_namespaces]]
binding = "dispatcher"
namespace = "api-prod"</code></pre>
            <p>In the example below, this Dispatch Worker reads the subdomain from the path and calls the appropriate User Worker. Alternatively you can use KV, D1 or your data store of choice to map identifying parameters from an incoming request to a User Worker.</p>
            <pre><code>export default {
 async fetch(request, env) {
   try {
       // parse the URL, read the subdomain
       let worker_name = new URL(request.url).host.split('.')[0]
       let user_worker = env.dispatcher.get(worker_name)
       return user_worker.fetch(request)
   } catch (e) {
       if (e.message == 'Error: Worker not found.') {
           // we tried to get a worker that doesn't exist in our dispatch namespace
           return new Response('', {status: 404})
       }
       // this could be any other exception from `fetch()` *or* an exception
       // thrown by the called worker (e.g. if the dispatched worker has
       // `throw MyException()`, you could check for that here).
       return new Response(e.message, {status: 500})
   }
 }

}</code></pre>
            
    <div>
      <h3>Uploading User Workers</h3>
      <a href="#uploading-user-workers">
        
      </a>
    </div>
    <p>User Workers must be uploaded to a Dispatch Namespace through the Cloudflare API (wrangler support coming soon!). This code snippet below uses a simple HTML form to take in a script and customer id and then uploads it to the Dispatch Namespace.</p>
            <pre><code>export default {
 async fetch(request: Request) {
   try {
     // on form submit
     if (request.method === "POST"){
       const str = JSON.stringify(await request.json())
       const upload_obj = JSON.parse(str)
       await upload(upload_obj.customerID, upload_obj.script)
   }
   //render form
     return new Response (html, {
       headers: {
         "Content-Type": "text/html"
       }
     })
   } catch (e) {
       // form error
       return new Response(e.message, {status: 500})
   }
 }
}

async function upload(customerID:string, script:string){
 const scriptName = customerID;
 const scriptContent = script;
 const accountId = "&lt;ACCOUNT_ID&gt;";
 const dispatchNamespace = "api-prod";
 const url = `https://api.cloudflare.com/client/v4/accounts/${accountId}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}`;
 // construct and send request
 const response = await fetch(url, {
   method: "PUT",
   body: scriptContent,
   headers: {
     "Content-Type": "application/javascript",
     "X-Auth-Email": "&lt;EMAIL&gt;",
     "X-Auth-Key": "&lt;API_KEY&gt;"
   }
 });

 const result = (await response.json());
 if (response.status != 200) {
   throw new Error(`Upload error`);
 }
}</code></pre>
            <p>It’s that simple. With Dispatch Namespaces and Dispatch Workers, we’re giving you the building blocks to customize your SaaS applications. Along with the Platforms APIs, we’re also releasing a Workers for Platforms UI on the Cloudflare dashboard where you can view your Dispatch Namespaces, search scripts and view analytics for User Workers.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3IfHMkKVxIinmdqstzqGS9/1d7c72ea6706e107b11a5b3bd6e14f15/image3-14.png" />
            
            </figure><p>To view an end to end example, check out our <a href="https://github.com/cloudflare/workers-for-platforms-example">Workers for Platforms example application</a>.</p>
    <div>
      <h3>Get started today!</h3>
      <a href="#get-started-today">
        
      </a>
    </div>
    <p>We’re releasing Workers for Platforms to all <a href="https://www.cloudflare.com/plans/enterprise/">Cloudflare Enterprise</a> customers. If you’re interested, reach out to your Customer Success Manager (CSM) to get access. To get started, take a look at our <a href="https://github.com/cloudflare/workers-for-platforms-example">Workers for Platforms starter project</a> and <a href="https://developers.cloudflare.com/cloudflare-for-platforms/workers-for-platforms/">developer documentation</a>.</p><p>We also have plans to release this down to the Workers Paid plan. Stay tuned on the <a href="https://discord.gg/hWAMUm9MPj">Cloudflare Discord</a> (channel name: workers-for-platforms) for updates.</p>
    <div>
      <h3>What’s next?</h3>
      <a href="#whats-next">
        
      </a>
    </div>
    <p>We’ve heard lots of great feature requests from our early Workers for Platforms customers. Here’s a preview of what’s coming next on the roadmap:</p><ul><li><p>Fine-grained controls over User Workers: custom script limits, allowlist/blocklist for fetch requests</p></li><li><p>GraphQL and Logs: Metrics for User Workers by tag</p></li><li><p>Plug and play Platform Development Kit</p></li><li><p>Tighter integration with Cloudflare for SaaS custom domains</p></li></ul><p>If you have specific feature requests in mind, please reach out to your CSM or get in touch through the <a href="https://discord.gg/hWAMUm9MPj">Discord</a>!</p> ]]></content:encoded>
            <category><![CDATA[GA Week]]></category>
            <category><![CDATA[General Availability]]></category>
            <category><![CDATA[Serverless]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[SaaS]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <guid isPermaLink="false">6dcOc4G84Hm30oRipD6moR</guid>
            <dc:creator>Tanushree Sharma</dc:creator>
            <dc:creator>Mark J Miller</dc:creator>
        </item>
        <item>
            <title><![CDATA[Logs on R2: slash your logging costs]]></title>
            <link>https://blog.cloudflare.com/logs-r2/</link>
            <pubDate>Wed, 11 May 2022 12:59:24 GMT</pubDate>
            <description><![CDATA[ You shouldn’t have to make trade-offs between keeping logs that you need and managing tight budgets. R2’s low costs makes this decision easier and now you can use Logpush to store logs on R2. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Hot on the heels of the <a href="/r2-open-beta">R2 open beta announcement</a>, we’re excited that Cloudflare enterprise customers can now use Logpush to store logs on R2!</p><p>Raw logs from our products are used by our customers for debugging performance issues, to investigate security incidents, to keep up security standards for compliance and much more. You shouldn’t have to make tradeoffs between keeping logs that you need and managing tight budgets. With <a href="https://www.cloudflare.com/developer-platform/products/r2/">R2’s low costs</a>, we’re making this decision easier for our customers!</p>
    <div>
      <h3>Getting into the numbers</h3>
      <a href="#getting-into-the-numbers">
        
      </a>
    </div>
    <p>Cloudflare helps customers at different levels of scale — from a few requests per day, up to a million requests per second. Because of this, the cost of log storage also varies widely. For customers with higher-traffic websites, log storage costs can grow large, quickly.</p><p>As an example, imagine a website that gets 100,000 requests per second. This site would generate about 9.2 TB of HTTP request logs per day, or 850 GB/day after gzip compression. Over a month, you’ll be storing about 26 TB (compressed) of HTTP logs.</p><p>For a typical use case, imagine that you write and read the data exactly once – for example, you might write the data to <a href="https://www.cloudflare.com/learning/cloud/what-is-object-storage/">object storage</a> before ingesting it into an alerting system. <a href="https://r2-calculator.cloudflare.com/">Compare the costs of R2 and S3</a> (note that this excludes costs per operation to read/write data).</p><table><tr><td><p><b>Provider</b></p></td><td><p><b>Storage price</b></p></td><td><p><b>Data transfer price</b></p></td><td><p><b>Total cost assuming data is read once</b></p></td></tr><tr><td><p>R2</p></td><td><p>$0.015/GB</p></td><td><p>$0</p></td><td><p>$390/month</p></td></tr><tr><td><p>S3 (Standard, US East)</p></td><td><p><a href="http://web.archive.org/web/20220531135033/https://aws.amazon.com/s3/pricing/">$0.023/GB</a></p></td><td><p><a href="http://web.archive.org/web/20220531135033/https://aws.amazon.com/s3/pricing/">$0.09/GB</a> for first 10 TB; then <a href="http://web.archive.org/web/20220531135033/https://aws.amazon.com/s3/pricing/">$0.085/GB</a></p></td><td><p>$2,858/month</p></td></tr></table><p>In this example, R2 leads to 86% savings! It’s worth noting that querying logs is where another hefty price tag comes in because Amazon Athena charges based on the amount of data scanned. If your team is looking back through historical data, each query can be hundreds of dollars.</p><p>Many of our customers have tens to hundreds of domains behind Cloudflare and the majority of our Enterprise customers also use multiple Cloudflare products. Imagine how costs will scale if you need to store HTTP, WAF and Spectrum logs for all of your Internet properties behind Cloudflare.</p><p>For SaaS customers that are building the next big thing on Cloudflare, logs are important to get visibility into customer usage and performance. Your customer’s developers may also want access to raw logs to understand errors during development and to troubleshoot production issues. Costs for storing logs multiply and add up quickly!</p>
    <div>
      <h3>The flip side: log retrieval</h3>
      <a href="#the-flip-side-log-retrieval">
        
      </a>
    </div>
    <p>When designing products, one of Cloudflare’s core principles is ease of use. We take on the complexity, so you don’t have to. Storing logs is only half the battle, you also need to be able to access relevant logs when you need them – in the heat of an incident or when doing an in depth analysis.</p><p>Our product, <a href="https://developers.cloudflare.com/logs/logpull/">Logpull</a>, offers seven days of <a href="https://www.cloudflare.com/learning/performance/log-retention-best-practices/">log retention</a> and an easy-to-use API to access. Our customers love that Logpull doesn’t need any setup on third parties since it's completely managed by Cloudflare. However, Logpull is limited in the retention of logs, the type of logs that we store (only HTTP request logs) and the amount of data that can be queried at one time.</p><p>We’re building tools for log retrieval that make it super easy to get your data out of R2 from any of our datasets. Similar to Logpull, we’ll start by supporting lookups by time period and rayId. From there, we’ll tackle more complex functions like returning logs within time X and Y that have 500 errors or where WAF action = <code>block</code>.</p><p>We’re looking for customers to join a closed beta for our Log Retrieval API. If you’re interested in testing it out, giving feedback and ultimately helping us shape the product sign up <a href="https://docs.google.com/forms/d/e/1FAIpQLSeIzZk_giT5KFLL7PyUQofZKMLMp9BIo0ObCbxqKg1vlD0dlw/viewform?usp=sf_link">here</a>.</p>
    <div>
      <h3>Logs on R2: How to get started</h3>
      <a href="#logs-on-r2-how-to-get-started">
        
      </a>
    </div>
    <p>Enterprise customers first need to get R2 added to their contract. Reach out to your account team if this is something you’re interested in! Once enabled, create an R2 bucket for your logs and follow the Logpush setup flow to create your job.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2nzN2tZ2qIJv23lDiIrlbU/2a0a51af78eb5ab678e36378b016b09d/pasted-image-0.png" />
            
            </figure><p>It’s that simple! If you have questions, our <a href="https://developers.cloudflare.com/logs/get-started/enable-destinations/r2//">Logpush to R2</a> developer docs go into more detail.</p>
    <div>
      <h3>More to come</h3>
      <a href="#more-to-come">
        
      </a>
    </div>
    <p>We’re continuing to build out more advanced Logpush features with a focus on customization. Here’s a preview of what’s next on the roadmap:</p><ul><li><p>New datasets: Network Analytics Logs, Worker's Trace Events</p></li><li><p>Log filtering</p></li><li><p>Custom log formatting</p></li></ul><p>We also have exciting plans to build out log analysis and forensics capabilities on top of R2. We want to make log storage tightly coupled to the Cloudflare dash, so you can see high level analytics and drill down into individual log lines all in one view. Stay tuned to the blog for more!</p> ]]></content:encoded>
            <category><![CDATA[Platform Week]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Logs]]></category>
            <category><![CDATA[Beta]]></category>
            <guid isPermaLink="false">22cFwEOvRYecsonDb4YVCQ</guid>
            <dc:creator>Tanushree Sharma</dc:creator>
        </item>
        <item>
            <title><![CDATA[Workers visibility: announcing Logpush for Worker’s Trace Events]]></title>
            <link>https://blog.cloudflare.com/logpush-for-workers/</link>
            <pubDate>Tue, 10 May 2022 13:01:14 GMT</pubDate>
            <description><![CDATA[ Customers are using Cloudlfare Workers to create the next big thing, we’re building tools to make that happen successfully. We’re excited to announce Logpush for Worker’s Trace Events, making it easier than ever to gain visibility into applications built on Workers ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Writing an application is like building a rocket. Countless hours in development and thousands of moving parts all come down to one moment - launch day. Picture the countdown: T minus 10 seconds. The entire team is making sure that things are running smoothly by monitoring dashboards that measure the health of every part of the system.</p><p>It’s every developer’s dream to get the level of visibility that NASA has in their mission control room, but for their own code. For flight directors and engineering directors alike, it’s important to have visibility into the systems that are built throughout development and after release. Today, we’re excited to announce <a href="https://developers.cloudflare.com/logs/about/">Logpush</a> for Worker’s Trace Events, making it easier than ever to gain visibility into applications built on Workers.</p>
    <div>
      <h3>Workers Visibility Today</h3>
      <a href="#workers-visibility-today">
        
      </a>
    </div>
    <p>Today, we have lots of tools that are used to find out what’s happening in a Worker.</p><ul><li><p><a href="https://developers.cloudflare.com/workers/learning/metrics-and-analytics/">Workers metrics &amp; analytics</a></p></li><li><p><a href="/introducing-workers-dashboard-logs/">Workers logs on the dashboard</a></p></li><li><p><a href="https://developers.cloudflare.com/workers/cli-wrangler/commands/#tail">wrangler tail</a></p></li><li><p><a href="/observability-ecosystem/">Observability Ecosystem Partners</a>: Sentry, New Relic, Datadog</p></li></ul><p>These tools are awesome for debugging, generalizing trends and monitoring Workers on third parties. They emphasize ease of use and make it effortless to get visibility quickly from your Workers.</p><p>As Workers have evolved, we’re now seeing more adoption from larger enterprises and platform companies who are using Workers as a foundation for their customers to develop on top of. When building complex and dynamic applications, customers, especially those building on Workers in the SaaS world need access to raw logs.</p>
    <div>
      <h3>Bringing Trace Events to Logpush</h3>
      <a href="#bringing-trace-events-to-logpush">
        
      </a>
    </div>
    <p>Coming soon — we’re adding Workers execution logs to Logpush! Cloudflare Enterprise customers get access to Logpush for any of our available products, including CDN, WAF, Spectrum and many more. We’re excited to add Workers to this list.</p><p>Logpush for Worker’s Trace Events will include unstructured <code>console.log()</code> messages, exceptions, and metadata about requests/responses. Here is a sample Trace Event for a fetch request:</p><p><code>{"accountID":123456,"scriptName":"cloudflare-workers-script","outcome":"ok","duration":0.5,"CPUTime":4,"eventType":"fetch","event":{"request":{"url":"https://workersdevtest.com","method":"GET","headers":{"accept":"*/*","accept-encoding":"gzip","connection":"Keep-Alive"},"cf":{"clientTcpRtt":40,"tlsVersion":"TLSv1.2","httpProtocol":"HTTP/2","edgeRequestKeepAliveStatus":1,"country":"CA","asn":16591}},"subrequests":{"request":{"url":"https://example.com","method":"GET","headers":{"x-custom-header":"my-header-value"}},"logs":[{"message":["foo"],"level":"log","timestamp":1587491479166}],"exceptions":[]}}}</code></p><p>With this new dataset, our Enterprise customers will be able to send Workers logs to their preferred cloud storage destination such as GCS or R2 or to analysis platforms like Splunk or New Relic. Logpush handles batching and can scale no matter how much traffic your Worker gets.</p><p>This brings new ways to get transparency into Workers! You can pinpoint when a fetch request fails, find out which call is adding the most lag in your application, and track down specific log lines to debug the end user experience. Also, combine Workers logs with HTTP request logs to get a better picture of the full request lifecycle.</p><p>It also opens up doors for SaaS companies building on Workers. SaaS companies can <a href="https://www.cloudflare.com/application-services/solutions/app-performance-monitoring/">get visibility into how their customer’s applications are performing</a> and expose logs to their customer’s developers to make debugging and troubleshooting much easier.</p>
    <div>
      <h3>Mission Control in the making</h3>
      <a href="#mission-control-in-the-making">
        
      </a>
    </div>
    <p>wrangler tail, Workers Analytics Engine (coming later this week!) and Logpush for Worker’s Trace Events are an elite trio to give visibility into every aspect of a Worker.</p><p>When you’re deep in the mix of development, wrangler tail is by your side to help you crush bugs and eliminate errors.  With Workers Analytics Engine, you can instrument business logic and query aggregates within seconds to populate dashboards for monitoring. Logpush for Trace Events is there for when you need to debug very specific cases and get an exact record of what happened.</p><p>Customers big and small are using Cloudflare Workers for their next launch, and we’re building tools to make that happen successfully. We’re bringing Logpush for Trace Events to our Enterprise customers very soon. Stay tuned for updates.</p> ]]></content:encoded>
            <category><![CDATA[Platform Week]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Serverless]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <guid isPermaLink="false">6vO5zaKikTbGog7S5Dje4W</guid>
            <dc:creator>Tanushree Sharma</dc:creator>
        </item>
        <item>
            <title><![CDATA[Cloudflare Observability]]></title>
            <link>https://blog.cloudflare.com/vision-for-observability/</link>
            <pubDate>Fri, 18 Mar 2022 21:03:00 GMT</pubDate>
            <description><![CDATA[ Being a single pane of glass for all network activity has always been one of Cloudflare’s goals. Today, we’re outlining the future vision for Cloudflare observability. ]]></description>
            <content:encoded><![CDATA[ 
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3bfLNf93KkwbzGrHAI7Eoo/c9afa97526fe27a4d3c1350bb97237aa/Observability---Bringing-Logs-in-Dash.png" />
            
            </figure><p>Whether you’re a software engineer deploying a new feature, network engineer updating routes, or a security engineer configuring a new firewall rule: You need visibility to know if your system is behaving as intended — and if it’s not, to know how to fix it.</p><p>Cloudflare is committed to helping our customers get visibility into the services they have protected behind Cloudflare. Being a single pane of glass for all network activity has always been one of Cloudflare’s goals. Today, we’re outlining the future vision for Cloudflare observability.</p>
    <div>
      <h3>What is observability?</h3>
      <a href="#what-is-observability">
        
      </a>
    </div>
    <p><a href="https://www.cloudflare.com/learning/performance/what-is-observability/">Observability</a> means gaining visibility into the internal state of a system. It’s used to <a href="https://www.cloudflare.com/application-services/solutions/app-performance-monitoring/">give users the tools</a> to figure out what’s happening, where it’s happening, and why.</p><p>At Cloudflare, we believe that observability has three core components: monitoring, analytics, and forensics. Monitoring measures the health of a system - it tells you when something is going wrong. Analytics give you the tools to visualize data to identify patterns and insights. Forensics helps you answer very specific questions about an event.</p><p>Observability becomes particularly important in the context of security to validate that any mitigating actions performed by our security products, such as Firewall or Bot Management, are not false positives. Was that request correctly classified as malicious? And if it wasn’t, which detection system classified it as such?</p><p>Cloudflare, additionally, has products to improve performance of applications and corporate networks and allow developers to write lightning fast code that runs on our global network. We want to be able to provide our customers with insights into every request, packet, and fetch that goes through Cloudflare’s network.</p>
    <div>
      <h3>Monitoring and Notifying</h3>
      <a href="#monitoring-and-notifying">
        
      </a>
    </div>
    <p>Analytics are fantastic for summarizing data, but how do you know <i>when</i> to look at them? No one wants to sit on the dashboard clicking refresh over and over again just in case something looks off. That’s where notifications come in.</p><p>When we talk about something “looking off” on an analytics page, what we really mean is that there’s a significant change in your traffic or network which is reflected by spikes or drops in our analytics. Availability and performance directly affect end users, and our goal is to monitor and notify our customers as soon as we see things going wrong.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1l5DpBwxWnfWRiyAIpwMxo/b85ae5d80dc26967acc17190e3ad633f/Untitled--1-.png" />
            
            </figure><p>Today, we have many different types of notifications from <a href="/smarter-origin-service-level-monitoring/">Origin Error Rates</a>, <a href="/get-notified-when-your-site-is-under-attack/">Security Events, and Advanced Security Events</a> to Usage Based Billing and <a href="/health-check-analytics-and-how-you-can-use-it/">Health Checks</a>. We’re continuously adding more notification types to have them correspond with our awesome analytics. As our analytics get more customizable, our notifications will as well.</p><p>There’s tons of different algorithms that can be used to detect spikes, including using burn rates and z-scores. We’re continuing to iterate on the algorithms that we use for detections to offer more variations, make them smarter, and make sure that our notifications are both accurate and not too noisy.</p>
    <div>
      <h3>Analytics</h3>
      <a href="#analytics">
        
      </a>
    </div>
    <p>So, you’ve received an alert from Cloudflare. What comes next?</p><p>Analytics can be used to get a birds eye view of traffic or focus on specific types of events by adding filters and time ranges. After you receive an alert, we want to show you exactly what’s been triggered through graphs, high level metrics, and top Ns on the Cloudflare dashboard.</p><p>Whether you’re a developer, security analyst, or network engineer, the Cloudflare dashboard should be the spot for you to see everything you need. We want to make the dashboard more customizable to serve the diverse use cases of our customers. Analyze data by specifying a timeframe and filter through dropdowns on the dashboard, or build your own metrics and graphs that work alongside the raw logs to give you a clear picture of what's happening.</p><p>Focusing on security, we believe analytics are the best tool to build confidence before deploying security policies. Moving forward, we plan to layer all of our security related detection signals on top of HTTP analytics so you can use the dashboard to answer questions such as: if I were to block all requests that the <a href="https://www.cloudflare.com/learning/ddos/glossary/web-application-firewall-waf/">WAF</a> identifies as an XSS attack, what would I block?</p><p>Customers using our enterprise Bot Management may already be familiar with this experience, and as we improve it and build upon it further, all of our other security products will follow.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1bJEpCdWDMbU6pcepmsoXW/565e8bbd48406f35bc8faffc42d4de0f/Screenshot-2022-03-18-at-15.24.11.png" />
            
            </figure><p>Analytics are a powerful tool to see high level patterns and identify anomalies that indicate that something unusual is happening. We’re working on new dashboards, customizations, and features that widen the use cases for our customers. Stay tuned!</p>
    <div>
      <h3>Logs</h3>
      <a href="#logs">
        
      </a>
    </div>
    <p>Logs are used when you want to examine specific details about an event. They consist of a timestamp and fields that describe the event and are used to get visibility on a granular level when you need a play-by-play.</p><p>In each of our datasets, an event measures something different. For example, in HTTP request logs, an event is when an end user requests content from or sends content to a server. For Firewall logs, an event occurs when the Firewall takes an action on an HTTP request. There can be multiple Firewall events for each HTTP request.</p><p>Today, our customers access logs using Logpull, Logpush, or Instant Logs. Logpull and Logpush are great for customers that want to send their logs to third parties (like our <a href="https://www.cloudflare.com/partners/analytics/">Analytics Partners</a>) to store, analyze, and correlate with other data sources. With Instant Logs, our customers can monitor and troubleshoot their traffic in real-time straight from the dashboard or CLI. We’re planning on building out more capabilities to dig into logs on Cloudflare. We’re hard at work on building <a href="/store-your-cloudflare-logs-on-r2/">log storage on R2</a> - but what’s next?</p><p>We’ve heard from customers that the activity log on the Firewall analytics dashboard is incredibly useful. We want to continue to bring the power of logs to the dashboard by adding the same functionality across our products. For customers that will store their logs on Cloudflare R2, this means that we can minimize the use of sampled data.</p><p>If you’re looking for something very specific, querying logs is also important, which is where forensics comes in. The goal is to let you investigate from high level analytics all the way down to individual logs lines that make them up. Given a unique identifier, such as the ray ID, you should be able to look up a single request, and then correlate it with all other related activity. Find out the client IP of that ray ID and from there, use cases are plentiful: what other requests from this IP are malicious? What paths did the client follow?</p>
    <div>
      <h3>Tracing</h3>
      <a href="#tracing">
        
      </a>
    </div>
    <p>Logs are really useful, but they don’t capture the context around a request. Traces show the end-to-end life cycle of a request from when a user requests a resource to each of the systems that are involved in its delivery. They’re another way of applying forensics to help you find something very specific.</p><p>These are used to differentiate each part of the application to identify where errors or bottlenecks are occurring. Let's say that you have a Worker that performs a fetch event to your origin and a third party API. Analytics can show you average execution times and error rates for your Worker, but it doesn’t give you visibility into each of these operations.</p><p>Using wrangler dev and console.log statements are really helpful ways to test and debug your code. They bring some of the visibility that’s needed, but it can be tedious to instrument your code like this.</p><p>As a developer, you should have the tools to understand what’s going on in your applications so you can deliver the best experience to your end users. We can help you answer questions like: Where is my Worker execution failing? Which operation is causing a spike in latency in my application?</p>
    <div>
      <h3>Putting it all together</h3>
      <a href="#putting-it-all-together">
        
      </a>
    </div>
    <p>Notifications, analytics, logs, and tracing each have their distinct use cases, but together, these are powerful tools to provide analysts and developers visibility. Looking forward, we’re excited to bring more and more of these capabilities on the Cloudflare dashboard.</p><p>We would love to hear from you as we build these features out. If you’re interested in sharing use cases and helping shape our roadmap, contact your account team!</p> ]]></content:encoded>
            <category><![CDATA[Security Week]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Analytics]]></category>
            <category><![CDATA[Bots]]></category>
            <guid isPermaLink="false">23Q8iqhgSAOgTyAsHRfZ6s</guid>
            <dc:creator>Tanushree Sharma</dc:creator>
            <dc:creator>Natasha Wissmann</dc:creator>
            <dc:creator>Ashcon Partovi</dc:creator>
            <dc:creator>Michael Tremante</dc:creator>
        </item>
        <item>
            <title><![CDATA[Get full observability into your Cloudflare logs with New Relic]]></title>
            <link>https://blog.cloudflare.com/announcing-the-new-relic-direct-log-integration/</link>
            <pubDate>Mon, 14 Mar 2022 12:59:17 GMT</pubDate>
            <description><![CDATA[ Correlating Cloudflare logs across your stack in New Relic One is powerful for monitoring and debugging in order to keep services safe and reliable. We’re excited to have partnered with New Relic to create a direct integration that provides this visibility ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Building a great customer experience is at the heart of any business. Building resilient products is half the battle — teams also need observability into their applications and services that are running across their stack.</p><p>Cloudflare provides analytics and logs for our products in order to give our customers visibility to extract insights. Many of our customers use Cloudflare along with other applications and network services and want to be able to correlate data through all of their systems.</p><p>Understanding normal traffic patterns, causes of latency and errors can be used to improve performance and ultimately the customer experience. For example, for websites behind Cloudflare, analyzing application logs and origin server logs along with Cloudflare’s HTTP request logs give our customers an end-to-end visibility about the journey of a request.</p><p>We’re excited to have partnered with New Relic to create a direct integration that provides this visibility. The direct integration with our logging product, Logpush, means customers no longer need to pay for middleware to get their Cloudflare data into New Relic. The result is a faster log delivery and fewer costs for our mutual customers!</p><p>We’ve invited the New Relic team to dig into how New Relic One can be used to provide insights into Cloudflare.</p>
    <div>
      <h3>New Relic Log Management</h3>
      <a href="#new-relic-log-management">
        
      </a>
    </div>
    <p>New Relic provides an open, extensible, cloud-based observability platform that gives visibility into your entire stack. Logs, metrics, events, and traces are automatically correlated to help our customers improve user experience, accelerate time to market, and reduce MTTR.</p><p>Deploying <a href="https://newrelic.com/products/log-management">log management</a> in context and at scale has never been faster, easier, or more attainable. With New Relic One, you can collect, search, and correlate logs and other telemetry data from applications, infrastructure, network devices, and more for faster troubleshooting and investigation.</p><p>New Relic correlates events from your applications, infrastructure, serverless environments, along with mobile errors, traces and spans to your logs — so you find exactly what you need with less toil. All your logs are only a click away, so there’s no need to dig through logs in a separate etool to manually correlate them with errors and traces.</p><p>See how engineers have used logs in New Relic to better serve their customers in the short video below.</p>
    <div>
      <h3>A quickstart for Cloudflare Logpush and New Relic</h3>
      <a href="#a-quickstart-for-cloudflare-logpush-and-new-relic">
        
      </a>
    </div>
    <p>To help you get the most of the new Logpush integration with New Relic, we’ve created the <a href="https://newrelic.com/instant-observability/cloudflare-network-logs/fc2bb0ac-6622-43c6-8c1f-6a4c26ab5434/?utm_source=external_partners&amp;utm_medium=referral&amp;utm_campaign=global-ever-green-io-partner">Cloudflare Logpush quickstart for New Relic</a>. The Cloudflare quickstart will enable you to monitor and analyze web traffic metrics on a single pre-built dashboard, integrating with New Relic’s database to provide an at-a-glance overview of the most important logs and metrics from your websites and applications.</p><p>Getting started is simple:</p><ul><li><p>First, ensure that you have enabled pushing logs directly into New Relic by following the documentation <a href="https://developers.cloudflare.com/logs/get-started/enable-destinations/new-relic/">“Enable Logpush to New Relic”</a>.</p></li><li><p>You’ll also need a New Relic account. If you don’t have one yet, get a free-forever account <a href="https://newrelic.com/signup?utm_source=external_partners&amp;utm_medium=content&amp;utm_campaign=global-fy22-q4-io-partner-cloudflare">here</a>.</p></li><li><p>Next, visit the <a href="https://newrelic.com/instant-observability/cloudflare-network-logs/fc2bb0ac-6622-43c6-8c1f-6a4c26ab5434/?utm_source=external_partners&amp;utm_medium=referral&amp;utm_campaign=global-ever-green-io-partner">Cloudflare quickstart in New Relic</a>, click “Install quickstart”, and follow the guided click-through.</p></li></ul><p>For full instructions to set up the integration and quickstart, read the <a href="http://newrelic.com/blog/how-to-relic/cloudflare-log-integration">New Relic blog post</a>.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/686cjyzad7TdJGQzRMobPY/2ddb0260e727059f8c327f7fa7d77f57/image1-16.png" />
            
            </figure><p>As a result, you’ll get a rich ready-made dashboard with key metrics about your Cloudflare logs!</p><p>Correlating Cloudflare logs across your stack in New Relic One is powerful for monitoring and debugging in order to keep services safe and reliable. Cloudflare customers get access to logs as part of the Enterprise account, if you aren’t using Cloudflare Enterprise, <a href="https://www.cloudflare.com/plans/enterprise/contact/">contact us</a>. If you’re not already a New Relic user, <a href="https://newrelic.com/signup">sign up for New Relic</a> to get a free account which includes this new experience and all of our product capabilities.</p> ]]></content:encoded>
            <category><![CDATA[Security Week]]></category>
            <category><![CDATA[Logs]]></category>
            <category><![CDATA[Analytics]]></category>
            <category><![CDATA[Guest Post]]></category>
            <guid isPermaLink="false">2PBumqKZPAc7RpJjXlMoZa</guid>
            <dc:creator>Tanushree Sharma</dc:creator>
            <dc:creator>Mike Neville-O'Neill (Guest Author)</dc:creator>
        </item>
        <item>
            <title><![CDATA[Leverage IBM QRadar SIEM to get insights from Cloudflare logs]]></title>
            <link>https://blog.cloudflare.com/announcing-the-ibm-qradar-direct-log-integration/</link>
            <pubDate>Mon, 14 Mar 2022 12:59:13 GMT</pubDate>
            <description><![CDATA[ We’re excited to announce that Cloudflare customers are now able to push their logs directly to QRadar. This direct integration leads to cost savings and faster log delivery for Cloudflare and QRadar SIEM customers ]]></description>
            <content:encoded><![CDATA[ <p></p><p>It’s just gone midnight, and you’ve just been notified that there is a malicious IP hitting your servers. You need to triage the situation; find the who, what, where, when, why as fast and in as much detail as possible.</p><p>Based on what you find out, your next steps could fall anywhere between classifying the alert as a false positive, to escalating the situation and alerting on-call staff from around your organization with a middle of the night wake up.</p><p>For anyone that’s gone through a similar situation, you’re aware that the security tools you have on hand can make the situation infinitely easier. It’s invaluable to have one platform that provides complete visibility of all the endpoints, systems and operations that are running at your company.</p><p>Cloudflare protects customers’ applications through application services: DNS, CDN and WAF to name a few. We also have products that protect corporate applications, like our <a href="https://www.cloudflare.com/learning/security/glossary/what-is-zero-trust/">Zero Trust</a> offerings Access and Gateway. Each of these products generates logs that provide customers visibility into what’s happening in their environments. Many of our customers use Cloudflare’s services along with other network or application services, such as endpoint management, containerized systems and their own servers.</p><p>We’re excited to announce that Cloudflare customers are now able to push their logs directly to IBM Security QRadar SIEM. This direct integration leads to cost savings and faster log delivery for Cloudflare and QRadar SIEM customers because there is no intermediary cloud storage required.</p><p>Cloudflare has invited our partner from the IBM QRadar SIEM team to speak to the capabilities this unlocks for our mutual customers.</p>
    <div>
      <h3>IBM QRadar SIEM</h3>
      <a href="#ibm-qradar-siem">
        
      </a>
    </div>
    <p>QRadar SIEM provides security teams centralized visibility and insights across users, endpoints, clouds, applications, and networks – helping you detect, investigate, and respond to threats enterprise wide. QRadar SIEM helps security teams work quickly and efficiently by turning thousands to millions of events into a manageable number of prioritized alerts and accelerating investigations with automated, AI-driven enrichment and root cause analysis. With QRadar SIEM, increase the productivity of your team, address critical use cases, and mature your security operation.</p><p>Cloudflare’s reverse proxy and enterprise security products are a key part of customer’s environments. <a href="https://www.cloudflare.com/learning/security/what-is-siem/">Security analysis</a> can gain visibility about logs from these products along with data from tools that span their network to build out detections and response workflows.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/U23IR6bdNFpsSfnjbBRWg/7d63da63229f0c4889eba72b4d21bc9d/image1-15.png" />
            
            </figure><p>IBM and Cloudflare have partnered together for years to provide a single pane of glass view for our customers. This new enhanced integration means that QRadar SIEM customers can ingest Cloudflare logs directly from Cloudflare’s Logpush product. QRadar SIEM also continues to support customers who are leveraging existing integration via S3 storage.</p><p>For more information about how to use this new integration, refer to the <a href="https://www.ibm.com/docs/en/dsm?topic=configuration-cloudflare-logs">Cloudflare Logs DSM guide</a>. Also, check out the blog post on the <a href="https://community.ibm.com/community/user/security/blogs/gaurav-sharma/2022/03/07/beyondthedsmguide-qradar-cloudflare-integration">QRadar Community blog</a> for more details!</p> ]]></content:encoded>
            <category><![CDATA[Security Week]]></category>
            <category><![CDATA[Logs]]></category>
            <category><![CDATA[Analytics]]></category>
            <category><![CDATA[Guest Post]]></category>
            <guid isPermaLink="false">6GxLJgfX1YTdqaAlUPMHoi</guid>
            <dc:creator>Tanushree Sharma</dc:creator>
            <dc:creator>Gaurav Gyan Sharma (Guest Author)</dc:creator>
        </item>
        <item>
            <title><![CDATA[All the Platform Improvements We’ve Made in 2021 to Make CIOs Lives Easier]]></title>
            <link>https://blog.cloudflare.com/platform-improvements-in-2021-to-make-cio-lives-easier/</link>
            <pubDate>Sat, 11 Dec 2021 13:59:10 GMT</pubDate>
            <description><![CDATA[ While over time best practices and technologies change, we aim to ensure our platform meets the security needs and depth of control that our customers require. In that spirit, we have been busy over the past year delivering important updates to many of our platform services. ]]></description>
            <content:encoded><![CDATA[ 
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2LRi9MnyfHjmj1fohS4RwS/25b6ca9388baa69ea1525478cb96c446/image1-67.png" />
            
            </figure><p>CIO week has been packed with new product innovations to give CIOs the tools they need to secure, protect, and speed up their networks. At Cloudflare, we know that many of the things that matter to CIOs are not just new product announcements — but the improvements to the security and usability of the platform itself. They’re much less visible, but no less important to ensuring our customers can reliably use the growing set of services we provide in a standard and secure manner. While over time best practices and technologies change, we aim to ensure our platform meets the security needs and depth of control that our customers require. In that spirit, we have been busy over the past year delivering important updates to many of our platform services.</p>
    <div>
      <h3>Improved SSO Onboarding</h3>
      <a href="#improved-sso-onboarding">
        
      </a>
    </div>
    <p>Customers need SSO to ensure they can securely control which applications employees can access. Our original iteration of SSO was manual and could be time consuming or error prone for customers to set up. We have <a href="https://developers.cloudflare.com/cloudflare-one/applications/configure-apps/dash-sso-apps">streamlined the setup process</a> by leveraging SaaS Applications in Cloudflare Access to allow customers to manage their SSO setup inside the <a href="https://dash.teams.cloudflare.com/">Cloudflare for Teams dashboard</a>. If you are an enterprise customer and are not yet getting the benefits of SSO, reach out to your account team so we can get you set up. Look forward to us further deepening control of user management when using SSO next year.</p>
    <div>
      <h3>Zone Scoped Roles Beta</h3>
      <a href="#zone-scoped-roles-beta">
        
      </a>
    </div>
    <p>Many customers keep both production and testing/staging zones in one account. This provides benefits for managing configuration given everything is in the scope of one account. A common issue that customers would run into though was that they wanted to handle access to critical production zones differently than their other zones. We now have a beta program available for customers to try out setting up zone scoped roles for members in this account. With Zone Scoped Roles, users can be granted access to a subset of the zones in an account. This means edit access to production zones can be limited to only those who truly need it. At the same time, everyone else can retain read only access, so they are not blocked from investigations. Again, for customers who want to try Zone Scoped Roles out, reach out to your account team for getting access to the beta.</p>
    <div>
      <h3>Terraform Improvements</h3>
      <a href="#terraform-improvements">
        
      </a>
    </div>
    <p>Customers continue to invest in automation in order to streamline management of Cloudflare and other providers. For many, Terraform is their go to solution to give them a single way to manage the multiple services they use every day. Cloudflare continues to invest in Terraform support for our services to ensure customers’ success.</p><ul><li><p>In 2021, we added 10 new resources, growing the list to <a href="https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs">51 resources</a>.</p></li><li><p>This included major additions to the platform like our <a href="https://developers.cloudflare.com/ruleset-engine/">ruleset engine</a> which powers features like <a href="https://developers.cloudflare.com/rules/transform">Transform Rules</a>, <a href="https://developers.cloudflare.com/waf/managed-rulesets">Managed WAF Rulesets</a>, and <a href="https://developers.cloudflare.com/ddos-protection/managed-rulesets">Managed DDoS Rulesets</a></p></li><li><p>We released a <a href="/cloudflares-partnership-with-hashicorp-and-bootstrapping-terraform-with-cf-terraforming/">major update</a> to <a href="https://github.com/cloudflare/cf-terraforming">cf-terraforming</a>, our library for quickly generating Terraform configuration and state for existing Cloudflare customers getting started with Terraform</p></li><li><p>More resources are now supported and we re-worked the interface for easier use.</p></li></ul>
    <div>
      <h3>Notifications and Alerts</h3>
      <a href="#notifications-and-alerts">
        
      </a>
    </div>
    <p>Cloudflare continues to invest heavily in giving customers the ability to know exactly what's happening as soon as it happens for their services behind Cloudflare. We have a great write up <a href="/p/994d43fd-0267-4d17-a0e9-dc9ddcb356b2/blog.cloudflare.com/whats-new-with-notifications/">today</a> on the improvements, but here is a quick list of the improvements:</p><ul><li><p>New Notification Types</p></li><li><p>DDoS Alerts</p></li><li><p>Firewall Alerts</p></li><li><p>Workers CPU</p></li><li><p>Origin 5XX Errors</p></li><li><p>New Webhook Destinations</p></li><li><p>DataDog, Discord, OpsGenie, and Splunk</p></li><li><p>This is in addition to Slack, Microsoft Teams, Google Chat, and custom destinations.</p></li><li><p><a href="https://api.cloudflare.com/#notification-history-properties">Alert History</a> is now available via API and with UI support coming soon.</p></li></ul><p>Again, if you’d like to see all the details of the improvements we’ve made, jump over <a href="/p/994d43fd-0267-4d17-a0e9-dc9ddcb356b2/blog.cloudflare.com/whats-new-with-notifications/">here</a>!</p>
    <div>
      <h3>Data Protection and Locality</h3>
      <a href="#data-protection-and-locality">
        
      </a>
    </div>
    <p>It’s been increasingly important for our customers to address requirements around data locality. We’ve built out capabilities that give customers control over where their data is processed and stored through the <a href="/introducing-the-cloudflare-data-localization-suite/">Data Localization Suite</a>.</p><p>In the EU, the recent “Schrems II” decision resulted in additional requirements for companies that transfer personal data outside the EU. And a number of highly regulated industries require that specific types of personal data stay within the EU’s borders.</p><p>Cloudflare is committed to helping our customers keep personal data in the EU. This week, <a href="/introducing-the-customer-metadata-boundary/">we introduced the Customer Metadata Boundary</a>, which expands the Data Localisation Suite to ensure that a customer’s end user traffic metadata stays in the EU.</p>
    <div>
      <h3>Logs</h3>
      <a href="#logs">
        
      </a>
    </div>
    <p>Cloudflare’s logs provide our customers with visibility into their network. This past year, we’ve expanded logging for more of our products, and given customers more control over where they can send their logs.</p><p>Recept expansions to logs include Firewall Events, Gateway, Spectrum. The most recent is Audit logs.</p><p>We’ve added the option for customers to store their logs on any platform with an S3-compatible API and partnered with major analytics providers to create integrations. This opened the doors for a lot of our customers to directly integrate with their log destinations of choice. Read more about the new products and destinations we support <a href="/logpush-ui-update/">here</a>. This week we announced that we’re building support for another log storage destination - <a href="/store-your-cloudflare-logs-on-r2/">R2</a>!</p>
    <div>
      <h3>The Dogfood Advantage</h3>
      <a href="#the-dogfood-advantage">
        
      </a>
    </div>
    <p>Whenever the opportunity arises, any products that we create for our customers, we’re first in line to use ourselves. It keeps us honest — if there are gaps in our solution, we’re going to have our own CIO, CISO, or engineering teams breathing down our neck!</p><p>Our public facing sites (including the blog that you’re reading this on) are secured with Cloudflare. We’re just as excited about the additional security provided by Zone Scoped Roles, as our customers are! Our security and IT organizations have adopted Terraform in order to manage the security and access control of our internal applications at scale, while giving developers the ability to self-serve request changes. Cloudflare’s security team also uses logs from our services behind Cloudflare to monitor and detect malicious behavior.</p><p>By doing things just like our customers do, we build empathy for the same kinds of problems our customers may face using our services. We continue to focus on not only innovating to solve unique problems for our customers, but also taking steps to build products that make our platform a better overall experience to use.</p> ]]></content:encoded>
            <category><![CDATA[CIO Week]]></category>
            <guid isPermaLink="false">6Dsg4Shdnvkd4X6nwMT10e</guid>
            <dc:creator>Garrett Galow</dc:creator>
            <dc:creator>Tanushree Sharma</dc:creator>
        </item>
        <item>
            <title><![CDATA[Store your Cloudflare logs on R2]]></title>
            <link>https://blog.cloudflare.com/store-your-cloudflare-logs-on-r2/</link>
            <pubDate>Tue, 07 Dec 2021 13:59:42 GMT</pubDate>
            <description><![CDATA[ We're excited to announce that customers will soon be able to store their Cloudflare logs on Cloudflare R2 storage. Storing your logs on Cloudflare will give CIOs and Security Teams an opportunity to consolidate their infrastructure; creating simplicity, savings and additional security. ]]></description>
            <content:encoded><![CDATA[ 
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6q2ecJTQQuYwhfby8PlIwY/8541c695f397ad88ff1534777cdf382a/unnamed-4.png" />
            
            </figure><p>We're excited to announce that customers will soon be able to store their Cloudflare logs on <a href="www.cloudflare.com/developer-platform/r2/">Cloudflare R2 storage</a>. Storing your logs on Cloudflare will give CIOs and Security Teams an opportunity to <a href="https://www.cloudflare.com/cio/">consolidate their infrastructure</a>; creating simplicity, savings and additional security.</p><p>Cloudflare protects your applications from malicious traffic, speeds up connections, and keeps bad actors out of your network. The logs we produce from our products help customers answer questions like:</p><ul><li><p>Why are requests being blocked by the Firewall rules I’ve set up?</p></li><li><p>Why are my users seeing disconnects from my applications that use Spectrum?</p></li><li><p>Why am I seeing a spike in Cloudflare Gateway requests to a specific application?</p></li></ul><p>Storage on R2 adds to our existing suite of logging products. Storing logs on R2 fills in gaps that our customers have been asking for: a cost-effective solution to store logs for any of our products for any period of time.</p>
    <div>
      <h3>Goodbye to old school logging</h3>
      <a href="#goodbye-to-old-school-logging">
        
      </a>
    </div>
    <p>Let’s rewind to the early 2000s. Most organizations were running their own self-managed infrastructure: network devices, firewalls, servers and all the associated software. Each company has to manage logs coming from hundreds of sources in the IT stack. With dedicated storage needed for retaining an endless volume of logs, specialized teams are required to build an ETL pipeline and make the data actionable.</p><p>Fast-forward to the 2010s. Organizations are transitioning to using managed services for their IT functions. As a result of this shift, the way that customers collect logs for all their services have changed too. With managed services, much of the logging load is shifted off of the customer.</p><p>The challenge now: collecting logs from a combination of managed services, each of which has its own quirks. Logs can be sent at varying latencies, in different formats and some are too detailed while others not detailed enough. To gain a single pane view of their IT infrastructure, companies need to build or buy a <a href="https://www.cloudflare.com/learning/security/what-is-siem/">SIEM</a> solution.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/PCMvAvpkvBostvlml5Rld/ed0c88237d8748b192f30379bc3cbed1/Log-storage-diagram.png" />
            
            </figure><p>Logging changes over the years</p><p>Cloudflare replaces these sets of managed services. When a customer onboards to Cloudflare, we make it super easy to gain visibility to their traffic that hits our network. We’ve built analytics for many of our products, such as CDN, Firewall, Magic Transit and Spectrum to both view high level trends and dig into patterns by slicing and dicing data.</p><p>Analytics are a great way to see data at an aggregate level, but we know that raw logs are important to our customers as well, so we’ve built out a set of logging products.</p>
    <div>
      <h3>Logging today</h3>
      <a href="#logging-today">
        
      </a>
    </div>
    <p>During <a href="/instant-logs/">Speed Week</a> we announced Instant Logs to show customers traffic as it hits their domain. Instant Logs is perfect for live debugging and triaging use cases. Monitor your traffic, make a config change and instantly view its impacts. In cases where you need to retroactively inspect your logs, we have Logpush.</p><p>We’ve built an impressive logging pipeline to get data from the 250+ cities that house our data centers to our customers in under a minute using Logpush. If your organization has existing practices for getting data across your stack into one place, we support Logpush to a variety of cloud storage or SIEM destinations. We also have partnerships in place with major SIEM platforms to surface Cloudflare data in ways that are meaningful to our customers.</p><p>Last but not least is Logpull. Using Logpull, customers can access HTTP request logs using our REST API. Our customers like Logpull because it's easy to configure, they don’t have to worry about storing logs on a third party, and you can pull data ad hoc for up to seven days.</p>
    <div>
      <h3>Why Cloudflare storage?</h3>
      <a href="#why-cloudflare-storage">
        
      </a>
    </div>
    <p>The top four requests we’ve heard from customers when it comes to logs are:</p><ul><li><p>I have tight budgets and need low cost log storage.</p></li><li><p>They should be low effort to set up and maintain.</p></li><li><p>I should be able to store logs for as long as I need to.</p></li><li><p>I want to access my logs on Cloudflare for any product.</p></li></ul><p>For many of our customers, Cloudflare is one of the most important data sources, and it also generates more data than other applications on their IT stack. R2 is significantly cheaper than other cloud providers, so our customers don’t need to compromise by sampling or leaving out logs from products all together in order to cut down on costs.</p><p>Just like the simplicity of Logpull, log storage on R2 will be quick and easy. With a one click setup, we’ll store your logs, and you don’t have to worry about any configuration details. Retention is totally in our customer’s control to match the security and compliance needs of their business. With R2, you can also store your logs for any products we have logging for today (and we’re always adding more as our product line expands).</p>
    <div>
      <h3>Log storage; we’re just getting started</h3>
      <a href="#log-storage-were-just-getting-started">
        
      </a>
    </div>
    <p>With log storage on Cloudflare, we’re creating the building blocks to allow customers to perform log analysis and forensics capabilities directly on Cloudflare. Whether conducting an investigation, responding to a support request or addressing an incident, using analytics for a birds eye view and inspecting logs to determine the root cause is a powerful combination.</p><p>If you’re interested in getting notified when you can store your logs on Cloudflare, sign up through this <a href="https://forms.gle/x24NKoMF8rJBJPpU7">form</a>.</p><p>We’re always looking for talented engineers to take on the challenges of working with data at an incredible scale. If you’re interested <a href="https://boards.greenhouse.io/cloudflare/jobs/2103918?gh_jid=2103918">apply here</a>.</p> ]]></content:encoded>
            <category><![CDATA[CIO Week]]></category>
            <category><![CDATA[Logs]]></category>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Storage]]></category>
            <category><![CDATA[undefined]]></category>
            <guid isPermaLink="false">31g0hcyo4g0BZnWK0oC5ut</guid>
            <dc:creator>Tanushree Sharma</dc:creator>
        </item>
    </channel>
</rss>