---
title: "Automatic Instrumentation"
description: "Learn what's captured automatically after tracing is enabled."
url: https://docs.sentry.io/platforms/dart/tracing/instrumentation/automatic-instrumentation/
---

# Automatic Instrumentation | Sentry for Dart

Automatic instrumentation requires that you first [set up tracing](https://docs.sentry.io/platforms/dart/tracing.md) if you haven't already.

In stream mode, these instrumentations automatically switch to the streaming span API. No code changes are needed, except for the initial opt-in to stream mode. Learn more about [Streamed Spans](https://docs.sentry.io/platforms/dart/tracing/streamed-spans.md).

### [http.Client Library Instrumentation](https://docs.sentry.io/platforms/dart/tracing/instrumentation/automatic-instrumentation.md#httpclient-library-instrumentation)

The `http.Client` instrumentation, once added the `SentryHttpClient` and enabled the [performance](https://docs.sentry.io/platforms/dart/tracing.md) feature, starts a child span of the active span for each HTTP Request. The SDK sets the span `operation` to `http.client` and `description` to request `$METHOD $url`; for example, `GET https://sentry.io`.

The span finishes once the request has been executed. The span status is derived from the HTTP response code, or set to an error status if the code doesn't map to a known status.

When the HTTP request throws an `Exception`, Sentry's SDK associates this exception to the running span. If you haven't set the SDK to swallow the exception and capture it, the span and `SentryEvent` will be linked when viewing it on the **Issue Details** page in sentry.io.

For more information see our [SentryHttpClient integration](https://docs.sentry.io/platforms/dart/integrations/http-integration.md#performance-monitoring-for-http-requests).

### [Dio HTTP Library Instrumentation](https://docs.sentry.io/platforms/dart/tracing/instrumentation/automatic-instrumentation.md#dio-http-library-instrumentation)

The Dio instrumentation starts a child span of the active span for each HTTP request. The SDK sets the span `operation` to `http.client` and the `description` to request `$METHOD $url`. For example, `GET https://sentry.io`.

The span finishes once the request has been executed. The span status is derived from the HTTP response code, or set to an error status if the code doesn't map to a known status.

When the HTTP request throws an `Exception`, Sentry's SDK associates this exception to the running span. If you haven't set the SDK to swallow the exception and capture it, the span and `SentryEvent` will be linked when viewing it on the **Issue Details** page in [sentry.io](https://sentry.io).

Learn more in our [Dio integration documentation](https://docs.sentry.io/platforms/dart/integrations/dio.md#performance-monitoring-for-http-requests).

### [File I/O Instrumentation](https://docs.sentry.io/platforms/dart/tracing/instrumentation/automatic-instrumentation.md#file-io-instrumentation)

The Sentry-specific file I/O implementation starts a child span of the active span for each file I/O operation. The SDK sets the span `operation` to `file.copy`, `file.write`, `file.delete`, `file.open`, `file.read` or `file.rename`, and `description` to `filename` (for example, `file.txt`).

In addition, the span contains other useful information such as `file.size` (raw number of bytes), `file.path` (an absolute path to the file), and `file.async` (`true` if the called method returns a `Future`, or `false` if it's a `Sync` call) as additional span data.

The span finishes once the operation has been executed. The span status is set to a success status if it succeeds, or an error status if it fails.

When the operation throws an `Exception`, Sentry's SDK associates it with the running span. If you haven't set the SDK to swallow and capture the exception, the span and `SentryEvent` will be shown as linked on the **Issue Details** page in [sentry.io](https://sentry.io).

For more information see our [file I/O integration](https://docs.sentry.io/platforms/dart/integrations/file.md).
