-
Notifications
You must be signed in to change notification settings - Fork 225
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
[META 408] Instrumentation for AWS SQS #1956
Comments
Some notes on the implementation details of the AWS SDK that will be helpful in instrumenting API methods for the SQS API as well as the other APIs we'll want to instrument. The AWS SDK provides an internal system for building constructor-functions that can inherit from one another and provide other features that an end-user-programmer might expect to find in a class based system. This has been a popular pattern in javascript frameworks since the language's inception. Here's an example of using this system to create a simple const AWS = require('aws-sdk')
BaseClass = AWS.util.inherit({
constructor: function BaseClass() {
console.log("BaseClass constructor")
},
test: function(value) {
console.log(`In BaseClass: ${value}`)
this.science = 'science'
return true
}
})
ClassA = AWS.util.inherit(BaseClass, {
constructor: function ClassA() {
console.log("ClassA constructor")
BaseClass.call(this)
this.science = null
},
test: function(value) {
console.log(`Before: this.science = ${this.science}`)
console.log(`In ClassA: ${value}`)
BaseClass.prototype.test.call(this,"goodbye")
console.log(`After: this.science = ${this.science}`)
}
})
const a = new ClassA()
a.test("hello") While Service Constructor FunctionsIn addition to these For example, in this code var sqs = new AWS.SQS({apiVersion: '2012-11-05'});
var params = {/* ... */ }
sqs.sendMessage(params, function(err, data) {
if (err) {
console.log("Error", err);
} else {
console.log("Success", data.MessageId);
}
}); The Amazon's programmers create their service-constructor-functions via calls to the One interesting thing about these service objects are that their public API methods (like This means that every call to a method that the You can see the creation/assignment of these methods here.
In this code block All this means every call to a public API method in the
The For the purposes of instrumentation, this means every call to a public API on a service object can be identified, (with it's Can't Extend Service Constructor FunctionsIf you try extending a service-constructor-function using
Will give us an error like this.
It's unclear if this is a quirk of this object system or a deliberate decision to disable inheritance on service objects. Without getting too into the weeds, the call to |
Re-opening. #2008 was only part of the work for this. |
Priliminary version of this feature is complete, with additional issues opened for possible expansions to our functionality. Closing this one out. |
Provide instrumentation for AWS SQS.
Meta issue: elastic/apm#408
SPEC: elastic/apm#409
The text was updated successfully, but these errors were encountered: