Documentation ¶
Index ¶
Constants ¶
View Source
const ( // RegionField is the name of the field containing the AWS region. RegionField = "ec2_region" // InstanceField is the name of the field containing the EC2 instance ID. InstanceField = "ec2_instance" // TaskARNField is the name of the field containing the ECS task ARN. TaskARNField = "ecs_task_arn" // TaskFamilyField is the name of the field containing the ECS task family. TaskFamilyField = "ecs_task_family" // TaskVersionField is the name of the field containing the ECS task version. TaskVersionField = "ecs_task_version" )
Variables ¶
View Source
var Session = session.Must(session.NewSession())
Session is used by EC2Info to retrieve details from AWS.
Functions ¶
func EC2Info ¶
EC2Info adds application information to a log in a similar manner to logutil.AppInfo. It retrieves the hostname from EC2 rather than os.Hostname(). It will also attempt to retrieve the ECS service and task names if it has permission.
The following fields are added to the log if available: - ec2_region: The region in which the instance is running. - ec2_instance: The ID of the instance. - ecs_task: The ECS task ARN. - ecs_taskdef: The ECS task definition.
The ECS info requires that the ecs-agent's HTTP server be accessible. Regular app info is appended if the EC2 metadata endpoint is unavailable.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.