Skip to content

Commit 089c635

Browse files
committed
Merge remote-tracking branch 'origin' into add-sdk-release-callout
2 parents 76a3885 + d8130fd commit 089c635

File tree

189 files changed

+2889
-837
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+2889
-837
lines changed

app/[[...path]]/page.tsx

Lines changed: 81 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ import {Home} from 'sentry-docs/components/home';
1111
import {Include} from 'sentry-docs/components/include';
1212
import {PlatformContent} from 'sentry-docs/components/platformContent';
1313
import {
14+
DocNode,
1415
getCurrentPlatformOrGuide,
1516
getDocsRootNode,
17+
getNextNode,
18+
getPreviousNode,
1619
nodeForPath,
1720
} from 'sentry-docs/docTree';
1821
import {isDeveloperDocs} from 'sentry-docs/isDeveloperDocs';
@@ -24,6 +27,7 @@ import {
2427
} from 'sentry-docs/mdx';
2528
import {mdxComponents} from 'sentry-docs/mdxComponents';
2629
import {setServerContext} from 'sentry-docs/serverContext';
30+
import {PaginationNavNode} from 'sentry-docs/types/paginationNavNode';
2731
import {stripVersion} from 'sentry-docs/versioning';
2832

2933
export async function generateStaticParams() {
@@ -42,7 +46,11 @@ export const dynamic = 'force-static';
4246

4347
const mdxComponentsWithWrapper = mdxComponents(
4448
{Include, PlatformContent},
45-
({children, frontMatter}) => <DocPage frontMatter={frontMatter}>{children}</DocPage>
49+
({children, frontMatter, nextPage, previousPage}) => (
50+
<DocPage frontMatter={frontMatter} nextPage={nextPage} previousPage={previousPage}>
51+
{children}
52+
</DocPage>
53+
)
4654
);
4755

4856
function MDXLayoutRenderer({mdxSource, ...rest}) {
@@ -59,6 +67,42 @@ export default async function Page({params}: {params: {path?: string[]}}) {
5967
path: params.path ?? [],
6068
});
6169

70+
if (!params.path && !isDeveloperDocs) {
71+
return <Home />;
72+
}
73+
74+
const pageNode = nodeForPath(rootNode, params.path ?? '');
75+
76+
if (!pageNode) {
77+
// eslint-disable-next-line no-console
78+
console.warn('no page node', params.path);
79+
return notFound();
80+
}
81+
82+
// gather previous and next page that will be displayed in the bottom pagination
83+
const getPaginationDetails = (
84+
getNode: (node: DocNode) => DocNode | undefined | 'root',
85+
page: PaginationNavNode | undefined
86+
) => {
87+
if (page && 'path' in page && 'title' in page) {
88+
return page;
89+
}
90+
91+
const node = getNode(pageNode);
92+
93+
if (node === 'root') {
94+
return {path: '', title: 'Welcome to Sentry'};
95+
}
96+
97+
return node ? {path: node.path, title: node.frontmatter.title} : undefined;
98+
};
99+
100+
const previousPage = getPaginationDetails(
101+
getPreviousNode,
102+
pageNode?.frontmatter?.previousPage
103+
);
104+
const nextPage = getPaginationDetails(getNextNode, pageNode?.frontmatter?.nextPage);
105+
62106
if (isDeveloperDocs) {
63107
// get the MDX for the current doc and render it
64108
let doc: Awaited<ReturnType<typeof getFileBySlug>> | null = null;
@@ -74,13 +118,17 @@ export default async function Page({params}: {params: {path?: string[]}}) {
74118
}
75119
const {mdxSource, frontMatter} = doc;
76120
// pass frontmatter tree into sidebar, rendered page + fm into middle, headers into toc
77-
return <MDXLayoutRenderer mdxSource={mdxSource} frontMatter={frontMatter} />;
78-
}
79-
if (!params.path) {
80-
return <Home />;
121+
return (
122+
<MDXLayoutRenderer
123+
mdxSource={mdxSource}
124+
frontMatter={frontMatter}
125+
nextPage={nextPage}
126+
previousPage={previousPage}
127+
/>
128+
);
81129
}
82130

83-
if (params.path[0] === 'api' && params.path.length > 1) {
131+
if (params.path?.[0] === 'api' && params.path.length > 1) {
84132
const categories = await apiCategories();
85133
const category = categories.find(c => c.slug === params?.path?.[1]);
86134
if (category) {
@@ -94,14 +142,6 @@ export default async function Page({params}: {params: {path?: string[]}}) {
94142
}
95143
}
96144

97-
const pageNode = nodeForPath(rootNode, params.path);
98-
99-
if (!pageNode) {
100-
// eslint-disable-next-line no-console
101-
console.warn('no page node', params.path);
102-
return notFound();
103-
}
104-
105145
// get the MDX for the current doc and render it
106146
let doc: Awaited<ReturnType<typeof getFileBySlug>> | null = null;
107147
try {
@@ -122,7 +162,12 @@ export default async function Page({params}: {params: {path?: string[]}}) {
122162

123163
// pass frontmatter tree into sidebar, rendered page + fm into middle, headers into toc.
124164
return (
125-
<MDXLayoutRenderer mdxSource={mdxSource} frontMatter={{...frontMatter, versions}} />
165+
<MDXLayoutRenderer
166+
mdxSource={mdxSource}
167+
frontMatter={{...frontMatter, versions}}
168+
nextPage={nextPage}
169+
previousPage={previousPage}
170+
/>
126171
);
127172
}
128173

@@ -132,6 +177,17 @@ type MetadataProps = {
132177
};
133178
};
134179

180+
// Helper function to clean up canonical tags missing leading or trailing slash
181+
function formatCanonicalTag(tag: string) {
182+
if (tag.charAt(0) !== '/') {
183+
tag = '/' + tag;
184+
}
185+
if (tag.charAt(tag.length - 1) !== '/') {
186+
tag = tag + '/';
187+
}
188+
return tag;
189+
}
190+
135191
export async function generateMetadata({params}: MetadataProps): Promise<Metadata> {
136192
const domain = isDeveloperDocs
137193
? 'https://develop.sentry.dev'
@@ -142,6 +198,7 @@ export async function generateMetadata({params}: MetadataProps): Promise<Metadat
142198
: domain;
143199
let title =
144200
'Sentry Docs | Application Performance Monitoring &amp; Error Tracking Software';
201+
let customCanonicalTag;
145202
let description =
146203
'Self-hosted and cloud-based application performance monitoring &amp; error tracking that helps software teams see clearer, solve quicker, &amp; learn continuously.';
147204
const images = [{url: `${previewDomain ?? domain}/meta.jpg`, width: 1200, height: 822}];
@@ -160,13 +217,18 @@ export async function generateMetadata({params}: MetadataProps): Promise<Metadat
160217
pageNode.frontmatter.title +
161218
(guideOrPlatform ? ` | Sentry for ${guideOrPlatform.title}` : '');
162219
description = pageNode.frontmatter.description ?? '';
220+
221+
if (pageNode.frontmatter.customCanonicalTag) {
222+
customCanonicalTag = formatCanonicalTag(pageNode.frontmatter.customCanonicalTag);
223+
}
163224
}
164225
}
165226

166-
let canonical = domain;
167-
if (params.path) {
168-
canonical = `${domain}/${params.path.join('/')}/`;
169-
}
227+
const canonical = customCanonicalTag
228+
? domain + customCanonicalTag
229+
: params.path
230+
? `${domain}/${params.path.join('/')}/`
231+
: domain;
170232

171233
return {
172234
title,

app/platform-redirect/page.tsx

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {redirect} from 'next/navigation';
22

3+
import {Alert} from 'sentry-docs/components/alert';
34
import {DocPage} from 'sentry-docs/components/docPage';
45
import {PlatformIcon} from 'sentry-docs/components/platformIcon';
56
import {SmartLink} from 'sentry-docs/components/smartLink';
@@ -14,16 +15,31 @@ export default async function Page({
1415
if (Array.isArray(next)) {
1516
next = next[0];
1617
}
18+
1719
// discard the hash
1820
const [pathname, _] = next.split('#');
1921
const rootNode = await getDocsRootNode();
22+
const defaultTitle = 'Platform Specific Content';
23+
let description = '';
24+
const platformInfo =
25+
"The page you are looking for is customized for each platform. Select your platform below and we'll direct you to the most specific documentation on it.";
26+
let title = defaultTitle;
27+
2028
// get rid of irrelevant platforms for the `next` path
2129
const platformList = extractPlatforms(rootNode).filter(platform_ => {
22-
return !!nodeForPath(rootNode, [
30+
const node = nodeForPath(rootNode, [
2331
'platforms',
2432
platform_.key,
2533
...pathname.split('/').filter(Boolean),
2634
]);
35+
36+
// extract title and description for displaying it on page
37+
if (node && title === defaultTitle && pathname.length > 0) {
38+
title = node.frontmatter.title ?? title;
39+
description = node.frontmatter.description || '';
40+
}
41+
42+
return !!node;
2743
});
2844

2945
if (platformList.length === 0) {
@@ -42,18 +58,16 @@ export default async function Page({
4258
}
4359

4460
const frontMatter = {
45-
title: 'Platform Specific Content',
61+
title,
62+
description,
4663
};
4764

4865
// make the Sidebar aware of the current path
4966
setServerContext({rootNode, path: ['platform-redirect']});
5067

5168
return (
5269
<DocPage frontMatter={frontMatter}>
53-
<p>
54-
The page you are looking for is customized for each platform. Select your platform
55-
below and we&apos;ll direct you to the most specific documentation on it.
56-
</p>
70+
<Alert level="info">{platformInfo}</Alert>
5771

5872
<ul>
5973
{platformList.map(p => (

apps/changelog/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"@radix-ui/react-icons": "^1.3.0",
2222
"@radix-ui/react-toolbar": "^1.0.4",
2323
"@radix-ui/themes": "^2.0.3",
24-
"@sentry/nextjs": "8.34.0",
24+
"@sentry/nextjs": "8.36.0-beta.0",
2525
"@spotlightjs/spotlight": "^2.1.1",
2626
"next": "15.0.0-rc.1",
2727
"next-auth": "^4.24.5",
@@ -63,4 +63,4 @@
6363
"@types/react": "npm:[email protected]",
6464
"@types/react-dom": "npm:[email protected]"
6565
}
66-
}
66+
}

develop-docs/application/config.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Configuration
3+
sidebar_order: 60
34
---
45

56
This document describes configuration available to the Sentry server itself.

develop-docs/backend/control-silo.mdx renamed to develop-docs/application/control-silo.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Control Silo
3+
sidebar_order: 30
34
---
45

56
Within the Control Silo are features that allow us to provide backwards compatibility for both customer API usage, and integrations

develop-docs/backend/cross-region-replication.mdx renamed to develop-docs/application/cross-region-replication.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Cross Region Replication
3+
sidebar_order: 40
34
---
45

56
Our data-model includes many relations between users and the objects they create or interact with. Eventually users are deleted, and they need to be detached from the records they created, or those records need to be destroyed. Before sentry became a multi-region application, we relied on a mixture of Django callbacks, and postgres constraints to cascade deletions. However, in a multi-region state we arent't able to rely on these anymore as Users are in [Control Silo](/architecture/#silo-modes) and many of the objects they interact with are in the various Region Silos.

develop-docs/backend/cross-region-rpc.mdx renamed to develop-docs/application/cross-region-rpc.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Cross Region RPC
3+
sidebar_order: 50
34
---
45

56
When Sentry is deployed in a multi-region deployment (like sentry.io) there are many scenarios and workflows where a region silo requires information that is stored in Control Silo. Similarly there are flows where Control Silo operations need to read or mutate state stored in regions.

develop-docs/application/dynamic-sampling/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Dynamic Sampling
33
description: Dynamic Sampling is a feature of the ingestion pipeline that allows Sentry to automatically adjust the amount of data retained based on the value of the data.
4-
sidebar_order: 50
4+
sidebar_order: 10
55
---
66

77
From all the data received by the SDKs, Sentry is able to extract low-granularity information through metrics, while Dynamic Sampling makes the decision of whether to keep or drop data.

develop-docs/application/feedback-architecture.mdx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: User Feedback Architecture
3+
sidebar_order: 20
34
---
45

56
**The goal of this doc is to give engineers an in-depth understanding of User Feedback's backend.**
@@ -51,17 +52,18 @@ offers 2 improvements:
5152

5253
The user's submission is wrapped in a context object:
5354

54-
```Python/Javascript
55+
```Pseudo-code
5556
event[”contexts”][”feedback”] = {
5657
"name": <user-provided>,
5758
"contact_email": <user-provided>,
5859
"message": <user-provided>,
5960
"url": <referring web page>,
60-
"source": <developer-provided, ex: "widget">
61+
"source": <developer-provided, ex: "widget">,
62+
"associated_event_id": <developer-provided, should be a valid error event in the same project>
6163
}
6264
63-
// all fields are technically optional, but recommended
64-
// the widget can be configured to require a non-empty email and/or name
65+
// All fields are optional except message.
66+
// The widget can be configured to require a non-empty email and/or name.
6567
```
6668

6769
- This doc refers to the payload format (`event` in the pseudo-code above) as a “**feedback event”**.
@@ -99,7 +101,7 @@ a separate topic and storage, and the UI makes a separate request for them.
99101

100102
The deprecated way of sending feedback is as a **user report**. This is a simple typed dict:
101103

102-
```Python/Javascript
104+
```Pseudo-code
103105
user_report = {
104106
"event_id": <required UUID str>,
105107
"email": <optional str>,
@@ -207,12 +209,14 @@ This feature is available if you enable the following feature flags.
207209
- `organizations:user-feedback-ui`
208210
- `organizations:user-feedback-replay-clip` (v24.7.1+)
209211

210-
Auto-registered flags for issue platform (you won't be able to grep these in the sentry repo, but you need to enable them too):
212+
Auto-registered flags for issue platform, for versions \<= v24.10.0 only:
211213

212214
- `organizations:feedback-ingest`
213215
- `organizations:feedback-visible`
214216
- `organizations:feedback-post-process-group`
215217

218+
(You won't be able to grep for these in the sentry repo, but you do need to enable them.)
219+
216220
You need to have v24.4.2 or higher in order to use the latest functionality of User
217221
Feedback, such as adding screenshots. Also note that User Feedback is only available
218222
in feature-complete Sentry, _not_ errors-only.

develop-docs/application/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Application
3+
sidebar_order: 30
34
---
45

56
<PageGrid />

0 commit comments

Comments
 (0)