The SDK now requires Go 1.25 or later. Upgrade the module for your framework:
go get github.com/apitally/apitally-go/chi-v5
go get github.com/apitally/apitally-go/echo-v5
go get github.com/apitally/apitally-go/echo-v4
go get github.com/apitally/apitally-go/fiber-v3
go get github.com/apitally/apitally-go/fiber-v2
go get github.com/apitally/apitally-go/gin-v1
The Gin module has been renamed from github.com/apitally/apitally-go/gin to github.com/apitally/apitally-go/gin-v1. Update your imports and remove the old module with go mod tidy.
The SDK now authenticates with a write token instead of a client ID. Your existing app’s token (apt_...) is available under Setup instructions in the Apitally dashboard.NewConfig() no longer takes a client ID. Set the WriteToken option, or set the APITALLY_WRITE_TOKEN environment variable.
Replace the Middleware registration with a call to Init, which registers everything the SDK needs. Call it after your recovery middleware and OpenTelemetry HTTP instrumentation, and before your other middleware and routes.
Call the new apitally.Shutdown function when your application exits, after your HTTP server has stopped, so the SDK can deliver the remaining telemetry. The setup guides show the full pattern.
The RequestLoggingConfig type and the RequestLogging field have been removed. Their settings are now fields directly on Config, with the option changes listed below.
Replaced by WriteToken, which requires a new credential.
RequestLogging.LogRequestHeaders
Renamed to CaptureRequestHeaders.
RequestLogging.LogRequestBody
Renamed to CaptureRequestBody.
RequestLogging.LogResponseHeaders
Renamed to CaptureResponseHeaders.
RequestLogging.LogResponseBody
Renamed to CaptureResponseBody.
RequestLogging.MaskQueryParams
Moved to MaskQueryParams, now []string.
RequestLogging.MaskHeaders
Moved to MaskHeaders, now []string.
RequestLogging.MaskBodyFields
Moved to MaskBodyFields, now []string.
RequestLogging.ExcludePaths
Moved to ExcludePaths, now []string. Matches actual request paths instead of matched route patterns.
RequestLogging.MaskRequestBodyCallback
Moved to MaskRequestBody with new arguments.
RequestLogging.MaskResponseBodyCallback
Moved to MaskResponseBody with new arguments.
RequestLogging.ExcludeCallback
Replaced by SampleOnRequest or SampleOnResponse with new arguments and return values.
Pattern options now take regular expressions as strings instead of *regexp.Regexp values. They are matched case-insensitively unless a pattern sets its own flags, such as (?-i:...).
The request helpers, such as SetConsumer(), now take a context.Context instead of the framework’s request or context type. This changes the call sites on Echo, Fiber v2 and Chi:
Framework
Before
After
Gin
apitally.SetConsumer(c, ...)
apitally.SetConsumer(c, ...)
Echo
apitally.SetConsumer(c, ...)
apitally.SetConsumer(c.Request().Context(), ...)
Fiber v3
apitally.SetConsumer(c, ...)
apitally.SetConsumer(c, ...)
Fiber v2
apitally.SetConsumer(c, ...)
apitally.SetConsumer(c.UserContext(), ...) or c.Context()
Chi
apitally.SetConsumer(r, ...)
apitally.SetConsumer(r.Context(), ...)
SetConsumerIdentifier has been removed. Use SetConsumer with only the Identifier field set.
CaptureValidationError has been removed. Pass validation errors to CaptureError with the request context instead. See request context for the context to pass on each framework.
The SDK no longer wraps the default log/slog handler automatically. To capture logs, wrap your handler with NewSlogHandler and log with the request context, for example with slog.InfoContext:
Records logged without the request context are not linked to requests and are not captured. See request context for the context to pass on each framework.
MaskRequestBodyCallback and MaskResponseBodyCallback are now named MaskRequestBody and MaskResponseBody. Both receive (span, body), rather than the Request and Response objects. The body is passed as []byte. Request metadata is available through span.Attributes().For example, a callback that masks bodies for admin routes becomes:
Use sampling callbacks to exclude requests: SampleOnRequest for early decisions based on the request, or SampleOnResponse for decisions based on the response status or consumer. Both receive the span as their only argument.The callbacks should return 1, true to capture the request, and 0, true to exclude it. Callbacks can also return any probability between 0 and 1. Returning false as the second value from SampleOnRequest applies SampleRate, and from SampleOnResponse preserves the earlier sampling decision.For example, to capture only error responses:
Replace the ExcludeCallback option with the appropriate sampling callback. Note that captured headers and bodies are not available in sampling callbacks.Sampling affects request logs and traces, but not metrics.See sampling for details.
ExcludePaths now matches request paths rather than matched route patterns. If a pattern contains route parameters, update it to match concrete values. For example, replace ^/users/:id$ with ^/users/[^/]+$ to match /users/123.
If your application registers a tracer provider from go.opentelemetry.io/otel/sdk/trace with otel.SetTracerProvider before starting the server, the SDK automatically adds its span processor. No manual registration is required.Review these settings when upgrading:
Sampling: Previously, your provider’s sampler affected traces but not Apitally’s request logs. It now affects both. Check that its sampling rate provides the request log coverage you want. Metrics remain unsampled.
Network access: The SDK now sends data to otlp.apitally.io instead of hub.apitally.io. Update firewall allowlists if necessary.
Removed types: The ApitallyMiddleware, ApitallyConfig and ApitallyConsumer aliases and the Request and Response types have been removed from the public API.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Apitally Docs","colors":{"primary":"#0b9797","light":"#0b9797","dark":"#0b9797"},"logo":{"light":"https://mintcdn.com/apitally/N2ERaeHClCgFy9Y6/images/logo-light.svg?fit=max\u0026auto=format\u0026n=N2ERaeHClCgFy9Y6\u0026q=85\u0026s=e1d72c6d56f4625e48a29dd012b89739","dark":"https://mintcdn.com/apitally/N2ERaeHClCgFy9Y6/images/logo-dark.svg?fit=max\u0026auto=format\u0026n=N2ERaeHClCgFy9Y6\u0026q=85\u0026s=c6aecd17ce726476be3d8a32b2b8d990"},"favicon":"https://mintcdn.com/apitally/TB-PurCnjfcCoHVd/images/favicon.svg?fit=max\u0026auto=format\u0026n=TB-PurCnjfcCoHVd\u0026q=85\u0026s=a6cf7d03f3f69f4fec43387790813a2b","background":{"image":"https://mintcdn.com/apitally/N2ERaeHClCgFy9Y6/images/background.webp?fit=max\u0026auto=format\u0026n=N2ERaeHClCgFy9Y6\u0026q=85\u0026s=da30315f44124609083957a5c3b96a38","color":{"dark":"#0e1515"}},"navbar":{"links":[{"href":"https://app.apitally.io","label":"Log in"}],"primary":{"type":"button","label":"Sign up","href":"https://app.apitally.io?signup"}},"footer":{"socials":{"github":"https://github.com/apitally","twitter":"https://twitter.com/apitally_io","linkedin":"https://www.linkedin.com/company/apitally"}},"integrations":{"posthog":{"apiKey":"phc_kOKUlIHUZPLsz5a6Bqix8h7uy5zl7SaMWSDlXhLVZka","apiHost":"https://ph.apitally.io"},"plausible":{"domain":"docs.apitally.io","server":"plsbl.apitally.io"}},"interaction":{"drilldown":false},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"apitally","hasAudioNarration":false,"actualSubdomain":"apitally","customDomains":["docs.apitally.io"],"gitSource":{"type":"github","owner":"apitally","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ade9b78500a4c24cc4c13e7","collectionId":"cf3c81e5-79af-4560-a52e-aa10732f3fe4","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ade9b78500a4c24cc4c13e7"},"feedback":{"edits":true,"issues":true},"entitlements":{},"buildId":"6ade9b78500a4c24cc4c13e7","clientVersion":"0.0.4044","searchFilterCounts":[{"language":"default","tag":"SDK reference","count":145},{"language":"default","tag":"Setup guides","count":44},{"language":"default","tag":"JavaScript","count":29},{"language":"default","tag":"Python","count":25},{"language":"default","tag":"Go","count":19},{"language":"default","tag":"Documentation","count":18},{"language":"default","tag":".NET","count":13},{"language":"default","tag":"API reference","count":9},{"language":"default","tag":"API metrics","count":7},{"language":"default","tag":"Endpoints","count":7}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"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":"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":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","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":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","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":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","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":"workos-signup","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":"workos-enabled","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":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"#sidebar,html{scrollbar-gutter:stable;scrollbar-color:#e1e2e2 #ffffff00}#sidebar{scrollbar-width:thin}html.dark,html.dark #sidebar{scrollbar-color:#252b2b #0e151500}header div:has(>[data-component-part=version-select-trigger]){flex-shrink:0;margin-left:-.5rem;order:1}header [data-component-part=products-selector-trigger]{flex-shrink:0;margin-left:.5rem}header a:has(>.nav-logo){flex-shrink:0}@media (min-width:1024px){header div:has(>a>.nav-logo){flex:0 0 30.5rem}}@media (min-width:1024px) and (max-width:1279px){header div:has(>#search-bar-entry){flex:0 1 18rem;min-width:0}}"}],"page":{"pagePath":"sdk-reference/go/v1/migration","slug":"/sdk-reference/go/v1/migration","pageMetadata":{"title":"Migration from v0","description":"Migrate your application to the new Apitally SDK for Go.","href":"/sdk-reference/go/v1/migration"},"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: \"Migrate your application to the new Apitally SDK for Go.\"\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`,em:`em`,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,CodeGroup,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`The Go SDK now uses OpenTelemetry to collect and send metrics, logs, and traces.`}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Request logging and tracing are now enabled by default. If you previously used the SDK for metrics only, set `,_jsx(_components.code,{children:`SampleRate = 0`}),` to keep that behavior.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`installation-and-setup`,children:`Installation and setup`}),`\n`,_jsx(_components.p,{children:`The SDK now requires Go 1.25 or later. Upgrade the module for your framework:`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Chi`,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--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:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`go`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` get`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` github.com/apitally/apitally-go/chi-v5`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Echo v5`,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--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:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`go`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` get`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` github.com/apitally/apitally-go/echo-v5`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Echo v4`,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--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:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`go`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` get`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` github.com/apitally/apitally-go/echo-v4`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Fiber v3`,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--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:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`go`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` get`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` github.com/apitally/apitally-go/fiber-v3`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Fiber v2`,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--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:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`go`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` get`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` github.com/apitally/apitally-go/fiber-v2`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Gin`,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--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:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`go`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` get`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` github.com/apitally/apitally-go/gin-v1`})]}),`\n`]})})})]}),`\n`,_jsxs(_components.p,{children:[`The Gin module has been renamed from `,_jsx(_components.code,{children:`github.com/apitally/apitally-go/gin`}),` to `,_jsx(_components.code,{children:`github.com/apitally/apitally-go/gin-v1`}),`. Update your imports and remove the old module with `,_jsx(_components.code,{children:`go mod tidy`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`write-tokens-replace-client-ids`,children:`Write tokens replace client IDs`}),`\n`,_jsxs(_components.p,{children:[`The SDK now authenticates with a `,_jsx(_components.strong,{children:`write token`}),` instead of a client ID. Your existing app’s token (`,_jsx(_components.code,{children:`apt_...`}),`) is available under `,_jsx(_components.em,{children:`Setup instructions`}),` in the `,_jsx(_components.a,{href:`https://app.apitally.io/apps`,children:`Apitally dashboard`}),`.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`NewConfig()`}),` no longer takes a client ID. Set the `,_jsx(_components.code,{children:`WriteToken`}),` option, or set the `,_jsx(_components.code,{children:`APITALLY_WRITE_TOKEN`}),` environment variable.`]}),`\n`,_jsxs(Heading,{level:`3`,id:`init-replaces-the-middleware`,children:[_jsx(_components.code,{children:`Init`}),` replaces the middleware`]}),`\n`,_jsxs(_components.p,{children:[`Replace the `,_jsx(_components.code,{children:`Middleware`}),` registration with a call to `,_jsx(_components.code,{children:`Init`}),`, which registers everything the SDK needs. Call it after your recovery middleware and OpenTelemetry HTTP instrumentation, and before your other middleware and routes.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`12`,language:`go`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`go`,children:_jsxs(_components.code,{language:`go`,numberOfLines:`12`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Before`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`r`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` :=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` gin`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Default`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`config`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` :=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` apitally`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`NewConfig`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"your-client-id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`config`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Env`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"dev\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`r`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Use`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`apitally`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Middleware`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`r`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`config`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`))`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// After`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`r`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` :=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` gin`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Default`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`cfg`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` :=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` apitally`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`NewConfig`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`cfg`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`WriteToken`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"your-write-token\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`cfg`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Env`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"dev\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`apitally`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Init`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`r`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`cfg`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`graceful-shutdown`,children:`Graceful shutdown`}),`\n`,_jsxs(_components.p,{children:[`Call the new `,_jsx(_components.code,{children:`apitally.Shutdown`}),` function when your application exits, after your HTTP server has stopped, so the SDK can deliver the remaining telemetry. The `,_jsx(_components.a,{href:`/sdk-reference/go/v1/overview#supported-frameworks`,children:`setup guides`}),` show the full pattern.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`go`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`go`,children:_jsxs(_components.code,{language:`go`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`srv`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Shutdown`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ctx`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`apitally`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Shutdown`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ctx`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`configuration-changes`,children:`Configuration changes`}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`RequestLoggingConfig`}),` type and the `,_jsx(_components.code,{children:`RequestLogging`}),` field have been removed. Their settings are now fields directly on `,_jsx(_components.code,{children:`Config`}),`, with the option changes listed below.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`15`,language:`go`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`go`,children:_jsxs(_components.code,{language:`go`,numberOfLines:`15`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Before`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`config`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` :=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` apitally`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`NewConfig`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"your-client-id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`config`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`RequestLogging`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u0026`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`apitally`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`RequestLoggingConfig`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Enabled`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` LogRequestBody`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` LogResponseBody`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` MaskHeaders`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: []`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`*`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`regexp`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`Regexp`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`regexp`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`MustCompile`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`(?i)^X-Internal-`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)},`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// After`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`cfg`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` :=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` apitally`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`NewConfig`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`cfg`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`WriteToken`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"your-write-token\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`cfg`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`CaptureRequestBody`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` true`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`cfg`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`CaptureResponseBody`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` true`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`cfg`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`MaskHeaders`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` []`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#4EC9B0`},children:`string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`^X-Internal-`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`changed-options`,children:`Changed options`}),`\n`,_jsx(_components.p,{children:`The following options have been changed:`}),`\n`,_jsxs(`table`,{children:[_jsxs(`colgroup`,{children:[_jsx(`col`,{width:`40%`}),_jsx(`col`,{width:`60%`})]}),_jsx(`thead`,{children:_jsxs(`tr`,{children:[_jsx(`th`,{style:{minWidth:`240px`},children:`Option`}),_jsx(`th`,{style:{minWidth:`300px`},children:`Change`})]})}),_jsxs(`tbody`,{children:[_jsxs(`tr`,{children:[_jsx(`td`,{children:_jsx(`code`,{style:{whiteSpace:`nowrap`},children:`ClientID`})}),_jsxs(`td`,{children:[`Replaced by `,_jsx(`code`,{children:`WriteToken`}),`, which requires a new credential.`]})]}),_jsxs(`tr`,{children:[_jsx(`td`,{children:_jsx(`code`,{style:{whiteSpace:`nowrap`},children:`RequestLogging.LogRequestHeaders`})}),_jsxs(`td`,{children:[`Renamed to `,_jsx(`code`,{children:`CaptureRequestHeaders`}),`.`]})]}),_jsxs(`tr`,{children:[_jsx(`td`,{children:_jsx(`code`,{style:{whiteSpace:`nowrap`},children:`RequestLogging.LogRequestBody`})}),_jsxs(`td`,{children:[`Renamed to `,_jsx(`code`,{children:`CaptureRequestBody`}),`.`]})]}),_jsxs(`tr`,{children:[_jsx(`td`,{children:_jsx(`code`,{style:{whiteSpace:`nowrap`},children:`RequestLogging.LogResponseHeaders`})}),_jsxs(`td`,{children:[`Renamed to `,_jsx(`code`,{children:`CaptureResponseHeaders`}),`.`]})]}),_jsxs(`tr`,{children:[_jsx(`td`,{children:_jsx(`code`,{style:{whiteSpace:`nowrap`},children:`RequestLogging.LogResponseBody`})}),_jsxs(`td`,{children:[`Renamed to `,_jsx(`code`,{children:`CaptureResponseBody`}),`.`]})]}),_jsxs(`tr`,{children:[_jsx(`td`,{children:_jsx(`code`,{style:{whiteSpace:`nowrap`},children:`RequestLogging.MaskQueryParams`})}),_jsxs(`td`,{children:[`Moved to `,_jsx(`code`,{children:`MaskQueryParams`}),`, now `,_jsx(`code`,{children:`[]string`}),`.`]})]}),_jsxs(`tr`,{children:[_jsx(`td`,{children:_jsx(`code`,{style:{whiteSpace:`nowrap`},children:`RequestLogging.MaskHeaders`})}),_jsxs(`td`,{children:[`Moved to `,_jsx(`code`,{children:`MaskHeaders`}),`, now `,_jsx(`code`,{children:`[]string`}),`.`]})]}),_jsxs(`tr`,{children:[_jsx(`td`,{children:_jsx(`code`,{style:{whiteSpace:`nowrap`},children:`RequestLogging.MaskBodyFields`})}),_jsxs(`td`,{children:[`Moved to `,_jsx(`code`,{children:`MaskBodyFields`}),`, now `,_jsx(`code`,{children:`[]string`}),`.`]})]}),_jsxs(`tr`,{children:[_jsx(`td`,{children:_jsx(`code`,{style:{whiteSpace:`nowrap`},children:`RequestLogging.ExcludePaths`})}),_jsxs(`td`,{children:[`Moved to `,_jsx(`code`,{children:`ExcludePaths`}),`, now `,_jsx(`code`,{children:`[]string`}),`. Matches actual request paths instead of matched route patterns.`]})]}),_jsxs(`tr`,{children:[_jsx(`td`,{children:_jsx(`code`,{style:{whiteSpace:`nowrap`},children:`RequestLogging.MaskRequestBodyCallback`})}),_jsxs(`td`,{children:[`Moved to `,_jsx(`code`,{children:`MaskRequestBody`}),` with new arguments.`]})]}),_jsxs(`tr`,{children:[_jsx(`td`,{children:_jsx(`code`,{style:{whiteSpace:`nowrap`},children:`RequestLogging.MaskResponseBodyCallback`})}),_jsxs(`td`,{children:[`Moved to `,_jsx(`code`,{children:`MaskResponseBody`}),` with new arguments.`]})]}),_jsxs(`tr`,{children:[_jsx(`td`,{children:_jsx(`code`,{style:{whiteSpace:`nowrap`},children:`RequestLogging.ExcludeCallback`})}),_jsxs(`td`,{children:[`Replaced by `,_jsx(`code`,{children:`SampleOnRequest`}),` or `,_jsx(`code`,{children:`SampleOnResponse`}),` with new arguments and return values.`]})]})]})]}),`\n`,_jsxs(_components.p,{children:[`Pattern options now take regular expressions as strings instead of `,_jsx(_components.code,{children:`*regexp.Regexp`}),` values. They are matched case-insensitively unless a pattern sets its own flags, such as `,_jsx(_components.code,{children:`(?-i:...)`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`removed-options`,children:`Removed options`}),`\n`,_jsx(_components.p,{children:`These options have been removed:`}),`\n`,_jsxs(`table`,{children:[_jsxs(`colgroup`,{children:[_jsx(`col`,{width:`40%`}),_jsx(`col`,{width:`60%`})]}),_jsx(`thead`,{children:_jsxs(`tr`,{children:[_jsx(`th`,{style:{minWidth:`240px`},children:`Removed option`}),_jsx(`th`,{style:{minWidth:`300px`},children:`Migration`})]})}),_jsxs(`tbody`,{children:[_jsxs(`tr`,{children:[_jsx(`td`,{children:_jsx(`code`,{style:{whiteSpace:`nowrap`},children:`RequestLogging`})}),_jsxs(`td`,{children:[`Set its fields directly on `,_jsx(`code`,{children:`Config`}),`, applying the changes above. Remove its `,_jsx(`code`,{children:`Enabled`}),` flag.`]})]}),_jsxs(`tr`,{children:[_jsx(`td`,{children:_jsxs(_components.p,{children:[_jsx(`code`,{style:{whiteSpace:`nowrap`},children:`RequestLogging.Enabled`}),` and`,_jsx(`br`,{}),`\n`,_jsx(`code`,{style:{whiteSpace:`nowrap`},children:`RequestLogging.CaptureTraces`})]})}),_jsxs(`td`,{children:[`Previously defaulted to `,_jsx(`code`,{children:`false`}),`. Request logging and tracing are now enabled by default. Use `,_jsx(`code`,{children:`SampleRate = 0`}),` to disable request logs and traces.`]})]}),_jsxs(`tr`,{children:[_jsx(`td`,{children:_jsx(`code`,{style:{whiteSpace:`nowrap`},children:`RequestLogging.LogQueryParams`})}),_jsxs(`td`,{children:[`Query parameters are now always captured. To mask all values, use `,_jsx(`code`,{children:`MaskQueryParams = []string{\".*\"}`}),`.`]})]}),_jsxs(`tr`,{children:[_jsx(`td`,{children:_jsx(`code`,{style:{whiteSpace:`nowrap`},children:`RequestLogging.CaptureLogs`})}),_jsxs(`td`,{children:[`Logs are captured when you wrap your `,_jsx(`code`,{children:`log/slog`}),` handler with `,_jsx(`code`,{children:`NewSlogHandler`}),` (see `,_jsx(`a`,{href:`#application-logs`,children:`below`}),`).`]})]}),_jsxs(`tr`,{children:[_jsx(`td`,{children:_jsx(`code`,{style:{whiteSpace:`nowrap`},children:`RequestLogging.LogPanic`})}),_jsx(`td`,{children:`Panics are now always captured in request traces.`})]}),_jsxs(`tr`,{children:[_jsx(`td`,{children:_jsx(`code`,{style:{whiteSpace:`nowrap`},children:`DisableSync`})}),_jsxs(`td`,{children:[`Use the `,_jsx(`code`,{children:`Disabled`}),` option or the `,_jsx(`code`,{children:`APITALLY_DISABLED`}),` environment variable. Apitally is also disabled in `,_jsx(`code`,{children:`go test`}),` binaries.`]})]})]})]}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.a,{href:`/sdk-reference/go/v1/configuration`,children:`configuration reference`}),` lists all available options.`]}),`\n`,_jsx(Heading,{level:`2`,id:`consumer-identification`,children:`Consumer identification`}),`\n`,_jsxs(_components.p,{children:[`The request helpers, such as `,_jsx(_components.code,{children:`SetConsumer()`}),`, now take a `,_jsx(_components.code,{children:`context.Context`}),` instead of the framework’s request or context type. This changes the call sites on Echo, Fiber v2 and Chi:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{style:{textAlign:`left`},children:`Framework`}),_jsx(_components.th,{style:{textAlign:`left`},children:`Before`}),_jsx(_components.th,{style:{textAlign:`left`},children:`After`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:`Gin`}),_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`apitally.SetConsumer(c, ...)`})}),_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`apitally.SetConsumer(c, ...)`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:`Echo`}),_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`apitally.SetConsumer(c, ...)`})}),_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`apitally.SetConsumer(c.Request().Context(), ...)`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:`Fiber v3`}),_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`apitally.SetConsumer(c, ...)`})}),_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`apitally.SetConsumer(c, ...)`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:`Fiber v2`}),_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`apitally.SetConsumer(c, ...)`})}),_jsxs(_components.td,{style:{textAlign:`left`},children:[_jsx(_components.code,{children:`apitally.SetConsumer(c.UserContext(), ...)`}),` or `,_jsx(_components.code,{children:`c.Context()`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:`Chi`}),_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`apitally.SetConsumer(r, ...)`})}),_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`apitally.SetConsumer(r.Context(), ...)`})})]})]})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`SetConsumerIdentifier`}),` has been removed. Use `,_jsx(_components.code,{children:`SetConsumer`}),` with only the `,_jsx(_components.code,{children:`Identifier`}),` field set.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`go`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`go`,children:_jsxs(_components.code,{language:`go`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Before`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`apitally`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`SetConsumerIdentifier`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`user`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ID`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// After`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`apitally`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`SetConsumer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ctx`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`apitally`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`Consumer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Identifier`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`user`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ID`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`})`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`You can also provide custom attributes for each consumer:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`go`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`go`,children:_jsxs(_components.code,{language:`go`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`apitally`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`SetConsumer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ctx`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`apitally`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`Consumer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Identifier`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`user`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ID`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`user`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// optional`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Group`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`user`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Group`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// optional`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Attributes`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`map`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#4EC9B0`},children:`string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#4EC9B0`},children:`string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"plan\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`user`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Plan`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// optional`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`})`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`validation-errors`,children:`Validation errors`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`CaptureValidationError`}),` has been removed. Pass validation errors to `,_jsx(_components.code,{children:`CaptureError`}),` with the request context instead. See `,_jsx(_components.a,{href:`/sdk-reference/go/v1/tracing#request-context`,children:`request context`}),` for the context to pass on each framework.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`go`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`go`,children:_jsxs(_components.code,{language:`go`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Before`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`apitally`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`CaptureValidationError`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`err`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// After`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`apitally`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`CaptureError`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ctx`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`err`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`application-logs`,children:`Application logs`}),`\n`,_jsxs(_components.p,{children:[`The SDK no longer wraps the default `,_jsx(_components.code,{children:`log/slog`}),` handler automatically. To capture logs, wrap your handler with `,_jsx(_components.code,{children:`NewSlogHandler`}),` and log with the request context, for example with `,_jsx(_components.code,{children:`slog.InfoContext`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`go`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`go`,children:_jsxs(_components.code,{language:`go`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`handler`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` :=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` slog`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`NewJSONHandler`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`os`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Stdout`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`nil`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`slog`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`SetDefault`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`slog`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`New`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`apitally`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`NewSlogHandler`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`handler`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)))`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`slog`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`InfoContext`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ctx`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Order created\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"order_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`order`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ID`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Records logged without the request context are not linked to requests and are not captured. See `,_jsx(_components.a,{href:`/sdk-reference/go/v1/tracing#request-context`,children:`request context`}),` for the context to pass on each framework.`]}),`\n`,_jsx(Heading,{level:`2`,id:`body-masking-callbacks`,children:`Body masking callbacks`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`MaskRequestBodyCallback`}),` and `,_jsx(_components.code,{children:`MaskResponseBodyCallback`}),` are now named `,_jsx(_components.code,{children:`MaskRequestBody`}),` and `,_jsx(_components.code,{children:`MaskResponseBody`}),`. Both receive `,_jsx(_components.code,{children:`(span, body)`}),`, rather than the `,_jsx(_components.code,{children:`Request`}),` and `,_jsx(_components.code,{children:`Response`}),` objects. The body is passed as `,_jsx(_components.code,{children:`[]byte`}),`. Request metadata is available through `,_jsx(_components.a,{href:`/sdk-reference/go/v1/attributes`,children:_jsx(_components.code,{children:`span.Attributes()`})}),`.`]}),`\n`,_jsx(_components.p,{children:`For example, a callback that masks bodies for admin routes becomes:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`17`,language:`go`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`go`,children:_jsxs(_components.code,{language:`go`,numberOfLines:`17`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Before`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`config`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`RequestLogging`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`MaskRequestBodyCallback`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` func`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`request`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` *`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`apitally`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`Request`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) []`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#4EC9B0`},children:`byte`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` strings`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`HasPrefix`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`request`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Path`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"/admin/\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` nil`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` request`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Body`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// After`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`cfg`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`MaskRequestBody`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` func`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`span`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` sdktrace`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`ReadOnlySpan`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`body`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` []`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#4EC9B0`},children:`byte`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) []`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#4EC9B0`},children:`byte`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` attrs`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` :=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` attribute`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`NewSet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`span`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Attributes`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`...`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` route`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`_`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` :=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` attrs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Value`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"http.route\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` strings`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`HasPrefix`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`route`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`AsString`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(), `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"/admin/\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` nil`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` body`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`request-exclusion`,children:`Request exclusion`}),`\n`,_jsxs(_components.p,{children:[`Use sampling callbacks to exclude requests: `,_jsx(_components.code,{children:`SampleOnRequest`}),` for early decisions based on the request, or `,_jsx(_components.code,{children:`SampleOnResponse`}),` for decisions based on the response status or consumer. Both receive the span as their only argument.`]}),`\n`,_jsxs(_components.p,{children:[`The callbacks should return `,_jsx(_components.code,{children:`1, true`}),` to capture the request, and `,_jsx(_components.code,{children:`0, true`}),` to exclude it. Callbacks can also return any probability between 0 and 1. Returning `,_jsx(_components.code,{children:`false`}),` as the second value from `,_jsx(_components.code,{children:`SampleOnRequest`}),` applies `,_jsx(_components.code,{children:`SampleRate`}),`, and from `,_jsx(_components.code,{children:`SampleOnResponse`}),` preserves the earlier sampling decision.`]}),`\n`,_jsx(_components.p,{children:`For example, to capture only error responses:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`14`,language:`go`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`go`,children:_jsxs(_components.code,{language:`go`,numberOfLines:`14`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Before`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`config`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`RequestLogging`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ExcludeCallback`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` func`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`request`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` *`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`apitally`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`Request`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` *`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`apitally`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`Response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#4EC9B0`},children:`bool`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`StatusCode`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 400`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// After`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`cfg`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`SampleOnResponse`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` func`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`span`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` sdktrace`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`ReadOnlySpan`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#4EC9B0`},children:`float64`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#4EC9B0`},children:`bool`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` attrs`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` :=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` attribute`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`NewSet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`span`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Attributes`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`...`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` statusCode`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`_`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` :=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` attrs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Value`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"http.response.status_code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` statusCode`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`AsInt64`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 400`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Replace the `,_jsx(_components.code,{children:`ExcludeCallback`}),` option with the appropriate sampling callback. Note that captured headers and bodies are not available in sampling callbacks.`]}),`\n`,_jsx(_components.p,{children:`Sampling affects request logs and traces, but not metrics.`}),`\n`,_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/sdk-reference/go/v1/sampling`,children:`sampling`}),` for details.`]}),`\n`,_jsx(Heading,{level:`3`,id:`path-exclusions`,children:`Path exclusions`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`ExcludePaths`}),` now matches request paths rather than matched route patterns. If a pattern contains route parameters, update it to match concrete values. For example, replace `,_jsx(_components.code,{children:`^/users/:id$`}),` with `,_jsx(_components.code,{children:`^/users/[^/]+$`}),` to match `,_jsx(_components.code,{children:`/users/123`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`existing-opentelemetry-setups`,children:`Existing OpenTelemetry setups`}),`\n`,_jsxs(_components.p,{children:[`If your application registers a tracer provider from `,_jsx(_components.code,{children:`go.opentelemetry.io/otel/sdk/trace`}),` with `,_jsx(_components.code,{children:`otel.SetTracerProvider`}),` before starting the server, the SDK automatically adds its span processor. No manual registration is required.`]}),`\n`,_jsx(_components.p,{children:`Review these settings when upgrading:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Sampling:`}),` Previously, your provider’s sampler affected traces but not Apitally’s request logs. It now affects both. Check that its sampling rate provides the request log coverage you want. Metrics remain unsampled.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`other-changes`,children:`Other changes`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Network access:`}),` The SDK now sends data to `,_jsx(_components.code,{children:`otlp.apitally.io`}),` instead of `,_jsx(_components.code,{children:`hub.apitally.io`}),`. Update firewall allowlists if necessary.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Removed types:`}),` The `,_jsx(_components.code,{children:`ApitallyMiddleware`}),`, `,_jsx(_components.code,{children:`ApitallyConfig`}),` and `,_jsx(_components.code,{children:`ApitallyConsumer`}),` aliases and the `,_jsx(_components.code,{children:`Request`}),` and `,_jsx(_components.code,{children:`Response`}),` types have been removed from the public API.`]}),`\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":{"config":{},"pageMetadata":{"title":"Migration from v0","description":"Migrate your application to the new Apitally SDK for Go.","href":"/sdk-reference/go/v1/migration"}}},"mdxSourceWithNoJs":null,"noJsSplices":[[29838,29897,""]]},"mdxExtracts":{"tableOfContents":[{"title":"Installation and setup","slug":"installation-and-setup","depth":2,"children":[{"title":"Write tokens replace client IDs","slug":"write-tokens-replace-client-ids","depth":3,"children":[]},{"title":"Init replaces the middleware","slug":"init-replaces-the-middleware","depth":3,"children":[]},{"title":"Graceful shutdown","slug":"graceful-shutdown","depth":3,"children":[]}]},{"title":"Configuration changes","slug":"configuration-changes","depth":2,"children":[{"title":"Changed options","slug":"changed-options","depth":3,"children":[]},{"title":"Removed options","slug":"removed-options","depth":3,"children":[]}]},{"title":"Consumer identification","slug":"consumer-identification","depth":2,"children":[]},{"title":"Validation errors","slug":"validation-errors","depth":2,"children":[]},{"title":"Application logs","slug":"application-logs","depth":2,"children":[]},{"title":"Body masking callbacks","slug":"body-masking-callbacks","depth":2,"children":[]},{"title":"Request exclusion","slug":"request-exclusion","depth":2,"children":[{"title":"Path exclusions","slug":"path-exclusions","depth":3,"children":[]}]},{"title":"Existing OpenTelemetry setups","slug":"existing-opentelemetry-setups","depth":2,"children":[]},{"title":"Other changes","slug":"other-changes","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"apitally","siteName":"Apitally Docs","title":"Migration from v0 - Apitally Docs","navMaps":{"firstHrefInVersion":{"v1":{"href":"/sdk-reference/go/v1/migration","matchLevel":0},"v0":{"href":"/sdk-reference/go/v0/overview","matchLevel":2}},"firstHrefInLanguage":{}},"lastModified":"2026-10-21T06:06:11.866Z","originalFileLocation":"sdk-reference/go/v1/migration.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=\"system\"}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=\"Migrate your application to the new Apitally SDK for Go.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Apitally 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/apitally/wbLGdYpKEp4-Uamx/_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/apitally/wbLGdYpKEp4-Uamx/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/apitally/wbLGdYpKEp4-Uamx/_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/apitally/wbLGdYpKEp4-Uamx/_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/apitally/wbLGdYpKEp4-Uamx/_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/apitally/wbLGdYpKEp4-Uamx/_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/apitally/wbLGdYpKEp4-Uamx/_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/apitally/wbLGdYpKEp4-Uamx/_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/apitally/wbLGdYpKEp4-Uamx/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Migration from v0 - Apitally Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Migrate your application to the new Apitally SDK for Go.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Apitally Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.apitally.io/sdk-reference/go/v1/migration\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://apitally.mintlify.app/_mintlify/api/og/v2?division=SDK+reference\u0026amp;title=Migration+from+v0\u0026amp;description=Migrate+your+application+to+the+new+Apitally+SDK+for+Go.\u0026amp;theme=f8a29e48343a1364e1ae879f\u0026amp;signature=5b1eaf02d8c5b6e070b038e74f7819b3d536fc29e0e7df4027af1ccd30771796\">\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=\"Migration from v0 - Apitally Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Migrate your application to the new Apitally SDK for Go.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://apitally.mintlify.app/_mintlify/api/og/v2?division=SDK+reference\u0026amp;title=Migration+from+v0\u0026amp;description=Migrate+your+application+to+the+new+Apitally+SDK+for+Go.\u0026amp;theme=f8a29e48343a1364e1ae879f\u0026amp;signature=5b1eaf02d8c5b6e070b038e74f7819b3d536fc29e0e7df4027af1ccd30771796\">\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/apitally/wbLGdYpKEp4-Uamx/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Apitally Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0b9797\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.apitally.io/sdk-reference/go/v1/migration\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/sdk-reference/go/v1/migration.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.apitally.io/#organization\",\"name\":\"Apitally Docs\",\"url\":\"https://docs.apitally.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/apitally/N2ERaeHClCgFy9Y6/images/logo-light.svg?fit=max\u0026auto=format\u0026n=N2ERaeHClCgFy9Y6\u0026q=85\u0026s=e1d72c6d56f4625e48a29dd012b89739\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.apitally.io#website\",\"name\":\"Apitally Docs\",\"url\":\"https://docs.apitally.io\",\"publisher\":{\"@id\":\"https://docs.apitally.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.apitally.io/sdk-reference/go/v1/migration#webpage\",\"url\":\"https://docs.apitally.io/sdk-reference/go/v1/migration\",\"name\":\"Migration from v0\",\"description\":\"Migrate your application to the new Apitally SDK for Go.\",\"dateModified\":\"2026-10-21T06:06:11.866Z\",\"isPartOf\":{\"@id\":\"https://docs.apitally.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.apitally.io/sdk-reference/go/v1/migration#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.apitally.io/sdk-reference/go/v1/migration#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"SDK reference\",\"item\":\"https://docs.apitally.io/sdk-reference/go/v1/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Migration from v0\",\"item\":\"https://docs.apitally.io/sdk-reference/go/v1/migration\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.apitally.io/sdk-reference/go/v1/migration#article\",\"headline\":\"Migration from v0\",\"name\":\"Migration from v0\",\"description\":\"Migrate your application to the new Apitally SDK for Go.\",\"url\":\"https://docs.apitally.io/sdk-reference/go/v1/migration\",\"mainEntityOfPage\":{\"@id\":\"https://docs.apitally.io/sdk-reference/go/v1/migration#webpage\"},\"dateModified\":\"2026-10-21T06:06:11.866Z\",\"publisher\":{\"@id\":\"https://docs.apitally.io/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.apitally.io#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Apitally Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Apitally Docs","nav":{"global":null,"anchors":[{"anchor":"Documentation","icon":"book-open","pages":[{"title":"Documentation","href":"/introduction"}]},{"anchor":"SDK reference","icon":"box-isometric","products":[{"product":"Overview","icon":"book","pages":[{"title":"Overview","href":"/sdk-reference/overview"}]},{"product":"Python","icon":"python","pages":[{"title":"Python","href":"/sdk-reference/python/v1/overview"}]},{"product":"JavaScript","icon":"node-js","pages":[{"title":"JavaScript","href":"/sdk-reference/javascript/v1/overview"}]},{"product":"Go","icon":"golang","versions":[{"version":"v1","groups":[{"group":"SDK reference","icon":"book","pages":[{"title":"Go SDK reference","sidebarTitle":"Overview","mode":"wide","href":"/sdk-reference/go/v1/overview"},{"title":"Configuration","href":"/sdk-reference/go/v1/configuration"},{"title":"Masking","href":"/sdk-reference/go/v1/masking"},{"title":"Sampling","href":"/sdk-reference/go/v1/sampling"},{"title":"Tracing instrumentation","sidebarTitle":"Tracing","href":"/sdk-reference/go/v1/tracing"},{"title":"Attributes","description":"Span attributes available to callbacks in the Apitally SDK for Go.","href":"/sdk-reference/go/v1/attributes"},{"title":"Migration from v0","href":"/sdk-reference/go/v1/migration"}]},{"group":"Setup guides","icon":"rocket","pages":[{"title":"Setup guide for Chi","sidebarTitle":"Chi","description":"Set up the Apitally SDK for your Chi application.","href":"/sdk-reference/go/v1/setup-guides/chi"},{"title":"Setup guide for Echo","sidebarTitle":"Echo","href":"/sdk-reference/go/v1/setup-guides/echo"},{"title":"Setup guide for Fiber","sidebarTitle":"Fiber","href":"/sdk-reference/go/v1/setup-guides/fiber"},{"title":"Setup guide for Gin","sidebarTitle":"Gin","href":"/sdk-reference/go/v1/setup-guides/gin"}]}]},{"version":"v0","pages":[{"title":"v0","href":"/sdk-reference/go/v0/overview"}]}]},{"product":".NET","icon":"microsoft","pages":[{"title":".NET","href":"/sdk-reference/dotnet/v1/overview"}]},{"product":"Python Serverless","icon":"python","pages":[{"title":"Python Serverless","href":"/sdk-reference/python-serverless/v0/overview"}]},{"product":"JavaScript Serverless","icon":"node-js","pages":[{"title":"JavaScript Serverless","href":"/sdk-reference/javascript-serverless/v0/overview"}]}]},{"anchor":"API reference","icon":"brackets-curly","pages":[{"title":"API reference","href":"/api-reference"}]},{"anchor":"Website","icon":"globe","href":"https://apitally.io"}]},"basePath":"","title":"Migration from v0 - Apitally Docs","buildId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","deploymentId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","dynamics":[],"chunks":[]}