# withK6OtlpEnvironment

- Module: [CommunityToolkit.Aspire.Hosting.k6](/reference/api/typescript/communitytoolkit.aspire.hosting.k6.md)
- Version: `13.4.0`
- Kind: `method`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire)

Set K6 environment variables from the existing OTEL environment set for this resource. See https://grafana.com/docs/k6/latest/results-output/real-time/opentelemetry/#configuration.

## Definition

```typescript
interface K6Resource {
  // ... omitted for brevity
  withK6OtlpEnvironment(): K6Resource
}
```

## Returns

[K6Resource](/reference/api/typescript/communitytoolkit.aspire.hosting.k6/k6resource.md) `builder`

## Applies to

- [K6Resource](/reference/api/typescript/communitytoolkit.aspire.hosting.k6/k6resource.md)
