Class: Instana::Snapshot::FargateTask
- Inherits:
-
Object
- Object
- Instana::Snapshot::FargateTask
- Defined in:
- lib/instana/snapshot/fargate_task.rb
Overview
Describes the current process in terms of its existence inside of a Fargate task
Constant Summary collapse
- ID =
'com.instana.plugin.aws.ecs.task'.freeze
Instance Method Summary collapse
- #data ⇒ Object
- #entity_id ⇒ Object (also: #host_name)
-
#initialize(metadata_uri: ENV['ECS_CONTAINER_METADATA_URI']) ⇒ FargateTask
constructor
A new instance of FargateTask.
- #snapshot ⇒ Object
Constructor Details
#initialize(metadata_uri: ENV['ECS_CONTAINER_METADATA_URI']) ⇒ FargateTask
Returns a new instance of FargateTask.
11 12 13 14 |
# File 'lib/instana/snapshot/fargate_task.rb', line 11 def initialize(metadata_uri: ENV['ECS_CONTAINER_METADATA_URI']) = URI() @client = Backend::RequestClient.new(.host, .port, use_ssl: .scheme == "https") end |
Instance Method Details
#data ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/instana/snapshot/fargate_task.rb', line 21 def data { taskArn: ['TaskARN'], clusterArn: ['Cluster'], taskDefinition: ['Family'], taskDefinitionVersion: ['Revision'], availabilityZone: ['AvailabilityZone'], desiredStatus: ['DesiredStatus'], knownStatus: ['KnownStatus'], pullStartedAt: ['PullStartedAt'], pullStoppedAt: ['PullStoppedAt'], instanaZone: instana_zone, tags: }.reject { |_, v| v.nil? } end |
#entity_id ⇒ Object Also known as: host_name
16 17 18 |
# File 'lib/instana/snapshot/fargate_task.rb', line 16 def entity_id ['TaskARN'] end |
#snapshot ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/instana/snapshot/fargate_task.rb', line 37 def snapshot { name: ID, entityId: entity_id, data: data } end |