minipower-backend-telemetry-dotnet
Thiết lập Jarvis.OpenTelemetry cho ASP.NET Core — trace/metric/log OTLP, enrich middleware, instrumentation plug-in. Dùng khi tích hợp telemetry .NET, section OTEL, hoặc thêm Redis/EF/enricher.
- License 许可
- MIT
- 最近更新
- 2026-11-09
- Stars
- ★ 7
- Forks
- 0
01 前言 Front Matter
- name
- minipower-backend-telemetry-dotnet
- metadata
- { "workflow": "github" }
- description
- Thiết lập Jarvis.OpenTelemetry cho ASP.NET Core — trace/metric/log OTLP, enrich middleware, instrumentation plug-in. Dùng khi tích hợp telemetry .NET, section OTEL, hoặc thêm Redis/EF/enricher.
02 资源文件 6
- 参考文档README.md4.3 KB
- 其他templates/enrich-service.cs1.1 KB
- 参考文档templates/otel-appsettings.json1.3 KB
- 其他templates/program-setup.cs1.1 KB
- 参考文档workflows/add.md1.9 KB
- 参考文档workflows/init.md3.3 KB
03 SKILL.md 正文
Jarvis.OpenTelemetry — Orchestrator
Skill điều phối gắn Jarvis.OpenTelemetry vào ASP.NET Core minimal hosting.
Kiến trúc & hướng dẫn: README.md.
Khi nào dùng workflow nào
| Tình huống | Workflow |
|---|---|
| Project chưa có Jarvis OTEL | workflows/init.md |
| Đã có core, cần thêm instrumentation/enricher | workflows/add.md |
Quy tắc cốt lõi
AddJarvisOpenTelemetry(configuration, configureServices)→.ConfigureResource()→.ConfigureLogging()/.ConfigureTrace()/.ConfigureMetric().- Plug-in (
ITraceInstrumentation, enricher, …) đăng ký trong callbackconfigureServices(trướcBuild()). app.UseJarvisOpenTelemetry()khi cần tag trace / log scope từIEnrich*.- Config theo signal:
OTEL:Tracing,OTEL:Metric,OTEL:Logging. HttpTraceEnrichment: allowlist header — không capture toàn bộ header.- Không hard-code OTLP secrets; dùng env / secret store.
- Jarvis logging không
ClearProviders— Serilog/NLog thêm riêng. - Options snapshot lúc startup — đổi config runtime cần restart.
Templates
- templates/program-setup.cs —
Program.cstối thiểu - templates/enrich-service.cs —
IEnrichTraceService/IEnrichLogService - templates/otel-appsettings.json — mẫu section
OTEL
Providers (atomic)
Chỉ đọc provider cần dùng:
| Provider | Path |
|---|---|
| Enrich trace/log | providers/enrich/SKILL.md |
| Redis trace | providers/redis/SKILL.md |
| EF Core trace | providers/entityframework/SKILL.md |
| Custom trace plug-in | providers/trace-plugin/SKILL.md |
| Custom metric plug-in | providers/metric-plugin/SKILL.md |
| Custom log exporter | providers/logging-plugin/SKILL.md |
Biến môi trường OTLP (tham chiếu)
| Mục đích | Ví dụ |
|---|---|
| OTLP chung | OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS |
| Trace | OTEL_EXPORTER_OTLP_TRACES_ENDPOINT |
| Metrics | OTEL_EXPORTER_OTLP_METRICS_ENDPOINT |
| Logs | OTEL_EXPORTER_OTLP_LOGS_ENDPOINT |
| Resource | OTEL_RESOURCE_ATTRIBUTES, OTEL_SERVICE_NAME |
Output bắt buộc
- Thay đổi
Program.cs appsettings.jsonsectionOTEL(khi đổi config)- Checklist: OTLP endpoint/env, sampling, allowlist header, plug-in singleton
- Code C# theo minipower-backend-convention-dotnet —
dotnet format --verify-no-changessạch trên file đã chạm - File đặt đúng layer + hướng phụ thuộc theo minipower-backend-architecture-dotnet —
dotnet test -c Debugxanh, kể cả{Product}.ArchitectureTests
Background worker
Kế thừa Jarvis.OpenTelemetry.HostedServices.BaseWorker — cron + trace/log scope mỗi tick. Chi tiết: README.md.
Checklist production
- Sampling:
Tracing:Sampler+TraceIdRatiohợp lý - PII: allowlist header chặt
- Cardinality: tag ổn định
- Noise:
ExcludedPathPrefixescho/health,/swagger - Secrets: OTLP headers qua env, không commit
04 同仓库更多 Skills
minipower-vcs-gitlab
Tra GitLab (search, issue, pipeline, MR), soạn MR/comment, tạo MR và commit/push sau L2. Dùng khi merge request, GitLab MCP, code_provider gitlab — không scaffold .NET, không force-push.
minipower-toolbox-skill-author
Viết và soát skill lá-rời Minipower (minipower-{module}-{capability}) — chọn module bằng 3 câu hỏi ADR-022, dựng cây SKILL.md/README.md/workflows/providers, đặt description kích hoạt được, cập nhật hub và test canh. Hỏi người xác nhận trước mọi quyết định, không tự chốt. Dùng khi tạo skill mới, thêm provider/pattern/workflow, mở module mới, hoặc soát skill có sẵn lệch chuẩn.
minipower-tasks-lark
Đọc, lọc, tìm, soạn nháp và ghi task Lark (tasklist / task) theo L1–L3. Dùng khi việc trên Lark, sprint, tasklist, "tìm task", "tạo task", tasks_provider lark — không dùng cho tin nhắn nhóm hay wiki.
minipower-support-registry
Rà registry DOC theo project_mode, nhắc owner thiếu ID hoặc chỗ lưu sai. Dùng khi doc-registry, thiếu DOC, rà soát tiêu chuẩn — không tự sửa FR, không init.
minipower-support-publish
暂无简介
minipower-router
Phân loại intent Minipower rồi gợi ý đúng một pack nghề hoặc kênh. Dùng khi làm gì tiếp, chọn skill, dispatcher, không biết mở pack nào — không tự gọi MCP L3, không spawn agent.