Daily Quest #12: Observability & Monitoring
Observability & monitoring is key to understand about application and infrastructure healty in real-time
Reference :
Real world usecase : Before deploying application in production, devops team scrape request latency and error rate in 30Second. if error rate > 1% deployment canceled
We use feature on github workflows called service_containers, you can use other tools using docker container that provide a simple and portable way for you to host services you might need to test or operate your application in a workflow.
Skenario : Integrate prometheus service in github actions, scrape basic metrics, and save snapshot using artefacts
- Create folder
/monitoringwithprometheus.ymlanddocker-compose.yaml
global:
scrape_interval: 5s
scrape_configs:
- job_name: 'ci-cd-demo'
static_configs:
- targets:
- 'localhost:9090'
name: Observability & monitoring
on:
push:
jobs:
observe:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Running prometheus container
run: |
docker run -d \
--name prometheus \
-p 9090:9090 \
-v ${{ github.workspace }}/monitoring/prometheus.yml:/etc/prometheus/prometheus.yml \
prom/prometheus:latest \
--config.file=/etc/prometheus/prometheus.yml \
--web.listen-address=:9090
- name: Wait prometheus to be ready
run: |
echo "Waiting for Prometheus to be ready..."
sleep 30s
docker logs prometheus
echo "Prometheus should be ready now."
- name: Run Prometheus
run: |
echo "scrape metrics"
curl http://localhost:9090/metrics | head -n 10 > prometheus_metrics.txt
- name: Upload metrics to artifact
uses: actions/upload-artifact@v4
with:
name: prometheus-metrics
path: prometheus_metrics.txt
- Push and see result

# HELP go_gc_cycles_automatic_gc_cycles_total Count of completed GC cycles generated by the Go runtime. Sourced from /gc/cycles/automatic:gc-cycles.
# TYPE go_gc_cycles_automatic_gc_cycles_total counter
go_gc_cycles_automatic_gc_cycles_total 6
# HELP go_gc_cycles_forced_gc_cycles_total Count of completed GC cycles forced by the application. Sourced from /gc/cycles/forced:gc-cycles.
# TYPE go_gc_cycles_forced_gc_cycles_total counter
go_gc_cycles_forced_gc_cycles_total 0
# HELP go_gc_cycles_total_gc_cycles_total Count of all completed GC cycles. Sourced from /gc/cycles/total:gc-cycles.
# TYPE go_gc_cycles_total_gc_cycles_total counter
go_gc_cycles_total_gc_cycles_total 6
# HELP go_gc_duration_seconds A summary of the wall-time pause (stop-the-world) duration in garbage collection cycles.
Answer (jelaskan dong):
- Scrape lebih unggul untuk mendapatkan data dari hal yang dimonitoring
- Snapshot metrik dapat digunakan sebagai acuan dalam mendesign grafana dashboard
Read more
Provisioning AWS Lambda dengan Terraform
Lanjutan belajar AWS: mengenal Lambda dan provisioning Lambda function di AWS menggunakan Terraform.
Provisioning EC2 dan RDS di AWS dengan Terraform
Catatan provisioning infrastruktur AWS pakai Terraform untuk EC2 dan RDS, mulai dari konfigurasi sampai hasil apply-nya.
AWS IAM Role, EC2 Instance Profile, dan Multi-Tier VPC
Bikin IAM role dan attach ke EC2 lewat instance profile, uji akses ke S3 dan SSM Parameter Store, lalu provisioning multi-tier VPC pakai OpenTofu.
AWS IAM Least-Privilege Policy dan VPC Networking Deep Dive
Menyusun IAM policy least-privilege dan IAM role di AWS, lalu lanjut ke networking VPC: subnet publik-privat sampai NAT Gateway.