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

推荐订阅源

freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
G
Google Developers Blog
Hugging Face - Blog
Hugging Face - Blog
博客园 - 【当耐特】
S
SegmentFault 最新的问题
宝玉的分享
宝玉的分享
博客园 - Franky
博客园_首页
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
WordPress大学
WordPress大学
有赞技术团队
有赞技术团队
月光博客
月光博客
博客园 - 聂微东
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
小众软件
小众软件
Microsoft Security Blog
Microsoft Security Blog
Last Week in AI
Last Week in AI
Vercel News
Vercel News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
爱范儿
爱范儿
J
Java Code Geeks
博客园 - 叶小钗
Engineering at Meta
Engineering at Meta
阮一峰的网络日志
阮一峰的网络日志

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
Focus on code that matters with source code previews in C...
Pierre-Yves Bigourdan · 2024-06-14 · via Datadog | The Monitor blog
Pierre-Yves Bigourdan

Pierre-Yves Bigourdan

The use of code profiling to troubleshoot application performance can appear daunting to the uninitiated, and many software engineers even assume that this domain is reserved for niche specialists. But here at Datadog, one of the key goals for our Continuous Profiler product has been to take this seemingly intimidating practice of code profiling and make it more accessible to engineers at all levels.

One area of improvement we are particularly focused on is making visualizations more intuitive. For example, even though flame graphs are a common way to visualize profiling data in the industry, we have seen that engineers who investigate them often get blocked in their troubleshooting journeys. This happens for a number of reasons. First, it’s challenging for many to figure out what the cells in flame graphs represent. But even when users understand that each cell maps to an element in the call stack and that a cell’s relative width corresponds to resource usage, the format used to identify code can still be hard to interpret. And then, once users spot a particular cell that reveals a performance issue, it’s tedious to switch contexts and connect that cell back to any particular block of source code to review.

To help address this problem and make it easier for engineers to connect flame graphs to their next troubleshooting steps, we are introducing source code previews in Continuous Profiler. This feature contextualizes profiling data by linking individual cells in flame graphs to information that software engineers can immediately recognize and relate to—the source code of their applications. This isn’t limited to first-party code. Continuous Profiler can also surface previews for commonly used open source libraries, so engineers can diagnose performance bottlenecks even when the issue lies outside their codebase.

Enabling source code previews

To begin to enable source code previews, you first need to set up Datadog’s source code integration, which allows you to connect your telemetry with your Git repositories. To do so, either follow the language-specific instructions to associate the repository and hash for the build artifacts, or use our in-app setup page to guide you through the installation steps.

Continuous Profiler supports source code previews for both your own application code and open source libraries. After configuring Datadog’s source code integration, you can link profiling data directly to your Git repositories and build artifacts to preview the exact code running in your environment. This makes it easy to understand where time or resources are spent and quickly move from a flame graph to the relevant lines of code.

Additionally, previews for many popular open source libraries are available automatically, with no additional per-library setup required. This built-in functionality helps you diagnose performance bottlenecks even when the issue originates in third-party dependencies. It also helps you better understand how your application interacts with those third-party dependencies.

Viewing source code previews

Once you have set up Datadog’s code integration, hover over a flame graph cell within a profile. If prompted to do so in the tooltip (as shown in the example below), press the Option key (or the Alt key in Windows) to enable the source code preview feature.

Tooltip to enable source code preview by pressing the Option key

Once the feature is enabled, hovering over a cell will reveal the associated code.

Tooltip displaying snippet of code associated with flamegraph cell

Grouping by line for more granular insights

By default, each cell in the flame graph corresponds to a method, and the code preview highlights the most impactful line in the method. If you want more granular information about the impact of individual lines of code, you can switch the Group by value from Method to Line. This will display the most impactful lines of code as individual cells, and the code preview will highlight the code surrounding that line.

Troubleshoot code performance more efficiently with source code previews

Source code previews are available for services written in Java, Python, Node.js, Go, Ruby, and .NET. We plan to keep enhancing the capabilities of code previews to make your troubleshooting journeys easier, so look out for new features, such as the ability to interact with and scroll through code previews.

For more information about our Continuous Profiler product, check out our product documentation. And if you’re not yet a Datadog customer, feel free to sign up for a 14-day free trial to get started.