# IResourceWithEnvironment.withOtlpExporter

- Module: [Aspire.Hosting](/reference/api/typescript/aspire.hosting.md)
- Defined on: [IResourceWithEnvironment](/reference/api/typescript/aspire.hosting/iresourcewithenvironment.md)
- Version: `13.4.0`
- Kind: `method`

Configures OTLP telemetry export

## Definition

```typescript
interface IResourceWithEnvironment {
  // ... omitted for brevity
  withOtlpExporter(protocol?: OtlpProtocol): IResourceWithEnvironment;
}
```

## Signature

```typescript
withOtlpExporter(protocol?: OtlpProtocol): IResourceWithEnvironment
```

## Parameters

- `protocol` ([OtlpProtocol](/reference/api/typescript/aspire.hosting/otlpprotocol.md)) `optional`

## Returns

[IResourceWithEnvironment](/reference/api/typescript/aspire.hosting/iresourcewithenvironment.md) `builder`

## Defined on

- [IResourceWithEnvironment](/reference/api/typescript/aspire.hosting/iresourcewithenvironment.md) -- `interface`
