惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
SegmentFault 最新的问题
爱范儿
爱范儿
博客园 - Franky
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
雷峰网
雷峰网
酷 壳 – CoolShell
酷 壳 – CoolShell
IT之家
IT之家
有赞技术团队
有赞技术团队
美团技术团队
Last Week in AI
Last Week in AI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
The Cloudflare Blog
Jina AI
Jina AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Engineering at Meta
Engineering at Meta
T
Tailwind CSS Blog
J
Java Code Geeks
Martin Fowler
Martin Fowler
I
InfoQ
小众软件
小众软件
MongoDB | Blog
MongoDB | Blog

Datadog | The Monitor blog

Introducing our open source AI-native SAST Instrument and monitor Boomi integration flows with OpenTelemetry and Datadog Not all index scans are equal: How we cut query latency by over 99% Platform engineering metrics: What to measure and what to ignore Integrate Recorded Future threat intelligence with Datadog Cloud SIEM CI/CD security: threat modeling using a MITRE-style threat matrix CI/CD security: How to secure your GitHub ecosystem Ingress NGINX is EOL: A practical guide for migrating to Kubernetes Gateway API Operating agentic AI with Amazon Bedrock AgentCore and Datadog LLM Observability: Lessons from NTT DATA Introducing the Datadog Code Security MCP Capture and analyze custom heatmaps in Session Replay Understand session replays faster with AI summaries and smart chapters Monitor ClickHouse query performance with Datadog Database Monitoring How we designed empathetic alert sounds for on-call engineers Search and act across Datadog to resolve issues faster with Bits Assistant Measure the business impact of every product change with Datadog Experiments Analyzing round trip query latency Configuring JavaScript caches for better performance Introducing Bits AI Dev Agent for Code Security Datadog achieves ISO 42001 certification for responsible AI Monitor Nutanix clusters, hosts, and VMs with Datadog Monitor Juniper Mist in Datadog A new Host Map for modern infrastructure Annotate traces to improve LLM quality with Datadog LLM Observability What’s new in Cloud SIEM: AI-powered investigations, enhanced threat intelligence, and scalable security operations Explore Kubernetes with native OpenTelemetry data Monitor Oracle Fusion Cloud Applications with Datadog Announcing the Datadog Terraform provider v4.0.0 Scaling Kubernetes workloads on custom metrics How to design cloud environments for AI-powered threat analysis
Trace AWS event-driven serverless applications with Datad...
2021-03-09 · via Datadog | The Monitor blog
Alex Cuoci

Alex Cuoci

Kai Xin Tai

Kai Xin Tai

Last year, we released native tracing for AWS Lambda through Datadog APM to provide deep visibility into serverless functions and surface performance issues such as cold starts and errors, without any added latency. But Lambda functions are only one piece of the puzzle in a rapidly growing serverless ecosystem, which includes message queues, data streams, notification services, and more. Developers often find themselves managing hundreds of loosely coupled components that power event-driven workloads, making it difficult to trace which components were involved in any given request.

Now, with Datadog APM's enhanced AWS serverless tracing capabilities, Lambda functions and AWS managed services are automatically connected in a single trace.

To effectively debug event-driven serverless applications, you need to understand where an issue occurred—and how upstream and downstream services were involved. That’s why today, we’re excited to announce that Datadog APM now connects Python and Node.js Lambda functions to AWS managed services all in one trace. Datadog also now tags your function spans with additional information about incoming events, which you can use to quickly search, filter, and aggregate your data when troubleshooting issues.

See Lambda functions and their triggers in a single trace

With our latest enhancements to APM, even if a request triggers multiple functions and services such as Amazon SQS and Amazon Kinesis in an event-driven architecture, Datadog will follow the entire request from end to end and tie all the components together in a single trace. This way, if you notice a spike in Lambda errors or latency, you can easily identify the root cause (e.g., malformed requests) from the exact service that triggered the function. If the triggering resource is Amazon API Gateway, Datadog also captures the incoming endpoint’s URL path, request method, and status code.

Datadog brings your distributed traces into the same view as your infrastructure metrics and logs to provide detailed context around your event-driven architecture. Once you determine the scope of an issue—and how it affects your end users—you can prioritize fixes more strategically. For example, you may decide to fix issues in the services that support business-critical functionalities first before addressing those that run less time-sensitive tasks (e.g., cron jobs).

Datadog APM in action

Let’s take a look at an example of how Datadog supports application-centric troubleshooting in an AWS serverless environment. Say we have a Node.js Express application for a theme park deployed on a Lambda function. With this application, users can purchase tickets, view ride information, get notified about wait times, and more. When we get alerted to elevated latency in our function, we start by navigating to the Serverless view and inspecting details of every invocation.

In Datadog's Serverless View, you can see all of your Lambda function's details, including its invocations, errors, and execution duration.

To dig deeper, we can navigate to the trace for a particularly slow invocation to see which other functions and services were involved in the same request. In this example, we can see that this invocation was the first in a sequence of Lambda functions connected by Amazon SQS and Amazon SNS. If we take a look at the function_trigger and http sections of the Tags tab, we can see that our Lambda function was invoked by a GET request from API Gateway to the /dev/checkout/cart endpoint. If we notice that the Lambda function latency is healthy when triggered by other endpoints, that may mean that there is an issue in the application code processing GET requests to the /dev/checkout/cart endpoint. In other words, while customers getting ride information are not impacted, others might be experiencing long page load times during checkout, which could result in abandoned carts and churn.

Datadog stitches together all functions and AWS managed services that served a request in a single trace, and provides additional metadata on function triggers in the tags section.

To determine if the issue with the /dev/checkout/cart endpoint is one-off or recurring, we can pivot over to Trace Analytics. With our new span tags (e.g., function_trigger.event_source, http.url_details.path), you can meaningfully filter, aggregate, and analyze your serverless application data to find any patterns or anomalies. In this case, we can graph this function’s duration by URL path, which tells us that requests to the /dev/checkout/cart path consistently took longer than other paths—a strong indicator that we should further investigate the handler for this endpoint in our Express application. Since dozens of endpoints may be connected to any given Amazon API Gateway, having this insight into which endpoint is problematic saves us valuable troubleshooting time.

In this example, we are using Trace Analytics to visualize function execution duration by URL path.

Get started with AWS serverless tracing

Datadog APM supports a variety of AWS managed services in applications written in Python and Node.js—and automatically propagates trace context through Amazon SQS and direct Lambda function invocations from AWS SDK without any changes to your code. For other AWS managed services, including Amazon SNS, Amazon EventBridge, Amazon Kinesis, and AWS IoT, see our documentation for instrumentation instructions.

If you have already set up AWS serverless tracing, all you need to do is upgrade your Lambda Library to v28+ for Python and v49+ for Node.js. Otherwise, follow the steps here to set up AWS serverless tracing with Datadog APM.

Our new approach to distributed tracing embraces the complexities of modern serverless applications to help you troubleshoot faster. By capturing the relationships between Lambda functions and other AWS managed services, Datadog APM gives you end-to-end visibility into your event-driven serverless applications to help you find and fix issues faster. If you’re not yet using Datadog, sign up for a 14-day free trial today.