Skip to content

Commit

Permalink
migrate documentation to mintlify
Browse files Browse the repository at this point in the history
  • Loading branch information
ferhatkorkmaz11 committed Oct 14, 2024
1 parent eae2b7b commit 9d24193
Show file tree
Hide file tree
Showing 48 changed files with 806 additions and 0 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
32 changes: 32 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Mintlify Starter Kit

Click on `Use this template` to copy the Mintlify starter kit. The starter kit contains examples including

- Guide pages
- Navigation
- Customizations
- API Reference pages
- Use of popular components

### Development

Install the [Mintlify CLI](https://www.npmjs.com/package/mintlify) to preview the documentation changes locally. To install, use the following command

```
npm i -g mintlify
```

Run the following command at the root of your documentation (where mint.json is)

```
mintlify dev
```

### Publishing Changes

Install our Github App to auto propagate changes from your repo to your deployment. Changes will be deployed to production automatically after pushing to the default branch. Find the link to install on your dashboard.

#### Troubleshooting

- Mintlify dev isn't running - Run `mintlify install` it'll re-install dependencies.
- Page loads as a 404 - Make sure you are running in a folder with `mint.json`
8 changes: 8 additions & 0 deletions docs/advanced/configuration.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Advanced Configuration
description: 'Learn about advanced configuration options for infrastack.ai'
---

# Advanced Configuration

This page covers advanced configuration options for infrastack.ai...
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
---
title: Integrate OpenTelemetry for Express.js with infrastack.ai
description: 'Learn how to instrument your Express.js application with infrastack.ai and OpenTelemetry for comprehensive observability and performance insights.'
og:site_name: "infrastack.ai"
og:title: "Integrate OpenTelemetry for Express.js with infrastack.ai"
og:description: "Learn how to instrument your Express.js application with infrastack.ai and OpenTelemetry for comprehensive observability and performance insights."
og:locale: "en_US"
article:publisher: "https://www.linkedin.com/company/infrastack-ai"
twitter:title: "Integrate OpenTelemetry for Express.js with infrastack.ai"
twitter:description: "Learn how to instrument your Express.js application with infrastack.ai and OpenTelemetry for comprehensive observability and performance insights."
twitter:site: "@infrastackai"
---

import { GithubIcon, JsIcon } from '/snippets/custom-icons.mdx'

#### What you will learn
- Installing the `@infrastack/otel` NPM package
- Setting up your environment
- Instrumenting your application

#### Prerequisites
- An [infrastack.ai](https://app.infrastack.ai) account to get your API key
- An Express.js application

<CardGroup cols={1}>
<Card title="Follow the example project on GitHub" href="https://github.com/infrastackai/infrastack/tree/main/examples/expressjs"
icon={<GithubIcon />}
/>
</CardGroup>
### Getting started

<Steps>

<Step title="Install the NPM package">
<CodeGroup>
```bash npm
npm install @infrastack/otel
```
```bash yarn
yarn add @infrastack/otel
```
```bash pnpm
pnpm add @infrastack/otel
```
</CodeGroup>
</Step>
<Step title="Prepare your environment">
Export your API key as an environment variable.
```bash
export INFRASTACK_API_KEY=sk-1*************************f5af
```
</Step>

<Step title="Create instrumentation.ts">
```javascript instrumentation.ts
import { startOtel } from "@infrastack/otel";
startOtel({
serviceName:"YOUR_SERVICE_NAME",
});
```
<Info>If you don't provide a service name, we will create a random name for you.</Info>
</Step>

<Step title="Build and run your application">
Run your Express.js application with the node required command.
```bash
npx tsc && node -r ./dist/instrumentation.js dist/index.js
```

<Tip>After creating some traffic, you can check your data from the [infrastack.ai](https://app.infrastack.ai) dashboard.</Tip>
</Step>

</Steps>

### Next steps
<CardGroup cols={2}>
<Card title="Javascript SDK Reference" href="/sdk-reference/javascript/configuration"
icon={<JsIcon />}
/>
<Card title="Explore the Express.js example project" href="https://github.com/infrastackai/infrastack/tree/main/examples/expressjs"
icon={<GithubIcon />}
/>
</CardGroup>



Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
---
title: Integrate OpenTelemetry for Nest.js with infrastack.ai
description: 'Learn how to instrument your Nest.js application with infrastack.ai and OpenTelemetry for comprehensive observability and performance insights.'
og:site_name: "infrastack.ai"
og:title: "Integrate OpenTelemetry for Nest.js with infrastack.ai"
og:description: "Learn how to instrument your Nest.js application with infrastack.ai and OpenTelemetry for comprehensive observability and performance insights."
og:locale: "en_US"
article:publisher: "https://www.linkedin.com/company/infrastack-ai"
twitter:title: "Integrate OpenTelemetry for Nest.js with infrastack.ai"
twitter:description: "Learn how to instrument your Nest.js application with infrastack.ai and OpenTelemetry for comprehensive observability and performance insights."
twitter:site: "@infrastackai"
---

import { GithubIcon, JsIcon } from '/snippets/custom-icons.mdx'

#### What you will learn
- Installing the `@infrastack/otel` NPM package
- Setting up your environment
- Instrumenting your application

#### Prerequisites
- An [infrastack.ai](https://app.infrastack.ai) account to get your API key
- A Nest.js application

<CardGroup cols={1}>
<Card title="Follow the example project on GitHub" href="https://github.com/infrastackai/infrastack/tree/main/examples/nestjs"
icon={<GithubIcon />}
/>
</CardGroup>

### Getting started

<Steps>

<Step title="Install the NPM package">
<CodeGroup>
```bash npm
npm install @infrastack/otel
```
```bash yarn
yarn add @infrastack/otel
```
```bash pnpm
pnpm add @infrastack/otel
```
</CodeGroup>
</Step>

<Step title="Prepare your environment">
Export your API key as an environment variable.
```bash
export INFRASTACK_API_KEY=sk-1*************************f5af
```
</Step>

<Step title="Create instrumentation.ts">
Create an `instrumentation.ts` file under the `src` folder.
```javascript instrumentation.ts
import { startOtel } from '@infrastack/otel';
startOtel({
serviceName: 'nestjs-otel-example',
});

```
<Info>If you don't provide a service name, we will create a random name for you.</Info>
</Step>
<Step title="Import the instrumentation module in your main.ts file">
```javascript main.ts
import './instrumentation';
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
await app.listen(8081);
console.log('Server is running on port 8081');
}
bootstrap();
```
</Step>
<Step title="Run your application">
Run your Nest.js application with the default Nest.js command.
```bash
npm run start
```

<Tip>After creating some traffic, you can check your data from the [infrastack.ai](https://app.infrastack.ai) dashboard.</Tip>
</Step>

</Steps>

### Next steps
<CardGroup cols={2}>
<Card title="Javascript SDK Reference" href="/sdk-reference/javascript/configuration"
icon={<JsIcon />}
/>
<Card title="Explore the Nest.js example project" href="https://github.com/infrastackai/infrastack/tree/main/examples/nestjs"
icon={<GithubIcon />}
/>
</CardGroup>
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
---
title: Integrate OpenTelemetry for Next.js with infrastack.ai
description: 'Learn how to instrument your Next.js application with infrastack.ai and OpenTelemetry for comprehensive observability and performance insights.'
og:site_name: "infrastack.ai"
og:title: "Integrate OpenTelemetry for Next.js with infrastack.ai"
og:description: "Learn how to instrument your Next.js application with infrastack.ai and OpenTelemetry for comprehensive observability and performance insights."
og:locale: "en_US"
article:publisher: "https://www.linkedin.com/company/infrastack-ai"
twitter:title: "Integrate OpenTelemetry for Next.js with infrastack.ai"
twitter:description: "Learn how to instrument your Next.js application with infrastack.ai and OpenTelemetry for comprehensive observability and performance insights."
twitter:site: "@infrastackai"
---

import { GithubIcon, JsIcon } from '/snippets/custom-icons.mdx'

#### What you will learn
- Installing the `@infrastack/otel` NPM package
- Setting up your environment
- Instrumenting your application

#### Prerequisites
- An [infrastack.ai](https://app.infrastack.ai) account to get your API key
- A Next.js application

<CardGroup cols={1}>
<Card title="Follow the example project on GitHub" href="https://github.com/infrastackai/infrastack/tree/main/examples/nextjs"
icon={<GithubIcon />}
/>
</CardGroup>

### Getting started

<Steps>

<Step title="Install the NPM package">
<CodeGroup>
```bash npm
npm install @infrastack/otel
```
```bash yarn
yarn add @infrastack/otel
```
```bash pnpm
pnpm add @infrastack/otel
```
</CodeGroup>
</Step>


<Step title="Prepare your environment">
Create an `.env` file in the root of your project and add your API key.
```properties .env
INFRASTACK_API_KEY=sk-1*************************f5af
```
</Step>

<Step title="Configure your Next.js application">
This is step is required in order to enable instrumentation. Right now, `instrumentationHook` and `serverComponentsExternalPackages` are expermiental. Please follow the [Official Next.js Documentation for instrumentationHook](https://nextjs.org/docs/app/api-reference/next-config-js/instrumentationHook) if this document is outdated.

```javascript next.config.mjs
const nextConfig = {
experimental: {
instrumentationHook: true, // To enable instrumentation
serverComponentsExternalPackages: [ // To utilize node.js specific features in a next.js environment
"@opentelemetry/auto-instrumentations-node",
"@opentelemetry/sdk-node",
],
},
};

export default nextConfig;
```
</Step>

<Step title="Create instrumentation.ts">
<Info>If you are using a `src` folder in your Next.js application, create an `instrumentation.ts` file there. If not, create the file in the root of your project.</Info>
```javascript instrumentation.ts
export async function register() {
if (process.env.NEXT_RUNTIME === "nodejs") {
const { startOtel } = await import("@infrastack/otel");
startOtel({
"serviceName": "YOUR_SERVICE_NAME",
});
}
}
```
<Info>If you don't provide a service name, we will create a random name for you.</Info>

</Step>

<Step title="Run your application">
Run your Next.js application with the default command.
```bash
npm run dev
```

<Tip>You can check your data from the [infrastack.ai](https://app.infrastack.ai) dashboard.</Tip>

</Step>

</Steps>

### Next steps
<CardGroup cols={2}>
<Card title="Javascript SDK Reference" href="/sdk-reference/javascript/configuration"
icon={<JsIcon />}
/>
<Card title="Explore the Next.js example project" href="https://github.com/infrastackai/infrastack/tree/main/examples/nextjs"
icon={<GithubIcon />}
/>
</CardGroup>


Loading

0 comments on commit 9d24193

Please sign in to comment.