# OpenTelemetry

**Identifier:** `PowerShellUniversal.Plugins.OpenTelemetry`

OpenTelemetry is a collection of APIs, SDKs, and tools. Use it to instrument, generate, collect, and export telemetry data (metrics, logs, and traces) to help you analyze your software’s performance and behavior.

The plugin enables integration with the technology. You can use [App Settings](/config/settings.md) to configure where to send data. PowerShell Universal currently only exposes a single OTLP endpoint configuration. The below configuration would work with Prometheus.

```json
{    
    "OpenTelemetry": {
        "Otlp": {
            "Endpoint": "http://localhost:9090/api/v1/otlp/v1/metrics"
        }
    }
}
```

### Prometheus

You can configure Prometheus to collect PowerShell Universal data by starting it with the OTLP collector enabled.

```powershell
 .\prometheus.exe --web.enable-otlp-receiver
```

Within PowerShell Universal, you will need to specify the `/api/v1/otlp/v1/metrics` URL for the Prometheus server. This example uses Prometheus 3.5.

```powershell
{    
    "OpenTelemetry": {
        "Otlp": {
            "Endpoint": "http://localhost:9090/api/v1/otlp/v1/metrics"
        }
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.powershelluniversal.com/platform/plugins/opentelemetry.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
