Conversation
Docker-based proof of concept demonstrating that the NiFi REST API provides all metrics needed for a Datadog Agent integration. Runs NiFi 2.8.0 in Docker with single-user auth, creates test flows via REST API, and queries all monitoring endpoints. Endpoints validated: /flow/about, /system-diagnostics, /flow/status, /flow/process-groups/root/status?recursive=true, /flow/cluster/summary, /flow/bulletin-board, /system-diagnostics/jmx-metrics.
|
This PR does not modify any files shipped with the agent. To help streamline the release process, please consider adding the |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cfe5083a3b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
nifi/poc/scripts/setup-flow.sh
Outdated
| if [ -z "$TOKEN" ] || [ "$TOKEN" = "null" ]; then | ||
| echo "ERROR: Failed to obtain auth token" | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
Validate token response status before continuing setup
This authentication check only rejects empty/null bodies, but NiFi can return a non-empty error payload on failed login (for example, wrong credentials or auth not fully initialized), which will be treated as a valid bearer token. In that case the script proceeds, downstream jq -r '.id' calls resolve to null, and the run can appear successful while no processors were actually created. The setup flow should fail fast by checking the HTTP status from /access/token (and ideally validating IDs after create calls).
Useful? React with 👍 / 👎.
Handle curl connection failures in collect() by defaulting http_code to "000" on error, preventing temp file orphans under set -e. Add JMX metrics endpoint to README table with note about empty results.
- Check HTTP status code (201) on token requests instead of just checking for empty/null body, catching HTML error responses - Add require_id() validation after every processor/connection creation to fail fast with clear errors - Re-collected API responses from fresh Docker run
Summary
nifi/poc/responses/for reference during implementationTest plan
cd nifi/poc && ./scripts/run-poc.sh— starts NiFi in Docker, creates test flows, collects all API responsescd nifi/poc && docker compose down -v