> ## Documentation Index
> Fetch the complete documentation index at: https://wb-21fd5541-docs-3071-org-scoped-api-keys.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# createOtelExtension

> TypeScript SDK リファレンス

> **createOtelExtension**(`opts?`): (`pi`) => `void`

GenAI のセマンティック規約に準拠し、エージェントのライフサイクル全体にわたって OTEL スパンを送出する piコーディングエージェント拡張機能を作成します。

`weave.init(...)` が呼び出されている場合、スパンは自動的に Weave トレースサーバーの `/agents/otel/v1/traces` にエクスポートされます。そうでない場合は、`opts` にカスタム `tracer` を渡してください。

定義元: [src/integrations/piCodingAgent.ts:654](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/integrations/piCodingAgent.ts#L654)

<div id="parameters">
  ## パラメーター
</div>

<div id="opts">
  ### opts?
</div>

`OtelExtensionOptions` = `{}`

<div id="returns">
  ## 戻り値
</div>

(`pi`) => `void`

<div id="example">
  ## 例
</div>

```typescript twoslash theme={null}
// @noErrors
const resourceLoader = new DefaultResourceLoader({
  extensionFactories: [createOtelExtension()],
});
```
