Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hivemq-platform-operator: issue with enabling prometheus extension #393

Open
ArtemZ opened this issue Nov 22, 2024 · 1 comment
Open

hivemq-platform-operator: issue with enabling prometheus extension #393

ArtemZ opened this issue Nov 22, 2024 · 1 comment

Comments

@ArtemZ
Copy link

ArtemZ commented Nov 22, 2024

Hello,

I use the recent hivemq-platform-operator and hivemq-platform charts.
I wanted to enabled prometheus metrics for hivemq and therefore tried to enable the related extension in plaform chart:

extensions:
  - name: hivemq-prometheus-extension
    enabled: true

but after that, I'm getting the following error in hivemq-platform-operator:

04:01:44.936 [pool-13-thread-24] WARN  c.h.p.o.d.StatefulSetResource - [hivemq4] Cannot reconcile the StatefulSet: The custom resource spec is invalid
java.lang.IllegalArgumentException: The extension 'hivemq-prometheus-extension' is fully managed by the HiveMQ Platform Operator and cannot be customized via an extension configuration
	at com.hivemq.platform.operator.v1.HiveMQPlatformValidator.lambda$validateExtensions$4(HiveMQPlatformValidator.java:246)
	at java.base/java.util.ArrayList.forEach(Unknown Source)
	at com.hivemq.platform.operator.v1.HiveMQPlatformValidator.validateExtensions(HiveMQPlatformValidator.java:238)
	at com.hivemq.platform.operator.v1.HiveMQPlatformValidator.validateSpec(HiveMQPlatformValidator.java:92)
	at com.hivemq.platform.operator.dependants.StatefulSetResource.reconcile(StatefulSetResource.java:108)
	at com.hivemq.platform.operator.dependants.StatefulSetResource.reconcile(StatefulSetResource.java:55)
	at io.javaoperatorsdk.operator.processing.dependent.workflow.WorkflowReconcileExecutor$NodeReconcileExecutor.doRun(WorkflowReconcileExecutor.java:123)
	at io.javaoperatorsdk.operator.processing.dependent.workflow.NodeExecutor.run(NodeExecutor.java:22)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

I also set this configuraion for the platform chart:

# Monitoring settings used by the HiveMQ Prometheus extension.
metrics:
  # Set to disable or enable the HiveMQ Prometheus extension.
  enabled: true
  # Defines the port to be used by the HiveMQ Prometheus extension.
  port: 9399
  # Defines the URL path to be used by HiveMQ Prometheus extension.
  path: /

but it made no effect.

So how do I get metrics then?
I looked up in /opt/hivemq/extensions/hivemq-prometheus-extension on the pod and there is "DISABLED" file in this folder, so the init script skips this extension. How to properly enable it then?

@afalhambra-hivemq
Copy link
Contributor

afalhambra-hivemq commented Nov 22, 2024

Hello @ArtemZ!
Thanks for reaching out.

As you can see from the error log, the HiveMQ Prometheus extension is already bundled with the HiveMQ Platform Operator

The extension 'hivemq-prometheus-extension' is fully managed by the HiveMQ Platform Operator and cannot be customized via an extension configuration

Out of the box, when installing the HiveMQ Platform you will automatically get a a metrics Kubernetes service available, so you don't really need to do anything else to setup the Prometheus extension to get the HiveMQ metrics.

Of course, you can still configure it by using some of the Helm HiveMQ Platform chart values for the same as documented here: https://docs.hivemq.com/hivemq-platform-operator/configuration.html#metrics-options

Hope it helps.

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

No branches or pull requests

2 participants