Skip to main content
The Go SDK is optimized for backend services that want strongly typed runtime telemetry plus a reusable transport for provider requests. This page is the basic setup path.

Proxy Transport

Read this next if you want OpenAI or Anthropic traffic to go through WhyOps using ProxyHTTPClient().

Runtime Events

Add tool spans, prompt-caching usage, hybrid patterns, and self-hosted settings.

SDK Overview

Compare Go with the TypeScript and Python packages.

Before you start

1. Install the module

2. Create the WhyOps client once

If the agent has tools, include them in AgentMetadata.Tools. If it has no tools, using an empty slice keeps the registered definition unambiguous.

3. Initialize the agent during startup

You do not have to call this manually because trace methods initialize on first event, but early registration is the better default because configuration problems fail before live traffic.

4. Send your first runtime event

5. Move to proxy transport or richer runtime tracing

Go SDK Proxy Transport

Learn the Go-specific proxy flow: ProxyHTTPClient() injects headers only, so your provider client must still point at the WhyOps proxy host.

Go SDK Runtime Events

Add tool spans, prompt-caching usage, hybrid patterns, self-hosted overrides, and a full method map.