Skip to content

Documentation: Migrate from reporting-task to native Prometheus metrics #704

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

Open
sbernauer opened this issue Nov 7, 2024 · 2 comments
Open

Comments

@sbernauer
Copy link
Member

sbernauer commented Nov 7, 2024

The Reporting task was removed from NiFi 2.x.x in #708.

However, /nifi-api/flow/metrics/prometheus needs authentication- which might be a blocker :( Relevant Slack thread

The steps required for the migration/configuration of the metrics endpoint (auth, authz) and how to connect e.g. Prometheus, should be documented.

@maltesander maltesander changed the title Migrate from reporting-task to native Prometheus metrics Documentation: Migrate from reporting-task to native Prometheus metrics Mar 27, 2025
@Maleware Maleware moved this to Development: In Progress in Stackable Engineering May 2, 2025
@sbernauer
Copy link
Member Author

A relevant message on NiFi Slack (cross-posting it here, as NiFi Slack looses messages):

I have set up prometheus with the simple-nifi cluster in k8s https://docs.stackable.tech/home/stable/nifi/getting_started/first_steps/. But I cannot access the metrics endpoint given in the docs https://docs.stackable.tech/home/stable/nifi/getting_started/first_steps/ with this prometheus configuration, because I get an 401 Unauthorized HTTP status. Has anyone an idea to solve it ? Or is this a bug ?

apiVersion: v1 
kind: Namespace
metadata:
  name: monitoring
---
apiVersion: v1
kind: ServiceAccount
metadata:
  namespace: monitoring
  name: prometheus
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: discoverer
rules:
- apiGroups: [""]
  resources:
  - nodes
  - services
  - endpoints
  - pods
  verbs: ["get", "list", "watch"]
- apiGroups:
  - extensions
  resources:
  - ingresses
  verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: prometheus-discoverer
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: discoverer
subjects:
- kind: ServiceAccount
  name: prometheus
  namespace: monitoring
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: prometheus
  namespace: monitoring
  labels:
    app: prometheus
spec:
  replicas: 1
  selector:
    matchLabels:
      app: prometheus
  template:
    metadata:
      labels:
        app: prometheus
    spec:
      serviceAccountName: prometheus
      containers:
      - name: prometheus
        image: prom/prometheus:v2.33.4
        ports:
        - containerPort: 9090
        volumeMounts:
          - name: config
            mountPath: /etc/prometheus
      volumes:
        - name: config
          configMap:
            name: prometheus-server-conf
---
apiVersion: v1
kind: Service
metadata:
  name: prometheus
  namespace: monitoring
spec:
  selector:
    app: prometheus
  ports:
  - port: 9090
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: prometheus-server-conf
  namespace: monitoring
  labels:
    name: prometheus-server-conf
data:
  prometheus.yml: |
    global:
      scrape_interval: 15s
    scrape_configs:
      - job_name: 'nifi-metrics'
        metrics_path: '/nifi-api/flow/metrics/prometheus'
        scheme: https
        static_configs:
          - targets:
            - 'simple-nifi-node-default-0.simple-nifi-node-default.default.svc.cluster.local:8443'
        basic_auth:
          username: admin
          password: admin
        tls_config:
          insecure_skip_verify: true
---
apiVersion: v1
kind: Service
metadata:
  name: my-service-prometheus
  namespace: monitoring
spec:
  type: NodePort
  selector:
    app: prometheus
  ports:
    - port: 9090
      targetPort: 9090
      nodePort: 30090

@Maleware
Copy link
Member

Maleware commented May 5, 2025

docs pr: #786

@Maleware Maleware moved this from Development: In Progress to Development: Waiting for Review in Stackable Engineering May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Development: Waiting for Review
Development

No branches or pull requests

3 participants