How can I send data from Apigee to AWS CloudWatch via SDK using flow hooks?

I’m trying to integrate AWS CloudWatch with Apigee so that I can send custom logs or metrics at the end of each API proxy execution. I plan to use a flow hook in Apigee and make a ServiceCallout to a custom endpoint.

However, CloudWatch doesn’t offer a simple HTTP endpoint for ingestion (as far as I know); it works via SDK

My questions are:

  1. Can I wrap SDK-based logging logic into an executable file (e.g., a .exe) and somehow attach or call that from Apigee?

  2. If that’s not feasible, is there an established or recommended approach to forward logs/metrics from Apigee to CloudWatch?

I’ve already successfully implemented simple executable files, but I’m unsure how to proceed when SDKs are involved.

Any advice, alternatives, or architecture suggestions are welcome!

Hi @HamzaJaffry ,

I noticed your question hasn’t been answered yet. Don’t worry—we’ll keep an eye on it and try to get some input from other members soon.

You should probably check with AWS, but is what you’re after not potentially this or similar? https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutMetricData.html

This is a separate thing however, thankyou I found the rest APIs but now the problem arises that there is no way to natively sign that payload with AWS signature when tried it says signature does not match. i am using a jar file published on github for the signature. but it is possible using signature directly from postman but not apigee

Hey @HamzaJaffry which JAR file are you using to sign, have you look at the following reference: GitHub - DinoChiesa/Apigee-Java-AWSV4-Signature

You mentioned that Postman works but creating the same workflow in Apigee does not - have you reviewed a debug session to review any possible differences?

Thanks!

Hi, yes, that’s the same JAR file I’m currently using to sign my payload. The issue is that I’m still getting an error in Postman. In Postman, I’m using its native AWS Signature authorization, while in Apigee I’m using the JAR file.

I also ran debug sessions to compare the payloads and didn’t notice any differences except for the date header which is off by about 5 seconds between requests. To rule this out, I even tried hardcoding the date so both requests would match exactly, but I’m still getting the same error.