Skip to content

Commit f4246f0

Browse files
authored
Updated instructions for bash users
1 parent 7d0e14a commit f4246f0

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

README.md

+17-8
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99

1010
| Step | Windows (PowerShell) | Linux / MacOS (bash) |
1111
|------|---------------------------------------|----------------------------------------|
12-
| 1 | `pip install virtualenv` |
12+
| 1 | `pip install virtualenv` | `pip3 install virtualenv` |
1313
| 2 | `python -m venv venv` | `python3 -m venv venv` |
1414
| 3 | `.\venv\Scripts\Activate.ps1` | `source venv/bin/activate` |
1515
| 4 | `python -m pip install --upgrade pip` | `python3 -m pip install --upgrade pip` |
16-
| 5 | `pip install -r requirements.txt` |
16+
| 5 | `pip install -r requirements.txt` | `pip install -r requirements.txt` |
1717

1818

1919
# Running the Application
@@ -23,11 +23,11 @@ import newrelic.agent
2323
newrelic.agent.initialize()
2424
```
2525

26-
| Windows (PowerShell) | Linux / MacOS (bash) |
26+
| Windows (PowerShell) | Linux / macOS (bash) |
2727
|------------------------------------------------|------------------------------------------------|
2828
| `$Env:NEW_RELIC_APP_NAME = "Local Python App"` | `export NEW_RELIC_APP_NAME="Local Python App"` |
2929
| `$Env:NEW_RELIC_LICENSE_KEY = "XXXX...NRAL"` | `export NEW_RELIC_LICENSE_KEY="XXXX...NRAL"` |
30-
| `python datacrunch-consulting\webserver.py` | `python3 datacrunch-consulting/webserver.py` |
30+
| `python webserver.py` | `python3 webserver.py` |
3131

3232

3333
# Endpoints to Test
@@ -45,10 +45,19 @@ newrelic.agent.initialize()
4545

4646
# OpenTelemetry
4747
1. To send telemetry data to New Relic, set the following environment variables
48+
49+
Windows (PowerShell)
50+
```
51+
$Env:OTEL_EXPORTER_OTLP_ENDPOINT="https://otlp.nr-data.net:4317"
52+
$Env:OTEL_EXPORTER_OTLP_HEADERS=api-key="XXXX...NRAL"
53+
(optional) $Env:OTEL_RESOURCE_ATTRIBUTES=service.name="python-flask.otel,service.instance.id=localhost-pc"
54+
```
55+
56+
Linux / macOS
4857
```
49-
OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp.nr-data.net:4317
50-
OTEL_EXPORTER_OTLP_HEADERS=api-key=XXXX...NRAL
51-
OTEL_RESOURCE_ATTRIBUTES=service.name=python-flask.otel,service.instance.id=localhost-pc
58+
export OTEL_EXPORTER_OTLP_ENDPOINT="https://otlp.nr-data.net:4317"
59+
export OTEL_EXPORTER_OTLP_HEADERS=api-key="XXXX...NRAL"
60+
(optional) export OTEL_RESOURCE_ATTRIBUTES=service.name="python-flask.otel,service.instance.id=localhost-pc"
5261
```
5362

5463
2. Download the following packages to your virtual environment
@@ -62,7 +71,7 @@ pip install opentelemetry-distro
6271

6372
3. No changes to the code is needed, just run the app as usual but with `opentelemetry-instrument` at the front
6473
```
65-
opentelemetry-instrument python .\datacrunch-consulting\webserver.py
74+
opentelemetry-instrument python3 webserver.py
6675
```
6776

6877
# Docker Image

0 commit comments

Comments
 (0)