Skip to content

Commit 2c55176

Browse files
committed
refactor: update import statements and code blocks to use consistent syntax in documentation
1 parent a393373 commit 2c55176

4 files changed

Lines changed: 18 additions & 14 deletions

File tree

-493 KB
Binary file not shown.
Binary file not shown.

src/frontend/src/content/docs/dashboard/standalone-for-nodejs.mdx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Use the Aspire dashboard with Node.js apps
33
description: How to use the Aspire Dashboard in a Node.js application.
44
---
55

6-
import { Steps } from '@astrojs/starlight/components';
6+
import { TabItem, Tabs, Steps } from '@astrojs/starlight/components';
77

88
The [Aspire dashboard](/dashboard/overview/) provides a great user experience for viewing telemetry, and is available as a standalone container image that can be used with any OpenTelemetry-enabled app. In this article, you'll learn how to:
99

@@ -35,21 +35,21 @@ To create a new Express.js application:
3535

3636
1. Initialize a new Node.js project:
3737

38-
```npm
38+
```bash
3939
npm init -y
4040
```
4141

4242
1. Install Express.js:
4343

44-
```npm
44+
```bash
4545
npm install express
4646
```
4747

4848
1. Create a basic Express.js application by creating an *app.js* file with Express server code.
4949

5050
1. Test the application by running:
5151

52-
```console
52+
```bash
5353
npm start
5454
```
5555

@@ -60,30 +60,32 @@ To create a new Express.js application:
6060

6161
To use the Aspire dashboard with your Node.js app, you need to install the OpenTelemetry SDK and exporter. The OpenTelemetry SDK provides the API for instrumenting your application, and the exporter sends telemetry data to the Aspire dashboard.
6262

63+
<Steps>
6364
1. Create a new file called *tracing.js* to configure OpenTelemetry.
6465

6566
1. Update your *app.js* to import the tracing configuration at the very beginning.
6667

6768
1. Restart your application:
6869

69-
```console
70+
```bash
7071
npm start
7172
```
73+
</Steps>
7274

7375
## Start the Aspire dashboard
7476

7577
To start the Aspire dashboard in standalone mode, run the following Docker command:
7678

7779
<Tabs>
78-
<TabItem label="Bash">
80+
<TabItem label="Bash" icon="seti:shell">
7981

8082
```bash
8183
docker run --rm -it -p 18888:18888 -p 4317:18889 --name aspire-dashboard \
8284
mcr.microsoft.com/dotnet/aspire-dashboard:9.5
8385
```
8486

8587
</TabItem>
86-
<TabItem label="PowerShell">
88+
<TabItem label="PowerShell" icon="seti:powershell">
8789

8890
```powershell
8991
docker run --rm -it -p 18888:18888 -p 4317:18889 --name aspire-dashboard `
@@ -99,14 +101,16 @@ In the Docker logs, the endpoint and key for the dashboard are displayed. Copy t
99101

100102
After starting both the dashboard and your Node.js application, you can view telemetry data by making requests to your application and observing the results in the dashboard.
101103

104+
<Steps>
102105
1. Make some requests to your Node.js application:
103106

104107
```console
105108
curl http://localhost:3000/
106109
curl http://localhost:3000/api/weather
107110
```
108111

109-
1. Navigate to the Aspire dashboard at <http://localhost:18888> and explore the different sections:
112+
1. Navigate to the Aspire dashboard at `http://localhost:18888` and explore the different sections:
113+
</Steps>
110114

111115
### Traces
112116

src/frontend/src/content/docs/dashboard/standalone-for-python.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ This tutorial can be completed using either Flask, Django, or FastAPI. A sample
2323

2424
### Flask
2525

26-
```console
26+
```bash
2727
git clone https://github.com/Azure-Samples/msdocs-python-flask-webapp-quickstart
2828
```
2929

3030
### FastAPI
3131

32-
```console
32+
```bash
3333
git clone https://github.com/Azure-Samples/msdocs-python-fastapi-webapp-quickstart.git
3434
```
3535

@@ -41,7 +41,7 @@ To use the Aspire dashboard with your Python app, you need to install the OpenTe
4141

4242
1. Install the OpenTelemetry SDK and exporter:
4343

44-
```console
44+
```bash
4545
pip install opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp-proto-grpc
4646
```
4747

@@ -59,7 +59,7 @@ This instrumentation has only focused on adding OpenTelemetry to our code. For m
5959

6060
1. Install the Flask instrumentation package:
6161

62-
```console
62+
```bash
6363
pip install opentelemetry-instrumentation-flask
6464
```
6565

@@ -69,7 +69,7 @@ This instrumentation has only focused on adding OpenTelemetry to our code. For m
6969

7070
1. Install the FastAPI instrumentation package:
7171

72-
```console
72+
```bash
7373
pip install opentelemetry-instrumentation-fastapi
7474
```
7575

@@ -86,7 +86,7 @@ docker run --rm -it -p 18888:18888 -p 4317:18889 --name aspire-dashboard \
8686

8787
In the Docker logs, the endpoint and key for the dashboard are displayed. Copy the key and navigate to `http://localhost:18888` in a web browser. Enter the key to log in to the dashboard.
8888

89-
## View Structured Logs
89+
## View structured logs
9090

9191
Navigate around the Python application, and you'll see structured logs in the Aspire dashboard. The structured logs page displays logs from your application, and you can filter and search the logs.
9292

0 commit comments

Comments
 (0)