I have a Proxy and in that Proxy's have multiple resource path with multiple endpoints. I would like to create an Apigee ALERT to know which resource path/endpoint is failing. In Alert there is no option to set the resource path. I would be appreciate if anyone can help me on this or any best suggestion to implement .
Solved! Go to Solution.
Hi there,
You are correct in that with Apigee's metric based alerts are unable to configure alerts at a level deeper than the proxy. Meaning that configuring alerts for specific paths and endpoints within that proxy are impossible.
You can, however, use Apigee's log based alerts in tandem with GCP log based metrics to accomplish this. Here's how I was able to get it working:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<MessageLogging continueOnError="false" enabled="true" name="log-to-logging">
<DisplayName>Log to Logging</DisplayName>
<CloudLogging>
<LogName>projects/{organization.name}/logs/{system.timestamp}</LogName>
<Message contentType="application/json">{"reqPath": "{request.path}"}</Message>
<Labels>
<Label>
<Key>logType</Key>
<Value>apigeeError</Value>
</Label>
</Labels>
</CloudLogging>
</MessageLogging>
So to summarize I use an Apigee MessageLogging policy to send error logs to GCP Cloud Logging complete request path data, I then use a log-based metric to count incoming logs for any log which resided in the path "path1", I use that metric in my log-based alert to trigger an email alert any time it goes above the threshold of 60 logs per minute, and finally I send enough traffic to trigger that alert.
With this solution you can create a new metric+alert for any specific path/endpoint combination you'd like. I hope this helps!
Oh, apologies then. I should have confirmed if you were on Edge or X.
In similar fashion to X, you'll have to utilize tools external to Apigee in order to accomplish this on Edge. You could bootstrap my solution from above and make it work for Edge by utilizing the Google Cloud Logging Extension. Once the data is in Logging you should be able to follow my instructions and configure a metric alert.
Alternatively you could utilize a different extension or a MessageLogging policy to log your messages to a different service. Once the needed data is in your desired logging service it'll be up to you to configure alerts.
Hi there,
You are correct in that with Apigee's metric based alerts are unable to configure alerts at a level deeper than the proxy. Meaning that configuring alerts for specific paths and endpoints within that proxy are impossible.
You can, however, use Apigee's log based alerts in tandem with GCP log based metrics to accomplish this. Here's how I was able to get it working:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<MessageLogging continueOnError="false" enabled="true" name="log-to-logging">
<DisplayName>Log to Logging</DisplayName>
<CloudLogging>
<LogName>projects/{organization.name}/logs/{system.timestamp}</LogName>
<Message contentType="application/json">{"reqPath": "{request.path}"}</Message>
<Labels>
<Label>
<Key>logType</Key>
<Value>apigeeError</Value>
</Label>
</Labels>
</CloudLogging>
</MessageLogging>
So to summarize I use an Apigee MessageLogging policy to send error logs to GCP Cloud Logging complete request path data, I then use a log-based metric to count incoming logs for any log which resided in the path "path1", I use that metric in my log-based alert to trigger an email alert any time it goes above the threshold of 60 logs per minute, and finally I send enough traffic to trigger that alert.
With this solution you can create a new metric+alert for any specific path/endpoint combination you'd like. I hope this helps!
Thank you @ravenhedden for your quick response. Here I am using Apigee edge not Apigee X. In Apigee edge what's the solution for this.
Oh, apologies then. I should have confirmed if you were on Edge or X.
In similar fashion to X, you'll have to utilize tools external to Apigee in order to accomplish this on Edge. You could bootstrap my solution from above and make it work for Edge by utilizing the Google Cloud Logging Extension. Once the data is in Logging you should be able to follow my instructions and configure a metric alert.
Alternatively you could utilize a different extension or a MessageLogging policy to log your messages to a different service. Once the needed data is in your desired logging service it'll be up to you to configure alerts.
Thank you @ravenhedden