Skip to content
This repository was archived by the owner on Apr 7, 2025. It is now read-only.

Commit d1b7802

Browse files
author
Joel Worrall
committed
feat: add instrumentation landing page
1 parent d7cdd9e commit d1b7802

File tree

1 file changed

+180
-0
lines changed

1 file changed

+180
-0
lines changed

src/pages/instrumentation.js

+180
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
import React from 'react';
2+
import PropTypes from 'prop-types';
3+
import { graphql, Link } from 'gatsby';
4+
import { get } from 'lodash';
5+
import Layout from '../components/layout';
6+
import SEO from '../components/seo';
7+
import PageHeading from '../components/PageHeading';
8+
import SimpleProjectModule from '../components/SimpleProjectModule';
9+
10+
import styles from './collection.module.scss';
11+
12+
export const query = graphql`
13+
query InstrumentationProjects($path: String) {
14+
allProjects(
15+
filter: {
16+
projectType: { eq: "newrelic" }
17+
projectTags:
18+
{ elemMatch: { slug: { in: ["exporter", "nri", "agent", "sdk", "cli" ] } }
19+
}
20+
}
21+
) {
22+
edges {
23+
node {
24+
...exploreProjectsFields
25+
}
26+
}
27+
}
28+
sitePage: allSitePage(filter: { path: { eq: $path } }) {
29+
nodes {
30+
fields {
31+
contentEditLink
32+
}
33+
componentPath
34+
path
35+
}
36+
}
37+
}
38+
`;
39+
40+
const InstrumentationPage = ({ data }) => {
41+
// console.debug(data);
42+
const allProjects = data.allProjects.edges.map(project => {
43+
const p = project.node;
44+
45+
p.title = p.title.replace(/New Relic/, '');
46+
return p;
47+
});
48+
49+
const exporters = allProjects.filter(p => p.projectTags.find(t => t.slug === 'exporter'));
50+
const nris = allProjects.filter(p => p.projectTags.find(t => t.slug === 'nri'));
51+
const sdks = allProjects.filter(p => p.projectTags.find(t => t.slug === 'sdk'));
52+
const clis = allProjects.filter(p => p.projectTags.find(t => t.slug === 'cli'));
53+
const agents = allProjects.filter(p => p.projectTags.find(t => t.slug === 'agent'));
54+
//const opentelemetry = allProjects.filter(p => p.projectTags.find(t => t.slug === 'opentelemetry'));
55+
56+
return (
57+
<Layout
58+
fullWidth
59+
className={styles.collectionPage}
60+
editLink={get(data, 'sitePage.nodes[0].fields.contentEditLink')}
61+
>
62+
<SEO title="Open source New Relic One applications" />
63+
<PageHeading
64+
title="New Relic Open Source Instrumentation"
65+
subheader="Explore our agents, data exporters, SDK's, and instrumentation intregrations."
66+
/>
67+
<div className={styles.collectionListingContainer}>
68+
<header className={styles.collectionListingHeaderSection}>
69+
<h4 className={styles.collectionListingHeaderSectionHeading}>
70+
Agents
71+
</h4>
72+
<p className={styles.collectionListingHeaderSectionDescription}>
73+
Automated instrumentation projects for languages and technologies
74+
</p>
75+
</header>
76+
<div className={styles.collectionListing}>
77+
{agents.map(project => {
78+
return (
79+
<SimpleProjectModule
80+
key={project.id}
81+
data={project}
82+
className={styles.project}
83+
/>
84+
);
85+
})}
86+
</div>
87+
</div>
88+
<div className={styles.collectionListingContainer}>
89+
<header className={styles.collectionListingHeaderSection}>
90+
<h4 className={styles.collectionListingHeaderSectionHeading}>
91+
New Relic Infrastructure integrations
92+
</h4>
93+
<p className={styles.collectionListingHeaderSectionDescription}>
94+
Replace me with smart words.
95+
</p>
96+
</header>
97+
<div className={styles.collectionListing}>
98+
{nris.map(project => {
99+
return (
100+
<SimpleProjectModule
101+
key={project.id}
102+
data={project}
103+
className={styles.project}
104+
/>
105+
);
106+
})}
107+
</div>
108+
</div>
109+
<div className={styles.collectionListingContainer}>
110+
<header className={styles.collectionListingHeaderSection}>
111+
<h4 className={styles.collectionListingHeaderSectionHeading}>
112+
Data Exporters
113+
</h4>
114+
<p className={styles.collectionListingHeaderSectionDescription}>
115+
Replace me with smart words.
116+
</p>
117+
</header>
118+
<div className={styles.collectionListing}>
119+
{exporters.map(project => {
120+
return (
121+
<SimpleProjectModule
122+
key={project.id}
123+
data={project}
124+
className={styles.project}
125+
/>
126+
);
127+
})}
128+
</div>
129+
</div>
130+
<div className={styles.collectionListingContainer}>
131+
<header className={styles.collectionListingHeaderSection}>
132+
<h4 className={styles.collectionListingHeaderSectionHeading}>
133+
SDK's
134+
</h4>
135+
<p className={styles.collectionListingHeaderSectionDescription}>
136+
Replace me with smart words.
137+
</p>
138+
</header>
139+
<div className={styles.collectionListing}>
140+
{sdks.map(project => {
141+
return (
142+
<SimpleProjectModule
143+
key={project.id}
144+
data={project}
145+
className={styles.project}
146+
/>
147+
);
148+
})}
149+
</div>
150+
</div>
151+
<div className={styles.collectionListingContainer}>
152+
<header className={styles.collectionListingHeaderSection}>
153+
<h4 className={styles.collectionListingHeaderSectionHeading}>
154+
CLI's
155+
</h4>
156+
<p className={styles.collectionListingHeaderSectionDescription}>
157+
Replace me with smart words.
158+
</p>
159+
</header>
160+
<div className={styles.collectionListing}>
161+
{clis.map(project => {
162+
return (
163+
<SimpleProjectModule
164+
key={project.id}
165+
data={project}
166+
className={styles.project}
167+
/>
168+
);
169+
})}
170+
</div>
171+
</div>
172+
</Layout>
173+
);
174+
};
175+
176+
InstrumentationPage.propTypes = {
177+
data: PropTypes.object
178+
};
179+
180+
export default InstrumentationPage;

0 commit comments

Comments
 (0)