---
title: "prometheus.exporter.vsphere | Grafana Agent documentation"
description: "Learn about prometheus.exporter.vsphere"
---

# prometheus.exporter.vsphere (deprecated)

> Caution
> 
> Starting with release v0.40, `prometheus.exporter.vsphere` is deprecated. Consider using `otelcol.receiver.vcenter` instead. `prometheus.exporter.vsphere` will be removed in a future release.

The `prometheus.exporter.vsphere` component embeds [`vmware_exporter`](https://github.com/grafana/vmware_exporter) to collect vSphere metrics.

> **NOTE**: We recommend to use [otelcol.receiver.vcenter](../otelcol.receiver.vcenter/) instead.

## Usage

Alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```alloy
prometheus.exporter.vsphere "LABEL" {
}
```

## Arguments

You can use the following arguments to configure the exporter’s behavior. Omitted fields take their default values.

Expand table

| Name                      | Type       | Description                                                                                         | Default | Required |
|---------------------------|------------|-----------------------------------------------------------------------------------------------------|---------|----------|
| `vsphere_url`             | `string`   | The url of the vCenter endpoint SDK                                                                 |         | no       |
| `vsphere_user`            | `string`   | vCenter username.                                                                                   |         | no       |
| `vsphere_password`        | `secret`   | vCenter password.                                                                                   |         | no       |
| `request_chunk_size`      | `int`      | Number of managed objects to include in each request to vsphere when fetching performance counters. | `256`   | no       |
| `collect_concurrency`     | `int`      | Number of concurrent requests to vSphere when fetching performance counters.                        | `8`     | no       |
| `discovery_interval`      | `duration` | Interval on which to run vSphere managed object discovery.                                          | `0`     | no       |
| `enable_exporter_metrics` | `boolean`  | Enable the exporter metrics.                                                                        | `true`  | no       |

- Setting `discovery_interval` to a non-zero value will result in object discovery running in the background. Each scrape will use object data gathered during the last discovery. When this value is 0, object discovery occurs per scrape.

## Exported fields

The following fields are exported and can be referenced by other components.

Expand table

| Name      | Type                | Description                                               |
|-----------|---------------------|-----------------------------------------------------------|
| `targets` | `list(map(string))` | The targets that can be used to collect exporter metrics. |

For example, the `targets` can either be passed to a `discovery.relabel` component to rewrite the targets’ label sets or to a `prometheus.scrape` component that collects the exposed metrics.

The exported targets use the configured [in-memory traffic](/docs/agent/v0.43/flow/concepts/component_controller/#in-memory-traffic) address specified by the [run command](/docs/agent/v0.43/flow/reference/cli/run/).

## Component health

`prometheus.exporter.vsphere` is only reported as unhealthy if given an invalid configuration. In those cases, exported fields retain their last healthy values.

## Debug information

`prometheus.exporter.vsphere` does not expose any component-specific debug information.

## Debug metrics

`prometheus.exporter.vsphere` does not expose any component-specific debug metrics.

## Example

This example uses a [`prometheus.scrape` component](../prometheus.scrape/) to collect metrics from `prometheus.exporter.vsphere`:

Alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```alloy
prometheus.exporter.vsphere "example" {
    vsphere_url      = "https://127.0.0.1:8989/sdk"
    vsphere_user     = "user"
    vsphere_password = "pass"
}

// Configure a prometheus.scrape component to collect vsphere metrics.
prometheus.scrape "demo" {
  targets    = prometheus.exporter.vsphere.example.targets
  forward_to = [ prometheus.remote_write.default.receiver ]
}

prometheus.remote_write "default" {
  endpoint {
    url = "REMOTE_WRITE_URL"
  }
}
```

## Compatible components

`prometheus.exporter.vsphere` has exports that can be consumed by the following components:

- Components that consume [Targets](../../compatibility/#targets-consumers)

> Note
> 
> Connecting some components may not be sensible or components may require further configuration to make the connection work correctly. Refer to the linked documentation for more details.
