Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: sqs queue instrumentation #2013

Merged
merged 62 commits into from
Apr 7, 2021
Merged

feature: sqs queue instrumentation #2013

merged 62 commits into from
Apr 7, 2021

Conversation

astorm
Copy link
Contributor

@astorm astorm commented Mar 23, 2021

Part of #1956

This PR provides instrumentation for Amazon's SQS queues and partially implements the messaging spec.

This PR does not automatically generate transactions during message processing -- see #2012 for more information. To work around this limitation we provide documentation showing a few different ways users could use the API to generate transactions when processing messages.

We instrument the SQS method calls by wrapping the underlying AWS SDK AWS.Request.send method. The main instrumentation entry point is built in such a way that should allow us to instrument future aws-sdk services in a similar fashion.

We also generate a queue latency metric using the existing measured based metric system. These new metrics are query-able via the Kibana apm index pattern

dimensions

@astorm astorm marked this pull request as draft March 23, 2021 23:34
@github-actions github-actions bot added the agent-nodejs Make available for APM Agents project planning. label Mar 23, 2021
@apmmachine
Copy link
Contributor

apmmachine commented Mar 24, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: astorm commented: jenkins run the tests please

  • Start Time: 2021-04-07T00:58:12.392+0000

  • Duration: 15 min 12 sec

  • Commit: b34cacf

Test stats 🧪

Test Results
Failed 0
Passed 16614
Skipped 0
Total 16614

Trends 🧪

Image of Build Times

Image of Tests

@astorm astorm requested review from bmorelli25 and trentm March 24, 2021 02:49
@astorm astorm marked this pull request as ready for review March 24, 2021 02:49
Copy link
Member

@bmorelli25 bmorelli25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neato! I have some suggestions and questions.

docs/message-queues.asciidoc Outdated Show resolved Hide resolved
docs/message-queues.asciidoc Outdated Show resolved Hide resolved
docs/message-queues.asciidoc Outdated Show resolved Hide resolved
docs/message-queues.asciidoc Outdated Show resolved Hide resolved
docs/message-queues.asciidoc Outdated Show resolved Hide resolved
docs/message-queues.asciidoc Outdated Show resolved Hide resolved
docs/message-queues.asciidoc Outdated Show resolved Hide resolved
docs/message-queues.asciidoc Outdated Show resolved Hide resolved
docs/message-queues.asciidoc Outdated Show resolved Hide resolved
docs/message-queues.asciidoc Outdated Show resolved Hide resolved
@astorm
Copy link
Contributor Author

astorm commented Apr 1, 2021

jenkins run the tests please

@astorm
Copy link
Contributor Author

astorm commented Apr 2, 2021

@trentm the span strategy, promise tests and other nits have been addressed. The CI failures are the integration tests listed here and seemingly unrelated to these changes.

@astorm astorm requested a review from trentm April 2, 2021 15:45
@astorm
Copy link
Contributor Author

astorm commented Apr 5, 2021

jenkins run the tests please

lib/instrumentation/span.js Outdated Show resolved Hide resolved
CHANGELOG.asciidoc Show resolved Hide resolved
lib/instrumentation/modules/aws-sdk.js Outdated Show resolved Hide resolved
lib/metrics/queue.js Outdated Show resolved Hide resolved
@astorm
Copy link
Contributor Author

astorm commented Apr 7, 2021

jenkins run the tests please

@astorm astorm requested a review from trentm April 7, 2021 01:27
@astorm astorm merged commit 5b3af00 into master Apr 7, 2021
@astorm astorm deleted the astorm/aws-sdk-sqs branch April 7, 2021 22:08
astorm added a commit that referenced this pull request Apr 8, 2021
* feat: instrument amazon SQS

Adds support for Amazon SQS queues via `aws-sdk` instrumentation that
partially implements the APM messaging spec

https://github.com/elastic/apm/blob/master/specs/agents/tracing-instrumentation-messaging

Also adds `queue.latency.min.ms`, `queue.latency.max.ms`, and
`queue.latency.avg.ms` metrics for SQS queues.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-nodejs Make available for APM Agents project planning.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants