Send Temporal traces and metrics to Bronto via OpenTelemetry
Trace Temporal Workflows, Activities and the AI agents that run in them, and send Temporal SDK metrics to Bronto with OpenTelemetry.
Temporal runs Workflows durably: if a process crashes, the Workflow continues where it left off, and failed Activities are retried. That makes it a common runtime for long-running AI agents. With OpenTelemetry, you can see each Workflow in Bronto as one trace: the client that started it, the Workflow, every Activity attempt and, for agents, every model request and tool call.This page covers the Temporal Python, TypeScript and Go SDKs:
Traces from each SDK’s OpenTelemetry plugin or, in Go, its tracing interceptor
Metrics from each SDK’s metrics exporter or, in Go, its metrics handler
AI agents run on Temporal, built with the Claude Agent SDK (Python, TypeScript) or the Anthropic Go SDK (Go)
This page was verified on November 26, 2026 with temporalio 1.37.0, temporalio-claude-agent-sdk 0.0.3, claude-agent-sdk 0.2.168 (Claude Code 2.1.301), the OpenTelemetry Python SDK 1.45.2 and a local Temporal dev server (Temporal CLI 1.10.1). The TypeScript examples were verified on November 27, 2026 with @temporalio/* 1.27.0, @temporalio/interceptors-opentelemetry-v2 1.27.0, @anthropic-ai/claude-agent-sdk 0.3.332 (Claude Code 2.1.332), the OpenTelemetry JS SDK 2.12.1 and Node.js 24. The Go examples were verified on November 27, 2026 with go.temporal.io/sdk 1.52.0, go.temporal.io/sdk/contrib/opentelemetry 0.9.0, github.com/anthropics/anthropic-sdk-go 1.84.0, the OpenTelemetry Go SDK 1.47.0 and Go 1.27. GenAI libraries and semantic conventions are evolving rapidly, so package configuration and emitted attributes can change between releases. Keep your instrumentation current and verify the fields emitted by the version you deploy.
Prerequisites
Python 3.11+, Node.js 20+ or Go 1.26+, and the Temporal SDK for your language
A Temporal Service: Temporal Cloud, a self-hosted cluster or temporal server start-dev for local development
Via a Collector: point the application’s OTLP exporter at the Collector, then configure the Collector using Connect OpenTelemetry to Bronto. This is recommended in production.Direct export: point the exporter at the Bronto ingestion endpoint and add your API key:
The OpenTelemetry SDK appends /v1/traces. Give the Worker and the process that starts Workflows different service names, so you can tell them apart in a trace. See API Keys for how to create a key with ingestion permissions.In TypeScript, the OTLP trace exporter reads these variables. In Go, the OTLP trace and metric exporters both read them. The TypeScript and Go examples set the service name in code, in the tracer provider’s resource.
Register a tracer provider, then add the SDK’s OpenTelemetryPlugin to the client. Do this in every process that uses Temporal, both the Worker and the code that starts Workflows, so their spans join one trace:
Use create_tracer_provider() instead of the OpenTelemetry SDK’s TracerProvider. Workflow code can be replayed, and the provider it returns is replay-safe. Register it before Client.connect. A Worker created from the client uses the client’s plugins, so you don’t pass plugins to Worker again. Short-lived processes, such as a script that starts one Workflow, should call provider.force_flush() before they exit.
OpenTelemetryPlugin is marked experimental in temporalio 1.37.0. Older guides use TracingInterceptor from the same module. It still works, but its Workflow span has a duration of zero, so it doesn’t show how long the Workflow ran.
Create a tracer provider and a span processor, and pass them to the SDK’s OpenTelemetryPlugin. Do this in every process that uses Temporal, both the Worker and the code that starts Workflows, so their spans join one trace:
// instrumentation.tsimport { resourceFromAttributes } from '@opentelemetry/resources';import { ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions';import { BatchSpanProcessor } from '@opentelemetry/sdk-trace-base';import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node';import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-proto';export function setupTracing(serviceName: string) { const resource = resourceFromAttributes({ [ATTR_SERVICE_NAME]: serviceName }); // The exporter reads OTEL_EXPORTER_OTLP_ENDPOINT and OTEL_EXPORTER_OTLP_HEADERS. const spanProcessor = new BatchSpanProcessor(new OTLPTraceExporter()); const provider = new NodeTracerProvider({ resource, spanProcessors: [spanProcessor] }); provider.register(); return { resource, spanProcessor, provider };}
The plugin adds a client interceptor, an Activity interceptor and a sink that exports the spans of Workflow code. The Workflow sink uses the resource and spanProcessor you pass, so pass the same ones that the provider uses. Short-lived processes, such as a script that starts one Workflow, should call provider.forceFlush() and provider.shutdown() before they exit.Use @temporalio/interceptors-opentelemetry-v2 with the OpenTelemetry JS SDK 2.x. For SDK 1.x, use the older @temporalio/interceptors-opentelemetry package.
OpenTelemetryPlugin is marked experimental in the TypeScript SDK too.
go get go.temporal.io/sdk go.temporal.io/sdk/contrib/opentelemetry \ go.opentelemetry.io/otel go.opentelemetry.io/otel/sdk \ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp
The Go SDK has no OpenTelemetry plugin. Register a tracer provider, then add the SDK’s tracing interceptor from NewTracingInterceptor to the client. Do this in every process that uses Temporal, both the Worker and the code that starts Workflows, so their spans join one trace:
A Worker created from the client uses the client’s interceptors, so you don’t pass them to worker.Options again. Short-lived processes, such as a program that starts one Workflow, should call tp.ForceFlush(ctx) and tp.Shutdown(ctx) before they exit.Unlike Python’s older TracingInterceptor, the Go interceptor’s RunWorkflow span has a real duration.
Spans
One Workflow that runs two Activities, where charge_card fails once and succeeds on retry, produces this trace:
Python
TypeScript
Go
The Workflow trace in Bronto: 7 spans over 1.45 s, with the failed charge_card attempt and its retry
The Workflow trace in Bronto: 7 spans over 1.66 s, with the failed chargeCard attempt and its retry
The Workflow trace in Bronto: 8 spans over 1.08 s, with the failed ChargeCard attempt and its retry
The ask span at the root comes from the example’s own code that starts the Workflow, not from the interceptor.
In each trace, RunWorkflow is a child of StartWorkflow, StartActivity is a child of RunWorkflow, and each RunActivity attempt is a child of its StartActivity.Open Tracing and select the StartWorkflow:<Workflow type> operation to find Workflows, then open a trace to see the Workflow as a waterfall. Each Activity attempt is its own RunActivity span, so retries and the wait between them are visible. A failed attempt has an error status and an exception event with the error message.The TypeScript and Go SDKs produce the same trace. Span names use the function names of your Workflows and Activities, for example StartWorkflow:orderWorkflow and RunActivity:chargeCard in TypeScript, or RunActivity:ChargeCard in Go. In Go, the exception.type of a failed attempt is the Go error type, for example *errors.errorString.
A failed Activity attempt with its exception event and Temporal attributes
Python and Go
TypeScript
Spans
Notes
temporalWorkflowID
temporalWorkflowId on RunActivity, workflowId on RunWorkflow
RunWorkflow, RunActivity
The Workflow ID. Search for it to find all spans of one Workflow
temporalRunID
run_id on RunActivity, runId on RunWorkflow
RunWorkflow, RunActivity
The Run ID of the Workflow Execution
temporalActivityID
temporalActivityId
RunActivity
The Activity ID
In TypeScript, the RunWorkflow span also carries workflowType.The RunWorkflow span lasts from the start of the Workflow to its completion. The root StartWorkflow span ends when the Temporal Service accepts the start request, so its duration is the latency of that call, not of the Workflow.
Trace AI agents on Temporal
An agent on Temporal runs its model requests and tool calls from Workflow and Activity code, so they can join the Workflow’s trace. How you run the agent depends on the language.
Python
TypeScript
Go
Temporal’s Claude Agent SDK integration runs a Claude agent inside a Workflow. The agent runs in a Claude Code subprocess that the Worker starts from an Activity. Tools can call Activities, so a crash doesn’t lose the run. The integration doesn’t emit spans of its own, but OpenTelemetryPlugin passes the trace context to the Claude Code subprocess. With Claude Code’s telemetry turned on, its model requests and tool calls join the Workflow’s trace.
import asynciofrom datetime import timedeltafrom typing import Anyfrom claude_agent_sdk import ClaudeAgentOptions, ClaudeSDKClient, ResultMessage, create_sdk_mcp_server, toolfrom temporalio import activity, workflowfrom temporalio.claude_agent_sdk import ClaudeAgentSDKPlugin, TemporalTransportfrom temporalio.client import Clientfrom temporalio.contrib.opentelemetry import OpenTelemetryPluginfrom temporalio.exceptions import ApplicationErrorfrom temporalio.worker import Worker@activity.defnasync def fetch_weather(city: str) -> str: return f"It is 21 C and sunny in {city}."@tool("get_weather", "Get the current weather in a city", {"city": str})async def get_weather(args: dict[str, Any]) -> dict[str, Any]: text = await workflow.execute_activity(fetch_weather, args["city"], start_to_close_timeout=timedelta(seconds=30)) return {"content": [{"type": "text", "text": text}]}@workflow.defnclass WeatherAgent: @workflow.run async def run(self, prompt: str) -> str: options = ClaudeAgentOptions( model="claude-haiku-5-5", tools=[], setting_sources=[], mcp_servers={"demo": create_sdk_mcp_server("demo", tools=[get_weather])}, allowed_tools=["mcp__demo__get_weather"], ) async with ClaudeSDKClient(options=options, transport=TemporalTransport(options)) as client: await client.query(prompt) async for msg in client.receive_response(): if isinstance(msg, ResultMessage): # Failed runs also arrive as a ResultMessage. Raise, so they count as failed Workflows. if msg.is_error or msg.subtype != "success": raise ApplicationError(f"The agent run failed: {msg.subtype}") return msg.result or "" raise RuntimeError("The agent returned no result")async def main(): # Register the tracer provider as in the previous section, then: client = await Client.connect( "localhost:7233", plugins=[OpenTelemetryPlugin(add_temporal_spans=True), ClaudeAgentSDKPlugin()], ) worker = Worker(client, task_queue="agents", workflows=[WeatherAgent], activities=[fetch_weather]) await worker.run()if __name__ == "__main__": asyncio.run(main())
Start the event loop under if __name__ == "__main__": in any module that defines a Workflow. Temporal imports the module again in its Workflow sandbox to validate it.Turn on Claude Code’s trace export in the Worker’s environment. The Claude Code subprocess inherits it, together with the OTEL_EXPORTER_OTLP_* variables from Send traces and metrics to Bronto and ANTHROPIC_API_KEY:
Don’t pass these variables, or any API key, through ClaudeAgentOptions.env. The options are part of the Workflow’s input, so they’re stored in its Event History.
One agent run produces this trace (trimmed):
The agent trace in Bronto: 58 spans over 7.83 s. The top rows show the Workflow, the Claude Code subprocess and its model requests and tool call
The screenshot shows the first rows only. Below them the trace continues with sibling StartActivity and RunActivity spans for the tool, and the claude-agent-sdk-read, claude-agent-sdk-write and claude-agent-sdk-close Activities. The ask-agent span at the root comes from the example’s own code that starts the Workflow.The Workflow also runs claude-agent-sdk-read and claude-agent-sdk-write Activities to exchange messages with the subprocess. They show up as sibling spans under RunWorkflow.
Temporal doesn’t have a Claude Agent SDK integration for TypeScript. Run the agent from an Activity with @anthropic-ai/claude-agent-sdk, and pass the Activity’s trace context to the Claude Code subprocess in TRACEPARENT. Temporal retries the Activity if it fails, but the agent loop isn’t durable step by step: a retry starts the agent again.
// activities.tsimport { Context } from '@temporalio/activity';import { context, propagation } from '@opentelemetry/api';import { createSdkMcpServer, query, tool } from '@anthropic-ai/claude-agent-sdk';import { z } from 'zod';const getWeather = tool('get_weather', 'Get the current weather in a city', { city: z.string() }, async ({ city }) => ({ content: [{ type: 'text' as const, text: `It is 21 C and sunny in ${city}.` }],}));export async function runAgent(prompt: string): Promise<string> { // Hand the Activity's trace context to the Claude Code subprocess. Claude Code reads TRACEPARENT. const carrier: Record<string, string> = {}; propagation.inject(context.active(), carrier); const env: Record<string, string | undefined> = { ...process.env }; if (carrier.traceparent) env.TRACEPARENT = carrier.traceparent; const q = query({ prompt, options: { model: 'claude-haiku-5-5', tools: [], settingSources: [], mcpServers: { demo: createSdkMcpServer({ name: 'demo', tools: [getWeather] }) }, allowedTools: ['mcp__demo__get_weather'], maxTurns: 4, env, }, }); for await (const msg of q) { Context.current().heartbeat(); if (msg.type !== 'result') continue; // API errors can arrive with subtype 'success' and is_error set. Throw, so the Activity retries and counts as failed. if (msg.subtype === 'success' && !msg.is_error) return msg.result; throw new Error(`The agent run failed: ${msg.subtype}`); } throw new Error('The agent returned no result');}
// workflows.tsimport { proxyActivities } from '@temporalio/workflow';import type * as activities from './activities';const { runAgent } = proxyActivities<typeof activities>({ startToCloseTimeout: '5 minutes', retry: { maximumAttempts: 2 },});export async function weatherAgent(prompt: string): Promise<string> { return await runAgent(prompt);}
Register the Worker with OpenTelemetryPlugin as in the previous section. @anthropic-ai/claude-agent-sdk is ESM-only: compiling a CommonJS project that imports it with tsc fails. The examples were run with tsx.Claude Code inherits the environment you pass in env. Turn on its trace export in the Worker’s environment, together with the OTEL_EXPORTER_OTLP_* variables from Send traces and metrics to Bronto and ANTHROPIC_API_KEY. Set OTEL_SERVICE_NAME there for the Claude Code spans, for example claude-code. The Worker’s own spans use the service name from its tracer provider.
The Activity runs in the Worker, so options.env isn’t stored in the Workflow’s history. Keep secrets in the Worker’s environment anyway, and don’t pass them as Activity arguments.One agent run produces this trace:
The agent trace in Bronto: 11 spans over 11 s, from the Workflow to Claude Code's model requests and tool call
The tool runs in the Activity’s process, so there is no Workflow span for it.
There is no Claude Agent SDK for Go. Call the Claude API with the Anthropic Go SDK from an Activity. The SDK has built-in OpenTelemetry support: it creates an anthropic.messages.create span for each API call, as a child of the Activity span. It uses the tracer provider you registered with otel.SetTracerProvider, so you don’t need a separate instrumentation package.
Pass the Activity’s ctx to the API call, so the span joins the trace. Keep the API key in the Worker’s environment, not in Workflow input.One run produces this trace:
The agent trace in Bronto: 6 spans over 730 ms, ending in the Anthropic API call
The ask span at the root comes from the example’s own code that starts the Workflow. The last span, anthropic.messages.create, is the API call.
The span also carries your Anthropic organization and workspace IDs in anthropic.organization.id and anthropic.workspace.id. It has no ttft_ms or gen_ai.response.finish_reasons. There are no claude_code.tool spans: a Go agent’s tool calls are your own code, so run each tool as an Activity to get a RunActivity span for it. By default, the span contains no prompts or responses.
The Python and TypeScript agents run in Claude Code, so their model requests and tool calls are claude_code.* spans:
A claude_code.llm_request span with model, token counts and time to first token
Field
Spans
Notes
gen_ai.request.model
claude_code.llm_request
The model
input_tokens, output_tokens
claude_code.llm_request
Tokens of one request
cache_read_tokens, cache_creation_tokens
claude_code.llm_request
Prompt cache tokens
ttft_ms
claude_code.llm_request
Time to first token, in milliseconds
gen_ai.response.finish_reasons.0
claude_code.llm_request
For example tool_use or end_turn
gen_ai.tool.name
claude_code.tool
The tool, for example mcp__demo__get_weather
gen_ai.conversation.id, session.id
claude_code.llm_request, claude_code.tool
The Claude Code session. Search for it to find all spans of one agent run
In the TypeScript run (Claude Code 2.1.332), gen_ai.tool.name was the tool name without the MCP prefix, get_weather. The prefixed name mcp__demo__get_weather was in tool_name.By default, the spans contain no prompts, responses or tool arguments. For the settings that add them, see Claude Code: Monitoring.
Send Temporal SDK metrics
Python
TypeScript
Go
The Temporal SDK has its own metrics exporter, separate from the OpenTelemetry Python SDK. It doesn’t read the OTEL_EXPORTER_OTLP_* variables, so pass the endpoint and API key in code. The example reads the key from its own variable:
export BRONTO_API_KEY="<YOUR_API_KEY>"
Configure the exporter on a Runtime and pass the runtime to the client:
Use the full URL including /v1/metrics. Unlike the OpenTelemetry SDK, it doesn’t append the path.
Set http=True. The default is OTLP over gRPC.
Set the temporality to DELTA. With cumulative temporality, every export repeats the running total, and summing a counter in Bronto counts the same events more than once.
It does read OTEL_SERVICE_NAME for the service.name resource attribute.
As in Python, the Temporal SDK has its own metrics exporter. It doesn’t read the OTEL_EXPORTER_OTLP_* variables, so pass the endpoint and API key in code. The example reads the key from BRONTO_API_KEY:
export BRONTO_API_KEY="<YOUR_API_KEY>"
Install the runtime before you create the Worker or the client. It applies to the whole process:
As in Python, use the full URL including /v1/metrics, set http: true and set temporality: 'delta'.The TypeScript exporter doesn’t read OTEL_SERVICE_NAME. Its metrics arrive with the tag service_name=temporal-core-sdk and no service.name. To tell Workers apart, add your own tag with globalTags, for example globalTags: { service: 'order-worker' }, and group by it.
The Go SDK reports metrics through a metrics handler on the client. The contrib package’s handler wraps an OpenTelemetry meter, so it uses the OpenTelemetry Go SDK and reads the same OTEL_EXPORTER_OTLP_* variables as traces. The exporter appends /v1/metrics, and the SDK adds the temporal_ prefix itself.
go get go.opentelemetry.io/otel/sdk/metric \ go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp
temporal_activity_execution_failed grouped by activity_type
All of them also carry namespace. For the full list of metrics and their tags, see the Temporal SDK metrics reference.The TypeScript and Go SDKs emit the same metric names. Their workflow_type and activity_type values are the function names, for example chargeCard in TypeScript. Go keeps Go casing, for example ChargeCard.Latency metrics are in milliseconds in Python and TypeScript, and in seconds in Go. A Workflow that ran 1.07 seconds has a temporal_workflow_endtoend_latency of 1.07 in Go. Keep this in mind when you compare Workers in different languages or set monitor thresholds.
Alert on failures
Monitors evaluate log datasets and metrics, not spans. Create a metric monitor on temporal_workflow_failed or temporal_activity_execution_failed with Sum over a time window, grouped by workflow_type or activity_type. A monitor on temporal_activity_schedule_to_start_latency tells you when Workers fall behind.
Verify in Bronto
Start a Workflow, then open Tracing and filter by the service names you configured. Each Workflow appears as a StartWorkflow:<Workflow type> operation. The Worker’s spans can arrive a minute or two after the client’s span. Then open Metrics Explorer and search for temporal_.If the client’s span appears but the Worker’s spans don’t, check that the Worker’s client also has OpenTelemetryPlugin and a tracer provider registered before Client.connect. If no metrics appear, check the full /v1/metrics URL and http=True.In TypeScript, check that the Worker passes OpenTelemetryPlugin to Worker.create and that provider.register() ran before the first Workflow. If no metrics appear, check the full /v1/metrics URL and http: true, and look for export errors in the Worker’s log.In Go, check that the Worker’s client has the tracing interceptor and that you called otel.SetTracerProvider before you created the client. The Go exporters write errors to the standard log package. If a stray OTEL_EXPORTER_OTLP_INSECURE=true is set in the environment, they send plain HTTP to the endpoint and time out.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Bronto Docs","colors":{"primary":"#F4C430","light":"#F4C430","dark":"#F4C430"},"logo":{"light":"https://mintcdn.com/bronto/XgZO_N2_fZQn0lij/logo/bronto_mark.png?fit=max\u0026auto=format\u0026n=XgZO_N2_fZQn0lij\u0026q=85\u0026s=9d3e675d8cd714b8dbd1f1753438f856","dark":"https://mintcdn.com/bronto/XgZO_N2_fZQn0lij/logo/bronto_mark.png?fit=max\u0026auto=format\u0026n=XgZO_N2_fZQn0lij\u0026q=85\u0026s=9d3e675d8cd714b8dbd1f1753438f856","href":"https://www.bronto.io"},"favicon":"https://mintcdn.com/bronto/XgZO_N2_fZQn0lij/logo/favicon.png?fit=max\u0026auto=format\u0026n=XgZO_N2_fZQn0lij\u0026q=85\u0026s=26a0f5f54bf49ad88d2a110a0dc1bb04","appearance":{"default":"dark"},"background":{"color":{"light":"#F8F7F3","dark":"#0A0B0E"}},"navbar":{"links":[{"href":"https://app.bronto.io/login","label":"Login"}],"primary":{"type":"button","label":"Book a demo","href":"https://www.bronto.io/book-a-demo"}},"footer":{"socials":{"linkedin":"https://www.linkedin.com/company/brontohq"}},"seo":{"metatags":{"og:type":"website","og:site_name":"Bronto Docs","twitter:card":"summary_large_image","applicationName":"Bronto Docs"},"indexing":"all"},"fonts":{"heading":{"family":"Radio Canada Big"},"body":{"family":"Radio Canada Big"}},"icons":{"library":"lucide"},"styling":{"codeblocks":"dark","latex":true},"contextual":{"options":["copy","view","chatgpt","claude","mcp","cursor","vscode"],"display":"header"},"navigation":{"global":{"anchors":[{"anchor":"Trust","icon":"shield","href":"https://trust.bronto.io/"},{"anchor":"Book a Demo","icon":"calendar","href":"https://www.bronto.io/book-a-demo"},{"anchor":"Status","icon":"signal","href":"https://status.bronto.io"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"bronto","hasAudioNarration":false,"actualSubdomain":"bronto","customDomains":["docs.bronto.io"],"gitSource":{"type":"github","owner":"brontoio","repo":"bronto-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"","_id":"6b10af2c9ffae5051c3fe039"},"feedback":{"thumbs":false,"issues":true,"edits":true,"agentFeedback":false},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6b117af9a6151f7bc51e9138","clientVersion":"0.0.4428","searchFilterCounts":[{"language":"default","tag":"API Reference","count":148},{"language":"default","tag":"Ingest Data","count":111},{"language":"default","tag":"CLI","count":65},{"language":"default","tag":"Getting Started and UI","count":47},{"language":"default","tag":"Reference","count":45},{"language":"default","tag":"Commands","count":40},{"language":"default","tag":"Ingest from AWS","count":32},{"language":"default","tag":"AI Assisted Observability","count":22},{"language":"default","tag":"AWS Services","count":21},{"language":"default","tag":"integrations","count":20}]},"assistantConfig":{"enableAskAiButton":true,"enableStarterQuestions":true,"enableContextualStarterQuestions":true,"enableAskAiSearchBar":false,"deflection":{"enabled":true,"email":"support@bronto.io","showHelpButton":true}},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":true},"customCss":[{"filePath":"styles/welcome-style.css","content":"[data-page=\"welcome\"]{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:4rem 2rem}[data-page=\"welcome\"] h1{font-size:3rem;font-weight:bold;color:#F4C430;margin-bottom:1.5rem}[data-page=\"welcome\"] .content-container{max-width:800px;margin:0 auto}[data-page=\"welcome\"] .side-nav{display:none}[data-page=\"welcome\"] img{max-width:100%;height:auto;margin-bottom:2rem}[data-page=\"welcome\"] .CardGroup{display:grid;grid-template-columns:1fr;gap:1.5rem;margin-top:2rem}[data-page=\"welcome\"] .Card{background:#1e1e1e;color:white;padding:1.5rem;border-radius:8px;transition:transform 0.2s ease-in-out}[data-page=\"welcome\"] .Card:hover{transform:scale(1.05)}[data-page=\"welcome\"] .Card h2{font-size:1.5rem;color:#F4C430;margin-bottom:0.5rem}"},{"filePath":"styles/brand-icons.css","content":"img[src^=\"/images/icons/\"]{object-fit:contain}html.dark img[src$=\"/images/icons/aws.svg\"]{content:url(\"/images/icons/aws-dark.svg\")}html.dark img[src$=\"/images/icons/kafka.svg\"]{content:url(\"/images/icons/kafka-dark.svg\")}html.dark img[src$=\"/images/icons/kong.svg\"]{content:url(\"/images/icons/kong-dark.svg\")}html.dark img[src$=\"/images/icons/rust.svg\"]{content:url(\"/images/icons/rust-dark.svg\")}html.dark img[src$=\"/images/icons/vercel.svg\"]{content:url(\"/images/icons/vercel-dark.svg\")}html.dark img[src$=\"/images/icons/auth0.svg\"]{content:url(\"/images/icons/auth0-dark.svg\")}html.dark img[src$=\"/images/icons/okta.svg\"]{content:url(\"/images/icons/okta-dark.svg\")}html.dark img[src$=\"/images/icons/mysql.svg\"]{content:url(\"/images/icons/mysql-dark.svg\")}html.dark img[src$=\"/images/icons/heroku.svg\"]{content:url(\"/images/icons/heroku-dark.svg\")}html.dark img[src$=\"/images/icons/langchain.svg\"]{content:url(\"/images/icons/langchain-dark.svg\")}html.dark img[src$=\"/images/icons/mcp.svg\"]{content:url(\"/images/icons/mcp-dark.svg\")}html.dark img[src$=\"/images/icons/temporal.svg\"]{content:url(\"/images/icons/temporal-dark.svg\")}"},{"filePath":"styles/buttons.css","content":"html:not(.dark) #topbar-cta-button a>span:first-child{background-color:#151513}"},{"filePath":"styles/card-icons.css","content":"[data-component-part=\"card-content-container\"]:has([data-component-part=\"card-icon\"]){display:grid;grid-template-columns:auto 1fr;column-gap:10px;align-items:center}[data-component-part=\"card-content-container\"] div:has(>[data-component-part=\"card-title\"]){display:contents}[data-component-part=\"card-icon\"]{grid-column:1;grid-row:1;display:flex;width:16px;height:16px}[data-component-part=\"card-icon\"]>svg{width:16px!important;height:16px!important}[data-component-part=\"card-content-container\"]:has([data-component-part=\"card-icon\"]) [data-component-part=\"card-title\"]{grid-column:2;grid-row:1;margin-top:0}[data-component-part=\"card-content-container\"]:has([data-component-part=\"card-icon\"]) [data-component-part=\"card-content\"]{grid-column:1 / -1;margin-top:4px}.card:hover [data-component-part=\"card-content-container\"]>a>div.absolute{color:rgb(var(--gray-400))}html.dark .card:hover [data-component-part=\"card-content-container\"]>a>div.absolute{color:rgb(var(--gray-500))}"},{"filePath":"styles/cards.css","content":".card{border-width:0}html.dark .card{box-shadow:0 0 0 1px rgb(255 255 255 / 0.1);transition:box-shadow 150ms ease-out}html.dark .card:hover{box-shadow:0 0 0 1px rgb(255 255 255 / 0.18), 0 8px 24px -8px rgb(0 0 0 / 0.5)}html:not(.dark) .card{--card-shadow:\n 0 0 0 1px hsl(40 20% 20% / 0.04),\n 0 1px 2px hsl(40 20% 20% / 0.04),\n 0 2px 6px -1px hsl(40 20% 20% / 0.06),\n 0 6px 14px -6px hsl(40 20% 20% / 0.08);--card-shadow-hover:\n 0 0 0 1px hsl(40 20% 20% / 0.06),\n 0 2px 4px hsl(40 20% 20% / 0.05),\n 0 4px 10px -2px hsl(40 20% 20% / 0.08),\n 0 12px 24px -8px hsl(40 20% 20% / 0.12);background-color:#ffffff;border-radius:12px;box-shadow:var(--card-shadow);transition:box-shadow 150ms ease-out}html:not(.dark) .card:hover{box-shadow:var(--card-shadow-hover)}.card [data-component-part=\"card-content-container\"]{padding:14px 16px}.card h2{font-family:\"Radio Canada Big\", sans-serif;font-size:14px;font-weight:600;letter-spacing:-0.02em}html:not(.dark) .card h2{color:#151513}"},{"filePath":"styles/dark-mode.css","content":"html.dark{--background-dark: 10 11 14;--primary: 43 127 255;--primary-light: 43 127 255;--primary-dark: 43 127 255;--gray-50: 248 249 251;--gray-100: 238 240 244;--gray-200: 238 240 244;--gray-300: 205 209 217;--gray-400: 144 151 165;--gray-500: 104 109 120;--gray-600: 74 79 89;--gray-700: 48 52 60;--gray-800: 34 38 45;--gray-900: 20 22 27;--gray-950: 10 11 14}html.dark .card{background-color:#14161B;box-shadow:0 0 0 1px #22262D}html.dark .card:hover{box-shadow:0 0 0 1px #2E333C, 0 8px 24px -8px rgb(0 0 0 / 0.6)}html.dark #navbar-transition,html.dark #navbar .h-16>div{border-color:#191C21}html.dark #sidebar .sidebar-group-header{color:#686D78}html.dark #sidebar a:not([aria-current]),html.dark #sidebar button{color:#CDD1D9}html.dark #sidebar .sidebar-group a:not([aria-current]):hover,html.dark #sidebar .sidebar-group button:hover,html.dark #sidebar a.nav-anchor:hover{background-color:#14161B}html.dark #sidebar a[aria-current]{background-color:#242732;color:#EEF0F4}html.dark #sidebar a[aria-current] svg{background-color:#EEF0F4}"},{"filePath":"styles/footer.css","content":"#footer{margin-top:40px;padding-top:24px;padding-bottom:40px}[data-assistant-bar].invisible{height:0;overflow:hidden}"},{"filePath":"styles/header.css","content":"@media (min-width: 1024px){:root{--mintlify-slot-header-height: 92px;--topbar-tabs-height: 40px}#navbar .h-16:has(.nav-logo){height:52px}#navbar div:has(>.nav-tabs){height:40px}}#search-bar-entry,#assistant-entry{height:32px;border-radius:8px}html:not(.dark) #search-bar-entry,html:not(.dark) #assistant-entry,html:not(.dark) .chat-assistant-floating-input .rounded-2xl{background-color:#ffffff;border-color:transparent;box-shadow:0 0 0 1px hsl(40 20% 20% / 0.04),\n 0 1px 2px hsl(40 20% 20% / 0.04),\n 0 2px 6px -1px hsl(40 20% 20% / 0.06),\n 0 6px 14px -6px hsl(40 20% 20% / 0.08);transition:box-shadow 150ms ease-out}html:not(.dark) #search-bar-entry:hover,html:not(.dark) #assistant-entry:hover,html:not(.dark) .chat-assistant-floating-input .rounded-2xl:hover,html:not(.dark) .chat-assistant-floating-input .rounded-2xl:focus-within{box-shadow:0 0 0 1px hsl(40 20% 20% / 0.06),\n 0 2px 4px hsl(40 20% 20% / 0.05),\n 0 4px 10px -2px hsl(40 20% 20% / 0.08),\n 0 12px 24px -8px hsl(40 20% 20% / 0.12)}html:not(.dark) .chat-assistant-floating-input .rounded-2xl{border-radius:12px}#navbar div:has(>#theme-preference-menu-trigger){order:-1}#navbar div:has(>nav):has(#theme-preference-menu-trigger){gap:10px}#navbar div:has(>nav):has(#theme-preference-menu-trigger)>*{margin-inline:0}#navbar nav>ul{gap:10px}#navbar nav>ul>li{margin-inline:0}#navbar li.navbar-link>a{height:32px;padding:0 12px;border-radius:8px;font-weight:500;color:#151513;background-color:#ffffff;box-shadow:0 0 0 1px hsl(40 20% 20% / 0.1),\n 0 1px 2px hsl(40 20% 20% / 0.06);transition:background-color 150ms ease-out}#navbar li.navbar-link>a:hover{background-color:#F1EFE7}html.dark #navbar li.navbar-link>a{color:rgb(var(--gray-200));background-color:rgb(255 255 255 / 0.05);box-shadow:0 0 0 1px rgb(255 255 255 / 0.1)}html.dark #navbar li.navbar-link>a:hover{background-color:rgb(255 255 255 / 0.1)}#topbar-cta-button>a{height:32px;padding:0 12px}#topbar-cta-button svg{display:none}#topbar-cta-button>a>span:first-child{border-radius:8px}"},{"filePath":"styles/hero.css","content":"/* cyrillic-ext */\n@font-face {\n font-family: 'Source Serif Pro';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/sourceserifpro/v19/neIXzD-0qpwxpaWvjeD0X88SAOeasasatSGqxLUv.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Source Serif Pro';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/sourceserifpro/v19/neIXzD-0qpwxpaWvjeD0X88SAOeasasatSiqxLUv.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* greek */\n@font-face {\n font-family: 'Source Serif Pro';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/sourceserifpro/v19/neIXzD-0qpwxpaWvjeD0X88SAOeasasatS-qxLUv.woff2) format('woff2');\n unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Source Serif Pro';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/sourceserifpro/v19/neIXzD-0qpwxpaWvjeD0X88SAOeasasatSOqxLUv.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Source Serif Pro';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/sourceserifpro/v19/neIXzD-0qpwxpaWvjeD0X88SAOeasasatSKqxLUv.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Source Serif Pro';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/sourceserifpro/v19/neIXzD-0qpwxpaWvjeD0X88SAOeasasatSyqxA.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n#content-area:has(.bronto-hero) #header{display:none}.mdx-content:has(.bronto-hero){margin-top:0}.bronto-hero{position:relative;isolation:isolate;display:flex;flex-direction:column;align-items:center;padding:72px 0 8px;margin-bottom:48px;text-align:center}.bronto-grid{--cell: 255 214 10;position:absolute;z-index:-1;inset:-40px 0 auto;display:grid;grid-template-columns:repeat(auto-fill, 10px);grid-auto-rows:10px;gap:4px;justify-content:center;height:180px;overflow:hidden;pointer-events:none;-webkit-mask-image:linear-gradient(to bottom, #000 0%, rgb(0 0 0 / 0.6) 35%, transparent 100%),\n linear-gradient(to right, transparent, #000 15%, #000 85%, transparent);-webkit-mask-composite:source-in;mask-image:linear-gradient(to bottom, #000 0%, rgb(0 0 0 / 0.6) 35%, transparent 100%),\n linear-gradient(to right, transparent, #000 15%, #000 85%, transparent);mask-composite:intersect}.bronto-grid>span{border-radius:2px;background-color:rgb(var(--cell));opacity:0}.bronto-grid>span.on{animation:bronto-grid-twinkle var(--d, 5s) ease-in-out var(--delay, 0s) infinite}.bronto-grid>span.glow{box-shadow:0 0 8px rgb(var(--cell) / 0.7)}@keyframes bronto-grid-twinkle{0%,100%{opacity:calc(var(--o, 0.5) * 0.25)}50%{opacity:var(--o, 0.5)}}.bronto-hero-title{margin-top:20px;font-family:\"Source Serif Pro\", serif;font-size:clamp(36px, 5.5vw, 60px);font-weight:600;line-height:1.06;letter-spacing:-0.055em;color:#151513}.bronto-hero-subtitle{max-width:560px;margin:20px auto 0;font-size:17px;line-height:26px;color:rgb(var(--gray-600))}.bronto-pills{width:100%;max-width:560px;margin-top:28px;overflow:hidden;-webkit-mask-image:linear-gradient(to right, transparent, #000 18%, #000 82%, transparent);mask-image:linear-gradient(to right, transparent, #000 18%, #000 82%, transparent)}.bronto-pills-track{display:flex;gap:8px;width:max-content;animation:bronto-pills-drift 60s linear infinite}@keyframes bronto-pills-drift{from{transform:translateX(calc(-50% - 4px))}to{transform:translateX(0)}}.bronto-pill{display:inline-flex;flex-shrink:0;align-items:center;gap:5px;height:24px;padding:0 9px;border-radius:9999px;background-color:#F1EFE7;color:#151513;font-size:12px;line-height:1;white-space:nowrap}.bronto-pill svg{width:12px;height:12px}.bronto-hero-cards{width:100%;max-width:760px;margin-top:40px;text-align:left}html.dark .bronto-grid{--cell: 43 127 255}html.dark .bronto-hero-title{color:#EEF0F4}html.dark .bronto-hero-subtitle{color:#9097A5}html.dark .bronto-pill{background-color:#14161B;box-shadow:0 0 0 1px #22262D;color:#CDD1D9}@media (prefers-reduced-motion: reduce){.bronto-grid>span.on{animation:none;opacity:calc(var(--o, 0.5) * 0.6)}.bronto-pills{-webkit-mask-image:none;mask-image:none}.bronto-pills-track{flex-wrap:wrap;justify-content:center;width:auto;animation:none}.bronto-pill[aria-hidden=\"true\"]{display:none}}"},{"filePath":"styles/images.css","content":".mdx-content{--image-shadow:\n 0 0 0 1px hsl(40 20% 20% / 0.05),\n 0 2px 4px hsl(40 20% 20% / 0.05),\n 0 10px 28px -10px hsl(40 20% 20% / 0.18)}html.dark .mdx-content{--image-shadow:\n 0 0 0 1px #22262D,\n 0 10px 28px -10px rgb(0 0 0 / 0.7)}.mdx-content .frame{padding:0;border-radius:12px;background:transparent;box-shadow:var(--image-shadow)}.mdx-content .frame>div[class*=\"bg-grid\"],.mdx-content .frame>div.pointer-events-none{display:none}.mdx-content .zoom-image-trigger img:not(.frame *,.card *,table *,.bronto-hero *){border-radius:12px;box-shadow:var(--image-shadow)}"},{"filePath":"styles/layout.css","content":"@media (min-width: 1024px){#navbar .max-w-8xl,div:has(>#sidebar){max-width:none}html:not([data-page-mode=\"wide\"]) #content-area{max-width:960px}div:has(>#sidebar):not(:has(#table-of-contents))>#content-container{margin-left:max(0px, calc(50vw - 451px - var(--sidebar-width) - 8px))}.flex.items-center.h-16:has(.nav-logo){padding-left:16px;padding-right:16px}div:has(>.nav-tabs){padding-left:24px;padding-right:24px}div:has(>#sidebar){padding-left:8px;padding-right:24px}}@media (min-width: 1280px){html:not([data-page-mode=\"wide\"]) #content-container:has(#table-of-contents) #content-area{margin-left:clamp(\n -48px,\n calc(50vw - 524px - var(--sidebar-width) - 8px),\n calc(100vw - var(--sidebar-width) - 8px - 960px - 48px - 264px - 24px)\n )}}"},{"filePath":"styles/logo.css","content":"a:has(>.nav-logo){display:flex;align-items:center}a>.nav-logo{height:24px}a:has(>.nav-logo)::after{content:\"Docs\";padding-left:28px;margin-left:4px;font-size:19px;font-weight:500;line-height:28px;letter-spacing:-0.02em;color:#151513;background:linear-gradient(\n to bottom right,\n transparent calc(50% - 0.75px),\n var(--logo-slash, #D6D2C4) calc(50% - 0.75px),\n var(--logo-slash, #D6D2C4) calc(50% + 0.75px),\n transparent calc(50% + 0.75px)\n )\n left 10px top 7px / 7.5px 14px no-repeat}html.dark a:has(>.nav-logo)::after{--logo-slash: rgb(255 255 255 / 0.2);color:rgb(var(--gray-200))}"},{"filePath":"styles/page-actions.css","content":"#page-context-menu{min-width:0;width:fit-content;height:28px;border-radius:8px;background-color:#ffffff;box-shadow:0 0 0 1px hsl(40 20% 20% / 0.06),\n 0 1px 2px hsl(40 20% 20% / 0.05),\n 0 2px 6px -1px hsl(40 20% 20% / 0.06);transition:box-shadow 150ms ease-out}#page-context-menu:hover{box-shadow:0 0 0 1px hsl(40 20% 20% / 0.08),\n 0 2px 4px hsl(40 20% 20% / 0.06),\n 0 4px 10px -2px hsl(40 20% 20% / 0.1)}#page-context-menu>button{height:28px;border:0;border-radius:0;background-color:transparent;transition:background-color 150ms ease-out}#page-context-menu>button:first-child{padding:0 10px;border-radius:8px 0 0 8px}#page-context-menu>button:first-child>div{gap:6px;font-size:13px}#page-context-menu>button:first-child svg{width:14px;height:14px}#page-context-menu>button:last-child{width:28px;padding:0;border-radius:0 8px 8px 0;border-left:1px solid hsl(40 20% 20% / 0.08)}#page-context-menu>button:hover{background-color:#F1EFE7}html.dark #page-context-menu{background-color:#14161B;box-shadow:0 0 0 1px #22262D}html.dark #page-context-menu:hover{box-shadow:0 0 0 1px #2E333C, 0 6px 16px -6px rgb(0 0 0 / 0.6)}html.dark #page-context-menu>button:last-child{border-left-color:#22262D}html.dark #page-context-menu>button:hover{background-color:rgb(255 255 255 / 0.05)}"},{"filePath":"styles/pagination.css","content":"#pagination{gap:12px;margin-inline:-20px;padding:0}#pagination>a{display:grid;grid-template-columns:auto 1fr;align-items:center;column-gap:8px;row-gap:6px;width:calc(50% - 6px);padding:18px 20px;border-radius:12px;transition:background-color 150ms ease-out}#pagination>a[data-component-part=\"pagination-next\"]{grid-template-columns:1fr auto;margin-left:auto;text-align:right}@media (max-width: 640px){#pagination{flex-direction:column;align-items:stretch;gap:4px}#pagination>a,#pagination>a[data-component-part=\"pagination-next\"]{width:auto;margin-left:0}}#pagination>a:hover{background-color:#F1EFE7}html.dark #pagination>a:hover{background-color:#14161B}#pagination [data-component-part=\"pagination-title\"]{grid-row:1;grid-column:1 / -1;font-size:17px;font-weight:500;line-height:24px;color:#151513}html.dark #pagination [data-component-part=\"pagination-title\"]{color:#EEF0F4}#pagination [data-component-part=\"pagination-chevron\"]{grid-row:2;height:9px;width:auto;stroke:rgb(var(--gray-500))}#pagination>a[data-component-part=\"pagination-prev\"] [data-component-part=\"pagination-chevron\"]{grid-column:1}#pagination>a[data-component-part=\"pagination-next\"] [data-component-part=\"pagination-chevron\"]{grid-column:2}#pagination>a::after{grid-row:2;font-family:ui-monospace, \"SF Mono\", Menlo, monospace;font-size:11px;font-weight:400;letter-spacing:0.1em;line-height:16px;text-transform:uppercase;color:rgb(var(--gray-500))}#pagination>a[data-component-part=\"pagination-prev\"]::after{content:\"Previous\";grid-column:2}#pagination>a[data-component-part=\"pagination-next\"]::after{content:\"Next\";grid-column:1}#pagination>a:hover::after,#pagination>a:hover [data-component-part=\"pagination-chevron\"]{color:rgb(var(--gray-700));stroke:rgb(var(--gray-700))}html.dark #pagination>a:hover::after,html.dark #pagination>a:hover [data-component-part=\"pagination-chevron\"]{color:rgb(var(--gray-300));stroke:rgb(var(--gray-300))}"},{"filePath":"styles/sidebar.css","content":"html:not(.dark) #sidebar .sidebar-group-header{color:#747471}:root{--sidebar-width: 17rem}#sidebar .sidebar-group-header{font-weight:500}html:not(.dark) #sidebar a:not([aria-current]),html:not(.dark) #sidebar button{color:#151513}html:not(.dark) #sidebar .sidebar-group a:not([aria-current]):hover,html:not(.dark) #sidebar .sidebar-group button:hover,html:not(.dark) #sidebar a.nav-anchor:hover{background-color:#F1EFE7}html:not(.dark) #sidebar a[aria-current]{background-color:#E2DECC;color:#151513}html:not(.dark) #sidebar a[aria-current] svg{background-color:#151513}#sidebar a svg[style*=\"mask\"],#sidebar a:hover svg[style*=\"mask\"],#sidebar button svg[style*=\"mask\"]{width:14px;height:14px;background-color:currentColor}#sidebar .sidebar-group a,#sidebar .sidebar-group button{padding-top:3px;padding-bottom:3px}#sidebar div:has(>.sidebar-group-header){margin-top:20px}#sidebar .sidebar-group-header{margin-bottom:4px}#navigation-items{display:flex;flex-direction:column}div:has(>#navigation-items)>div.sticky:first-child{height:20px;margin-bottom:-20px}#navigation-items>ul:has(a.nav-anchor){order:1;margin-top:20px}#sidebar a.nav-anchor{margin:0 0 1px;padding:3px 12px 3px 16px;gap:12px;border-radius:12px;font-weight:400;line-height:24px}#sidebar a.nav-anchor>div:first-child{color:inherit;margin:0;padding:0;border-radius:0;background:none!important;box-shadow:none;filter:none}"},{"filePath":"styles/steps.css","content":".steps{--step-line: rgb(21 21 19 / 0.1);--step-badge-border: rgb(21 21 19 / 0.14);--step-badge-bg: #ffffff;margin-left:12px}html.dark .steps{--step-line: #22262D;--step-badge-border: #2E333C;--step-badge-bg: #14161B}.steps>.step{padding-bottom:24px}.steps [data-component-part=\"step-number\"]{margin-left:-12px;padding:0}.steps [data-component-part=\"step-indicator\"]{display:grid;place-items:center;width:24px;height:24px;border:1px solid var(--step-badge-border);background-color:var(--step-badge-bg);font-family:ui-monospace, \"SF Mono\", Menlo, monospace;font-size:11.5px;font-weight:500;color:#151513}html.dark .steps [data-component-part=\"step-indicator\"]{color:#EEF0F4}.steps [data-component-part=\"step-line\"]{top:28px;height:calc(100% - 32px);background-color:var(--step-line)}.steps>.step:last-child [data-component-part=\"step-line\"]{display:none}.steps>.step>div:last-child{padding-left:28px}.steps [data-component-part=\"step-title\"]{margin:0;font-size:15px;line-height:24px;color:#151513}html.dark .steps [data-component-part=\"step-title\"]{color:#EEF0F4}.steps [data-component-part=\"step-content\"]{margin-top:4px}.steps [data-component-part=\"step-content\"]>:first-child{margin-top:0}.steps [data-component-part=\"step-content\"]>:last-child{margin-bottom:0}"},{"filePath":"styles/tables.css","content":".mdx-content table{--table-line: rgb(21 21 19 / 0.08);--table-head: #F1EFE7;--table-body: #ffffff;border-collapse:separate;border-spacing:0;border:1px solid var(--table-line);border-radius:10px;overflow:hidden;background-color:var(--table-body)}html.dark .mdx-content table{--table-line: #22262D;--table-head: #14161B;--table-body: transparent}.mdx-content table :is(th,td){padding:11px 16px;vertical-align:top;border-bottom:1px solid var(--table-line);border-right:1px solid var(--table-line)}.mdx-content table :is(th,td):last-child{border-right:0}.mdx-content table tbody tr:last-child td{border-bottom:0}.mdx-content table th{vertical-align:middle;background-color:var(--table-head);font-family:ui-monospace, \"SF Mono\", Menlo, monospace;font-size:12.5px;font-weight:400;line-height:18px;color:rgb(var(--gray-600))}html.dark .mdx-content table th{color:#9097A5}.mdx-content table td{font-size:14px;line-height:21px}.mdx-content table td:first-child{font-weight:600;color:#151513}html.dark .mdx-content table td:first-child{color:#EEF0F4}.mdx-content table td code{white-space:nowrap;word-break:normal;overflow-wrap:normal}"},{"filePath":"styles/tabs.css","content":"[data-component-part=\"tabs-list\"]{display:inline-flex;gap:2px;width:fit-content;min-width:0;max-width:100%;margin-bottom:16px;padding:3px;border:0;border-radius:10px;background-color:#F1EFE7}[data-component-part=\"tab-button\"]{margin:0;padding:4px 12px;border:0;border-radius:7px;font-size:13px;font-weight:500;line-height:20px;color:rgb(var(--gray-600));transition:color 150ms ease-out, background-color 150ms ease-out, box-shadow 150ms ease-out}[data-component-part=\"tab-button\"]:hover{color:#151513}[data-component-part=\"tab-button\"][data-active=\"true\"]{color:#151513;background-color:#ffffff;box-shadow:0 0 0 1px hsl(40 20% 20% / 0.06),\n 0 1px 2px hsl(40 20% 20% / 0.08),\n 0 2px 6px -1px hsl(40 20% 20% / 0.08)}html.dark [data-component-part=\"tabs-list\"]{background-color:#14161B;box-shadow:0 0 0 1px #22262D}html.dark [data-component-part=\"tab-button\"]{color:#9097A5}html.dark [data-component-part=\"tab-button\"]:hover,html.dark [data-component-part=\"tab-button\"][data-active=\"true\"]{color:#EEF0F4}html.dark [data-component-part=\"tab-button\"][data-active=\"true\"]{background-color:#242732;box-shadow:0 0 0 1px #2E333C}[role=\"tablist\"][aria-label=\"Code examples\"] [role=\"tab\"][aria-selected=\"true\"],[role=\"tablist\"][aria-label=\"Code examples\"] [role=\"tab\"][aria-selected=\"true\"]>div{color:#ffffff}[role=\"tablist\"][aria-label=\"Code examples\"] [role=\"tab\"][aria-selected=\"true\"]>div:last-child:not(:first-child){background-color:rgb(255 255 255 / 0.7)}"},{"filePath":"styles/tags.css","content":".eyebrow,.bronto-tag{display:inline-flex;align-items:center;gap:8px;width:fit-content;height:auto;padding:6px 12px;border-radius:9999px;border:1px solid rgb(255 214 10 / 80%);background:rgb(255 214 10 / 35%);color:#7A5200;font-family:\"Radio Canada Big\", sans-serif;font-size:13px;font-weight:600;line-height:1;letter-spacing:0;box-shadow:0 1px 3px rgba(153, 117, 63, 0.2)}.eyebrow::before,.bronto-tag::before{content:\"\";width:6px;height:6px;flex-shrink:0;border-radius:50%;background:#FFD60A}html.dark .eyebrow,html.dark .bronto-tag{border-color:rgb(43 127 255 / 50%);background:rgb(43 127 255 / 15%);color:#93C5FD;box-shadow:none}html.dark .eyebrow::before,html.dark .bronto-tag::before{background:#2B7FFF}"},{"filePath":"styles/text-colors.css","content":"html:not(.dark){--gray-950: 21 21 19;--gray-900: 21 21 19;--gray-800: 39 39 37;--gray-700: 57 57 55;--gray-600: 85 84 82;--gray-500: 116 116 113;--gray-400: 153 152 149}html:not(.dark) .prose{--tw-prose-headings: #151513;--tw-prose-bold: #151513;--tw-prose-links: #151513;--tw-prose-code: #151513;--tw-prose-quotes: #151513;--tw-prose-body: #393937;--tw-prose-counters: #747471;--tw-prose-bullets: #999895}"},{"filePath":"styles/toc.css","content":"#table-of-contents h2 button svg{display:none}#table-of-contents h2 button{font-size:13px;font-weight:500;color:rgb(var(--gray-500))}#table-of-contents-content{margin-top:4px;border-left:1px solid rgb(var(--gray-950) / 0.08)}#table-of-contents-content li.toc-item>a{position:relative;padding-top:4px;padding-bottom:4px;padding-left:calc(14px + var(--toc-padding-left, 0rem));font-size:13px;line-height:20px;font-weight:400;color:rgb(var(--gray-500));transition:color 150ms ease-out}#table-of-contents-content li.toc-item>a:hover{color:rgb(var(--gray-900))}#table-of-contents-content li.toc-item>a[aria-current]{color:#151513}#table-of-contents-content li.toc-item>a::before{content:\"\";position:absolute;top:calc(50% - 7px);left:-1.5px;width:2px;height:14px;border-radius:1px;background-color:#151513;transform:scaleY(0);transition:transform 200ms ease-out}#table-of-contents-content li.toc-item>a[aria-current]::before{transform:scaleY(1)}html.dark #table-of-contents-content{border-left-color:rgb(255 255 255 / 0.08)}html.dark #table-of-contents-content li.toc-item>a{color:rgb(var(--gray-400))}html.dark #table-of-contents-content li.toc-item>a:hover,html.dark #table-of-contents-content li.toc-item>a[aria-current]{color:#ffffff}html.dark #table-of-contents-content li.toc-item>a::before{background-color:#ffffff}"},{"filePath":"styles/typography.css","content":".mdx-content :is(p,[data-as=\"p\"],li,blockquote,dd,dt):not([data-component-part=\"callout-content\"] *,table *,.card *,.bronto-hero *){font-size:15px;line-height:26px}#header .prose p{font-size:17px;line-height:26px}[data-component-part=\"card-content\"]{font-size:13px;line-height:19px}"}]}
{"page":{"pagePath":"integrations/temporal","slug":"/integrations/temporal","pageMetadata":{"title":"Send Temporal traces and metrics to Bronto via OpenTelemetry","sidebarTitle":"Temporal","description":"Trace Temporal Workflows, Activities and the AI agents that run in them, and send Temporal SDK metrics to Bronto with OpenTelemetry.","icon":"/images/icons/temporal.svg","href":"/integrations/temporal"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Trace Temporal Workflows, Activities and the AI agents that run in them, and send Temporal SDK metrics to Bronto with OpenTelemetry.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Frame,Heading,Note,OptimizedImage,Tab,Table,Tabs,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[_jsx(_components.a,{href:`https://temporal.io`,children:`Temporal`}),` runs Workflows durably: if a process crashes, the Workflow continues where it left off, and failed Activities are retried. That makes it a common runtime for long-running AI agents. With OpenTelemetry, you can see each Workflow in Bronto as one trace: the client that started it, the Workflow, every Activity attempt and, for agents, every model request and tool call.`]}),`\n`,_jsx(_components.p,{children:`This page covers the Temporal Python, TypeScript and Go SDKs:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Traces`}),` from each SDK’s OpenTelemetry plugin or, in Go, its tracing interceptor`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Metrics`}),` from each SDK’s metrics exporter or, in Go, its metrics handler`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`AI agents`}),` run on Temporal, built with the Claude Agent SDK (Python, TypeScript) or the Anthropic Go SDK (Go)`]}),`\n`]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`This page was verified on `,_jsx(_components.strong,{children:`November 26, 2026`}),` with `,_jsx(_components.code,{children:`temporalio`}),` 1.37.0, `,_jsx(_components.code,{children:`temporalio-claude-agent-sdk`}),` 0.0.3, `,_jsx(_components.code,{children:`claude-agent-sdk`}),` 0.2.168 (Claude Code 2.1.301), the OpenTelemetry Python SDK 1.45.2 and a local Temporal dev server (Temporal CLI 1.10.1). The TypeScript examples were verified on `,_jsx(_components.strong,{children:`November 27, 2026`}),` with `,_jsx(_components.code,{children:`@temporalio/*`}),` 1.27.0, `,_jsx(_components.code,{children:`@temporalio/interceptors-opentelemetry-v2`}),` 1.27.0, `,_jsx(_components.code,{children:`@anthropic-ai/claude-agent-sdk`}),` 0.3.332 (Claude Code 2.1.332), the OpenTelemetry JS SDK 2.12.1 and Node.js 24. The Go examples were verified on `,_jsx(_components.strong,{children:`November 27, 2026`}),` with `,_jsx(_components.code,{children:`go.temporal.io/sdk`}),` 1.52.0, `,_jsx(_components.code,{children:`go.temporal.io/sdk/contrib/opentelemetry`}),` 0.9.0, `,_jsx(_components.code,{children:`github.com/anthropics/anthropic-sdk-go`}),` 1.84.0, the OpenTelemetry Go SDK 1.47.0 and Go 1.27. GenAI libraries and semantic conventions are evolving rapidly, so package configuration and emitted attributes can change between releases. Keep your instrumentation current and verify the fields emitted by the version you deploy.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`prerequisites`,children:`Prerequisites`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Python 3.11+, Node.js 20+ or Go 1.26+, and the Temporal SDK for your language`}),`\n`,_jsxs(_components.li,{children:[`A Temporal Service: Temporal Cloud, a self-hosted cluster or `,_jsx(_components.code,{children:`temporal server start-dev`}),` for local development`]}),`\n`,_jsxs(_components.li,{children:[`An OTel Collector configured using `,_jsx(_components.a,{href:`/agent-setup/open-telemetry`,children:`Connect OpenTelemetry to Bronto`}),`, or a direct OTLP exporter (below)`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`send-traces-and-metrics-to-bronto`,children:`Send traces and metrics to Bronto`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Via a Collector`}),`: point the application’s OTLP exporter at the Collector, then configure the Collector using `,_jsx(_components.a,{href:`/agent-setup/open-telemetry`,children:`Connect OpenTelemetry to Bronto`}),`. This is recommended in production.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Direct export`}),`: point the exporter at the Bronto ingestion endpoint and add your API key:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` OTEL_EXPORTER_OTLP_ENDPOINT`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"https://ingestion.eu.bronto.io\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` OTEL_EXPORTER_OTLP_PROTOCOL`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"http/protobuf\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` OTEL_EXPORTER_OTLP_HEADERS`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"x-bronto-api-key=\u003cYOUR_API_KEY>\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` OTEL_SERVICE_NAME`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"order-worker\"`})]}),`\n`]})})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Region`}),_jsx(_components.th,{children:`Endpoint`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`EU`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`https://ingestion.eu.bronto.io`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`US`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`https://ingestion.us.bronto.io`})})]})]})]}),`\n`,_jsxs(_components.p,{children:[`The OpenTelemetry SDK appends `,_jsx(_components.code,{children:`/v1/traces`}),`. Give the Worker and the process that starts Workflows different service names, so you can tell them apart in a trace. See `,_jsx(_components.a,{href:`/Account-Management/API-Keys`,children:`API Keys`}),` for how to create a key with ingestion permissions.`]}),`\n`,_jsx(_components.p,{children:`In TypeScript, the OTLP trace exporter reads these variables. In Go, the OTLP trace and metric exporters both read them. The TypeScript and Go examples set the service name in code, in the tracer provider’s resource.`}),`\n`,_jsx(Heading,{level:`2`,id:`trace-workflows-and-activities`,children:`Trace Workflows and Activities`}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Python`,id:`python`,children:[_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`pip`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` install`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` temporalio`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` opentelemetry-sdk`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` opentelemetry-exporter-otlp-proto-http`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`Register a tracer provider, then add the SDK’s `,_jsx(_components.code,{children:`OpenTelemetryPlugin`}),` to the client. Do this in every process that uses Temporal, both the Worker and the code that starts Workflows, so their spans join one trace:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`15`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`15`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` opentelemetry `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` trace`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` opentelemetry.exporter.otlp.proto.http.trace_exporter `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` OTLPSpanExporter`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` opentelemetry.sdk.trace.export `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` BatchSpanProcessor`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` temporalio.client `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` Client`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` temporalio.contrib.opentelemetry `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` OpenTelemetryPlugin, create_tracer_provider`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` temporalio.worker `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` Worker`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`provider = create_tracer_provider()`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`provider.add_span_processor(BatchSpanProcessor(OTLPSpanExporter()))`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`trace.set_tracer_provider(provider)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`client = `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` Client.connect(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"localhost:7233\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`plugins`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=[OpenTelemetryPlugin(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`add_temporal_spans`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)])`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`worker = Worker(client, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`task_queue`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"orders\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`workflows`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=[OrderWorkflow], `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`activities`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=[fetch_order, charge_card])`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` worker.run()`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`Use `,_jsx(_components.code,{children:`create_tracer_provider()`}),` instead of the OpenTelemetry SDK’s `,_jsx(_components.code,{children:`TracerProvider`}),`. Workflow code can be replayed, and the provider it returns is replay-safe. Register it before `,_jsx(_components.code,{children:`Client.connect`}),`. A Worker created from the client uses the client’s plugins, so you don’t pass `,_jsx(_components.code,{children:`plugins`}),` to `,_jsx(_components.code,{children:`Worker`}),` again. Short-lived processes, such as a script that starts one Workflow, should call `,_jsx(_components.code,{children:`provider.force_flush()`}),` before they exit.`]}),_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`OpenTelemetryPlugin`}),` is marked experimental in `,_jsx(_components.code,{children:`temporalio`}),` 1.37.0. Older guides use `,_jsx(_components.code,{children:`TracingInterceptor`}),` from the same module. It still works, but its Workflow span has a duration of zero, so it doesn’t show how long the Workflow ran.`]})})]}),_jsxs(Tab,{title:`TypeScript`,id:`typescript`,children:[_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`npm`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` install`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` @temporalio/client`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` @temporalio/worker`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` @temporalio/workflow`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` @temporalio/activity`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` @temporalio/interceptors-opentelemetry-v2`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` @opentelemetry/api`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` @opentelemetry/resources`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` @opentelemetry/sdk-trace-base`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` @opentelemetry/sdk-trace-node`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` @opentelemetry/exporter-trace-otlp-proto`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` @opentelemetry/semantic-conventions`})}),`\n`]})})}),_jsxs(_components.p,{children:[`Create a tracer provider and a span processor, and pass them to the SDK’s `,_jsx(_components.code,{children:`OpenTelemetryPlugin`}),`. Do this in every process that uses Temporal, both the Worker and the code that starts Workflows, so their spans join one trace:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`15`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`15`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`// instrumentation.ts`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`resourceFromAttributes`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` '@opentelemetry/resources'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`ATTR_SERVICE_NAME`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` '@opentelemetry/semantic-conventions'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`BatchSpanProcessor`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` '@opentelemetry/sdk-trace-base'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`NodeTracerProvider`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` '@opentelemetry/sdk-trace-node'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`OTLPTraceExporter`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` '@opentelemetry/exporter-trace-otlp-proto'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`export`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` setupTracing`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`serviceName`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`string`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` resource`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`resourceFromAttributes`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`[`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:`ATTR_SERVICE_NAME`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`]:`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` serviceName`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // The exporter reads OTEL_EXPORTER_OTLP_ENDPOINT and OTEL_EXPORTER_OTLP_HEADERS.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` spanProcessor`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`new`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` BatchSpanProcessor`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`new`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` OTLPTraceExporter`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`());`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` provider`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`new`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` NodeTracerProvider`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`resource`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`spanProcessors:`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`spanProcessor`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`] });`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` provider`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`register`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`resource`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`spanProcessor`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`provider`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` };`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:``,numberOfLines:`21`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`21`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`// worker.ts`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`NativeConnection`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`Worker`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` '@temporalio/worker'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`OpenTelemetryPlugin`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` '@temporalio/interceptors-opentelemetry-v2'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` *`}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` as`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` activities`}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` from`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` './activities'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`setupTracing`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` './instrumentation'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` main`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`() {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:`resource`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:`spanProcessor`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:`provider`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` } = `}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`setupTracing`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'order-worker'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` connection`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` NativeConnection`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`connect`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`address:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 'localhost:7233'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` worker`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` Worker`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` connection`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` taskQueue:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 'orders'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` workflowsPath:`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` require`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`resolve`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'./workflows'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` activities`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` plugins:`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`new`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` OpenTelemetryPlugin`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`resource`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`spanProcessor`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` })],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` worker`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`run`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` provider`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`forceFlush`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` provider`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`shutdown`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`main`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`().`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`catch`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`((`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`e`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`error`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`e`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`); `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`process`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`exit`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`); });`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:``,numberOfLines:`17`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`17`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`// starter.ts`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`Client`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`Connection`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` '@temporalio/client'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`OpenTelemetryPlugin`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` '@temporalio/interceptors-opentelemetry-v2'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`setupTracing`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` './instrumentation'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` main`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`() {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:`resource`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:`spanProcessor`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:`provider`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` } = `}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`setupTracing`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'order-client'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` connection`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` Connection`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`connect`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`address:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 'localhost:7233'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` client`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`new`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` Client`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`connection`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`plugins:`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`new`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` OpenTelemetryPlugin`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`resource`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`spanProcessor`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` })] });`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` handle`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` client`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`workflow`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`start`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'orderWorkflow'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` args:`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'42'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`], `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`taskQueue:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 'orders'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`workflowId:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:\" `order-\"}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`Date`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`now`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` handle`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`result`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`());`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` provider`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`forceFlush`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` provider`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`shutdown`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`main`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`().`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`catch`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`((`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`e`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`error`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`e`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`); `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`process`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`exit`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`); });`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`The plugin adds a client interceptor, an Activity interceptor and a sink that exports the spans of Workflow code. The Workflow sink uses the `,_jsx(_components.code,{children:`resource`}),` and `,_jsx(_components.code,{children:`spanProcessor`}),` you pass, so pass the same ones that the provider uses. Short-lived processes, such as a script that starts one Workflow, should call `,_jsx(_components.code,{children:`provider.forceFlush()`}),` and `,_jsx(_components.code,{children:`provider.shutdown()`}),` before they exit.`]}),_jsxs(_components.p,{children:[`Use `,_jsx(_components.code,{children:`@temporalio/interceptors-opentelemetry-v2`}),` with the OpenTelemetry JS SDK 2.x. For SDK 1.x, use the older `,_jsx(_components.code,{children:`@temporalio/interceptors-opentelemetry`}),` package.`]}),_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`OpenTelemetryPlugin`}),` is marked experimental in the TypeScript SDK too.`]})})]}),_jsxs(Tab,{title:`Go`,id:`go`,children:[_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`go`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` get`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` go.temporal.io/sdk`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` go.temporal.io/sdk/contrib/opentelemetry`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` go.opentelemetry.io/otel`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` go.opentelemetry.io/otel/sdk`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`})}),`\n`]})})}),_jsxs(_components.p,{children:[`The Go SDK has no OpenTelemetry plugin. Register a tracer provider, then add the SDK’s tracing interceptor from `,_jsx(_components.code,{children:`NewTracingInterceptor`}),` to the client. Do this in every process that uses Temporal, both the Worker and the code that starts Workflows, so their spans join one trace:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`45`,language:`go`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`go`,children:_jsxs(_components.code,{language:`go`,numberOfLines:`45`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` (`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"context\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"log\"`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"go.opentelemetry.io/otel\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"go.opentelemetry.io/otel/sdk/resource\"`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` sdktrace`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"go.opentelemetry.io/otel/sdk/trace\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` semconv`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"go.opentelemetry.io/otel/semconv/v1.26.0\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"go.temporal.io/sdk/client\"`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` temporalotel`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"go.temporal.io/sdk/contrib/opentelemetry\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"go.temporal.io/sdk/interceptor\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"go.temporal.io/sdk/worker\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`ctx`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` := `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`context`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`Background`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`res`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`_`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` := `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`resource`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`Merge`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`resource`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`Default`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(), `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`resource`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`NewSchemaless`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`semconv`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`ServiceName`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"order-worker\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)))`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`texp`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`err`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` := `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`otlptracehttp`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`New`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`ctx`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`// reads the OTEL_EXPORTER_OTLP_* variables`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` err`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` != `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`nil`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` log`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`Fatal`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`err`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`tp`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` := `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`sdktrace`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`NewTracerProvider`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`sdktrace`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`WithBatcher`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`texp`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`), `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`sdktrace`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`WithResource`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`res`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`))`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`otel`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`SetTracerProvider`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`tp`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`defer`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` tp`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`Shutdown`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`ctx`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`tracing`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`err`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` := `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`temporalotel`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`NewTracingInterceptor`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`temporalotel`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`TracerOptions`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`{})`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` err`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` != `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`nil`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` log`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`Fatal`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`err`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`c`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`err`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` := `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`client`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`Dial`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`client`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`Options`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` HostPort`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"localhost:7233\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` Interceptors`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: []`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`interceptor`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`ClientInterceptor`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`tracing`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`})`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` err`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` != `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`nil`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` log`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`Fatal`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`err`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`defer`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` c`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`Close`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`w`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` := `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`worker`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`New`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`c`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"orders\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`worker`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`Options`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`{})`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`w`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`RegisterWorkflow`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`OrderWorkflow`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`w`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`RegisterActivity`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`FetchOrder`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`w`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`RegisterActivity`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`ChargeCard`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`err`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`w`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`Run`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`nil`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`A Worker created from the client uses the client’s interceptors, so you don’t pass them to `,_jsx(_components.code,{children:`worker.Options`}),` again. Short-lived processes, such as a program that starts one Workflow, should call `,_jsx(_components.code,{children:`tp.ForceFlush(ctx)`}),` and `,_jsx(_components.code,{children:`tp.Shutdown(ctx)`}),` before they exit.`]}),_jsxs(_components.p,{children:[`Unlike Python’s older `,_jsx(_components.code,{children:`TracingInterceptor`}),`, the Go interceptor’s `,_jsx(_components.code,{children:`RunWorkflow`}),` span has a real duration.`]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`spans`,children:`Spans`}),`\n`,_jsxs(_components.p,{children:[`One Workflow that runs two Activities, where `,_jsx(_components.code,{children:`charge_card`}),` fails once and succeeds on retry, produces this trace:`]}),`\n`,_jsxs(Tabs,{children:[_jsx(Tab,{title:`Python`,id:`python-2`,children:_jsx(Frame,{caption:`The Workflow trace in Bronto: 7 spans over 1.45 s, with the failed charge_card attempt and its retry`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-waterfall-python.png?fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=e301ce935df0e0951b0ec37affb611e6`,alt:`Bronto trace waterfall of OrderWorkflow in Python: StartWorkflow, RunWorkflow, StartActivity and RunActivity spans for fetch_order and charge_card, with the first charge_card attempt in error and a second attempt after the retry interval`,\"data-og-width\":`748`,width:`748`,\"data-og-height\":`400`,height:`400`,\"data-path\":`images/integrations/assets/images/temporal-waterfall-python.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-waterfall-python.png?w=280\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=88e2c1912d5862799420784293f6846a 280w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-waterfall-python.png?w=560\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=3d7d082196cf833899c591f65620eba8 560w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-waterfall-python.png?w=840\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=344acfcd7047e374c6fe767448488e25 840w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-waterfall-python.png?w=1100\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=feadc4bad65de786c6e4639e6cfc5f3c 1100w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-waterfall-python.png?w=1650\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=13a4e16befc9c2454cc0ab109c36606b 1650w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-waterfall-python.png?w=2500\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=a3005b6f65ff45dfd4b865ae877c0c0e 2500w`})})}),_jsx(Tab,{title:`TypeScript`,id:`typescript-2`,children:_jsx(Frame,{caption:`The Workflow trace in Bronto: 7 spans over 1.66 s, with the failed chargeCard attempt and its retry`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-waterfall-typescript.png?fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=4ad8bcf68683bda6b6b862545e7b33f6`,alt:`Bronto trace waterfall of orderWorkflow in TypeScript: StartWorkflow, RunWorkflow, StartActivity and RunActivity spans for fetchOrder and chargeCard, with the first chargeCard attempt in error and a second attempt after the retry interval`,\"data-og-width\":`748`,width:`748`,\"data-og-height\":`400`,height:`400`,\"data-path\":`images/integrations/assets/images/temporal-waterfall-typescript.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-waterfall-typescript.png?w=280\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=665125f256c531fad621a0da0c1b45d0 280w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-waterfall-typescript.png?w=560\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=de8795e78136fdba322687e75041d8f0 560w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-waterfall-typescript.png?w=840\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=52bda23b26c330893a063f7707661a3f 840w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-waterfall-typescript.png?w=1100\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=b12c6c7eec9b492c6422b10998f0b885 1100w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-waterfall-typescript.png?w=1650\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=3461d64a9934894353d4f48850e895c1 1650w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-waterfall-typescript.png?w=2500\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=1516d17a369327698bf93f6002368996 2500w`})})}),_jsxs(Tab,{title:`Go`,id:`go-2`,children:[_jsx(Frame,{caption:`The Workflow trace in Bronto: 8 spans over 1.08 s, with the failed ChargeCard attempt and its retry`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-waterfall-go.png?fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=71fcd580e55dbf6fef013524c3b065e2`,alt:`Bronto trace waterfall of OrderWorkflow in Go: an ask root span, then StartWorkflow, RunWorkflow, StartActivity and RunActivity spans for FetchOrder and ChargeCard, with the first ChargeCard attempt in error and a second attempt after the retry interval`,\"data-og-width\":`748`,width:`748`,\"data-og-height\":`435`,height:`435`,\"data-path\":`images/integrations/assets/images/temporal-waterfall-go.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-waterfall-go.png?w=280\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=edbc6ad4b804a6968dfd7776350d29c8 280w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-waterfall-go.png?w=560\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=7ac2974da1c3c7043e7db46b3ef7d8a9 560w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-waterfall-go.png?w=840\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=dda1cd449933243f67afe144274eb39a 840w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-waterfall-go.png?w=1100\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=e98a00cb31a9e4be77b2235994a39e39 1100w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-waterfall-go.png?w=1650\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=9bafcfee449fd06bb1eac2771bb4f345 1650w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-waterfall-go.png?w=2500\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=432f59b0aaa9f1bb39566f5d86f070b2 2500w`})}),_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`ask`}),` span at the root comes from the example’s own code that starts the Workflow, not from the interceptor.`]})]})]}),`\n`,_jsxs(_components.p,{children:[`In each trace, `,_jsx(_components.code,{children:`RunWorkflow`}),` is a child of `,_jsx(_components.code,{children:`StartWorkflow`}),`, `,_jsx(_components.code,{children:`StartActivity`}),` is a child of `,_jsx(_components.code,{children:`RunWorkflow`}),`, and each `,_jsx(_components.code,{children:`RunActivity`}),` attempt is a child of its `,_jsx(_components.code,{children:`StartActivity`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`Open `,_jsx(_components.a,{href:`/tracing/explore-traces`,children:`Tracing`}),` and select the `,_jsx(_components.code,{children:`StartWorkflow:\u003cWorkflow type>`}),` operation to find Workflows, then open a trace to see the Workflow as a waterfall. Each Activity attempt is its own `,_jsx(_components.code,{children:`RunActivity`}),` span, so retries and the wait between them are visible. A failed attempt has an error status and an exception event with the error message.`]}),`\n`,_jsxs(_components.p,{children:[`The TypeScript and Go SDKs produce the same trace. Span names use the function names of your Workflows and Activities, for example `,_jsx(_components.code,{children:`StartWorkflow:orderWorkflow`}),` and `,_jsx(_components.code,{children:`RunActivity:chargeCard`}),` in TypeScript, or `,_jsx(_components.code,{children:`RunActivity:ChargeCard`}),` in Go. In Go, the `,_jsx(_components.code,{children:`exception.type`}),` of a failed attempt is the Go error type, for example `,_jsx(_components.code,{children:`*errors.errorString`}),`.`]}),`\n`,_jsx(Frame,{caption:`A failed Activity attempt with its exception event and Temporal attributes`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-failed-activity-span.png?fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=352f6d72b5cf55e6e7248dd71afedb5d`,alt:`Span details of a failed RunActivity span in Bronto, showing the error status, the exception message and type, and the temporalActivityID, temporalRunID and temporalWorkflowID attributes`,\"data-og-width\":`748`,width:`748`,\"data-og-height\":`700`,height:`700`,\"data-path\":`images/integrations/assets/images/temporal-failed-activity-span.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-failed-activity-span.png?w=280\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=4f74b2d22b627cc026ffc09f0ea3a46a 280w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-failed-activity-span.png?w=560\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=923f04c1bef588e047a8a16a3e331b45 560w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-failed-activity-span.png?w=840\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=029973ea9e727117193828ce13baaf84 840w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-failed-activity-span.png?w=1100\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=43b420dd9052f024db9e81f274b66e11 1100w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-failed-activity-span.png?w=1650\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=64ec84500f62ebe4371166d8a6d517ba 1650w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-failed-activity-span.png?w=2500\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=4471e4566dfe9b2c2ee69a01bf018a90 2500w`})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Python and Go`}),_jsx(_components.th,{children:`TypeScript`}),_jsx(_components.th,{children:`Spans`}),_jsx(_components.th,{children:`Notes`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`temporalWorkflowID`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`temporalWorkflowId`}),` on `,_jsx(_components.code,{children:`RunActivity`}),`, `,_jsx(_components.code,{children:`workflowId`}),` on `,_jsx(_components.code,{children:`RunWorkflow`})]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`RunWorkflow`}),`, `,_jsx(_components.code,{children:`RunActivity`})]}),_jsx(_components.td,{children:`The Workflow ID. Search for it to find all spans of one Workflow`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`temporalRunID`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`run_id`}),` on `,_jsx(_components.code,{children:`RunActivity`}),`, `,_jsx(_components.code,{children:`runId`}),` on `,_jsx(_components.code,{children:`RunWorkflow`})]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`RunWorkflow`}),`, `,_jsx(_components.code,{children:`RunActivity`})]}),_jsx(_components.td,{children:`The Run ID of the Workflow Execution`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`temporalActivityID`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`temporalActivityId`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`RunActivity`})}),_jsx(_components.td,{children:`The Activity ID`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`In TypeScript, the `,_jsx(_components.code,{children:`RunWorkflow`}),` span also carries `,_jsx(_components.code,{children:`workflowType`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`RunWorkflow`}),` span lasts from the start of the Workflow to its completion. The root `,_jsx(_components.code,{children:`StartWorkflow`}),` span ends when the Temporal Service accepts the start request, so its duration is the latency of that call, not of the Workflow.`]}),`\n`,_jsx(Heading,{level:`2`,id:`trace-ai-agents-on-temporal`,children:`Trace AI agents on Temporal`}),`\n`,_jsx(_components.p,{children:`An agent on Temporal runs its model requests and tool calls from Workflow and Activity code, so they can join the Workflow’s trace. How you run the agent depends on the language.`}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Python`,id:`python-3`,children:[_jsxs(_components.p,{children:[`Temporal’s `,_jsx(_components.a,{href:`https://docs.temporal.io/develop/python/integrations/claude-agent-sdk`,children:`Claude Agent SDK integration`}),` runs a Claude agent inside a Workflow. The agent runs in a Claude Code subprocess that the Worker starts from an Activity. Tools can call Activities, so a crash doesn’t lose the run. The integration doesn’t emit spans of its own, but `,_jsx(_components.code,{children:`OpenTelemetryPlugin`}),` passes the trace context to the Claude Code subprocess. With Claude Code’s telemetry turned on, its model requests and tool calls join the Workflow’s trace.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`pip`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` install`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` temporalio`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` temporalio-claude-agent-sdk`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` claude-agent-sdk`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` opentelemetry-sdk`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` opentelemetry-exporter-otlp-proto-http`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:``,numberOfLines:`53`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`53`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` asyncio`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` datetime `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` timedelta`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` typing `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` Any`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` claude_agent_sdk `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` ClaudeAgentOptions, ClaudeSDKClient, ResultMessage, create_sdk_mcp_server, tool`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` temporalio `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` activity, workflow`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` temporalio.claude_agent_sdk `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` ClaudeAgentSDKPlugin, TemporalTransport`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` temporalio.client `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` Client`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` temporalio.contrib.opentelemetry `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` OpenTelemetryPlugin`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` temporalio.exceptions `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` ApplicationError`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` temporalio.worker `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` Worker`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`@activity.defn`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` def`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` fetch_weather`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`city`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) -> `}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` f`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"It is 21 C and sunny in `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`city`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`.\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`@tool`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"get_weather\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Get the current weather in a city\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, {`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"city\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`})`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` def`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` get_weather`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`args`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: dict[`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, Any]) -> dict[`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, Any]:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` text = `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` workflow.execute_activity(fetch_weather, args[`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"city\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`], `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`start_to_close_timeout`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=timedelta(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`seconds`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`30`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`))`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"content\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: [{`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"text\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"text\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: text}]}`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`@workflow.defn`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`class`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:` WeatherAgent`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` @workflow.run`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` async`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` def`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` run`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`self`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`prompt`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) -> `}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` options = ClaudeAgentOptions(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"claude-haiku-5-5\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` tools`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=[],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` setting_sources`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=[],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` mcp_servers`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`={`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"demo\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: create_sdk_mcp_server(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"demo\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`tools`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=[get_weather])},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` allowed_tools`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=[`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"mcp__demo__get_weather\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` async`}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` with`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` ClaudeSDKClient(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`options`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=options, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`transport`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=TemporalTransport(options)) `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` client:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` client.query(prompt)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` async`}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` for`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` msg `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`in`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` client.receive_response():`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` isinstance`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(msg, ResultMessage):`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` # Failed runs also arrive as a ResultMessage. Raise, so they count as failed Workflows.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` msg.is_error `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`or`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` msg.subtype != `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"success\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` raise`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` ApplicationError(`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"The agent run failed: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`msg.subtype`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` msg.result `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`or`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` raise`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:` RuntimeError`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"The agent returned no result\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` def`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` main`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`():`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` # Register the tracer provider as in the previous section, then:`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` client = `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` Client.connect(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"localhost:7233\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` plugins`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=[OpenTelemetryPlugin(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`add_temporal_spans`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`), ClaudeAgentSDKPlugin()],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` worker = Worker(client, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`task_queue`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"agents\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`workflows`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=[WeatherAgent], `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`activities`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=[fetch_weather])`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` worker.run()`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` __name__`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` == `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"__main__\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` asyncio.run(main())`})}),`\n`]})})}),_jsxs(_components.p,{children:[`Start the event loop under `,_jsx(_components.code,{children:`if __name__ == \"__main__\":`}),` in any module that defines a Workflow. Temporal imports the module again in its Workflow sandbox to validate it.`]}),_jsxs(_components.p,{children:[`Turn on Claude Code’s trace export in the Worker’s environment. The Claude Code subprocess inherits it, together with the `,_jsx(_components.code,{children:`OTEL_EXPORTER_OTLP_*`}),` variables from `,_jsx(_components.a,{href:`#send-traces-and-metrics-to-bronto`,children:`Send traces and metrics to Bronto`}),` and `,_jsx(_components.code,{children:`ANTHROPIC_API_KEY`}),`:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` CLAUDE_CODE_ENABLE_TELEMETRY`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`1`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` CLAUDE_CODE_ENHANCED_TELEMETRY_BETA`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`1`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` OTEL_TRACES_EXPORTER`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`otlp`})]}),`\n`]})})}),_jsx(Warning,{children:_jsxs(_components.p,{children:[`Don’t pass these variables, or any API key, through `,_jsx(_components.code,{children:`ClaudeAgentOptions.env`}),`. The options are part of the Workflow’s input, so they’re stored in its Event History.`]})}),_jsx(_components.p,{children:`One agent run produces this trace (trimmed):`}),_jsx(Frame,{caption:`The agent trace in Bronto: 58 spans over 7.83 s. The top rows show the Workflow, the Claude Code subprocess and its model requests and tool call`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-agent-waterfall-python.png?fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=cf3f2150cfc886dd7941e808713e8bd8`,alt:`Bronto trace waterfall of the Python weather agent: StartWorkflow, RunWorkflow and a StartActivity with RunActivity that starts the Claude Code subprocess, with a claude_code.interaction span that contains three claude_code.llm_request spans and a claude_code.tool span with blocked_on_user and execution children`,\"data-og-width\":`748`,width:`748`,\"data-og-height\":`583`,height:`583`,\"data-path\":`images/integrations/assets/images/temporal-agent-waterfall-python.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-agent-waterfall-python.png?w=280\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=0a68e51eec2aca78c001492dd2f65edf 280w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-agent-waterfall-python.png?w=560\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=2671f34d9c31c359da547ce2f3f1ff51 560w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-agent-waterfall-python.png?w=840\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=7af1891054e01094d14a98378a3bbdfc 840w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-agent-waterfall-python.png?w=1100\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=a53fd7869017050d9d3ac2c6869fe32f 1100w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-agent-waterfall-python.png?w=1650\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=73aa68cf51b30ef4af64a93a18ac217e 1650w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-agent-waterfall-python.png?w=2500\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=5d7a78f15a2ed1a4676010e6162fdcc5 2500w`})}),_jsxs(_components.p,{children:[`The screenshot shows the first rows only. Below them the trace continues with sibling `,_jsx(_components.code,{children:`StartActivity`}),` and `,_jsx(_components.code,{children:`RunActivity`}),` spans for the tool, and the `,_jsx(_components.code,{children:`claude-agent-sdk-read`}),`, `,_jsx(_components.code,{children:`claude-agent-sdk-write`}),` and `,_jsx(_components.code,{children:`claude-agent-sdk-close`}),` Activities. The `,_jsx(_components.code,{children:`ask-agent`}),` span at the root comes from the example’s own code that starts the Workflow.`]}),_jsxs(_components.p,{children:[`The Workflow also runs `,_jsx(_components.code,{children:`claude-agent-sdk-read`}),` and `,_jsx(_components.code,{children:`claude-agent-sdk-write`}),` Activities to exchange messages with the subprocess. They show up as sibling spans under `,_jsx(_components.code,{children:`RunWorkflow`}),`.`]})]}),_jsxs(Tab,{title:`TypeScript`,id:`typescript-3`,children:[_jsxs(_components.p,{children:[`Temporal doesn’t have a Claude Agent SDK integration for TypeScript. Run the agent from an Activity with `,_jsx(_components.code,{children:`@anthropic-ai/claude-agent-sdk`}),`, and pass the Activity’s trace context to the Claude Code subprocess in `,_jsx(_components.code,{children:`TRACEPARENT`}),`. Temporal retries the Activity if it fails, but the agent loop isn’t durable step by step: a retry starts the agent again.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`npm`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` install`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` @anthropic-ai/claude-agent-sdk`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` @anthropic-ai/sdk`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` zod`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:``,numberOfLines:`38`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`38`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`// activities.ts`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`Context`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` '@temporalio/activity'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`context`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`propagation`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` '@opentelemetry/api'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`createSdkMcpServer`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`query`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`tool`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` '@anthropic-ai/claude-agent-sdk'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`z`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 'zod'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` getWeather`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`tool`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'get_weather'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'Get the current weather in a city'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, { `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`city:`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` z`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`string`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`() }, `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` ({ `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`city`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }) `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` ({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` content:`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` [{ `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`type:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 'text'`}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` as`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`text:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:\" `It is 21 C and sunny in \"}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`city`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:\".`\"}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}));`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`export`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` async`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` runAgent`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`prompt`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`string`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`): `}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`Promise`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`string`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`> {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // Hand the Activity's trace context to the Claude Code subprocess. Claude Code reads TRACEPARENT.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` carrier`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`Record`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`string`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`string`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`> = {};`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` propagation`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`inject`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`context`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`active`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(), `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`carrier`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` env`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`Record`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`string`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`string`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` | `}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`undefined`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`> = { ...`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`process`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` };`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`carrier`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`traceparent`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:`TRACEPARENT`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`carrier`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`traceparent`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` q`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`query`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` prompt`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` options:`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` model:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 'claude-haiku-5-5'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` tools:`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` [],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` settingSources:`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` [],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` mcpServers:`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`demo:`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` createSdkMcpServer`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`name:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 'demo'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`tools:`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`getWeather`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`] }) },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` allowedTools:`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'mcp__demo__get_weather'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` maxTurns:`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:` 4`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` env`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` for`}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` msg`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` of`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` q`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` Context`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`current`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`().`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`heartbeat`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`msg`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`type`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` !== `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'result'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`continue`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // API errors can arrive with subtype 'success' and is_error set. Throw, so the Activity retries and counts as failed.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`msg`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`subtype`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` === `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'success'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` \u0026\u0026 !`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`msg`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`is_error`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`return`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` msg`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`result`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` throw`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` Error`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:\"`The agent run failed: \"}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`msg`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`subtype`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` throw`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` Error`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'The agent returned no result'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:``,numberOfLines:`12`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`12`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`// workflows.ts`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`proxyActivities`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` '@temporalio/workflow'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` type`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` *`}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` as`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` activities`}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` from`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` './activities'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:`runAgent`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` } = `}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`proxyActivities`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`typeof`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` activities`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`>({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` startToCloseTimeout:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` '5 minutes'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` retry:`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`maximumAttempts:`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:` 2`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`export`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` async`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` weatherAgent`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`prompt`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`string`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`): `}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`Promise`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`string`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`> {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` runAgent`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`prompt`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsxs(_components.p,{children:[`Register the Worker with `,_jsx(_components.code,{children:`OpenTelemetryPlugin`}),` as in the previous section. `,_jsx(_components.code,{children:`@anthropic-ai/claude-agent-sdk`}),` is ESM-only: compiling a CommonJS project that imports it with `,_jsx(_components.code,{children:`tsc`}),` fails. The examples were run with `,_jsx(_components.code,{children:`tsx`}),`.`]}),_jsxs(_components.p,{children:[`Claude Code inherits the environment you pass in `,_jsx(_components.code,{children:`env`}),`. Turn on its trace export in the Worker’s environment, together with the `,_jsx(_components.code,{children:`OTEL_EXPORTER_OTLP_*`}),` variables from `,_jsx(_components.a,{href:`#send-traces-and-metrics-to-bronto`,children:`Send traces and metrics to Bronto`}),` and `,_jsx(_components.code,{children:`ANTHROPIC_API_KEY`}),`. Set `,_jsx(_components.code,{children:`OTEL_SERVICE_NAME`}),` there for the Claude Code spans, for example `,_jsx(_components.code,{children:`claude-code`}),`. The Worker’s own spans use the service name from its tracer provider.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` CLAUDE_CODE_ENABLE_TELEMETRY`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`1`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` CLAUDE_CODE_ENHANCED_TELEMETRY_BETA`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`1`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` OTEL_TRACES_EXPORTER`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`otlp`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`The Activity runs in the Worker, so `,_jsx(_components.code,{children:`options.env`}),` isn’t stored in the Workflow’s history. Keep secrets in the Worker’s environment anyway, and don’t pass them as Activity arguments.`]}),_jsx(_components.p,{children:`One agent run produces this trace:`}),_jsx(Frame,{caption:`The agent trace in Bronto: 11 spans over 11 s, from the Workflow to Claude Code's model requests and tool call`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-agent-waterfall-typescript.png?fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=c09ca29a59f882174ff1e0126dc6a0ed`,alt:`Bronto trace waterfall of the TypeScript weather agent: StartWorkflow, RunWorkflow, StartActivity and RunActivity:runAgent, with a claude_code.interaction span that contains three claude_code.llm_request spans and a claude_code.tool span with blocked_on_user and execution children`,\"data-og-width\":`748`,width:`748`,\"data-og-height\":`539`,height:`539`,\"data-path\":`images/integrations/assets/images/temporal-agent-waterfall-typescript.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-agent-waterfall-typescript.png?w=280\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=5b22848e435baa8842ebfd58e719ece5 280w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-agent-waterfall-typescript.png?w=560\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=654afd148fc5a62aa1d188ce0fe869e1 560w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-agent-waterfall-typescript.png?w=840\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=c654f463b7d91eb026cd2d5491171d66 840w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-agent-waterfall-typescript.png?w=1100\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=f9f058e4fb8b3a3ed636d52347f4e5d7 1100w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-agent-waterfall-typescript.png?w=1650\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=e05b93cda5ffdd71ef5753804c00baa5 1650w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-agent-waterfall-typescript.png?w=2500\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=62e4434b60e460f26bae7d77c199fa37 2500w`})}),_jsx(_components.p,{children:`The tool runs in the Activity’s process, so there is no Workflow span for it.`})]}),_jsxs(Tab,{title:`Go`,id:`go-3`,children:[_jsxs(_components.p,{children:[`There is no Claude Agent SDK for Go. Call the Claude API with the `,_jsx(_components.a,{href:`https://github.com/anthropics/anthropic-sdk-go`,children:`Anthropic Go SDK`}),` from an Activity. The SDK has built-in OpenTelemetry support: it creates an `,_jsx(_components.code,{children:`anthropic.messages.create`}),` span for each API call, as a child of the Activity span. It uses the tracer provider you registered with `,_jsx(_components.code,{children:`otel.SetTracerProvider`}),`, so you don’t need a separate instrumentation package.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`go`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` get`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` github.com/anthropics/anthropic-sdk-go`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:``,numberOfLines:`19`,language:`go`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`go`,children:_jsxs(_components.code,{language:`go`,numberOfLines:`19`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`func`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` AskClaude`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`ctx`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:` context`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`Context`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`prompt`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:` string`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) (`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`string`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`error`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` c`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` := `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`anthropic`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`NewClient`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`() `}),_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`// ANTHROPIC_API_KEY from the environment`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` msg`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`err`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` := `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`c`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`Messages`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`New`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`ctx`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`anthropic`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`MessageNewParams`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` Model`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"claude-haiku-5-5\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` MaxTokens`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`64`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` Messages`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: []`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`anthropic`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`MessageParam`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`anthropic`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`NewUserMessage`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`anthropic`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`NewTextBlock`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`prompt`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`))},`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` })`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` err`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` != `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`nil`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`err`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` msg`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`Content`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`].`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`Text`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`nil`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`func`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` AgentWorkflow`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`ctx`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:` workflow`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`Context`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`prompt`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:` string`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) (`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`string`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`error`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` ctx`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`workflow`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`WithActivityOptions`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`ctx`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`workflow`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`ActivityOptions`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`StartToCloseTimeout`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`time`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`Minute`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`})`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` var`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` out`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:` string`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` err`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` := `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`workflow`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`ExecuteActivity`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`ctx`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`AskClaude`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`prompt`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`Get`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`ctx`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, \u0026`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`out`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` out`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`err`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsxs(_components.p,{children:[`Pass the Activity’s `,_jsx(_components.code,{children:`ctx`}),` to the API call, so the span joins the trace. Keep the API key in the Worker’s environment, not in Workflow input.`]}),_jsx(_components.p,{children:`One run produces this trace:`}),_jsx(Frame,{caption:`The agent trace in Bronto: 6 spans over 730 ms, ending in the Anthropic API call`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-agent-waterfall-go.png?fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=0b1c25dd73b7fc643a353e89b0309748`,alt:`Bronto trace waterfall of the Go agent: an ask root span, StartWorkflow, RunWorkflow, StartActivity and RunActivity:AskClaude, with the anthropic.messages.create span as a downstream call under the Activity`,\"data-og-width\":`748`,width:`748`,\"data-og-height\":`364`,height:`364`,\"data-path\":`images/integrations/assets/images/temporal-agent-waterfall-go.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-agent-waterfall-go.png?w=280\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=4af28aed212bcb0bd8f0a4e0d58dcbf8 280w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-agent-waterfall-go.png?w=560\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=eefea4157b40ab1f62bc8779b9c19c91 560w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-agent-waterfall-go.png?w=840\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=9a6f8bfad9cacdbc888b9baadd442041 840w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-agent-waterfall-go.png?w=1100\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=64bae899c006ae549ca47cf2e1e60585 1100w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-agent-waterfall-go.png?w=1650\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=fecd212f916dccd22d274fb0382d172a 1650w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-agent-waterfall-go.png?w=2500\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=805abc0dec2cd0eb550bfe79e1adcbb4 2500w`})}),_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`ask`}),` span at the root comes from the example’s own code that starts the Workflow. The last span, `,_jsx(_components.code,{children:`anthropic.messages.create`}),`, is the API call.`]}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Spans`}),_jsx(_components.th,{children:`Notes`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`gen_ai.request.model`}),`, `,_jsx(_components.code,{children:`gen_ai.response.model`})]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`anthropic.messages.create`})}),_jsx(_components.td,{children:`The requested and the served model`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`gen_ai.usage.input_tokens`}),`, `,_jsx(_components.code,{children:`gen_ai.usage.output_tokens`})]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`anthropic.messages.create`})}),_jsx(_components.td,{children:`Tokens of the request`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`gen_ai.usage.cache_read.input_tokens`}),`, `,_jsx(_components.code,{children:`gen_ai.usage.cache_write.input_tokens`})]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`anthropic.messages.create`})}),_jsx(_components.td,{children:`Prompt cache tokens`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`gen_ai.operation.name`}),`, `,_jsx(_components.code,{children:`gen_ai.provider.name`})]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`anthropic.messages.create`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`chat`}),` and `,_jsx(_components.code,{children:`anthropic`})]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`gen_ai.response.id`}),`, `,_jsx(_components.code,{children:`anthropic.request.id`})]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`anthropic.messages.create`})}),_jsx(_components.td,{children:`IDs of the response and the request`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`anthropic.message.stop_reason`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`anthropic.messages.create`})}),_jsxs(_components.td,{children:[`For example `,_jsx(_components.code,{children:`end_turn`})]})]})]})]}),_jsxs(_components.p,{children:[`The span also carries your Anthropic organization and workspace IDs in `,_jsx(_components.code,{children:`anthropic.organization.id`}),` and `,_jsx(_components.code,{children:`anthropic.workspace.id`}),`. It has no `,_jsx(_components.code,{children:`ttft_ms`}),` or `,_jsx(_components.code,{children:`gen_ai.response.finish_reasons`}),`. There are no `,_jsx(_components.code,{children:`claude_code.tool`}),` spans: a Go agent’s tool calls are your own code, so run each tool as an Activity to get a `,_jsx(_components.code,{children:`RunActivity`}),` span for it. By default, the span contains no prompts or responses.`]})]})]}),`\n`,_jsxs(_components.p,{children:[`The Python and TypeScript agents run in Claude Code, so their model requests and tool calls are `,_jsx(_components.code,{children:`claude_code.*`}),` spans:`]}),`\n`,_jsx(Frame,{caption:`A claude_code.llm_request span with model, token counts and time to first token`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-claude-llm-request-span.png?fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=e2ea9f2616259b572dfb3bc086c4a885`,alt:`Span details of a claude_code.llm_request span in Bronto, showing the model, input, output and cache tokens, time to first token and the stop reason`,\"data-og-width\":`748`,width:`748`,\"data-og-height\":`552`,height:`552`,\"data-path\":`images/integrations/assets/images/temporal-claude-llm-request-span.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-claude-llm-request-span.png?w=280\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=42650aaf5917d92ef95285d07e68d1e9 280w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-claude-llm-request-span.png?w=560\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=8354850ae65703dc14b2ca1e3d502c07 560w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-claude-llm-request-span.png?w=840\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=eed2f7ad00ddf301ecd10c1ef29d052c 840w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-claude-llm-request-span.png?w=1100\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=1029497b6bb05ba96902223208e0f638 1100w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-claude-llm-request-span.png?w=1650\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=ff017e22864036b058e941eaff9c6507 1650w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-claude-llm-request-span.png?w=2500\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=d8aaa1c7a83ef0f89f4fea9789c02a71 2500w`})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Spans`}),_jsx(_components.th,{children:`Notes`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`gen_ai.request.model`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`claude_code.llm_request`})}),_jsx(_components.td,{children:`The model`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`input_tokens`}),`, `,_jsx(_components.code,{children:`output_tokens`})]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`claude_code.llm_request`})}),_jsx(_components.td,{children:`Tokens of one request`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`cache_read_tokens`}),`, `,_jsx(_components.code,{children:`cache_creation_tokens`})]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`claude_code.llm_request`})}),_jsx(_components.td,{children:`Prompt cache tokens`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ttft_ms`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`claude_code.llm_request`})}),_jsx(_components.td,{children:`Time to first token, in milliseconds`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`gen_ai.response.finish_reasons.0`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`claude_code.llm_request`})}),_jsxs(_components.td,{children:[`For example `,_jsx(_components.code,{children:`tool_use`}),` or `,_jsx(_components.code,{children:`end_turn`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`gen_ai.tool.name`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`claude_code.tool`})}),_jsxs(_components.td,{children:[`The tool, for example `,_jsx(_components.code,{children:`mcp__demo__get_weather`})]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`gen_ai.conversation.id`}),`, `,_jsx(_components.code,{children:`session.id`})]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`claude_code.llm_request`}),`, `,_jsx(_components.code,{children:`claude_code.tool`})]}),_jsx(_components.td,{children:`The Claude Code session. Search for it to find all spans of one agent run`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`In the TypeScript run (Claude Code 2.1.332), `,_jsx(_components.code,{children:`gen_ai.tool.name`}),` was the tool name without the MCP prefix, `,_jsx(_components.code,{children:`get_weather`}),`. The prefixed name `,_jsx(_components.code,{children:`mcp__demo__get_weather`}),` was in `,_jsx(_components.code,{children:`tool_name`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`By default, the spans contain no prompts, responses or tool arguments. For the settings that add them, see `,_jsx(_components.a,{href:`https://code.claude.com/docs/en/monitoring-usage`,children:`Claude Code: Monitoring`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`send-temporal-sdk-metrics`,children:`Send Temporal SDK metrics`}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Python`,id:`python-4`,children:[_jsxs(_components.p,{children:[`The Temporal SDK has its own metrics exporter, separate from the OpenTelemetry Python SDK. It doesn’t read the `,_jsx(_components.code,{children:`OTEL_EXPORTER_OTLP_*`}),` variables, so pass the endpoint and API key in code. The example reads the key from its own variable:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` BRONTO_API_KEY`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cYOUR_API_KEY>\"`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`Configure the exporter on a `,_jsx(_components.code,{children:`Runtime`}),` and pass the runtime to the client:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`24`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`24`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` os`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` datetime `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` timedelta`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` temporalio.client `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` Client`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` temporalio.contrib.opentelemetry `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` OpenTelemetryPlugin`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` temporalio.runtime `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` OpenTelemetryConfig, OpenTelemetryMetricTemporality, Runtime, TelemetryConfig`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`runtime = Runtime(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` telemetry`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=TelemetryConfig(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` metric_prefix`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"temporal_\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` metrics`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=OpenTelemetryConfig(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` url`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"https://ingestion.eu.bronto.io/v1/metrics\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` headers`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`={`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"x-bronto-api-key\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: os.environ[`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"BRONTO_API_KEY\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`]},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` http`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` metric_temporality`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=OpenTelemetryMetricTemporality.DELTA,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` metric_periodicity`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=timedelta(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`seconds`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`60`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`),`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` ),`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`client = `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` Client.connect(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"localhost:7233\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` runtime`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=runtime,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` plugins`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=[OpenTelemetryPlugin(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`add_temporal_spans`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),_jsx(_components.p,{children:`Differences from the OpenTelemetry SDK exporter:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Use the `,_jsxs(_components.strong,{children:[`full URL including `,_jsx(_components.code,{children:`/v1/metrics`})]}),`. Unlike the OpenTelemetry SDK, it doesn’t append the path.`]}),`\n`,_jsxs(_components.li,{children:[`Set `,_jsx(_components.code,{children:`http=True`}),`. The default is OTLP over gRPC.`]}),`\n`,_jsxs(_components.li,{children:[`Set the temporality to `,_jsx(_components.code,{children:`DELTA`}),`. With cumulative temporality, every export repeats the running total, and summing a counter in Bronto counts the same events more than once.`]}),`\n`]}),_jsxs(_components.p,{children:[`It does read `,_jsx(_components.code,{children:`OTEL_SERVICE_NAME`}),` for the `,_jsx(_components.code,{children:`service.name`}),` resource attribute.`]})]}),_jsxs(Tab,{title:`TypeScript`,id:`typescript-4`,children:[_jsxs(_components.p,{children:[`As in Python, the Temporal SDK has its own metrics exporter. It doesn’t read the `,_jsx(_components.code,{children:`OTEL_EXPORTER_OTLP_*`}),` variables, so pass the endpoint and API key in code. The example reads the key from `,_jsx(_components.code,{children:`BRONTO_API_KEY`}),`:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` BRONTO_API_KEY`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cYOUR_API_KEY>\"`})]}),`\n`]})})}),_jsx(_components.p,{children:`Install the runtime before you create the Worker or the client. It applies to the whole process:`}),_jsx(CodeBlock,{filename:``,numberOfLines:`16`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`Runtime`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` '@temporalio/worker'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`Runtime`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`install`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` telemetryOptions:`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` metrics:`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` metricPrefix:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 'temporal_'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` otel:`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` url:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 'https://ingestion.eu.bronto.io/v1/metrics'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` http:`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` true`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` headers:`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'x-bronto-api-key'`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:`BRONTO_API_KEY`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`! },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` metricsExportInterval:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` '60s'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` temporality:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 'delta'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),_jsxs(_components.p,{children:[`As in Python, use the `,_jsxs(_components.strong,{children:[`full URL including `,_jsx(_components.code,{children:`/v1/metrics`})]}),`, set `,_jsx(_components.code,{children:`http: true`}),` and set `,_jsx(_components.code,{children:`temporality: 'delta'`}),`.`]}),_jsxs(_components.p,{children:[`The TypeScript exporter doesn’t read `,_jsx(_components.code,{children:`OTEL_SERVICE_NAME`}),`. Its metrics arrive with the tag `,_jsx(_components.code,{children:`service_name=temporal-core-sdk`}),` and no `,_jsx(_components.code,{children:`service.name`}),`. To tell Workers apart, add your own tag with `,_jsx(_components.code,{children:`globalTags`}),`, for example `,_jsx(_components.code,{children:`globalTags: { service: 'order-worker' }`}),`, and group by it.`]})]}),_jsxs(Tab,{title:`Go`,id:`go-4`,children:[_jsxs(_components.p,{children:[`The Go SDK reports metrics through a metrics handler on the client. The contrib package’s handler wraps an OpenTelemetry meter, so it uses the OpenTelemetry Go SDK and reads the same `,_jsx(_components.code,{children:`OTEL_EXPORTER_OTLP_*`}),` variables as traces. The exporter appends `,_jsx(_components.code,{children:`/v1/metrics`}),`, and the SDK adds the `,_jsx(_components.code,{children:`temporal_`}),` prefix itself.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`go`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` get`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` go.opentelemetry.io/otel/sdk/metric`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`})}),`\n`]})})}),_jsx(CodeBlock,{filename:``,numberOfLines:`29`,language:`go`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`go`,children:_jsxs(_components.code,{language:`go`,numberOfLines:`29`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` (`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"time\"`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp\"`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` sdkmetric`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"go.opentelemetry.io/otel/sdk/metric\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"go.opentelemetry.io/otel/sdk/metric/metricdata\"`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` temporalotel`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"go.temporal.io/sdk/contrib/opentelemetry\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`mexp`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`err`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` := `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`otlpmetrichttp`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`New`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`ctx`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`otlpmetrichttp`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`WithTemporalitySelector`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` func`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`sdkmetric`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`InstrumentKind`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`metricdata`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`Temporality`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`return`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` metricdata`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`DeltaTemporality`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }))`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` err`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` != `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`nil`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` log`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`Fatal`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`err`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`mp`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` := `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`sdkmetric`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`NewMeterProvider`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`sdkmetric`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`WithResource`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`res`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` sdkmetric`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`WithReader`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`sdkmetric`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`NewPeriodicReader`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`mexp`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`sdkmetric`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`WithInterval`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`60`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`*`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`time`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`Second`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`))))`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`defer`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` mp`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`Shutdown`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`ctx`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`handler`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` := `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`temporalotel`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`NewMetricsHandler`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`temporalotel`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`MetricsHandlerOptions`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` Meter`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`mp`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`Meter`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"temporal-sdk-go\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` UseMonotonicCounters`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` OnError`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`func`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`err`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:` error`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) { `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`log`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`Println`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"metrics:\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`err`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) },`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`})`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`c`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`err`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` := `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`client`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`Dial`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`client`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`Options`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` HostPort`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"localhost:7233\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` Interceptors`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: []`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`interceptor`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`ClientInterceptor`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`tracing`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` MetricsHandler`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`handler`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`})`})}),`\n`]})})}),_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Set the temporality to delta, as in Python. With cumulative temporality, summing a counter in Bronto counts the same events more than once.`}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`UseMonotonicCounters`}),` exports the SDK’s counters as monotonic sums.`]}),`\n`,_jsxs(_components.li,{children:[`Without `,_jsx(_components.code,{children:`OnError`}),`, the handler panics when the meter returns an error.`]}),`\n`,_jsxs(_components.li,{children:[`Call `,_jsx(_components.code,{children:`mp.ForceFlush(ctx)`}),` and `,_jsx(_components.code,{children:`mp.Shutdown(ctx)`}),` before a short-lived process exits, so the last interval is exported.`]}),`\n`]})]})]}),`\n`,_jsxs(_components.p,{children:[`The metrics appear in `,_jsx(_components.a,{href:`/metrics/explore-metrics`,children:`Metrics Explorer`}),` with the `,_jsx(_components.code,{children:`temporal_`}),` prefix. Useful ones:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Metric`}),_jsx(_components.th,{children:`What it measures`}),_jsx(_components.th,{children:`Group by`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`temporal_workflow_completed`}),`, `,_jsx(_components.code,{children:`temporal_workflow_failed`})]}),_jsx(_components.td,{children:`Workflows that completed or failed`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`workflow_type`}),`, `,_jsx(_components.code,{children:`task_queue`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`temporal_workflow_endtoend_latency`})}),_jsx(_components.td,{children:`Time from Workflow start to completion`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`workflow_type`}),`, `,_jsx(_components.code,{children:`task_queue`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`temporal_activity_execution_failed`})}),_jsx(_components.td,{children:`Failed Activity attempts, including attempts that are retried`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`activity_type`}),`, `,_jsx(_components.code,{children:`workflow_type`}),`, `,_jsx(_components.code,{children:`task_queue`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`temporal_activity_execution_latency`})}),_jsx(_components.td,{children:`Time an Activity attempt took to run`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`activity_type`}),`, `,_jsx(_components.code,{children:`workflow_type`}),`, `,_jsx(_components.code,{children:`task_queue`})]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`temporal_activity_schedule_to_start_latency`}),`, `,_jsx(_components.code,{children:`temporal_workflow_task_schedule_to_start_latency`})]}),_jsx(_components.td,{children:`Time tasks waited in the Task Queue. A rising value means you need more Workers`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`task_queue`})})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`temporal_worker_task_slots_available`}),`, `,_jsx(_components.code,{children:`temporal_worker_task_slots_used`})]}),_jsx(_components.td,{children:`Worker capacity`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`task_queue`}),`, `,_jsx(_components.code,{children:`worker_type`})]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`temporal_request`}),`, `,_jsx(_components.code,{children:`temporal_request_latency`})]}),_jsx(_components.td,{children:`Calls from the SDK to the Temporal Service`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`operation`})})]})]})]}),`\n`,_jsx(Frame,{caption:`temporal_activity_execution_failed grouped by activity_type`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-activity-failed-metric.png?fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=8338d3cc6dd22a5f2412d9fc42bbcefe`,alt:`Bronto Metrics Explorer showing temporal_activity_execution_failed as a sum grouped by activity_type, with one failure for charge_card`,\"data-og-width\":`1400`,width:`1400`,\"data-og-height\":`305`,height:`305`,\"data-path\":`images/integrations/assets/images/temporal-activity-failed-metric.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-activity-failed-metric.png?w=280\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=2cba50559424c6adb600eecb33b5d002 280w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-activity-failed-metric.png?w=560\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=e6fb0cfe9b40b50c14b889c8b6dd30f6 560w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-activity-failed-metric.png?w=840\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=cb1d708cbb3cbd97f26e320f589ac8c1 840w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-activity-failed-metric.png?w=1100\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=7386f5503b0e4d9ed091fe265fd4622b 1100w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-activity-failed-metric.png?w=1650\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=e59a107dd103e32d8b5f9b7ead54c204 1650w, https://mintcdn.com/bronto/_Nx3BR7Rshe2zZlA/images/integrations/assets/images/temporal-activity-failed-metric.png?w=2500\u0026fit=max\u0026auto=format\u0026n=_Nx3BR7Rshe2zZlA\u0026q=85\u0026s=63e8146a964612bd152819bbdee57dbb 2500w`})}),`\n`,_jsxs(_components.p,{children:[`All of them also carry `,_jsx(_components.code,{children:`namespace`}),`. For the full list of metrics and their tags, see the `,_jsx(_components.a,{href:`https://docs.temporal.io/references/sdk-metrics`,children:`Temporal SDK metrics reference`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`The TypeScript and Go SDKs emit the same metric names. Their `,_jsx(_components.code,{children:`workflow_type`}),` and `,_jsx(_components.code,{children:`activity_type`}),` values are the function names, for example `,_jsx(_components.code,{children:`chargeCard`}),` in TypeScript. Go keeps Go casing, for example `,_jsx(_components.code,{children:`ChargeCard`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`Latency metrics are in milliseconds in Python and TypeScript, and in seconds in Go. A Workflow that ran 1.07 seconds has a `,_jsx(_components.code,{children:`temporal_workflow_endtoend_latency`}),` of `,_jsx(_components.code,{children:`1.07`}),` in Go. Keep this in mind when you compare Workers in different languages or set monitor thresholds.`]}),`\n`,_jsx(Heading,{level:`2`,id:`alert-on-failures`,children:`Alert on failures`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.a,{href:`/core-features/monitors`,children:`Monitors`}),` evaluate log datasets and metrics, not spans. Create a metric monitor on `,_jsx(_components.code,{children:`temporal_workflow_failed`}),` or `,_jsx(_components.code,{children:`temporal_activity_execution_failed`}),` with `,_jsx(_components.strong,{children:`Sum`}),` over a time window, grouped by `,_jsx(_components.code,{children:`workflow_type`}),` or `,_jsx(_components.code,{children:`activity_type`}),`. A monitor on `,_jsx(_components.code,{children:`temporal_activity_schedule_to_start_latency`}),` tells you when Workers fall behind.`]}),`\n`,_jsx(Heading,{level:`2`,id:`verify-in-bronto`,children:`Verify in Bronto`}),`\n`,_jsxs(_components.p,{children:[`Start a Workflow, then open `,_jsx(_components.a,{href:`/tracing/explore-traces`,children:`Tracing`}),` and filter by the service names you configured. Each Workflow appears as a `,_jsx(_components.code,{children:`StartWorkflow:\u003cWorkflow type>`}),` operation. The Worker’s spans can arrive a minute or two after the client’s span. Then open `,_jsx(_components.a,{href:`/metrics/explore-metrics`,children:`Metrics Explorer`}),` and search for `,_jsx(_components.code,{children:`temporal_`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`If the client’s span appears but the Worker’s spans don’t, check that the Worker’s client also has `,_jsx(_components.code,{children:`OpenTelemetryPlugin`}),` and a tracer provider registered before `,_jsx(_components.code,{children:`Client.connect`}),`. If no metrics appear, check the full `,_jsx(_components.code,{children:`/v1/metrics`}),` URL and `,_jsx(_components.code,{children:`http=True`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`In TypeScript, check that the Worker passes `,_jsx(_components.code,{children:`OpenTelemetryPlugin`}),` to `,_jsx(_components.code,{children:`Worker.create`}),` and that `,_jsx(_components.code,{children:`provider.register()`}),` ran before the first Workflow. If no metrics appear, check the full `,_jsx(_components.code,{children:`/v1/metrics`}),` URL and `,_jsx(_components.code,{children:`http: true`}),`, and look for export errors in the Worker’s log.`]}),`\n`,_jsxs(_components.p,{children:[`In Go, check that the Worker’s client has the tracing interceptor and that you called `,_jsx(_components.code,{children:`otel.SetTracerProvider`}),` before you created the client. The Go exporters write errors to the standard `,_jsx(_components.code,{children:`log`}),` package. If a stray `,_jsx(_components.code,{children:`OTEL_EXPORTER_OTLP_INSECURE=true`}),` is set in the environment, they send plain HTTP to the endpoint and time out.`]}),`\n`,_jsx(Heading,{level:`2`,id:`references`,children:`References`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/ai-features/llm-observability`,children:`LLM Observability`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/tracing/explore-traces`,children:`Explore Traces`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`https://docs.temporal.io/develop/python/platform/observability`,children:`Temporal: Python SDK observability`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`https://docs.temporal.io/develop/typescript/platform/observability`,children:`Temporal: TypeScript SDK observability`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`https://docs.temporal.io/develop/go/observability`,children:`Temporal: Go SDK observability`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`https://docs.temporal.io/references/sdk-metrics`,children:`Temporal: SDK metrics reference`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`https://docs.temporal.io/develop/python/integrations/claude-agent-sdk`,children:`Temporal: Claude Agent SDK integration`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`https://code.claude.com/docs/en/agent-sdk/typescript`,children:`Claude Agent SDK for TypeScript`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`https://github.com/anthropics/anthropic-sdk-go`,children:`Anthropic Go SDK`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`https://code.claude.com/docs/en/monitoring-usage`,children:`Claude Code: Monitoring`})}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":"dark","config":{},"pageMetadata":{"title":"Send Temporal traces and metrics to Bronto via OpenTelemetry","sidebarTitle":"Temporal","description":"Trace Temporal Workflows, Activities and the AI agents that run in them, and send Temporal SDK metrics to Bronto with OpenTelemetry.","icon":"/images/icons/temporal.svg","href":"/integrations/temporal"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Prerequisites","slug":"prerequisites","depth":2,"children":[]},{"title":"Send traces and metrics to Bronto","slug":"send-traces-and-metrics-to-bronto","depth":2,"children":[]},{"title":"Trace Workflows and Activities","slug":"trace-workflows-and-activities","depth":2,"children":[{"title":"Spans","slug":"spans","depth":3,"children":[]}]},{"title":"Trace AI agents on Temporal","slug":"trace-ai-agents-on-temporal","depth":2,"children":[]},{"title":"Send Temporal SDK metrics","slug":"send-temporal-sdk-metrics","depth":2,"children":[]},{"title":"Alert on failures","slug":"alert-on-failures","depth":2,"children":[]},{"title":"Verify in Bronto","slug":"verify-in-bronto","depth":2,"children":[]},{"title":"References","slug":"references","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/bronto/c0c85aeb1654c085/scripts/do11y-config.js","/_mintlify/custom/bronto/a02c6c6af4e0cbe9/scripts/do11y.min.js","/_mintlify/custom/bronto/b9fe7d1728ae15af/scripts/theme-toggle.js"],"subdomain":"bronto","siteName":"Bronto Docs","title":"Send Temporal traces and metrics to Bronto via OpenTelemetry - Bronto Docs","contextualStarterQuestions":[{"_id":"6b117b08457c2cc105e3bf74","deploymentId":"67ab42c567c9a403dcded195","questionText":"How do I send SDK metrics to Bronto?","status":"active","generatedBy":"contextual","path":"integrations/temporal","createdAt":"2026-12-03T14:22:00.906Z","updatedAt":"2026-12-03T14:22:00.906Z","__v":0},{"_id":"6b117b08457c2cc105e3bf73","deploymentId":"67ab42c567c9a403dcded195","questionText":"How do I trace Temporal Workflows?","status":"active","generatedBy":"contextual","path":"integrations/temporal","createdAt":"2026-12-03T14:22:00.905Z","updatedAt":"2026-12-03T14:22:00.905Z","__v":0}],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-12-03T14:21:56.874Z","originalFileLocation":"integrations/temporal.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Trace Temporal Workflows, Activities and the AI agents that run in them, and send Temporal SDK metrics to Bronto with OpenTelemetry.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Bronto Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/bronto/VQz551XAfr4fCCWx/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/bronto/VQz551XAfr4fCCWx/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/bronto/VQz551XAfr4fCCWx/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/bronto/VQz551XAfr4fCCWx/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/bronto/VQz551XAfr4fCCWx/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/bronto/VQz551XAfr4fCCWx/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/bronto/VQz551XAfr4fCCWx/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/bronto/VQz551XAfr4fCCWx/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/bronto/VQz551XAfr4fCCWx/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Send Temporal traces and metrics to Bronto via OpenTelemetry - Bronto Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Trace Temporal Workflows, Activities and the AI agents that run in them, and send Temporal SDK metrics to Bronto with OpenTelemetry.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Bronto Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.bronto.io/integrations/temporal\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://bronto.mintlify.site/_mintlify/api/og/v2?division=LLM+Observability\u0026amp;title=Send+Temporal+traces+and+metrics+to+Bronto+via+OpenTelemetry\u0026amp;description=Trace+Temporal+Workflows%2C+Activities+and+the+AI+agents+that+run+in+them%2C+and+send+Temporal+SDK+metrics+to+Bronto+with+OpenTelemetry.\u0026amp;theme=9dad5babbe3adae7c0eb3b04\u0026amp;signature=73aed1f869e8e314dfaa5406b64b552295098a1ce83bbc08a65e0b723f373d0b\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Send Temporal traces and metrics to Bronto via OpenTelemetry - Bronto Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Trace Temporal Workflows, Activities and the AI agents that run in them, and send Temporal SDK metrics to Bronto with OpenTelemetry.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://bronto.mintlify.site/_mintlify/api/og/v2?division=LLM+Observability\u0026amp;title=Send+Temporal+traces+and+metrics+to+Bronto+via+OpenTelemetry\u0026amp;description=Trace+Temporal+Workflows%2C+Activities+and+the+AI+agents+that+run+in+them%2C+and+send+Temporal+SDK+metrics+to+Bronto+with+OpenTelemetry.\u0026amp;theme=9dad5babbe3adae7c0eb3b04\u0026amp;signature=73aed1f869e8e314dfaa5406b64b552295098a1ce83bbc08a65e0b723f373d0b\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/bronto/VQz551XAfr4fCCWx/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Bronto Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#F4C430\">\u003cmeta data-mint-head name=\"applicationName\" content=\"Bronto Docs\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.bronto.io/integrations/temporal\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/integrations/temporal.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.bronto.io/#organization\",\"name\":\"Bronto Docs\",\"url\":\"https://docs.bronto.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/bronto/XgZO_N2_fZQn0lij/logo/bronto_mark.png?fit=max\u0026auto=format\u0026n=XgZO_N2_fZQn0lij\u0026q=85\u0026s=9d3e675d8cd714b8dbd1f1753438f856\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.bronto.io#website\",\"name\":\"Bronto Docs\",\"url\":\"https://docs.bronto.io\",\"publisher\":{\"@id\":\"https://docs.bronto.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.bronto.io/integrations/temporal#webpage\",\"url\":\"https://docs.bronto.io/integrations/temporal\",\"name\":\"Send Temporal traces and metrics to Bronto via OpenTelemetry\",\"description\":\"Trace Temporal Workflows, Activities and the AI agents that run in them, and send Temporal SDK metrics to Bronto with OpenTelemetry.\",\"dateModified\":\"2026-12-03T14:21:56.874Z\",\"isPartOf\":{\"@id\":\"https://docs.bronto.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.bronto.io/integrations/temporal#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.bronto.io/integrations/temporal#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"LLM Observability\",\"item\":\"https://docs.bronto.io/ai-features/llm-observability\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Send Temporal traces and metrics to Bronto via OpenTelemetry\",\"item\":\"https://docs.bronto.io/integrations/temporal\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.bronto.io/integrations/temporal#article\",\"headline\":\"Send Temporal traces and metrics to Bronto via OpenTelemetry\",\"name\":\"Send Temporal traces and metrics to Bronto via OpenTelemetry\",\"description\":\"Trace Temporal Workflows, Activities and the AI agents that run in them, and send Temporal SDK metrics to Bronto with OpenTelemetry.\",\"url\":\"https://docs.bronto.io/integrations/temporal\",\"mainEntityOfPage\":{\"@id\":\"https://docs.bronto.io/integrations/temporal#webpage\"},\"dateModified\":\"2026-12-03T14:21:56.874Z\",\"publisher\":{\"@id\":\"https://docs.bronto.io/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.bronto.io#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Bronto Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Bronto Docs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/integrations/temporal.md","siteName":"Bronto Docs","nav":{"global":{"anchors":[{"anchor":"Trust","icon":"shield","href":"https://trust.bronto.io/"},{"anchor":"Book a Demo","icon":"calendar","href":"https://www.bronto.io/book-a-demo"},{"anchor":"Status","icon":"signal","href":"https://status.bronto.io"}]},"tabs":[{"tab":"Getting Started and UI","pages":[{"title":"Getting Started and UI","href":"/welcome"}]},{"tab":"Ingest Data","pages":[{"title":"Ingest Data","href":"/ingest-data/overview"}]},{"tab":"AI Assisted Observability","groups":[{"group":"Getting Started","pages":[{"title":"AI Overview","icon":"sparkles","href":"/ai-features/ai-welcome"},{"title":"Bronto Agent Skills","icon":"wand-sparkles","href":"/ai-features/bronto-agent-skills"}]},{"group":"MCP","pages":[{"title":"Hosted MCP Server","icon":"https://mintlify.s3.us-west-1.amazonaws.com/bronto/images/icons/mcp.svg","href":"/ai-features/hosted-mcp"},{"title":"Local MCP Server","icon":"https://mintlify.s3.us-west-1.amazonaws.com/bronto/images/icons/mcp.svg","href":"/ai-features/local-mcp"}]},{"group":"AI Investigations","pages":[{"title":"BrontoScope","icon":"scan-search","href":"/ai-features/brontoscope"},{"title":"AI Investigation Reports","icon":"file-search","href":"/ai-features/ai-investigation-reports"}]},{"group":"LLM Observability","pages":[{"title":"LLM Observability","sidebarTitle":"Overview","icon":"brain-circuit","href":"/ai-features/llm-observability"},{"title":"Amazon Bedrock LLM observability with OpenTelemetry","sidebarTitle":"AWS Bedrock","icon":"https://mintlify.s3.us-west-1.amazonaws.com/bronto/images/icons/aws-bedrock.svg","href":"/ai-features/aws-bedrock"},{"title":"Amazon Bedrock AgentCore observability with OpenTelemetry","sidebarTitle":"AWS AgentCore","icon":"https://mintlify.s3.us-west-1.amazonaws.com/bronto/images/icons/aws-agentcore.svg","href":"/ai-features/aws-agentcore"},{"title":"Microsoft Foundry observability with OpenTelemetry","sidebarTitle":"Microsoft Foundry","icon":"https://mintlify.s3.us-west-1.amazonaws.com/bronto/images/icons/azure-ai-foundry.svg","href":"/ai-features/microsoft-foundry"},{"title":"Claude Platform observability with OpenTelemetry","sidebarTitle":"Claude Platform","icon":"https://mintlify.s3.us-west-1.amazonaws.com/bronto/images/icons/claude.svg","href":"/ai-features/claude-platform"},{"title":"Send Vercel AI SDK traces to Bronto with OpenTelemetry","sidebarTitle":"Vercel AI SDK","icon":"https://mintlify.s3.us-west-1.amazonaws.com/bronto/images/icons/vercel.svg","href":"/integrations/vercel-ai-sdk"},{"title":"Send eve agent traces to Bronto","sidebarTitle":"eve","icon":"https://mintlify.s3.us-west-1.amazonaws.com/bronto/images/icons/vercel.svg","href":"/integrations/eve"},{"title":"Send OpenLLMetry traces to Bronto","sidebarTitle":"OpenLLMetry","icon":"telescope","href":"/integrations/openllmetry"},{"title":"Send LangChain traces to Bronto via OpenTelemetry","sidebarTitle":"LangChain","icon":"https://mintlify.s3.us-west-1.amazonaws.com/bronto/images/icons/langchain.svg","href":"/integrations/langchain"},{"title":"Send Pydantic AI traces to Bronto via OpenTelemetry","sidebarTitle":"Pydantic AI","description":"Send Pydantic AI agent runs, model calls, tool calls, token usage and cost to Bronto with OpenTelemetry, with or without the Logfire SDK.","icon":"https://mintlify.s3.us-west-1.amazonaws.com/bronto/images/icons/pydantic.svg","href":"/integrations/pydantic-ai"},{"title":"Send Temporal traces and metrics to Bronto via OpenTelemetry","sidebarTitle":"Temporal","icon":"https://mintlify.s3.us-west-1.amazonaws.com/bronto/images/icons/temporal.svg","href":"/integrations/temporal"}]},{"group":"LLM-Powered Parsing","pages":[{"title":"Custom Parser","description":"Generate custom log parsers automatically with LLMs to extract structured fields from Apache, IIS, HAProxy, Syslog, and custom log formats in Bronto.","icon":"braces","href":"/core-features/custom-parser"}]},{"group":"AI Integrations","pages":[{"title":"AWS DevOps Agent Integration","sidebarTitle":"AWS DevOps Agent","icon":"https://mintlify.s3.us-west-1.amazonaws.com/bronto/images/icons/aws-devops-agent.svg","href":"/ai-features/aws-devops-agent"},{"title":"n8n Integration","sidebarTitle":"n8n","icon":"https://mintlify.s3.us-west-1.amazonaws.com/bronto/images/icons/n8n.svg","href":"/ai-features/n8n"},{"title":"OpenClaw Integration","sidebarTitle":"OpenClaw","icon":"hand-grab","href":"/ai-features/openclaw"},{"title":"Vibe Building with Bronto","sidebarTitle":"Vibe Building","icon":"blocks","href":"/ai-features/vibe-building"}]}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/introduction"}]},{"tab":"CLI","pages":[{"title":"CLI","href":"/cli"}]}]},"basePath":"","title":"Send Temporal traces and metrics to Bronto via OpenTelemetry - Bronto Docs","deploymentId":"dpl_4dgnk6TA5fUgboKHTvWWyeqm3idh","buildId":"dpl_4dgnk6TA5fUgboKHTvWWyeqm3idh","dynamics":["07c022d89b","a74be98ba7","a9bb46feb3"],"chunks":["Frame-BhbIEdST.js","DynamicMarkdown-DoPsKgYC.js","zoom-image-lightbox-D-vTqM_C.js","lightbox-handle-r17bVUz3.js","Markdown-CIbHOmUi.js","AssistantPageLink-C0oSAXp0.js","dist-Bp7AI3M8.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}