Apache SkyWalking is an open-source APM (Application Performance Monitoring) system designed for microservices, cloud-native, and container-based architectures. It provides distributed tracing, metrics aggregation, log analysis, and profiling capabilities (including eBPF, async-profiler, and JFR). The system features a modular, plugin-based architecture where receivers ingest telemetry data, analyzers process it, storage plugins persist it, and query services expose it via GraphQL, PromQL, LogQL, and TraceQL interfaces. Alarm mechanisms detect anomalies and trigger notifications through multiple channels. The codebase demonstrates strong engineering practices with clear separation of concerns, extensive use of interfaces and dependency injection, and reusable patterns like the module system, storage abstraction, and analysis listener framework.
This repository provides TransmittableThreadLocal (TTL), a Java library that extends InheritableThreadLocal to propagate thread-local values across threads even when using thread pools, executors, ForkJoinPool, and other asynchronous constructs. It solves the common problem of context loss (e.g., tracing, security, session) in asynchronous Java applications. The library offers three usage modes: manual wrapping of Runnable/Callable via TtlRunnable/TtlCallable, wrapping executors via TtlExecutors, and transparent bytecode transformation via a Java Agent (TtlAgent) that automatically instruments JDK thread pool classes. The architecture is modular: ttl-core contains the core API and CRR (Capture-Replay-Restore) pattern, ttl-agent provides the agent with Javassist-based transformlets, ttl-kotlin adds Kotlin extensions, and ttl-integrations includes Vert.x 3/4 support. A ttl2-compatible module maintains backward compatibility with the v2 API. The library is widely adopted in the Java ecosystem (e.g., Apache ShardingSphere, SOFARPC) and is under active development with a v3 branch introducing a refined API. While primarily a library, it includes a Java Agent component that operates at the JVM level, making it a hybrid of library and instrumentation tool.
This repository contains the Apache SkyWalking Nginx Agent, a Lua-based library that provides distributed tracing capabilities for Nginx and OpenResty deployments. The agent integrates with Nginx's Lua API to automatically trace incoming and outgoing HTTP requests, propagate trace context between services using custom headers (sw8 and sw8-correlation), and report trace data to a SkyWalking OAP server. The architecture uses Nginx's phased execution model (init_worker, rewrite, body_filter, log) to manage the tracing lifecycle, with a shared dictionary for buffering trace segments and a timer for periodic reporting and heartbeats. The codebase demonstrates strong engineering practices with clear separation of concerns, comprehensive error handling, and performance optimizations like table pooling to reduce garbage collection pressure in LuaJIT. Several components show particular craftsmanship and reusability: the utility module provides high-performance table pooling and ID generation; the correlation context module implements lightweight context propagation via base64-encoded headers; and the segment reference module handles trace context serialization for cross-process tracing.