You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/languages/_includes/exporters/prometheus-setup.md
+8-10Lines changed: 8 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,17 +23,11 @@ Once you have Prometheus set up, you can set up the OTLP Exporter, Prometheus ex
23
23
This section explains how to configure your application to send metrics directly to a Prometheus endpoint.
24
24
25
25
#### 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:
@@ -53,14 +47,18 @@ The default push interval for OpenTelemetry metrics is 60 seconds. The following
53
47
export OTEL_METRIC_EXPORT_INTERVAL=15000
54
48
```
55
49
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.
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.
64
62
65
-
#### Step 2: Configuring Telemetry
63
+
#### Configure telemetry
66
64
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