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

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

Related

go xray sdk in lambda to capture calls to redis

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.

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 do i load test aws appsync?

I am attempting to use Load runner to simulate 10k clients all subscribed to AWS Appsync.
My understanding is that it uses MQTT over Websockets.
I haven't been able to find documentation on how to achieve this with load runner.
Currently (12.63) LoadRunner supports only MQTT over HTTP.
See VUGEN, advanced topics, creating virtual users in Visual Studio. Use the published appsync C#, C++, VB interfaces.
An eclipse path exits as well if you are so inclined
Should AWS Appsync fail to meet your requirements, how will you post a defect to Amazon? Do you have a strict SLA from Amazon on response times?

Unit Test GraphQL schemas/queries made in AWS AppSync?

I have a simple question: is there a way/program/method to create unit tests to test the API Url generated on AWS AppSync to verify the validity of created GraphQL schemas, queries, mutations, etc?
There is an open-source AppSync Serverless plugin which has offline emulator support. You may find it useful: https://github.com/sid88in/serverless-appsync-plugin#offline-support
Another good recommendation is to have two separate AppSync APIs. One API is hosting you production traffic. The other is to test changes before they go to production. This is significantly easier if you use Cloudformation (highly recommended) to manage your infrastructure.
If you want to validate your API is working periodically (every minute or so), you could create a canary like the following:
Create a Lambda function which runs on a schedule. This lambda function will make various GraphQL requests. It can emit success/failure metrics to CloudWatch.
Setup a CloudWatch alarm so you can be notified if your success/failure metric is out of the ordinary.
For the canary use-case see:
https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/RunLambdaSchedule.html
https://docs.aws.amazon.com/lambda/latest/dg/with-scheduled-events.html
There is also amplify amplify-appsync-simulator package that is supposed to help with testing appsync, but there is no documentation on how you should use it. It is used by serverless-appsync-simulator Michael wrote and Amplify itself.

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