Zuplo Changelog
We release improvements, new features, and fixes daily. Follow along here to see the most important updates.
This release introduces significant enhancements to request handling, CLI authentication, logging capabilities, and observability. Key features include a new pre-routing hook for request manipulation before routing, enhanced CLI authentication supporting both Auth0 and API Key methods, custom log fields across all logging plugins, and improved tracing for programmatically invoked policies.
New Features 🎉#
-
Pre-routing hook - Introduces a powerful new hook that allows you to manipulate incoming requests before routing checks are performed. This enables use cases like making URLs case-insensitive or normalizing URL paths. Learn more about pre-routing hooks
-
Custom log fields for all logging plugins - All logging plugins now support a
fields
option that allows you to append custom fields to every log entry. This enhancement enables better log enrichment and correlation across your observability stack. See custom log fields documentation -
Tracing for programmatically invoked policies - Policies that are invoked programmatically now include proper tracing information, improving observability and debugging capabilities when policies call other policies within your API gateway. Learn about API monitoring with OpenTelemetry
Bug Fixes 🐛#
- Enhanced error handling - Strengthened error handling checks for the
throwOnError
configuration option, ensuring more predictable behavior when errors occur in your API gateway.
Documentation 📚#
- CLI command consistency - Updated the CLI documentation and commands to
consistently use
zuplo
instead of the shortenedzup
command, improving clarity and consistency across all documentation.
The new Pre-Routing Hook allows you to manipulate an incoming request before it's checked for routing. For example, if you want all routes to be case insensitive you could just lowercase the URL as it comes into the gateway, as shown below:
runtime.addPreRoutingHook(async (request) => {
const nr = new Request(request.url.toLowerCase(), request);
return nr;
});
Another example would be URL path normalization to remove trailing slashes:
runtime.addPreRoutingHook(async (request) => {
const url = new URL(request.url);
if (url.pathname.length > 1 && url.pathname.endsWith("/")) {
url.pathname = url.pathname.slice(0, -1);
const nr = new Request(url, request);
return nr;
}
return request;
});
Keep in mind that this will run on all requests so the code you use here needs to be appropriately performant and aware it can generate weird downstream effects by changing URLs and headers.
The method is async but reading and manipulating the request body is not recommended for performance reasons.
A new fields
option is now available across all
logging plugins. This addition
enables you to append arbitrary custom fields to each log entry, providing
additional context and information in your logs.
For example, using our Google Cloud Logging plugin:
import {
RuntimeExtensions,
GoogleCloudLoggingPlugin,
environment,
} from "@zuplo/runtime";
export function runtimeInit(runtime: RuntimeExtensions) {
runtime.addPlugin(
new GoogleCloudLoggingPlugin({
logName: "projects/my-project/logs/my-api",
serviceAccountJson: environment.GCP_SERVICE_ACCOUNT,
fields: {
myCustomField: "value",
anotherCustomField: "value2",
},
}),
);
}
You can use this feature to include relevant metadata, application-specific details, or contextual information that may be useful for debugging or analysis purposes.
This release includes improvements to the local development experience with increased body size limits in the route designer and bug fixes.
New Features 🎉#
- Increased body limit in local route designer - The maximum request body size limit has been increased in the local route designer, allowing developers to test APIs with larger payloads during development.
Bug Fixes 🐛#
- Project template creation improvements - Fixed an issue where creating a project from a template would fail if the source control access token was not properly validated. The system now correctly checks for and handles access token availability during template-based project creation.
This release includes improvements to logging stability and performance.
Bug Fixes 🐛#
-
Fixed OpenTelemetry fetch instrumentation issue - Resolved an issue with OpenTelemetry outgoing fetch instrumentation that could cause unexpected behavior in distributed tracing. This fix ensures proper trace context propagation for outgoing HTTP requests.
-
Improved log ordering - Fixed an issue where logs could appear out of order in certain scenarios. Logs now maintain their correct chronological sequence for better debugging and monitoring.
When your API throws an error in local development, you will now see a formatted output that includes the error message and stack trace in a more readable format. This will help you quickly identify the issue and debug your application.