Skip to content

Migrate from kube-prometheus-metrics to victoria-metrics-k8s-stack - #592

Merged
lhotari merged 1 commit into
apache:masterfrom
lhotari:lh-migrate-to-victoria-metrics-k8s-stack
Mar 9, 2025
Merged

lhotari merged 1 commit into
apache:masterfrom
lhotari:lh-migrate-to-victoria-metrics-k8s-stack

Conversation

@lhotari

@lhotari lhotari commented Mar 8, 2025

Copy link
Copy Markdown
Member

Motivation

kube-prometheus-stack has been replaced by victoria-metrics-k8s-stack for Pulsar Helm Chart version 4.0.0 due to
Prometheus incompatibility with Pulsar metrics since Pulsar 2.11.0 . Pulsar exposes metrics in a format that is partially OpenMetrics 1.0.0 text format, but isn't fully compatible. Prometheus doesn't provide proper support for OpenMetrics 1.0.0 text format, even in Prometheus version 3.2.1 where it was extensively tested before making the switch to Victoria MetricsVictoria Metrics is Apache 2.0 Licensed OSS and it's fully compatible with Prometheus.

Modifications

  • replace kube-prometheus-stack with victoria-metrics-k8s-stack which is Apache 2.0 Licensed OSS and it's fully compatible with Prometheus.
  • The Pulsar Helm Chart has pre-installed Grafana dashboards for Pulsar from various Apache 2.0 Licensed sources. These dashboards are outdated, and there's a separate project https://github.com/lhotari/pulsar-grafana-dashboards where the dashboards will be cleaned up and made fully compatible with Pulsar 4.0+ and Victoria Metrics.
    • In Pulsar, the Prometheus client_java library was updated to 0.15.0 with Bump prometheus client version from 0.5.0 to 0.15.0 pulsar#13785 in Pulsar 2.11.0 and this broke most of the metrics since the output is not Prometheus Text 0.0.4 format any more.
    • Since Victoria Metrics has better support for handling scraped metrics, it should be possible to get the metric names working again with Victoria Metrics configuration. In Prometheus, this isn't possible at the moment. There are some changes going on in the Prometheus project, to address it, but since Victoria Metrics is more feature complete and runs with less resources, it's a better choice in getting the dashboards usable again.

Additional context

  • Another PR will contain changes to migrate from using Prometheus Operator CRDs to use Victoria Metrics CRDs (PodMonitor -> VMPodScrape)

@lhotari
lhotari force-pushed the lh-migrate-to-victoria-metrics-k8s-stack branch 9 times, most recently from 41e8cb5 to b9a2863 Compare March 9, 2025 00:03
@lhotari
lhotari force-pushed the lh-migrate-to-victoria-metrics-k8s-stack branch from b9a2863 to 7ae7462 Compare March 9, 2025 00:07
@lhotari
lhotari merged commit e6f0580 into apache:master Mar 9, 2025
@mrtworo

mrtworo commented Mar 17, 2025

Copy link
Copy Markdown

@lhotari could you share some details on impact of staying with kube-prometheus-stack? Which metrics are broken? I couldn't find it here or in pulsar repo, sorry if it was already published.

@lhotari

lhotari commented Mar 17, 2025

Copy link
Copy Markdown
Member Author

@lhotari could you share some details on impact of staying with kube-prometheus-stack? Which metrics are broken? I couldn't find it here or in pulsar repo, sorry if it was already published.

@mrtworo I had limited time to spend on it and I seemed to have ran into some Prometheus bugs. one of them contained similar error messages as prometheus/prometheus#16160 . To be actually sure about the reasons, it would require time and effort that I don't have. With victoria-metrics-k8s-stack, I didn't run into problems and I was able to get the dashboards into a usable state.
One challenge was https://prometheus.io/docs/prometheus/latest/migration/#scrape-protocols which I was able to resolve with fallback_scrape_protocol. There's only a single metric that uses a histogram in Pulsar metrics (the metadata one) and Prometheus wasn't able to understand that. That was a minor issue. With VictoriaMetrics, the Pulsar metrics get ingested without issues. My observations could always be incorrect. Switching from Prometheus to VictoriaMetrics seems to be useful as a default. If someone would like to continue using kube-prometheus-stack, they could always customize their chart usage. There's simply not sufficient interest and contributors in this project to keep too many options around.

lhotari added a commit to kovaxur/pulsar-helm-chart that referenced this pull request May 4, 2026
PR apache#592 migrated all *-podmonitor.yaml templates to use the shared
pulsar.podMonitor helper in _monitor.tpl, which renders either a
Prometheus PodMonitor or a VictoriaMetrics VMPodScrape resource.

Adapted the customLabels feature to the new structure by injecting
the labels in the shared helper instead of in each individual file,
so they apply to both resource kinds and to all components covered
by the helper (broker, bookkeeper, autorecovery, proxy, zookeeper,
oxia-coordinator, oxia-server, standalone).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants