2023-10-05 12:43:28 +02:00
|
|
|
---
|
2024-04-18 10:25:29 +02:00
|
|
|
weight: 14
|
2023-10-05 12:43:28 +02:00
|
|
|
title: VMStaticScrape
|
|
|
|
menu:
|
|
|
|
docs:
|
2024-08-16 16:32:25 +02:00
|
|
|
identifier: operator-cr-vmstaticscrape
|
|
|
|
parent: operator-cr
|
2024-04-18 10:25:29 +02:00
|
|
|
weight: 14
|
2023-11-22 12:59:07 +01:00
|
|
|
aliases:
|
2024-08-16 16:32:25 +02:00
|
|
|
- /operator/resources/vmstaticscrape/
|
|
|
|
- /operator/resources/vmstaticscrape/index.html
|
2023-10-05 12:43:28 +02:00
|
|
|
---
|
2023-10-02 14:50:08 +02:00
|
|
|
The `VMStaticScrape` CRD provides mechanism for scraping metrics from static targets, configured by CRD targets.
|
|
|
|
|
2024-08-16 16:32:25 +02:00
|
|
|
`VMStaticScrape` object generates part of [VMAgent](https://docs.victoriametrics.com/operator/resources/vmagent)
|
|
|
|
configuration with [static "service discovery"](https://docs.victoriametrics.com/sd_configs#static_configs).
|
2023-10-02 14:50:08 +02:00
|
|
|
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
|
2024-08-16 16:32:25 +02:00
|
|
|
for [VMAgent](https://docs.victoriametrics.com/operator/resources/vmagent) and syncs it.
|
2023-10-02 14:50:08 +02:00
|
|
|
It's useful for external targets management, when service-discovery is not available.
|
|
|
|
`VMAgent` `staticScrapeSelector` must match `VMStaticScrape` labels.
|
|
|
|
|
2024-08-16 16:32:25 +02:00
|
|
|
More information about selectors you can find in [this doc](https://docs.victoriametrics.com/operator/resources/vmagent#scraping).
|
2023-10-02 14:50:08 +02:00
|
|
|
|
|
|
|
## Specification
|
|
|
|
|
|
|
|
You can see the full actual specification of the `VMStaticScrape` resource in
|
2024-08-16 16:32:25 +02:00
|
|
|
the **[API docs -> VMStaticScrape](https://docs.victoriametrics.com/operator/api#vmstaticscrape)**.
|
2023-10-02 14:50:08 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
```
|