VictoriaMetrics/docs/operator/resources/vmstaticscrape.md
Github Actions a0b1c95787
Automatic update operator docs from VictoriaMetrics/operator@731de81 (#6139)
Co-authored-by: Alexander Marshalov <_@marshalov.org>
2024-04-19 11:35:21 +02:00

49 lines
1.4 KiB
Markdown

---
sort: 14
weight: 14
title: VMStaticScrape
menu:
docs:
parent: "operator-custom-resources"
weight: 14
aliases:
- /operator/resources/vmstaticscrape.html
---
# VMStaticScrape
The `VMStaticScrape` CRD provides mechanism for scraping metrics from static targets, configured by CRD targets.
`VMStaticScrape` object generates part of [VMAgent](./vmagent.md)
configuration with [static "service discovery"](https://docs.victoriametrics.com/sd_configs.html#static_configs).
It has various options for scraping configuration of target (with basic auth,tls access, by specific port name etc.).
By specifying configuration at CRD, operator generates config
for [VMAgent](./vmagent.md) and syncs it.
It's useful for external targets management, when service-discovery is not available.
`VMAgent` `staticScrapeSelector` must match `VMStaticScrape` labels.
More information about selectors you can find in [this doc](./vmagent.md#scraping).
## Specification
You can see the full actual specification of the `VMStaticScrape` resource in
the **[API docs -> VMStaticScrape](../api.md#vmstaticscrape)**.
Also, you can check out the [examples](#examples) section.
## Examples
```yaml
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMStaticScrape
metadata:
name: vmstaticscrape-sample
spec:
jobName: static
targetEndpoints:
- targets: ["192.168.0.1:9100", "196.168.0.50:9100"]
labels:
env: dev
project: operator
```