# WithSurrealDbOtlpExporter

- Module: [CommunityToolkit.Aspire.Hosting.SurrealDb](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb.md)
- Version: `13.6.1`
- Kind: `method`
- Defined on: [`SurrealDbServerResource`](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb/surrealdbserverresource.md)
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/tree/d9c2addac6f527ef2e33712d290b84574b455a3b)

Injects the appropriate environment variables to allow the resource to enable sending telemetry to the dashboard. 1. It sets the OTLP endpoint to the value of the DOTNET_DASHBOARD_OTLP_ENDPOINT_URL environment variable. 2. It sets the service name and instance id to the resource name and UID. Values are injected by the orchestrator. 3. It sets a small batch schedule delay in development. This reduces the delay that OTLP exporter waits to sends telemetry and makes the dashboard telemetry pages responsive.

## Definition

```go
func (SurrealDbServerResource) WithSurrealDbOtlpExporter() SurrealDbServerResource
```

## Returns

[`SurrealDbServerResource`](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb/surrealdbserverresource.md) -- The `IResourceBuilder`.

Returns a handle; failures surface later via `Err()`.

## Applies to

- [`SurrealDbServerResource`](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb/surrealdbserverresource.md)
