Skip to content

Commit 0d9249a

Browse files
AJAJ
authored andcommitted
Merge branch 'master' of github.com:getsentry/sentry-docs into feat/node-lambda-docs
2 parents 775c52d + b27788f commit 0d9249a

24 files changed

+1651
-18
lines changed

src/components/markdown.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import DefinitionList from "./definitionList";
2020
import PlatformRedirectLink from "./platformRedirectLink";
2121
import PlatformSection from "./platformSection";
2222
import PlatformIdentifier from "./platformIdentifier";
23+
import RelayMetrics from "./relayMetrics";
2324

2425
const mdxComponents = {
2526
Alert,
@@ -39,6 +40,7 @@ const mdxComponents = {
3940
PlatformRedirectLink,
4041
PlatformSection,
4142
PlatformIdentifier,
43+
RelayMetrics,
4244
};
4345

4446
export default ({ value }) => {

src/components/relayMetrics.tsx

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import React from "react";
2+
import styled from "@emotion/styled";
3+
import { graphql, useStaticQuery } from "gatsby";
4+
import Alert from "~src/components/alert";
5+
6+
const query = graphql`
7+
query RelayMetricsQuery {
8+
allRelayMetric {
9+
nodes {
10+
name
11+
type
12+
features
13+
14+
childRelayMetricDescription {
15+
childMarkdownRemark {
16+
html
17+
}
18+
}
19+
}
20+
}
21+
}
22+
`;
23+
24+
const MetricType = styled.span`
25+
color: var(--light-text);
26+
font-style: italic;
27+
`;
28+
29+
function RelayFeatures({ features }) {
30+
if (Array.isArray(features) && features.includes("processing")) {
31+
return (
32+
<Alert level="info" title="Note">
33+
This metric is emitted only when Relay runs as internal Sentry service
34+
for event ingestion (<code>processing</code> feature).
35+
</Alert>
36+
);
37+
}
38+
39+
return null;
40+
}
41+
42+
function Metric({ metric }) {
43+
const descriptionHtml =
44+
metric.childRelayMetricDescription.childMarkdownRemark.html;
45+
46+
return (
47+
<>
48+
<dt>
49+
<code>
50+
{metric.name} <MetricType>({metric.type})</MetricType>
51+
</code>
52+
</dt>
53+
<dd>
54+
<RelayFeatures features={metric.features} />
55+
<div
56+
dangerouslySetInnerHTML={{
57+
__html: descriptionHtml,
58+
}}
59+
/>
60+
</dd>
61+
</>
62+
);
63+
}
64+
65+
export default (): JSX.Element => {
66+
const data = useStaticQuery(query);
67+
const metrics = data.allRelayMetric.nodes;
68+
69+
return (
70+
<dl>
71+
{metrics.map(metric => (
72+
<Metric key={metric.name} metric={metric} />
73+
))}
74+
</dl>
75+
);
76+
};

src/components/sidebar.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ export const Sidebar = ({ data }: ChildProps): JSX.Element => {
4040
const tree = toTree(data.allSitePage.nodes.filter(n => !!n.context));
4141
return (
4242
<ul className="list-unstyled" data-sidebar-tree>
43-
<DynamicNav root="product" title="Product" tree={tree} />
43+
<DynamicNav
44+
root="product"
45+
title="Product"
46+
tree={tree}
47+
exclude={["/product/relay/"]}
48+
/>
4449
<DynamicNav root="accounts" title="Account Management" tree={tree} />
4550
<DynamicNav root="cli" title="sentry-cli" tree={tree} />
4651
<DynamicNav root="meta" title="Security and Legal" tree={tree} />

src/css/_includes/development-api.scss

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,23 @@
2929
align-items: center;
3030
}
3131

32+
.api-block-header.response .tabs-group {}
33+
34+
.api-block-header.response .tabs-group .tab {
35+
border-left: 1px solid #444;
36+
color: #9990ab;
37+
cursor: pointer;
38+
39+
&:first-child {
40+
padding-right: 8px;
41+
border: none;
42+
}
43+
44+
&:not(:first-child) {
45+
padding-left: 8px;
46+
}
47+
}
48+
3249
.response-status-btn-group {
3350
border-radius: 3px;
3451
}
@@ -55,7 +72,8 @@
5572
}
5673
}
5774

58-
.response-status-btn.selected {
75+
.response-status-btn.selected,
76+
.api-block-header.response .tabs-group .tab.selected {
5977
color: var(--white);
6078
}
6179

@@ -87,3 +105,15 @@
87105
.api-params dd {
88106
margin-top: 0rem !important;
89107
}
108+
109+
.api-params dt {
110+
display: flex;
111+
flex-direction: row;
112+
}
113+
114+
.api-params .required {
115+
font-size: 0.8rem;
116+
font-weight: bold;
117+
text-transform: uppercase;
118+
padding-left: 1rem;
119+
}

0 commit comments

Comments
 (0)