-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
base: main
Are you sure you want to change the base?
Conversation
…ackabletech/nifi-operator into fix/nifi2.0.0-monitoring-docs
Is this ready for review @Maleware ? I don't think you requested one yet.. |
Yes and no. It's the only working solution, but it will break stuff. I'd talk about it today to see if we want to make the efforts to fix it or leave as is. Depending on this, we can merge it or document a better way. |
needs to wait for https://github.com/stackabletech/decisions/issues/54 as this changes the regex expression |
after talking to @adwk67 we are not waiting on the decision of the service name. We will merge with the current implementation ( It's already with listener ) and rework if needed. Moving to |
==== Known Limitations | ||
|
||
NiFi only allows authentication with JWT on pod level. Therefore you will need one endpoint per NiFi pod and a valid bearer token for each. This is a consequence of NiFi | ||
moving their metrics endpoint behind a strong authentication mechanism. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would move this to the beginning of the authentication paragraph and update a little like this
==== Known Limitations | |
NiFi only allows authentication with JWT on pod level. Therefore you will need one endpoint per NiFi pod and a valid bearer token for each. This is a consequence of NiFi | |
moving their metrics endpoint behind a strong authentication mechanism. | |
[IMPORTANT] | |
==== | |
The NiFi metrics endpoints are behind a strong authentication mechanism which require credentials for each individual pod. | |
==== |
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's more important to explain why -k
is needed than what it does.
|
||
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You then can use the bearer token to authenticate with Prometheus replacing `basic_auth` with | |
The following example shows how to configure the Prometheus scraper to use the bearer token to authenticate against a NiFi pod. |
# basic_auth: | ||
# username: <user> | ||
# password: <password> | ||
authorization: | ||
type: Bearer | ||
credentials: "<Bearer Token>" | ||
tls_config: | ||
insecure_skip_verify: true | ||
static_configs: | ||
- targets: | ||
- '<pod>.<statefulset>.svc.cluster.local:8443' <1> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# basic_auth: | |
# username: <user> | |
# password: <password> | |
authorization: | |
type: Bearer | |
credentials: "<Bearer Token>" | |
tls_config: | |
insecure_skip_verify: true | |
static_configs: | |
- targets: | |
- '<pod>.<statefulset>.svc.cluster.local:8443' <1> | |
authorization: <1> | |
type: Bearer | |
credentials: "<Bearer Token>" <2> | |
tls_config: | |
insecure_skip_verify: true | |
static_configs: | |
- targets: | |
- '<pod>.<statefulset>.svc.cluster.local:8443' <3> |
metrics_path: '/nifi-api/flow/metrics/prometheus' | ||
scheme: https | ||
---- | ||
<1> Static targets only scrapes one pod. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<1> Static targets only scrapes one pod. | |
<1> Use the `authentication` property instead if the `basic_auth`. | |
<2> Add the previously obtained token here. | |
<3> Static targets only scrapes one pod. |
Description
Please add a description here. This will become the commit message of the merge request later.
Definition of Done Checklist