Files
zeekay 10e6fec4c0 debrand: the brand token is INSIGHTS_, and a wrong one stops the container
The rule table mapped HOG_ -> FN_ ahead of any POSTHOG rule, so POSTHOG_FOO
split into POST + HOG_ and came out POSTFN_FOO. Nothing sets that. The live
pods set INSIGHTS_SKIP_MIGRATION_CHECKS, which bin/migrate-check reads on the
container entrypoint, so the misspelling does not degrade a feature -- it runs
migrate --check against a database whose history this tree does not share and
the container never starts.

Both replacements are measured against the shipped tree rather than chosen:
every HOG_ name with a counterpart there is spelled INSIGHTS_ (HOG_QL ->
INSIGHTS_QL, HOG_FUNCTION_TEMPLATES -> INSIGHTS_FUNCTION_TEMPLATES, 12 of 12
determinate cases), and FN_ appears in it nowhere. Upstream carries 95 HOG_
tokens and zero FN_ ones, so repairing FN_ back out is exactly the inverse of
the bad rule and cannot collide with an upstream name.

The rule is fixed for the next convergence, and the tree it already produced is
repaired in the same commit -- the codemod is idempotent against its own output,
so it cannot undo this itself.
2026-08-01 17:42:28 -07:00

120 lines
4.7 KiB
TypeScript

import { OnboardingComponentsContext, createInstallation } from 'scenes/onboarding/shared/OnboardingDocsContentWrapper'
import { getAndroidSteps as getAndroidStepsPA } from '../product-analytics/android'
import { StepDefinition } from '../steps'
export const getAndroidSteps = (ctx: OnboardingComponentsContext): StepDefinition[] => {
const { CodeBlock, Markdown, CalloutBox, dedent } = ctx
const installSteps = getAndroidStepsPA(ctx)
const exceptionAutocaptureStep: StepDefinition = {
title: 'Set up exception autocapture',
badge: 'recommended',
content: (
<>
<CalloutBox type="fyi" title="Client-side configuration only">
<Markdown>
{dedent`
Support for remote configuration
in the [error tracking settings](https://app.hanzo.ai/settings/project-error-tracking#exception-autocapture)
requires SDK version 3.32.0 or higher.
`}
</Markdown>
</CalloutBox>
<Markdown>
{dedent`
You can autocapture exceptions by setting the \`errorTrackingConfig.autoCapture\`
argument to \`true\` when initializing the Insights SDK.
`}
</Markdown>
<CodeBlock
blocks={[
{
language: 'kotlin',
file: 'Kotlin',
code: dedent`
import com.insights.android.InsightsAndroidConfig
val config = InsightsAndroidConfig(
apiKey = INSIGHTS_PROJECT_TOKEN,
host = INSIGHTS_HOST
).apply {
...
errorTrackingConfig.autoCapture = true
}
...
`,
},
]}
/>
<Markdown>
{dedent`
When enabled, this automatically captures \`$exception\` events when errors are thrown by wrapping the \`Thread.UncaughtExceptionHandler\` listener.
`}
</Markdown>
<CalloutBox type="fyi" title="Planned features">
<Markdown>
{dedent`
We currently don't support [source code context](https://hanzo.ai/docs/error-tracking/stack-traces) associated with an exception.
These features will be added in a future release.
`}
</Markdown>
</CalloutBox>
</>
),
}
const manualCaptureStep: StepDefinition = {
title: 'Manually capture exceptions',
badge: 'optional',
content: (
<>
<Markdown>
{dedent`
It is also possible to manually capture exceptions using the \`captureException\` method:
`}
</Markdown>
<CodeBlock
blocks={[
{
language: 'kotlin',
file: 'Kotlin',
code: dedent`
Insights.captureException(
exception,
properties = additionalProperties
)
`,
},
]}
/>
<Markdown>
{dedent`
This is helpful if you've built your own error handling logic or want to capture exceptions that are handled by your application code.
`}
</Markdown>
</>
),
}
const verifyStep: StepDefinition = {
title: 'Verify error tracking',
badge: 'recommended',
checkpoint: true,
content: (
<Markdown>
{dedent`
Before proceeding, let's make sure exception events are being captured and sent to Insights. You should see events appear in the activity feed.
[Check for exceptions in Insights](https://app.hanzo.ai/activity/explore)
`}
</Markdown>
),
}
return [...installSteps, exceptionAutocaptureStep, manualCaptureStep, verifyStep]
}
export const AndroidInstallation = createInstallation(getAndroidSteps)