opencode-skills-collection 4.0.54 → 4.0.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled-skills/.antigravity-install-manifest.json +1 -1
- package/bundled-skills/antigravity-maintainer-batch-release/SKILL.md +10 -1
- package/bundled-skills/backend-security-coder/resources/implementation-playbook.md +23 -0
- package/bundled-skills/business-analyst/resources/implementation-playbook.md +23 -0
- package/bundled-skills/devops-troubleshooter/resources/implementation-playbook.md +23 -0
- package/bundled-skills/distributed-tracing/SKILL.md +22 -435
- package/bundled-skills/distributed-tracing/references/instrumentation.md +13 -0
- package/bundled-skills/distributed-tracing/references/jaeger-setup.md +13 -0
- package/bundled-skills/distributed-tracing/resources/implementation-playbook.md +23 -0
- package/bundled-skills/django-pro/resources/implementation-playbook.md +23 -0
- package/bundled-skills/embedding-strategies/SKILL.md +40 -64
- package/bundled-skills/embedding-strategies/resources/implementation-playbook.md +23 -0
- package/bundled-skills/fastapi-pro/resources/implementation-playbook.md +23 -0
- package/bundled-skills/find-complementary-founders/scripts/assess_profile.py +7 -1
- package/bundled-skills/frontend-security-coder/SKILL.md +5 -5
- package/bundled-skills/frontend-security-coder/resources/implementation-playbook.md +23 -0
- package/bundled-skills/github-actions-templates/SKILL.md +34 -314
- package/bundled-skills/github-actions-templates/references/common-workflows.md +13 -0
- package/bundled-skills/github-actions-templates/resources/implementation-playbook.md +23 -0
- package/bundled-skills/google-docs-automation/SKILL.md +19 -69
- package/bundled-skills/google-sheets-automation/SKILL.md +20 -128
- package/bundled-skills/google-slides-automation/SKILL.md +19 -128
- package/bundled-skills/grafana-dashboards/SKILL.md +6 -6
- package/bundled-skills/grafana-dashboards/references/dashboard-design.md +13 -0
- package/bundled-skills/grafana-dashboards/resources/implementation-playbook.md +23 -0
- package/bundled-skills/incident-responder/resources/implementation-playbook.md +23 -0
- package/bundled-skills/instagram/scripts/config.py +33 -8
- package/bundled-skills/ios-developer/resources/implementation-playbook.md +23 -0
- package/bundled-skills/junta-leiloeiros/scripts/.snyk +5 -0
- package/bundled-skills/junta-leiloeiros/scripts/requirements.txt +2 -0
- package/bundled-skills/kpi-dashboard-design/SKILL.md +7 -67
- package/bundled-skills/kpi-dashboard-design/resources/implementation-playbook.md +23 -0
- package/bundled-skills/kpi-dashboard-design/resources/metric-queries.sql +30 -0
- package/bundled-skills/lint-and-validate/SKILL.md +17 -45
- package/bundled-skills/lint-and-validate/scripts/lint_runner.py +17 -8
- package/bundled-skills/lint-and-validate/scripts/type_coverage.py +77 -167
- package/bundled-skills/mobile-developer/resources/implementation-playbook.md +23 -0
- package/bundled-skills/multi-platform-apps-multi-platform/resources/implementation-playbook.md +23 -0
- package/bundled-skills/notebooklm/scripts/config.py +33 -11
- package/bundled-skills/observability-and-instrumentation/SKILL.md +4 -1
- package/bundled-skills/observability-and-instrumentation/references/observability-checklist.md +13 -0
- package/bundled-skills/pci-compliance/SKILL.md +23 -469
- package/bundled-skills/pci-compliance/resources/implementation-playbook.md +23 -0
- package/bundled-skills/postmortem-writing/SKILL.md +1 -1
- package/bundled-skills/postmortem-writing/resources/implementation-playbook.md +23 -0
- package/bundled-skills/pydantic-models-py/SKILL.md +1 -3
- package/bundled-skills/secrets-management/SKILL.md +24 -349
- package/bundled-skills/secrets-management/references/github-secrets.md +13 -0
- package/bundled-skills/secrets-management/references/vault-setup.md +13 -0
- package/bundled-skills/security-and-hardening/SKILL.md +8 -6
- package/bundled-skills/security-and-hardening/references/security-checklist.md +13 -0
- package/bundled-skills/seo-content-planner/resources/implementation-playbook.md +23 -0
- package/bundled-skills/seo-content-writer/SKILL.md +2 -2
- package/bundled-skills/seo-content-writer/resources/implementation-playbook.md +23 -0
- package/bundled-skills/shopify-development/scripts/.snyk +3 -0
- package/bundled-skills/slack-gif-creator/.snyk +5 -0
- package/bundled-skills/slack-gif-creator/requirements.txt +2 -2
- package/bundled-skills/slo-implementation/SKILL.md +24 -9
- package/bundled-skills/slo-implementation/references/error-budget.md +13 -0
- package/bundled-skills/slo-implementation/references/slo-definitions.md +13 -0
- package/bundled-skills/slo-implementation/resources/implementation-playbook.md +23 -0
- package/bundled-skills/sql-optimization-patterns/SKILL.md +10 -6
- package/bundled-skills/sql-optimization-patterns/resources/implementation-playbook.md +52 -56
- package/bundled-skills/telegram/assets/boilerplate/nodejs/package-lock.json +1888 -0
- package/bundled-skills/telegram/assets/boilerplate/nodejs/package.json +3 -0
- package/bundled-skills/vector-database-engineer/resources/implementation-playbook.md +23 -0
- package/bundled-skills/videodb/scripts/ws_listener.py +8 -1
- package/bundled-skills/whatsapp-cloud-api/assets/boilerplate/nodejs/package-lock.json +1881 -0
- package/bundled-skills/whatsapp-cloud-api/assets/boilerplate/nodejs/package.json +3 -0
- package/bundled-skills/whatsapp-cloud-api/assets/boilerplate/python/.snyk +3 -0
- package/package.json +1 -1
|
@@ -82,6 +82,14 @@ Before changing anything:
|
|
|
82
82
|
|
|
83
83
|
When changing maintainer scripts, workflows, or policy, update the canonical skill, maintainer documentation, and regression tests in the same source PR. Add a negative test for every failure mode being fixed, run the relevant dry-run path, and reject any implementation/documentation mismatch. Source PRs must exclude generated registries and plugin mirrors; the protected canonical-sync PR owns that derived state, except for files intentionally staged by the scripted protected-release flow.
|
|
84
84
|
|
|
85
|
+
## Repository documentation consistency
|
|
86
|
+
|
|
87
|
+
When auditing repository documentation, compare operational guides and translations with exact-base scripts and workflow behavior. Check local links, heading anchors and documented npm commands with `tools/scripts/tests/test_documentation_consistency.py`; dated evidence and backup snapshots are historical, not current instructions. Keep canonical guides discoverable from `docs/README.md`, distinguish source merge from release availability, and report the scope of the audit without claiming that all skill procedures or external integrations ran.
|
|
88
|
+
|
|
89
|
+
## Specialized Plugin Consistency
|
|
90
|
+
|
|
91
|
+
Use `data/specialized-plugin-candidates.json` for specialized-plugin membership and `data/editorial-bundles.json` for the installable composition, descriptions, limits and starter prompts. Review changes against canonical `skills_index.json`; keep IDs stable unless a migration is explicitly requested. Derive the web catalog and prerender/live-verifier counts from these sources instead of maintaining copied lists or fixed counts. Verify full skill-list expansion, source-to-web parity and a negative stale-count case. The specialized-resource regression must reject missing prose-declared local support paths and verify their bytes in generated specialized bundles; fenced application examples remain a separate semantic review. Run the pure-example regressions when editing documented calculations or chunking behavior. Regenerate plugin artifacts as evidence, but leave their commit to the protected canonical-sync lane. A source refresh does not authorize release or deployment.
|
|
92
|
+
|
|
85
93
|
## Hosted Catalog and Legacy Redirect Bridge
|
|
86
94
|
|
|
87
95
|
Treat the current catalog and the legacy user-site bridge as one public system:
|
|
@@ -113,9 +121,10 @@ For AAS CLI, MCP, stack, catalog-cache, or Workbench changes:
|
|
|
113
121
|
- Explicit caller search filters may narrow retrieval; they never define skill eligibility. For search changes, verify backward-compatible broad matching, all-term matching, bounded filters, category aliases, stable pagination, complete-catalog reachability without filters, and preservation of supplied options through evidence export and inspection.
|
|
114
122
|
4. Keep `aas-stack.json` free of Core selection policy. It pins catalog identity, targets, goals, and the exact IDs selected by the agent. `compose_stack` validates and records that selection; missing or cautionary metadata must never make a canonical skill unselectable or unusable.
|
|
115
123
|
5. Keep the supported public path at manifest validation and immutable plan preview. Planning may write only the requested plan artifact; it must not materialize skill payloads or AAS managed state in the target.
|
|
124
|
+
- Verify manifest-to-installer command preparation preserves exact agent-selected IDs and catalog version, rejects empty or unknown selections, quotes shell arguments, and only emits a dry run. Runtime auto-resolution must stay offline and bounded, fully verify cached bytes, and reject multiple verified identities; never infer skill suitability from runtime or metadata checks. Exercise actual packed installation in a temporary destination, compare all selected file bytes, repeat it, preserve unmanaged files, and reject moved-release and symlink-target cases. Distinguish fixture publication resolution from a real published-release/client check; the aggregate must reject missing installation evidence. Require both Linux and Windows packed receipts. Execute the emitted PowerShell command with both PowerShell 7 and Windows PowerShell 5.1 on a disposable Windows runner, recording and checking both actual shell versions, including paths with spaces and apostrophes, full payload comparison, repeat/prune behavior and junction rejection. Local Git/publication fixtures are not proof of registry availability or a native client session.
|
|
116
125
|
- Infer a target only for a validated single-target manifest; require an explicit choice otherwise. Verify that the cached runtime's catalog matches the manifest, and keep runtime integrity, cache location and destination explicit. Document the separate direct-installer handoff without implying it applies Core plans.
|
|
117
126
|
- Workbench evidence imports must remain bounded and in memory. Verify artifact digests, project references, manifest/catalog/profile/selection bindings, conflict displays and replacement of stale results. Identify browser checks separately from full Core inspection and semantic judgment. Recorded examples need real inputs and observed checks; optional feedback may export only user-entered fields after an explicit action, without telemetry or imported project data.
|
|
118
|
-
- Verify large manifest and evidence round trips through real stdio, not just in-process handlers. Artifact arguments may use the existing 256 KiB frame ceiling; ordinary requests and unrelated metadata remain bounded at 4 KiB. Rejected, safely parsed requests must retain a bounded request ID; never reflect malformed or unbounded IDs.
|
|
127
|
+
- Verify large manifest and evidence round trips through real stdio, not just in-process handlers. Artifact arguments may use the existing 256 KiB frame ceiling; ordinary requests and unrelated metadata remain bounded at 4 KiB. Rejected, safely parsed requests must retain a bounded request ID; never reflect malformed or unbounded IDs. Keep overload errors correlated to bounded, strictly parsed request IDs; valid notifications receive no response, including when the queue is full or a handler fails. Reject invalid envelopes without reflecting invalid IDs, and test the burst path through real stdio.
|
|
119
128
|
6. Treat apply and recovery as experimental opt-ins outside the supported preview claim. Do not add apply/recovery, benchmark, fuzz, crash/race, or synthetic verifier work unless the user explicitly places it in scope.
|
|
120
129
|
7. When the task asks for end-to-end client proof, use a real supported client that discovers and invokes the local AAS MCP tools; direct stdio probes and automated tests do not substitute for that evidence.
|
|
121
130
|
8. Do not tag, publish npm, deploy Pages, or write real user MCP configuration without the separately required publication approval.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Backend security implementation
|
|
2
|
+
|
|
3
|
+
## Inputs
|
|
4
|
+
|
|
5
|
+
Endpoint code, request schema, identity/tenant model, persistence adapter and existing tests.
|
|
6
|
+
|
|
7
|
+
## Procedure
|
|
8
|
+
|
|
9
|
+
1. Trace each untrusted field from request to database, outbound call and response. Record the resource owner separately from the authenticated caller.
|
|
10
|
+
2. Implement allowlisted input fields, parameterized persistence and server-side resource authorization before side effects. Keep error responses generic and logs free of request bodies or credentials.
|
|
11
|
+
3. Exercise anonymous, wrong-role, wrong-tenant, malformed and oversized requests in a disposable test environment. Check the database and outbound-call mocks to prove denied requests did not act.
|
|
12
|
+
|
|
13
|
+
## Worked example
|
|
14
|
+
|
|
15
|
+
A user can edit another tenant's invoice by changing its ID. Add a tenant-bound lookup and test own-tenant success plus cross-tenant denial with unchanged stored data.
|
|
16
|
+
|
|
17
|
+
## Verification and handoff
|
|
18
|
+
|
|
19
|
+
Report the actual files or configuration changed, checks performed, observed results and any untested environment. Keep the original inputs and evidence sufficient to reproduce the conclusion.
|
|
20
|
+
|
|
21
|
+
## Limitations
|
|
22
|
+
|
|
23
|
+
An authenticated request is not proof of resource ownership. A passing scanner is not proof that authorization works.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Business analysis decision brief
|
|
2
|
+
|
|
3
|
+
## Inputs
|
|
4
|
+
|
|
5
|
+
Decision owner, business question, source tables, reporting window, definitions and known data gaps.
|
|
6
|
+
|
|
7
|
+
## Procedure
|
|
8
|
+
|
|
9
|
+
1. Write the decision and alternatives before choosing metrics. Define grain, population, exclusions, currency and time zone.
|
|
10
|
+
2. Check missing values, duplicates and join cardinality. Reconcile totals to a small hand-calculated sample before segmenting or forecasting.
|
|
11
|
+
3. Separate observed results, assumptions and recommendations. Deliver reproducible calculations and a decision threshold; identify which missing evidence could change the choice.
|
|
12
|
+
|
|
13
|
+
## Worked example
|
|
14
|
+
|
|
15
|
+
Compare two acquisition channels using reconciled spend and distinct acquired customers for the same period. Keep attribution uncertainty visible rather than inferring causality from conversion differences.
|
|
16
|
+
|
|
17
|
+
## Verification and handoff
|
|
18
|
+
|
|
19
|
+
Report the actual files or configuration changed, checks performed, observed results and any untested environment. Keep the original inputs and evidence sufficient to reproduce the conclusion.
|
|
20
|
+
|
|
21
|
+
## Limitations
|
|
22
|
+
|
|
23
|
+
Do not invent benchmarks, forecast accuracy or causal effects. A chart cannot repair an ambiguous denominator.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# DevOps failure investigation
|
|
2
|
+
|
|
3
|
+
## Inputs
|
|
4
|
+
|
|
5
|
+
Affected service and environment, impact window, recent changes, authorized read access and recovery owner.
|
|
6
|
+
|
|
7
|
+
## Procedure
|
|
8
|
+
|
|
9
|
+
1. Capture the failing symptom and a healthy comparison. Read bounded logs, metrics, deployment identity and dependency status without dumping environment variables.
|
|
10
|
+
2. Write competing hypotheses and choose the cheapest discriminating observation. Preserve timestamps and exact filters so another engineer can reproduce the evidence.
|
|
11
|
+
3. Prepare a bounded mitigation with rollback and abort conditions. Apply only within authorized operational scope, then verify the original user journey and dependent services.
|
|
12
|
+
|
|
13
|
+
## Worked example
|
|
14
|
+
|
|
15
|
+
After a rollout, requests time out while CPU stays normal. Compare connection-pool occupancy and downstream latency across old and new instances before proposing scaling.
|
|
16
|
+
|
|
17
|
+
## Verification and handoff
|
|
18
|
+
|
|
19
|
+
Report the actual files or configuration changed, checks performed, observed results and any untested environment. Keep the original inputs and evidence sufficient to reproduce the conclusion.
|
|
20
|
+
|
|
21
|
+
## Limitations
|
|
22
|
+
|
|
23
|
+
Correlation with a deployment is not proof of cause. Avoid broad restarts, destructive cleanup and fault injection during diagnosis.
|
|
@@ -8,451 +8,38 @@ date_added: "2026-02-27"
|
|
|
8
8
|
|
|
9
9
|
# Distributed Tracing
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## When to Use
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Trace a request across services, diagnose latency and error propagation, or add observable boundaries to a new integration.
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
- You need a different domain or tool outside this scope
|
|
15
|
+
## Inputs and prerequisites
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
Record installed SDK and backend versions, permitted collector endpoints, the service graph and a staging request. Inspect the installed version's primary documentation before selecting exporter APIs or deployment configuration. This bundle does not install a tracing backend.
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
- Apply relevant best practices and validate outcomes.
|
|
22
|
-
- Provide actionable steps and verification.
|
|
23
|
-
- If detailed examples are required, open `resources/implementation-playbook.md`.
|
|
19
|
+
## Procedure
|
|
24
20
|
|
|
25
|
-
|
|
21
|
+
1. Read `resources/implementation-playbook.md` and identify one user journey.
|
|
22
|
+
2. Configure the matching OpenTelemetry SDK and OTLP exporter before loading instrumented frameworks. Use `references/instrumentation.md` for propagation, shutdown and privacy checks.
|
|
23
|
+
3. Configure Jaeger using `references/jaeger-setup.md`, or the existing Tempo/collector deployment's supported configuration. Review listeners, authentication, transport protection, storage and retention before any deployment.
|
|
24
|
+
4. Propagate context over HTTP and asynchronous messages. Use stable operation names and allowlisted attributes. Do not log credentials, raw request bodies or sensitive query values.
|
|
25
|
+
5. Send successful and failing staging requests and verify connected spans in the backend. Record service identity, parentage, duration units and exporter errors.
|
|
26
|
+
6. Measure queue loss and overhead. Select sampling based on those observations; no fixed percentage guarantees coverage or performance.
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
## Example
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
A checkout calls inventory and payment. Verify that the root request and both downstream operations share a trace, that a simulated payment timeout is recorded, and that no card data is present. Repeat with exporter connectivity unavailable: request handling must retain the application's defined behavior.
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
- Understand service dependencies
|
|
33
|
-
- Identify bottlenecks
|
|
34
|
-
- Trace error propagation
|
|
35
|
-
- Analyze request paths
|
|
32
|
+
## Verification
|
|
36
33
|
|
|
37
|
-
|
|
34
|
+
- Actual trace evidence for each exercised boundary, including queue consumers.
|
|
35
|
+
- Allowed fields only; bounded attribute cardinality.
|
|
36
|
+
- Shutdown flush and exporter failure behavior observed.
|
|
37
|
+
- Access, storage and retention checked independently from UI availability.
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
```
|
|
41
|
-
Trace (Request ID: abc123)
|
|
42
|
-
↓
|
|
43
|
-
Span (frontend) [100ms]
|
|
44
|
-
↓
|
|
45
|
-
Span (api-gateway) [80ms]
|
|
46
|
-
├→ Span (auth-service) [10ms]
|
|
47
|
-
└→ Span (user-service) [60ms]
|
|
48
|
-
└→ Span (database) [40ms]
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### Key Components
|
|
52
|
-
- **Trace** - End-to-end request journey
|
|
53
|
-
- **Span** - Single operation within a trace
|
|
54
|
-
- **Context** - Metadata propagated between services
|
|
55
|
-
- **Tags** - Key-value pairs for filtering
|
|
56
|
-
- **Logs** - Timestamped events within a span
|
|
57
|
-
|
|
58
|
-
## Jaeger Setup
|
|
59
|
-
|
|
60
|
-
### Kubernetes Deployment
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
# Deploy Jaeger Operator
|
|
64
|
-
kubectl create namespace observability
|
|
65
|
-
kubectl create -f https://github.com/jaegertracing/jaeger-operator/releases/download/v1.51.0/jaeger-operator.yaml -n observability
|
|
66
|
-
|
|
67
|
-
# Deploy Jaeger instance
|
|
68
|
-
kubectl apply -f - <<EOF
|
|
69
|
-
apiVersion: jaegertracing.io/v1
|
|
70
|
-
kind: Jaeger
|
|
71
|
-
metadata:
|
|
72
|
-
name: jaeger
|
|
73
|
-
namespace: observability
|
|
74
|
-
spec:
|
|
75
|
-
strategy: production
|
|
76
|
-
storage:
|
|
77
|
-
type: elasticsearch
|
|
78
|
-
options:
|
|
79
|
-
es:
|
|
80
|
-
server-urls: http://elasticsearch:9200
|
|
81
|
-
ingress:
|
|
82
|
-
enabled: true
|
|
83
|
-
EOF
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
### Docker Compose
|
|
87
|
-
|
|
88
|
-
```yaml
|
|
89
|
-
version: '3.8'
|
|
90
|
-
services:
|
|
91
|
-
jaeger:
|
|
92
|
-
image: jaegertracing/all-in-one:latest
|
|
93
|
-
ports:
|
|
94
|
-
- "5775:5775/udp"
|
|
95
|
-
- "6831:6831/udp"
|
|
96
|
-
- "6832:6832/udp"
|
|
97
|
-
- "5778:5778"
|
|
98
|
-
- "16686:16686" # UI
|
|
99
|
-
- "14268:14268" # Collector
|
|
100
|
-
- "14250:14250" # gRPC
|
|
101
|
-
- "9411:9411" # Zipkin
|
|
102
|
-
environment:
|
|
103
|
-
- COLLECTOR_ZIPKIN_HOST_PORT=:9411
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
**Reference:** See `references/jaeger-setup.md`
|
|
107
|
-
|
|
108
|
-
## Application Instrumentation
|
|
109
|
-
|
|
110
|
-
### OpenTelemetry (Recommended)
|
|
111
|
-
|
|
112
|
-
#### Python (Flask)
|
|
113
|
-
```python
|
|
114
|
-
from opentelemetry import trace
|
|
115
|
-
from opentelemetry.exporter.jaeger.thrift import JaegerExporter
|
|
116
|
-
from opentelemetry.sdk.resources import SERVICE_NAME, Resource
|
|
117
|
-
from opentelemetry.sdk.trace import TracerProvider
|
|
118
|
-
from opentelemetry.sdk.trace.export import BatchSpanProcessor
|
|
119
|
-
from opentelemetry.instrumentation.flask import FlaskInstrumentor
|
|
120
|
-
from flask import Flask
|
|
121
|
-
|
|
122
|
-
# Initialize tracer
|
|
123
|
-
resource = Resource(attributes={SERVICE_NAME: "my-service"})
|
|
124
|
-
provider = TracerProvider(resource=resource)
|
|
125
|
-
processor = BatchSpanProcessor(JaegerExporter(
|
|
126
|
-
agent_host_name="jaeger",
|
|
127
|
-
agent_port=6831,
|
|
128
|
-
))
|
|
129
|
-
provider.add_span_processor(processor)
|
|
130
|
-
trace.set_tracer_provider(provider)
|
|
131
|
-
|
|
132
|
-
# Instrument Flask
|
|
133
|
-
app = Flask(__name__)
|
|
134
|
-
FlaskInstrumentor().instrument_app(app)
|
|
135
|
-
|
|
136
|
-
@app.route('/api/users')
|
|
137
|
-
def get_users():
|
|
138
|
-
tracer = trace.get_tracer(__name__)
|
|
139
|
-
|
|
140
|
-
with tracer.start_as_current_span("get_users") as span:
|
|
141
|
-
span.set_attribute("user.count", 100)
|
|
142
|
-
# Business logic
|
|
143
|
-
users = fetch_users_from_db()
|
|
144
|
-
return {"users": users}
|
|
145
|
-
|
|
146
|
-
def fetch_users_from_db():
|
|
147
|
-
tracer = trace.get_tracer(__name__)
|
|
148
|
-
|
|
149
|
-
with tracer.start_as_current_span("database_query") as span:
|
|
150
|
-
span.set_attribute("db.system", "postgresql")
|
|
151
|
-
span.set_attribute("db.statement", "SELECT * FROM users")
|
|
152
|
-
# Database query
|
|
153
|
-
return query_database()
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
#### Node.js (Express)
|
|
157
|
-
```javascript
|
|
158
|
-
const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node');
|
|
159
|
-
const { JaegerExporter } = require('@opentelemetry/exporter-jaeger');
|
|
160
|
-
const { BatchSpanProcessor } = require('@opentelemetry/sdk-trace-base');
|
|
161
|
-
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
|
|
162
|
-
const { HttpInstrumentation } = require('@opentelemetry/instrumentation-http');
|
|
163
|
-
const { ExpressInstrumentation } = require('@opentelemetry/instrumentation-express');
|
|
164
|
-
|
|
165
|
-
// Initialize tracer
|
|
166
|
-
const provider = new NodeTracerProvider({
|
|
167
|
-
resource: { attributes: { 'service.name': 'my-service' } }
|
|
168
|
-
});
|
|
169
|
-
|
|
170
|
-
const exporter = new JaegerExporter({
|
|
171
|
-
endpoint: 'http://jaeger:14268/api/traces'
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
provider.addSpanProcessor(new BatchSpanProcessor(exporter));
|
|
175
|
-
provider.register();
|
|
176
|
-
|
|
177
|
-
// Instrument libraries
|
|
178
|
-
registerInstrumentations({
|
|
179
|
-
instrumentations: [
|
|
180
|
-
new HttpInstrumentation(),
|
|
181
|
-
new ExpressInstrumentation(),
|
|
182
|
-
],
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
const express = require('express');
|
|
186
|
-
const app = express();
|
|
187
|
-
|
|
188
|
-
app.get('/api/users', async (req, res) => {
|
|
189
|
-
const tracer = trace.getTracer('my-service');
|
|
190
|
-
const span = tracer.startSpan('get_users');
|
|
191
|
-
|
|
192
|
-
try {
|
|
193
|
-
const users = await fetchUsers();
|
|
194
|
-
span.setAttributes({ 'user.count': users.length });
|
|
195
|
-
res.json({ users });
|
|
196
|
-
} finally {
|
|
197
|
-
span.end();
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
#### Go
|
|
203
|
-
```go
|
|
204
|
-
package main
|
|
205
|
-
|
|
206
|
-
import (
|
|
207
|
-
"context"
|
|
208
|
-
"go.opentelemetry.io/otel"
|
|
209
|
-
"go.opentelemetry.io/otel/exporters/jaeger"
|
|
210
|
-
"go.opentelemetry.io/otel/sdk/resource"
|
|
211
|
-
sdktrace "go.opentelemetry.io/otel/sdk/trace"
|
|
212
|
-
semconv "go.opentelemetry.io/otel/semconv/v1.4.0"
|
|
213
|
-
)
|
|
214
|
-
|
|
215
|
-
func initTracer() (*sdktrace.TracerProvider, error) {
|
|
216
|
-
exporter, err := jaeger.New(jaeger.WithCollectorEndpoint(
|
|
217
|
-
jaeger.WithEndpoint("http://jaeger:14268/api/traces"),
|
|
218
|
-
))
|
|
219
|
-
if err != nil {
|
|
220
|
-
return nil, err
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
tp := sdktrace.NewTracerProvider(
|
|
224
|
-
sdktrace.WithBatcher(exporter),
|
|
225
|
-
sdktrace.WithResource(resource.NewWithAttributes(
|
|
226
|
-
semconv.SchemaURL,
|
|
227
|
-
semconv.ServiceNameKey.String("my-service"),
|
|
228
|
-
)),
|
|
229
|
-
)
|
|
230
|
-
|
|
231
|
-
otel.SetTracerProvider(tp)
|
|
232
|
-
return tp, nil
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
func getUsers(ctx context.Context) ([]User, error) {
|
|
236
|
-
tracer := otel.Tracer("my-service")
|
|
237
|
-
ctx, span := tracer.Start(ctx, "get_users")
|
|
238
|
-
defer span.End()
|
|
239
|
-
|
|
240
|
-
span.SetAttributes(attribute.String("user.filter", "active"))
|
|
241
|
-
|
|
242
|
-
users, err := fetchUsersFromDB(ctx)
|
|
243
|
-
if err != nil {
|
|
244
|
-
span.RecordError(err)
|
|
245
|
-
return nil, err
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
span.SetAttributes(attribute.Int("user.count", len(users)))
|
|
249
|
-
return users, nil
|
|
250
|
-
}
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
**Reference:** See `references/instrumentation.md`
|
|
254
|
-
|
|
255
|
-
## Context Propagation
|
|
256
|
-
|
|
257
|
-
### HTTP Headers
|
|
258
|
-
```
|
|
259
|
-
traceparent: 00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01
|
|
260
|
-
tracestate: congo=t61rcWkgMzE
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
### Propagation in HTTP Requests
|
|
264
|
-
|
|
265
|
-
#### Python
|
|
266
|
-
```python
|
|
267
|
-
from opentelemetry.propagate import inject
|
|
268
|
-
|
|
269
|
-
headers = {}
|
|
270
|
-
inject(headers) # Injects trace context
|
|
271
|
-
|
|
272
|
-
response = requests.get('http://downstream-service/api', headers=headers)
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
#### Node.js
|
|
276
|
-
```javascript
|
|
277
|
-
const { propagation } = require('@opentelemetry/api');
|
|
278
|
-
|
|
279
|
-
const headers = {};
|
|
280
|
-
propagation.inject(context.active(), headers);
|
|
281
|
-
|
|
282
|
-
axios.get('http://downstream-service/api', { headers });
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
## Tempo Setup (Grafana)
|
|
286
|
-
|
|
287
|
-
### Kubernetes Deployment
|
|
288
|
-
|
|
289
|
-
```yaml
|
|
290
|
-
apiVersion: v1
|
|
291
|
-
kind: ConfigMap
|
|
292
|
-
metadata:
|
|
293
|
-
name: tempo-config
|
|
294
|
-
data:
|
|
295
|
-
tempo.yaml: |
|
|
296
|
-
server:
|
|
297
|
-
http_listen_port: 3200
|
|
298
|
-
|
|
299
|
-
distributor:
|
|
300
|
-
receivers:
|
|
301
|
-
jaeger:
|
|
302
|
-
protocols:
|
|
303
|
-
thrift_http:
|
|
304
|
-
grpc:
|
|
305
|
-
otlp:
|
|
306
|
-
protocols:
|
|
307
|
-
http:
|
|
308
|
-
grpc:
|
|
309
|
-
|
|
310
|
-
storage:
|
|
311
|
-
trace:
|
|
312
|
-
backend: s3
|
|
313
|
-
s3:
|
|
314
|
-
bucket: tempo-traces
|
|
315
|
-
endpoint: s3.amazonaws.com
|
|
316
|
-
|
|
317
|
-
querier:
|
|
318
|
-
frontend_worker:
|
|
319
|
-
frontend_address: tempo-query-frontend:9095
|
|
320
|
-
---
|
|
321
|
-
apiVersion: apps/v1
|
|
322
|
-
kind: Deployment
|
|
323
|
-
metadata:
|
|
324
|
-
name: tempo
|
|
325
|
-
spec:
|
|
326
|
-
replicas: 1
|
|
327
|
-
template:
|
|
328
|
-
spec:
|
|
329
|
-
containers:
|
|
330
|
-
- name: tempo
|
|
331
|
-
image: grafana/tempo:latest
|
|
332
|
-
args:
|
|
333
|
-
- -config.file=/etc/tempo/tempo.yaml
|
|
334
|
-
volumeMounts:
|
|
335
|
-
- name: config
|
|
336
|
-
mountPath: /etc/tempo
|
|
337
|
-
volumes:
|
|
338
|
-
- name: config
|
|
339
|
-
configMap:
|
|
340
|
-
name: tempo-config
|
|
341
|
-
```
|
|
342
|
-
|
|
343
|
-
**Reference:** See `assets/jaeger-config.yaml.template`
|
|
344
|
-
|
|
345
|
-
## Sampling Strategies
|
|
346
|
-
|
|
347
|
-
### Probabilistic Sampling
|
|
348
|
-
```yaml
|
|
349
|
-
# Sample 1% of traces
|
|
350
|
-
sampler:
|
|
351
|
-
type: probabilistic
|
|
352
|
-
param: 0.01
|
|
353
|
-
```
|
|
354
|
-
|
|
355
|
-
### Rate Limiting Sampling
|
|
356
|
-
```yaml
|
|
357
|
-
# Sample max 100 traces per second
|
|
358
|
-
sampler:
|
|
359
|
-
type: ratelimiting
|
|
360
|
-
param: 100
|
|
361
|
-
```
|
|
362
|
-
|
|
363
|
-
### Adaptive Sampling
|
|
364
|
-
```python
|
|
365
|
-
from opentelemetry.sdk.trace.sampling import ParentBased, TraceIdRatioBased
|
|
366
|
-
|
|
367
|
-
# Sample based on trace ID (deterministic)
|
|
368
|
-
sampler = ParentBased(root=TraceIdRatioBased(0.01))
|
|
369
|
-
```
|
|
370
|
-
|
|
371
|
-
## Trace Analysis
|
|
372
|
-
|
|
373
|
-
### Finding Slow Requests
|
|
374
|
-
|
|
375
|
-
**Jaeger Query:**
|
|
376
|
-
```
|
|
377
|
-
service=my-service
|
|
378
|
-
duration > 1s
|
|
379
|
-
```
|
|
380
|
-
|
|
381
|
-
### Finding Errors
|
|
382
|
-
|
|
383
|
-
**Jaeger Query:**
|
|
384
|
-
```
|
|
385
|
-
service=my-service
|
|
386
|
-
error=true
|
|
387
|
-
tags.http.status_code >= 500
|
|
388
|
-
```
|
|
389
|
-
|
|
390
|
-
### Service Dependency Graph
|
|
391
|
-
|
|
392
|
-
Jaeger automatically generates service dependency graphs showing:
|
|
393
|
-
- Service relationships
|
|
394
|
-
- Request rates
|
|
395
|
-
- Error rates
|
|
396
|
-
- Average latencies
|
|
397
|
-
|
|
398
|
-
## Best Practices
|
|
399
|
-
|
|
400
|
-
1. **Sample appropriately** (1-10% in production)
|
|
401
|
-
2. **Add meaningful tags** (user_id, request_id)
|
|
402
|
-
3. **Propagate context** across all service boundaries
|
|
403
|
-
4. **Log exceptions** in spans
|
|
404
|
-
5. **Use consistent naming** for operations
|
|
405
|
-
6. **Monitor tracing overhead** (<1% CPU impact)
|
|
406
|
-
7. **Set up alerts** for trace errors
|
|
407
|
-
8. **Implement distributed context** (baggage)
|
|
408
|
-
9. **Use span events** for important milestones
|
|
409
|
-
10. **Document instrumentation** standards
|
|
410
|
-
|
|
411
|
-
## Integration with Logging
|
|
412
|
-
|
|
413
|
-
### Correlated Logs
|
|
414
|
-
```python
|
|
415
|
-
import logging
|
|
416
|
-
from opentelemetry import trace
|
|
417
|
-
|
|
418
|
-
logger = logging.getLogger(__name__)
|
|
419
|
-
|
|
420
|
-
def process_request():
|
|
421
|
-
span = trace.get_current_span()
|
|
422
|
-
trace_id = span.get_span_context().trace_id
|
|
423
|
-
|
|
424
|
-
logger.info(
|
|
425
|
-
"Processing request",
|
|
426
|
-
extra={"trace_id": format(trace_id, '032x')}
|
|
427
|
-
)
|
|
428
|
-
```
|
|
429
|
-
|
|
430
|
-
## Troubleshooting
|
|
431
|
-
|
|
432
|
-
**No traces appearing:**
|
|
433
|
-
- Check collector endpoint
|
|
434
|
-
- Verify network connectivity
|
|
435
|
-
- Check sampling configuration
|
|
436
|
-
- Review application logs
|
|
437
|
-
|
|
438
|
-
**High latency overhead:**
|
|
439
|
-
- Reduce sampling rate
|
|
440
|
-
- Use batch span processor
|
|
441
|
-
- Check exporter configuration
|
|
442
|
-
|
|
443
|
-
## Reference Files
|
|
444
|
-
|
|
445
|
-
- `references/jaeger-setup.md` - Jaeger installation
|
|
446
|
-
- `references/instrumentation.md` - Instrumentation patterns
|
|
447
|
-
- `assets/jaeger-config.yaml.template` - Jaeger configuration
|
|
39
|
+
## Limitations
|
|
448
40
|
|
|
449
|
-
|
|
41
|
+
Head sampling can discard errors before tail sampling sees them. In-memory demos do not prove durable storage. Context propagation and cross-service clocks need actual integration tests; this guide is not a runnable multi-service application.
|
|
450
42
|
|
|
451
|
-
|
|
452
|
-
- `grafana-dashboards` - For visualization
|
|
453
|
-
- `slo-implementation` - For latency SLOs
|
|
43
|
+
## Sources
|
|
454
44
|
|
|
455
|
-
|
|
456
|
-
- Use this skill only when the task clearly matches the scope described above.
|
|
457
|
-
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
|
|
458
|
-
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
|
|
45
|
+
- [OpenTelemetry exporter documentation](https://opentelemetry.io/docs/languages/python/exporters/) — use the installed SDK's matching documentation.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Instrumentation checks
|
|
2
|
+
|
|
3
|
+
## Inputs
|
|
4
|
+
|
|
5
|
+
Choose the installed OpenTelemetry SDK and matching exporter. Initialize before instrumented libraries and use OTLP for the configured collector transport.
|
|
6
|
+
|
|
7
|
+
## Procedure and verification
|
|
8
|
+
|
|
9
|
+
Follow one request across two services. Assert trace identity and parent-child relationships, exercise an exception, and flush on orderly shutdown. Allowlist low-cardinality operation attributes; exclude credentials, raw payloads and sensitive query values. Verify exporter failures do not make the application request fail.
|
|
10
|
+
|
|
11
|
+
## Limitations
|
|
12
|
+
|
|
13
|
+
A local span is not proof of context propagation. Sampling and queue overflow can discard traces; test the actual failure and shutdown behavior.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Jaeger integration checklist
|
|
2
|
+
|
|
3
|
+
## Inputs
|
|
4
|
+
|
|
5
|
+
Record the installed Jaeger version, storage backend, retention, query access and OTLP transport. Use that version's deployment guide; the collector endpoint and query UI are different services.
|
|
6
|
+
|
|
7
|
+
## Procedure and verification
|
|
8
|
+
|
|
9
|
+
Prepare configuration in a disposable environment. Restrict listeners and query access, use transport protection appropriate to the network, and verify storage credentials without exposing them in manifests. Send a synthetic trace and locate it through the query interface. Restart the disposable instance to check the chosen persistence behavior.
|
|
10
|
+
|
|
11
|
+
## Limitations
|
|
12
|
+
|
|
13
|
+
An in-memory demonstration is not durable production storage. A healthy UI does not prove ingestion, retention or authorization. Record the exact tested configuration and rollback path.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Tracing integration playbook
|
|
2
|
+
|
|
3
|
+
## Inputs
|
|
4
|
+
|
|
5
|
+
Service graph, installed SDK versions, allowed collector endpoint, representative requests and telemetry policy.
|
|
6
|
+
|
|
7
|
+
## Procedure
|
|
8
|
+
|
|
9
|
+
1. Map one request through entrypoint, outbound call and downstream handler. Use the same propagation format and distinguish service identity from operation names.
|
|
10
|
+
2. Configure the SDK and exporter before instrumented libraries load. Use a bounded batch queue and graceful shutdown. Allowlist attributes and omit credentials, raw SQL values and request bodies.
|
|
11
|
+
3. Send one successful and one failed staging request. Verify connected spans, duration units, expected service names and exporter failures. Measure overhead before choosing a sampling rate.
|
|
12
|
+
|
|
13
|
+
## Worked example
|
|
14
|
+
|
|
15
|
+
A checkout calls inventory and payment. Locate both calls under the checkout trace and ensure a timeout is visible without recording payment data.
|
|
16
|
+
|
|
17
|
+
## Verification and handoff
|
|
18
|
+
|
|
19
|
+
Report the actual files or configuration changed, checks performed, observed results and any untested environment. Keep the original inputs and evidence sufficient to reproduce the conclusion.
|
|
20
|
+
|
|
21
|
+
## Limitations
|
|
22
|
+
|
|
23
|
+
Sampling may drop an error before a later collector sees it. Never promise complete error retention from a head-sampled stream.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Django feature implementation
|
|
2
|
+
|
|
3
|
+
## Inputs
|
|
4
|
+
|
|
5
|
+
Installed Django/DRF versions, models, permissions, database backend and existing test commands.
|
|
6
|
+
|
|
7
|
+
## Procedure
|
|
8
|
+
|
|
9
|
+
1. Trace the endpoint through middleware, view, serializer and queryset. Reuse the project's authentication and transaction boundaries.
|
|
10
|
+
2. Implement the smallest change and a migration only when needed. Scope list and detail querysets by tenant; validate writes and use server-owned fields for ownership.
|
|
11
|
+
3. Test authorized and unauthorized access, validation failure and rollback. Inspect query count and migration behavior on a disposable database before preparing deployment.
|
|
12
|
+
|
|
13
|
+
## Worked example
|
|
14
|
+
|
|
15
|
+
Add a project notes endpoint. Test that another tenant cannot list, retrieve or create notes in that project; verify the allowed user can.
|
|
16
|
+
|
|
17
|
+
## Verification and handoff
|
|
18
|
+
|
|
19
|
+
Report the actual files or configuration changed, checks performed, observed results and any untested environment. Keep the original inputs and evidence sufficient to reproduce the conclusion.
|
|
20
|
+
|
|
21
|
+
## Limitations
|
|
22
|
+
|
|
23
|
+
Async views do not make synchronous database work non-blocking. Check the installed framework's supported async and transaction behavior.
|