Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

NIFI rest api monitoring

Explorer

I would like to use chrome developer tools to monitor REST API calls that nifi makes. I went to the developer tools, and selected network option and can see all calls that my processgroup makes but not able to see the calls with API usage. The reason is that I would like to use REST API to modify the processgroup on the fly without affecting current flow running. Do I need to install any other plugins to track nifi REST api calls.

4 REPLIES 4

Expert Contributor
@laki cheli

Could you elaborate on what you mean by 'processgroup'? I'm unclear on "modify the processgroup on the fly without affecting current flow running".

In general if you are using an InvokeHTTP processor inside of NiFi, you won't be able to monitor the calls it is making out to a REST API endpoint. This is because the processor is running on your NiFi node, not in your NiFi client/browser app, and the activity is occurring separate from your client machine on the NiFi nodes. You can track usage by sending the data to a processor that logs the information to HDFS or local disk.

You may also be looking for the NiFi REST API, which allows you to modify NiFi flows and get information about your flows:

https://nifi.apache.org/docs/nifi-docs/rest-api/index.html

Explorer

I have a flow that is running for ever to pull data from external sources, and at the end of the flow, I would like to add a process to write a log file. only option that I have is stop the flow and add new one, or add thru script using API,

I got the API doc but there is not much explanation about the usage and browsed community to get some info and found out that if we can use Chrome developer tools and understand how calls are made, I can simulate the same using script on my node.

The part that is missing is how to trace out, I used developer tools to trace JS, some client based tools. How i can trace the API calls that nifi is making .

Expert Contributor

@laki cheli

The guidance you probably read in the community pertains to when you want to duplicate a set of API calls from a custom client application to its server. You would need to use the Chrome developer tools to understand how those client-server API calls are being made. However this has nothing to do with writing to a log file in NiFi, so that is not what you are looking for.

Is there anything wrong with stopping your flow and adding a new processor to write to a log file? That would be the easiest and recommended way to test it out. If this is a production system then you will need to either use the NiFi Flow Registry or create a template in Dev and apply that template across to other environments.

Explorer

I agree with other options, in the below link, lots of information has been extracted using curl into jason object, wondering how to know the usage of commands in pertain to API calls, the author also explained how to add a new process to the existing flow.

All is well, but I do not get to see the commands used to extract. So thinking that there should be a away to see the command usage. I used some on my node, it worked like a charm but how do i know the current usage of switches ???? I do not want to use it just it is there

https://community.hortonworks.com/articles/87217/change-nifi-flow-using-rest-api-part-1.html

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.