ONLYOFFICE / Kubernetes-Docs

ONLYOFFICE Docs for Kubernetes
https://onlyoffice.com
Apache License 2.0
43 stars 26 forks source link

Unable to get metrics in prometheus-statsd-exporter #318

Closed aurelgcmoi closed 2 months ago

aurelgcmoi commented 3 months ago

Hello,

I followed documentation to deploy prometheus-statsd-exporter and enable metrics in Onlyoffice helm as shown here: https://github.com/ONLYOFFICE/Kubernetes-Docs?tab=readme-ov-file#6-deploy-statsd-exporter https://github.com/ONLYOFFICE/Kubernetes-Docs?tab=readme-ov-file#52-metrics-deployment-optional

But I'm unable to see any metrics appear in prometheus-statsd-exporter. I even tried to add statsd config to a local.json confimap just in case but nothing seems to work.

Here is my values.yaml:

metrics:
  enabled: true
  host: observability-prometheus-statsd-exporter.observability
  port: "8125"
  prefix: onlyoffice.demoa.

Here is my local.json (but if I understand I shouldn't have to use this):

{{- if .Values.extraConf.configMap }}
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ .Values.extraConf.configMap }}
  namespace: {{ include "ds.namespace" . | quote }}
  {{- if .Values.commonLabels }}
  labels:
    {{- include "ds.labels.commonLabels" . | trim | nindent 4 }}
  {{- end }}
data:
  local.json: |-
    {
    {{- if .Values.metrics.enabled }}
      "statsd": {
        "useMetrics": true,
        "host": "{{ .Values.metrics.host }}",
        "port": "{{ .Values.metrics.port }}",
        "prefix": "{{.Values.metrics.prefix }}"
      },
    {{- end }}
      "services": {
        "CoAuthoring": {
          "autoAssembly": {
            "enable": true,
            "interval": "0m",
            "step": "0m"
          }
        }
      }
    }

{{- end }}

Any idea on what I may have missed here?

Thanks for the help.

Aurélien

GeorgeONLYOFFICE commented 2 months ago

Hello,

You don't need a configMap in this case, since there are environmental variables that exist for it already. At this point, you need to simply follow the guide. Could you specify where you are going to visualize metrics? If you are going to use Grafana, then you need to execute a step for Grafana as well

Judging by your metrics.host, it looks like you are deploying it in a different namespace than Docs. In this case, you need to specify the actual value here prior installation/update of Helm Docs. If you are going to install Grafana following our guidelines as well, you'll need to specify the correct value here Additionally, please note that in order for metrics to appear, you need to open a document for editing. You can also check if metrics are enabled for DS inside a converter pod by checking the value of METRICS_ENABLED environmental variable.

aurelgcmoi commented 2 months ago

Thanks for pointing this out !!

Additionally, please note that in order for metrics to appear, you need to open a document for editing.

Maybe next time I'll just wait a while before opening an issue.

Thanks again