Skip to content

Latest commit

 

History

History
136 lines (101 loc) · 8.02 KB

File metadata and controls

136 lines (101 loc) · 8.02 KB
title Bits Code
aliases
/bits_ai/bits_ai_dev_agent/
further_reading
link tag text
Blog
Automatically identify issues and generate fixes with Bits Code
link tag text
Blog
Introducing Bits Code for Code Security
link tag text
/account_management/billing/ai_credits/
Documentation
AI Credits

Overview

Bits Code is a generative AI coding assistant that uses Datadog observability data to automatically diagnose and fix issues in your code. It integrates with source code providers to create production-ready pull or merge requests, then iterates on changes using CI logs and developer feedback.

{{< img src="bits_ai/dev_agent/sessions_overview.png" alt="A tab titled 'Sessions' shows a text field with suggestions underneath" style="width:100%;" >}}

Each time Bits Code investigates an issue or generates a fix, it creates a session, which captures the agent's analysis, actions, and any resulting code changes across supported Datadog products. Set up automations to have Bits Code run sessions on a schedule or in response to signals from other Datadog products, such as a new APM Recommendation or flaky test.

To get started with Bits Code, set up a source code integration and complete any additional configuration. Then, start your first session.

Learn how your Bits Code usage is billed on AI Credits.

Supported source code providers

Bits Code supports the following source code providers:

The following plans are not supported:

Sessions

A session captures a segment of work with Bits Code, including its analysis and code changes. Start, view, and manage your sessions at Bits AI > Bits Code > Sessions.

{{< img src="bits_ai/dev_agent/code_fix.png" alt="A session showing a Bits AI summary and task list on the left and a code diff on the right" style="width:100%;" >}}

Start a session

After completing setup, do one of the following to start a Bits Code session:

A session can also be created when another Bits AI agent (like Bits Chat or Bits Investigation) hands off a coding task to Bits Code.

View and manage sessions

On Sessions, view your past sessions in the My Sessions panel. A session appears here if you initiated it or interacted with it in some way, like participating in the conversation or creating an associated PR or MR.

Click a session to view its details and continue working with Bits Code. To remove a session from your My Sessions list, click (Archive for everyone) or (Unwatch session).

Supported Datadog products

Bits Code can suggest code improvements within several Datadog products, including the following:

Product Capabilities
APM Proposes code changes for relevant APM Recommendations
Bits Investigation Generates code remediations based on Bits Investigations
Bits Chat Suggests code changes arising from Bits Chat conversations
Cloud Cost Generates code changes for Cloud Cost Recommendations
Error Tracking Diagnoses issues and generates code fixes on-demand or autonomously
Code Security Remediates SAST vulnerabilities, IaC vulnerabilities, and SCA vulnerabilities (individually or in bulk)
Test Optimization Provides code fixes for flaky tests and verifies that tests remain stable
Continuous Profiler Provides code changes for Automated Analysis insights
Containers Provides code changes for Kubernetes Remediations

Key capabilities

Code fixes and optimizations surfaced by Datadog products

Across supported Datadog products, use Bits Code to implement optimizations and fixes—for example, Cloud Cost Recommendations, Error Tracking issues, and SAST vulnerabilities. In certain products, Bits Chat explores and investigates issues, then hands off its findings to Bits Code to implement a code change.

{{< img src="bits_ai/dev_agent/fix_with_bits.png" alt="A button labeled with the text 'Fix with Bits.'" style="width:25%" >}}

You can manually prompt Bits Code to implement changes for a certain finding, or configure an automation so that it does so autonomously.

General coding tasks

Use the freeform prompt field at Sessions to work with Bits Code on general coding tasks.

Automations

Automations run Bits Code sessions automatically, on a schedule or in response to signals from Datadog products like Error Tracking, APM, or Code Security. After a session completes, Bits Code delivers the results as a pull or merge request (optionally in draft mode) or a Slack notification.

You can build automations from triggers (a product finding, a custom prompt, a schedule, or a combination) and configure one or more outputs. Datadog-provided templates are also available to help you get started. Create and manage automations at Bits AI > Bits Code > Automations.

Pull or merge request collaboration

Bits Code integrates with source code providers to:

  • Create pull or merge requests, generating titles and descriptions based on your repository's pull or merge request template
  • Iterate on pull or merge requests in response to comments; mention @Datadog in a comment to prompt Bits for updates
  • Monitor CI logs and fix failures

Bits Code never auto-merges PRs or MRs. See all the PRs or MRs that Bits Code is working on in Bits AI > Bits Code > Sessions.

Limitations

  • Bits Code is an AI product, which means it can make mistakes. Use best practices when reviewing and testing agent-generated code.
  • Bits Code does not support multi-repository investigations.

Further reading

{{< partial name="whats-next/whats-next.html" >}}