oh-my-agent-commandcode 0.0.0-stage → 20.38.3
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/README.md +35 -2
- package/filter-test-output.sh +52 -0
- package/mods/oma.ts +347 -0
- package/package.json +30 -4
- package/skills/_shared/conditional/experiment-ledger.md +28 -0
- package/skills/_shared/conditional/exploration-loop.md +22 -0
- package/skills/_shared/conditional/quality-score.md +33 -0
- package/skills/_shared/core/anti-ai-prose.md +191 -0
- package/skills/_shared/core/api-contracts/README.md +28 -0
- package/skills/_shared/core/api-contracts/template.md +90 -0
- package/skills/_shared/core/clarification-protocol.md +23 -0
- package/skills/_shared/core/code-intelligence.md +46 -0
- package/skills/_shared/core/collaboration-policy.md +28 -0
- package/skills/_shared/core/common-checklist.md +28 -0
- package/skills/_shared/core/context-budget.md +22 -0
- package/skills/_shared/core/context-loading.md +34 -0
- package/skills/_shared/core/difficulty-guide.md +26 -0
- package/skills/_shared/core/execution-policy.md +31 -0
- package/skills/_shared/core/lessons-learned.md +33 -0
- package/skills/_shared/core/prompt-structure.md +18 -0
- package/skills/_shared/core/quality-principles.md +11 -0
- package/skills/_shared/core/session-metrics.md +35 -0
- package/skills/_shared/core/skill-routing.md +39 -0
- package/skills/_shared/core/test-approach.md +54 -0
- package/skills/_shared/core/vendor-detection.md +52 -0
- package/skills/_shared/runtime/memory-protocol.md +118 -0
- package/skills/_shared/runtime/result-contract.md +64 -0
- package/skills/_shared/ui-interaction-quality.md +133 -0
- package/skills/oma-academic-writing/SKILL.md +181 -0
- package/skills/oma-academic-writing/resources/abstract-guide.md +51 -0
- package/skills/oma-academic-writing/resources/academic-verb-tiers.md +42 -0
- package/skills/oma-academic-writing/resources/anti-ai-checklist.md +52 -0
- package/skills/oma-academic-writing/resources/hedging-guide.md +132 -0
- package/skills/oma-academic-writing/resources/sentence-structure-reference.md +151 -0
- package/skills/oma-architecture/SKILL.md +203 -0
- package/skills/oma-architecture/resources/api-evolution.md +41 -0
- package/skills/oma-architecture/resources/checklist.md +42 -0
- package/skills/oma-architecture/resources/execution-protocol.md +115 -0
- package/skills/oma-architecture/resources/methodology-selection.md +92 -0
- package/skills/oma-architecture/resources/migration-patterns.md +28 -0
- package/skills/oma-architecture/resources/output-templates.md +111 -0
- package/skills/oma-architecture/resources/stakeholder-synthesis.md +80 -0
- package/skills/oma-backend/SKILL.md +202 -0
- package/skills/oma-backend/resources/checklist.md +45 -0
- package/skills/oma-backend/resources/error-playbook.md +97 -0
- package/skills/oma-backend/resources/execution-protocol.md +39 -0
- package/skills/oma-backend/resources/orm-reference.md +61 -0
- package/skills/oma-backend/variants/node/api-template.ts +315 -0
- package/skills/oma-backend/variants/node/snippets.md +475 -0
- package/skills/oma-backend/variants/node/stack.yaml +21 -0
- package/skills/oma-backend/variants/node/tech-stack.md +33 -0
- package/skills/oma-backend/variants/python/api-template.py +378 -0
- package/skills/oma-backend/variants/python/snippets.md +199 -0
- package/skills/oma-backend/variants/python/stack.yaml +18 -0
- package/skills/oma-backend/variants/python/tech-stack.md +45 -0
- package/skills/oma-backend/variants/rust/api-template.rs +635 -0
- package/skills/oma-backend/variants/rust/snippets.md +471 -0
- package/skills/oma-backend/variants/rust/stack.yaml +20 -0
- package/skills/oma-backend/variants/rust/tech-stack.md +36 -0
- package/skills/oma-backend/variants/stack.schema.json +73 -0
- package/skills/oma-brainstorm/SKILL.md +166 -0
- package/skills/oma-brainstorm/resources/triz-lite.md +117 -0
- package/skills/oma-coordination/SKILL.md +171 -0
- package/skills/oma-db/SKILL.md +201 -0
- package/skills/oma-db/resources/anti-patterns.md +177 -0
- package/skills/oma-db/resources/checklist.md +67 -0
- package/skills/oma-db/resources/document-templates.md +107 -0
- package/skills/oma-db/resources/error-playbook.md +50 -0
- package/skills/oma-db/resources/examples.md +170 -0
- package/skills/oma-db/resources/execution-protocol.md +127 -0
- package/skills/oma-db/resources/iso-controls.md +98 -0
- package/skills/oma-db/resources/migration-playbook.md +93 -0
- package/skills/oma-db/resources/query-tuning.md +57 -0
- package/skills/oma-db/resources/vector-db.md +159 -0
- package/skills/oma-debug/SKILL.md +146 -0
- package/skills/oma-debug/resources/bug-report-template.md +327 -0
- package/skills/oma-debug/resources/checklist.md +31 -0
- package/skills/oma-debug/resources/common-patterns.md +734 -0
- package/skills/oma-debug/resources/debugging-checklist.md +364 -0
- package/skills/oma-debug/resources/error-playbook.md +94 -0
- package/skills/oma-debug/resources/execution-protocol.md +40 -0
- package/skills/oma-design/SKILL.md +135 -0
- package/skills/oma-design/resources/asset-strategy.md +34 -0
- package/skills/oma-design/resources/checklist.md +63 -0
- package/skills/oma-design/resources/data-grid.md +48 -0
- package/skills/oma-design/resources/design-md-spec.md +107 -0
- package/skills/oma-design/resources/design-tokens.md +53 -0
- package/skills/oma-design/resources/error-playbook.md +18 -0
- package/skills/oma-design/resources/execution-protocol.md +95 -0
- package/skills/oma-design/resources/external-design-skills.md +130 -0
- package/skills/oma-design/resources/getdesign-fetcher.md +104 -0
- package/skills/oma-design/resources/product-interface-review.md +59 -0
- package/skills/oma-design/resources/redesign-protocol.md +52 -0
- package/skills/oma-design/resources/stitch-integration.md +244 -0
- package/skills/oma-dev-workflow/SKILL.md +375 -0
- package/skills/oma-dev-workflow/resources/affected-checks.py +58 -0
- package/skills/oma-dev-workflow/resources/api-workflows.md +58 -0
- package/skills/oma-dev-workflow/resources/database-patterns.md +107 -0
- package/skills/oma-dev-workflow/resources/i18n-patterns.md +63 -0
- package/skills/oma-dev-workflow/resources/release-coordination.md +240 -0
- package/skills/oma-dev-workflow/resources/tooling-profiles.md +217 -0
- package/skills/oma-dev-workflow/resources/troubleshooting.md +78 -0
- package/skills/oma-dev-workflow/resources/validation-pipeline.md +246 -0
- package/skills/oma-docs/SKILL.md +77 -0
- package/skills/oma-docs/resources/commands.md +76 -0
- package/skills/oma-explanation/SKILL.md +212 -0
- package/skills/oma-explanation/resources/document-structure.md +115 -0
- package/skills/oma-explanation/resources/draft-format.md +199 -0
- package/skills/oma-explanation/resources/html-contract.md +102 -0
- package/skills/oma-frontend/SKILL.md +227 -0
- package/skills/oma-frontend/resources/angular-rules.md +110 -0
- package/skills/oma-frontend/resources/checklist.md +76 -0
- package/skills/oma-frontend/resources/error-playbook.md +125 -0
- package/skills/oma-frontend/resources/execution-protocol.md +46 -0
- package/skills/oma-frontend/resources/snippets.md +354 -0
- package/skills/oma-frontend/resources/specialized-visual-implementation.md +193 -0
- package/skills/oma-frontend/resources/tailwind-rules.md +83 -0
- package/skills/oma-frontend/resources/tech-stack.md +156 -0
- package/skills/oma-hwp/SKILL.md +166 -0
- package/skills/oma-hwp/config/hwp-config.yaml +35 -0
- package/skills/oma-hwp/resources/balanced-tables.ts +39 -0
- package/skills/oma-hwp/resources/execution-protocol.md +145 -0
- package/skills/oma-hwp/resources/flatten-tables.ts +101 -0
- package/skills/oma-hwp/resources/package.json +13 -0
- package/skills/oma-hwp/resources/troubleshooting.md +70 -0
- package/skills/oma-hwp/resources/tsconfig.json +10 -0
- package/skills/oma-hwp/resources/turndown-plugin-gfm.d.ts +9 -0
- package/skills/oma-image/SKILL.md +142 -0
- package/skills/oma-image/config/image-config.yaml +70 -0
- package/skills/oma-image/resources/checklist.md +18 -0
- package/skills/oma-image/resources/execution-protocol.md +117 -0
- package/skills/oma-image/resources/invocation.md +105 -0
- package/skills/oma-image/resources/prompt-tips.md +71 -0
- package/skills/oma-image/resources/vendor-matrix.md +90 -0
- package/skills/oma-market/SKILL.md +142 -0
- package/skills/oma-market/resources/checklist.md +12 -0
- package/skills/oma-market/resources/error-playbook.md +12 -0
- package/skills/oma-market/resources/execution-protocol.md +60 -0
- package/skills/oma-market/resources/frameworks/pestel.md +101 -0
- package/skills/oma-market/resources/frameworks/porters-5f.md +90 -0
- package/skills/oma-market/resources/frameworks/swot.md +61 -0
- package/skills/oma-market/resources/intent-rules.md +35 -0
- package/skills/oma-market/resources/output-laws.md +53 -0
- package/skills/oma-mobile/SKILL.md +168 -0
- package/skills/oma-mobile/resources/checklist.md +77 -0
- package/skills/oma-mobile/resources/error-playbook.md +198 -0
- package/skills/oma-mobile/resources/execution-protocol.md +47 -0
- package/skills/oma-mobile/resources/screen-template.dart +331 -0
- package/skills/oma-mobile/resources/screen-template.swift +239 -0
- package/skills/oma-mobile/resources/screen-template.tsx +179 -0
- package/skills/oma-mobile/resources/tech-stack.md +69 -0
- package/skills/oma-mobile/variants/README.md +45 -0
- package/skills/oma-mobile/variants/flutter/api-template.dart +461 -0
- package/skills/oma-mobile/variants/flutter/snippets.md +1353 -0
- package/skills/oma-mobile/variants/flutter/stack.yaml +21 -0
- package/skills/oma-mobile/variants/flutter/tech-stack.md +201 -0
- package/skills/oma-mobile/variants/kotlin-android/api-template.kt +182 -0
- package/skills/oma-mobile/variants/kotlin-android/snippets.md +871 -0
- package/skills/oma-mobile/variants/kotlin-android/stack.yaml +32 -0
- package/skills/oma-mobile/variants/kotlin-android/tech-stack.md +159 -0
- package/skills/oma-mobile/variants/react-native/api-template.ts +531 -0
- package/skills/oma-mobile/variants/react-native/snippets.md +1014 -0
- package/skills/oma-mobile/variants/react-native/stack.yaml +22 -0
- package/skills/oma-mobile/variants/react-native/tech-stack.md +192 -0
- package/skills/oma-mobile/variants/stack.schema.json +68 -0
- package/skills/oma-mobile/variants/swift-ios/api-template.swift +165 -0
- package/skills/oma-mobile/variants/swift-ios/snippets.md +1028 -0
- package/skills/oma-mobile/variants/swift-ios/stack.yaml +25 -0
- package/skills/oma-mobile/variants/swift-ios/tech-stack.md +174 -0
- package/skills/oma-observability/SKILL.md +225 -0
- package/skills/oma-observability/resources/anti-patterns.md +555 -0
- package/skills/oma-observability/resources/boundaries/cross-application.md +348 -0
- package/skills/oma-observability/resources/boundaries/multi-tenant.md +290 -0
- package/skills/oma-observability/resources/boundaries/release.md +372 -0
- package/skills/oma-observability/resources/boundaries/slo.md +225 -0
- package/skills/oma-observability/resources/checklist.md +123 -0
- package/skills/oma-observability/resources/examples.md +448 -0
- package/skills/oma-observability/resources/execution-protocol.md +166 -0
- package/skills/oma-observability/resources/incident-forensics.md +348 -0
- package/skills/oma-observability/resources/intent-rules.md +307 -0
- package/skills/oma-observability/resources/layers/L3-network.md +281 -0
- package/skills/oma-observability/resources/layers/L4-transport.md +299 -0
- package/skills/oma-observability/resources/layers/L7-application/crash-analytics.md +359 -0
- package/skills/oma-observability/resources/layers/L7-application/mobile-rum.md +278 -0
- package/skills/oma-observability/resources/layers/L7-application/waf.md +246 -0
- package/skills/oma-observability/resources/layers/L7-application/web-rum.md +350 -0
- package/skills/oma-observability/resources/layers/mesh.md +368 -0
- package/skills/oma-observability/resources/matrix.md +177 -0
- package/skills/oma-observability/resources/meta-observability.md +605 -0
- package/skills/oma-observability/resources/observability-as-code.md +666 -0
- package/skills/oma-observability/resources/signals/audit.md +310 -0
- package/skills/oma-observability/resources/signals/cost.md +303 -0
- package/skills/oma-observability/resources/signals/logs.md +263 -0
- package/skills/oma-observability/resources/signals/metrics.md +478 -0
- package/skills/oma-observability/resources/signals/privacy.md +351 -0
- package/skills/oma-observability/resources/signals/profiles.md +245 -0
- package/skills/oma-observability/resources/signals/traces.md +360 -0
- package/skills/oma-observability/resources/standards.md +214 -0
- package/skills/oma-observability/resources/transport/collector-topology.md +308 -0
- package/skills/oma-observability/resources/transport/otlp-grpc-vs-http.md +256 -0
- package/skills/oma-observability/resources/transport/sampling-recipes.md +297 -0
- package/skills/oma-observability/resources/transport/udp-statsd-mtu.md +167 -0
- package/skills/oma-observability/resources/vendor-categories.md +352 -0
- package/skills/oma-orchestration/SKILL.md +302 -0
- package/skills/oma-orchestration/config/cli-config.yaml +92 -0
- package/skills/oma-orchestration/resources/memory-schema.md +232 -0
- package/skills/oma-orchestration/resources/subagent-prompt-template.md +30 -0
- package/skills/oma-orchestration/scripts/parallel-run.sh +6 -0
- package/skills/oma-orchestration/scripts/spawn-agent.sh +5 -0
- package/skills/oma-orchestration/scripts/verify.sh +20 -0
- package/skills/oma-orchestration/templates/backend-task.md +19 -0
- package/skills/oma-orchestration/templates/debug-task.md +16 -0
- package/skills/oma-orchestration/templates/frontend-task.md +18 -0
- package/skills/oma-orchestration/templates/mobile-task.md +18 -0
- package/skills/oma-orchestration/templates/qa-task.md +16 -0
- package/skills/oma-orchestration/templates/tasks-example.yaml +15 -0
- package/skills/oma-pdf/SKILL.md +162 -0
- package/skills/oma-pdf/config/pdf-config.yaml +27 -0
- package/skills/oma-pdf/resources/execution-protocol.md +127 -0
- package/skills/oma-pm/SKILL.md +157 -0
- package/skills/oma-pm/resources/error-playbook.md +75 -0
- package/skills/oma-pm/resources/examples.md +439 -0
- package/skills/oma-pm/resources/execution-protocol.md +62 -0
- package/skills/oma-pm/resources/iso-planning.md +110 -0
- package/skills/oma-pm/resources/plan-phase-protocol.md +66 -0
- package/skills/oma-pm/resources/task-template.json +86 -0
- package/skills/oma-qa/SKILL.md +141 -0
- package/skills/oma-qa/resources/checklist.md +339 -0
- package/skills/oma-qa/resources/error-playbook.md +98 -0
- package/skills/oma-qa/resources/execution-protocol.md +169 -0
- package/skills/oma-qa/resources/iso-quality.md +82 -0
- package/skills/oma-qa/resources/verify-ship-protocol.md +116 -0
- package/skills/oma-recap/SKILL.md +245 -0
- package/skills/oma-recap/resources/output-formats.md +83 -0
- package/skills/oma-refactor/SKILL.md +184 -0
- package/skills/oma-refactor/resources/definition.md +108 -0
- package/skills/oma-refactor/resources/governance.md +33 -0
- package/skills/oma-refactor/resources/hotspots.py +44 -0
- package/skills/oma-refactor/resources/measurement.md +93 -0
- package/skills/oma-scholar/SKILL.md +276 -0
- package/skills/oma-scholar/config/scholar-config.yaml +79 -0
- package/skills/oma-scholar/resources/api-endpoints.md +174 -0
- package/skills/oma-scholar/resources/checklist.md +92 -0
- package/skills/oma-scholar/resources/execution-protocol.md +224 -0
- package/skills/oma-scholar/resources/fallback-providers.md +143 -0
- package/skills/oma-scholar/resources/setup-openalex.md +85 -0
- package/skills/oma-scholar/resources/sidecar-spec.md +341 -0
- package/skills/oma-scholar/resources/upstream-spec-cache.md +972 -0
- package/skills/oma-scm/SKILL.md +103 -0
- package/skills/oma-scm/resources/cm-operations.md +56 -0
- package/skills/oma-scm/resources/codeowners-playbook.md +45 -0
- package/skills/oma-scm/resources/conventional-commits.md +108 -0
- package/skills/oma-scm/resources/merge-risk.md +76 -0
- package/skills/oma-scm/resources/onboarding-risk-signals.md +71 -0
- package/skills/oma-search/SKILL.md +125 -0
- package/skills/oma-search/resources/checklist.md +36 -0
- package/skills/oma-search/resources/error-playbook.md +66 -0
- package/skills/oma-search/resources/examples.md +80 -0
- package/skills/oma-search/resources/execution-protocol.md +86 -0
- package/skills/oma-search/resources/intent-rules.md +47 -0
- package/skills/oma-search/resources/trust-registry.md +53 -0
- package/skills/oma-security/SKILL.md +172 -0
- package/skills/oma-security/resources/artex.md +108 -0
- package/skills/oma-security/resources/ci.md +134 -0
- package/skills/oma-security/resources/cisco-source.md +108 -0
- package/skills/oma-security/resources/deepsec-config.md +45 -0
- package/skills/oma-security/resources/deepsec-matchers.md +35 -0
- package/skills/oma-security/resources/deepsec-scanning.md +45 -0
- package/skills/oma-security/resources/deepsec-setup.md +41 -0
- package/skills/oma-security/resources/findings-contract.md +408 -0
- package/skills/oma-security/resources/mcp-scanning.md +122 -0
- package/skills/oma-security/resources/skill-scanning.md +106 -0
- package/skills/oma-security/resources/validation.md +71 -0
- package/skills/oma-skill-creation/SKILL.md +84 -0
- package/skills/oma-skill-creation/resources/prompt-evaluation.md +36 -0
- package/skills/oma-skill-creation/resources/ssl-lite-template.md +108 -0
- package/skills/oma-skill-creation/resources/validation-checklist.md +101 -0
- package/skills/oma-slide/SKILL.md +277 -0
- package/skills/oma-slide/resources/animation-patterns.md +245 -0
- package/skills/oma-slide/resources/assets/deck-stage.js +514 -0
- package/skills/oma-slide/resources/assets/viewport-base.css +257 -0
- package/skills/oma-slide/resources/canva-integration.md +203 -0
- package/skills/oma-slide/resources/checklist.md +46 -0
- package/skills/oma-slide/resources/design-doctrine.md +260 -0
- package/skills/oma-slide/resources/fixed-stage.md +232 -0
- package/skills/oma-slide/resources/generation-protocol.md +393 -0
- package/skills/oma-slide/resources/native-pptx.md +84 -0
- package/skills/oma-slide/resources/selection-index.json +461 -0
- package/skills/oma-slide/resources/style-presets.LICENSE +10 -0
- package/skills/oma-slide/resources/style-presets.md +520 -0
- package/skills/oma-tf-infra/SKILL.md +201 -0
- package/skills/oma-tf-infra/resources/checklist.md +53 -0
- package/skills/oma-tf-infra/resources/cost-optimization.md +574 -0
- package/skills/oma-tf-infra/resources/error-playbook.md +68 -0
- package/skills/oma-tf-infra/resources/examples.md +38 -0
- package/skills/oma-tf-infra/resources/execution-protocol.md +129 -0
- package/skills/oma-tf-infra/resources/iso-42001-infra.md +229 -0
- package/skills/oma-tf-infra/resources/multi-cloud-examples.md +241 -0
- package/skills/oma-tf-infra/resources/policy-testing-examples.md +332 -0
- package/skills/oma-translation/SKILL.md +229 -0
- package/skills/oma-translation/resources/anti-ai-patterns.md +104 -0
- package/skills/oma-translation/resources/lang/_template.md +73 -0
- package/skills/oma-translation/resources/lang/en.md +123 -0
- package/skills/oma-translation/resources/lang/ja.md +274 -0
- package/skills/oma-translation/resources/lang/ko.md +228 -0
- package/skills/oma-translation/resources/lang/zh.md +285 -0
- package/skills/oma-translation/resources/style-skills.md +104 -0
- package/skills/oma-translation/resources/translation-rubric.md +126 -0
- package/skills/oma-video/SKILL.md +229 -0
- package/skills/oma-video/config/video-config.yaml +60 -0
- package/skills/oma-video/resources/checklist.md +26 -0
- package/skills/oma-video/resources/execution-protocol.md +122 -0
- package/skills/oma-video/resources/existing-media.md +185 -0
- package/skills/oma-video/resources/hyperframes-authoring/README.md +44 -0
- package/skills/oma-video/resources/hyperframes-authoring/demo.md +31 -0
- package/skills/oma-video/resources/hyperframes-authoring/explainer.md +10 -0
- package/skills/oma-video/resources/hyperframes-authoring/shorts.md +10 -0
- package/skills/oma-video/resources/motion-principles.md +81 -0
- package/skills/oma-video/resources/mpt/driver.py +301 -0
- package/skills/oma-video/resources/prompt-tips.md +75 -0
- package/skills/oma-video/resources/script-schema.md +81 -0
- package/skills/oma-video/resources/sound-design.md +127 -0
- package/skills/oma-video/resources/strudel/package.json +11 -0
- package/skills/oma-video/resources/strudel/page.html +87 -0
- package/skills/oma-video/resources/strudel/render.mjs +295 -0
- package/skills/oma-video/resources/vendor-matrix.md +124 -0
- package/skills/oma-voice/SKILL.md +249 -0
- package/skills/oma-voice/config/voice-config.yaml +30 -0
- package/skills/oma-voice/resources/audio-processing.md +119 -0
- package/skills/oma-voice/resources/checklist.md +47 -0
- package/skills/oma-voice/resources/execution-protocol.md +215 -0
- package/skills/oma-voice/resources/prompt-tips.md +43 -0
- package/skills/oma-voice/resources/voice-matrix.md +51 -0
- package/skills/oma-voice/resources/voicestudio.md +87 -0
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
---
|
|
2
|
+
otel_spec: "1.x (stable API/SDK)"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Sampling Recipes: Tail-Based, Cost-Aware, and Tenant-Aware
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 1. Sampling Taxonomy
|
|
11
|
+
|
|
12
|
+
| Type | Where Decision Is Made | Trace Completeness | Typical Use |
|
|
13
|
+
|------|----------------------|-------------------|-------------|
|
|
14
|
+
| **Head-based** | At trace start (first span) | May be incomplete; downstream services inherit decision but cannot guarantee it | Simple, low-overhead; works well for single-service or homogeneous traffic |
|
|
15
|
+
| **Tail-based** | After all spans arrive (end of trace) | Complete; sampler buffers spans until decision | Production multi-service; required for error/latency policies |
|
|
16
|
+
| **Adaptive** | Dynamic rate based on traffic volume | Depends on implementation | Auto-scaling sampling rate under variable load |
|
|
17
|
+
|
|
18
|
+
**Head-based limitation**: If a service at hop 2 is sampled out but hop 1 was sampled in (or vice versa), the reconstructed trace is missing spans. This is the core motivation for tail-based sampling in multi-service systems.
|
|
19
|
+
|
|
20
|
+
**Tail-based trade-off**: The sampler must buffer all spans for a trace until a decision is made (default `decision_wait: 30s`). Memory usage scales with trace volume and decision wait duration.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 2. Tail-Based Recipe (Recommended for Production)
|
|
25
|
+
|
|
26
|
+
The production-standard recipe retains high-signal traces at 100% while keeping a low-rate baseline for ambient visibility.
|
|
27
|
+
|
|
28
|
+
**Positive retention policies** (default positive decisions combine as OR; ordering is not first-match priority. An `and` policy requires its subconditions to match):
|
|
29
|
+
|
|
30
|
+
1. **100% error retention**: any trace with an error span is always kept
|
|
31
|
+
2. **100% cost/latency threshold retention**: traces meeting the configured per-span cost or trace-duration threshold are kept
|
|
32
|
+
3. **5-10% baseline**: probabilistic sampling also evaluates traces; it adds baseline retention alongside the other policies
|
|
33
|
+
|
|
34
|
+
This requires the `tail_sampling` processor running in the **gateway tier only**, combined with a `loadbalancing` exporter upstream to ensure trace completeness via consistent hash by `trace_id`. See `collector-topology.md` Section 6.
|
|
35
|
+
|
|
36
|
+
```yaml
|
|
37
|
+
processors:
|
|
38
|
+
tail_sampling:
|
|
39
|
+
decision_wait: 30s # wait up to 30s for all spans to arrive
|
|
40
|
+
num_traces: 100000 # in-memory trace buffer capacity
|
|
41
|
+
expected_new_traces_per_sec: 1000
|
|
42
|
+
policies:
|
|
43
|
+
# Policy 1: Always keep traces with errors
|
|
44
|
+
- name: keep-errors
|
|
45
|
+
type: status_code
|
|
46
|
+
status_code:
|
|
47
|
+
status_codes: [ERROR]
|
|
48
|
+
|
|
49
|
+
# Policy 2: Always keep high-latency traces (p99 threshold)
|
|
50
|
+
- name: keep-slow-traces
|
|
51
|
+
type: latency
|
|
52
|
+
latency:
|
|
53
|
+
threshold_ms: 2000 # trace duration: earliest span start to latest span end
|
|
54
|
+
|
|
55
|
+
# Policy 3: Always keep high-cost LLM traces (see Section 3)
|
|
56
|
+
- name: keep-high-cost
|
|
57
|
+
type: string_attribute
|
|
58
|
+
string_attribute:
|
|
59
|
+
key: sampling.keep_reason
|
|
60
|
+
values: ["high_cost"]
|
|
61
|
+
|
|
62
|
+
# Policy 4: Baseline probabilistic sampling alongside the positive policies
|
|
63
|
+
- name: baseline-sample
|
|
64
|
+
type: probabilistic
|
|
65
|
+
probabilistic:
|
|
66
|
+
sampling_percentage: 8 # 5-10% baseline
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
> For these positive policies, any keep decision retains the trace (OR), regardless of policy order. `and` combines its own subconditions. Drop/inverted policies and optional early-decision behavior have additional semantics; verify them against the pinned processor README before use.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 3. Cost-Aware Sampling (LLM / FinOps Context)
|
|
74
|
+
|
|
75
|
+
LLM workloads (OpenAI, Anthropic, Bedrock, Vertex AI) attach cost attributes to spans. These should be treated as first-class sampling dimensions.
|
|
76
|
+
|
|
77
|
+
**Relevant span attributes** (token attributes follow GenAI semantic conventions; USD cost attributes below are custom, team-defined):
|
|
78
|
+
- `gen_ai.usage.input_tokens`: prompt token count
|
|
79
|
+
- `gen_ai.usage.output_tokens`: completion token count
|
|
80
|
+
- `llm.request.cost_usd`: custom per-span estimated cost, if implemented by the team
|
|
81
|
+
- `gen_ai.cost.total_usd`: custom cost for the operation/span; define its scope explicitly
|
|
82
|
+
|
|
83
|
+
**Strategy shown below**: retain a trace when any individual span carries cost above $0.50. This is not cumulative trace cost: two $0.30 spans will not qualify. Trace-level cumulative cost requires a separately implemented and verified aggregation that supplies the final total before the sampling decision.
|
|
84
|
+
|
|
85
|
+
The native `numeric_attribute` policy supports span-attribute bounds (`min_value`/`max_value`). The transform below normalizes two custom cost keys into one keep-reason attribute. Use it for that normalization; native numeric comparison is also available:
|
|
86
|
+
|
|
87
|
+
```yaml
|
|
88
|
+
processors:
|
|
89
|
+
transform/cost_annotation:
|
|
90
|
+
trace_statements:
|
|
91
|
+
- context: span
|
|
92
|
+
statements:
|
|
93
|
+
# If this span cost exceeds the threshold, annotate it for trace retention
|
|
94
|
+
- set(attributes["sampling.keep_reason"], "high_cost")
|
|
95
|
+
where attributes["llm.request.cost_usd"] > 0.50
|
|
96
|
+
- set(attributes["sampling.keep_reason"], "high_cost")
|
|
97
|
+
where attributes["gen_ai.cost.total_usd"] > 0.50
|
|
98
|
+
|
|
99
|
+
tail_sampling:
|
|
100
|
+
decision_wait: 30s
|
|
101
|
+
policies:
|
|
102
|
+
- name: keep-high-cost
|
|
103
|
+
type: string_attribute
|
|
104
|
+
string_attribute:
|
|
105
|
+
key: sampling.keep_reason
|
|
106
|
+
values: ["high_cost"]
|
|
107
|
+
- name: keep-errors
|
|
108
|
+
type: status_code
|
|
109
|
+
status_code:
|
|
110
|
+
status_codes: [ERROR]
|
|
111
|
+
- name: baseline
|
|
112
|
+
type: probabilistic
|
|
113
|
+
probabilistic:
|
|
114
|
+
sampling_percentage: 8
|
|
115
|
+
|
|
116
|
+
service:
|
|
117
|
+
pipelines:
|
|
118
|
+
traces:
|
|
119
|
+
processors: [transform/cost_annotation, tail_sampling]
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## 4. Tenant-Aware Sampling (Multi-Tenant B2B SaaS)
|
|
125
|
+
|
|
126
|
+
Different customer tiers have different observability value. Enterprise customers justify full retention; free tier customers do not.
|
|
127
|
+
|
|
128
|
+
**Per-tier retention targets**:
|
|
129
|
+
|
|
130
|
+
| Tenant Tier | Retention Rate | Rationale |
|
|
131
|
+
|------------|---------------|-----------|
|
|
132
|
+
| `enterprise` | 100% | SLA obligations, full debugging capability |
|
|
133
|
+
| `pro` | 20% | Representative sample, cost-controlled |
|
|
134
|
+
| `free` | 2% | Ambient visibility only |
|
|
135
|
+
|
|
136
|
+
**Option A: `routing_connector` for per-tenant pipeline branching**
|
|
137
|
+
|
|
138
|
+
The `routing_connector` routes telemetry to different pipelines based on attribute values, allowing different `tail_sampling` configurations per tenant tier.
|
|
139
|
+
|
|
140
|
+
> Alpha stability warning: `routing_connector` is in **alpha** as of 2025. The API and behavior may change in minor releases. Verify the pinned connector version before using it. If stability requirements preclude it, use separately configured collector/exporter pipelines or dedicated collectors for isolation. Option B changes retention in a shared pipeline only; it does not replace routing.
|
|
141
|
+
|
|
142
|
+
```yaml
|
|
143
|
+
connectors:
|
|
144
|
+
routing:
|
|
145
|
+
default_pipelines: [traces/pro] # fallback if no rule matches
|
|
146
|
+
error_mode: ignore
|
|
147
|
+
table:
|
|
148
|
+
- statement: route() where attributes["tenant.tier"] == "enterprise"
|
|
149
|
+
pipelines: [traces/enterprise]
|
|
150
|
+
- statement: route() where attributes["tenant.tier"] == "free"
|
|
151
|
+
pipelines: [traces/free]
|
|
152
|
+
|
|
153
|
+
service:
|
|
154
|
+
pipelines:
|
|
155
|
+
traces/input:
|
|
156
|
+
receivers: [otlp]
|
|
157
|
+
exporters: [routing]
|
|
158
|
+
|
|
159
|
+
traces/enterprise:
|
|
160
|
+
receivers: [routing]
|
|
161
|
+
processors: [tail_sampling/enterprise]
|
|
162
|
+
exporters: [otlp/backend]
|
|
163
|
+
|
|
164
|
+
traces/pro:
|
|
165
|
+
receivers: [routing]
|
|
166
|
+
processors: [tail_sampling/pro]
|
|
167
|
+
exporters: [otlp/backend]
|
|
168
|
+
|
|
169
|
+
traces/free:
|
|
170
|
+
receivers: [routing]
|
|
171
|
+
processors: [tail_sampling/free]
|
|
172
|
+
exporters: [otlp/backend]
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Option B: `tail_sampling` with per-tier policies in a shared pipeline**
|
|
176
|
+
|
|
177
|
+
Use composite `and` policies combining tenant tier with probabilistic sampling. This controls retention only; it neither splits export pipelines nor isolates tenant data. Validate that each trace has a consistent server-verified tier. The final 2% baseline applies to all tiers under OR semantics; it is not a first-match fallback:
|
|
178
|
+
|
|
179
|
+
```yaml
|
|
180
|
+
processors:
|
|
181
|
+
tail_sampling:
|
|
182
|
+
decision_wait: 30s
|
|
183
|
+
num_traces: 100000
|
|
184
|
+
policies:
|
|
185
|
+
# Enterprise: always keep
|
|
186
|
+
- name: enterprise-full
|
|
187
|
+
type: and
|
|
188
|
+
and:
|
|
189
|
+
and_sub_policy:
|
|
190
|
+
- name: is-enterprise
|
|
191
|
+
type: string_attribute
|
|
192
|
+
string_attribute:
|
|
193
|
+
key: tenant.tier
|
|
194
|
+
values: ["enterprise"]
|
|
195
|
+
- name: keep-all
|
|
196
|
+
type: probabilistic
|
|
197
|
+
probabilistic:
|
|
198
|
+
sampling_percentage: 100
|
|
199
|
+
|
|
200
|
+
# Pro: 20%
|
|
201
|
+
- name: pro-sample
|
|
202
|
+
type: and
|
|
203
|
+
and:
|
|
204
|
+
and_sub_policy:
|
|
205
|
+
- name: is-pro
|
|
206
|
+
type: string_attribute
|
|
207
|
+
string_attribute:
|
|
208
|
+
key: tenant.tier
|
|
209
|
+
values: ["pro"]
|
|
210
|
+
- name: pro-rate
|
|
211
|
+
type: probabilistic
|
|
212
|
+
probabilistic:
|
|
213
|
+
sampling_percentage: 20
|
|
214
|
+
|
|
215
|
+
# Baseline: 2% across all tiers (OR, not an ordered fallback)
|
|
216
|
+
- name: free-sample
|
|
217
|
+
type: probabilistic
|
|
218
|
+
probabilistic:
|
|
219
|
+
sampling_percentage: 2 # global baseline; tier-specific keep decisions OR with this
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## 5. Complete Example: Four-Policy `tail_sampling`
|
|
225
|
+
|
|
226
|
+
This processor/pipeline excerpt combines positive error, trace-duration, per-span cost, and baseline policies. Configure receivers/exporters, traceID-aware upstream routing, bounded memory, and attribute types for the pinned Collector before deployment:
|
|
227
|
+
|
|
228
|
+
```yaml
|
|
229
|
+
processors:
|
|
230
|
+
memory_limiter:
|
|
231
|
+
check_interval: 1s
|
|
232
|
+
limit_mib: 1500
|
|
233
|
+
spike_limit_mib: 400
|
|
234
|
+
|
|
235
|
+
transform/cost_annotation:
|
|
236
|
+
trace_statements:
|
|
237
|
+
- context: span
|
|
238
|
+
statements:
|
|
239
|
+
- set(attributes["sampling.keep_reason"], "high_cost")
|
|
240
|
+
where attributes["llm.request.cost_usd"] > 0.50
|
|
241
|
+
|
|
242
|
+
tail_sampling:
|
|
243
|
+
decision_wait: 30s
|
|
244
|
+
num_traces: 200000
|
|
245
|
+
expected_new_traces_per_sec: 2000
|
|
246
|
+
policies:
|
|
247
|
+
# Policy 1: 100% error traces
|
|
248
|
+
- name: policy-errors
|
|
249
|
+
type: status_code
|
|
250
|
+
status_code:
|
|
251
|
+
status_codes: [ERROR]
|
|
252
|
+
|
|
253
|
+
# Policy 2: 100% high-latency traces (>2s earliest-start to latest-end)
|
|
254
|
+
- name: policy-latency
|
|
255
|
+
type: latency
|
|
256
|
+
latency:
|
|
257
|
+
threshold_ms: 2000
|
|
258
|
+
|
|
259
|
+
# Policy 3: 100% traces with an individual LLM span costing >$0.50
|
|
260
|
+
- name: policy-high-cost
|
|
261
|
+
type: string_attribute
|
|
262
|
+
string_attribute:
|
|
263
|
+
key: sampling.keep_reason
|
|
264
|
+
values: ["high_cost"]
|
|
265
|
+
|
|
266
|
+
# Policy 4: 8% baseline probabilistic sampling
|
|
267
|
+
- name: policy-baseline
|
|
268
|
+
type: probabilistic
|
|
269
|
+
probabilistic:
|
|
270
|
+
sampling_percentage: 8
|
|
271
|
+
|
|
272
|
+
service:
|
|
273
|
+
pipelines:
|
|
274
|
+
traces:
|
|
275
|
+
receivers: [otlp]
|
|
276
|
+
processors: [memory_limiter, transform/cost_annotation, tail_sampling]
|
|
277
|
+
exporters: [otlp/backend]
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## 6. Pitfalls
|
|
283
|
+
|
|
284
|
+
| Pitfall | Description | Mitigation |
|
|
285
|
+
|---------|-------------|-----------|
|
|
286
|
+
| Head-based sampling on multi-service paths | A service sampled out at hop 2 drops spans; trace is reconstructed with gaps | Use tail-based sampling in gateway; propagate `traceparent` regardless of local sampling decision |
|
|
287
|
+
| Tail sampling memory exhaustion | Buffer holds all in-flight spans per trace for `decision_wait` duration; high RPS + long wait = large heap | Set `num_traces` based on `expected_new_traces_per_sec * decision_wait`; always include `memory_limiter` |
|
|
288
|
+
| Decision wait too short | Spans from slow downstream services arrive after decision is made; those spans are dropped | Set `decision_wait` to exceed your p99 inter-service latency; typically 30-60s |
|
|
289
|
+
| Sample-rate mismatch between gateway tiers | Tier-1 and Tier-2 each apply independent sampling; effective rate is multiplied (e.g., 50% × 20% = 10%) | Assign sampling responsibility to one tier only; the other tier passes all traffic through |
|
|
290
|
+
| `routing_connector` in production (alpha) | Alpha components may break on minor version upgrades of collector-contrib | Verify connector stability for the pinned version; use separate collector/exporter pipelines for isolation if necessary. `tail_sampling` `and` changes retention, not routing |
|
|
291
|
+
| Missing `loadbalancing` exporter before tail sampler | Spans for the same trace land on different gateway replicas; sampler on each replica sees an incomplete trace and makes wrong decisions | Always deploy `loadbalancing` exporter (routing_key: traceID) in the tier upstream of `tail_sampling` |
|
|
292
|
+
|
|
293
|
+
## References
|
|
294
|
+
|
|
295
|
+
- https://opentelemetry.io/docs/specs/otlp/
|
|
296
|
+
- https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/tailsamplingprocessor
|
|
297
|
+
- https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/connector/routingconnector
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
---
|
|
2
|
+
otel_spec: "1.x (stable API/SDK)"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# UDP StatsD MTU and Fragmentation Guide
|
|
6
|
+
|
|
7
|
+
## 1. Scope
|
|
8
|
+
|
|
9
|
+
This document covers StatsD metric payloads transported over UDP or Unix Domain Socket (UDS)
|
|
10
|
+
into an OpenTelemetry Collector `statsdreceiver` or a DogStatsD agent. It does not address
|
|
11
|
+
TCP or HTTP transports, or metrics emitted directly via OTLP.
|
|
12
|
+
|
|
13
|
+
Sources:
|
|
14
|
+
- OTel statsdreceiver: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/statsdreceiver
|
|
15
|
+
- DogStatsD high-throughput: docs.datadoghq.com/developers/dogstatsd/high_throughput/
|
|
16
|
+
- Prometheus statsd_exporter issue #35 (buffer sizing)
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 2. Why Fragmentation Matters for UDP
|
|
21
|
+
|
|
22
|
+
UDP is connectionless and provides no retransmission. When an IP datagram exceeds the path MTU:
|
|
23
|
+
|
|
24
|
+
- **No retransmission**: if any IP fragment is lost in transit, the kernel discards the entire
|
|
25
|
+
reassembled datagram silently. StatsD has no acknowledgement mechanism, so the loss is invisible.
|
|
26
|
+
- **Middlebox drops**: NAT gateways, stateful firewalls, and VPN concentrators frequently drop
|
|
27
|
+
IP fragments entirely, or track only the first fragment for NAT state and discard the rest.
|
|
28
|
+
- **Reassembly CPU overhead**: fragment reassembly at the receiver incurs kernel memory allocation
|
|
29
|
+
and timer management. Under high packet rate this degrades throughput measurably.
|
|
30
|
+
|
|
31
|
+
**Rule**: keep each datagram within the path MTU so it is transmitted as a single unfragmented packet.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 3. Optimal Datagram Size Table
|
|
36
|
+
|
|
37
|
+
| Network path | Effective MTU | Max UDP payload | Notes |
|
|
38
|
+
|----------------------------------|---------------|-----------------|---------------------------------------------|
|
|
39
|
+
| External network, IPv4 Ethernet | 1500 B | **1472 B** | 1500 − 20 (IP) − 8 (UDP) |
|
|
40
|
+
| External network, IPv6 Ethernet | 1500 B | **1452 B** | 1500 − 40 (IPv6) − 8 (UDP) |
|
|
41
|
+
| VPN / PPPoE encapsulation | ~1460 B | **1432 B** | Conservative; accounts for tunnel overhead |
|
|
42
|
+
| Same-host loopback (Linux/macOS) | ~65535 B | **~16384 B** | Kernel loopback; practical limit ~16 K |
|
|
43
|
+
| Unix Domain Socket (`unixgram`) | N/A | **8192 B** | Recommended; avoids kernel socket buffer pressure |
|
|
44
|
+
|
|
45
|
+
> IPv6 minimum MTU is 1280 B (RFC 8200); on links with lower MTU, fragmentation is performed
|
|
46
|
+
> by the source host only; not routers; making drops more likely. Always test your actual path.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## 4. Verification
|
|
51
|
+
|
|
52
|
+
### 4.1 PMTUD Probe (Linux / macOS)
|
|
53
|
+
|
|
54
|
+
Find the largest datagram that reaches a destination without fragmentation:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# Linux — DF bit set, vary -s until you find the boundary
|
|
58
|
+
ping -M do -s 1472 -c 3 <collector-host>
|
|
59
|
+
|
|
60
|
+
# macOS equivalent
|
|
61
|
+
ping -D -s 1472 -c 3 <collector-host>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Decrease `-s` in steps of 10 until you stop seeing "Frag needed" / "Message too long" errors.
|
|
65
|
+
The largest passing value is your PMTU; set `max_packet_size` to that value minus 28 (IPv4)
|
|
66
|
+
or 48 (IPv6) to leave room for IP and UDP headers.
|
|
67
|
+
|
|
68
|
+
### 4.2 Wireshark Fragment Inspection
|
|
69
|
+
|
|
70
|
+
Capture on the collector interface and filter for IP fragments:
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
ip.flags.mf == 1
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The **More Fragments (MF)** bit set on any packet indicates fragmentation is occurring.
|
|
77
|
+
A fragment offset > 0 identifies continuation fragments. If you see these in production
|
|
78
|
+
traffic, your client is sending oversized datagrams.
|
|
79
|
+
|
|
80
|
+
For UDS traffic, capture on a loopback or use `socat` to proxy and inspect:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
socat -v UNIX-RECV:/tmp/statsd.sock UDP:127.0.0.1:8126
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## 5. Client-Side Batching
|
|
89
|
+
|
|
90
|
+
Most StatsD client libraries default to sending **one metric per datagram**, which is wasteful:
|
|
91
|
+
|
|
92
|
+
- A single counter line (`my.counter:1|c`) is ~20 bytes; one UDP send per metric at 1 M metrics/min
|
|
93
|
+
generates 16 K packets/sec of syscall overhead.
|
|
94
|
+
- Enable multi-metric batching in your client library.
|
|
95
|
+
|
|
96
|
+
| Client library | Batching config | Recommended buffer |
|
|
97
|
+
|--------------------|------------------------------------------|----------------------|
|
|
98
|
+
| dogstatsd-go | `WithMaxMessagesPerPayload(N)` | 1472 (external UDP) |
|
|
99
|
+
| statsd (npm) | `maxBufferSize: 1432` | 1432 (VPN/default) |
|
|
100
|
+
| statsd-client (py) | `maxudpsize=1432` | 1432 |
|
|
101
|
+
| Any UDS client | Set buffer ≤ 8192 | 8192 |
|
|
102
|
+
|
|
103
|
+
Rules:
|
|
104
|
+
- For external UDP: keep buffered payload at or below the PMTU value found in section 4.1.
|
|
105
|
+
- For UDS (same-host): buffer up to 8192 bytes per send; larger values risk ENOBUFS under load.
|
|
106
|
+
- Never exceed 65507 bytes (IPv4 UDP maximum); the kernel will return EMSGSIZE.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## 6. OTel StatsD Receiver Configuration
|
|
111
|
+
|
|
112
|
+
Default UDP port is 8125. Switch to UDS for same-host agents to eliminate network stack overhead.
|
|
113
|
+
|
|
114
|
+
```yaml
|
|
115
|
+
receivers:
|
|
116
|
+
statsd:
|
|
117
|
+
endpoint: "0.0.0.0:8125" # UDP; change to unixgram path for UDS
|
|
118
|
+
# endpoint: "/var/run/statsd.sock"
|
|
119
|
+
transport: udp # udp | unixgram
|
|
120
|
+
aggregation_interval: 60s # flush interval to next processor
|
|
121
|
+
enable_metric_type: true # attach metric type as attribute
|
|
122
|
+
is_monotonic_counter: false # set true for always-increasing counters
|
|
123
|
+
timer_histogram_mapping:
|
|
124
|
+
- statsd_type: "timing"
|
|
125
|
+
observer_type: "histogram"
|
|
126
|
+
- statsd_type: "histogram"
|
|
127
|
+
observer_type: "histogram"
|
|
128
|
+
|
|
129
|
+
processors:
|
|
130
|
+
memory_limiter:
|
|
131
|
+
check_interval: 1s
|
|
132
|
+
limit_mib: 512
|
|
133
|
+
spike_limit_mib: 128
|
|
134
|
+
batch:
|
|
135
|
+
send_batch_size: 8192
|
|
136
|
+
timeout: 10s
|
|
137
|
+
|
|
138
|
+
exporters:
|
|
139
|
+
otlp:
|
|
140
|
+
endpoint: "otel-collector-tier2:4317"
|
|
141
|
+
compression: gzip
|
|
142
|
+
|
|
143
|
+
service:
|
|
144
|
+
pipelines:
|
|
145
|
+
metrics:
|
|
146
|
+
receivers: [statsd]
|
|
147
|
+
processors: [memory_limiter, batch]
|
|
148
|
+
exporters: [otlp]
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**Bridge pattern**: `StatsD clients` → UDP/UDS → `OTel Collector statsdreceiver` → OTLP gRPC →
|
|
152
|
+
downstream Collector or backend. This decouples metric ingestion from processing and allows the
|
|
153
|
+
statsdreceiver to be scaled or replaced without changing client configuration.
|
|
154
|
+
|
|
155
|
+
For UDS on Linux, set socket permissions to allow the application user:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
chmod 0660 /var/run/statsd.sock
|
|
159
|
+
chown root:app /var/run/statsd.sock
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Set `SO_RCVBUF` on the collector socket to handle burst traffic (Linux default is typically 208 KB;
|
|
163
|
+
increase to 8–25 MB for high-throughput agents via `net.core.rmem_max`):
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
sysctl -w net.core.rmem_max=26214400
|
|
167
|
+
```
|