Skip to content

help request: Fluentd Prometheus Plugin and Metrics Expose #1777

@vajgi90

Description

@vajgi90

Describe the issue

Dear Community,

I would like my Fluentd pods to provide metrics about themselves on 24231 port /metrics patch.

It's not entirely clear to me, but I wanted this block

<source>
  @type prometheus
  bind 0.0.0.0
  port 24231
  metrics_path /metrics
</source>

to be included in my fluentd config and the metrics to be placed in the /metrics path.

To do this, I also created a ClusterInput:

apiVersion: fluentd.fluent.io/v1alpha1
kind: ClusterInput
metadata:
  labels:
    config.fluentd.fluent.io/enabled: 'true'
  name: prometheus-metrics
spec:
  inputs:
    - customPlugin:
        config: |
          <source>
            @type prometheus
            bind 0.0.0.0
            port 24231
            metrics_path /metrics
          </source>

And I patched: ClusterFluentdConfig with this because by default the template does not contain it:

clusterInputSelector:
matchLabels:
filter.fluentd.fluent.io/enabled: "true"

apiVersion: fluentd.fluent.io/v1alpha1
kind: ClusterFluentdConfig
metadata:
  labels:
    config.fluentd.fluent.io/enabled: "true"
  name: fluentd-config
spec:
  clusterFilterSelector:
    matchLabels:
      filter.fluentd.fluent.io/enabled: "true"
  clusterInputSelector:
    matchLabels:
      filter.fluentd.fluent.io/enabled: "true"
  clusterOutputSelector:
    matchLabels:
      output.fluentd.fluent.io/enabled: "true"
  watchedNamespaces: []

I still find that the Prometheus-specific Source is not included in the configuration (fluentd-config k8s secret).

Do you have any tips on what else might be missing? Thank you in advance for your help.

How did you install fluent operator?

With Helm Chart ( version 3.3.0).

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions