otel 자료 설명
- User
otel 자료 설명
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
otel 자료 설명
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
OpenTelemetry(OTel)은 CNCF(Cloud Native Computing Foundation) 산하의 오픈소스 표준으로,
분산 시스템에서 Trace・Metric・Log 3종 관측 데이터를 일관된 방식으로 수집·가공·전송하기 위한 통합 관측(Observability) 프레임워크입니다.
(기존 OpenTracing + OpenCensus 프로젝트가 합쳐져 2019년 5월 ‘OpenTelemetry’로 출범)
| 구성요소 | 역할 | 키워드 |
|---|---|---|
| SDK / Instrumentation | 애플리케이션 코드에 Trace·Metric·Log를 삽입하는 라이브러리. 언어별(Go, Java, Python 등) 제공 | Manual / Auto Instrumentation |
| Collector | 수집한 데이터를 필터링, 가공(Processor), 버퍼링, 내보내기(Exporter) 하는 독립 실행형 에이전트/게이트웨이 | Agent 모드 / Gateway 모드 |
| Protocol | OTLP(OpenTelemetry Protocol). gRPC/HTTP 기반. 데이터 모델을 정형화 | OTLP/HTTP, OTLP/gRPC |
| Exporter | OTLP, Jaeger, Zipkin, Prometheus, Kafka, Elasticsearch 등 다양한 백엔드로 전송 | Vendor-neutral |
| Resource | 서비스, 호스트, 컨테이너 등 컨텍스트 메타데이터를 담는 객체 | service.name, host.id |
[사용자 요청] → App 코드 (OTel SDK) ─▶ OTLP ─▶ Collector
┌─ processor(샘플링, 필터, 배치)
└─ exporter(Zipkin, Prometheus, Tempo…)
| 유형 | 핵심 객체 | 예시 |
|---|---|---|
| Trace | Span(시작·종료 시각, Attribute, Event, Link) | HTTP 요청, DB 쿼리 |
| Metric | Point(측정값) ⇢ Meter | CPU usage %, http.server.duration |
| Log | OTel LogRecord | application.log, error stack |
OTel 1.20+ 부터 Trace ↔ Log Correlation(TraceID 필드 포함)로 로그·트레이스 상호 연결이 가능.
pip install opentelemetry-distro opentelemetry-exporter-otlp
opentelemetry-bootstrap -a flask
opentelemetry-instrument --exporter_otlp_endpoint=http://localhost:4318 python app.py
import (
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/sdk/trace"
)
tp := trace.NewTracerProvider()
otel.SetTracerProvider(tp)
tr := otel.Tracer("example-service")
ctx, span := tr.Start(context.Background(), "main-operation")
defer span.End()
receivers:
otlp:
protocols:
grpc:
http:
processors:
batch:
attributes:
actions:
- key: deployment.environment
value: prod
action: insert
exporters:
logging:
loglevel: debug
prometheusremotewrite:
endpoint: http://prom:9090/api/v1/write
service:
pipelines:
traces:
receivers: [otlp]
processors: [batch, attributes]
exporters: [logging]
🎯 장점
• 벤더 종속 최소화(표준화된 OTLP)
• Trace/Metric/Log 통합 스키마 → 상호 연계 분석 용이
• 커뮤니티 활발 + CNCF Graduated(2024)
⚠️ 유의사항
• 여전히 evolving: 일부 Signal(Log) 는 preview 기능 포함
• 샘플링·보존 정책 미설계 시 비용 급증
• Auto-instrumentation 호환성: 프레임워크 버전 lock 여부 확인 필요
• 특정 언어/프레임워크 계측 방법?
• Collector 고급 파이프라인 설계?
• Trace → Metric ↔ Log Correlation 베스트프랙티스?
필요한 주제가 있으면 알려주세요!