skills/a6-plugin-skywalking/SKILL.md
Skill for configuring the Apache APISIX skywalking plugin via the a6 CLI. Covers distributed tracing with Apache SkyWalking OAP, sampling configuration, service topology, and integration with skywalking-logger for trace-log correlation.
npx skillsauth add moonming/a6 a6-plugin-skywalkingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The skywalking plugin integrates APISIX with Apache SkyWalking for
distributed tracing. It creates entry and exit spans for each request,
reports them to SkyWalking OAP via HTTP, and enables service topology
visualization and performance analysis.
skywalking-logger| Field | Type | Required | Default | Description |
|-------|------|----------|---------|-------------|
| sample_ratio | number | No | 1 | Sampling rate from 0.00001 to 1 (1 = trace all) |
Configure in APISIX config.yaml under plugin_attr:
| Field | Type | Default | Description |
|-------|------|---------|-------------|
| service_name | string | "APISIX" | Service name in SkyWalking UI |
| service_instance_name | string | "APISIX Instance Name" | Instance name (use $hostname for dynamic) |
| endpoint_addr | string | http://127.0.0.1:12800 | SkyWalking OAP HTTP endpoint |
| report_interval | integer | 3 | Reporting interval in seconds |
plugin_attr:
skywalking:
service_name: api-gateway
service_instance_name: "$hostname"
endpoint_addr: http://skywalking-oap:12800
report_interval: 5
# Docker example
docker run -d --name skywalking-oap \
-p 12800:12800 -p 11800:11800 \
apache/skywalking-oap-server:latest
Add to config.yaml:
plugin_attr:
skywalking:
service_name: my-gateway
service_instance_name: "$hostname"
endpoint_addr: http://skywalking-oap:12800
a6 route create -f - <<'EOF'
{
"id": "traced-api",
"uri": "/api/*",
"plugins": {
"skywalking": {
"sample_ratio": 1
}
},
"upstream": {
"type": "roundrobin",
"nodes": {
"backend:8080": 1
}
}
}
EOF
curl http://127.0.0.1:9080/api/hello
View traces in SkyWalking UI at http://skywalking-ui:8080.
{
"plugins": {
"skywalking": {
"sample_ratio": 0.1
}
}
}
Traces 10% of requests. Sufficient for production traffic analysis without excessive overhead.
{
"plugins": {
"skywalking": {
"sample_ratio": 1
},
"skywalking-logger": {
"endpoint_addr": "http://skywalking-oap:12800"
}
}
}
Associates access logs with trace IDs in the SkyWalking UI, enabling click-through from traces to logs.
curl "$(a6 context current -o json | jq -r .server)/apisix/admin/global_rules" \
-X PUT \
-H "X-API-KEY: $(a6 context current -o json | jq -r .api_key)" \
-d '{
"id": "skywalking-global",
"plugins": {
"skywalking": {
"sample_ratio": 0.5
}
}
}'
The plugin creates two spans per request:
version: "1"
routes:
- id: traced-api
uri: /api/*
plugins:
skywalking:
sample_ratio: 1
upstream_id: my-upstream
upstreams:
- id: my-upstream
type: roundrobin
nodes:
"backend:8080": 1
| Symptom | Cause | Fix |
|---------|-------|-----|
| No traces in SkyWalking UI | Wrong endpoint_addr | Verify OAP is reachable at the configured address |
| Missing service in topology | service_name mismatch | Check plugin_attr.skywalking.service_name in config.yaml |
| High overhead | sample_ratio: 1 in production | Lower to 0.01-0.1 for high-traffic routes |
| Traces not correlated | Backend not instrumented | Install SkyWalking agent in upstream services |
| Plugin not working | Not in plugins list | Ensure skywalking is in the plugins array in config.yaml |
tools
Core skill for working with the a6 CLI — the Apache APISIX command-line tool. Provides project conventions, command patterns, architecture overview, and development workflow. Load this skill when working on a6 source code, adding new commands, writing tests, or modifying any a6 component.
tools
Recipe skill for implementing multi-tenant API gateway patterns using the a6 CLI. Covers tenant isolation via Consumer Groups, host/path/header-based routing, per-tenant rate limiting, context forwarding with proxy-rewrite, and declarative config sync workflows for multi-tenant management.
tools
Recipe skill for configuring mutual TLS (mTLS) using the a6 CLI. Covers SSL certificate management, upstream mTLS to backend services, client certificate verification, and end-to-end mTLS setup from client through APISIX to upstream.
tools
Recipe skill for configuring upstream health checks using the a6 CLI. Covers active health checks (HTTP probing), passive health checks (response analysis), combining both, configuring healthy/unhealthy thresholds, and monitoring upstream node status.