[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79WW3SQXW47BCJDPJ71C81D":3,"skill-same:01M79WW3SQXW47BCJDPJ71C81D":61},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M79WW3SQXW47BCJDPJ71C81D","opentelemetry-net-instrumentation",null,"Provides guidance for implementing OpenTelemetry instrumentation in .NET codebases, covering tracing (Activities\u002FSpans), metrics, logs, naming conventions, error handling, performance, SDK setup, resources, context propagation, and API design best practices.","Blind-Striker\u002Fagent-skills-and-plugins","Blind-Striker","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1965259?v=4","01M79WFXTE5PH0C1VB7B54ANMN","Deniz İrgin","01M79WFXV5KZ5GST1K8G035DM5",1,"MIT","https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fcodex\u002Fdeniz-dotnet-general\u002Fskills\u002Fopentelemetry-net-instrumentation\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: opentelemetry-net-instrumentation\ndescription: Provides guidance for implementing OpenTelemetry instrumentation in\n  .NET codebases, covering tracing (Activities\u002FSpans), metrics, logs, naming\n  conventions, error handling, performance, SDK setup, resources, context\n  propagation, and API design best practices.\n---\n\n# OpenTelemetry .NET Instrumentation Skill\n\n## When to Use\n\n- Adding OpenTelemetry instrumentation to .NET code (traces, metrics, logs)\n- Creating or modifying ActivitySources, Meters, or ILogger usage\n- Setting up the OpenTelemetry SDK, resources, exporters, or sampling\n- Reviewing telemetry implementations for spec compliance\n- Optimizing instrumentation performance\n- Designing telemetry APIs that become part of the public surface\n- Implementing context propagation across service boundaries\n\n## Architecture: .NET Is Different\n\n**CRITICAL**: The .NET OpenTelemetry implementation is fundamentally different from other platforms. .NET provides tracing, metrics, and logging APIs **in the framework itself**.\nThat means **OTel does not provide a separate instrumentation API** — it uses the built-in .NET APIs and acts as the collection\u002Fexport layer.\n\n### The Three Built-in .NET APIs (Primary — Zero Dependencies)\n\n| Signal | .NET Framework API | Namespace |\n|--------|-------------------|-----------|\n| **Tracing** | `ActivitySource` \u002F `Activity` | `System.Diagnostics` |\n| **Metrics** | `Meter` \u002F `Counter\u003CT>` \u002F `Histogram\u003CT>` \u002F etc. | `System.Diagnostics.Metrics` |\n| **Logging** | `ILogger\u003CT>` | `Microsoft.Extensions.Logging` |\n\nThese are **the primary and only APIs** library authors should use for instrumentation.\nThey ship with the .NET runtime — **no NuGet packages required**.\n\n### The OTel Collection\u002FExport Layer (Secondary — Application Root Only)\n\nOTel NuGet packages are the **collection and export layer**, added only at the application\ncomposition root (not in libraries):\n\n| Package | Purpose | When to add |\n|---------|---------|-------------|\n| `OpenTelemetry.Extensions.Hosting` | DI integration for ASP.NET Core \u002F generic host | Application only |\n| `OpenTelemetry.Exporter.Console` | Console exporter (dev\u002Ftesting) | Application only |\n| `OpenTelemetry.Exporter.OpenTelemetryProtocol` | OTLP exporter (production) | Application only |\n| `OpenTelemetry.Exporter.Prometheus*` | Prometheus metrics endpoint | Application only |\n| `OpenTelemetry.Instrumentation.AspNetCore` | Auto-instrument ASP.NET Core requests | Application only |\n| `OpenTelemetry.Instrumentation.Http` | Auto-instrument HttpClient calls | Application only |\n| `OpenTelemetry.Instrumentation.SqlClient` | Auto-instrument SQL calls | Application only |\n\n### Package Decision Guide\n\n**Before adding ANY OpenTelemetry NuGet package, discuss the trade-off with the user:**\n\n> \"You're about to add an OTel NuGet package. Is this an application where you need to\n> export telemetry to an observability backend (Jaeger, Prometheus, OTLP collector)?\n> If you're writing a library, you likely need **zero** OTel packages — just use\n> `System.Diagnostics.ActivitySource` \u002F `System.Diagnostics.Metrics.Meter` and let the\n> consuming application configure the export pipeline. Do you want to proceed?\"\n\n**Library authors**: Add **nothing**. Use only `System.Diagnostics.*` and `ILogger`.\nThe consuming application wires up the SDK and exporters.\n\n**Application authors**: Add `OpenTelemetry.Extensions.Hosting` + the exporters and instrumentation libraries you need. See [sdk-resources-and-logs-reference.md](sdk-resources-and-logs-reference.md) for full setup patterns.\n\n**When Aspire ServiceDefaults, or any other composition root, already calls `UseOtlpExporter()`**: register your `ActivitySource` and `Meter` names there and add no exporter. Never add a per-signal `AddOtlpExporter()` beside it: OpenTelemetry .NET throws `NotSupportedException` when both are on one service collection, and the Aspire AppHost sets the OTLP endpoint that turns `UseOtlpExporter()` on, so the service fails at startup under the AppHost.\n\n**Never add** `OpenTelemetry.Api` to a library — `System.Diagnostics.*` IS the API.\n\nFor SDK setup, resource configuration, exporters, sampling, and logs integration, see [sdk-resources-and-logs-reference.md](sdk-resources-and-logs-reference.md).\n\n## Core Principles\n\n### Resiliency First\n**CRITICAL**: Exceptions in diagnostic\u002Ftracing\u002Fmetrics logic MUST NEVER impact application processing.\n- Assume Activity instances can be null. Always protect against null Activity references except in Activity extension methods (use `activity?.ExtensionMethod()`)\n- Guard all instrumentation code with appropriate null checks\n\n### API Surface Awareness\n- Any telemetry emitted becomes part of the public API surface\n- Changes are subject to breaking changes guidelines\n- Telemetry should be emitted by default (users opt-in to collection via OpenTelemetry extensions)\n- Exception: High-cardinality metric dimensions may require explicit opt-in\n\n### Standards Compliance\n- Follow Microsoft best practices for [distributed tracing instrumentation](https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fdotnet\u002Fcore\u002Fdiagnostics\u002Fdistributed-tracing-instrumentation-walkthroughs)\n- Follow [OpenTelemetry semantic conventions](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fsemconv\u002F)\n- Attribute values support: **string, boolean, double (IEEE 754), int64, byte arrays, and homogeneous arrays** of these primitive types. Null\u002Fempty values are valid and meaningful per the [OTel AnyValue spec](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fotel\u002Fcommon\u002F#anyvalue) — they MUST be stored and passed to exporters.\n- Attribute **keys** must be non-null, non-empty strings\n\n## Traces \u002F Spans (Activities)\n\n### ActivitySource Setup\n\n```csharp\n\u002F\u002F ✅ CORRECT: Use ActivitySource, not DiagnosticSource\npublic class MyFeature\n{\n    \u002F\u002F Primary ActivitySource - name typically matches the component or NuGet package name\n    private static readonly ActivitySource ActivitySource = new(\"MyApp.MyComponent\", \"1.0.0\");\n\n    \u002F\u002F Specialized ActivitySource for opt-in scenarios\n    private static readonly ActivitySource DetailedActivitySource = new(\"MyApp.MyComponent.Detailed\", \"1.0.0\");\n}\n```\n\n**Rules**:\n- Every component defines a primary `ActivitySource` for mainstream activities\n- Name typically matches the component or NuGet package (e.g., `\"MyCompany.MyLibrary\"`)\n- Version the ActivitySource using SemVer\n- Create separate `ActivitySource`s for specialized or opt-in scenarios. Use hierarchical source names, e.g. `MyCompany.MyLibrary` and `MyCompany.MyLibrary.Detailed`, so consuming applications can subscribe only to the sources they want via `AddSource(...)` and backends can filter by instrumentation scope.\n\n### Creating Activities\n\n```csharp\n\u002F\u002F ✅ Check HasListeners, null-check, then guard expensive work behind IsAllDataRequested\nif (ActivitySource.HasListeners())\n{\n    using var activity = ActivitySource.StartActivity(\"ProcessItem\", ActivityKind.Internal);\n    if (activity != null && activity.IsAllDataRequested)\n    {\n        activity.DisplayName = \"Processing order #12345\";\n        activity.SetTag(\"app.item_id\", itemId);\n        activity.SetTag(\"app.item_type\", itemType);\n    }\n}\n\n\u002F\u002F ❌ WRONG: Don't start activities in fire-and-forget tasks where the\n\u002F\u002F using scope ends before the async work completes (AsyncLocal context is lost)\nasync Task HelperAsync()\n{\n    using var activity = ActivitySource.StartActivity(\"Helper\");\n    _ = Task.Run(() => DoWorkAsync()); \u002F\u002F ❌ activity disposed before task completes\n}\n```\n\n**Rules**:\n- Check `ActivitySource.HasListeners()` before creating (zero-allocation fast path)\n- Always null-check Activity after creation (listener may filter or sample it out)\n- Never start activities in async helper methods (`Activity.Current` uses `AsyncLocal`)\n- Guard expensive tag computation behind `activity.IsAllDataRequested`\n- Use W3C TraceContext. .NET Core 3.0+ \u002F .NET 5+ uses it by default; older TFMs or .NET Framework apps may set `Activity.DefaultIdFormat = ActivityIdFormat.W3C` at startup and use `Activity.ForceDefaultIdFormat = true` to override hierarchical parents.\n\n### Activity Naming\n\n```csharp\n\u002F\u002F ✅ Unique operation name, friendly display name (null-check before accessing)\nusing var activity = ActivitySource.StartActivity(\n    name: \"ProcessItem\",              \u002F\u002F Unique, identifies class of spans\n    kind: ActivityKind.Internal\n);\nif (activity != null)\n    activity.DisplayName = \"Processing order #12345\"; \u002F\u002F User-friendly, can be specific\n\n\u002F\u002F ❌ WRONG: Don't include runtime data in operation name\nusing var badActivity = ActivitySource.StartActivity($\"Process_{itemId}\"); \u002F\u002F ❌\n```\n\n**Rules**:\n- Each span type has unique `OperationName` (identifies statistically interesting class of spans)\n- Operation name should NOT contain runtime data (only compile\u002Fconfig-time info)\n- Use human-readable `DisplayName` for specifics\n- Follow [OpenTelemetry span naming conventions](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fotel\u002Ftrace\u002Fapi\u002F#span)\n\n### SpanKind Selection\n\nChoose the correct `ActivityKind` to clarify the span's role in distributed tracing:\n\n| `ActivityKind` | OTel SpanKind | When to use |\n|----------------|---------------|-------------|\n| `Internal` | `INTERNAL` | Default — in-process operations not crossing a remote boundary |\n| `Server` | `SERVER` | Processing an incoming request\u002Fresponse call (HTTP server, gRPC server, RPC server) |\n| `Client` | `CLIENT` | Making an outgoing request\u002Fresponse call (HTTP client, database client, RPC call) |\n| `Producer` | `PRODUCER` | Enqueuing\u002Fpublishing deferred work (message queue publish, event emit, job enqueue) |\n| `Consumer` | `CONSUMER` | Dequeuing\u002Fprocessing deferred work (message queue receive, event handle, job dequeue) |\n\n**Rules**:\n- A single span SHOULD NOT serve more than one purpose\n- Create the outgoing span **before** injecting its `SpanContext` into the request. If you inject first, the parent's context propagates instead and the outgoing span ends up dangling (no connection to the downstream call).\n- See [traces-and-propagation-reference.md](traces-and-propagation-reference.md) for detailed SpanKind guidance with examples\n\n### Span Attributes (Tags)\n\n```csharp\n\u002F\u002F ✅ Application code: use your own namespace\nactivity?.SetTag(\"myapp.order_id\", orderId);\nactivity?.SetTag(\"myapp.payment.status\", \"confirmed\");\n\n\u002F\u002F ✅ Manual infrastructure instrumentation: use semantic conventions\n\u002F\u002F activity?.SetTag(\"db.system.name\", \"postgresql\"); \u002F\u002F custom database client\n\u002F\u002F activity?.SetTag(\"http.request.method\", \"GET\"); \u002F\u002F custom HTTP transport\n\n\u002F\u002F Values can be strings, numbers, booleans, or homogeneous arrays\nactivity?.SetTag(\"app.item_count\", 42);\nactivity?.SetTag(\"app.related_ids\", new int[] { 1, 2, 3 });\n\n\u002F\u002F ❌ WRONG: PascalCase, hyphen delimiter, plural, or unrelated namespace\nactivity?.SetTag(\"MyApp.OrderId\", orderId);     \u002F\u002F ❌ Wrong case\nactivity?.SetTag(\"myapp.order-id\", orderId);    \u002F\u002F ❌ Wrong delimiter\n```\n\n**Rules**:\n- Namespace prefix matching your component: `myapp.*`, `myapp.db.*`\n- All lowercase, underscore (`_`) delimiters, singular form\n- Attribute values: string, boolean, double, int64, byte arrays, homogeneous arrays (null\u002Fempty valid per [AnyValue spec](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fotel\u002Fcommon\u002F#anyvalue))\n- **Business\u002Fdomain attributes**: use your own namespace (`myapp.*`).\n- **HTTP, database, messaging, or RPC concepts you manually instrument**: use [semantic conventions](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fsemconv\u002F). Do not duplicate attributes already emitted by auto-instrumentation. Do not use OTel namespaces as prefixes for custom attributes.\n\n### Activity Status and Errors\n\n```csharp\ntry\n{\n    await ProcessItemAsync(); \u002F\u002F ✅ success: leave status Unset, do not call SetStatus(Ok) — see rules below\n}\ncatch (Exception ex)\n{\n    if (activity != null)\n    {\n        activity.SetStatus(ActivityStatusCode.Error, ex.Message); \u002F\u002F modern API\n        activity.SetTag(\"error.type\", ex.GetType().FullName);\n    }\n    throw;\n}\n```\n\n**Rules** (per [Recording Errors](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fsemconv\u002Fgeneral\u002Frecording-errors\u002F) and the [Set Status API spec](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fotel\u002Ftrace\u002Fapi\u002F#set-status)):\n- Leave span status **Unset** on success — do not call `SetStatus(ActivityStatusCode.Ok)`.\n- `Ok` is for application code, not instrumentation libraries. The trace API spec: \"Instrumentation Libraries SHOULD NOT set the status code to `Ok`, unless explicitly configured to do so (...) Application developers and Operators may set the status code to `Ok`\" — typically to override a library-reported `Error` they've decided isn't a real failure (e.g. suppressing a noisy 404). Once set, `Ok` is final; later calls are ignored.\"\n- On failure: **SHOULD** set `ActivityStatusCode.Error`, **SHOULD** set the `error.type` tag, **SHOULD** set the status description to the exception message.\n- Use `SetStatus` — legacy `otel.status_code`\u002F`otel.status_description` tags are no longer needed.\n- Do **not** record errors that were retried or handled and let the operation complete gracefully — `Error` status and `error.type` describe operations that failed, not ones that recovered.\n\n### Recording Exceptions — Keep Emitting Span Events, Add the Logs Opt-In\n\n`exceptions-spans` — the convention behind `Activity.AddEvent(new ActivityEvent(\"exception\", ...))` — carries a **Deprecated** status in favor of `exceptions-logs`, but the .NET ecosystem has not followed yet: no `OpenTelemetry.*` .NET package implements the spec's `OTEL_SEMCONV_EXCEPTION_SIGNAL_OPT_IN` opt-in (verified against `OpenTelemetry.Api` 1.17.0), and `OpenTelemetry.Instrumentation.AspNetCore` 1.17.0 itself still records exceptions via `Activity.AddException`, i.e. span events. That means the exporters, backends, and dashboards a typical .NET user has wired up today are built to read exception span events, not log-based exceptions. **Keep implementing span events as the default** — dropping them because the underlying spec document is marked Deprecated will silently break exception visibility for anyone still on today's tooling. Layer the newer logs-based path on top as an opt-in, exactly as the spec's own transition guidance describes for instrumentations moving off span events:\n\n```csharp\n\u002F\u002F Mirrors the spec's OTEL_SEMCONV_EXCEPTION_SIGNAL_OPT_IN values: unset\u002Fanything else → spans only (today's default), \"logs\u002Fdup\" → both, \"logs\" → logs only.\nprivate static readonly string? ExceptionSignalOptIn = Environment.GetEnvironmentVariable(\"OTEL_SEMCONV_EXCEPTION_SIGNAL_OPT_IN\");\nprivate static readonly bool EmitSpanEvents = ExceptionSignalOptIn != \"logs\";\nprivate static readonly bool EmitLogs = ExceptionSignalOptIn is \"logs\" or \"logs\u002Fdup\";\n\ntry\n{\n    await ProcessItemAsync();\n}\ncatch (Exception ex)\n{\n    activity?.SetStatus(ActivityStatusCode.Error, ex.Message);\n    activity?.SetTag(\"error.type\", ex.GetType().FullName);\n\n    if (EmitSpanEvents) \u002F\u002F ✅ default — what current .NET tooling and dashboards actually consume today\n    {\n        activity?.AddEvent(new ActivityEvent(\"exception\", tags: new ActivityTagsCollection\n        {\n            [\"exception.type\"] = ex.GetType().FullName,\n            [\"exception.message\"] = ex.Message,\n            [\"exception.stacktrace\"] = ex.ToString()\n        }));\n    }\n\n    if (EmitLogs) \u002F\u002F opt-in — the spec's forward direction; pass the exception instance while `activity` is still Activity.Current so the SDK derives trace_id\u002Fspan_id and exception.type\u002Fmessage\u002Fstacktrace from it\n    {\n        logger.LogError(ex, \"Item processing failed\");\n    }\n\n    throw;\n}\n```\n\n**Rules**:\n- Don't set `exception.escaped` on the span event — it's deprecated outright: \"no longer recommended to record exceptions that are handled and do not escape the scope of a span.\"\n- Support `OTEL_SEMCONV_EXCEPTION_SIGNAL_OPT_IN` (`logs` \u002F `logs\u002Fdup`) so consumers who are ready can opt into logs or dual-emission, but default to spans-only — this is the spec's own transition guidance, not an optional nicety, and it exists precisely so nobody has to choose one signal over the other before they're ready.\n- When emitting logs (opt-in or dual), pick severity per `exceptions-logs`: `ERROR` for unhandled exceptions (especially on `SERVER`\u002F`CONSUMER` spans), `WARN` for exceptions expected to be handled by the caller (especially on `CLIENT`\u002F`PRODUCER` spans), `DEBUG` for exceptions that don't indicate an actual issue (e.g., a request cancelled client-side), `FATAL` only when the exception causes application shutdown.\n- The log call **MUST** happen while the span it's associated with is still current — the spec requires \"exception events emitted by instrumentations that also record spans for the same operation MUST be associated with the corresponding span context.\" Logging from a detached error-reporting callback after the `using` activity scope has ended silently correlates to the wrong span, or none. See [Accessing Activities](#accessing-activities) below.\n- Only move to `logs`-only once you've held dual-emission for at least six months on a stable major version (the spec's own minimum) **and** confirmed your actual consumers read log-based exceptions — not on a fixed timeline alone.\n\nSee [traces-and-propagation-reference](traces-and-propagation-reference.md) for the full pattern, including how a library with no logging dependency in its core can still expose a callback so a separate OTel integration package can capture exception details while the right span is active.\n\n### Accessing Activities\n\n```csharp\nvar current = Activity.Current; \u002F\u002F ❌ may be a user-created ambient span\nusing var ownedActivity = ActivitySource.StartActivity(\"MyOperation\"); \u002F\u002F ✅ captured reference\nownedActivity?.SetTag(\"myapp.key\", value);\n```\n**Rules**: Do not rely on `Activity.Current` for spans you own; user code can replace it via `AsyncLocal`. Pass\u002Fstore captured `Activity` only while alive. Store `ActivityContext` for propagation identity.\n\n### Span Links\n\nLinks connect a span to other spans that are causally related but not in a direct parent-child relationship — batch processing, scatter\u002Fgather, trace boundary crossings.\n\n```csharp\nvar links = new List\u003CActivityLink>\n{\n    new(activityContext1),\n    new(activityContext2),\n};\n\nvar activity = ActivitySource.StartActivity(\n    ActivityKind.Internal, name: \"batch-process\", links: links);\n```\n\nSee [traces-and-propagation-reference.md](traces-and-propagation-reference.md) for full link patterns including batch processing, scatter\u002Fgather, and trace boundary crossing.\n\n### Context Propagation\n\nDistributed tracing requires propagating trace context across process boundaries (HTTP calls, message queues, etc.) using W3C `traceparent` headers. In .NET, this is handled by `DistributedContextPropagator`. The OTel SDK configures W3C TraceContext propagation by default.\n\nSee [traces-and-propagation-reference.md](traces-and-propagation-reference.md) for propagation patterns, custom propagators, and manual inject\u002Fextract for non-standard transports.\n\n## Metrics\n\n### Meter and Metrics Class Setup\n\n```csharp\npublic sealed class OrderProcessingMetrics : IDisposable\n{\n    private readonly Meter meter = new(\"MyApp.OrderProcessing\", \"1.0.0\");\n    private readonly Histogram\u003Cdouble> processingDuration =\n        meter.CreateHistogram\u003Cdouble>(\"myapp.order.processing.duration\", unit: \"s\");\n    private readonly Counter\u003Clong> itemsProcessed =\n        meter.CreateCounter\u003Clong>(\"myapp.order.processing.count\", unit: \"{order}\");\n\n    public void Dispose() => meter.Dispose();\n}\n```\n\n**Naming Conventions** (follow [OTel semantic conventions](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fsemconv\u002Fgeneral\u002Fmetrics\u002F)):\n- Singular names, nested hierarchy: `myapp.order.processing.duration`\n- Define units (s, ms, {item}, {connection}); avoid technical suffixes (`_counter`, `_histogram`)\n- Start with pre-1.0.0 version until adoption proven\n\n### Instrument Type Overview\n\n.NET provides 7 metric instrument types. Choose the right one for your measurement:\n\n| Instrument | .NET API | Behavior | Typical Use |\n|------------|---------|----------|-------------|\n| **Counter** | `CreateCounter\u003CT>` | Monotonically increasing | Request counts, error counts |\n| **UpDownCounter** | `CreateUpDownCounter\u003CT>` | Increases or decreases | Queue size, active connections |\n| **Histogram** | `CreateHistogram\u003CT>` | Distribution of values | Durations, response sizes |\n| **Gauge** | `CreateGauge\u003CT>` (.NET 9+) | Synchronous instant value | Current measurement recording |\n| **ObservableCounter** | `CreateObservableCounter\u003CT>` | Async callback, monotonic | Periodically polled totals |\n| **ObservableGauge** | `CreateObservableGauge\u003CT>` | Async callback, non-monotonic | CPU\u002Fmemory usage |\n| **ObservableUpDownCounter** | `CreateObservableUpDownCounter\u003CT>` | Async callback, bi-directional | Active tasks by priority |\n\nSee [metrics-and-instruments-reference.md](metrics-and-instruments-reference.md) for full creation\u002Frecording examples and observable callback patterns.\n\n### Metric Recording Method Naming\n\n```csharp\n\u002F\u002F ✅ Action\u002Foutcome-based naming, separate methods per outcome\npublic void OrderProcessingSucceeded(string orderType, TimeSpan duration) { \u002F* Record *\u002F }\npublic void OrderProcessingFailed(string orderType, Exception ex, TimeSpan duration) { \u002F* Record *\u002F }\npublic void ConnectionOpened() => connectionsOpen.Add(1);\npublic void ConnectionClosed() => connectionsOpen.Add(-1);\n\n\u002F\u002F ❌ WRONG: Name after metric, confusing signature\npublic void RecordOrderProcessingDuration(...) { } \u002F\u002F ❌ don't name after metric\npublic void RecordError(bool succeeded, Exception? ex) { } \u002F\u002F ❌ confusing signature\n```\n\n**Rules**:\n- Name after action\u002Foutcome (`OrderProcessingSucceeded`), NOT after metric (`RecordXxx`)\n- Separate methods per outcome (avoid boolean flags + optional exceptions)\n- Event-based naming for state changes: `ConnectionOpened()`, `ItemQueued()`\n\n### Metric Dimensions\n\n```csharp\n\u002F\u002F ✅ Low-cardinality, predefined dimensions\nprocessingDuration.Record(duration.TotalSeconds,\n    new KeyValuePair\u003Cstring, object?>(\"myapp.order_type\", orderType),  \u002F\u002F bounded set\n    new KeyValuePair\u003Cstring, object?>(\"outcome\", \"success\"));         \u002F\u002F bounded set\n\n\u002F\u002F ❌ High-cardinality: unbounded values cause cardinality explosion\nfailureCount.Add(1, new KeyValuePair\u003Cstring, object?>(\"order_id\", orderId)); \u002F\u002F ❌ unbounded\n```\n\n**Rules**:\n- Dimensions MUST be predefined and low-cardinality (item type, queue name, outcome)\n- Avoid unbounded values (each unique value = new time series row → cardinality explosion)\n- High-cardinality dimensions MUST be opt-in configuration\n- Consistent names across components: `myapp.region` means the same everywhere\n- Users can enable [exemplars](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Flanguages\u002Fdotnet\u002Fmetrics\u002Fexemplars\u002F) for trace correlation (not via dimensions)\n\n## Performance Requirements\n\nInstrumentation MUST be cheap by default. Follow these rules to minimize overhead:\n\n### Zero-Allocation Fast Path\n\n```csharp\n\u002F\u002F ✅ CORRECT: Guard with cheap checks\nif (ActivitySource.HasListeners())\n{\n    using var activity = ActivitySource.StartActivity(\"Operation\");\n    \u002F\u002F ... expensive work\n}\n\n\u002F\u002F ✅ CORRECT: Use TagList (struct) for metrics\nvar tags = new TagList\n{\n    { \"myapp.order_type\", orderType },\n    { \"outcome\", \"success\" }\n};\ncounter.Add(1, tags);\n```\n\n### Timing\n\n```csharp\n\u002F\u002F ✅ Timestamp math (no allocation)\nvar startTime = Stopwatch.GetTimestamp();\ntry { await ProcessAsync(); }\nfinally { var duration = Stopwatch.GetElapsedTime(startTime); metrics.OrderProcessingSucceeded(orderType, duration); }\n\n\u002F\u002F ❌ Allocates: Stopwatch.StartNew() or IDisposable timing wrappers\n```\n\n### Avoid Hidden Allocations\n\n```csharp\n\u002F\u002F ❌ Allocates: string interpolation without IsAllDataRequested guard\nactivity?.SetTag(\"item\", $\"Processing {itemId}\"); \u002F\u002F ❌\n\n\u002F\u002F ✅ Guard expensive work behind IsAllDataRequested\nif (activity?.IsAllDataRequested == true)\n    activity.SetTag(\"item\", $\"Processing {itemId}\");\n```\n\n**Rules**:\n- No `Stopwatch.StartNew()` (use `Stopwatch.GetTimestamp()`\u002F`GetElapsedTime`)\n- Prefer `TagList` (struct) over arrays\u002Fdictionaries\n- No LINQ, string interpolation, or async state machines in hot paths without guards\n\n## Testing Requirements\n\n### Span Tests\n\n```csharp\n[Test]\npublic async Task Should_create_processing_span_with_correct_parent()\n{\n    \u002F\u002F Arrange\n    using var parent = new Activity(\"Parent\").Start();\n\n    \u002F\u002F Act\n    await handler.Handle(item);\n\n    \u002F\u002F Assert\n    var processingSpan = recordedActivities.Single(a => a.OperationName == \"ProcessItem\");\n    Assert.AreEqual(parent.Id, processingSpan.ParentId);\n    Assert.AreEqual(\"myapp.item_type\", processingSpan.Tags.First().Key);\n}\n\n[Test]\npublic void Should_not_introduce_breaking_changes_to_span_names()\n{\n    \u002F\u002F Ensures string values in span names are under test\n    Assert.AreEqual(\"ProcessItem\", MyFeature.SpanName);\n}\n```\n\n**Rules**:\n- Test which spans activities connect to\n- Test string values (span names, tag names) to prevent breaking changes\n- Remember: telemetry is part of public API\n\n## Versioning\n\n- Telemetry versioning decoupled from package version\n- Use SemVer semantics\n- Traces and Metrics use separate versions (evolve independently)\n- Start with pre-1.0.0 version until adoption\u002Fusefulness proven\n\n```csharp\nprivate static readonly ActivitySource ActivitySource = new(\"MyApp.MyComponent\", \"0.9.0\");\nprivate readonly Meter meter = new(\"MyApp.MyComponent\", \"0.8.0\");\n```\n\n## Logs\n\n.NET logs integrate with OpenTelemetry through the built-in `ILogger` API. The OTel SDK provides `AddOpenTelemetry()` on the logging builder to collect, process, and export logs. Log records are automatically correlated with traces via `TraceId`\u002F`SpanId`.\n\nSee [sdk-resources-and-logs-reference.md](sdk-resources-and-logs-reference.md) for full logs integration patterns including correlation, redaction, structured logging, and severity filtering.\n\n## Reference Files\n\n- [traces-and-propagation-reference.md](traces-and-propagation-reference.md): SpanKind deep dive with examples, Span Links (batch, scatter\u002Fgather, trace boundary), Context Propagation (W3C traceparent, DistributedContextPropagator, custom propagators), Baggage, and the full modern exception recording pattern.\n- [metrics-and-instruments-reference.md](metrics-and-instruments-reference.md): All 7 metric instrument types with creation\u002Frecording code and when-to-use guidance, observable instrument callback patterns, dimensions deep dive, exemplars, aggregation defaults, and units.\n- [sdk-resources-and-logs-reference.md](sdk-resources-and-logs-reference.md): SDK initialization (ASP.NET Core + Console), Resource configuration (ResourceBuilder, AddService, AddDetector, custom detectors), Exporters (OTLP, Console, Jaeger, Zipkin, Prometheus), Instrumentation Libraries, Sampling (built-in, custom, env vars, head\u002Ftail-based), Logs integration (ILogger, correlation, redaction, structured logging), and environment variable configuration.\n\n## References\n\n- [OTel Specification Overview](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fotel\u002Foverview\u002F)\n- [OTel Semantic Conventions](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fsemconv\u002F)\n- [OTel Common Spec (AnyValue)](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fotel\u002Fcommon\u002F)\n- [OTel Tracing SDK Spec](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fotel\u002Ftrace\u002Fsdk\u002F)\n- [OTel Metrics SDK Spec](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fotel\u002Fmetrics\u002Fsdk\u002F)\n- [OTel Logs Spec](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fotel\u002Flogs\u002F)\n- [OTel Resource Spec](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fotel\u002Fresource\u002F)\n- [OTel Context Spec](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fotel\u002Fcontext\u002F)\n- [.NET Observability with OpenTelemetry (MS Learn)](https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fdotnet\u002Fcore\u002Fdiagnostics\u002Fobservability-with-otel)\n- [OTel .NET Manual Instrumentation](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Flanguages\u002Fdotnet\u002Finstrumentation\u002F)\n- [OTel .NET Metric Instruments](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Flanguages\u002Fdotnet\u002Fmetrics\u002Finstruments\u002F)\n- [OTel .NET Sampling](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Flanguages\u002Fdotnet\u002Fsampling\u002F)\n- [OTel .NET Zero-Code Instrumentation](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fzero-code\u002Fnet\u002F)","# OpenTelemetry .NET Instrumentation Skill\n\n## When to Use\n\n- Adding OpenTelemetry instrumentation to .NET code (traces, metrics, logs)\n- Creating or modifying ActivitySources, Meters, or ILogger usage\n- Setting up the OpenTelemetry SDK, resources, exporters, or sampling\n- Reviewing telemetry implementations for spec compliance\n- Optimizing instrumentation performance\n- Designing telemetry APIs that become part of the public surface\n- Implementing context propagation across service boundaries\n\n## Architecture: .NET Is Different\n\n**CRITICAL**: The .NET OpenTelemetry implementation is fundamentally different from other platforms. .NET provides tracing, metrics, and logging APIs **in the framework itself**.\nThat means **OTel does not provide a separate instrumentation API** — it uses the built-in .NET APIs and acts as the collection\u002Fexport layer.\n\n### The Three Built-in .NET APIs (Primary — Zero Dependencies)\n\n| Signal | .NET Framework API | Namespace |\n|--------|-------------------|-----------|\n| **Tracing** | `ActivitySource` \u002F `Activity` | `System.Diagnostics` |\n| **Metrics** | `Meter` \u002F `Counter\u003CT>` \u002F `Histogram\u003CT>` \u002F etc. | `System.Diagnostics.Metrics` |\n| **Logging** | `ILogger\u003CT>` | `Microsoft.Extensions.Logging` |\n\nThese are **the primary and only APIs** library authors should use for instrumentation.\nThey ship with the .NET runtime — **no NuGet packages required**.\n\n### The OTel Collection\u002FExport Layer (Secondary — Application Root Only)\n\nOTel NuGet packages are the **collection and export layer**, added only at the application\ncomposition root (not in libraries):\n\n| Package | Purpose | When to add |\n|---------|---------|-------------|\n| `OpenTelemetry.Extensions.Hosting` | DI integration for ASP.NET Core \u002F generic host | Application only |\n| `OpenTelemetry.Exporter.Console` | Console exporter (dev\u002Ftesting) | Application only |\n| `OpenTelemetry.Exporter.OpenTelemetryProtocol` | OTLP exporter (production) | Application only |\n| `OpenTelemetry.Exporter.Prometheus*` | Prometheus metrics endpoint | Application only |\n| `OpenTelemetry.Instrumentation.AspNetCore` | Auto-instrument ASP.NET Core requests | Application only |\n| `OpenTelemetry.Instrumentation.Http` | Auto-instrument HttpClient calls | Application only |\n| `OpenTelemetry.Instrumentation.SqlClient` | Auto-instrument SQL calls | Application only |\n\n### Package Decision Guide\n\n**Before adding ANY OpenTelemetry NuGet package, discuss the trade-off with the user:**\n\n> \"You're about to add an OTel NuGet package. Is this an application where you need to\n> export telemetry to an observability backend (Jaeger, Prometheus, OTLP collector)?\n> If you're writing a library, you likely need **zero** OTel packages — just use\n> `System.Diagnostics.ActivitySource` \u002F `System.Diagnostics.Metrics.Meter` and let the\n> consuming application configure the export pipeline. Do you want to proceed?\"\n\n**Library authors**: Add **nothing**. Use only `System.Diagnostics.*` and `ILogger`.\nThe consuming application wires up the SDK and exporters.\n\n**Application authors**: Add `OpenTelemetry.Extensions.Hosting` + the exporters and instrumentation libraries you need. See [sdk-resources-and-logs-reference.md](sdk-resources-and-logs-reference.md) for full setup patterns.\n\n**When Aspire ServiceDefaults, or any other composition root, already calls `UseOtlpExporter()`**: register your `ActivitySource` and `Meter` names there and add no exporter. Never add a per-signal `AddOtlpExporter()` beside it: OpenTelemetry .NET throws `NotSupportedException` when both are on one service collection, and the Aspire AppHost sets the OTLP endpoint that turns `UseOtlpExporter()` on, so the service fails at startup under the AppHost.\n\n**Never add** `OpenTelemetry.Api` to a library — `System.Diagnostics.*` IS the API.\n\nFor SDK setup, resource configuration, exporters, sampling, and logs integration, see [sdk-resources-and-logs-reference.md](sdk-resources-and-logs-reference.md).\n\n## Core Principles\n\n### Resiliency First\n**CRITICAL**: Exceptions in diagnostic\u002Ftracing\u002Fmetrics logic MUST NEVER impact application processing.\n- Assume Activity instances can be null. Always protect against null Activity references except in Activity extension methods (use `activity?.ExtensionMethod()`)\n- Guard all instrumentation code with appropriate null checks\n\n### API Surface Awareness\n- Any telemetry emitted becomes part of the public API surface\n- Changes are subject to breaking changes guidelines\n- Telemetry should be emitted by default (users opt-in to collection via OpenTelemetry extensions)\n- Exception: High-cardinality metric dimensions may require explicit opt-in\n\n### Standards Compliance\n- Follow Microsoft best practices for [distributed tracing instrumentation](https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fdotnet\u002Fcore\u002Fdiagnostics\u002Fdistributed-tracing-instrumentation-walkthroughs)\n- Follow [OpenTelemetry semantic conventions](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fsemconv\u002F)\n- Attribute values support: **string, boolean, double (IEEE 754), int64, byte arrays, and homogeneous arrays** of these primitive types. Null\u002Fempty values are valid and meaningful per the [OTel AnyValue spec](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fotel\u002Fcommon\u002F#anyvalue) — they MUST be stored and passed to exporters.\n- Attribute **keys** must be non-null, non-empty strings\n\n## Traces \u002F Spans (Activities)\n\n### ActivitySource Setup\n\n```csharp\n\u002F\u002F ✅ CORRECT: Use ActivitySource, not DiagnosticSource\npublic class MyFeature\n{\n    \u002F\u002F Primary ActivitySource - name typically matches the component or NuGet package name\n    private static readonly ActivitySource ActivitySource = new(\"MyApp.MyComponent\", \"1.0.0\");\n\n    \u002F\u002F Specialized ActivitySource for opt-in scenarios\n    private static readonly ActivitySource DetailedActivitySource = new(\"MyApp.MyComponent.Detailed\", \"1.0.0\");\n}\n```\n\n**Rules**:\n- Every component defines a primary `ActivitySource` for mainstream activities\n- Name typically matches the component or NuGet package (e.g., `\"MyCompany.MyLibrary\"`)\n- Version the ActivitySource using SemVer\n- Create separate `ActivitySource`s for specialized or opt-in scenarios. Use hierarchical source names, e.g. `MyCompany.MyLibrary` and `MyCompany.MyLibrary.Detailed`, so consuming applications can subscribe only to the sources they want via `AddSource(...)` and backends can filter by instrumentation scope.\n\n### Creating Activities\n\n```csharp\n\u002F\u002F ✅ Check HasListeners, null-check, then guard expensive work behind IsAllDataRequested\nif (ActivitySource.HasListeners())\n{\n    using var activity = ActivitySource.StartActivity(\"ProcessItem\", ActivityKind.Internal);\n    if (activity != null && activity.IsAllDataRequested)\n    {\n        activity.DisplayName = \"Processing order #12345\";\n        activity.SetTag(\"app.item_id\", itemId);\n        activity.SetTag(\"app.item_type\", itemType);\n    }\n}\n\n\u002F\u002F ❌ WRONG: Don't start activities in fire-and-forget tasks where the\n\u002F\u002F using scope ends before the async work completes (AsyncLocal context is lost)\nasync Task HelperAsync()\n{\n    using var activity = ActivitySource.StartActivity(\"Helper\");\n    _ = Task.Run(() => DoWorkAsync()); \u002F\u002F ❌ activity disposed before task completes\n}\n```\n\n**Rules**:\n- Check `ActivitySource.HasListeners()` before creating (zero-allocation fast path)\n- Always null-check Activity after creation (listener may filter or sample it out)\n- Never start activities in async helper methods (`Activity.Current` uses `AsyncLocal`)\n- Guard expensive tag computation behind `activity.IsAllDataRequested`\n- Use W3C TraceContext. .NET Core 3.0+ \u002F .NET 5+ uses it by default; older TFMs or .NET Framework apps may set `Activity.DefaultIdFormat = ActivityIdFormat.W3C` at startup and use `Activity.ForceDefaultIdFormat = true` to override hierarchical parents.\n\n### Activity Naming\n\n```csharp\n\u002F\u002F ✅ Unique operation name, friendly display name (null-check before accessing)\nusing var activity = ActivitySource.StartActivity(\n    name: \"ProcessItem\",              \u002F\u002F Unique, identifies class of spans\n    kind: ActivityKind.Internal\n);\nif (activity != null)\n    activity.DisplayName = \"Processing order #12345\"; \u002F\u002F User-friendly, can be specific\n\n\u002F\u002F ❌ WRONG: Don't include runtime data in operation name\nusing var badActivity = ActivitySource.StartActivity($\"Process_{itemId}\"); \u002F\u002F ❌\n```\n\n**Rules**:\n- Each span type has unique `OperationName` (identifies statistically interesting class of spans)\n- Operation name should NOT contain runtime data (only compile\u002Fconfig-time info)\n- Use human-readable `DisplayName` for specifics\n- Follow [OpenTelemetry span naming conventions](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fotel\u002Ftrace\u002Fapi\u002F#span)\n\n### SpanKind Selection\n\nChoose the correct `ActivityKind` to clarify the span's role in distributed tracing:\n\n| `ActivityKind` | OTel SpanKind | When to use |\n|----------------|---------------|-------------|\n| `Internal` | `INTERNAL` | Default — in-process operations not crossing a remote boundary |\n| `Server` | `SERVER` | Processing an incoming request\u002Fresponse call (HTTP server, gRPC server, RPC server) |\n| `Client` | `CLIENT` | Making an outgoing request\u002Fresponse call (HTTP client, database client, RPC call) |\n| `Producer` | `PRODUCER` | Enqueuing\u002Fpublishing deferred work (message queue publish, event emit, job enqueue) |\n| `Consumer` | `CONSUMER` | Dequeuing\u002Fprocessing deferred work (message queue receive, event handle, job dequeue) |\n\n**Rules**:\n- A single span SHOULD NOT serve more than one purpose\n- Create the outgoing span **before** injecting its `SpanContext` into the request. If you inject first, the parent's context propagates instead and the outgoing span ends up dangling (no connection to the downstream call).\n- See [traces-and-propagation-reference.md](traces-and-propagation-reference.md) for detailed SpanKind guidance with examples\n\n### Span Attributes (Tags)\n\n```csharp\n\u002F\u002F ✅ Application code: use your own namespace\nactivity?.SetTag(\"myapp.order_id\", orderId);\nactivity?.SetTag(\"myapp.payment.status\", \"confirmed\");\n\n\u002F\u002F ✅ Manual infrastructure instrumentation: use semantic conventions\n\u002F\u002F activity?.SetTag(\"db.system.name\", \"postgresql\"); \u002F\u002F custom database client\n\u002F\u002F activity?.SetTag(\"http.request.method\", \"GET\"); \u002F\u002F custom HTTP transport\n\n\u002F\u002F Values can be strings, numbers, booleans, or homogeneous arrays\nactivity?.SetTag(\"app.item_count\", 42);\nactivity?.SetTag(\"app.related_ids\", new int[] { 1, 2, 3 });\n\n\u002F\u002F ❌ WRONG: PascalCase, hyphen delimiter, plural, or unrelated namespace\nactivity?.SetTag(\"MyApp.OrderId\", orderId);     \u002F\u002F ❌ Wrong case\nactivity?.SetTag(\"myapp.order-id\", orderId);    \u002F\u002F ❌ Wrong delimiter\n```\n\n**Rules**:\n- Namespace prefix matching your component: `myapp.*`, `myapp.db.*`\n- All lowercase, underscore (`_`) delimiters, singular form\n- Attribute values: string, boolean, double, int64, byte arrays, homogeneous arrays (null\u002Fempty valid per [AnyValue spec](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fotel\u002Fcommon\u002F#anyvalue))\n- **Business\u002Fdomain attributes**: use your own namespace (`myapp.*`).\n- **HTTP, database, messaging, or RPC concepts you manually instrument**: use [semantic conventions](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fsemconv\u002F). Do not duplicate attributes already emitted by auto-instrumentation. Do not use OTel namespaces as prefixes for custom attributes.\n\n### Activity Status and Errors\n\n```csharp\ntry\n{\n    await ProcessItemAsync(); \u002F\u002F ✅ success: leave status Unset, do not call SetStatus(Ok) — see rules below\n}\ncatch (Exception ex)\n{\n    if (activity != null)\n    {\n        activity.SetStatus(ActivityStatusCode.Error, ex.Message); \u002F\u002F modern API\n        activity.SetTag(\"error.type\", ex.GetType().FullName);\n    }\n    throw;\n}\n```\n\n**Rules** (per [Recording Errors](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fsemconv\u002Fgeneral\u002Frecording-errors\u002F) and the [Set Status API spec](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fotel\u002Ftrace\u002Fapi\u002F#set-status)):\n- Leave span status **Unset** on success — do not call `SetStatus(ActivityStatusCode.Ok)`.\n- `Ok` is for application code, not instrumentation libraries. The trace API spec: \"Instrumentation Libraries SHOULD NOT set the status code to `Ok`, unless explicitly configured to do so (...) Application developers and Operators may set the status code to `Ok`\" — typically to override a library-reported `Error` they've decided isn't a real failure (e.g. suppressing a noisy 404). Once set, `Ok` is final; later calls are ignored.\"\n- On failure: **SHOULD** set `ActivityStatusCode.Error`, **SHOULD** set the `error.type` tag, **SHOULD** set the status description to the exception message.\n- Use `SetStatus` — legacy `otel.status_code`\u002F`otel.status_description` tags are no longer needed.\n- Do **not** record errors that were retried or handled and let the operation complete gracefully — `Error` status and `error.type` describe operations that failed, not ones that recovered.\n\n### Recording Exceptions — Keep Emitting Span Events, Add the Logs Opt-In\n\n`exceptions-spans` — the convention behind `Activity.AddEvent(new ActivityEvent(\"exception\", ...))` — carries a **Deprecated** status in favor of `exceptions-logs`, but the .NET ecosystem has not followed yet: no `OpenTelemetry.*` .NET package implements the spec's `OTEL_SEMCONV_EXCEPTION_SIGNAL_OPT_IN` opt-in (verified against `OpenTelemetry.Api` 1.17.0), and `OpenTelemetry.Instrumentation.AspNetCore` 1.17.0 itself still records exceptions via `Activity.AddException`, i.e. span events. That means the exporters, backends, and dashboards a typical .NET user has wired up today are built to read exception span events, not log-based exceptions. **Keep implementing span events as the default** — dropping them because the underlying spec document is marked Deprecated will silently break exception visibility for anyone still on today's tooling. Layer the newer logs-based path on top as an opt-in, exactly as the spec's own transition guidance describes for instrumentations moving off span events:\n\n```csharp\n\u002F\u002F Mirrors the spec's OTEL_SEMCONV_EXCEPTION_SIGNAL_OPT_IN values: unset\u002Fanything else → spans only (today's default), \"logs\u002Fdup\" → both, \"logs\" → logs only.\nprivate static readonly string? ExceptionSignalOptIn = Environment.GetEnvironmentVariable(\"OTEL_SEMCONV_EXCEPTION_SIGNAL_OPT_IN\");\nprivate static readonly bool EmitSpanEvents = ExceptionSignalOptIn != \"logs\";\nprivate static readonly bool EmitLogs = ExceptionSignalOptIn is \"logs\" or \"logs\u002Fdup\";\n\ntry\n{\n    await ProcessItemAsync();\n}\ncatch (Exception ex)\n{\n    activity?.SetStatus(ActivityStatusCode.Error, ex.Message);\n    activity?.SetTag(\"error.type\", ex.GetType().FullName);\n\n    if (EmitSpanEvents) \u002F\u002F ✅ default — what current .NET tooling and dashboards actually consume today\n    {\n        activity?.AddEvent(new ActivityEvent(\"exception\", tags: new ActivityTagsCollection\n        {\n            [\"exception.type\"] = ex.GetType().FullName,\n            [\"exception.message\"] = ex.Message,\n            [\"exception.stacktrace\"] = ex.ToString()\n        }));\n    }\n\n    if (EmitLogs) \u002F\u002F opt-in — the spec's forward direction; pass the exception instance while `activity` is still Activity.Current so the SDK derives trace_id\u002Fspan_id and exception.type\u002Fmessage\u002Fstacktrace from it\n    {\n        logger.LogError(ex, \"Item processing failed\");\n    }\n\n    throw;\n}\n```\n\n**Rules**:\n- Don't set `exception.escaped` on the span event — it's deprecated outright: \"no longer recommended to record exceptions that are handled and do not escape the scope of a span.\"\n- Support `OTEL_SEMCONV_EXCEPTION_SIGNAL_OPT_IN` (`logs` \u002F `logs\u002Fdup`) so consumers who are ready can opt into logs or dual-emission, but default to spans-only — this is the spec's own transition guidance, not an optional nicety, and it exists precisely so nobody has to choose one signal over the other before they're ready.\n- When emitting logs (opt-in or dual), pick severity per `exceptions-logs`: `ERROR` for unhandled exceptions (especially on `SERVER`\u002F`CONSUMER` spans), `WARN` for exceptions expected to be handled by the caller (especially on `CLIENT`\u002F`PRODUCER` spans), `DEBUG` for exceptions that don't indicate an actual issue (e.g., a request cancelled client-side), `FATAL` only when the exception causes application shutdown.\n- The log call **MUST** happen while the span it's associated with is still current — the spec requires \"exception events emitted by instrumentations that also record spans for the same operation MUST be associated with the corresponding span context.\" Logging from a detached error-reporting callback after the `using` activity scope has ended silently correlates to the wrong span, or none. See [Accessing Activities](#accessing-activities) below.\n- Only move to `logs`-only once you've held dual-emission for at least six months on a stable major version (the spec's own minimum) **and** confirmed your actual consumers read log-based exceptions — not on a fixed timeline alone.\n\nSee [traces-and-propagation-reference](traces-and-propagation-reference.md) for the full pattern, including how a library with no logging dependency in its core can still expose a callback so a separate OTel integration package can capture exception details while the right span is active.\n\n### Accessing Activities\n\n```csharp\nvar current = Activity.Current; \u002F\u002F ❌ may be a user-created ambient span\nusing var ownedActivity = ActivitySource.StartActivity(\"MyOperation\"); \u002F\u002F ✅ captured reference\nownedActivity?.SetTag(\"myapp.key\", value);\n```\n**Rules**: Do not rely on `Activity.Current` for spans you own; user code can replace it via `AsyncLocal`. Pass\u002Fstore captured `Activity` only while alive. Store `ActivityContext` for propagation identity.\n\n### Span Links\n\nLinks connect a span to other spans that are causally related but not in a direct parent-child relationship — batch processing, scatter\u002Fgather, trace boundary crossings.\n\n```csharp\nvar links = new List\u003CActivityLink>\n{\n    new(activityContext1),\n    new(activityContext2),\n};\n\nvar activity = ActivitySource.StartActivity(\n    ActivityKind.Internal, name: \"batch-process\", links: links);\n```\n\nSee [traces-and-propagation-reference.md](traces-and-propagation-reference.md) for full link patterns including batch processing, scatter\u002Fgather, and trace boundary crossing.\n\n### Context Propagation\n\nDistributed tracing requires propagating trace context across process boundaries (HTTP calls, message queues, etc.) using W3C `traceparent` headers. In .NET, this is handled by `DistributedContextPropagator`. The OTel SDK configures W3C TraceContext propagation by default.\n\nSee [traces-and-propagation-reference.md](traces-and-propagation-reference.md) for propagation patterns, custom propagators, and manual inject\u002Fextract for non-standard transports.\n\n## Metrics\n\n### Meter and Metrics Class Setup\n\n```csharp\npublic sealed class OrderProcessingMetrics : IDisposable\n{\n    private readonly Meter meter = new(\"MyApp.OrderProcessing\", \"1.0.0\");\n    private readonly Histogram\u003Cdouble> processingDuration =\n        meter.CreateHistogram\u003Cdouble>(\"myapp.order.processing.duration\", unit: \"s\");\n    private readonly Counter\u003Clong> itemsProcessed =\n        meter.CreateCounter\u003Clong>(\"myapp.order.processing.count\", unit: \"{order}\");\n\n    public void Dispose() => meter.Dispose();\n}\n```\n\n**Naming Conventions** (follow [OTel semantic conventions](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fsemconv\u002Fgeneral\u002Fmetrics\u002F)):\n- Singular names, nested hierarchy: `myapp.order.processing.duration`\n- Define units (s, ms, {item}, {connection}); avoid technical suffixes (`_counter`, `_histogram`)\n- Start with pre-1.0.0 version until adoption proven\n\n### Instrument Type Overview\n\n.NET provides 7 metric instrument types. Choose the right one for your measurement:\n\n| Instrument | .NET API | Behavior | Typical Use |\n|------------|---------|----------|-------------|\n| **Counter** | `CreateCounter\u003CT>` | Monotonically increasing | Request counts, error counts |\n| **UpDownCounter** | `CreateUpDownCounter\u003CT>` | Increases or decreases | Queue size, active connections |\n| **Histogram** | `CreateHistogram\u003CT>` | Distribution of values | Durations, response sizes |\n| **Gauge** | `CreateGauge\u003CT>` (.NET 9+) | Synchronous instant value | Current measurement recording |\n| **ObservableCounter** | `CreateObservableCounter\u003CT>` | Async callback, monotonic | Periodically polled totals |\n| **ObservableGauge** | `CreateObservableGauge\u003CT>` | Async callback, non-monotonic | CPU\u002Fmemory usage |\n| **ObservableUpDownCounter** | `CreateObservableUpDownCounter\u003CT>` | Async callback, bi-directional | Active tasks by priority |\n\nSee [metrics-and-instruments-reference.md](metrics-and-instruments-reference.md) for full creation\u002Frecording examples and observable callback patterns.\n\n### Metric Recording Method Naming\n\n```csharp\n\u002F\u002F ✅ Action\u002Foutcome-based naming, separate methods per outcome\npublic void OrderProcessingSucceeded(string orderType, TimeSpan duration) { \u002F* Record *\u002F }\npublic void OrderProcessingFailed(string orderType, Exception ex, TimeSpan duration) { \u002F* Record *\u002F }\npublic void ConnectionOpened() => connectionsOpen.Add(1);\npublic void ConnectionClosed() => connectionsOpen.Add(-1);\n\n\u002F\u002F ❌ WRONG: Name after metric, confusing signature\npublic void RecordOrderProcessingDuration(...) { } \u002F\u002F ❌ don't name after metric\npublic void RecordError(bool succeeded, Exception? ex) { } \u002F\u002F ❌ confusing signature\n```\n\n**Rules**:\n- Name after action\u002Foutcome (`OrderProcessingSucceeded`), NOT after metric (`RecordXxx`)\n- Separate methods per outcome (avoid boolean flags + optional exceptions)\n- Event-based naming for state changes: `ConnectionOpened()`, `ItemQueued()`\n\n### Metric Dimensions\n\n```csharp\n\u002F\u002F ✅ Low-cardinality, predefined dimensions\nprocessingDuration.Record(duration.TotalSeconds,\n    new KeyValuePair\u003Cstring, object?>(\"myapp.order_type\", orderType),  \u002F\u002F bounded set\n    new KeyValuePair\u003Cstring, object?>(\"outcome\", \"success\"));         \u002F\u002F bounded set\n\n\u002F\u002F ❌ High-cardinality: unbounded values cause cardinality explosion\nfailureCount.Add(1, new KeyValuePair\u003Cstring, object?>(\"order_id\", orderId)); \u002F\u002F ❌ unbounded\n```\n\n**Rules**:\n- Dimensions MUST be predefined and low-cardinality (item type, queue name, outcome)\n- Avoid unbounded values (each unique value = new time series row → cardinality explosion)\n- High-cardinality dimensions MUST be opt-in configuration\n- Consistent names across components: `myapp.region` means the same everywhere\n- Users can enable [exemplars](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Flanguages\u002Fdotnet\u002Fmetrics\u002Fexemplars\u002F) for trace correlation (not via dimensions)\n\n## Performance Requirements\n\nInstrumentation MUST be cheap by default. Follow these rules to minimize overhead:\n\n### Zero-Allocation Fast Path\n\n```csharp\n\u002F\u002F ✅ CORRECT: Guard with cheap checks\nif (ActivitySource.HasListeners())\n{\n    using var activity = ActivitySource.StartActivity(\"Operation\");\n    \u002F\u002F ... expensive work\n}\n\n\u002F\u002F ✅ CORRECT: Use TagList (struct) for metrics\nvar tags = new TagList\n{\n    { \"myapp.order_type\", orderType },\n    { \"outcome\", \"success\" }\n};\ncounter.Add(1, tags);\n```\n\n### Timing\n\n```csharp\n\u002F\u002F ✅ Timestamp math (no allocation)\nvar startTime = Stopwatch.GetTimestamp();\ntry { await ProcessAsync(); }\nfinally { var duration = Stopwatch.GetElapsedTime(startTime); metrics.OrderProcessingSucceeded(orderType, duration); }\n\n\u002F\u002F ❌ Allocates: Stopwatch.StartNew() or IDisposable timing wrappers\n```\n\n### Avoid Hidden Allocations\n\n```csharp\n\u002F\u002F ❌ Allocates: string interpolation without IsAllDataRequested guard\nactivity?.SetTag(\"item\", $\"Processing {itemId}\"); \u002F\u002F ❌\n\n\u002F\u002F ✅ Guard expensive work behind IsAllDataRequested\nif (activity?.IsAllDataRequested == true)\n    activity.SetTag(\"item\", $\"Processing {itemId}\");\n```\n\n**Rules**:\n- No `Stopwatch.StartNew()` (use `Stopwatch.GetTimestamp()`\u002F`GetElapsedTime`)\n- Prefer `TagList` (struct) over arrays\u002Fdictionaries\n- No LINQ, string interpolation, or async state machines in hot paths without guards\n\n## Testing Requirements\n\n### Span Tests\n\n```csharp\n[Test]\npublic async Task Should_create_processing_span_with_correct_parent()\n{\n    \u002F\u002F Arrange\n    using var parent = new Activity(\"Parent\").Start();\n\n    \u002F\u002F Act\n    await handler.Handle(item);\n\n    \u002F\u002F Assert\n    var processingSpan = recordedActivities.Single(a => a.OperationName == \"ProcessItem\");\n    Assert.AreEqual(parent.Id, processingSpan.ParentId);\n    Assert.AreEqual(\"myapp.item_type\", processingSpan.Tags.First().Key);\n}\n\n[Test]\npublic void Should_not_introduce_breaking_changes_to_span_names()\n{\n    \u002F\u002F Ensures string values in span names are under test\n    Assert.AreEqual(\"ProcessItem\", MyFeature.SpanName);\n}\n```\n\n**Rules**:\n- Test which spans activities connect to\n- Test string values (span names, tag names) to prevent breaking changes\n- Remember: telemetry is part of public API\n\n## Versioning\n\n- Telemetry versioning decoupled from package version\n- Use SemVer semantics\n- Traces and Metrics use separate versions (evolve independently)\n- Start with pre-1.0.0 version until adoption\u002Fusefulness proven\n\n```csharp\nprivate static readonly ActivitySource ActivitySource = new(\"MyApp.MyComponent\", \"0.9.0\");\nprivate readonly Meter meter = new(\"MyApp.MyComponent\", \"0.8.0\");\n```\n\n## Logs\n\n.NET logs integrate with OpenTelemetry through the built-in `ILogger` API. The OTel SDK provides `AddOpenTelemetry()` on the logging builder to collect, process, and export logs. Log records are automatically correlated with traces via `TraceId`\u002F`SpanId`.\n\nSee [sdk-resources-and-logs-reference.md](sdk-resources-and-logs-reference.md) for full logs integration patterns including correlation, redaction, structured logging, and severity filtering.\n\n## Reference Files\n\n- [traces-and-propagation-reference.md](traces-and-propagation-reference.md): SpanKind deep dive with examples, Span Links (batch, scatter\u002Fgather, trace boundary), Context Propagation (W3C traceparent, DistributedContextPropagator, custom propagators), Baggage, and the full modern exception recording pattern.\n- [metrics-and-instruments-reference.md](metrics-and-instruments-reference.md): All 7 metric instrument types with creation\u002Frecording code and when-to-use guidance, observable instrument callback patterns, dimensions deep dive, exemplars, aggregation defaults, and units.\n- [sdk-resources-and-logs-reference.md](sdk-resources-and-logs-reference.md): SDK initialization (ASP.NET Core + Console), Resource configuration (ResourceBuilder, AddService, AddDetector, custom detectors), Exporters (OTLP, Console, Jaeger, Zipkin, Prometheus), Instrumentation Libraries, Sampling (built-in, custom, env vars, head\u002Ftail-based), Logs integration (ILogger, correlation, redaction, structured logging), and environment variable configuration.\n\n## References\n\n- [OTel Specification Overview](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fotel\u002Foverview\u002F)\n- [OTel Semantic Conventions](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fsemconv\u002F)\n- [OTel Common Spec (AnyValue)](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fotel\u002Fcommon\u002F)\n- [OTel Tracing SDK Spec](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fotel\u002Ftrace\u002Fsdk\u002F)\n- [OTel Metrics SDK Spec](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fotel\u002Fmetrics\u002Fsdk\u002F)\n- [OTel Logs Spec](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fotel\u002Flogs\u002F)\n- [OTel Resource Spec](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fotel\u002Fresource\u002F)\n- [OTel Context Spec](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fotel\u002Fcontext\u002F)\n- [.NET Observability with OpenTelemetry (MS Learn)](https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fdotnet\u002Fcore\u002Fdiagnostics\u002Fobservability-with-otel)\n- [OTel .NET Manual Instrumentation](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Flanguages\u002Fdotnet\u002Finstrumentation\u002F)\n- [OTel .NET Metric Instruments](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Flanguages\u002Fdotnet\u002Fmetrics\u002Finstruments\u002F)\n- [OTel .NET Sampling](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Flanguages\u002Fdotnet\u002Fsampling\u002F)\n- [OTel .NET Zero-Code Instrumentation](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fzero-code\u002Fnet\u002F)",{"name":5,"description":7},"master","b30b1c1908dbc56a8184128f18803053d762ccb5","codex\u002Fdeniz-dotnet-general\u002Fskills\u002Fopentelemetry-net-instrumentation",0,"https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins","https:\u002F\u002Fgithub.com\u002FBlind-Striker","denizirgin.com","VP of Engineering - \r\n@armutcom @homeruntech @prontopro\r\n |  Speaker \r\n@CodeFiction\r\n, http:\u002F\u002Fcodefiction.tech | Developer, gamer, blogger, maiden iron fan","2026-11-13 00:23:18",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add Blind-Striker\u002Fagent-skills-and-plugins --skill opentelemetry-net-instrumentation",{"tool":39,"command":40},"bunx","bunx skills add Blind-Striker\u002Fagent-skills-and-plugins --skill opentelemetry-net-instrumentation",{"tool":42,"command":43},"pnpm","pnpm dlx skills add Blind-Striker\u002Fagent-skills-and-plugins --skill opentelemetry-net-instrumentation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fcodex\u002Fdeniz-dotnet-general\u002Fskills\u002Fopentelemetry-net-instrumentation\u002FSKILL.md",true,[47,53,57],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"metrics-and-instruments-reference.md","REFERENCE","参考文档",19304,"https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fcodex\u002Fdeniz-dotnet-general\u002Fskills\u002Fopentelemetry-net-instrumentation\u002Fmetrics-and-instruments-reference.md",{"path":54,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":55,"sourceHtmlUrl":56},"sdk-resources-and-logs-reference.md",26973,"https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fcodex\u002Fdeniz-dotnet-general\u002Fskills\u002Fopentelemetry-net-instrumentation\u002Fsdk-resources-and-logs-reference.md",{"path":58,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":59,"sourceHtmlUrl":60},"traces-and-propagation-reference.md",40104,"https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fcodex\u002Fdeniz-dotnet-general\u002Fskills\u002Fopentelemetry-net-instrumentation\u002Ftraces-and-propagation-reference.md",[62,69,76,83,90,97],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M79YGWBJ52PHMSTKJ3RJ3AWR","writing-tunit-tests","Write tests in TUnit — the attributes, the async assertion model, data-driven cases, lifecycle hooks, and the parallelism rules. USE FOR writing or fixing a test in a TUnit project, translating a test idea into TUnit syntax, or reviewing TUnit test code for API mistakes. DO NOT USE FOR deciding what to test, judging whether a test is any good, or running tests.","https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fskills\u002Fdeniz-dotnet-general\u002Fwriting-tunit-tests\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M79YGR3Y9RCRS6TD71D0KKP8","dotnet-walls","Walls for a .NET change in a repository without its own quality gates — pinned, ephemeral analyzer, format, clone and scanner commands for the verify step, their identity ratchet, and the build traps. Use during a walls preflight, or when a worker's verify step needs .NET quality gates.","https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fskills\u002Fdeniz-dotnet-general\u002Fdotnet-walls\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M79YGFNJBST7D803NQW3SBYM","csharp-15","Write, review and modernize C# 15 (.NET 11) code correctly. Covers every C# 15 feature - collection expression arguments (`[with(...), ...]`), union types (`union`, `[Union]`, `IUnion`, custom unions), closed class hierarchies (`closed`), extension indexers, labeled `break`\u002F`continue`, non-virtual static interface members on runtimes without default interface methods, and the preview memory-safety model (`unsafe(expr)`, `safe`, requires-unsafe members). Use when code targets net11.0 or LangVersion 15\u002Fpreview, when the user mentions any of these features, when replacing marker interfaces, OneOf-style results, `goto`\u002Fflag loop exits or capacity\u002Fcomparer boilerplate, or when the build reports CS8121, CS8509, CS8655, CS8510, CS0121\u002FCS0411 on a `with(...)` element, CS9370, CS9380 or CS9363.","https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fskills\u002Fdeniz-dotnet-general\u002Fcsharp-15\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M79YGAV031473HSX6FN87ENH","verified-waves","Run one task as verified multi-agent waves. Plans the fan-out, sends findings to fresh skeptics, keeps a ledger, and reports N of M done; small tasks stay solo.","https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fskills\u002Fdeniz-coordination\u002Fverified-waves\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M79YG6QXNND4WRPP3GATSY8J","harness","The bundled dispatch harness, which runs a task file on worker models through OpenCode or Codex, fences their writes, escalates their asks to the operator, settles each result from git and its verify commands, and records every step in a ledger. Its commands, task file, modes and write fence, configuration, runs and their recovery, ledger and exit codes.","https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fskills\u002Fdeniz-coordination\u002Fharness\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":19},"01M79YG2P5S91SDTA5912XJ4FV","delegating-to-worker-models","Use when you hand off implementation, a plan, research a decision will rely on, or a review, and you brief the worker and check what comes back. A subagent that searches, reads in parallel, or keeps your context small is ordinary tool use. Covers what stays with you, the mechanism, assigning work by strength, the walls preflight, prompts without contradictions, the worker contract and model profiles, evidence from your own run, review, and the fix-up loop.","https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fskills\u002Fdeniz-coordination\u002Fdelegating-to-worker-models\u002FSKILL.md",[],[]]