{ Community }
  • Academy
  • Docs
  • Developers
  • Resources
    • Community Articles
    • Apigee on GitHub
    • Code Samples
    • Videos & eBooks
    • Accelerator Methodology
  • Support
  • Ask a Question
  • Spaces
    • Product Announcements
    • General
    • Edge/API Management
    • Developer Portal (Drupal-based)
    • Developer Portal (Integrated)
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Adapter for Envoy
    • Analytics
    • Events
    • Hybrid
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • 日本語コミュニティ
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Topics
    • Questions
    • Articles
    • Ideas
    • Leaderboard
    • Badges
  • Log in
  • Sign up

Get answers, ideas, and support from the Apigee Community

  • Home /
  • Integration (AWS, PCF, Etc.) /
avatar image
1
Question by Dorian Blanc · Jul 08, 2020 at 03:20 PM · 342 Views loggingawsmessageloggingpost client flow

How can I Send logs to AWS CloudWatch from Apigee PostClientFlow?

Hello,

How to send logs to AWS (CloudWatch) from Proxy's Postclientflow ?

CloudWatch cannot take syslog as input, it has REST API or SDK to push logs but how to use it with MessageLogging policy ?

Thanks.

Comment
Add comment
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Close

1 Answer

  • Sort: 
avatar image
1
Best Answer

Answer by Dino-at-Google   · Jul 08, 2020 at 04:53 PM

If CloudWatch has a REST API, then you can use ServiceCallout in PostClientFlow to send the message to the endpoint. The endpoint needs to be publicly accessible, publicly routable.

I think Apigee documentation states that the only policy permitted for use within PostClientFlow is the MessageLogging policy. BUT, Apigee operations can also configure your organization to allow ServiceCallout in PostClient Flow. To make this change, contact your Apigee support rep. There's no charge for that.

So if you can figure out how to make a POST call to your CloudWatch endpoint, with the appropriate credentials and payload, then ... you should be able to use ServiceCallout to emit that call for every request that Apigee handles.

Comment
Add comment Show 1 · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Eduardo Pablo Gonzalez Pozega · Aug 10, 2020 at 11:59 PM 0
Link

Hi, like Dino mentioned, I would recommend using AWS Rest API. I was able to get it working using this Java Callout policy implemented by @miguelmendoza, since you need to add AWS Signature V4 headers to the HTTP requests. Check out his post: https://community.apigee.com/articles/76109/calling-amazon-web-services-aws-rest-apis-from-api.html

Notice that there are some limitations when you are trying to log from multiple proxies, you need to make sure there are no collisions.

From AWS API Documentation here are some limitations:

  • The maximum batch size is 1,048,576 bytes. This size is calculated as the sum of all event messages in UTF-8, plus 26 bytes for each log event.
  • None of the log events in the batch can be more than 2 hours in the future.
  • None of the log events in the batch can be older than 14 days or older than the retention period of the log group.
  • The log events in the batch must be in chronological order by their timestamp. The timestamp is the time the event occurred, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. (In AWS Tools for PowerShell and the AWS SDK for .NET, the timestamp is specified in .NET format: yyyy-mm-ddThh:mm:ss. For example, 2017-09-15T13:45:30.)
  • A batch of log events in a single request cannot span more than 24 hours. Otherwise, the operation fails.
  • The maximum number of log events in a batch is 10,000.
  • There is a quota of 5 requests per second per log stream. Additional requests are throttled. This quota can't be changed.

Hope this helps!

Follow this Question

Answers Answers and Comments

54 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

AWS Instance Type Recommendations and AWS AMI 1 Answer

Zipkin vs Jaeger 1 Answer

Invoking AWS Lambda function from a nodejs proxy,Connecting Apigee to AWS Lambda 2 Answers

Apigee Edge Cloud Team bundle - integration AWS - IP Whitelisting 1 Answer

Limit access to Elastic Beanstalk to only via Apigee Reverse Proxies 1 Answer

  • Products
    • Edge - APIs
    • Insights - Big Data
    • Plans
  • Developers
    • Overview
    • Documentation
  • Resources
    • Overview
    • Blog
    • Apigee Institute
    • Academy
    • Documentation
  • Company
    • Overview
    • Press
    • Customers
    • Partners
    • Team
    • Events
    • Careers
    • Contact Us
  • Support
    • Support Overview
    • Documentation
    • Status
    • Edge Support Portal
    • Privacy Policy
    • Terms & Conditions
© 2021 Apigee Corp. All rights reserved. - Apigee Community Terms of Use - Powered by AnswerHub
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • Product Announcements
  • General
  • Edge/API Management
  • Developer Portal (Drupal-based)
  • Developer Portal (Integrated)
  • API Design
  • APIM on Istio
  • Extensions
  • Business of APIs
  • Academy/Certification
  • Adapter for Envoy
  • Analytics
  • Events
  • Hybrid
  • Integration (AWS, PCF, Etc.)
  • Microgateway
  • Monetization
  • Private Cloud Deployment
  • 日本語コミュニティ
  • Insights
  • IoT Apigee Link
  • BaaS/Usergrid
  • BaaS Transition/Migration
  • Apigee-127
  • New Customers
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Badges