sqs-consumer
opentelemetry-js-contrib
sqs-consumer | opentelemetry-js-contrib | |
---|---|---|
4 | 8 | |
1,678 | 598 | |
0.9% | 1.7% | |
8.5 | 9.5 | |
7 days ago | 4 days ago | |
TypeScript | TypeScript | |
GNU General Public License v3.0 or later | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
sqs-consumer
-
Infinite loop pattern to poll for a queue in a REST server app
You could utilize a wrapper like sqs-consumer. Check out their implementation.
-
How to Instrument AWS Services with OpenTelemetry
To receive the messages from the queue, we will use the sqs-consumer library. The service will receive messages describing newly created orders. After some processing, it will change the order status in the table to ‘completed’.
-
Knock and Open Source
As we built out this new system, we looked at the current module ecosystem to determine if anything would fit our needs to keep this queue cleared. Unfortunately, the best module we could find, sqs-consumer, did not support FIFO queues and the issues indicated they did not have any intention to do so. Therefore, we wrote sqsiphon. Our library heavily borrows from the public interface of sqs-consumer, but is implemented in a much different way. In particular, sqsiphon leverages the Node.js event loop through setImmediate to build the polling mechanism instead of relying on SQS's "long polling" feature. Additionally, sqsiphon utilizes the JavaScript prototype to reduce reliance on expensive closures. As a bonus, OpenTracing support is built-in to sqsiphon so that applications built with it can be monitored effectively. The result is a library that can poll SQS extremely quickly while requiring very little overhead.
opentelemetry-js-contrib
-
OpenTelemetry in 2023
[2] https://github.com/open-telemetry/opentelemetry-js-contrib/t...
- OpenTelemetry-based traces for every web page with zero code change.
- How to trace database query with OpenTelemetry and Zipkin for a Node.js app?
-
How to Instrument AWS Services with OpenTelemetry
@opentelemetry/instrumentation-aws-lambda
-
How to solve "Cannot redefine property: handler" on AWS Lambda
As suggested in both opentelemetry-js-contrib and aws-otel-lambda issues, the solution is changing ES6 export to CommonJS module.exports.
-
How To Use OpenTelemetry With AWS Lambda
More information about this can be found here and in the instrumentation docs.
-
GraphQL - Diving Deep
Opentelemetry has recently made support for GraphQL available. You can find it here
-
The Stack #3
Now, the exciting thing is that there is now a reference implementation to the same using GraphQL which you can find here and also an example to help you out with the same here
What are some alternatives?
AdonisJs Application
apollo-server - 🌍 Spec-compliant and production ready JavaScript GraphQL server that lets you develop in a schema-first way. Built for Express, Connect, Hapi, Koa, and more.
SailsJS - Realtime MVC Framework for Node.js
mercurius - Implement GraphQL servers and gateways with Fastify
sns-sqs-big-payload - Amazon SNS/SQS client library that enables sending and receiving messages with payload larger than 256KiB via Amazon S3.
Hasura - Blazing fast, instant realtime GraphQL APIs on your DB with fine grained access control, also trigger webhooks on database events.
Koa - Expressive middleware for node.js using ES2017 async functions
react-relay - Relay is a JavaScript framework for building data-driven React applications.
Express - Fast, unopinionated, minimalist web framework for node.
Hoppscotch - Open source API development ecosystem.
sqs-producer - Simple scaffolding for applications that produce SQS messages
aws-otel-lambda - AWS Distro for OpenTelemetry - AWS Lambda