상세 컨텐츠

본문 제목

Splunk Observability with AWS Fargate ECS

Splunk/Observability

by 야솔아빠 2022. 3. 31. 15:09

본문

반응형

1. O11y 화면에서 Data Setup > Amazon Fargate 선택

 

다음 단계에서 AWS 에서 아래 행위를 하라고 한다.

  • Create a revision of your task definition (HowTo).
  • Click Configure via JSON in the Create new revision of task definition page.
  • Paste the container definition JSON in the containerDefinitions section.

 

AWS ECS 화면으로 이동하고,

 

아래 json 포멧 containerDefinitions 이곳에 복사한 json을 추가 저장.

아래 코드는 오리지널 JSON FARGATE

{
    "ipcMode": null,
    "executionRoleArn": "arn:aws:iam::432274630114:role/ecsTaskExecutionRole",
    "containerDefinitions": [
        {
            "dnsSearchDomains": null,
            "environmentFiles": null,
            "logConfiguration": {
                "logDriver": "awslogs",
                "secretOptions": null,
                "options": {
                    "awslogs-group": "/ecs/first-run-task-definition",
                    "awslogs-region": "us-east-1",
                    "awslogs-stream-prefix": "ecs"
                }
            },
            "entryPoint": [],
            "portMappings": [
                {
                    "hostPort": 8080,
                    "protocol": "tcp",
                    "containerPort": 8080
                }
            ],
            "command": [],
            "linuxParameters": null,
            "cpu": 1024,
            "environment": [],
            "resourceRequirements": null,
            "ulimits": null,
            "dnsServers": null,
            "mountPoints": [],
            "workingDirectory": null,
            "secrets": null,
            "dockerSecurityOptions": null,
            "memory": null,
            "memoryReservation": 2048,
            "volumesFrom": [],
            "stopTimeout": null,
            "image": "tomcat",
            "startTimeout": null,
            "firelensConfiguration": null,
            "dependsOn": null,
            "disableNetworking": null,
            "interactive": null,
            "healthCheck": null,
            "essential": true,
            "links": [],
            "hostname": null,
            "extraHosts": null,
            "pseudoTerminal": null,
            "user": null,
            "readonlyRootFilesystem": null,
            "dockerLabels": null,
            "systemControls": null,
            "privileged": null,
            "name": "tomcat-webserver"
        }
    ],
    "memory": "2048",
    "taskRoleArn": null,
    "family": "first-run-task-definition",
    "pidMode": null,
    "requiresCompatibilities": [
        "FARGATE"
    ],
    "networkMode": "awsvpc",
    "runtimePlatform": null,
    "cpu": "1024",
    "inferenceAccelerators": [],
    "proxyConfiguration": null,
    "volumes": [],
    "tags": []
}

 

Otel collector 추가한 후의 JSON

{
    "ipcMode": null,
    "executionRoleArn": "arn:aws:iam::432274630114:role/ecsTaskExecutionRole",
    "containerDefinitions": [
        {
            "dnsSearchDomains": null,
            "environmentFiles": null,
            "logConfiguration": {
                "logDriver": "awslogs",
                "secretOptions": null,
                "options": {
                    "awslogs-group": "/ecs/first-run-task-definition",
                    "awslogs-region": "us-east-1",
                    "awslogs-stream-prefix": "ecs"
                }
            },
            "entryPoint": [],
            "portMappings": [
                {
                    "hostPort": 8080,
                    "protocol": "tcp",
                    "containerPort": 8080
                }
            ],
            "command": [],
            "linuxParameters": null,
            "cpu": 1024,
            "environment": [],
            "resourceRequirements": null,
            "ulimits": null,
            "dnsServers": null,
            "mountPoints": [],
            "workingDirectory": null,
            "secrets": null,
            "dockerSecurityOptions": null,
            "memory": null,
            "memoryReservation": 2048,
            "volumesFrom": [],
            "stopTimeout": null,
            "image": "tomcat",
            "startTimeout": null,
            "firelensConfiguration": null,
            "dependsOn": null,
            "disableNetworking": null,
            "interactive": null,
            "healthCheck": null,
            "essential": true,
            "links": [],
            "hostname": null,
            "extraHosts": null,
            "pseudoTerminal": null,
            "user": null,
            "readonlyRootFilesystem": null,
            "dockerLabels": null,
            "systemControls": null,
            "privileged": null,
            "name": "tomcat-webserver"
        },
        {
            "environment": [
                {
                    "name": "SPLUNK_ACCESS_TOKEN",
                    "value": "HcrmVJYcPTwP7pOgEuV4oA"
                },
                {
                    "name": "SPLUNK_REALM",
                    "value": "us1"
                },
                {
                    "name": "SPLUNK_CONFIG",
                    "value": "/etc/otel/collector/fargate_config.yaml"
                },
                {
                    "name": "ECS_METADATA_EXCLUDED_IMAGES",
                    "value": "[\"quay.io/signalfx/splunk-otel-collector:latest\"]"
                },
                {
                    "name": "METRICS_TO_EXCLUDE",
                    "value": "[]"
                }
            ],
            "image": "quay.io/signalfx/splunk-otel-collector:latest",
            "essential": true,
            "name": "splunk-otel-collector"
        }
    ],
    "memory": "2048",
    "taskRoleArn": null,
    "family": "first-run-task-definition",
    "pidMode": null,
    "requiresCompatibilities": [
        "FARGATE"
    ],
    "networkMode": "awsvpc",
    "runtimePlatform": null,
    "cpu": "1024",
    "inferenceAccelerators": [],
    "proxyConfiguration": null,
    "volumes": [],
    "tags": [],
    "placementConstraints": []
}

 

AWS ECS Cluster 로 이동후 작업한 클러스터를 선택

 

 

 

 

나머지는 next 버튼 클릭.

Amazon ECS > Cluster > 해당 클러스터를 선택해서 최신의 작업 (Task) 가 작동하는지 확인. 

 

Splunk Observability 로 이동후 Dashboards > AWS ECS 를 선택.

ECS (SignalFX) 관련 탭을 선택하면 Infrastructure 모니터링을 확인 할 수 있다. (AWS 계정 연동이 아닌, Otel Collector 연동을 하였기 때문이다)

 

반응형

관련글 더보기

댓글 영역