2024-04-13 04:04:25 +02:00
---
2024-04-18 10:25:29 +02:00
weight: 11
title: VMScrapeConfig
2024-04-13 04:04:25 +02:00
menu:
docs:
2024-08-16 16:32:25 +02:00
identifier: operator-cr-vmscrapeconfig
parent: operator-cr
2024-04-18 10:25:29 +02:00
weight: 11
2024-04-13 04:04:25 +02:00
aliases:
2024-08-16 16:32:25 +02:00
- /operator/resources/vmscrapeconfig/
- /operator/resources/vmscrapeconfig/index.html
2024-04-13 04:04:25 +02:00
---
2024-08-16 16:32:25 +02:00
The `VMScrapeConfig` CRD allows to define a scrape config using [any of the service discovery options supported in victoriametrics ](https://docs.victoriametrics.com/sd_configs ).
2024-04-13 04:04:25 +02:00
2024-08-16 16:32:25 +02:00
`VMScrapeConfig` object generates part of [VMAgent ](https://docs.victoriametrics.com/vmagent ) configuration with Prometheus-compatible scrape targets.
2024-04-13 04:04:25 +02:00
## Specification
You can see the full actual specification of the `VMScrapeConfig` resource in
2024-08-16 16:32:25 +02:00
the ** [API docs -> VMScrapeConfig ](https://docs.victoriametrics.com/operator/api#vmscrapeconfig )**.
2024-04-13 04:04:25 +02:00
Also, you can check out the [examples ](#examples ) section.
## Migration from Prometheus
The `VMScrapeConfig` CRD from VictoriaMetrics Operator is a drop-in replacement
for the Prometheus `ScrapeConfig` from prometheus-operator.
2024-08-16 16:32:25 +02:00
More details about migration from prometheus-operator you can read in [this doc ](https://docs.victoriametrics.com/operator/migration ).
2024-04-13 04:04:25 +02:00
## Examples
```yaml
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMScrapeConfig
metadata:
name: mongodb
spec:
consulSDConfigs:
- server: https://consul-dns:8500
services:
- mongodb
relabelConfigs:
- action: replace
sourceLabels:
- __meta_consul_service
targetLabel: job
```