# Scraping Metrics in Standalone Hosts

{% hint style="warning" %}
groundcover sensor should be deployed on the host. If that's not the case, please see [Pushing Metrics using Remote Write](https://docs.groundcover.com/integrations/data-sources/prometheus/push-metrics-to-groundcover) as an alternative.
{% endhint %}

Host based sensors can be configured to scrape Prometheus endpoints using standard [Prometheus discovery jobs](https://docs.victoriametrics.com/sd_configs.html#supported-service-discovery-configs).

To enable metrics scraping add the following overrides to your `/etc/opt/groundcover/overrides.yaml` file:

```yaml
receivers:
 remotewrite:
  enabled: true
 metricsscraper:
  enabled: true
```

Scrape configurations should be placed in the following file:\
`/opt/groundcover/scrape-config/metrics-scrape-config.yaml`

Below are the examples you can refer to.

#### Scraping Local Service <a href="#example-scraping-remote-service" id="example-scraping-remote-service"></a>

In this example we are instructing the sensor to periodically scrape metrics from a local service exposing its metrics on port `8080` under `/metrics.`

```yaml
scrape_configs:
  - job_name: scrape-local-service
    honor_timestamps: true
    honor_labels: true
    scrape_interval: 15s
    scrape_timeout: 5s
    metrics_path: /metrics
    scheme: http
    static_configs:
    - targets:
      - localhost:8080
```

#### Scraping Remote Service <a href="#example-scraping-remote-service" id="example-scraping-remote-service"></a>

In this example we are instructing the sensor to periodically scrape metrics from a remote service exposing its metrics on port `443` under `/metrics` and adding a team label.

{% hint style="success" %}
The target can be either a domain name or an IP address
{% endhint %}

```yaml
scrape_configs:
  - job_name: scrape-remote-service
    honor_timestamps: true
    honor_labels: true
    scrape_interval: 15s
    scrape_timeout: 5s
    metrics_path: /metrics
    scheme: http
    static_configs:
    - targets:
      - my-custom-domain.com:443
      labels:
        team: your-team-name
```

### Common Questions <a href="#common-questions" id="common-questions"></a>

#### How often are my metrics scraped? <a href="#how-often-are-my-metrics-scraped" id="how-often-are-my-metrics-scraped"></a>

Metrics are scraped periodically based on the `scrape_interval` configured.

#### Where can I find scraped metrics? <a href="#where-can-i-find-scraped-metrics" id="where-can-i-find-scraped-metrics"></a>

All metrics in the platform can be found in the metrics exploration page: <https://app.groundcover.com/explore/data-explorer>


---

# 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.groundcover.com/integrations/data-sources/prometheus/scraping-metrics-in-standalone-hosts.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.
