SigNoz Service Mesh
SigNoz Observability Service Mesh Istio OpenTelemetry ClickHouse Metrics Traces Logs Dashboard Alert Kubernetes
| Component | Role | Data | Storage |
|---|---|---|---|
| SigNoz OTel Collector | รับ Telemetry Data | Traces Metrics Logs | ClickHouse |
| SigNoz Query Service | Query ข้อมูล | API สำหรับ Dashboard | ClickHouse |
| SigNoz Frontend | Dashboard UI | Visualization | - |
| Istio Control Plane | Manage Mesh | Config Policy | etcd |
| Envoy Sidecar | Proxy Traffic | Metrics Traces Logs | → OTel Collector |
| ClickHouse | Storage Backend | All Telemetry | Columnar DB |
Installation & Setup
# === SigNoz + Istio Setup on Kubernetes ===
# Step 1: Install SigNoz via Helm
# helm repo add signoz https://charts.signoz.io
# helm repo update
# helm install signoz signoz/signoz \
# --namespace signoz \
# --create-namespace \
# --set otelCollector.config.receivers.zipkin.endpoint=0.0.0.0:9411
# Step 2: Install Istio
# istioctl install --set profile=demo -y
# kubectl label namespace default istio-injection=enabled
# Step 3: Configure Istio to send traces to SigNoz
# kubectl apply -f - <
Dashboard & Monitoring
# === SigNoz Dashboard Configuration ===
@dataclass
class DashboardPanel:
panel: str
query_type: str
metric: str
group_by: str
alert_threshold: str
panels = [
DashboardPanel("Request Rate (RPS)",
"ClickHouse Query",
"rate(istio_requests_total) by service",
"service_name, response_code",
"RPS drop > 50% → Alert"),
DashboardPanel("Error Rate (%)",
"ClickHouse Query",
"rate(istio_requests_total{response_code=~'5.*'}) / rate(istio_requests_total) * 100",
"service_name",
"Error Rate > 1% → Alert"),
DashboardPanel("Latency P99 (ms)",
"ClickHouse Query",
"histogram_quantile(0.99, istio_request_duration_milliseconds_bucket)",
"service_name",
"P99 > 500ms → Alert"),
DashboardPanel("Service Map",
"Trace-based",
"Auto-generated จาก Trace Data",
"service_name, operation",
"New Edge = New Dependency → Review"),
DashboardPanel("Top Slow Traces",
"Trace Explorer",
"duration > 1000ms ORDER BY duration DESC",
"service_name, operation, status",
"Slow Trace > 2s → Investigate"),
DashboardPanel("Log Errors",
"Log Explorer",
"level = 'error' OR level = 'fatal'",
"service_name, message",
"Error Log Spike > 10x → Alert"),
]
print("=== Dashboard Panels ===")
for p in panels:
print(f"\n [{p.panel}]")
print(f" Query: {p.query_type}")
print(f" Metric: {p.metric}")
print(f" Group: {p.group_by}")
print(f" Alert: {p.alert_threshold}")
Alerting
# === Alert Rules ===
@dataclass
class AlertRule:
name: str
condition: str
severity: str
channel: str
action: str
alerts = [
AlertRule("High Error Rate",
"Error Rate > 1% สำหรับ 5 นาทีต่อเนื่อง",
"Critical",
"Slack #alerts + PagerDuty",
"Investigate → Rollback ถ้าจำเป็น"),
AlertRule("High Latency",
"P99 Latency > 500ms สำหรับ 5 นาที",
"Warning",
"Slack #alerts",
"Check Resource Usage → Scale Up"),
AlertRule("Service Down",
"RPS = 0 สำหรับ 2 นาที",
"Critical",
"Slack + PagerDuty + Email",
"Check Pod Status → Restart → Escalate"),
AlertRule("mTLS Failure",
"istio_requests_total{security_policy='unknown'}",
"High",
"Slack #security",
"Check Istio mTLS Config → Fix Certificate"),
AlertRule("Circuit Breaker Open",
"envoy_cluster_circuit_breakers_open > 0",
"Warning",
"Slack #alerts",
"Check Upstream Service → Increase Limits"),
]
print("=== Alert Rules ===")
for a in alerts:
print(f" [{a.name}] {a.condition}")
print(f" Severity: {a.severity}")
print(f" Channel: {a.channel}")
print(f" Action: {a.action}")
เคล็ดลับ
- Sampling: Production ตั้ง Sampling 1-10% ไม่ใช่ 100% ลด Cost
- ClickHouse: ตั้ง TTL Retention 7-30 วัน ป้องกัน Disk เต็ม
- Service Map: ใช้ Service Map หา Dependency ที่ไม่คาดคิด
- Alert: ตั้ง Alert ทุก Service Error Rate Latency RPS
- Namespace: แยก Namespace ตาม Environment dev staging prod
การนำความรู้ไปประยุกต์ใช้งานจริง
แหล่งเรียนรู้ที่แนะนำ ได้แก่ Official Documentation ที่อัพเดทล่าสุดเสมอ Online Course จาก Coursera Udemy edX ช่อง YouTube คุณภาพทั้งไทยและอังกฤษ และ Community อย่าง Discord Reddit Stack Overflow ที่ช่วยแลกเปลี่ยนประสบการณ์กับนักพัฒนาทั่วโลก
เปรียบเทียบข้อดีและข้อเสีย
จากตารางเปรียบเทียบจะเห็นว่าข้อดีมีมากกว่าข้อเสียอย่างชัดเจน โดยเฉพาะในแง่ของประสิทธิภาพและความสามารถในการ Scale สำหรับข้อเสียส่วนใหญ่สามารถแก้ไขได้ด้วยการเรียนรู้อย่างเป็นระบบและวางแผนทรัพยากรให้เหมาะสม
SigNoz คืออะไร
Open Source Observability Metrics Traces Logs OpenTelemetry ClickHouse Dashboard Alert Kubernetes Helm ทดแทน Datadog New Relic GitHub 15K+ Stars
Service Mesh คืออะไร
Infrastructure Layer Istio Linkerd Envoy Sidecar Traffic Management mTLS Security Observability Metrics Traces Logs Microservices
ตั้งค่าอย่างไร
Helm install SigNoz istioctl install Istio Injection zipkin address OTel Collector accessLog JSON Prometheus Scrape Service Map Trace
ดู Dashboard อะไรได้บ้าง
Service Map RPS Error Rate Latency P99 Trace Waterfall Flame Graph Log Explorer Custom Dashboard ClickHouse Query Alert Rule
สรุป
SigNoz Observability Service Mesh Istio OpenTelemetry ClickHouse Metrics Traces Logs Dashboard Alert Service Map Kubernetes Helm
