go xray sdk in lambda to capture calls to redis - go

I am trying to implement golang xray sdk in LAMBDA to capture calls going to redis (AWS managed). Is there a documentation that I can refer for that or any directions to do that.
I am using go-redis to makes calls to redis server.

Related

Is it possible to have a multi-endpoint REST API on Google Cloud Functions? (Aws Lambda migration to GCF)

My company has been using AWS Lambda for many years to run our Spring Boot REST API. We are migrating to GCP and they want me to deploy our code to GCF the same way we were with AWS Lambda, but I am not sure that GCF works that way.
According to Google Cloud Functions are only good for Single Endpoints and can only work as a web server using the functions framework.
Spring has a document that uses the GcfJarLauncher, but that is still in alpha and I can only get it to work for a single endpoint. Any additional functions I put into the code are ignored and every endpoint triggers the same function.
There were some posts here on SO that talked about using Functional Beans to map to multiple functions, but I couldn't fully get it working and my boss isn't interested in that.
I've also read of people putting the endpoint in the request payload and then mapping to the proper function, but we are not interested in doing that either.
TLDR/Conclusion:
Is it even possible to deploy our app to GCF or do we need to use Cloud Run (as Google suggests in my first link)?

How does one know which operations can be done on a resource using the AWS API Gateway?

I understand you can use the AWS API Gateway to allow developers to create applications that interact with AWS backend services (e.g. DynamoDB).
The basic flow is:
Create the resource (e.g. DynamoDB table)
Create a Lambda function
Create an HTTP API
Create Routes
Create an integration
Attach integration to routes
But what are the options for the API? What kind of operations can be done on DynamoDB (or whatever resource you’re working with)?
Usually when a REST API is available through a Gateway there is a set of endpoints, so the developers know what they can build with the API. Like Swagger Documentation.
It would be great to know all the things that can be done via API to DynamoDB, S3, Cloudwatch, etc. is there a master list somewhere?
Or is the idea that you can do anything inside the Lambda function that is supported by the aws-sdk?
In that case, is there a list of available options for the aws-sdk?
Am I thinking about this the right way?

how to configure x-ray traces for amazon-neptune?

I've an api going thru Lambda (node.js) to Aws Neptune. X-ray shows the traces from api-gateway --> lambda and stops here. Has anyone enabled deeper tracing all the way into Neptune ?
Thanks !
you can use AWS X-Ray SDK for Node.js to instrument your lambda function so the calls to Neptune are traced: https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-nodejs-awssdkclients.html
Please let me know if you need further help.
As of now, the most you can do is to use XRay clients and explicitly trace [1] the requests that you make from your Lambda. Neptune's AWS SDK currently only tracks management API calls, and not queries to the database. So unlike the dynamo db example called out in XRay docs, you cannot get granular insights (eg: query that was executed, the latency breakdowns etc) via XRay from Neptune at the moment.
It does sound like a useful feature, so I would recommend making a feature request for the same, or build something custom for the client you are using. Just curious, what client are you using from within the lambda? (ie Gremlin GLV? Raw HTTP request? Jena? etc..) For example, if you're using Gremlin GLV, then maybe all you need is to build a custom netty handler that can do tracing on your behalf.
[1] https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-nodejs-httpclients.html

How to configure different APIGateway endpoints for lambda versions $LATEST and live AutoPublishAlias

I'm using SAM with AutoPublishAlias safe lambda deployments. However, in the Pretraffic hook, I'd like to run some initial validation tests by invoking the latest [unvalidated] lambda version through an AWS API Gateway endpoint that's different from the endpoint that points to stable lambda version.
In my case, it's quite challenging to call the lambda function directly by by-passing APIGateway in the pre-traffic hook because the lambda function includes whitelisting and other logic that requires values set by API Gateway proxy integration. Ideally, I'd like to have 2 API gateway endpoints that always point to the live & latest versions of the lambda function as follows:
/api/resource -> lambdaFunction:live
/api/latest_resource -> lambdaFunction:$LATEST
This way, the pre-traffic hook can always use /api/latest_resource while customers use /api/resource. So far, I've not been able to figure out a way to configure this in SAM AWS::Serverless::Function or AWS::Severless::Api. Does anyone have an example or idea of how to do this?

AWS ruby sdk for Async non blocking calls

I want to publish custom application level metrics to be pushed to aws cloudwatch service. (http://docs.aws.amazon.com/sdkforruby/api/Aws/CloudWatch/Client.html#put_metric_data-instance_method), so that I can see all the metrics both system and application level custom metrics in AWS dashboard. This way I don't have to use third party monitoring solution like graphite etc.
The thing here is that I don't want my application to get slowed down by making blocking calls to push metrics. Is there way I can make async calls (fire and forget) using aws ruby sdk? I know there are Async client in Java SDK but can't find anything for ruby sdk.
Currently there is no async abstraction for the AWS SDK for Ruby.

Resources