Open civilizeddev opened 2 years ago
The most important thing you can walk away with today is inspiration.
In this lab, you will install and configure the Agent in a Docker environment.
The objectives for this section are:
datadog:
image: 'datadog/agent:7.31.1'
environment:
- DD_API_KEY
- DD_LOGS_ENABLED=true
- DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL=true
- DD_PROCESS_AGENT_ENABLED=true
- DD_DOCKER_LABELS_AS_TAGS={"my.custom.label.team":"team"}
- DD_TAGS='env:dd101-dev'
- DD_HOSTNAME=dd101-dev-host
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /proc/:/host/proc/:ro
- /sys/fs/cgroup/:/host/sys/fs/cgroup:ro
/var/run/docker.sock
/proc
/sys/fs/cgroup
Getting the status from the agent.
===============
Agent (v7.31.1)
===============
Status date: 2022-07-08 00:28:16.898 UTC (1657240096898)
Agent start: 2022-07-08 00:28:02.606 UTC (1657240082606)
Pid: 380
Go Version: go1.15.13
Python Version: n/a
Build arch: amd64
Agent flavor: agent
Check Runners: 4
Log Level: info
Paths
=====
Config File: /etc/datadog-agent/datadog.yaml
conf.d: /etc/datadog-agent/conf.d
checks.d: /etc/datadog-agent/checks.d
Clocks
======
System time: 2022-07-08 00:28:16.898 UTC (1657240096898)
Host Info
=========
bootTime: 2022-07-07 23:50:29 UTC (1657237829000)
kernelArch: x86_64
kernelVersion: 5.13.0-1015-gcp
os: linux
platform: ubuntu
platformFamily: debian
platformVersion: 21.04
procs: 150
uptime: 37m48s
virtualizationRole: guest
virtualizationSystem: docker
Hostnames
=========
host_aliases: [docker-vm.vvncnayhy5tj.svc.cluster.local p-vvncnayhy5tj-docker-vm.instruqt-prod]
hostname: dd101-dev-host
socket-fqdn: 425b34ad89c2
socket-hostname: 425b34ad89c2
host tags:
'env:dd101-dev'
accessible-from-goog-gke-node
allow-external-ingress-high-ports
allow-external-ingress-http
allow-external-ingress-https
p-vvncnayhy5tj
zone:europe-west1-b
instance-type:n1-standard-1
internal-hostname:docker-vm.vvncnayhy5tj.svc.cluster.local
instance-id:4193758585264197592
project:instruqt-prod
numeric_project_id:3390740675
INSTRUQT_AWS_ACCOUNTS:
INSTRUQT_AZURE_SUBSCRIPTIONS:
INSTRUQT_GCP_PROJECTS:
hostname:docker-vm
hostname provider: configuration
Metadata
========
=========
Collector
=========
Running Checks
==============
No checks have run yet
========
JMXFetch
========
Information
==================
Initialized checks
==================
no checks
Failed checks
=============
no checks
=========
Forwarder
=========
Transactions
============
Cluster: 0
CronJob: 0
DaemonSet: 0
Deployment: 0
Dropped: 0
DroppedOnInput: 0
Job: 0
Node: 0
PersistentVolume: 0
PersistentVolumeClaim: 0
Pod: 0
ReplicaSet: 0
Requeued: 0
Retried: 0
RetryQueueSize: 0
Service: 0
StatefulSet: 0
API Keys status
===============
API key ending with 582f5: API Key valid
==========
Endpoints
==========
https://app.datadoghq.com - API Key ending with:
- 582f5
==========
Logs Agent
==========
Sending compressed logs in HTTPS to agent-http-intake.logs.datadoghq.com on port 443
BytesSent: 0
EncodedBytesSent: 28
LogsProcessed: 0
LogsSent: 0
=========
APM Agent
=========
Status: Running
Pid: 378
Uptime: 14 seconds
Mem alloc: 8,188,120 bytes
Hostname: dd101-dev-host
Receiver: 0.0.0.0:8126
Endpoints:
https://trace.agent.datadoghq.com
Receiver (previous minute)
==========================
No traces received in the previous minute.
Default priority sampling rate: 100.0%
Writer (previous minute)
========================
Traces: 0 payloads, 0 traces, 0 events, 0 bytes
Stats: 0 payloads, 0 stats buckets, 0 bytes
=========
Aggregator
=========
Dogstatsd Metric Sample: 48
Event: 1
=========
DogStatsD
=========
Event Packets: 0
Event Parse Errors: 0
Metric Packets: 47
Metric Parse Errors: 0
Service Check Packets: 0
Service Check Parse Errors: 0
Udp Bytes: 3,597
Udp Packet Reading Errors: 0
Udp Packets: 32
Uds Bytes: 0
Uds Origin Detection Errors: 0
Uds Packet Reading Errors: 0
Uds Packets: 0
Unterminated Metric Errors: 0
docker-compose exec datadog agent config | grep -A1 "^tags:"
누르면 더 상세히
discount를 고르니
죄다 에러로 보이고 있다.
역시 누르면 더 자세히
나중에 쿠버네티스 레이블도 마찬가지로 데이터 태그로 활용 가능
로그 수집 파이프라인
로그 파싱 (JSON Attributes로 추출)
인프라 유틸리티는 표준 파서가 있지만, 애플리케이션 로그 파싱은 개발자가 커스터마이즈 해야 한다.
https://docs.datadoghq.com/logs/log_collection/python/?tab=jsonlogformatter&tabs=jsonlogformatter
Alert -> Resolved
안 되서 다음에 (...)
Sorry, we can't find the track you're looking for
datadog / dd101-for-developers-lab-05-log-querying-and-analytics
Application developers get enormous value out of Datadog, but in significantly different ways than DevOps engineers or SREs.
You’ll begin this course by installing the Datadog Agent in a containerized web application. You’ll then create Synthetic Tests to monitor critical front-end services with simulated customer interactions. And as the name implies, Real User Monitoring (RUM) will help you measure and improve the quality of your users’ experience.
Along the way you will see how Datadog’s core tools such as Logs, APM, Dashboards, Monitors, and Alerts can help you stay ahead of application issues before they cause problems for your users.
See Also