Skip to content

Commit

Permalink
feat: 로그
Browse files Browse the repository at this point in the history
  • Loading branch information
hhko authored Jan 24, 2025
1 parent 546e4cb commit 8f99848
Show file tree
Hide file tree
Showing 8 changed files with 522 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tutorials/observability/logs/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
COMPOSE_PROJECT_NAME={조직}-{프로젝트}

INFRA_TAG=1.0.1.1-infra

OTELCOL_ARGS=
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions tutorials/observability/logs/config/otel-collector/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
receivers:
otlp:
protocols:
grpc:
endpoint: "0.0.0.0:4317"
http:
endpoint: "0.0.0.0:4318"

processors:
batch:

exporters:
# debug:
# verbosity: detailed
prometheus:
endpoint: "0.0.0.0:8899"

service:
pipelines:
metrics:
receivers:
- otlp
processors:
- batch
exporters:
- prometheus
76 changes: 76 additions & 0 deletions tutorials/observability/logs/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
x-logging-common: &logging-common
driver: "json-file"
options:
max-size: "10m"
max-file: "7"

services:
#
# service
#
helloworld:
env_file: .env
image: {조직}/{프로젝트}/helloworld
build:
context: .
dockerfile: Helloworld/Dockerfile
container_name: {조직}.{프로젝트}.helloworld
hostname: {조직}.{프로젝트}.helloworld
restart: always
networks:
- net

#
# aspire
#
{조직}.{프로젝트}.infra.aspire:
env_file: .env
image: {조직}/{프로젝트}/infra/aspire:${INFRA_TAG}
build:
context: .
dockerfile: dockerfiles/aspire/Dockerfile
container_name: {조직}.{프로젝트}.infra.aspire
hostname: {조직}.{프로젝트}.infra.aspire
restart: always
environment:
- DOTNET_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS=true
networks:
- net
ports:
- 18889:18889 # OTLP gRPC receiver: 4317
- 18888:18888 # Aspire 대시보드
volumes:
- /etc/localtime:/etc/localtime
logging: *logging-common

#
# otel-collector
#
{조직}.{프로젝트}.infra.otel-collector:
env_file: .env
image: {조직}/{프로젝트}/infra/otel-collector:${INFRA_TAG}
build:
context: .
dockerfile: dockerfiles/otel-collector/Dockerfile
container_name: {조직}.{프로젝트}.infra.otel-collector
hostname: {조직}.{프로젝트}.infra.otel-collector
restart: always
command: ["--config=/etc/otel-collector-config.yaml", "${OTELCOL_ARGS}"]
volumes:
- /etc/localtime:/etc/localtime
- ./config/otel-collector/config.yaml:/etc/otel-collector-config.yaml
# Linux Only
# 호스트 루트 파일 시스템 (/) 전체를 컨테이너에 마운트합니다.
#- /:/hostfs
networks:
- net
ports:
- "9999:8899" # Prometheus exporter metrics
# - "13133:13133" # health_check extension
- "4317:4317" # OTLP gRPC receiver
- "4318:4318" # OTLP HTTP receiver
logging: *logging-common

networks:
net:
driver: bridge
4 changes: 4 additions & 0 deletions tutorials/observability/logs/dockerfiles/aspire/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM mcr.microsoft.com/dotnet/aspire-dashboard:9.0

LABEL solution=corp
LABEL category=infra
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM otel/opentelemetry-collector:0.106.1

LABEL solution=corp
LABEL category=infra
Loading

0 comments on commit 8f99848

Please sign in to comment.