-
Notifications
You must be signed in to change notification settings - Fork 57
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
invalid configuration option `:xray_recorder' on Kinesis #51
Comments
Hi @mt-kelvintaywl, apologies for the delay in response. I believe having kinesis as your event source for the lambda function wouldn't cause the error since the X-Ray instrumentation is within the function and the message from kinesis stream is passed in as an event. Are you creating a kinesis client and/or calling kinesis service from within your lambda function? |
Hi @srprash, thank you for reaching out and my apologies for the late response here myself too 🙇
Indeed, i would believe so too. Yet, this was happening.
in the end, i've reverted and abandoned the instrumentation. |
Hi @mt-kelvintaywl |
I'm getting this error as well, just trying to do general instrutumentation. https://docs.amazonaws.cn/en_us/lambda/latest/dg/ruby-tracing.html In JS we have:
So its my assumption once things are instrumented I'll be able to see functions passed downstream, Since right now I'm just trying to see my Lambda call SNS in my service map. but how Ruby configures vs NodeJS is confusing me since next to no examples. [Update] I found this while clicking through on one of the files in the documentation. # lambda_function.rb
require 'logger'
require 'json'
require 'aws-sdk-lambda'
$client = Aws::Lambda::Client.new()
$client.get_account_settings()
require 'aws-xray-sdk/lambda'
def lambda_handler(event:, context:)
logger = Logger.new($stdout)
logger.info('## ENVIRONMENT VARIABLES')
vars = Hash.new
ENV.each do |variable|
vars[variable[0]] = variable[1]
end
logger.info(vars.to_json)
logger.info('## EVENT')
logger.info(event.to_json)
logger.info('## CONTEXT')
logger.info(context)
$client.get_account_settings().account_usage.to_h
end I suppose that would let me record subsegments, but I just want to see my SNS topic getting called: require 'aws-xray-sdk/lambda'
require 'aws-sdk-sns'
def handler(event:,context:)
results = { hello: 'world' }
sns = Aws::SNS::Resource.new
sns.client.publish({
topic_arn: ENV['TOPIC_ARN'],
# need a default for SNS
message: results.merge({default: 'evaluators-ruby'}).to_json,
message_structure: 'json'
})
return {
"statusCode" => 200,
"body" => results.to_json
}
end Just checking through the full backtrace to see what I can find in thes respective Ruby Gems:
This error is similar to this one over here suppose: #26 |
I looked into the the gems and noticed something called patching, so I added the following to my configuration and this stopped the error. Still can't see my Lambda calling SNS in my Service Map.
Carefully reading the docs more. Still don't see my downstream
|
What is odd is that it looks like require 'aws-xray-sdk/lambda' should already patch, which is what I'm including...
|
I've encountered similar errors a number of times now with this library. It's probably worth it to take some time and document the issue. When this invalid configuration option error occurs it's generally for one of two reasons:
i.e. require 'aws-sdk-lambda'
require 'aws-sdk-kinesis'
# be sure to require any other AWS SDK clients your app will use here
require 'aws-xray-sdk/lambda' |
Hi guys, are there better documentations on what dependencies i'll need to update for working with instrumenting this SDK with Ruby Lambda functions?
I followed the example, and have tried to instrument X-Ray with a Lambda function (with Kinesis data stream as its event source).
However, I seem to hit a possible bug(?) :
The redacted error trace:
My dependencies are below:
Not sure if it's related to #26 but the fix mentioned here shows the Kinesis service is whitelisted so I'm not sure what exactly is going wrong?
Would i just need to bump my dependencies on the
aws-sdk-*
gems?Thank you! 🙏
The text was updated successfully, but these errors were encountered: