Skip to content

Commit 6da1928

Browse files
committed
Apply code review suggestions on improving structure
1 parent 86dcca0 commit 6da1928

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

content/en/docs/languages/_includes/exporters/prometheus-setup.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,11 @@ Once you have Prometheus set up, you can set up the OTLP Exporter, Prometheus ex
2323
This section explains how to configure your application to send metrics directly to a Prometheus endpoint.
2424

2525
#### Use environment variables
26-
OpenTelemetry SDKs and instrumentation libraries can usually be configured via [standard environment variables](/docs/languages/sdk-configuration/). Set the environment variables before starting your application by:
27-
- exporting them directly from your terminal,
28-
- adding them to your shell config file (e.g., `.bashrc`, `.zshrc`),
29-
- or loading them from a `.env` file.
30-
31-
Below are the OpenTelemetry variables needed to send OpenTelemetry metrics to a Prometheus server on localhost:
26+
You can configure OpenTelemetry SDKs and instrumentation libraries with [standard environment variables](/docs/languages/sdk-configuration/). Set the environment variables before starting your application. Below are the OpenTelemetry variables needed to send OpenTelemetry metrics to a Prometheus server on localhost:
3227

3328
```bash
3429
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
3530
export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:9090/api/v1/otlp
36-
3731
```
3832
Note:
3933

@@ -53,14 +47,18 @@ The default push interval for OpenTelemetry metrics is 60 seconds. The following
5347
export OTEL_METRIC_EXPORT_INTERVAL=15000
5448
```
5549

56-
If your instrumentation library does not provide `service.name` and `service.instance.id` out-of-the-box, it is highly recommended to set them.
50+
If your instrumentation library does not provide `service.name` and `service.instance.id` out-of-the-box, it is highly recommended to set them. The example below assumes that the `uuidgen` command is available on your system.
5751

5852
```bash
5953
export OTEL_SERVICE_NAME="my-example-service"
6054
export OTEL_RESOURCE_ATTRIBUTES="service.instance.id=$(uuidgen)"
6155
```
6256

63-
The above assumes that the `uuidgen` command is available on your system. Make sure that `service.instance.id` is unique for each instance, and that a new `service.instance.id` is generated whenever a resource attribute changes. The [recommended way](https://github.com/open-telemetry/semantic-conventions/tree/main/docs/resource) is to generate a new UUID on each startup of an instance.
57+
> [!NOTE]
58+
> Make sure that `service.instance.id` is unique for each instance,
59+
> and that a new `service.instance.id` is generated whenever a resource attribute changes.
60+
> The [recommended way](https://github.com/open-telemetry/semantic-conventions/tree/main/docs/resource)
61+
> is to generate a new UUID on each startup of an instance.
6462
65-
#### Step 2: Configuring Telemetry
63+
#### Configure telemetry
6664
Update your OpenTelemetry Configuration to use the same `exporter` and `reader` from the [OTLP](#otlp-dependencies) setup. If the environment variables are set up and loaded correctly, the OpenTelemetry SDK reads them automatically.

0 commit comments

Comments
 (0)