Module: XRay::Plugins::EC2

Includes:
Logging
Defined in:
lib/aws-xray-sdk/plugins/ec2.rb

Overview

A plugin that gets the EC2 instance_id, availabiity_zone, instance_type, and ami_id if running on an EC2 instance. The plugin queries IMDSv2 endpoint with X-aws-ec2-metadata-token-ttl-seconds as 60 seconds, and fallback to using IMDSv1 endpoint. More details about EC2 instance metadata retreival: docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html#instancedata-data-retrieval

Constant Summary collapse

ORIGIN =
'AWS::EC2::Instance'.freeze
METADATA_BASE_URL =
'http://169.254.169.254/latest'.freeze

Class Method Summary collapse

Methods included from Logging

#logger, logger, logger=

Class Method Details

.awsObject



18
19
20
21
22
23
24
25
# File 'lib/aws-xray-sdk/plugins/ec2.rb', line 18

def self.aws
  @@aws = {}
  token = get_token
   = (token)
  @@aws = {
    ec2: 
  }
end