June 2022 Summaries
3 posts from Upstash
Filter
Month:
Year:
Post Summaries
Back to Blog
This tutorial provides a step-by-step guide on how to collect logs from Cloudflare Workers and send them to a Serverless Kafka setup using Upstash. It begins with setting up a Kafka cluster and topic through the Upstash Console or CLI, followed by configuring a project using Wrangler 2 for deployment, which includes initializing a new project directory, setting up package management, and creating necessary configuration files. The tutorial then details how to update the JavaScript code in `src/index.js` to send logs to Kafka using a webhook URL and offers options for using Upstash Kafka SDK or REST API. Testing and deployment instructions are provided, including local testing with `wrangler dev` and publishing the function to Cloudflare with `wrangler publish`, with guidance on verifying log collection in Kafka using a curl command.
Jun 14, 2022
305 words in the original blog post.
This tutorial explores how to connect to an Upstash Redis database using the go-redis client and monitor application performance through distributed tracing, utilizing tools like OpenTelemetry and Uptrace. It details the functionality of go-redis, a popular Redis client for Golang that supports Redis Server, Sentinel, and Cluster, and describes its use in caching data or rate-limiting API requests. The concept of distributed tracing is explained as a method to track requests across distributed systems, offering insights into system performance and issues. OpenTelemetry is introduced as a vendor-neutral standard for collecting and exporting traces, logs, and metrics, enabling interoperability across various programming languages and environments. The integration of OpenTelemetry with go-redis through the redisotel module is demonstrated, showing how to instrument the Redis client to create spans and record errors, which can then be visualized using Uptrace, an open-source alternative to DataDog. The tutorial concludes by encouraging further exploration of OpenTelemetry's capabilities for monitoring different application aspects, such as using additional instrumentations for frameworks like Gin or Go gRPC.
Jun 09, 2022
609 words in the original blog post.
The article provides a detailed guide on implementing rate limiting for Next.js API routes using the Upstash Rate Limit SDK. It begins with setting up a Redis database through Upstash and configuring a Next.js application to deploy on Vercel. The code section demonstrates how to integrate the Upstash libraries to create a rate limiter that restricts API requests to five per five seconds, using identifiers like a constant string, user ID, or IP address for individual limits. The guide also suggests running the application to observe the rate limiting in action and offers possible enhancements such as employing different algorithms like Sliding Window and Token Bucket for smoother rate limiting experiences, utilizing multiple Redis instances for applications in different regions, and securely storing Redis credentials.
Jun 07, 2022
378 words in the original blog post.