Ask any developer, and they will tell you that good and timely application telemetry is essential to building, maintaining, and optimizing apps. Without proper feedback, developers are left in the dark to identify logic errors, compliance issues, and areas for optimization. Application logging is a core part of the development process, providing key insights as code moves from concept to production. And for a long time, it has generally been a component missing from EdgeWorkers.
EdgeWorkers is the world's most distributed serverless edge computing platform, enabling developers to place business logic at the edge to reduce latency, speed response times, improve performance, and deliver a better user experience to customers around the globe.
We’re excited to share that EdgeWorkers observability just got a whole lot better! It’s been a few months since Akamai launched the integration between EdgeWorkers and DataStream, a free centralized data collection and delivery platform. With this new logging integration, developers can now set up logs for their mission-critical EdgeWorker workloads. As is standard with logging, there are multiple levels of verbosity available: trace, debug, info, warn, and error. Controlling the log levels provides flexibility and options for application developers to troubleshoot their EdgeWorkers logic.
Prior to launching the DataStream integration, EdgeWorker developers would debug their code and workflows using advanced headers and manual inspection, which is cumbersome, time-consuming, and error-prone, making it easy to miss key insights. Additionally, with full logging capabilities, developers can more easily detect anomalies that may not manifest in simple cURL requests.
One convenient DataStream integration feature is modifying log levels defined in EdgeWorkers code bundles without needing to edit and re-deploy code. Using log “overrides,” function logs can be toggled to set log level and verbosity as necessary, allowing users to only log errors until they need more granularity. The benefit is flexibility while controlling log volumes to avoid extra observability costs. See examples below to control log-level in the UI or by using the CLI.
Setting log-levels using the UI (without code redeployment)
Using the Akamai CLI, you can set the log level with a command similar to the following:
akamai ew log-level set 82236 production debug;
Since launching the integration, we’ve onboarded many of Akamai’s EdgeWorker customers who have configured application log streams. EdgeWorker customers can choose to send their log data to the destination of their choice, such as popular in-house observability tooling like Splunk, New Relic, and others. For a full and complete list of supported endpoints, refer to DataStream List of Destinations.
As many customers adopt this new capability, early feedback has been positive. One European gaming customer mentioned they used the new JavaScript logging to isolate problems with new business logic before going live. Another customer reinforced the criticality of having logs available, which resulted in faster problem discovery.
Below are the top destinations for EdgeWorker logging:
Top EdgeWorker DataStream Destinations
- AWS S3
- Splunk
- Datadog
- Google Cloud Storage
- HTTPS
- New Relic
- Azure Storage
- S3 Compatible storage (including Akamai’s Object Storage)
- TrafficPeak
- Sumo Logic
See the full list of supported end-points here: DataStream List of Destinations
Getting Started With EdgeWorker Logging
Setting up logging for your EdgeWorkers is straight-forward, assuming you’ve already added log messages to your bundle. First, make sure you have DataStream for EdgeWorkers on contract. It’s a free service, but requires the contract entitlement to enable. To add DataStream for EdgeWorkers, contact your account representative. Then, follow these steps to enable the service:
- Navigate to the DataStream service via the common services section of Control Center
- Select "Create an EdgeWorkers Stream"
- Give your stream a name
- Lastly, choose from the structured or JSON format and select the target destination.
That’s it! You are now ready to write your EdgeWorkers logging logic and, once activated, enable Datastream to consume it. To find out more, and for complete and step-by-step instructions, refer to the detailed documentation for enabling and configuring EdgeWorker logging streams. Please refer to the EdgeWorker JavaScript DataStream Setup page.
Here’s a look at some sample screenshots for setup:
Setting up the EW Log Stream
Configure log stream destination
What’s new and coming up for EdgeWorker observability?
Future improvement ideas include enabling an OpenTelemetry format, supporting data localization, and potentially allowing property-based streaming as opposed to. per EdgeWorker tracking. On a related note for observability, you can look for improvements within the EdgeWorkers execution reports found in the ACC portal, as we will soon be adding wall time tracking, initialization metrics, and streamlining reporting.
As always, if you have any questions, suggestions on how to improve EdgeWorker Observability, or any other area of the service, please contact your account representative or drop us a note in our community site, and happy logging!
Learn more about Akamai EdgeWorkers
Check out these Akamai resources to learn how Akamai EdgeWorkers can benefit your organization:
Tags