diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index e1e40b29..74e5b3a0 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -11,6 +11,8 @@ aliases: - /operator/changelog/index.html --- +- fixed Prometheus scrape config metricsPath conversion. See [this issue](https://github.com/VictoriaMetrics/operator/issues/1073) + ## [v0.47.0](https://github.com/VictoriaMetrics/operator/releases/tag/v0.47.0) - 15 Aug 2024 ### Breaking changes diff --git a/docs/setup.md b/docs/setup.md index 282faffe..a963ef67 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -21,7 +21,7 @@ For installing VictoriaMetrics operator with helm-chart follow the instructions ([this](https://github.com/VictoriaMetrics/helm-charts/blob/master/charts/victoria-metrics-operator/README.md) or [this](https://github.com/VictoriaMetrics/helm-charts/blob/master/charts/victoria-metrics-k8s-stack/README.md)). -in addition, you can use [quickstart guide](https://docs.victoriametrics.com/operator/quick-start) for +in addition, you can use [quickstart guide](https://docs.victoriametrics.com/operator/quick-start) for installing VictoriaMetrics operator with helm-chart. ## Installing by Manifest @@ -76,7 +76,8 @@ resources: namespace: ${NAMESPACE} images: -- name: victoriametrics/operator +- name: manager + newName: victoriametrics/operator newTag: ${VM_VERSION} EOF ``` diff --git a/internal/controller/operator/converter/v1alpha1/apis.go b/internal/controller/operator/converter/v1alpha1/apis.go index c815b081..5b443dae 100644 --- a/internal/controller/operator/converter/v1alpha1/apis.go +++ b/internal/controller/operator/converter/v1alpha1/apis.go @@ -143,6 +143,7 @@ func ConvertScrapeConfig(promscrapeConfig *promv1alpha1.ScrapeConfig, conf *conf cs.Annotations = converter.FilterPrefixes(promscrapeConfig.Annotations, conf.FilterPrometheusConverterAnnotationPrefixes) cs.Spec.RelabelConfigs = converter.ConvertRelabelConfig(promscrapeConfig.Spec.RelabelConfigs) cs.Spec.MetricRelabelConfigs = converter.ConvertRelabelConfig(promscrapeConfig.Spec.MetricRelabelConfigs) + cs.Spec.Path = ptr.Deref(promscrapeConfig.Spec.MetricsPath, "") if promscrapeConfig.Spec.EnableCompression != nil { cs.Spec.VMScrapeParams = &vmv1beta1.VMScrapeParams{ diff --git a/internal/controller/operator/converter/v1alpha1/apis_test.go b/internal/controller/operator/converter/v1alpha1/apis_test.go index bb25f56f..b9eb578b 100644 --- a/internal/controller/operator/converter/v1alpha1/apis_test.go +++ b/internal/controller/operator/converter/v1alpha1/apis_test.go @@ -82,6 +82,7 @@ func TestConvertScrapeConfig(t *testing.T) { Username: corev1.SecretKeySelector{Key: "username"}, Password: corev1.SecretKeySelector{Key: "password"}, }, + MetricsPath: ptr.To("/test"), ProxyConfig: promv1.ProxyConfig{ ProxyURL: ptr.To("http://proxy.com"), }, @@ -108,6 +109,7 @@ func TestConvertScrapeConfig(t *testing.T) { ProxyURL: ptr.To("http://proxy.com"), HonorTimestamps: ptr.To(true), VMScrapeParams: &vmv1beta1.VMScrapeParams{DisableCompression: ptr.To(false)}, + Path: "/test", }, StaticConfigs: []vmv1beta1.StaticConfig{ {