Skip to content

Commit 1e24532

Browse files
feat(onboarding): add anthropic to agent insights onboarding (#98145)
Closes https://linear.app/getsentry/issue/TET-1022/add-in-product-onboarding-instructions-for-anthropic
1 parent a424baf commit 1e24532

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed

static/app/gettingStartedDocs/python/python.tsx

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,68 @@ print(response)
579579
],
580580
};
581581

582+
const anthropicSdkStep = {
583+
type: StepType.CONFIGURE,
584+
description: tct(
585+
'Import and initialize the Sentry SDK with the [code:AnthropicIntegration] to instrument the Anthropic SDK:',
586+
{code: <code />}
587+
),
588+
configurations: [
589+
{
590+
code: [
591+
{
592+
label: 'Python',
593+
value: 'python',
594+
language: 'python',
595+
code: `
596+
import sentry_sdk
597+
from sentry_sdk.integrations.anthropic import AnthropicIntegration
598+
599+
sentry_sdk.init(
600+
dsn="${params.dsn.public}",
601+
traces_sample_rate=1.0,
602+
# Add data like inputs and responses to/from LLMs and tools;
603+
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
604+
send_default_pii=True,
605+
# this is optional:
606+
integrations=[
607+
AnthropicIntegration(
608+
# pass in any options here
609+
),
610+
],
611+
)`,
612+
},
613+
],
614+
},
615+
{
616+
code: [
617+
{
618+
label: 'Python',
619+
value: 'python',
620+
language: 'python',
621+
code: `
622+
from anthropic import Anthropic
623+
624+
with sentry_sdk.start_transaction(name="anthropic"):
625+
client = Anthropic()
626+
message = client.messages.create(
627+
max_tokens=1024,
628+
messages=[
629+
{
630+
"role": "user",
631+
"content": "Tell me a joke",
632+
}
633+
],
634+
model="claude-sonnet-4-20250514",
635+
)
636+
print(message.content)
637+
`,
638+
},
639+
],
640+
},
641+
],
642+
};
643+
582644
const manualStep = {
583645
type: StepType.CONFIGURE,
584646
description: tct(
@@ -628,6 +690,9 @@ with sentry_sdk.start_span(op="gen_ai.chat", name="chat o3-mini") as span:
628690
if (selected === 'openai') {
629691
return [openaiSdkStep];
630692
}
693+
if (selected === 'anthropic') {
694+
return [anthropicSdkStep];
695+
}
631696
if (selected === 'manual') {
632697
return [manualStep];
633698
}

static/app/views/insights/agents/views/onboarding.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ export function Onboarding() {
258258
? [
259259
{label: 'OpenAI SDK', value: 'openai'},
260260
{label: 'OpenAI Agents SDK', value: 'openai_agents'},
261+
{label: 'Anthropic SDK', value: 'anthropic'},
261262
{label: 'Manual', value: 'manual'},
262263
]
263264
: [

0 commit comments

Comments
 (0)