Skip to content

Adding docs on how to authenticate with prometheus to nifi 2.x.x metrics #786

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
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions docs/modules/nifi/pages/usage_guide/monitoring.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,29 @@ https://simple-nifi-node-default-0.simple-nifi-node-default.<namespace>.svc.clus
```

IMPORTANT: If NiFi is configured to do any user authentication, requests to the metric endpoint must be authenticated and authorized.

=== Authentication with NiFi `2.x.x`
To authenticate, you can use a bearer token created by your NiFi instance e.g.

[source,bash]
----
curl -X POST https://simple-nifi-node-default-0.simple-nifi-node-default.<namespace>.svc.cluster.local:8443/nifi-api/access/token -d 'username=<user>&password=<password>' -k
----

where `-k` equals `verify=false`. The reply is your bearer token.

You then can use the bearer token to authenticate with Prometheus replacing `basic_auth` with

[source,yaml]
----
# basic_auth:
# username: <user>
# password: <password>
authorization:
type: Bearer
credentials: "<Bearer Token>"
tls_config:
insecure_skip_verify: true
----

according to https://prometheus.io/docs/prometheus/latest/configuration/configuration/#http_config[Prometheus documentation].