Logging request and response in Azure Insight

Not applicable

Hi ,

We have a requirement wherein we have to log the request and response after the response sent to client. We need to usre Azure insight with Apigee for logging.

We have tried implementing this using nodejs proxy,

1. We have created one nodejs proxy which has script for azureinsight logging.

2. We have used assign message policy in the same proxy to create a request.

3. When we are sending request directly to this API, the request is being logged and we can see the data in Azure Insight.

However, when we tried to implemet in the following format,

1. Created node js proxy which has script for azure insight logging

2. Created shared flow and added assign message policy to get the request also added service callout policy to call my nodejs proxy created above.

3. Created one more API(ex: sampleAPI) and used this shared flow. Now when we call sampleAPI, the request is going through shared flow and coming to the nodejs proxy but the request data is not being stored.

Please assist us with the above implementation.

0 4 1,098
4 REPLIES 4

Hi @Minakshi Wadibhasme, does Azure Analytics support syslog receiver?

If yes, then we can simply use a Message Logging Policy.

-

In your question, what do you mean by `request data is not being stored`?

Is your sampleAPI call request is not stored?

Is the assign message policy from noedejs proxy request is not stored?

I don't think Azure Analytics supports syslog receiver.

Not applicable

Hi,

Can you help me with a away or a flow on how to connect Microsoft azure insights with APIGEE proxy to log the request and response for api proxy to azure insights?

I think you can probably send a log message with "fire and forget" ServiceCallout or JS callout (search the community archives, or check this answer here) to the Azure insights endpoint. You will use the API documented here.

You will need to format the JSON payload as required by Azure Insights.